var Fusion={singleFile:true};var Jx={};Object.inheritFrom=function(A,D,B){var C;if(typeof D=="function"){C=D.prototype}else{C=D}for(property in C){if(typeof A[property]=="undefined"){A[property]=C[property]}}if(C.initialize){C.initialize.apply(A,B)}};(function(){var singleFile=(typeof Fusion=="object"&&Fusion.singleFile);window.Fusion={Tool:{},Widget:{},Event:{lastEventId:1},Lib:{},Layers:{},Constant:{},applicationDefinition:null,sConfigFileURL:"",sWebAgentURL:"",sWebTierURL:"",sRedirectScript:"",bForceRedirect:false,sScriptLang:"",locale:"en",Strings:{},fusionURL:null,configuration:null,oBroker:null,aScripts:[],aLoadingScripts:[],loadState:null,UNLOADED:0,LOAD_CONFIG:1,LOAD_WIDGETS:2,LOAD_COMPLETE:3,UNKNOWN:0,INCHES:1,FEET:2,YARDS:3,MILES:4,NAUTICALMILES:5,MILLIMETERS:6,CENTIMETERS:7,METERS:8,KILOMETERS:9,DEGREES:10,DECIMALDEGREES:11,DMS:12,PIXELS:13,aUnitPerMeter:[1,39.37,3.2808,1.0936133,0.00062137,0.000539956803,1000,100,1,0.001,0.000009044,0.000009044,0.000009044,1],aMeterPerUnit:[1,0.0254,0.3048,0.9144,1609.344,1852,0.001,0.01,1,1000,111061.75033,111061.75033,111061.75033,1],aUnitNames:["Unknown","Inches","Feet","Yards","Miles","Nautical Miles","Millimeters","Centimeters","Meters","Kilometers","Degrees","Decimal Degrees","Degrees Minutes Seconds","Pixels"],aUnitAbbr:["unk","in","ft","yd","mi","nm","mm","cm","m","km","&deg;","&deg;","&deg;","px"],initialize:function(options){options=options||{};var sessionIdParam=this.getQueryParam("Session");this.sessionId=sessionIdParam||options.sessionId||this.sessionId;if(options.applicationDefinitionURL){this.applicationDefinitionURL=options.applicationDefinitionURL}else{var queryAppDef=this.getQueryParam("ApplicationDefinition");if(queryAppDef){this.applicationDefinitionURL=queryAppDef.split("+").join(" ");this.appDefJson=null}else{this.applicationDefinitionURL="ApplicationDefinition.xml"}}if(Fusion._singleFile){OpenLayers._getScriptLocation=function(){return Fusion.fusionURL+"lib/OpenLayers/"}}this.initializeLocale();this.sWebagentURL="";this.sScriptLang="";var test=window.location.protocol+"//"+window.location.host;var configUrl="config.json";if(((this.fusionURL.indexOf("http://")<0)||(this.fusionURL.indexOf(test,0)==0))&&!(this.bForceRedirect)){this.sRedirectScript=""}else{this.sRedirectScript="redirect.php";configUrl+="&method=get"}this.sScriptLang="php";if(Fusion.configuration){this.serverSet()}else{var options={onSuccess:OpenLayers.Function.bind(this.getConfigCB,this),onFailure:OpenLayers.Function.bind(this.serverFailed,this),method:"get"};this.ajaxRequest(configUrl,options)}},initializeLocale:function(locale){OpenLayers.Lang.setCode(locale?locale:window._FusionLocale);this.locale=OpenLayers.Lang.code;if(!OpenLayers.Lang[this.locale]){OpenLayers.Lang[this.locale]=OpenLayers.Lang[OpenLayers.Lang.defaultCode]}if(!Fusion.Strings[this.locale]){Fusion.Strings[this.locale]=Fusion.Strings[OpenLayers.Lang.defaultCode]}OpenLayers.Util.extend(OpenLayers.Lang[this.locale],Fusion.Strings[this.locale])},setLoadState:function(state){this.loadState=state;switch(state){case this.LOAD_CONFIG:this.loadConfig();break;case this.LOAD_WIDGETS:this.loadQueuedScripts();break;case this.LOAD_COMPLETE:if(this.applicationDefinition){this.applicationDefinition.create();this.triggerEvent(Fusion.Event.FUSION_INITIALIZED)}else{Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,"failed to create AppDef object"))}break}},loadQueuedScripts:function(){if(this.aScripts.length==0){this.setLoadState(this.LOAD_COMPLETE);return }this.aLoadingScripts=[];for(var i=0;i<this.aScripts.length;i++){this.aLoadingScripts[i]=this.aScripts[i]}this.aScripts=[];for(var i=0;i<this.aLoadingScripts.length;i++){document.getElementsByTagName("head")[0].appendChild(this.aLoadingScripts[i])}this.checkLoadInterval=window.setInterval(OpenLayers.Function.bind(this.checkLoadingScripts,this),500)},queueScript:function(url){if(!document.getElementById(url)&&!this.aScripts[url]){var script=document.createElement("script");script.defer=false;script.type="text/javascript";script.id=url;script.src=this.getFusionURL()+url;script.onload=OpenLayers.Function.bind(this.scriptLoaded,this,url);script.onerror=OpenLayers.Function.bind(this.scriptFailed,this,script.src);this.aScripts[url]=script;this.aScripts.push(script)}},scriptFailed:function(url){Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("scriptFailed",{script:url})))},scriptLoaded:function(url){for(var i=0;i<this.aLoadingScripts.length;i++){if(this.aLoadingScripts[i].id==url){this.aLoadingScripts.splice(i,1)}}if(this.aLoadingScripts.length==0){window.clearInterval(this.checkLoadInterval);if(this.aScripts.length>0){this.loadQueuedScripts()}else{this.setLoadState(this.LOAD_COMPLETE)}}},checkLoadingScripts:function(){var agt=navigator.userAgent.toLowerCase();for(var i=this.aLoadingScripts.length-1;i>=0;i--){var s=this.aLoadingScripts[i];if(agt.indexOf("safari")!=-1){var widgetName=s.id.substring(s.id.lastIndexOf("/")+1,s.id.indexOf(".js"));var b;eval("b = typeof Fusion.Widget."+widgetName+' == "function";');if(b){this.scriptLoaded(s.id)}}else{if(s.readyState=="loaded"||s.readyState=="complete"){this.scriptLoaded(s.id)}}}},loadConfig:function(){var mapAgentUrl=this.getConfigurationItem("mapguide","mapAgentUrl");if(mapAgentUrl){this.oBroker=new Fusion.Lib.MGBroker();var url=mapAgentUrl;if(this.sRedirectScript){url=this.sRedirectScript+"?s="+url;this.oBroker.method="post"}else{this.oBroker.method="get"}this.oBroker.setSiteURL(url,"Anonymous","")}this.applicationDefinition=new Fusion.Lib.ApplicationDefinition(this.sessionId);if(Fusion.appDefJson){Fusion.setLoadState(Fusion.LOAD_WIDGETS)}},getConfigCB:function(r){if(r.responseText){eval("this.configuration="+r.responseText);this.serverSet()}else{alert(OpenLayers.i18n("configParseError"))}},serverSet:function(){var s=this.configuration.mapguide.webTierUrl;if(s){var nLength=s.length;var slastChar=s.charAt((nLength-1));if(slastChar!="/"){s=s+"/"}}else{var idx=this.fusionURL.lastIndexOf("fusion");if(idx==-1){s=this.fusionURL+"../"}else{s=this.fusionURL.substring(0,idx)}}this.configuration.mapguide.webTierUrl=s;this.configuration.mapguide.mapAgentUrl=s+"mapagent/mapagent.fcgi";this.setLoadState(this.LOAD_CONFIG)},serverFailed:function(r){alert(OpenLayers.i18n("configLoadError"))},ajaxRequest:function(scriptURL,options){var r=this.getRedirectScript();if(r!=""){r=r+"?s="}var url=r+this.getFusionURL()+scriptURL;if(!options.onException){options.onException=OpenLayers.Function.bind(this.ajaxException,this)}if(!options.contentType){options.contentType="application/x-www-form-urlencoded"}if(options.parameters&&typeof options.parameters=="string"){if(options.parameters.indexOf("?")<0){options.parameters="?"+options.parameters}}var temp=new OpenLayers.Ajax.Request(url,options)},ajaxException:function(r,e){this.reportError(new Fusion.Error(Fusion.Error.WARNING,OpenLayers.i18n("ajaxError",{exception:e.message,filename:e.fileName,line:e.lineNumber,response:r.transport.responseText})))},getXmlAsJson:function(url,callback){var options={method:"get",onSuccess:OpenLayers.Function.bind(this.xml2json,this,callback),onFailure:OpenLayers.Function.bind(this.ajaxException,this)};var temp=new OpenLayers.Ajax.Request(url,options)},xml2json:function(callback,r,json){if(json){var o;eval("o="+r.responseText);callback(o)}else{if(r.status>=400){var msg=r.transport.responseText;if(msg==""){msg=OpenLayers.i18n("serverNotAvailable")}Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("invalidXMLDocument",{msg:msg,url:r.request.url})));return }var options={onSuccess:callback,method:"post",parameters:{xml:encodeURIComponent(r.responseText)}};var sl=Fusion.getScriptLanguage();Fusion.ajaxRequest("common/"+sl+"/Xml2JSON."+sl,options)}},getMapByName:function(name){var map=null;if(this.applicationDefinition){map=this.applicationDefinition.getMapByName(name)}return map},getMapById:function(id){var map=null;if(this.applicationDefinition){map=this.applicationDefinition.getMapById(id)}return map},getMapByIndice:function(indice){var map=null;if(this.applicationDefinition){map=this.applicationDefinition.getMapByIndice(indice)}return map},getWidgetById:function(id){var d=$(id);if(d&&d.widget){return d.widget}else{return null}},getWidgetsByType:function(type){var widgets=[];if(this.applicationDefinition){widgets=this.applicationDefinition.getWidgetsByType(type)}return widgets},getSearchDefinitions:function(){if(this.applicationDefinition){return this.applicationDefinition.searchDefinitions}else{return{}}},getSearchCategories:function(){if(this.applicationDefinition){return this.applicationDefinition.searchCategories}else{return{}}},getApplicationDefinitionURL:function(){return this.applicationDefinitionURL},getApplicationURL:function(){var path=window.location.pathname;var idx=path.lastIndexOf("/");if(idx>=0){path=path.substr(0,idx+1)}return window.location.protocol+"//"+window.location.host+path},getFusionURL:function(){return this.fusionURL},getConfigurationItem:function(arch,key){if(this.configuration[arch]&&(this.configuration[arch][key]!="undefined")){return this.configuration[arch][key]}return null},getScriptLanguage:function(){return this.configuration.general.scriptLanguage},getRedirectScript:function(){return this.sRedirectScript},getBroker:function(){return this.oBroker},require:function(url){this.queueScript(url)},reportError:function(o){this.triggerEvent(Fusion.Event.FUSION_ERROR,o)},unitFromName:function(unit){switch(unit.toLowerCase()){case"unknown":return Fusion.UNKNOWN;case"inches":case"inch":case"in":return Fusion.INCHES;case"feet":case"ft":return Fusion.FEET;case"yards":case"yard":case"yd":return Fusion.YARDS;case"miles":case"mile":case"mi":return Fusion.MILES;case"nautical miles":case"nautical mile":case"nm":return Fusion.NAUTICALMILES;case"millimeters":case"millimeter":case"mm":return Fusion.MILLIMETERS;case"centimeters":case"centimeter":case"cm":return Fusion.CENTIMETERS;case"meters":case"meter":case"m":return Fusion.METERS;case"kilometers":case"kilometer":case"km":return Fusion.KILOMETERS;case"degrees":case"degree":case"deg":return Fusion.DEGREES;case"decimal degrees":case"dd":return Fusion.DECIMALDEGREES;case"degrees minutes seconds":case"dms":return Fusion.DMS;case"pixels":case"pixel":case"px":return Fusion.PIXELS;default:return Fusion.UNKNOWN}},unitSystem:function(unit){switch(unit){case Fusion.INCHES:case Fusion.FEET:case Fusion.YARDS:case Fusion.MILES:case Fusion.NAUTICALMILES:return"imperial";case Fusion.MILLIMETERS:case Fusion.CENTIMETERS:case Fusion.METERS:case Fusion.KILOMETERS:return"metric";case Fusion.DEGREES:case Fusion.DECIMALDEGREES:case Fusion.DMS:return"deg";case Fusion.UNKNOWN:case Fusion.PIXELS:default:return"device"}},unitName:function(unit){if(unit>=Fusion.UNKNOWN&&unit<=Fusion.PIXELS){return(Fusion.aUnitNames[unit])}return"Unknown"},unitAbbr:function(unit){if(unit>=Fusion.UNKNOWN&&unit<=Fusion.PIXELS){return(Fusion.aUnitAbbr[unit])}return"Unk"},toMeter:function(unit,value){if(unit==Fusion.UNKNOWN){return value}if(unit>Fusion.UNKNOWN&&unit<Fusion.PIXELS){return(Fusion.aMeterPerUnit[unit]*value)}return false},fromMeter:function(unit,value){if(unit==Fusion.UNKNOWN){return value}if(unit>Fusion.UNKNOWN&&unit<Fusion.PIXELS){return(Fusion.aUnitPerMeter[unit]*value)}return false},convert:function(unitsIn,unitsOut,value){if(unitsIn>=Fusion.UNKNOWN&&unitsIn<Fusion.PIXELS&&unitsOut>=Fusion.UNKNOWN&&unitsOut<Fusion.PIXELS){return Fusion.fromMeter(unitsOut,Fusion.toMeter(unitsIn,value))}return false},initUnits:function(metersPerUnit){var eps=1000;if(Math.abs(metersPerUnit-Fusion.aMeterPerUnit[Fusion.DEGREES])<eps){Fusion.aMeterPerUnit[Fusion.DEGREES]=metersPerUnit;Fusion.aMeterPerUnit[Fusion.DECIMALDEGREES]=metersPerUnit;Fusion.aMeterPerUnit[Fusion.DMX]=metersPerUnit;var inverse=1/metersPerUnit;Fusion.aUnitPerMeter[Fusion.DEGREES]=inverse;Fusion.aUnitPerMeter[Fusion.DECIMALDEGREES]=inverse;Fusion.aUnitPerMeter[Fusion.DMX]=inverse;var inPerUnit=OpenLayers.INCHES_PER_UNIT.m*metersPerUnit;OpenLayers.INCHES_PER_UNIT.dd=inPerUnit;OpenLayers.INCHES_PER_UNIT.degrees=inPerUnit}},getClosestUnits:function(metersPerUnit){var units="degrees";var minDiff=100000000;for(var key in OpenLayers.INCHES_PER_UNIT){var newDiff=Math.abs((metersPerUnit*39.3701)-OpenLayers.INCHES_PER_UNIT[key]);if(newDiff<minDiff){minDiff=newDiff;units=key}}return units},addWidgetStyleSheet:function(url){var lnk=document.createElement("link");var hd=document.getElementsByTagName("HEAD")[0];hd.insertBefore(lnk,Fusion._scriptObject);lnk.type="text/css";lnk.rel="stylesheet";lnk.href=Fusion.getFusionURL()+url},parseQueryString:function(){this.queryParams=[];var s=window.location.search;if(s!=""){s=s.substring(1);var p=s.split("&");for(var i=0;i<p.length;i++){var q=p[i].split("=");this.queryParams[q[0].toLowerCase()]=decodeURIComponent(q[1])}}return this.queryParams},getQueryParam:function(p){if(!this.queryParams){this.parseQueryString()}p=p.toLowerCase();if(this.queryParams[p]&&typeof this.queryParams[p]=="string"){return this.queryParams[p]}else{return""}},_scriptName:"lib/fusionSF",_getScriptLocation:function(){Fusion.fusionURL=null;var scriptName=Fusion._scriptName;var scripts=document.getElementsByTagName("script");for(var i=0;i<scripts.length;i++){var src=scripts[i].getAttribute("src");if(src){var index=src.lastIndexOf(scriptName);if(index>-1){Fusion._scriptObject=scripts[i];var img=document.createElement("img");img.src=src.slice(0,index)+"lib/a_pixel.png";var s=img.src;var n=s.lastIndexOf("lib/a_pixel.png");Fusion.fusionURL=s.slice(0,n);Fusion.aPixel=img;break}}}if(!this.fusionURL){alert("failed to determine fusionURL using script name "+Fusion._scriptName+".  Initialization aborted");return }return Fusion.fusionURL}};Fusion._singleFile=singleFile;var host=Fusion._getScriptLocation();Jx.aPixel=Fusion.aPixel;var locale=navigator.language?navigator.language.substring(0,2):navigator.userLanguage.substring(0,2);var s=window.location.search.toLowerCase();var idx=s.indexOf("locale=");if(idx>0){locale=s.substring(idx+7,idx+9)}window._FusionLocale=locale;if(!Fusion._singleFile){var coreScripts=["lib/OpenLayers/OpenLayers.js","lib/jxlib.uncompressed.js","lib/proj4js-compressed.js","lib/EventMgr.js","lib/Error.js","lib/ApplicationDefinition.js","lib/MGBroker.js","lib/Widget.js","lib/Map.js","layers/Layers.js","lib/Search.js","text/en.json"];if(locale!="en"){coreScripts.push("lib/OpenLayers/Lang/"+locale+".js");coreScripts.push("text/"+locale+".json")}var agent=navigator.userAgent;var docWrite=(agent.match("MSIE")||agent.match("Safari"));if(docWrite){var allScriptTags=new Array(coreScripts.length)}for(var i=0;i<coreScripts.length;i++){if(docWrite){allScriptTags[i]="<script src='"+host+coreScripts[i]+"'><\/script>"}else{var s=document.createElement("script");s.src=host+coreScripts[i];var h=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;h.appendChild(s)}}if(docWrite){document.write(allScriptTags.join(""))}}var getAgentUrl=function(){var fusionURL=Fusion._getScriptLocation();var testUrl=window.location.protocol+"//"+window.location.host;var configUrl="config.json";if(((Fusion.fusionURL.indexOf("http://")<0)||(Fusion.fusionURL.indexOf(testUrl,0)==0))&&!(Fusion.bForceRedirect)){Fusion.sRedirectScript=""}else{Fusion.sRedirectScript="redirect.php";configUrl+="&method=get"}var r=Fusion.getRedirectScript();if(r!=""){r=r+"?s="}var fusionURL=r+Fusion.getFusionURL()+configUrl;var xhr=getXmlHttpRequest();xhr.open("GET",fusionURL,false);xhr.send(null);eval("Fusion.configuration="+xhr.responseText);var s=Fusion.configuration.mapguide.webTierUrl;if(s){var nLength=s.length;var slastChar=s.charAt((nLength-1));if(slastChar!="/"){s=s+"/"}}else{var idx=Fusion.fusionURL.lastIndexOf("fusion");if(idx==-1){s=Fusion.fusionURL+"../"}else{s=Fusion.fusionURL.substring(0,idx)}}Fusion.configuration.mapguide.mapAgentUrl=s+"mapagent/mapagent.fcgi";return Fusion.configuration.mapguide.mapAgentUrl};var addElement=function(element){if(!element){return }var src=element.textContent;if(!src){src=element.text}document.writeln('<script src="'+src+'"><\/script>')};var getXmlHttpRequest=function(){try{return new XMLHttpRequest()}catch(e){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}}};var createSessionId=function(){var xhr=getXmlHttpRequest();xhr.open("GET",Fusion.fusionURL+"layers/MapGuide/php/CreateSession.php",false);xhr.send(null);var o;eval("o="+xhr.responseText);Fusion.sessionId=o.sessionId};var appDefUrl=Fusion.getQueryParam("ApplicationDefinition");if(appDefUrl&&(appDefUrl.indexOf("Library")==0||appDefUrl.indexOf("Session")==0)){createSessionId();var xhr=new getXmlHttpRequest();var mapAgentUrl=getAgentUrl();xhr.open("GET",mapAgentUrl+"?OPERATION=GETRESOURCECONTENT&VERSION=1.0.0&LOCALE=en&CLIENTAGENT=MapGuide+Developer&RESOURCEID="+appDefUrl+"&FORMAT=text%2Fxml&SESSION="+Fusion.sessionId,false);xhr.send(null);var appDefXML=xhr.responseXML.documentElement;if(appDefXML){var googleElement=appDefXML.getElementsByTagName("GoogleScript")[0];var yahooElement=appDefXML.getElementsByTagName("YahooScript")[0];var veElement=appDefXML.getElementsByTagName("VirtualEarthScript")[0];addElement(googleElement);addElement(yahooElement);addElement(veElement)}}})();var OpenLayers={singleFile:true};(function(){var G=(typeof OpenLayers=="object"&&OpenLayers.singleFile);window.OpenLayers={_scriptName:(!G)?"lib/OpenLayers.js":"OpenLayers.js",_getScriptLocation:function(){var O="";var Q=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var L=document.getElementsByTagName("script");for(var N=0,K=L.length;N<K;N++){var P=L[N].getAttribute("src");if(P){var M=P.match(Q);if(M){O=M[1];break}}}return O}};if(!G){var H=new Array("OpenLayers/Util.js","OpenLayers/BaseTypes.js","OpenLayers/BaseTypes/Class.js","OpenLayers/BaseTypes/Bounds.js","OpenLayers/BaseTypes/Element.js","OpenLayers/BaseTypes/LonLat.js","OpenLayers/BaseTypes/Pixel.js","OpenLayers/BaseTypes/Size.js","OpenLayers/Console.js","OpenLayers/Tween.js","Rico/Corner.js","Rico/Color.js","OpenLayers/Ajax.js","OpenLayers/Events.js","OpenLayers/Request.js","OpenLayers/Request/XMLHttpRequest.js","OpenLayers/Projection.js","OpenLayers/Map.js","OpenLayers/Layer.js","OpenLayers/Icon.js","OpenLayers/Marker.js","OpenLayers/Marker/Box.js","OpenLayers/Popup.js","OpenLayers/Tile.js","OpenLayers/Tile/Image.js","OpenLayers/Tile/WFS.js","OpenLayers/Layer/Image.js","OpenLayers/Layer/SphericalMercator.js","OpenLayers/Layer/EventPane.js","OpenLayers/Layer/FixedZoomLevels.js","OpenLayers/Layer/Google.js","OpenLayers/Layer/VirtualEarth.js","OpenLayers/Layer/Yahoo.js","OpenLayers/Layer/HTTPRequest.js","OpenLayers/Layer/Grid.js","OpenLayers/Layer/MapGuide.js","OpenLayers/Layer/MapServer.js","OpenLayers/Layer/MapServer/Untiled.js","OpenLayers/Layer/KaMap.js","OpenLayers/Layer/KaMapCache.js","OpenLayers/Layer/MultiMap.js","OpenLayers/Layer/Markers.js","OpenLayers/Layer/Text.js","OpenLayers/Layer/WorldWind.js","OpenLayers/Layer/ArcGIS93Rest.js","OpenLayers/Layer/WMS.js","OpenLayers/Layer/WMS/Untiled.js","OpenLayers/Layer/ArcIMS.js","OpenLayers/Layer/GeoRSS.js","OpenLayers/Layer/Boxes.js","OpenLayers/Layer/XYZ.js","OpenLayers/Layer/TMS.js","OpenLayers/Layer/TileCache.js","OpenLayers/Popup/Anchored.js","OpenLayers/Popup/AnchoredBubble.js","OpenLayers/Popup/Framed.js","OpenLayers/Popup/FramedCloud.js","OpenLayers/Feature.js","OpenLayers/Feature/Vector.js","OpenLayers/Feature/WFS.js","OpenLayers/Handler.js","OpenLayers/Handler/Click.js","OpenLayers/Handler/Hover.js","OpenLayers/Handler/Point.js","OpenLayers/Handler/Path.js","OpenLayers/Handler/Polygon.js","OpenLayers/Handler/Feature.js","OpenLayers/Handler/Drag.js","OpenLayers/Handler/RegularPolygon.js","OpenLayers/Handler/Box.js","OpenLayers/Handler/MouseWheel.js","OpenLayers/Handler/Keyboard.js","OpenLayers/Control.js","OpenLayers/Control/Attribution.js","OpenLayers/Control/Button.js","OpenLayers/Control/ZoomBox.js","OpenLayers/Control/ZoomToMaxExtent.js","OpenLayers/Control/DragPan.js","OpenLayers/Control/Navigation.js","OpenLayers/Control/MouseDefaults.js","OpenLayers/Control/MousePosition.js","OpenLayers/Control/OverviewMap.js","OpenLayers/Control/KeyboardDefaults.js","OpenLayers/Control/PanZoom.js","OpenLayers/Control/PanZoomBar.js","OpenLayers/Control/ArgParser.js","OpenLayers/Control/Permalink.js","OpenLayers/Control/Scale.js","OpenLayers/Control/ScaleLine.js","OpenLayers/Control/Snapping.js","OpenLayers/Control/Split.js","OpenLayers/Control/LayerSwitcher.js","OpenLayers/Control/DrawFeature.js","OpenLayers/Control/DragFeature.js","OpenLayers/Control/ModifyFeature.js","OpenLayers/Control/Panel.js","OpenLayers/Control/SelectFeature.js","OpenLayers/Control/NavigationHistory.js","OpenLayers/Control/Measure.js","OpenLayers/Control/WMSGetFeatureInfo.js","OpenLayers/Geometry.js","OpenLayers/Geometry/Rectangle.js","OpenLayers/Geometry/Collection.js","OpenLayers/Geometry/Point.js","OpenLayers/Geometry/MultiPoint.js","OpenLayers/Geometry/Curve.js","OpenLayers/Geometry/LineString.js","OpenLayers/Geometry/LinearRing.js","OpenLayers/Geometry/Polygon.js","OpenLayers/Geometry/MultiLineString.js","OpenLayers/Geometry/MultiPolygon.js","OpenLayers/Geometry/Surface.js","OpenLayers/Renderer.js","OpenLayers/Renderer/Elements.js","OpenLayers/Renderer/SVG.js","OpenLayers/Renderer/Canvas.js","OpenLayers/Renderer/VML.js","OpenLayers/Layer/Vector.js","OpenLayers/Layer/Vector/RootContainer.js","OpenLayers/Strategy.js","OpenLayers/Strategy/Fixed.js","OpenLayers/Strategy/Cluster.js","OpenLayers/Strategy/Paging.js","OpenLayers/Strategy/BBOX.js","OpenLayers/Strategy/Save.js","OpenLayers/Protocol.js","OpenLayers/Protocol/HTTP.js","OpenLayers/Protocol/SQL.js","OpenLayers/Protocol/SQL/Gears.js","OpenLayers/Protocol/WFS.js","OpenLayers/Protocol/WFS/v1.js","OpenLayers/Protocol/WFS/v1_0_0.js","OpenLayers/Protocol/WFS/v1_1_0.js","OpenLayers/Layer/PointTrack.js","OpenLayers/Layer/GML.js","OpenLayers/Style.js","OpenLayers/StyleMap.js","OpenLayers/Rule.js","OpenLayers/Filter.js","OpenLayers/Filter/FeatureId.js","OpenLayers/Filter/Logical.js","OpenLayers/Filter/Comparison.js","OpenLayers/Filter/Spatial.js","OpenLayers/Format.js","OpenLayers/Format/XML.js","OpenLayers/Format/ArcXML.js","OpenLayers/Format/ArcXML/Features.js","OpenLayers/Format/GML.js","OpenLayers/Format/GML/Base.js","OpenLayers/Format/GML/v2.js","OpenLayers/Format/GML/v3.js","OpenLayers/Format/KML.js","OpenLayers/Format/GeoRSS.js","OpenLayers/Format/WFS.js","OpenLayers/Format/WFSCapabilities.js","OpenLayers/Format/WFSCapabilities/v1.js","OpenLayers/Format/WFSCapabilities/v1_0_0.js","OpenLayers/Format/WFSCapabilities/v1_1_0.js","OpenLayers/Format/WFSDescribeFeatureType.js","OpenLayers/Format/WMSDescribeLayer.js","OpenLayers/Format/WMSDescribeLayer/v1_1.js","OpenLayers/Format/WKT.js","OpenLayers/Format/OSM.js","OpenLayers/Format/GPX.js","OpenLayers/Format/Filter.js","OpenLayers/Format/Filter/v1.js","OpenLayers/Format/Filter/v1_0_0.js","OpenLayers/Format/Filter/v1_1_0.js","OpenLayers/Format/SLD.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/SLD/v1_0_0.js","OpenLayers/Format/SLD/v1.js","OpenLayers/Format/WFST.js","OpenLayers/Format/WFST/v1.js","OpenLayers/Format/WFST/v1_0_0.js","OpenLayers/Format/WFST/v1_1_0.js","OpenLayers/Format/Text.js","OpenLayers/Format/JSON.js","OpenLayers/Format/GeoJSON.js","OpenLayers/Format/WMC.js","OpenLayers/Format/WMC/v1.js","OpenLayers/Format/WMC/v1_0_0.js","OpenLayers/Format/WMC/v1_1_0.js","OpenLayers/Format/WMSCapabilities.js","OpenLayers/Format/WMSCapabilities/v1_1.js","OpenLayers/Format/WMSCapabilities/v1_1_0.js","OpenLayers/Format/WMSCapabilities/v1_1_1.js","OpenLayers/Format/WMSGetFeatureInfo.js","OpenLayers/Layer/WFS.js","OpenLayers/Control/GetFeature.js","OpenLayers/Control/MouseToolbar.js","OpenLayers/Control/NavToolbar.js","OpenLayers/Control/PanPanel.js","OpenLayers/Control/Pan.js","OpenLayers/Control/ZoomIn.js","OpenLayers/Control/ZoomOut.js","OpenLayers/Control/ZoomPanel.js","OpenLayers/Control/EditingToolbar.js","OpenLayers/Lang.js","OpenLayers/Lang/en.js");var B=navigator.userAgent;var D=(B.match("MSIE")||B.match("Safari"));if(D){var A=new Array(H.length)}var I=OpenLayers._getScriptLocation()+"lib/";for(var C=0,F=H.length;C<F;C++){if(D){A[C]="<script src='"+I+H[C]+"'><\/script>"}else{var J=document.createElement("script");J.src=I+H[C];var E=document.getElementsByTagName("head").length?document.getElementsByTagName("head")[0]:document.body;E.appendChild(J)}}if(D){document.write(A.join(""))}}})();OpenLayers.VERSION_NUMBER="OpenLayers 2.8 -- $Revision: 2023 $";OpenLayers.Util={};OpenLayers.Util.getElement=function(){var D=[];for(var C=0,A=arguments.length;C<A;C++){var B=arguments[C];if(typeof B=="string"){B=document.getElementById(B)}if(arguments.length==1){return B}D.push(B)}return D};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(A,E){A=A||{};if(E){for(var D in E){var C=E[D];if(C!==undefined){A[D]=C}}var B=typeof window.Event=="function"&&E instanceof window.Event;if(!B&&E.hasOwnProperty&&E.hasOwnProperty("toString")){A.toString=E.toString}}return A};OpenLayers.Util.removeItem=function(C,B){for(var A=C.length-1;A>=0;A--){if(C[A]==B){C.splice(A,1)}}return C};OpenLayers.Util.clearArray=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));A.length=0};OpenLayers.Util.indexOf=function(D,C){for(var B=0,A=D.length;B<A;B++){if(D[B]==C){return B}}return -1};OpenLayers.Util.modifyDOMElement=function(E,H,D,F,A,C,G,B){if(H){E.id=H}if(D){E.style.left=D.x+"px";E.style.top=D.y+"px"}if(F){E.style.width=F.w+"px";E.style.height=F.h+"px"}if(A){E.style.position=A}if(C){E.style.border=C}if(G){E.style.overflow=G}if(parseFloat(B)>=0&&parseFloat(B)<1){E.style.filter="alpha(opacity="+(B*100)+")";E.style.opacity=B}else{if(parseFloat(B)==1){E.style.filter="";E.style.opacity=""}}};OpenLayers.Util.createDiv=function(A,I,H,F,E,C,B,G){var D=document.createElement("div");if(F){D.style.backgroundImage="url("+F+")"}if(!A){A=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!E){E="absolute"}OpenLayers.Util.modifyDOMElement(D,A,I,H,E,C,B,G);return D};OpenLayers.Util.createImage=function(A,H,G,E,D,C,F,I){var B=document.createElement("img");if(!A){A=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!D){D="relative"}OpenLayers.Util.modifyDOMElement(B,A,H,G,D,C,null,F);if(I){B.style.display="none";OpenLayers.Event.observe(B,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,B));OpenLayers.Event.observe(B,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,B))}B.style.alt=A;B.galleryImg="no";if(E){B.src=E}return B};OpenLayers.Util.setOpacity=function(B,A){OpenLayers.Util.modifyDOMElement(B,null,null,null,null,null,null,A)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.backgroundColor="transparent";this.style.display=""}};OpenLayers.Util.onImageLoadErrorColor="pink";OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var D=this.urls;if(D&&D instanceof Array&&D.length>1){var E=this.src.toString();var C,A;for(A=0;C=D[A];A++){if(E.indexOf(C)!=-1){break}}var F=Math.floor(D.length*Math.random());var B=D[F];A=0;while(B==C&&A++<4){F=Math.floor(D.length*Math.random());B=D[F]}this.src=E.replace(C,B)}else{this.src=this.src}}else{this.style.backgroundColor=OpenLayers.Util.onImageLoadErrorColor}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var D=navigator.appVersion.split("MSIE");var A=parseFloat(D[1]);var B=false;try{B=!!(document.body.filters)}catch(C){}OpenLayers.Util.alphaHackNeeded=(B&&(A>=5.5)&&(A<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(A,B,J,I,G,F,C,D,H){OpenLayers.Util.modifyDOMElement(A,B,J,I,F,null,null,H);var E=A.childNodes[0];if(G){E.src=G}OpenLayers.Util.modifyDOMElement(E,A.id+"_innerImage",null,I,"relative",C);if(OpenLayers.Util.alphaHack()){if(A.style.display!="none"){A.style.display="inline-block"}if(D==null){D="scale"}A.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E.src+"', sizingMethod='"+D+"')";if(parseFloat(A.style.opacity)>=0&&parseFloat(A.style.opacity)<1){A.style.filter+=" alpha(opacity="+A.style.opacity*100+")"}E.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(B,J,I,G,F,C,D,H,K){var A=OpenLayers.Util.createDiv();var E=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);A.appendChild(E);if(K){E.style.display="none";OpenLayers.Event.observe(E,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,A));OpenLayers.Event.observe(E,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,A))}OpenLayers.Util.modifyAlphaImageDiv(A,B,J,I,G,F,C,D,H);return A};OpenLayers.Util.upperCaseObject=function(B){var A={};for(var C in B){A[C.toUpperCase()]=B[C]}return A};OpenLayers.Util.applyDefaults=function(D,C){D=D||{};var B=typeof window.Event=="function"&&C instanceof window.Event;for(var A in C){if(D[A]===undefined||(!B&&C.hasOwnProperty&&C.hasOwnProperty(A)&&!D.hasOwnProperty(A))){D[A]=C[A]}}if(!B&&C&&C.hasOwnProperty&&C.hasOwnProperty("toString")&&!D.hasOwnProperty("toString")){D.toString=C.toString}return D};OpenLayers.Util.getParameterString=function(H){var G=[];for(var C in H){var E=H[C];if((E!=null)&&(typeof E!="function")){var B;if(typeof E=="object"&&E.constructor==Array){var F=[];for(var D=0,A=E.length;D<A;D++){F.push(encodeURIComponent(E[D]))}B=F.join(",")}else{B=encodeURIComponent(E)}G.push(encodeURIComponent(C)+"="+B)}}return G.join("&")};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var D=null;for(var C=0,A=arguments.length;C<A;C++){var B=arguments[C];try{D=B();break}catch(E){}}return D};OpenLayers.Util.getNodes=function(C,B){var A=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(C.documentElement.childNodes,B)},function(){return OpenLayers.Util._getNodes(C.childNodes,B)});return A};OpenLayers.Util._getNodes=function(C,E){var B=[];for(var D=0,A=C.length;D<A;D++){if(C[D].nodeName==E){B.push(C[D])}}return B};OpenLayers.Util.getTagText=function(C,D,B){var A=OpenLayers.Util.getNodes(C,D);if(A&&(A.length>0)){if(!B){B=0}if(A[B].childNodes.length>1){return A.childNodes[1].nodeValue}else{if(A[B].childNodes.length==1){return A[B].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(A){var B=null;OpenLayers.Util.Try(function(){B=A.text;if(!B){B=A.textContent}if(!B){B=A.firstChild.nodeValue}},function(){B=A.textContent});return B};OpenLayers.Util.mouseLeft=function(A,C){var B=(A.relatedTarget)?A.relatedTarget:A.toElement;while(B!=C&&B!=null){B=B.parentNode}return(B!=C)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(B,A){if(A==null){A=OpenLayers.Util.DEFAULT_PRECISION}var B;if(A==0){B=parseFloat(B)}else{B=parseFloat(parseFloat(B).toPrecision(A))}return B};OpenLayers.Util.rad=function(A){return A*Math.PI/180};OpenLayers.Util.distVincenty=function(F,D){var l=6378137,k=6356752.3142,e=1/298.257223563;var M=OpenLayers.Util.rad(D.lon-F.lon);var j=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(F.lat)));var h=Math.atan((1-e)*Math.tan(OpenLayers.Util.rad(D.lat)));var K=Math.sin(j),H=Math.cos(j);var J=Math.sin(h),G=Math.cos(h);var Q=M,N=2*Math.PI;var P=20;while(Math.abs(Q-N)>1e-12&&--P>0){var X=Math.sin(Q),E=Math.cos(Q);var m=Math.sqrt((G*X)*(G*X)+(H*J-K*G*E)*(H*J-K*G*E));if(m==0){return 0}var Z=K*J+H*G*E;var W=Math.atan2(m,Z);var I=Math.asin(H*G*X/m);var c=Math.cos(I)*Math.cos(I);var O=Z-2*K*J/c;var T=e/16*c*(4+e*(4-3*c));N=Q;Q=M+(1-T)*e*Math.sin(I)*(W+T*m*(O+T*Z*(-1+2*O*O)))}if(P==0){return NaN}var S=c*(l*l-k*k)/(k*k);var V=1+S/16384*(4096+S*(-768+S*(320-175*S)));var U=S/1024*(256+S*(-128+S*(74-47*S)));var Y=U*m*(O+U/4*(Z*(-1+2*O*O)-U/6*O*(-3+4*m*m)*(-3+4*O*O)));var R=k*V*(W-Y);var g=R.toFixed(3)/1000;return g};OpenLayers.Util.getParameters=function(B){B=B||window.location.href;var A="";if(OpenLayers.String.contains(B,"?")){var C=B.indexOf("?")+1;var E=OpenLayers.String.contains(B,"#")?B.indexOf("#"):B.length;A=B.substring(C,E)}var M={};var D=A.split(/[&;]/);for(var H=0,I=D.length;H<I;++H){var G=D[H].split("=");if(G[0]){var K=decodeURIComponent(G[0]);var J=G[1]||"";J=J.split(",");for(var F=0,L=J.length;F<L;F++){J[F]=decodeURIComponent(J[F])}if(J.length==1){J=J[0]}M[K]=J}}return M};OpenLayers.Util.getArgs=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(A)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(A){if(A==null){A="id_"}OpenLayers.Util.lastSeqID+=1;return A+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(B){var A=(B>1)?(1/B):B;return A};OpenLayers.Util.getResolutionFromScale=function(D,A){if(A==null){A="degrees"}var C=OpenLayers.Util.normalizeScale(D);var B=1/(C*OpenLayers.INCHES_PER_UNIT[A]*OpenLayers.DOTS_PER_INCH);return B};OpenLayers.Util.getScaleFromResolution=function(B,A){if(A==null){A="degrees"}var C=B*OpenLayers.INCHES_PER_UNIT[A]*OpenLayers.DOTS_PER_INCH;return C};OpenLayers.Util.safeStopPropagation=function(A){OpenLayers.Event.stop(A,true)};OpenLayers.Util.pagePosition=function(E){var A=0,D=0;var B=E;var F=E;while(B){if(B==document.body){if(OpenLayers.Element.getStyle(F,"position")=="absolute"){break}}A+=B.offsetTop||0;D+=B.offsetLeft||0;F=B;try{B=B.offsetParent}catch(C){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:B.id}));break}}B=E;while(B){A-=B.scrollTop||0;D-=B.scrollLeft||0;B=B.parentNode}return[D,A]};OpenLayers.Util.isEquivalentUrl=function(F,E,C){C=C||{};OpenLayers.Util.applyDefaults(C,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var B=OpenLayers.Util.createUrlObject(F,C);var A=OpenLayers.Util.createUrlObject(E,C);for(var D in B){if(D!=="args"){if(B[D]!=A[D]){return false}}}for(var D in B.args){if(B.args[D]!=A.args[D]){return false}delete A.args[D]}for(var D in A.args){return false}return true};OpenLayers.Util.createUrlObject=function(B,J){J=J||{};if(!(/^\w+:\/\//).test(B)){var F=window.location;var D=F.port?":"+F.port:"";var G=F.protocol+"//"+F.host.split(":").shift()+D;if(B.indexOf("/")===0){B=G+B}else{var E=F.pathname.split("/");E.pop();B=G+E.join("/")+"/"+B}}if(J.ignoreCase){B=B.toLowerCase()}var H=document.createElement("a");H.href=B;var C={};C.host=H.host.split(":").shift();C.protocol=H.protocol;if(J.ignorePort80){C.port=(H.port=="80"||H.port=="0")?"":H.port}else{C.port=(H.port==""||H.port=="0")?"80":H.port}C.hash=(J.ignoreHash||H.hash==="#")?"":H.hash;var A=H.search;if(!A){var I=B.indexOf("?");A=(I!=-1)?B.substr(I):""}C.args=OpenLayers.Util.getParameters(A);C.pathname=(H.pathname.charAt(0)=="/")?H.pathname:"/"+H.pathname;return C};OpenLayers.Util.removeTail=function(B){var C=null;var A=B.indexOf("?");var D=B.indexOf("#");if(A==-1){C=(D!=-1)?B.substr(0,D):B}else{C=(D!=-1)?B.substr(0,Math.min(A,D)):B.substr(0,A)}return C};OpenLayers.Util.getBrowserName=function(){var B="";var A=navigator.userAgent.toLowerCase();if(A.indexOf("opera")!=-1){B="opera"}else{if(A.indexOf("msie")!=-1){B="msie"}else{if(A.indexOf("safari")!=-1){B="safari"}else{if(A.indexOf("mozilla")!=-1){if(A.indexOf("firefox")!=-1){B="firefox"}else{B="mozilla"}}}}}return B};OpenLayers.Util.getRenderedDimensions=function(B,L,M){var I,E;var A=document.createElement("div");A.style.visibility="hidden";var K=(M&&M.containerElement)?M.containerElement:document.body;if(L){if(L.w){I=L.w;A.style.width=I+"px"}else{if(L.h){E=L.h;A.style.height=E+"px"}}}if(M&&M.displayClass){A.className=M.displayClass}var F=document.createElement("div");F.innerHTML=B;F.style.overflow="visible";if(F.childNodes){for(var D=0,C=F.childNodes.length;D<C;D++){if(!F.childNodes[D].style){continue}F.childNodes[D].style.overflow="visible"}}A.appendChild(F);K.appendChild(A);var J=false;var H=A.parentNode;while(H&&H.tagName.toLowerCase()!="body"){var G=OpenLayers.Element.getStyle(H,"position");if(G=="absolute"){J=true;break}else{if(G&&G!="static"){break}}H=H.parentNode}if(!J){A.style.position="absolute"}if(!I){I=parseInt(F.scrollWidth);A.style.width=I+"px"}if(!E){E=parseInt(F.scrollHeight)}A.removeChild(F);K.removeChild(A);return new OpenLayers.Size(I,E)};OpenLayers.Util.getScrollbarWidth=function(){var C=OpenLayers.Util._scrollbarWidth;if(C==null){var E=null;var D=null;var A=0;var B=0;E=document.createElement("div");E.style.position="absolute";E.style.top="-1000px";E.style.left="-1000px";E.style.width="100px";E.style.height="50px";E.style.overflow="hidden";D=document.createElement("div");D.style.width="100%";D.style.height="200px";E.appendChild(D);document.body.appendChild(E);A=D.offsetWidth;E.style.overflow="scroll";B=D.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(A-B);C=OpenLayers.Util._scrollbarWidth}return C};OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(A){alert(A)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"};(function(){var B=document.getElementsByTagName("script");for(var C=0,A=B.length;C<A;++C){if(B[C].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.String={startsWith:function(B,A){return(B.indexOf(A)==0)},contains:function(B,A){return(B.indexOf(A)!=-1)},trim:function(A){return A.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(F){var D=F.split("-");var B=D[0];for(var C=1,A=D.length;C<A;C++){var E=D[C];B+=E.charAt(0).toUpperCase()+E.substring(1)}return B},format:function(D,C,A){if(!C){C=window}var B=function(I,E){var H;var G=E.split(/\.+/);for(var F=0;F<G.length;F++){if(F==0){H=C}H=H[G[F]]}if(typeof H=="function"){H=A?H.apply(null,A):H()}if(typeof H=="undefined"){return"undefined"}else{return H}};return D.replace(OpenLayers.String.tokenRegEx,B)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(A){return OpenLayers.String.numberRegEx.test(A)},numericIf:function(A){return OpenLayers.String.isNumeric(A)?parseFloat(A):A}};if(!String.prototype.startsWith){String.prototype.startsWith=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,A)}}if(!String.prototype.contains){String.prototype.contains=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,A)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(A,C){var B=0;if(C>0){B=parseFloat(A.toPrecision(C))}return B},format:function(C,A,G,I){A=(typeof A!="undefined")?A:0;G=(typeof G!="undefined")?G:OpenLayers.Number.thousandsSeparator;I=(typeof I!="undefined")?I:OpenLayers.Number.decimalSeparator;if(A!=null){C=parseFloat(C.toFixed(A))}var B=C.toString().split(".");if(B.length==1&&A==null){A=0}var D=B[0];if(G){var E=/(-?[0-9]+)([0-9]{3})/;while(E.test(D)){D=D.replace(E,"$1"+G+"$2")}}var F;if(A==0){F=D}else{var H=B.length>1?B[1]:"0";if(A!=null){H=H+new Array(A-H.length+1).join("0")}F=D+I+H}return F}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,A)}}OpenLayers.Function={bind:function(C,B){var A=Array.prototype.slice.apply(arguments,[2]);return function(){var D=A.concat(Array.prototype.slice.apply(arguments,[0]));return C.apply(B,D)}},bindAsEventListener:function(B,A){return function(C){return B.call(A,C||window.event)}}};if(!Function.prototype.bind){Function.prototype.bind=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bind"}));Array.prototype.unshift.apply(arguments,[this]);return OpenLayers.Function.bind.apply(null,arguments)}}if(!Function.prototype.bindAsEventListener){Function.prototype.bindAsEventListener=function(A){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,A)}}OpenLayers.Array={filter:function(G,F,B){var D=[];if(Array.prototype.filter){D=G.filter(F,B)}else{var A=G.length;if(typeof F!="function"){throw new TypeError()}for(var C=0;C<A;C++){if(C in G){var E=G[C];if(F.call(B,E,C,G)){D.push(E)}}}}return D}};OpenLayers.Class=function(){var D=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var C={};var F,B;for(var E=0,A=arguments.length;E<A;++E){if(typeof arguments[E]=="function"){if(E==0&&A>1){B=arguments[E].prototype.initialize;arguments[E].prototype.initialize=function(){};C=new arguments[E];if(B===undefined){delete arguments[E].prototype.initialize}else{arguments[E].prototype.initialize=B}}F=arguments[E].prototype}else{F=arguments[E]}OpenLayers.Util.extend(C,F)}D.prototype=C;return D};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}}};OpenLayers.Class.inherit=function(){var D=arguments[0];var E=new D(OpenLayers.Class.isPrototype);for(var C=1,A=arguments.length;C<A;C++){if(typeof arguments[C]=="function"){var B=arguments[C];arguments[C]=new B(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(E,arguments[C])}return E};OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(A,B){this.w=parseFloat(A);this.h=parseFloat(B)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(B){var A=false;if(B!=null){A=((this.w==B.w&&this.h==B.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(B.w)&&isNaN(B.h)))}return A},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(D,A,B,C){if(D!=null){this.left=OpenLayers.Util.toFloat(D)}if(A!=null){this.bottom=OpenLayers.Util.toFloat(A)}if(B!=null){this.right=OpenLayers.Util.toFloat(B)}if(C!=null){this.top=OpenLayers.Util.toFloat(C)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(B){var A=false;if(B!=null){A=((this.left==B.left)&&(this.right==B.right)&&(this.top==B.top)&&(this.bottom==B.bottom))}return A},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(){return[this.left,this.bottom,this.right,this.top]},toBBOX:function(A){if(A==null){A=6}var B=Math.pow(10,A);var C=Math.round(this.left*B)/B+","+Math.round(this.bottom*B)/B+","+Math.round(this.right*B)/B+","+Math.round(this.top*B)/B;return C},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){if(!this.centerLonLat){this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2)}return this.centerLonLat},scale:function(F,H){if(H==null){H=this.getCenterLonLat()}var A=[];var E,D;if(H.CLASS_NAME=="OpenLayers.LonLat"){E=H.lon;D=H.lat}else{E=H.x;D=H.y}var C=(this.left-E)*F+E;var B=(this.bottom-D)*F+D;var I=(this.right-E)*F+E;var G=(this.top-D)*F+D;return new OpenLayers.Bounds(C,B,I,G)},add:function(A,C){if((A==null)||(C==null)){var B=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(B);return null}return new OpenLayers.Bounds(this.left+A,this.bottom+C,this.right+A,this.top+C)},extend:function(A){var B=null;if(A){switch(A.CLASS_NAME){case"OpenLayers.LonLat":B=new OpenLayers.Bounds(A.lon,A.lat,A.lon,A.lat);break;case"OpenLayers.Geometry.Point":B=new OpenLayers.Bounds(A.x,A.y,A.x,A.y);break;case"OpenLayers.Bounds":B=A;break}if(B){this.centerLonLat=null;if((this.left==null)||(B.left<this.left)){this.left=B.left}if((this.bottom==null)||(B.bottom<this.bottom)){this.bottom=B.bottom}if((this.right==null)||(B.right>this.right)){this.right=B.right}if((this.top==null)||(B.top>this.top)){this.top=B.top}}}},containsLonLat:function(B,A){return this.contains(B.lon,B.lat,A)},containsPixel:function(B,A){return this.contains(B.x,B.y,A)},contains:function(B,D,A){if(A==null){A=true}if(B==null||D==null){return false}B=OpenLayers.Util.toFloat(B);D=OpenLayers.Util.toFloat(D);var C=false;if(A){C=((B>=this.left)&&(B<=this.right)&&(D>=this.bottom)&&(D<=this.top))}else{C=((B>this.left)&&(B<this.right)&&(D>this.bottom)&&(D<this.top))}return C},intersectsBounds:function(E,B){if(B==null){B=true}var D=false;var H=(this.left==E.right||this.right==E.left||this.top==E.bottom||this.bottom==E.top);if(B||!H){var G=(((E.bottom>=this.bottom)&&(E.bottom<=this.top))||((this.bottom>=E.bottom)&&(this.bottom<=E.top)));var F=(((E.top>=this.bottom)&&(E.top<=this.top))||((this.top>E.bottom)&&(this.top<E.top)));var C=(((E.left>=this.left)&&(E.left<=this.right))||((this.left>=E.left)&&(this.left<=E.right)));var A=(((E.right>=this.left)&&(E.right<=this.right))||((this.right>=E.left)&&(this.right<=E.right)));D=((G||F)&&(C||A))}return D},containsBounds:function(G,B,A){if(B==null){B=false}if(A==null){A=true}var C=this.contains(G.left,G.bottom,A);var D=this.contains(G.right,G.bottom,A);var F=this.contains(G.left,G.top,A);var E=this.contains(G.right,G.top,A);return(B)?(C||D||F||E):(C&&D&&F&&E)},determineQuadrant:function(C){var B="";var A=this.getCenterLonLat();B+=(C.lat<A.lat)?"b":"t";B+=(C.lon<A.lon)?"l":"r";return B},transform:function(D,B){this.centerLonLat=null;var E=OpenLayers.Projection.transform({x:this.left,y:this.bottom},D,B);var A=OpenLayers.Projection.transform({x:this.right,y:this.bottom},D,B);var C=OpenLayers.Projection.transform({x:this.left,y:this.top},D,B);var F=OpenLayers.Projection.transform({x:this.right,y:this.top},D,B);this.left=Math.min(E.x,C.x);this.bottom=Math.min(E.y,A.y);this.right=Math.max(A.x,F.x);this.top=Math.max(C.y,F.y);return this},wrapDateLine:function(A,C){C=C||{};var D=C.leftTolerance||0;var B=C.rightTolerance||0;var E=this.clone();if(A){while(E.left<A.left&&(E.right-B)<=A.left){E=E.add(A.getWidth(),0)}while((E.left+D)>=A.right&&E.right>A.right){E=E.add(-A.getWidth(),0)}}return E},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(B){var A=B.split(",");return OpenLayers.Bounds.fromArray(A)};OpenLayers.Bounds.fromArray=function(A){return new OpenLayers.Bounds(parseFloat(A[0]),parseFloat(A[1]),parseFloat(A[2]),parseFloat(A[3]))};OpenLayers.Bounds.fromSize=function(A){return new OpenLayers.Bounds(0,A.h,A.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(A){var B="";B+=(A.charAt(0)=="t")?"b":"t";B+=(A.charAt(1)=="l")?"r":"l";return B};OpenLayers.Element={visible:function(A){return OpenLayers.Util.getElement(A).style.display!="none"},toggle:function(){for(var C=0,A=arguments.length;C<A;C++){var B=OpenLayers.Util.getElement(arguments[C]);var D=OpenLayers.Element.visible(B)?"hide":"show";OpenLayers.Element[D](B)}},hide:function(){for(var C=0,A=arguments.length;C<A;C++){var B=OpenLayers.Util.getElement(arguments[C]);B.style.display="none"}},show:function(){for(var C=0,A=arguments.length;C<A;C++){var B=OpenLayers.Util.getElement(arguments[C]);B.style.display=""}},remove:function(A){A=OpenLayers.Util.getElement(A);A.parentNode.removeChild(A)},getHeight:function(A){A=OpenLayers.Util.getElement(A);return A.offsetHeight},getDimensions:function(B){B=OpenLayers.Util.getElement(B);if(OpenLayers.Element.getStyle(B,"display")!="none"){return{width:B.offsetWidth,height:B.offsetHeight}}var A=B.style;var E=A.visibility;var C=A.position;A.visibility="hidden";A.position="absolute";A.display="";var F=B.clientWidth;var D=B.clientHeight;A.display="none";A.position=C;A.visibility=E;return{width:F,height:D}},hasClass:function(B,A){var C=B.className;return(!!C&&new RegExp("(^|\\s)"+A+"(\\s|$)").test(C))},addClass:function(B,A){if(!OpenLayers.Element.hasClass(B,A)){B.className+=(B.className?" ":"")+A}return B},removeClass:function(B,A){var C=B.className;if(C){B.className=OpenLayers.String.trim(C.replace(new RegExp("(^|\\s+)"+A+"(\\s+|$)")," "))}return B},toggleClass:function(B,A){if(OpenLayers.Element.hasClass(B,A)){OpenLayers.Element.removeClass(B,A)}else{OpenLayers.Element.addClass(B,A)}return B},getStyle:function(C,D){C=OpenLayers.Util.getElement(C);var E=null;if(C&&C.style){E=C.style[OpenLayers.String.camelize(D)];if(!E){if(document.defaultView&&document.defaultView.getComputedStyle){var B=document.defaultView.getComputedStyle(C,null);E=B?B.getPropertyValue(D):null}else{if(C.currentStyle){E=C.currentStyle[OpenLayers.String.camelize(D)]}}}var A=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(A,D)!=-1)&&(OpenLayers.Element.getStyle(C,"position")=="static")){E="auto"}}return E=="auto"?null:E}};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(B,A){this.lon=OpenLayers.Util.toFloat(B);this.lat=OpenLayers.Util.toFloat(A)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(C,A){if((C==null)||(A==null)){var B=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(B);return null}return new OpenLayers.LonLat(this.lon+C,this.lat+A)},equals:function(B){var A=false;if(B!=null){A=((this.lon==B.lon&&this.lat==B.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(B.lon)&&isNaN(B.lat)))}return A},transform:function(C,B){var A=OpenLayers.Projection.transform({x:this.lon,y:this.lat},C,B);this.lon=A.x;this.lat=A.y;return this},wrapDateLine:function(A){var B=this.clone();if(A){while(B.lon<A.left){B.lon+=A.getWidth()}while(B.lon>A.right){B.lon-=A.getWidth()}}return B},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(B){var A=B.split(",");return new OpenLayers.LonLat(parseFloat(A[0]),parseFloat(A[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(A,B){this.x=parseFloat(A);this.y=parseFloat(B)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(A){var B=false;if(A!=null){B=((this.x==A.x&&this.y==A.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(A.x)&&isNaN(A.y)))}return B},add:function(A,C){if((A==null)||(C==null)){var B=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(B);return null}return new OpenLayers.Pixel(this.x+A,this.y+C)},offset:function(A){var B=this.clone();if(A){B=this.add(A.x,A.y)}return B},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(A,B,D,C){this.url=A;this.size=(B)?B:new OpenLayers.Size(20,20);this.offset=D?D:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=C;var E=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(E)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(A){if(A!=null){this.size=A}this.draw()},setUrl:function(A){if(A!=null){this.url=A}this.draw()},draw:function(A){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(A);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(A){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,A)},moveTo:function(A){if(A!=null){this.px=A}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var B=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,B)}}},display:function(A){this.imageDiv.style.display=(A)?"":"none"},isDrawn:function(){var A=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return A},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(G,C,F,B,E,D){if(G==null){G=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=G;this.lonlat=C;this.contentSize=(F!=null)?F:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(B!=null){this.contentHTML=B}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var A=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(A,null,null,null,"relative",null,"hidden");var G=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(G,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(E){this.addCloseBox(D)}this.registerEvents()},destroy:function(){this.id=null;this.lonlat=null;this.size=null;this.contentHTML=null;this.backgroundColor=null;this.opacity=null;this.border=null;if(this.closeOnMove&&this.map){this.map.events.unregister("movestart",this,this.hide)}this.events.destroy();this.events=null;if(this.closeDiv){OpenLayers.Event.stopObservingElement(this.closeDiv);this.groupDiv.removeChild(this.closeDiv)}this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;if(this.map!=null){this.map.removePopup(this)}this.map=null;this.div=null;this.autoSize=null;this.minSize=null;this.maxSize=null;this.padding=null;this.panMapIfOutOfView=null},draw:function(A){if(A==null){if((this.lonlat!=null)&&(this.map!=null)){A=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var B=document.defaultView.getComputedStyle(this.contentDiv,null);var C=B.getPropertyValue("overflow");if(C!="hidden"){this.contentDiv._oldOverflow=C;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var B=this.contentDiv._oldOverflow;if(B){this.contentDiv.style.overflow=B;this.contentDiv._oldOverflow=null}})}this.moveTo(A);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var A=this.map.getLayerPxFromLonLat(this.lonlat);if(A){this.moveTo(A)}}},moveTo:function(A){if((A!=null)&&(this.div!=null)){this.div.style.left=A.x+"px";this.div.style.top=A.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){OpenLayers.Element.show(this.div);if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(C){this.size=C.clone();var B=this.getContentDivPadding();var A=B.left+B.right;var E=B.top+B.bottom;this.fixPadding();A+=this.padding.left+this.padding.right;E+=this.padding.top+this.padding.bottom;if(this.closeDiv){var D=parseInt(this.closeDiv.style.width);A+=D+B.right}this.size.w+=A;this.size.h+=E;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=B.left+B.right;this.contentSize.h+=B.bottom+B.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=C.w+"px";this.contentDiv.style.height=C.h+"px"}},updateSize:function(){var E="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var H=(this.map)?this.map.layerContainerDiv:document.body;var I=OpenLayers.Util.getRenderedDimensions(E,null,{displayClass:this.displayClass,containerElement:H});var G=this.getSafeContentSize(I);var F=null;if(G.equals(I)){F=I}else{var B=new OpenLayers.Size();B.w=(G.w<I.w)?G.w:null;B.h=(G.h<I.h)?G.h:null;if(B.w&&B.h){F=G}else{var D=OpenLayers.Util.getRenderedDimensions(E,B,{displayClass:this.contentDisplayClass,containerElement:H});var C=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((C!="hidden")&&(D.equals(G))){var A=OpenLayers.Util.getScrollbarWidth();if(B.w){D.h+=A}else{D.w+=A}}F=this.getSafeContentSize(D)}}this.setSize(F)},setBackgroundColor:function(A){if(A!=undefined){this.backgroundColor=A}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(A){if(A!=undefined){this.opacity=A}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(A){if(A!=undefined){this.border=A}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(A){if(A!=null){this.contentHTML=A}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var F=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var B=this.contentDiv.getElementsByTagName("img");for(var E=0,A=B.length;E<A;E++){var C=B[E];if(C.width==0||C.height==0){var D={popup:this,img:C};C._onImgLoad=OpenLayers.Function.bind(F,D);OpenLayers.Event.observe(C,"load",C._onImgLoad)}}},getSafeContentSize:function(K){var D=K.clone();var I=this.getContentDivPadding();var J=I.left+I.right;var G=I.top+I.bottom;this.fixPadding();J+=this.padding.left+this.padding.right;G+=this.padding.top+this.padding.bottom;if(this.closeDiv){var C=parseInt(this.closeDiv.style.width);J+=C+I.right}if(this.minSize){D.w=Math.max(D.w,(this.minSize.w-J));D.h=Math.max(D.h,(this.minSize.h-G))}if(this.maxSize){D.w=Math.min(D.w,(this.maxSize.w-J));D.h=Math.min(D.h,(this.maxSize.h-G))}if(this.map&&this.map.size){var F=0,E=0;if(this.keepInMap&&!this.panMapIfOutOfView){var H=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":F=H.x;E=this.map.size.h-H.y;break;case"tl":F=this.map.size.w-H.x;E=this.map.size.h-H.y;break;case"bl":F=this.map.size.w-H.x;E=H.y;break;case"br":F=H.x;E=H.y;break;default:F=H.x;E=this.map.size.h-H.y;break}}var A=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-G-E;var B=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-J-F;D.w=Math.min(D.w,B);D.h=Math.min(D.h,A)}return D},getContentDivPadding:function(){var A=this._contentDivPadding;if(!A){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}A=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=A;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return A},addCloseBox:function(C){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var B=this.getContentDivPadding();this.closeDiv.style.right=B.right+"px";this.closeDiv.style.top=B.top+"px";this.groupDiv.appendChild(this.closeDiv);var A=C||function(D){this.hide();OpenLayers.Event.stop(D)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(A,this))},panIntoView:function(){var E=this.map.getSize();var D=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var C=D.clone();if(D.x<this.map.paddingForPopups.left){C.x=this.map.paddingForPopups.left}else{if((D.x+this.size.w)>(E.w-this.map.paddingForPopups.right)){C.x=E.w-this.map.paddingForPopups.right-this.size.w}}if(D.y<this.map.paddingForPopups.top){C.y=this.map.paddingForPopups.top}else{if((D.y+this.size.h)>(E.h-this.map.paddingForPopups.bottom)){C.y=E.h-this.map.paddingForPopups.bottom-this.size.h}}var B=D.x-C.x;var A=D.y-C.y;this.map.pan(B,A)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(A){this.mousedown=true;OpenLayers.Event.stop(A,true)},onmousemove:function(A){if(this.mousedown){OpenLayers.Event.stop(A,true)}},onmouseup:function(A){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(A,true)}},onclick:function(A){OpenLayers.Event.stop(A,true)},onmouseout:function(A){this.mousedown=false},ondblclick:function(A){OpenLayers.Event.stop(A,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,initialize:function(A){A=A||{};OpenLayers.Util.extend(this,A);this.options=A},destroy:function(){this.options=null;this.format=null},read:function(){},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(A){},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(A){OpenLayers.Util.extend(this,A)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(A,B){this.container=OpenLayers.Util.getElement(A)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(A,B){this.extent=A.clone();if(B){this.resolution=null}},setSize:function(A){this.size=A.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(A,B){if(B==null){B=A.style}if(A.geometry){var C=A.geometry.getBounds();if(C){if(!C.intersectsBounds(this.extent)){B={display:"none"}}var D=this.drawGeometry(A.geometry,B,A.id);if(B.display!="none"&&B.label&&D!==false){this.drawText(A.id,B,A.geometry.getCentroid())}else{this.removeText(A.id)}return D}}},drawGeometry:function(C,A,B){},drawText:function(C,B,A){},removeText:function(A){},clear:function(){},getFeatureIdFromEvent:function(A){},eraseFeatures:function(C){if(!(C instanceof Array)){C=[C]}for(var B=0,A=C.length;B<A;++B){this.eraseGeometry(C[B].geometry);this.removeText(C[B].id)}},eraseGeometry:function(A){},moveRoot:function(A){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(A){OpenLayers.Util.extend(this,A);this.options=A;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(A){this.layer=A},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(A){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,A);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var A in this.handlers){if(this.handlers.hasOwnProperty(A)&&typeof this.handlers[A].destroy=="function"){this.handlers[A].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(A){this.map=A;if(this.handler){this.handler.setMap(A)}},draw:function(A){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=function(){return(false)}}if(this.title!=""){this.div.title=this.title}}if(A!=null){this.position=A.clone()}this.moveTo(this.position);return this.div},moveTo:function(A){if((A!=null)&&(this.div!=null)){this.div.style.left=A.x+"px";this.div.style.top=A.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(B){var D;if(!B){B=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var C=B.split("-");C[0]=C[0].toLowerCase();if(typeof OpenLayers.Lang[C[0]]=="object"){D=C[0]}if(C[1]){var A=C[0]+"-"+C[1].toUpperCase();if(typeof OpenLayers.Lang[A]=="object"){D=A}}if(!D){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+C.join("-")+" dictionary, falling back to default language");D=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=D},translate:function(B,A){var D=OpenLayers.Lang[OpenLayers.Lang.getCode()];var C=D[B];if(!C){C=B}if(A){C=OpenLayers.String.format(C,A)}return C}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(H,D,G,C,B,F,E){var A=[H,D,G,C,F,E];OpenLayers.Popup.prototype.initialize.apply(this,A);this.anchor=(B!=null)?B:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(C){var B=this.relativePosition;this.relativePosition=this.calculateRelativePosition(C);var D=this.calculateNewPx(C);var A=new Array(D);OpenLayers.Popup.prototype.moveTo.apply(this,A);if(this.relativePosition!=B){this.updateRelativePosition()}},setSize:function(B){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var A=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(A)}},calculateRelativePosition:function(B){var D=this.map.getLonLatFromLayerPx(B);var C=this.map.getExtent();var A=C.determineQuadrant(D);return OpenLayers.Bounds.oppositeQuadrant(A)},updateRelativePosition:function(){},calculateNewPx:function(B){var E=B.offset(this.anchor.offset);var A=this.size||this.contentSize;var D=(this.relativePosition.charAt(0)=="t");E.y+=(D)?-A.h:this.anchor.size.h;var C=(this.relativePosition.charAt(1)=="l");E.x+=(C)?-A.w:this.anchor.size.w;return E},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(A){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.geometryMap={}},eraseGeometry:function(A){this.eraseFeatures(this.features[this.geometryMap[A.id]][0])},supported:function(){var A=document.createElement("canvas");return !!A.getContext},setExtent:function(A){this.extent=A.clone();this.resolution=null;this.redraw()},setSize:function(A){this.size=A.clone();this.root.style.width=A.w+"px";this.root.style.height=A.h+"px";this.root.width=A.w;this.root.height=A.h;this.resolution=null},drawFeature:function(A,B){if(B==null){B=A.style}B=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},B);this.features[A.id]=[A,B];if(A.geometry){this.geometryMap[A.geometry.id]=A.id}this.redraw()},drawGeometry:function(D,C){var B=D.CLASS_NAME;if((B=="OpenLayers.Geometry.Collection")||(B=="OpenLayers.Geometry.MultiPoint")||(B=="OpenLayers.Geometry.MultiLineString")||(B=="OpenLayers.Geometry.MultiPolygon")){for(var A=0;A<D.components.length;A++){this.drawGeometry(D.components[A],C)}return }switch(D.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(D,C);break;case"OpenLayers.Geometry.LineString":this.drawLineString(D,C);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(D,C);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(D,C);break;default:break}},drawExternalGraphic:function(I,A){var E=new Image();E.src=A.externalGraphic;if(A.graphicTitle){E.title=A.graphicTitle}var C=A.graphicWidth||A.graphicHeight;var H=A.graphicHeight||A.graphicWidth;C=C?C:A.pointRadius*2;H=H?H:A.pointRadius*2;var G=(A.graphicXOffset!=undefined)?A.graphicXOffset:-(0.5*C);var D=(A.graphicYOffset!=undefined)?A.graphicYOffset:-(0.5*H);var F=A.graphicOpacity||A.fillOpacity;var B={img:E,x:(I[0]+G),y:(I[1]+D),width:C,height:H,canvas:this.canvas};E.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},B)},setCanvasStyle:function(B,A){if(B=="fill"){this.canvas.globalAlpha=A.fillOpacity;this.canvas.fillStyle=A.fillColor}else{if(B=="stroke"){this.canvas.globalAlpha=A.strokeOpacity;this.canvas.strokeStyle=A.strokeColor;this.canvas.lineWidth=A.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},drawPoint:function(C,A){if(A.graphic!==false){var B=this.getLocalXY(C);if(A.externalGraphic){this.drawExternalGraphic(B,A)}else{if(A.fill!==false){this.setCanvasStyle("fill",A);this.canvas.beginPath();this.canvas.arc(B[0],B[1],6,0,Math.PI*2,true);this.canvas.fill()}if(A.stroke!==false){this.setCanvasStyle("stroke",A);this.canvas.beginPath();this.canvas.arc(B[0],B[1],6,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(D,B){if(B.stroke!==false){this.setCanvasStyle("stroke",B);this.canvas.beginPath();var E=this.getLocalXY(D.components[0]);this.canvas.moveTo(E[0],E[1]);for(var A=1;A<D.components.length;A++){var C=this.getLocalXY(D.components[A]);this.canvas.lineTo(C[0],C[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(E,C){if(C.fill!==false){this.setCanvasStyle("fill",C);this.canvas.beginPath();var F=this.getLocalXY(E.components[0]);this.canvas.moveTo(F[0],F[1]);for(var B=1;B<E.components.length-1;B++){var D=this.getLocalXY(E.components[B]);this.canvas.lineTo(D[0],D[1])}this.canvas.fill()}if(C.stroke!==false){var A=this.canvas.lineWidth;this.setCanvasStyle("stroke",C);this.canvas.beginPath();var F=this.getLocalXY(E.components[0]);this.canvas.moveTo(F[0],F[1]);for(var B=1;B<E.components.length;B++){var D=this.getLocalXY(E.components[B]);this.canvas.lineTo(D[0],D[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(C,B){this.drawLinearRing(C.components[0],B);for(var A=1;A<C.components.length;A++){this.drawLinearRing(C.components[A],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(B,D){D=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},D);var E=this.getLocalXY(B);this.setCanvasStyle("reset");this.canvas.fillStyle=D.fontColor;this.canvas.globalAlpha=1;var F=D.fontWeight+" "+D.fontSize+" "+D.fontFamily;if(this.canvas.fillText){var C=OpenLayers.Renderer.Canvas.LABEL_ALIGN[D.labelAlign[0]]||"middle";this.canvas.font=F;this.canvas.textAlign=C;this.canvas.fillText(D.label,E[0],E[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=F;var A=this.canvas.mozMeasureText(D.label);switch(D.labelAlign[0]){case"l":break;case"r":E[0]-=A;break;case"c":default:E[0]-=A/2}this.canvas.translate(E[0],E[1]);this.canvas.mozDrawText(D.label);this.canvas.translate(-1*E[0],-1*E[1])}}this.setCanvasStyle("reset")},getLocalXY:function(B){var C=this.getResolution();var D=this.extent;var A=(B.x/C+(-D.left/C));var E=((D.top/C)-B.y/C);return[A,E]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(A){var F=this.map.getLonLatFromPixel(A.xy);var B=this.getResolution();var E=new OpenLayers.Bounds(F.lon-B*5,F.lat-B*5,F.lon+B*5,F.lat+B*5);var C=E.toGeometry();for(var D in this.features){if(!this.features.hasOwnProperty(D)){continue}if(this.features[D][0].geometry.intersects(C)){return D}}return null},eraseFeatures:function(B){if(!(B instanceof Array)){B=[B]}for(var A=0;A<B.length;++A){delete this.features[B[A].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var E=[];var B,C;for(var F in this.features){if(!this.features.hasOwnProperty(F)){continue}B=this.features[F][0];C=this.features[F][1];if(!B.geometry){continue}this.drawGeometry(B.geometry,C);if(C.label){E.push([B,C])}}var D;for(var A=0;len=E.length,A<len;++A){D=E[A];this.drawText(D[0].geometry.getCentroid(),D[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(A){this.compare=A?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(C){if(this.exists(C)){this.remove(C)}var F=C.id;this.determineZIndex(C);var D=-1;var E=this.order.length;var A;while(E-D>1){A=parseInt((D+E)/2);var B=this.compare(this,C,OpenLayers.Util.getElement(this.order[A]));if(B>0){D=A}else{E=A}}this.order.splice(E,0,F);this.indices[F]=this.getZIndex(C);return this.getNextElement(E)},remove:function(B){var D=B.id;var A=OpenLayers.Util.indexOf(this.order,D);if(A>=0){this.order.splice(A,1);delete this.indices[D];if(this.order.length>0){var C=this.order[this.order.length-1];this.maxZIndex=this.indices[C]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(A){return(this.indices[A.id]!=null)},getZIndex:function(A){return A._style.graphicZIndex},determineZIndex:function(A){var B=A._style.graphicZIndex;if(B==null){B=this.maxZIndex;A._style.graphicZIndex=B}else{if(B>this.maxZIndex){this.maxZIndex=B}}},getNextElement:function(B){var A=B+1;if(A<this.order.length){var C=OpenLayers.Util.getElement(this.order[A]);if(C==undefined){C=this.getNextElement(A)}return C}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(E,D,B){var A=E.getZIndex(D);var F=0;if(B){var C=E.getZIndex(B);F=A-C}return F},Z_ORDER_DRAWING_ORDER:function(C,B,A){var D=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(C,B,A);if(A&&D==0){D=1}return D},Z_ORDER_Y_ORDER:function(F,E,B){var G=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(F,E,B);if(B&&G==0){var C=E._geometry.getBounds().bottom;var D=B._geometry.getBounds().bottom;var A=D-C;G=(A==0)?1:A}return G}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(A,B){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(B&&(B.zIndexing||B.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(B.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.vectorRoot){while(this.vectorRoot.childNodes.length>0){this.vectorRoot.removeChild(this.vectorRoot.firstChild)}}if(this.textRoot){while(this.textRoot.childNodes.length>0){this.textRoot.removeChild(this.textRoot.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(B,A){},drawGeometry:function(G,D,F){var C=G.CLASS_NAME;var H=true;if((C=="OpenLayers.Geometry.Collection")||(C=="OpenLayers.Geometry.MultiPoint")||(C=="OpenLayers.Geometry.MultiLineString")||(C=="OpenLayers.Geometry.MultiPolygon")){for(var B=0,A=G.components.length;B<A;B++){H=this.drawGeometry(G.components[B],D,F)&&H}return H}H=false;if(D.display!="none"){if(D.backgroundGraphic){this.redrawBackgroundNode(G.id,G,D,F)}H=this.redrawNode(G.id,G,D,F)}if(H==false){var E=document.getElementById(G.id);if(E){if(E._style.backgroundGraphic){E.parentNode.removeChild(document.getElementById(G.id+this.BACKGROUND_ID_SUFFIX))}E.parentNode.removeChild(E)}}return H},redrawNode:function(G,F,B,E){var C=this.nodeFactory(G,this.getNodeType(F,B));C._featureId=E;C._geometry=F;C._geometryClass=F.CLASS_NAME;C._style=B;var A=this.drawGeometryNode(C,F,B);if(A===false){return false}C=A.node;if(this.indexer){var D=this.indexer.insert(C);if(D){this.vectorRoot.insertBefore(C,D)}else{this.vectorRoot.appendChild(C)}}else{if(C.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(C)}}this.postDraw(C);return A.complete},redrawBackgroundNode:function(E,D,B,C){var A=OpenLayers.Util.extend({},B);A.externalGraphic=A.backgroundGraphic;A.graphicXOffset=A.backgroundXOffset;A.graphicYOffset=A.backgroundYOffset;A.graphicZIndex=A.backgroundGraphicZIndex;A.graphicWidth=A.backgroundWidth||A.graphicWidth;A.graphicHeight=A.backgroundHeight||A.graphicHeight;A.backgroundGraphic=null;A.backgroundXOffset=null;A.backgroundYOffset=null;A.backgroundGraphicZIndex=null;return this.redrawNode(E+this.BACKGROUND_ID_SUFFIX,D,A,null)},drawGeometryNode:function(C,E,B){B=B||C._style;OpenLayers.Util.applyDefaults(B,this.minimumSymbolizer);var A={isFilled:B.fill===undefined?true:B.fill,isStroked:B.stroke===undefined?!!B.strokeWidth:B.stroke};var D;switch(E.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.graphic===false){A.isFilled=false;A.isStroked=false}D=this.drawPoint(C,E);break;case"OpenLayers.Geometry.LineString":A.isFilled=false;D=this.drawLineString(C,E);break;case"OpenLayers.Geometry.LinearRing":D=this.drawLinearRing(C,E);break;case"OpenLayers.Geometry.Polygon":D=this.drawPolygon(C,E);break;case"OpenLayers.Geometry.Surface":D=this.drawSurface(C,E);break;case"OpenLayers.Geometry.Rectangle":D=this.drawRectangle(C,E);break;default:break}C._style=B;C._options=A;if(D!=false){return{node:this.setStyle(C,B,A,E),complete:D}}else{return false}},postDraw:function(A){},drawPoint:function(A,B){},drawLineString:function(A,B){},drawLinearRing:function(A,B){},drawPolygon:function(A,B){},drawRectangle:function(A,B){},drawCircle:function(A,B){},drawSurface:function(A,B){},removeText:function(B){var A=document.getElementById(B+this.LABEL_ID_SUFFIX);if(A){this.textRoot.removeChild(A)}},getFeatureIdFromEvent:function(A){var D=A.target;var B=D&&D.correspondingUseElement;var C=B?B:(D||A.srcElement);var E=C._featureId;return E},eraseGeometry:function(F){if((F.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(F.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(F.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(F.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var D=0,A=F.components.length;D<A;D++){this.eraseGeometry(F.components[D])}}else{var C=OpenLayers.Util.getElement(F.id);if(C&&C.parentNode){if(C.geometry){C.geometry.destroy();C.geometry=null}C.parentNode.removeChild(C);if(this.indexer){this.indexer.remove(C)}if(C._style.backgroundGraphic){var B=F.id+this.BACKGROUND_ID_SUFFIX;var E=OpenLayers.Util.getElement(B);if(E&&E.parentNode){E.parentNode.removeChild(E)}}}}},nodeFactory:function(C,A){var B=OpenLayers.Util.getElement(C);if(B){if(!this.nodeTypeCompare(B,A)){B.parentNode.removeChild(B);B=this.nodeFactory(C,A)}}else{B=this.createNode(A,C)}return B},nodeTypeCompare:function(B,A){},createNode:function(A,B){},moveRoot:function(B){var A=this.root;if(B.root.parentNode==this.rendererRoot){A=B.root}A.parentNode.removeChild(A);B.rendererRoot.appendChild(A)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(A){return(A!="circle")&&!!A},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:false,initialize:function(A){OpenLayers.Strategy.prototype.initialize.apply(this,[A])},destroy:function(){OpenLayers.Strategy.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)){this.layer.events.on({refresh:this.load,scope:this});if(this.layer.visibility==true||this.preload){this.load()}else{this.layer.events.on({visibilitychanged:this.load,scope:this})}return true}return false},deactivate:function(){var A=OpenLayers.Strategy.prototype.deactivate.call(this);if(A){this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this})}return A},load:function(A){this.layer.events.triggerEvent("loadstart");this.layer.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,scope:this},A));this.layer.events.un({visibilitychanged:this.load,scope:this})},merge:function(G){this.layer.destroyFeatures();var E=G.features;if(E&&E.length>0){var F=this.layer.projection;var D=this.layer.map.getProjectionObject();if(!D.equals(F)){var C;for(var B=0,A=E.length;B<A;++B){C=E[B].geometry;if(C){C.transform(F,D)}}}this.layer.addFeatures(E)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(A){this.easing=(A)?A:OpenLayers.Easing.Expo.easeOut},start:function(C,B,D,A){this.playing=true;this.begin=C;this.finish=B;this.duration=D;this.callbacks=A.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){if(!this.playing){return }if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}window.clearInterval(this.interval);this.interval=null;this.playing=false},play:function(){var D={};for(var B in this.begin){var A=this.begin[B];var C=this.finish[B];if(A==null||C==null||isNaN(A)||isNaN(C)){OpenLayers.Console.error("invalid value for Tween")}var E=C-A;D[B]=this.easing.apply(this,[this.time,A,E,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,D)}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playing=false}window.clearInterval(this.interval);this.interval=null}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(B,A,D,C){return D*B/C+A},easeOut:function(B,A,D,C){return D*B/C+A},easeInOut:function(B,A,D,C){return D*B/C+A},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(B,A,D,C){return(B==0)?A:D*Math.pow(2,10*(B/C-1))+A},easeOut:function(B,A,D,C){return(B==C)?A+D:D*(-Math.pow(2,-10*B/C)+1)+A},easeInOut:function(B,A,D,C){if(B==0){return A}if(B==C){return A+D}if((B/=C/2)<1){return D/2*Math.pow(2,10*(B-1))+A}return D/2*(-Math.pow(2,-10*--B)+2)+A},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(B,A,D,C){return D*(B/=C)*B+A},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A},easeInOut:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A}return -D/2*((--B)*(B-2)-1)+A},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(E){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var C=0,A=this.map.controls.length;C<A;C++){var D=this.map.controls[C];if((D!=this)&&(D.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(D.displayProjection!=this.displayProjection){this.displayProjection=D.displayProjection}break}}if(C==this.map.controls.length){var B=OpenLayers.Util.getParameters();if(B.layers){this.layers=B.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(B.lat&&B.lon){this.center=new OpenLayers.LonLat(parseFloat(B.lon),parseFloat(B.lat));if(B.zoom){this.zoom=parseInt(B.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var C=0,A=this.layers.length;C<A;C++){var B=this.map.layers[C];var D=this.layers.charAt(C);if(D=="B"){this.map.setBaseLayer(B)}else{if((D=="T")||(D=="F")){B.setVisibility(D=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(A){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},draw:function(B){OpenLayers.Control.prototype.draw.apply(this,arguments);B=this.position;this.buttons=[];var C=new OpenLayers.Size(18,18);var A=new OpenLayers.Pixel(B.x+C.w/2,B.y);this._addButton("panup","north-mini.png",A,C);B.y=A.y+C.h;this._addButton("panleft","west-mini.png",B,C);this._addButton("panright","east-mini.png",B.add(C.w,0),C);this._addButton("pandown","south-mini.png",A.add(0,C.h*2),C);this._addButton("zoomin","zoom-plus-mini.png",A.add(0,C.h*3+5),C);this._addButton("zoomworld","zoom-world-mini.png",A.add(0,C.h*4+5),C);this._addButton("zoomout","zoom-minus-mini.png",A.add(0,C.h*5+5),C);return this.div},_addButton:function(A,D,I,G){var F=OpenLayers.Util.getImagesLocation()+D;var B=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+A,I,G,F,"absolute");this.div.appendChild(B);OpenLayers.Event.observe(B,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,B));OpenLayers.Event.observe(B,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,B));OpenLayers.Event.observe(B,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,B));B.action=A;B.map=this.map;if(!this.slideRatio){var C=this.slideFactor;var E=function(){return C}}else{var H=this.slideRatio;var E=function(J){return this.map.getSize()[J]*H}}B.getSlideFactor=E;this.buttons.push(B);return B},_removeButton:function(A){OpenLayers.Event.stopObservingElement(A);A.map=null;this.div.removeChild(A);OpenLayers.Util.removeItem(this.buttons,A)},removeButtons:function(){for(var A=this.buttons.length-1;A>=0;--A){this._removeButton(this.buttons[A])}},doubleClick:function(A){OpenLayers.Event.stop(A);return false},buttonDown:function(A){if(!OpenLayers.Event.isLeftClick(A)){return }switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}OpenLayers.Event.stop(A)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,initialize:function(A){OpenLayers.Control.prototype.initialize.apply(this,[A])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.div.style.display="block";this.div.style.position="absolute";this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var A=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+"Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){this.eBottom.style.visibility="hidden"}else{this.eBottom.style.visibility="visible"}}this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(B){var D=parseInt(Math.log(B)/Math.log(10));var A=Math.pow(10,D);var C=parseInt(B/A);var E;if(C>5){E=5}else{if(C>2){E=2}else{E=1}}return E*A},update:function(){var H=this.map.getResolution();if(!H){return }var L=this.map.getUnits();var C=OpenLayers.INCHES_PER_UNIT;var I=this.maxWidth*H*C[L];var A;var D;if(I>100000){A=this.topOutUnits;D=this.bottomOutUnits}else{A=this.topInUnits;D=this.bottomInUnits}var F=I/C[A];var J=I/C[D];var G=this.getBarLen(F);var E=this.getBarLen(J);F=G/C[L]*C[A];J=E/C[L]*C[D];var B=F/H;var K=J/H;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(K)+"px";this.eBottom.innerHTML=E+" "+D}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(B)+"px";this.eTop.innerHTML=G+" "+A}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(A){return A.target||A.srcElement},isLeftClick:function(A){return(((A.which)&&(A.which==1))||((A.button)&&(A.button==1)))},isRightClick:function(A){return(((A.which)&&(A.which==3))||((A.button)&&(A.button==2)))},stop:function(B,A){if(!A){if(B.preventDefault){B.preventDefault()}else{B.returnValue=false}}if(B.stopPropagation){B.stopPropagation()}else{B.cancelBubble=true}},findElement:function(C,B){var A=OpenLayers.Event.element(C);while(A.parentNode&&(!A.tagName||(A.tagName.toUpperCase()!=B.toUpperCase()))){A=A.parentNode}return A},observe:function(B,D,C,A){var E=OpenLayers.Util.getElement(B);A=A||false;if(D=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||E.attachEvent)){D="keydown"}if(!this.observers){this.observers={}}if(!E._eventCacheID){var F="eventCacheID_";if(E.id){F=E.id+"_"+F}E._eventCacheID=OpenLayers.Util.createUniqueID(F)}var G=E._eventCacheID;if(!this.observers[G]){this.observers[G]=[]}this.observers[G].push({element:E,name:D,observer:C,useCapture:A});if(E.addEventListener){E.addEventListener(D,C,A)}else{if(E.attachEvent){E.attachEvent("on"+D,C)}}},stopObservingElement:function(A){var B=OpenLayers.Util.getElement(A);var C=B._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[C])},_removeElementObservers:function(E){if(E){for(var B=E.length-1;B>=0;B--){var C=E[B];var A=new Array(C.element,C.name,C.observer,C.useCapture);var D=OpenLayers.Event.stopObserving.apply(this,A)}}},stopObserving:function(H,A,G,B){B=B||false;var F=OpenLayers.Util.getElement(H);var D=F._eventCacheID;if(A=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||F.detachEvent){A="keydown"}}var J=false;var C=OpenLayers.Event.observers[D];if(C){var E=0;while(!J&&E<C.length){var I=C[E];if((I.name==A)&&(I.observer==G)&&(I.useCapture==B)){C.splice(E,1);if(C.length==0){delete OpenLayers.Event.observers[D]}J=true;break}E++}}if(J){if(F.removeEventListener){F.removeEventListener(A,G,B)}else{if(F&&F.detachEvent){F.detachEvent("on"+A,G)}}}return J},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var A in OpenLayers.Event.observers){var B=OpenLayers.Event.observers[A];OpenLayers.Event._removeElementObservers.apply(this,[B])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)}else{var Event=OpenLayers.Event}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,clearMouseListener:null,initialize:function(C,E,G,F,B){OpenLayers.Util.extend(this,B);this.object=C;this.fallThrough=F;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(G!=null){for(var D=0,A=G.length;D<A;D++){this.addEventType(G[D])}}if(E!=null){this.attachToElement(E)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(A){if(!this.listeners[A]){this.eventTypes.push(A);this.listeners[A]=[]}},attachToElement:function(D){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=D;for(var C=0,A=this.BROWSER_EVENTS.length;C<A;C++){var B=this.BROWSER_EVENTS[C];this.addEventType(B);OpenLayers.Event.observe(D,B,this.eventHandler)}OpenLayers.Event.observe(D,"dragstart",OpenLayers.Event.stop)},on:function(A){for(var B in A){if(B!="scope"){this.register(B,A.scope,A[B])}}},register:function(B,D,C){if((C!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,B)!=-1)){if(D==null){D=this.object}var A=this.listeners[B];A.push({obj:D,func:C})}},registerPriority:function(B,D,C){if(C!=null){if(D==null){D=this.object}var A=this.listeners[B];if(A!=null){A.unshift({obj:D,func:C})}}},un:function(A){for(var B in A){if(B!="scope"){this.unregister(B,A.scope,A[B])}}},unregister:function(D,F,E){if(F==null){F=this.object}var C=this.listeners[D];if(C!=null){for(var B=0,A=C.length;B<A;B++){if(C[B].obj==F&&C[B].func==E){C.splice(B,1);break}}}},remove:function(A){if(this.listeners[A]!=null){this.listeners[A]=[]}},triggerEvent:function(E,B){var D=this.listeners[E];if(!D||D.length==0){return }if(B==null){B={}}B.object=this.object;B.element=this.element;if(!B.type){B.type=E}var D=D.slice(),F;for(var C=0,A=D.length;C<A;C++){var G=D[C];F=G.func.apply(G.obj,[B]);if((F!=undefined)&&(F==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(B,true)}return F},handleBrowserEvent:function(A){if(this.includeXY){A.xy=this.getMousePosition(A)}this.triggerEvent(A.type,A)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(A){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);this.element.hasScrollEvent=true}}if(!this.element.scrolls){this.element.scrolls=[(document.documentElement.scrollLeft||document.body.scrollLeft),(document.documentElement.scrollTop||document.body.scrollTop)]}if(!this.element.lefttop){this.element.lefttop=[(document.documentElement.clientLeft||0),(document.documentElement.clientTop||0)]}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element.offsets[0]+=this.element.scrolls[0];this.element.offsets[1]+=this.element.scrolls[1]}return new OpenLayers.Pixel((A.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(A.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(A){OpenLayers.Util.extend(this,A);this.options=A},destroy:function(){},read:function(A){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(A){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(G,C,F,B,A,E,D){this.padding=new OpenLayers.Bounds(0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE,0,OpenLayers.Popup.AnchoredBubble.CORNER_SIZE);OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments)},draw:function(A){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(A){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(A){if(A!=undefined){this.backgroundColor=A}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(A){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,A);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(A){this.border=0},setRicoCorners:function(){var A=this.getCornersToRound(this.relativePosition);var B={corners:A,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,B);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,B);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var A=["tl","tr","bl","br"];var B=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(A,B);return A.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(B,A){OpenLayers.Util.extend(this,A);this.projCode=B;if(window.Proj4js){this.proj=new Proj4js.Proj(B)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(A){if(A&&A.getCode){return this.getCode()==A.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(C,B,A){if(!OpenLayers.Projection.transforms[C]){OpenLayers.Projection.transforms[C]={}}OpenLayers.Projection.transforms[C][B]=A};OpenLayers.Projection.transform=function(A,C,B){if(C.proj&&B.proj){A=Proj4js.transform(C.proj,B.proj,A)}else{if(C&&B&&OpenLayers.Projection.transforms[C.getCode()]&&OpenLayers.Projection.transforms[C.getCode()][B.getCode()]){OpenLayers.Projection.transforms[C.getCode()][B.getCode()](A)}}return A};OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15000,translationParameters:null,symbolSize:{},isGecko:null,initialize:function(A){if(!this.supported()){return }OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var A="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(A+"SVG","1.1")||document.implementation.hasFeature(A+"BasicStructure","1.1")))},inValidRange:function(A,E,B){var D=A+(B?0:this.translationParameters.x);var C=E+(B?0:this.translationParameters.y);return(D>=-this.MAX_PIXEL&&D<=this.MAX_PIXEL&&C>=-this.MAX_PIXEL&&C<=this.MAX_PIXEL)},setExtent:function(B,D){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var A=this.getResolution();var F=-B.left/A;var E=B.top/A;if(D){this.left=F;this.top=E;var C="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",C);this.translate(0,0);return true}else{var G=this.translate(F-this.left,E-this.top);if(!G){this.setExtent(B,true)}return G}},translate:function(A,C){if(!this.inValidRange(A,C,true)){return false}else{var B="";if(A||C){B="translate("+A+","+C+")"}this.root.setAttributeNS(null,"transform",B);this.translationParameters={x:A,y:C};return true}},setSize:function(A){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(C,B){var A=null;switch(C.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.externalGraphic){A="image"}else{if(this.isComplexSymbol(B.graphicName)){A="use"}else{A="circle"}}break;case"OpenLayers.Geometry.Rectangle":A="rect";break;case"OpenLayers.Geometry.LineString":A="polyline";break;case"OpenLayers.Geometry.LinearRing":A="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":A="path";break;default:break}return A},setStyle:function(N,Q,B){Q=Q||N._style;B=B||N._options;var I=parseFloat(N.getAttributeNS(null,"r"));var H=1;var D;if(N._geometryClass=="OpenLayers.Geometry.Point"&&I){N.style.visibility="";if(Q.graphic===false){N.style.visibility="hidden"}else{if(Q.externalGraphic){D=this.getPosition(N);if(Q.graphicTitle){N.setAttributeNS(null,"title",Q.graphicTitle)}if(Q.graphicWidth&&Q.graphicHeight){N.setAttributeNS(null,"preserveAspectRatio","none")}var M=Q.graphicWidth||Q.graphicHeight;var K=Q.graphicHeight||Q.graphicWidth;M=M?M:Q.pointRadius*2;K=K?K:Q.pointRadius*2;var R=(Q.graphicXOffset!=undefined)?Q.graphicXOffset:-(0.5*M);var E=(Q.graphicYOffset!=undefined)?Q.graphicYOffset:-(0.5*K);var A=Q.graphicOpacity||Q.fillOpacity;N.setAttributeNS(null,"x",(D.x+R).toFixed());N.setAttributeNS(null,"y",(D.y+E).toFixed());N.setAttributeNS(null,"width",M);N.setAttributeNS(null,"height",K);N.setAttributeNS(this.xlinkns,"href",Q.externalGraphic);N.setAttributeNS(null,"style","opacity: "+A)}else{if(this.isComplexSymbol(Q.graphicName)){var C=Q.pointRadius*3;var J=C*2;var L=this.importSymbol(Q.graphicName);var P="#"+L;D=this.getPosition(N);H=this.symbolSize[L]/J;var F=N.parentNode;var G=N.nextSibling;if(F){F.removeChild(N)}N.setAttributeNS(this.xlinkns,"href",P);N.setAttributeNS(null,"width",J);N.setAttributeNS(null,"height",J);N.setAttributeNS(null,"x",D.x-C);N.setAttributeNS(null,"y",D.y-C);if(G){F.insertBefore(N,G)}else{if(F){F.appendChild(N)}}}else{N.setAttributeNS(null,"r",Q.pointRadius)}}}if(typeof Q.rotation!="undefined"&&D){var O=OpenLayers.String.format("rotate(${0} ${1} ${2})",[Q.rotation,D.x,D.y]);N.setAttributeNS(null,"transform",O)}}if(B.isFilled){N.setAttributeNS(null,"fill",Q.fillColor);N.setAttributeNS(null,"fill-opacity",Q.fillOpacity)}else{N.setAttributeNS(null,"fill","none")}if(B.isStroked){N.setAttributeNS(null,"stroke",Q.strokeColor);N.setAttributeNS(null,"stroke-opacity",Q.strokeOpacity);N.setAttributeNS(null,"stroke-width",Q.strokeWidth*H);N.setAttributeNS(null,"stroke-linecap",Q.strokeLinecap);N.setAttributeNS(null,"stroke-linejoin","round");N.setAttributeNS(null,"stroke-dasharray",this.dashStyle(Q,H))}else{N.setAttributeNS(null,"stroke","none")}if(Q.pointerEvents){N.setAttributeNS(null,"pointer-events",Q.pointerEvents)}if(Q.cursor!=null){N.setAttributeNS(null,"cursor",Q.cursor)}return N},dashStyle:function(C,B){var A=C.strokeWidth*B;switch(C.strokeDashstyle){case"solid":return"none";case"dot":return[1,4*A].join();case"dash":return[4*A,4*A].join();case"dashdot":return[4*A,4*A,1,4*A].join();case"longdash":return[8*A,4*A].join();case"longdashdot":return[8*A,4*A,1,4*A].join();default:return C.strokeDashstyle.replace(/ /g,",")}},createNode:function(A,C){var B=document.createElementNS(this.xmlns,A);if(C){B.setAttributeNS(null,"id",C)}return B},nodeTypeCompare:function(B,A){return(A==B.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(A){return this.nodeFactory(this.container.id+A,"g")},createDefs:function(){var A=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(A);return A},drawPoint:function(A,B){return this.drawCircle(A,B,1)},drawCircle:function(D,E,B){var C=this.getResolution();var A=(E.x/C+this.left);var F=(this.top-E.y/C);if(this.inValidRange(A,F)){D.setAttributeNS(null,"cx",A);D.setAttributeNS(null,"cy",F);D.setAttributeNS(null,"r",B);return D}else{return false}},drawLineString:function(B,C){var A=this.getComponentsString(C.components);if(A.path){B.setAttributeNS(null,"points",A.path);return(A.complete?B:null)}else{return false}},drawLinearRing:function(B,C){var A=this.getComponentsString(C.components);if(A.path){B.setAttributeNS(null,"points",A.path);return(A.complete?B:null)}else{return false}},drawPolygon:function(B,G){var F="";var H=true;var A=true;var C,I;for(var D=0,E=G.components.length;D<E;D++){F+=" M";C=this.getComponentsString(G.components[D].components," ");I=C.path;if(I){F+=" "+I;A=C.complete&&A}else{H=false}}F+=" z";if(H){B.setAttributeNS(null,"d",F);B.setAttributeNS(null,"fill-rule","evenodd");return A?B:null}else{return false}},drawRectangle:function(C,D){var B=this.getResolution();var A=(D.x/B+this.left);var E=(this.top-D.y/B);if(this.inValidRange(A,E)){C.setAttributeNS(null,"x",A);C.setAttributeNS(null,"y",E);C.setAttributeNS(null,"width",D.width/B);C.setAttributeNS(null,"height",D.height/B);return C}else{return false}},drawSurface:function(E,G){var F=null;var B=true;for(var D=0,A=G.components.length;D<A;D++){if((D%3)==0&&(D/3)==0){var C=this.getShortString(G.components[D]);if(!C){B=false}F="M "+C}else{if((D%3)==1){var C=this.getShortString(G.components[D]);if(!C){B=false}F+=" C "+C}else{var C=this.getShortString(G.components[D]);if(!C){B=false}F+=" "+C}}}F+=" Z";if(B){E.setAttributeNS(null,"d",F);return E}else{return false}},drawText:function(C,A,I){var B=this.getResolution();var H=(I.x/B+this.left);var E=(I.y/B-this.top);var G=this.nodeFactory(C+this.LABEL_ID_SUFFIX,"text");var F=this.nodeFactory(C+this.LABEL_ID_SUFFIX+"_tspan","tspan");G.setAttributeNS(null,"x",H);G.setAttributeNS(null,"y",-E);G.setAttributeNS(null,"pointer-events","none");if(A.fontColor){G.setAttributeNS(null,"fill",A.fontColor)}if(A.fontFamily){G.setAttributeNS(null,"font-family",A.fontFamily)}if(A.fontSize){G.setAttributeNS(null,"font-size",A.fontSize)}if(A.fontWeight){G.setAttributeNS(null,"font-weight",A.fontWeight)}var D=A.labelAlign||"cm";G.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[D[0]]||"middle");if(this.isGecko){G.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[D[1]]||"central")}else{F.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[D[1]]||"-35%")}F.textContent=A.label;if(!G.parentNode){G.appendChild(F);this.textRoot.appendChild(G)}},getComponentsString:function(E,D){var G=[];var A=true;var F=E.length;var J=[];var H,I,B;for(var C=0;C<F;C++){I=E[C];G.push(I);H=this.getShortString(I);if(H){J.push(H)}else{if(C>0){if(this.getShortString(E[C-1])){J.push(this.clipLine(E[C],E[C-1]))}}if(C<F-1){if(this.getShortString(E[C+1])){J.push(this.clipLine(E[C],E[C+1]))}}A=false}}return{path:J.join(D||","),complete:A}},clipLine:function(E,H){if(H.equals(E)){return""}var F=this.getResolution();var B=this.MAX_PIXEL-this.translationParameters.x;var A=this.MAX_PIXEL-this.translationParameters.y;var D=H.x/F+this.left;var J=this.top-H.y/F;var C=E.x/F+this.left;var I=this.top-E.y/F;var G;if(C<-B||C>B){G=(I-J)/(C-D);C=C<0?-B:B;I=J+(C-D)*G}if(I<-A||I>A){G=(C-D)/(I-J);I=I<0?-A:A;C=D+(I-J)*G}return C+","+I},getShortString:function(B){var C=this.getResolution();var A=(B.x/C+this.left);var D=(this.top-B.y/C);if(this.inValidRange(A,D)){return A+","+D}else{return false}},getPosition:function(A){return({x:parseFloat(A.getAttributeNS(null,"cx")),y:parseFloat(A.getAttributeNS(null,"cy"))})},importSymbol:function(E){if(!this.defs){this.defs=this.createDefs()}var B=this.container.id+"-"+E;if(document.getElementById(B)!=null){return B}var D=OpenLayers.Renderer.symbol[E];if(!D){throw new Error(E+" is not a valid symbol name");return }var G=this.nodeFactory(B,"symbol");var C=this.nodeFactory(null,"polygon");G.appendChild(C);var L=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var J="";var I,H;for(var F=0;F<D.length;F=F+2){I=D[F];H=D[F+1];L.left=Math.min(L.left,I);L.bottom=Math.min(L.bottom,H);L.right=Math.max(L.right,I);L.top=Math.max(L.top,H);J+=" "+I+","+H}C.setAttributeNS(null,"points",J);var A=L.getWidth();var K=L.getHeight();var M=[L.left-A,L.bottom-K,A*3,K*3];G.setAttributeNS(null,"viewBox",M.join(" "));this.symbolSize[B]=Math.max(A,K)*3;this.defs.appendChild(G);return G.id},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(B){if(!this.supported()){return }if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var E=document.createStyleSheet();var C=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var D=0,A=C.length;D<A;D++){E.addRule("olv\\:"+C[D],"behavior: url(#default#VML); position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.offset={x:0,y:0}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(I,A){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var C=this.getResolution();var B=I.left/C;var F=I.top/C-this.size.h;if(A){this.offset={x:B,y:F};B=0;F=0}else{B=B-this.offset.x;F=F-this.offset.y}var K=B+" "+F;this.root.coordorigin=K;var H=[this.root,this.vectorRoot,this.textRoot];var G;for(var D=0,E=H.length;D<E;++D){G=H[D];var J=this.size.w+" "+this.size.h;G.coordsize=J}this.root.style.flip="y";return true},setSize:function(F){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var D=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var C=this.size.w+"px";var G=this.size.h+"px";var B;for(var E=0,A=D.length;E<A;++E){B=D[E];B.style.width=C;B.style.height=G}},getNodeType:function(C,B){var A=null;switch(C.CLASS_NAME){case"OpenLayers.Geometry.Point":if(B.externalGraphic){A="olv:rect"}else{if(this.isComplexSymbol(B.graphicName)){A="olv:shape"}else{A="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":A="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":A="olv:shape";break;default:break}return A},setStyle:function(D,B,P,K){B=B||D._style;P=P||D._options;var I=1;if(D._geometryClass=="OpenLayers.Geometry.Point"){if(B.externalGraphic){if(B.graphicTitle){D.title=B.graphicTitle}var C=B.graphicWidth||B.graphicHeight;var L=B.graphicHeight||B.graphicWidth;C=C?C:B.pointRadius*2;L=L?L:B.pointRadius*2;var F=this.getResolution();var H=(B.graphicXOffset!=undefined)?B.graphicXOffset:-(0.5*C);var E=(B.graphicYOffset!=undefined)?B.graphicYOffset:-(0.5*L);D.style.left=((K.x/F-this.offset.x)+H).toFixed();D.style.top=((K.y/F-this.offset.y)-(E+L)).toFixed();D.style.width=C+"px";D.style.height=L+"px";D.style.flip="y";B.fillColor="none";P.isStroked=false}else{if(this.isComplexSymbol(B.graphicName)){var A=this.importSymbol(B.graphicName);D.path=A.path;D.coordorigin=A.left+","+A.bottom;var O=A.size;D.coordsize=O+","+O;this.drawCircle(D,K,B.pointRadius);D.style.flip="y"}else{this.drawCircle(D,K,B.pointRadius)}}}if(P.isFilled){D.fillcolor=B.fillColor}else{D.filled="false"}var J=D.getElementsByTagName("fill");var N=(J.length==0)?null:J[0];if(!P.isFilled){if(N){D.removeChild(N)}}else{if(!N){N=this.createNode("olv:fill",D.id+"_fill")}N.opacity=B.fillOpacity;if(D._geometryClass=="OpenLayers.Geometry.Point"&&B.externalGraphic){if(B.graphicOpacity){N.opacity=B.graphicOpacity}N.src=B.externalGraphic;N.type="frame";if(!(B.graphicWidth&&B.graphicHeight)){N.aspect="atmost"}}if(N.parentNode!=D){D.appendChild(N)}}if(typeof B.rotation!="undefined"){if(B.externalGraphic){this.graphicRotate(D,H,E);N.opacity=0}else{D.style.rotation=B.rotation}}if(P.isStroked){D.strokecolor=B.strokeColor;D.strokeweight=B.strokeWidth+"px"}else{D.stroked=false}var G=D.getElementsByTagName("stroke");var M=(G.length==0)?null:G[0];if(!P.isStroked){if(M){D.removeChild(M)}}else{if(!M){M=this.createNode("olv:stroke",D.id+"_stroke");D.appendChild(M)}M.opacity=B.strokeOpacity;M.endcap=!B.strokeLinecap||B.strokeLinecap=="butt"?"flat":B.strokeLinecap;M.dashstyle=this.dashStyle(B)}if(B.cursor!="inherit"&&B.cursor!=null){D.style.cursor=B.cursor}return D},graphicRotate:function(N,R,F){var Q=Q||N._style;var D=N._options;var A,J;if(!(Q.graphicWidth&&Q.graphicHeight)){var S=new Image();S.onreadystatechange=OpenLayers.Function.bind(function(){if(S.readyState=="complete"||S.readyState=="interactive"){A=S.width/S.height;J=Math.max(Q.pointRadius*2,Q.graphicWidth||0,Q.graphicHeight||0);R=R*A;Q.graphicWidth=J*A;Q.graphicHeight=J;this.graphicRotate(N,R,F)}},this);S.src=Q.externalGraphic;return }else{J=Math.max(Q.graphicWidth,Q.graphicHeight);A=Q.graphicWidth/Q.graphicHeight}var M=Math.round(Q.graphicWidth||J*A);var K=Math.round(Q.graphicHeight||J);N.style.width=M+"px";N.style.height=K+"px";var L=document.getElementById(N.id+"_image");if(!L){L=this.createNode("olv:imagedata",N.id+"_image");N.appendChild(L)}L.style.width=M+"px";L.style.height=K+"px";L.src=Q.externalGraphic;L.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var O=Q.rotation*Math.PI/180;var H=Math.sin(O);var E=Math.cos(O);var G="progid:DXImageTransform.Microsoft.Matrix(M11="+E+",M12="+(-H)+",M21="+H+",M22="+E+",SizingMethod='auto expand')\n";var B=Q.graphicOpacity||Q.fillOpacity;if(B&&B!=1){G+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+B+")\n"}N.style.filter=G;var P=new OpenLayers.Geometry.Point(-R,-F);var C=new OpenLayers.Bounds(0,0,M,K).toGeometry();C.rotate(Q.rotation,P);var I=C.getBounds();N.style.left=Math.round(parseInt(N.style.left)+I.left)+"px";N.style.top=Math.round(parseInt(N.style.top)-I.bottom)+"px"},postDraw:function(A){var C=A._style.fillColor;var B=A._style.strokeColor;if(C=="none"&&A.fillcolor!=C){A.fillcolor=C}if(B=="none"&&A.strokecolor!=B){A.strokecolor=B}},setNodeDimension:function(B,E){var D=E.getBounds();if(D){var A=this.getResolution();var C=new OpenLayers.Bounds((D.left/A-this.offset.x).toFixed(),(D.bottom/A-this.offset.y).toFixed(),(D.right/A-this.offset.x).toFixed(),(D.top/A-this.offset.y).toFixed());B.style.left=C.left+"px";B.style.top=C.top+"px";B.style.width=C.getWidth()+"px";B.style.height=C.getHeight()+"px";B.coordorigin=C.left+" "+C.top;B.coordsize=C.getWidth()+" "+C.getHeight()}},dashStyle:function(A){var C=A.strokeDashstyle;switch(C){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return C;default:var B=C.split(/[ ,]/);if(B.length==2){if(1*B[0]>=2*B[1]){return"longdash"}return(B[0]==1||B[1]==1)?"dot":"dash"}else{if(B.length==4){return(1*B[0]>=2*B[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(A,C){var B=document.createElement(A);if(C){B.id=C}B.unselectable="on";B.onselectstart=function(){return(false)};return B},nodeTypeCompare:function(C,B){var D=B;var A=D.indexOf(":");if(A!=-1){D=D.substr(A+1)}var E=C.nodeName;A=E.indexOf(":");if(A!=-1){E=E.substr(A+1)}return(D==E)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(A){return this.nodeFactory(this.container.id+A,"olv:group")},drawPoint:function(A,B){return this.drawCircle(A,B,1)},drawCircle:function(D,E,A){if(!isNaN(E.x)&&!isNaN(E.y)){var B=this.getResolution();D.style.left=((E.x/B-this.offset.x).toFixed()-A)+"px";D.style.top=((E.y/B-this.offset.y).toFixed()-A)+"px";var C=A*2;D.style.width=C+"px";D.style.height=C+"px";return D}return false},drawLineString:function(A,B){return this.drawLine(A,B,false)},drawLinearRing:function(A,B){return this.drawLine(A,B,true)},drawLine:function(B,J,G){this.setNodeDimension(B,J);var C=this.getResolution();var A=J.components.length;var E=new Array(A);var H,K,I;for(var F=0;F<A;F++){H=J.components[F];K=(H.x/C-this.offset.x);I=(H.y/C-this.offset.y);E[F]=" "+K.toFixed()+","+I.toFixed()+" l "}var D=(G)?" x e":" e";B.path="m"+E.join("")+D;return B},drawPolygon:function(B,J){this.setNodeDimension(B,J);var C=this.getResolution();var L=[];var F,E,D,H,A,G,K,I;for(D=0,H=J.components.length;D<H;D++){F=J.components[D];L.push("m");for(E=0,A=F.components.length;E<A;E++){G=F.components[E];K=G.x/C-this.offset.x;I=G.y/C-this.offset.y;L.push(" "+K.toFixed()+","+I.toFixed());if(E==0){L.push(" l")}}L.push(" x ")}L.push("e");B.path=L.join("");return B},drawRectangle:function(B,C){var A=this.getResolution();B.style.left=(C.x/A-this.offset.x)+"px";B.style.top=(C.y/A-this.offset.y)+"px";B.style.width=C.width/A+"px";B.style.height=C.height/A+"px";return B},drawText:function(D,A,H){var G=this.nodeFactory(D+this.LABEL_ID_SUFFIX,"olv:rect");var F=this.nodeFactory(D+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var C=this.getResolution();G.style.left=(H.x/C-this.offset.x).toFixed()+"px";G.style.top=(H.y/C-this.offset.y).toFixed()+"px";G.style.flip="y";F.innerText=A.label;if(A.fillColor){F.style.color=A.fontColor}if(A.fontFamily){F.style.fontFamily=A.fontFamily}if(A.fontSize){F.style.fontSize=A.fontSize}if(A.fontWeight){F.style.fontWeight=A.fontWeight}F.style.whiteSpace="nowrap";F.inset="1px,0px,0px,0px";if(!G.parentNode){G.appendChild(F);this.textRoot.appendChild(G)}var E=A.labelAlign||"cm";var I=F.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[E.substr(0,1)]);var B=F.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[E.substr(1,1)]);G.style.left=parseInt(G.style.left)-I-1+"px";G.style.top=parseInt(G.style.top)+B+"px"},drawSurface:function(A,G){this.setNodeDimension(A,G);var B=this.getResolution();var I=[];var D,H,F;for(var C=0,E=G.components.length;C<E;C++){D=G.components[C];H=D.x/B-this.offset.x;F=D.y/B-this.offset.y;if((C%3)==0&&(C/3)==0){I.push("m")}else{if((C%3)==1){I.push(" c")}}I.push(" "+H+","+F)}I.push(" x e");A.path=I.join("");return A},moveRoot:function(B){var A=this.map.getLayer(B.container.id);if(A instanceof OpenLayers.Layer.Vector.RootContainer){A=this.map.getLayer(this.container.id)}A&&A.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);A&&A.redraw()},importSymbol:function(D){var B=this.container.id+"-"+D;var A=this.symbolCache[B];if(A){return A}var C=OpenLayers.Renderer.symbol[D];if(!C){throw new Error(D+" is not a valid symbol name");return }var H=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var E=["m"];for(var F=0;F<C.length;F=F+2){x=C[F];y=C[F+1];H.left=Math.min(H.left,x);H.bottom=Math.min(H.bottom,y);H.right=Math.max(H.right,x);H.top=Math.max(H.top,y);E.push(x);E.push(y);if(F==0){E.push("l")}}E.push("x e");var I=E.join(" ");var G=(H.getWidth()-H.getHeight())/2;if(G>0){H.bottom=H.bottom-G;H.top=H.top+G}else{H.left=H.left-G;H.right=H.right+G}A={path:I,size:H.getWidth(),left:H.left,bottom:H.bottom};this.symbolCache[B]=A;return A},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Tile=OpenLayers.Class({EVENT_TYPES:["loadstart","loadend","reload","unload"],events:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:false,initialize:function(D,A,E,B,C){this.layer=D;this.position=A.clone();this.bounds=E.clone();this.url=B;this.size=C.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(A){if(A==null){A=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(A,this);return A},draw:function(){var A=this.layer.maxExtent;var B=(A&&this.bounds.intersectsBounds(A,false));this.shouldDraw=(B||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(B,A,C){if(C==null){C=true}this.bounds=B.clone();this.position=A.clone();if(C){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(A){var F=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(F);var D=this.layer.map.getLonLatFromLayerPx(A);var C=A.clone();C.x+=this.size.w;C.y+=this.size.h;var B=this.layer.map.getLonLatFromLayerPx(C);if(D.lon>B.lon){if(D.lon<0){D.lon=-180-(D.lon+180)}else{B.lon=180+B.lon+180}}var E=new OpenLayers.Bounds(D.lon,B.lat,B.lon,D.lat);return E},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(A){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[A]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var B in this.namespaces){this.namespaceAlias[this.namespaces[B]]=B}},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(A,B){this.namespaces[A]=B;this.namespaceAlias[B]=A},read:function(C){var A=C.indexOf("<");if(A>0){C=C.substring(A)}var B=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var D;if(window.ActiveXObject&&!this.xmldom){D=new ActiveXObject("Microsoft.XMLDOM")}else{D=this.xmldom}D.loadXML(C);return D}),this),function(){return new DOMParser().parseFromString(C,"text/xml")},function(){var D=new XMLHttpRequest();D.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(C),false);if(D.overrideMimeType){D.overrideMimeType("text/xml")}D.send(null);return D.responseXML});if(this.keepData){this.data=B}return B},write:function(B){var C;if(this.xmldom){C=B.xml}else{var A=new XMLSerializer();if(B.nodeType==1){var D=document.implementation.createDocument("","",null);if(D.importNode){B=D.importNode(B,true)}D.appendChild(B);C=A.serializeToString(D)}else{C=A.serializeToString(B)}}return C},createElementNS:function(C,A){var B;if(this.xmldom){if(typeof C=="string"){B=this.xmldom.createNode(1,A,C)}else{B=this.xmldom.createNode(1,A,"")}}else{B=document.createElementNS(C,A)}return B},createTextNode:function(B){var A;if(this.xmldom){A=this.xmldom.createTextNode(B)}else{A=document.createTextNode(B)}return A},getElementsByTagNameNS:function(E,D,C){var A=[];if(E.getElementsByTagNameNS){A=E.getElementsByTagNameNS(D,C)}else{var B=E.getElementsByTagName("*");var I,F;for(var G=0,H=B.length;G<H;++G){I=B[G];F=(I.prefix)?(I.prefix+":"+C):C;if((C=="*")||(F==I.nodeName)){if((D=="*")||(D==I.namespaceURI)){A.push(I)}}}}return A},getAttributeNodeNS:function(C,B,A){var I=null;if(C.getAttributeNodeNS){I=C.getAttributeNodeNS(B,A)}else{var E=C.attributes;var H,D;for(var F=0,G=E.length;F<G;++F){H=E[F];if(H.namespaceURI==B){D=(H.prefix)?(H.prefix+":"+A):A;if(D==H.nodeName){I=H;break}}}}return I},getAttributeNS:function(E,D,A){var B="";if(E.getAttributeNS){B=E.getAttributeNS(D,A)||""}else{var C=this.getAttributeNodeNS(E,D,A);if(C){B=C.nodeValue}}return B},getChildValue:function(A,C){var B=C||"";if(A){for(var D=A.firstChild;D;D=D.nextSibling){switch(D.nodeType){case 3:case 4:B+=D.nodeValue}}}return B},concatChildValues:function(B,D){var C="";var E=B.firstChild;var A;while(E){A=E.nodeValue;if(A){C+=A}E=E.nextSibling}if(C==""&&D!=undefined){C=D}return C},isSimpleContent:function(A){var C=true;for(var B=A.firstChild;B;B=B.nextSibling){if(B.nodeType===1){C=false;break}}return C},contentType:function(C){var E=false,B=false;var A=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var D=C.firstChild;D;D=D.nextSibling){switch(D.nodeType){case 1:B=true;break;case 8:break;default:E=true}if(B&&E){break}}if(B&&E){A=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(B){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(E){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return A},hasAttributeNS:function(C,B,A){var D=false;if(C.hasAttributeNS){D=C.hasAttributeNS(B,A)}else{D=!!this.getAttributeNodeNS(C,B,A)}return D},setAttributeNS:function(D,C,A,E){if(D.setAttributeNS){D.setAttributeNS(C,A,E)}else{if(this.xmldom){if(C){var B=D.ownerDocument.createNode(2,A,C);B.nodeValue=E;D.setAttributeNode(B)}else{D.setAttribute(A,E)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(B,A){A=A||{};var D=A.uri||this.namespaces[A.prefix];if(!D){var F=B.indexOf(":");D=this.namespaces[B.substring(0,F)]}if(!D){D=this.namespaces[this.defaultPrefix]}var C=this.createElementNS(D,B);if(A.attributes){this.setAttributes(C,A.attributes)}var E=A.value;if(E!=null){if(typeof E=="boolean"){E=String(E)}C.appendChild(this.createTextNode(E))}return C},setAttributes:function(C,E){var D,B;for(var A in E){if(E[A]!=null&&E[A].toString){D=E[A].toString();B=this.namespaces[A.substring(0,A.indexOf(":"))]||null;this.setAttributeNS(C,B,A,D)}}},readNode:function(C,E){if(!E){E={}}var D=this.readers[this.namespaceAlias[C.namespaceURI]];if(D){var B=C.localName||C.nodeName.split(":").pop();var A=D[B]||D["*"];if(A){A.apply(this,[C,E])}}return E},readChildNodes:function(D,E){if(!E){E={}}var C=D.childNodes;var F;for(var B=0,A=C.length;B<A;++B){F=C[B];if(F.nodeType==1){this.readNode(F,E)}}return E},writeNode:function(A,F,D){var E,C;var B=A.indexOf(":");if(B>0){E=A.substring(0,B);C=A.substring(B+1)}else{if(D){E=this.namespaceAlias[D.namespaceURI]}else{E=this.defaultPrefix}C=A}var G=this.writers[E][C].apply(this,[F]);if(D){D.appendChild(G)}return G},getChildEl:function(C,A,B){return C&&this.getThisOrNextEl(C.firstChild,A,B)},getNextEl:function(C,A,B){return C&&this.getThisOrNextEl(C.nextSibling,A,B)},getThisOrNextEl:function(D,A,C){outer:for(var B=D;B;B=B.nextSibling){switch(B.nodeType){case 1:if((!A||A===(B.localName||B.nodeName.split(":").pop()))&&(!C||C===B.namespaceURI)){break outer}B=null;break outer;case 3:if(/^\s*$/.test(B.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:B=null;break outer}}return B||null},lookupNamespaceURI:function(E,F){var D=null;if(E){if(E.lookupNamespaceURI){D=E.lookupNamespaceURI(F)}else{outer:switch(E.nodeType){case 1:if(E.namespaceURI!==null&&E.prefix===F){D=E.namespaceURI;break outer}var B=E.attributes.length;if(B){var A;for(var C=0;C<B;++C){A=E.attributes[C];if(A.prefix==="xmlns"&&A.name==="xmlns:"+F){D=A.value||null;break outer}else{if(A.name==="xmlns"&&F===null){D=A.value||null;break outer}}}}D=this.lookupNamespaceURI(E.parentNode,F);break outer;case 2:D=this.lookupNamespaceURI(E.ownerElement,F);break outer;case 9:D=this.lookupNamespaceURI(E.documentElement,F);break outer;case 6:case 12:case 10:case 11:break outer;default:D=this.lookupNamespaceURI(E.parentNode,F);break outer}}}return D},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3};OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(C,B,A){OpenLayers.Util.extend(this,A);this.control=C;this.callbacks=B;if(C.map){this.setMap(C.map)}OpenLayers.Util.extend(this,A);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(A){this.map=A},checkModifiers:function(A){if(this.keyMask==null){return true}var B=(A.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(A.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(A.altKey?OpenLayers.Handler.MOD_ALT:0);return(B==this.keyMask)},activate:function(){if(this.active){return false}var C=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var B=0,A=C.length;B<A;B++){if(this[C[B]]){this.register(C[B],this[C[B]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var C=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var B=0,A=C.length;B<A;B++){if(this[C[B]]){this.unregister(C[B],this[C[B]])}}this.active=false;return true},callback:function(B,A){if(B&&this.callbacks[B]){this.callbacks[B].apply(this.control,A)}},register:function(A,B){this.map.events.registerPriority(A,this,B);this.map.events.registerPriority(A,this,this.setEvent)},unregister:function(A,B){this.map.events.unregister(A,this,B);this.map.events.unregister(A,this,this.setEvent)},setEvent:function(A){this.evt=A;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(H,D){if(arguments.length===1&&typeof H==="object"){D=H;H=D&&D.div}this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,OpenLayers.Map.TILE_HEIGHT);this.maxExtent=new OpenLayers.Bounds(-180,-90,180,90);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";OpenLayers.Util.extend(this,D);this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(H);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var G=this.div.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(G,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);G=this.div.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(G);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var F=true;var C=document.getElementsByTagName("link");for(var E=0,A=C.length;E<A;++E){if(OpenLayers.Util.isEquivalentUrl(C.item(E).href,this.theme)){F=false;break}}if(F){var B=document.createElement("link");B.setAttribute("rel","stylesheet");B.setAttribute("type","text/css");B.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(B)}}this.layers=[];if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var E=0,A=this.controls.length;E<A;E++){this.addControlToMap(this.controls[E])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy)},render:function(A){this.div=OpenLayers.Util.getElement(A);OpenLayers.Element.addClass(this.div,"olMap");this.events.attachToElement(this.div);this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var A=this.controls.length-1;A>=0;--A){this.controls[A].destroy()}this.controls=null}if(this.layers!=null){for(var A=this.layers.length-1;A>=0;--A){this.layers[A].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null},setOptions:function(A){OpenLayers.Util.extend(this,A)},getTileSize:function(){return this.tileSize},getBy:function(E,C,A){var D=(typeof A.test=="function");var B=OpenLayers.Array.filter(this[E],function(F){return F[C]==A||(D&&A.test(F[C]))});return B},getLayersBy:function(B,A){return this.getBy("layers",B,A)},getLayersByName:function(A){return this.getLayersBy("name",A)},getLayersByClass:function(A){return this.getLayersBy("CLASS_NAME",A)},getControlsBy:function(B,A){return this.getBy("controls",B,A)},getControlsByClass:function(A){return this.getControlsBy("CLASS_NAME",A)},getLayer:function(E){var B=null;for(var D=0,A=this.layers.length;D<A;D++){var C=this.layers[D];if(C.id==E){B=C;break}}return B},setLayerZIndex:function(B,A){B.setZIndex(this.Z_INDEX_BASE[B.isBaseLayer?"BaseLayer":"Overlay"]+A*5)},resetLayersZIndex:function(){for(var C=0,A=this.layers.length;C<A;C++){var B=this.layers[C];this.setLayerZIndex(B,C)}},addLayer:function(C){for(var B=0,A=this.layers.length;B<A;B++){if(this.layers[B]==C){var D=OpenLayers.i18n("layerAlreadyAdded",{layerName:C.name});OpenLayers.Console.warn(D);return false}}if(this.allOverlays){C.isBaseLayer=false}this.events.triggerEvent("preaddlayer",{layer:C});C.div.className="olLayerDiv";C.div.style.overflow="";this.setLayerZIndex(C,this.layers.length);if(C.isFixed){this.viewPortDiv.appendChild(C.div)}else{this.layerContainerDiv.appendChild(C.div)}this.layers.push(C);C.setMap(this);if(C.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(C)}else{C.setVisibility(false)}}else{C.redraw()}this.events.triggerEvent("addlayer",{layer:C});C.afterAdd()},addLayers:function(C){for(var B=0,A=C.length;B<A;B++){this.addLayer(C[B])}},removeLayer:function(C,E){if(E==null){E=true}if(C.isFixed){this.viewPortDiv.removeChild(C.div)}else{this.layerContainerDiv.removeChild(C.div)}OpenLayers.Util.removeItem(this.layers,C);C.removeMap(this);C.map=null;if(this.baseLayer==C){this.baseLayer=null;if(E){for(var B=0,A=this.layers.length;B<A;B++){var D=this.layers[B];if(D.isBaseLayer||this.allOverlays){this.setBaseLayer(D);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:C})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(A){return OpenLayers.Util.indexOf(this.layers,A)},setLayerIndex:function(D,B){var E=this.getLayerIndex(D);if(B<0){B=0}else{if(B>this.layers.length){B=this.layers.length}}if(E!=B){this.layers.splice(E,1);this.layers.splice(B,0,D);for(var C=0,A=this.layers.length;C<A;C++){this.setLayerZIndex(this.layers[C],C)}this.events.triggerEvent("changelayer",{layer:D,property:"order"});if(this.allOverlays){if(B===0){this.setBaseLayer(D)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(B,C){var A=this.getLayerIndex(B)+C;this.setLayerIndex(B,A)},setBaseLayer:function(E){var D=null;if(this.baseLayer){D=this.baseLayer.getExtent()}if(E!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,E)!=-1){if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=E;this.viewRequestID++;if(!this.allOverlays){this.baseLayer.visibility=true}var A=this.getCenter();if(A!=null){var B=(D)?D.getCenterLonLat():A;var C=(D)?this.getZoomForExtent(D,true):this.getZoomForResolution(this.resolution,true);this.setCenter(B,C,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(B,A){this.controls.push(B);this.addControlToMap(B,A)},addControlToMap:function(B,A){B.outsideViewport=(B.div!=null);if(this.displayProjection&&!B.displayProjection){B.displayProjection=this.displayProjection}B.setMap(this);var C=B.draw(A);if(C){if(!B.outsideViewport){C.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(C)}}},getControl:function(E){var B=null;for(var C=0,A=this.controls.length;C<A;C++){var D=this.controls[C];if(D.id==E){B=D;break}}return B},removeControl:function(A){if((A)&&(A==this.getControl(A.id))){if(A.div&&(A.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(A.div)}OpenLayers.Util.removeItem(this.controls,A)}},addPopup:function(A,D){if(D){for(var B=this.popups.length-1;B>=0;--B){this.removePopup(this.popups[B])}}A.map=this;this.popups.push(A);var C=A.draw();if(C){C.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(C)}},removePopup:function(A){OpenLayers.Util.removeItem(this.popups,A);if(A.div){try{this.layerContainerDiv.removeChild(A.div)}catch(B){}}A.map=null},getSize:function(){var A=null;if(this.size!=null){A=this.size.clone()}return A},updateSize:function(){this.events.clearMouseCache();var C=this.getCurrentSize();var F=this.getSize();if(F==null){this.size=F=C}if(!C.equals(F)){this.size=C;for(var D=0,B=this.layers.length;D<B;D++){this.layers[D].onMapResize()}if(this.baseLayer!=null){var A=new OpenLayers.Pixel(C.w/2,C.h/2);var G=this.getLonLatFromViewPortPx(A);var E=this.getZoom();this.zoom=null;this.setCenter(this.getCenter(),E)}}},getCurrentSize:function(){var A=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(A.w==0&&A.h==0||isNaN(A.w)&&isNaN(A.h)){var B=OpenLayers.Element.getDimensions(this.div);A.w=B.width;A.h=B.height}if(A.w==0&&A.h==0||isNaN(A.w)&&isNaN(A.h)){A.w=parseInt(this.div.style.width);A.h=parseInt(this.div.style.height)}return A},calculateBounds:function(A,B){var E=null;if(A==null){A=this.getCenter()}if(B==null){B=this.getResolution()}if((A!=null)&&(B!=null)){var D=this.getSize();var F=D.w*B;var C=D.h*B;E=new OpenLayers.Bounds(A.lon-F/2,A.lat-C/2,A.lon+F/2,A.lat+C/2)}return E},getCenter:function(){var A=null;if(this.center){A=this.center.clone()}return A},getZoom:function(){return this.zoom},pan:function(D,C,E){E=OpenLayers.Util.applyDefaults(E,{animate:true,dragging:false});var F=this.getViewPortPxFromLonLat(this.getCenter());var B=F.add(D,C);if(!E.dragging||!B.equals(F)){var A=this.getLonLatFromViewPortPx(B);if(E.animate){this.panTo(A)}else{this.setCenter(A,null,E.dragging)}}},panTo:function(B){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(B)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var A=this.getCenter();if(B.lon==A.lon&&B.lat==A.lat){return }var D={lon:A.lon,lat:A.lat};var C={lon:B.lon,lat:B.lat};this.panTween.start(D,C,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(E){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(E){E=new OpenLayers.LonLat(E.lon,E.lat);this.moveTo(E,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(E){E=new OpenLayers.LonLat(E.lon,E.lat);this.moveTo(E,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(B)}},setCenter:function(C,A,B,D){this.moveTo(C,A,{dragging:B,forceZoomChange:D,caller:"setCenter"})},moveTo:function(G,M,P){if(!P){P={}}var L=P.dragging;var C=P.forceZoomChange;var H=P.noEvent;if(this.panTween&&P.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(G)){G=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(G==null){G=this.getCenter()}if(M==null){M=this.getZoom()}var D=this.getResolutionForZoom(M);var N=this.calculateBounds(G,D);if(!this.restrictedExtent.containsBounds(N)){var O=this.restrictedExtent.getCenterLonLat();if(N.getWidth()>this.restrictedExtent.getWidth()){G=new OpenLayers.LonLat(O.lon,G.lat)}else{if(N.left<this.restrictedExtent.left){G=G.add(this.restrictedExtent.left-N.left,0)}else{if(N.right>this.restrictedExtent.right){G=G.add(this.restrictedExtent.right-N.right,0)}}}if(N.getHeight()>this.restrictedExtent.getHeight()){G=new OpenLayers.LonLat(G.lon,O.lat)}else{if(N.bottom<this.restrictedExtent.bottom){G=G.add(0,this.restrictedExtent.bottom-N.bottom)}else{if(N.top>this.restrictedExtent.top){G=G.add(0,this.restrictedExtent.top-N.top)}}}}}var B=C||((this.isValidZoomLevel(M))&&(M!=this.getZoom()));var E=(this.isValidLonLat(G))&&(!G.equals(this.center));if(B||E||!L){if(!this.dragging&&!H){this.events.triggerEvent("movestart")}if(E){if((!B)&&(this.center)){this.centerLayerContainer(G)}this.center=G.clone()}if((B)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(B){this.zoom=M;this.resolution=this.getResolutionForZoom(M);this.viewRequestID++}var A=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(A,B,L);if(L){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:B})}}A=this.baseLayer.getExtent();for(var F=0,J=this.layers.length;F<J;F++){var I=this.layers[F];if(I!==this.baseLayer&&!I.isBaseLayer){var K=I.calculateInRange();if(I.inRange!=K){I.inRange=K;if(!K){I.display(false)}this.events.triggerEvent("changelayer",{layer:I,property:"visibility"})}if(K&&I.visibility){I.moveTo(A,B,L);if(L){I.events.triggerEvent("move")}else{I.events.triggerEvent("moveend",{zoomChanged:B})}}}}if(B){for(var F=0,J=this.popups.length;F<J;F++){this.popups[F].updatePosition()}}this.events.triggerEvent("move");if(B){this.events.triggerEvent("zoomend")}}if(!L&&!H){this.events.triggerEvent("moveend")}this.dragging=!!L},centerLayerContainer:function(B){var A=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var C=this.getViewPortPxFromLonLat(B);if((A!=null)&&(C!=null)){this.layerContainerDiv.style.left=Math.round(A.x-C.x)+"px";this.layerContainerDiv.style.top=Math.round(A.y-C.y)+"px"}},isValidZoomLevel:function(A){return((A!=null)&&(A>=0)&&(A<this.getNumZoomLevels()))},isValidLonLat:function(C){var B=false;if(C!=null){var A=this.getMaxExtent();B=A.containsLonLat(C)}return B},getProjection:function(){var A=this.getProjectionObject();return A?A.getCode():null},getProjectionObject:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.projection}return A},getMaxResolution:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.maxResolution}return A},getMaxExtent:function(B){var A=null;if(B&&B.restricted&&this.restrictedExtent){A=this.restrictedExtent}else{if(this.baseLayer!=null){A=this.baseLayer.maxExtent}}return A},getNumZoomLevels:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.numZoomLevels}return A},getExtent:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getExtent()}return A},getResolution:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getResolution()}return A},getUnits:function(){var A=null;if(this.baseLayer!=null){A=this.baseLayer.units}return A},getScale:function(){var C=null;if(this.baseLayer!=null){var B=this.getResolution();var A=this.baseLayer.units;C=OpenLayers.Util.getScaleFromResolution(B,A)}return C},getZoomForExtent:function(C,B){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getZoomForExtent(C,B)}return A},getResolutionForZoom:function(B){var A=null;if(this.baseLayer){A=this.baseLayer.getResolutionForZoom(B)}return A},getZoomForResolution:function(A,C){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getZoomForResolution(A,C)}return B},zoomTo:function(A){if(this.isValidZoomLevel(A)){this.setCenter(null,A)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(D,C){var B=D.getCenterLonLat();if(this.baseLayer.wrapDateLine){var A=this.getMaxExtent();D=D.clone();while(D.right<D.left){D.right+=A.getWidth()}B=D.getCenterLonLat().wrapDateLine(A)}this.setCenter(B,this.getZoomForExtent(D,C))},zoomToMaxExtent:function(C){var B=(C)?C.restricted:true;var A=this.getMaxExtent({restricted:B});this.zoomToExtent(A)},zoomToScale:function(H,G){var D=OpenLayers.Util.getResolutionFromScale(H,this.baseLayer.units);var C=this.getSize();var F=C.w*D;var B=C.h*D;var A=this.getCenter();var E=new OpenLayers.Bounds(A.lon-F/2,A.lat-B/2,A.lon+F/2,A.lat+B/2);this.zoomToExtent(E,G)},getLonLatFromViewPortPx:function(A){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getLonLatFromViewPortPx(A)}return B},getViewPortPxFromLonLat:function(B){var A=null;if(this.baseLayer!=null){A=this.baseLayer.getViewPortPxFromLonLat(B)}return A},getLonLatFromPixel:function(A){return this.getLonLatFromViewPortPx(A)},getPixelFromLonLat:function(B){var A=this.getViewPortPxFromLonLat(B);A.x=Math.round(A.x);A.y=Math.round(A.y);return A},getViewPortPxFromLayerPx:function(D){var C=null;if(D!=null){var B=parseInt(this.layerContainerDiv.style.left);var A=parseInt(this.layerContainerDiv.style.top);C=D.add(B,A)}return C},getLayerPxFromViewPortPx:function(C){var D=null;if(C!=null){var B=-parseInt(this.layerContainerDiv.style.left);var A=-parseInt(this.layerContainerDiv.style.top);D=C.add(B,A);if(isNaN(D.x)||isNaN(D.y)){D=null}}return D},getLonLatFromLayerPx:function(A){A=this.getViewPortPxFromLayerPx(A);return this.getLonLatFromViewPortPx(A)},getLayerPxFromLonLat:function(B){var A=this.getPixelFromLonLat(B);return this.getLayerPxFromViewPortPx(A)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(C,B){this.lonlat=C;var A=(B)?B:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=A}else{this.icon.url=A.url;this.icon.size=A.size;this.icon.offset=A.offset;this.icon.calculateOffset=A.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(A){return this.icon.draw(A)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(A){if((A!=null)&&(this.icon!=null)){this.icon.moveTo(A)}this.lonlat=this.map.getLonLatFromLayerPx(A)},isDrawn:function(){var A=(this.icon&&this.icon.isDrawn());return A},onScreen:function(){var B=false;if(this.map){var A=this.map.getExtent();B=A.containsLonLat(this.lonlat)}return B},inflate:function(B){if(this.icon){var A=new OpenLayers.Size(this.icon.size.w*B,this.icon.size.h*B);this.icon.setSize(A)}},setOpacity:function(A){this.icon.setOpacity(A)},setUrl:function(A){this.icon.setUrl(A)},display:function(A){this.icon.display(A)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var A=OpenLayers.Util.getImagesLocation()+"marker.png";var B=new OpenLayers.Size(21,25);var C=function(D){return new OpenLayers.Pixel(-(D.w/2),-D.h)};return new OpenLayers.Icon(A,B,null,C)};OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(D){var G=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});D=OpenLayers.Util.applyDefaults(D,G);var F=new OpenLayers.Request.XMLHttpRequest();var A=D.url;if(D.params){var E=OpenLayers.Util.getParameterString(D.params);if(E.length>0){var I=(A.indexOf("?")>-1)?"&":"?";A+=I+E}}if(D.proxy&&(A.indexOf("http")==0)){A=D.proxy+encodeURIComponent(A)}F.open(D.method,A,D.async,D.user,D.password);for(var H in D.headers){F.setRequestHeader(H,D.headers[H])}var B=(D.scope)?OpenLayers.Function.bind(D.callback,D.scope):D.callback;var J;if(D.success){J=(D.scope)?OpenLayers.Function.bind(D.success,D.scope):D.success}var C;if(D.failure){C=(D.scope)?OpenLayers.Function.bind(D.failure,D.scope):D.failure}var K=this.events;F.onreadystatechange=function(){if(F.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var L=K.triggerEvent("complete",{request:F,config:D,requestUrl:A});if(L!==false){B(F);if(!F.status||(F.status>=200&&F.status<300)){K.triggerEvent("success",{request:F,config:D,requestUrl:A});if(J){J(F)}}if(F.status&&(F.status<200||F.status>=300)){K.triggerEvent("failure",{request:F,config:D,requestUrl:A});if(C){C(F)}}}}};if(D.async===false){F.send(D.data)}else{window.setTimeout(function(){F.send(D.data)},0)}return F},GET:function(A){A=OpenLayers.Util.extend(A,{method:"GET"});return OpenLayers.Request.issue(A)},POST:function(A){A=OpenLayers.Util.extend(A,{method:"POST"});A.headers=A.headers?A.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(A.headers))){A.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(A)},PUT:function(A){A=OpenLayers.Util.extend(A,{method:"PUT"});A.headers=A.headers?A.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(A.headers))){A.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(A)},DELETE:function(A){A=OpenLayers.Util.extend(A,{method:"DELETE"});return OpenLayers.Request.issue(A)},HEAD:function(A){A=OpenLayers.Util.extend(A,{method:"HEAD"});return OpenLayers.Request.issue(A)},OPTIONS:function(A){A=OpenLayers.Util.extend(A,{method:"OPTIONS"});return OpenLayers.Request.issue(A)}};OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,initialize:function(D,A,E,B,C){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=B;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id)}OpenLayers.Event.stopObservingElement(this.imgDiv.id);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(A){if(A==null){A=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}A=OpenLayers.Tile.prototype.clone.apply(this,[A]);A.imgDiv=null;return A},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var A=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(A){if(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();this.backBufferTile.isBackBuffer=true;this.events.register("loadend",this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer)}this.startTransition()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(A&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!A){return false}if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}return this.renderTile()},resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;var A=this.layer.maxExtent;var B=(A&&this.bounds.intersectsBounds(A,false));if(B){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.imageSize||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}this.backBufferTile.hide()}},renderTile:function(){if(this.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return }OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var A=this.layer.getImageSize();if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,A,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,A);this.imgDiv.src=this.url}},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}}},initImgDiv:function(){var D=this.layer.imageOffset;var B=this.layer.getImageSize();if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,D,B,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,D,B,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var C=function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("loadend")}};if(this.layerAlphaHack){OpenLayers.Event.observe(this.imgDiv.childNodes[0],"load",OpenLayers.Function.bind(C,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(C,this))}var A=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){C.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(A,this))},checkImgURL:function(){if(this.layer){var A=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(A,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return }var D=1;if(this.backBufferTile.resolution){D=this.backBufferTile.resolution/this.layer.getResolution()}if(D!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var C=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var B=new OpenLayers.Size(this.backBufferTile.size.w*D,this.backBufferTile.size.h*D);var A=this.layer.map.getLayerPxFromLonLat(C);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,A,B);var E=this.backBufferTile.imageSize;E=new OpenLayers.Size(E.w*D,E.h*D);var F=this.backBufferTile.imageOffset;if(F){F=new OpenLayers.Pixel(F.x*D,F.y*D)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,F,E);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=D},show:function(){this.frame.style.display="";if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:false,handlers:null,resolutionFactor:1,initialize:function(A){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[A])},destroy:function(){if(!this.mapDiv){return }this.handlers.click.destroy();this.mapDiv.removeChild(this.extentRectangle);this.extentRectangle=null;this.rectEvents.destroy();this.rectEvents=null;this.ovmap.destroy();this.ovmap=null;this.element.removeChild(this.mapDiv);this.mapDiv=null;this.div.removeChild(this.element);this.element=null;if(this.maximizeDiv){OpenLayers.Event.stopObservingElement(this.maximizeDiv);this.div.removeChild(this.maximizeDiv);this.maximizeDiv=null}if(this.minimizeDiv){OpenLayers.Event.stopObservingElement(this.minimizeDiv);this.div.removeChild(this.minimizeDiv);this.minimizeDiv=null}this.map.events.un({moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!(this.layers.length>0)){if(this.map.baseLayer){var D=this.map.baseLayer.clone();this.layers=[D]}else{this.map.events.register("changebaselayer",this,this.baseLayerDraw);return this.div}}this.element=document.createElement("div");this.element.className=this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1000;this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var E=OpenLayers.Util.getImagesLocation();var B=E+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),B,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var B=E+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),B,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var F=["dblclick","mousedown"];for(var C=0,A=F.length;C<A;C++){OpenLayers.Event.observe(this.maximizeDiv,F[C],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,F[C],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(I){var D=this.handlers.drag.last.x-I.x;var B=this.handlers.drag.last.y-I.y;if(D!=0||B!=0){var G=this.rectPxBounds.top;var A=this.rectPxBounds.left;var E=Math.abs(this.rectPxBounds.getHeight());var C=this.rectPxBounds.getWidth();var F=Math.max(0,(G-B));F=Math.min(F,this.ovmap.size.h-this.hComp-E);var H=Math.max(0,(A-D));H=Math.min(H,this.ovmap.size.w-this.wComp-C);this.setRectPxBounds(new OpenLayers.Bounds(H,F+E,H+C,F))}},mapDivClick:function(I){var B=this.rectPxBounds.getCenterPixel();var E=I.xy.x-B.x;var D=I.xy.y-B.y;var G=this.rectPxBounds.top;var C=this.rectPxBounds.left;var J=Math.abs(this.rectPxBounds.getHeight());var A=this.rectPxBounds.getWidth();var F=Math.max(0,(G+D));F=Math.min(F,this.ovmap.size.h-J);var H=Math.max(0,(C+E));H=Math.min(H,this.ovmap.size.w-A);this.setRectPxBounds(new OpenLayers.Bounds(H,F+J,H+A,F));this.updateMapToRect()},maximizeControl:function(A){this.element.style.display="";this.showToggle(false);if(A!=null){OpenLayers.Event.stop(A)}},minimizeControl:function(A){this.element.style.display="none";this.showToggle(true);if(A!=null){OpenLayers.Event.stop(A)}},showToggle:function(A){this.maximizeDiv.style.display=A?"":"none";this.minimizeDiv.style.display=A?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var B=this.map.getExtent();var A=this.map.maxExtent;var C=new OpenLayers.Bounds(Math.max(B.left,A.left),Math.max(B.bottom,A.bottom),Math.min(B.right,A.right),Math.min(B.top,A.top));if(this.ovmap.getProjection()!=this.map.getProjection()){C=C.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var D=this.ovmap.getResolution()/this.map.getResolution();return((D>this.minRatio)&&(D<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(C)))},updateOverview:function(){var C=this.map.getResolution();var B=this.ovmap.getResolution();var D=B/C;if(D>this.maxRatio){B=this.minRatio*C}else{if(D<=this.minRatio){B=this.maxRatio*C}}var A;if(this.ovmap.getProjection()!=this.map.getProjection()){A=this.map.center.clone();A.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{A=this.map.center}this.ovmap.setCenter(A,this.ovmap.getZoomForResolution(B*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var B=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,B);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(D){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(D){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var C=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var A=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=C&&A?OpenLayers.INCHES_PER_UNIT[C]/OpenLayers.INCHES_PER_UNIT[A]:1}},updateRectToMap:function(){var B;if(this.ovmap.getProjection()!=this.map.getProjection()){B=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{B=this.map.getExtent()}var A=this.getRectBoundsFromMapBounds(B);if(A){this.setRectPxBounds(A)}},updateMapToRect:function(){var A=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){A=A.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(A.getCenterLonLat())},setRectPxBounds:function(D){var G=Math.max(D.top,0);var E=Math.max(D.left,0);var B=Math.min(D.top+Math.abs(D.getHeight()),this.ovmap.size.h-this.hComp);var H=Math.min(D.left+D.getWidth(),this.ovmap.size.w-this.wComp);var C=Math.max(H-E,0);var I=Math.max(B-G,0);if(C<this.minRectSize||I<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var F=E+(C/2)-(this.minRectSize/2);var A=G+(I/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(A)+"px";this.extentRectangle.style.left=Math.round(F)+"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(G)+"px";this.extentRectangle.style.left=Math.round(E)+"px";this.extentRectangle.style.height=Math.round(I)+"px";this.extentRectangle.style.width=Math.round(C)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(E),Math.round(B),Math.round(H),Math.round(G))},getRectBoundsFromMapBounds:function(D){var A=new OpenLayers.LonLat(D.left,D.bottom);var F=new OpenLayers.LonLat(D.right,D.top);var C=this.getOverviewPxFromLonLat(A);var B=this.getOverviewPxFromLonLat(F);var E=null;if(C&&B){E=new OpenLayers.Bounds(C.x,C.y,B.x,B.y)}return E},getMapBoundsFromRectBounds:function(D){var C=new OpenLayers.Pixel(D.left,D.bottom);var B=new OpenLayers.Pixel(D.right,D.top);var A=this.getLonLatFromOverviewPx(C);var E=this.getLonLatFromOverviewPx(B);return new OpenLayers.Bounds(A.lon,A.lat,E.lon,E.lat)},getLonLatFromOverviewPx:function(F){var C=this.ovmap.size;var B=this.ovmap.getResolution();var A=this.ovmap.getExtent().getCenterLonLat();var E=F.x-(C.w/2);var D=F.y-(C.h/2);return new OpenLayers.LonLat(A.lon+E*B,A.lat-D*B)},getOverviewPxFromLonLat:function(D){var B=this.ovmap.getResolution();var C=this.ovmap.getExtent();var A=null;if(C){A=new OpenLayers.Pixel(Math.round(1/B*(D.lon-C.left)),Math.round(1/B*(C.top-D.lat)))}return A},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(A,C,B){this.layer=A;this.lonlat=C;this.data=(B!=null)?B:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}this.layer=null;this.id=null;this.lonlat=null;this.data=null;if(this.marker!=null){this.destroyMarker(this.marker);this.marker=null}if(this.popup!=null){this.destroyPopup(this.popup);this.popup=null}},onScreen:function(){var B=false;if((this.layer!=null)&&(this.layer.map!=null)){var A=this.layer.map.getExtent();B=A.containsLonLat(this.lonlat)}return B},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(B){if(this.lonlat!=null){var C=this.id+"_popup";var A=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(C,this.lonlat,this.data.popupSize,this.data.popupContentHTML,A,B)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:true,"double":false,pixelTolerance:0,stopSingle:false,stopDouble:false,timerId:null,down:null,rightclickTimerId:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(D){this.down=D.xy;return true}}},mousedown:null,mouseup:function(B){var A=true;if(this.checkModifiers(B)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(B)){A=this.rightclick(B)}return A},rightclick:function(B){if(this.passesTolerance(B)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[B]);return !this.stopDouble}else{var A=this["double"]?OpenLayers.Util.extend({},B):this.callback("rightclick",[B]);var C=OpenLayers.Function.bind(this.delayedRightCall,this,A);this.rightclickTimerId=window.setTimeout(C,this.delay)}}return !this.stopSingle},delayedRightCall:function(A){this.rightclickTimerId=null;if(A){this.callback("rightclick",[A])}return !this.stopSingle},dblclick:function(A){if(this.passesTolerance(A)){if(this["double"]){this.callback("dblclick",[A])}this.clearTimer()}return !this.stopDouble},click:function(B){if(this.passesTolerance(B)){if(this.timerId!=null){this.clearTimer()}else{var A=this.single?OpenLayers.Util.extend({},B):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,A),this.delay)}}return !this.stopSingle},passesTolerance:function(B){var C=true;if(this.pixelTolerance!=null&&this.down){var A=Math.sqrt(Math.pow(this.down.x-B.xy.x,2)+Math.pow(this.down.y-B.xy.y,2));if(A>this.pixelTolerance){C=false}}return C},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}if(this.rightclickTimerId!=null){window.clearTimeout(this.rightclickTimerId);this.rightclickTimerId=null}},delayedCall:function(A){this.timerId=null;if(A){this.callback("click",[A])}},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;A=true}return A},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(A){},move:function(A){},up:function(A){},out:function(A){},mousedown:function(B){var A=true;this.dragging=false;if(this.checkModifiers(B)&&OpenLayers.Event.isLeftClick(B)){this.started=true;this.start=B.xy;this.last=B.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(B);this.callback("down",[B.xy]);OpenLayers.Event.stop(B);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:function(){return true};document.onselectstart=function(){return false}}A=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return A},mousemove:function(A){if(this.started&&!this.timeoutId&&(A.xy.x!=this.last.x||A.xy.y!=this.last.y)){if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(A);this.callback("move",[A.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=function(){return false}}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(B){if(this.started){var A=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(B);this.callback("up",[B.xy]);if(A){this.callback("done",[B.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(B){if(this.started&&OpenLayers.Util.mouseLeft(B,this.map.div)){var A=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(B);this.callback("out",[]);if(A){this.callback("done",[B.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}return true},click:function(A){return(this.start==this.last)},activate:function(){var A=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;A=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return A},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:true,stopDown:true,stopUp:false,initialize:function(D,B,C,A){OpenLayers.Handler.prototype.initialize.apply(this,[D,C,A]);this.layer=B},mousedown:function(A){this.down=A.xy;return this.handle(A)?!this.stopDown:true},mouseup:function(A){this.up=A.xy;return this.handle(A)?!this.stopUp:true},click:function(A){return this.handle(A)?!this.stopClick:true},mousemove:function(A){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(A);return true},dblclick:function(A){return !this.handle(A)},geometryTypeMatches:function(A){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,A.geometry.CLASS_NAME)>-1},handle:function(A){if(this.feature&&!this.feature.layer){this.feature=null}var C=A.type;var F=false;var E=!!(this.feature);var D=(C=="click"||C=="dblclick");this.feature=this.layer.getFeatureFromEvent(A);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var B=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(E&&B){if(this.lastFeature){this.triggerCallback(C,"out",[this.lastFeature])}this.triggerCallback(C,"in",[this.feature])}else{if(!E||D){this.triggerCallback(C,"in",[this.feature])}}this.lastFeature=this.feature;F=true}else{if(this.lastFeature&&(E&&B||D)){this.triggerCallback(C,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(E||D)){this.triggerCallback(C,"out",[this.lastFeature])}}return F},triggerCallback:function(D,E,B){var C=this.EVENTMAP[D][E];if(C){if(D=="click"&&this.up&&this.down){var A=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(A<=this.clickTolerance){this.callback(C,B)}}else{this.callback(C,B)}}},activate:function(){var A=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});A=true}return A},handleMapEvents:function(A){if(!A.property||A.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var A=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(A)},moveLayerBack:function(){var A=this.layer.getZIndex()-1;if(A>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(A)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(A){if(this.passesTolerance(A.xy)){this.clearTimer();this.callback("move",[A]);this.px=A.xy;A=OpenLayers.Util.extend({},A);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,A),this.delay)}return !this.stopMove},mouseout:function(A){if(OpenLayers.Util.mouseLeft(A,this.map.div)){this.clearTimer();this.callback("move",[A])}return true},passesTolerance:function(B){var C=true;if(this.pixelTolerance&&this.px){var A=Math.sqrt(Math.pow(this.px.x-B.x,2)+Math.pow(this.px.y-B.y,2));if(A<this.pixelTolerance){C=false}}return C},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(A){this.callback("pause",[A])},deactivate:function(){var A=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();A=true}return A},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(I){if(!this.map||!this.checkModifiers(I)){return }var F=false;var J=false;var E=false;var B=OpenLayers.Event.element(I);while((B!=null)&&!E&&!F){if(!F){try{if(B.currentStyle){C=B.currentStyle.overflow}else{var A=document.defaultView.getComputedStyle(B,null);var C=A.getPropertyValue("overflow")}F=(C&&(C=="auto")||(C=="scroll"))}catch(D){}}if(!J){for(var G=0,H=this.map.layers.length;G<H;G++){if(B==this.map.layers[G].div||B==this.map.layers[G].pane){J=true;break}}}E=(B==this.map.div);B=B.parentNode}if(!F&&E){if(J){this.wheelZoom(I)}OpenLayers.Event.stop(I)}},wheelZoom:function(A){var B=0;if(!A){A=window.event}if(A.wheelDelta){B=A.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){B=-B}}else{if(A.detail){B=-A.detail/3}}if(B){if(this.mousePosition){A.xy=this.mousePosition}if(!A.xy){A.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(B<0){this.callback("down",[A,B])}else{this.callback("up",[A,B])}}},mousemove:function(A){this.mousePosition=A.xy},activate:function(A){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var B=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",B);OpenLayers.Event.observe(window,"mousewheel",B);OpenLayers.Event.observe(document,"mousewheel",B);return true}else{return false}},deactivate:function(A){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var B=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",B);OpenLayers.Event.stopObserving(window,"mousewheel",B);OpenLayers.Event.stopObserving(document,"mousewheel",B);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(B,A){this.addOptions(A);this.name=B;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.div.dir="ltr";this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true}},destroy:function(A){if(A==null){A=true}if(this.map!=null){this.map.removeLayer(this,A)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(A){if(A==null){A=new OpenLayers.Layer(this.name,this.options)}OpenLayers.Util.applyDefaults(A,this);A.map=null;return A},setName:function(A){if(A!=this.name){this.name=A;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(A){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,A);OpenLayers.Util.extend(this,A)},onMapResize:function(){},redraw:function(){var B=false;if(this.map){this.inRange=this.calculateInRange();var C=this.getExtent();if(C&&this.inRange&&this.visibility){var A=true;this.moveTo(C,A,false);this.events.triggerEvent("moveend",{zoomChanged:A});B=true}}return B},moveTo:function(B,A,C){var D=this.visibility;if(!this.isBaseLayer){D=D&&this.inRange}this.display(D)},setMap:function(B){if(this.map==null){this.map=B;this.maxExtent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var A=((this.visibility)&&(this.inRange));this.div.style.display=A?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(A){},getImageSize:function(){return(this.imageSize||this.tileSize)},setTileSize:function(A){var B=(A)?A:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=B;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(B.w+(2*this.gutter),B.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(A){if(A!=this.visibility){this.visibility=A;this.display(A);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(A){var B=this.calculateInRange();if(A!=(this.div.style.display!="none")){this.div.style.display=(A&&B)?"block":"none"}},calculateInRange:function(){var B=false;if(this.alwaysInRange){B=true}else{if(this.map){var A=this.map.getResolution();B=((A>=this.minResolution)&&(A<=this.maxResolution))}}return B},setIsBaseLayer:function(A){if(A!=this.isBaseLayer){this.isBaseLayer=A;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var M=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var B=["projection","units"];var E=false;var D={};for(var F=0,I=M.length;F<I;F++){var O=M[F];if(this.options[O]&&OpenLayers.Util.indexOf(B,O)==-1){E=true}D[O]=this.options[O]||this.map[O]}if(this.alwaysInRange==null){this.alwaysInRange=!E}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){D.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){D.resolutions=null}if((!D.numZoomLevels)&&(D.maxZoomLevel)){D.numZoomLevels=D.maxZoomLevel+1}if((D.scales!=null)||(D.resolutions!=null)){if(D.scales!=null){D.resolutions=[];for(var F=0,I=D.scales.length;F<I;F++){var C=D.scales[F];D.resolutions[F]=OpenLayers.Util.getResolutionFromScale(C,D.units)}}D.numZoomLevels=D.resolutions.length}else{if(D.minScale){D.maxResolution=OpenLayers.Util.getResolutionFromScale(D.minScale,D.units)}else{if(D.maxResolution=="auto"){var N=this.map.getSize();var L=D.maxExtent.getWidth()/N.w;var H=D.maxExtent.getHeight()/N.h;D.maxResolution=Math.max(L,H)}}if(D.maxScale!=null){D.minResolution=OpenLayers.Util.getResolutionFromScale(D.maxScale,D.units)}else{if((D.minResolution=="auto")&&(D.minExtent!=null)){var N=this.map.getSize();var L=D.minExtent.getWidth()/N.w;var H=D.minExtent.getHeight()/N.h;D.minResolution=Math.max(L,H)}}if(D.minResolution!=null&&this.options.numZoomLevels==undefined){var K=D.maxResolution/D.minResolution;D.numZoomLevels=Math.floor(Math.log(K)/Math.log(2))+1}D.resolutions=new Array(D.numZoomLevels);var A=2;if(typeof D.minResolution=="number"&&D.numZoomLevels>1){A=Math.pow((D.maxResolution/D.minResolution),(1/(D.numZoomLevels-1)))}for(var F=0;F<D.numZoomLevels;F++){var J=D.maxResolution/Math.pow(A,F);D.resolutions[F]=J}}D.resolutions.sort(function(Q,P){return(P-Q)});this.resolutions=D.resolutions;this.maxResolution=D.resolutions[0];var G=D.resolutions.length-1;this.minResolution=D.resolutions[G];this.scales=[];for(var F=0,I=D.resolutions.length;F<I;F++){this.scales[F]=OpenLayers.Util.getScaleFromResolution(D.resolutions[F],D.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=D.numZoomLevels},getResolution:function(){var A=this.map.getZoom();return this.getResolutionForZoom(A)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(B,C){var D=this.map.getSize();var A=Math.max(B.getWidth()/D.w,B.getHeight()/D.h);return this.getZoomForResolution(A,C)},getDataExtent:function(){},getResolutionForZoom:function(C){C=Math.max(0,Math.min(C,this.resolutions.length-1));var B;if(this.map.fractionalZoom){var A=Math.floor(C);var D=Math.ceil(C);B=this.resolutions[A]-((C-A)*(this.resolutions[A]-this.resolutions[D]))}else{B=this.resolutions[Math.round(C)]}return B},getZoomForResolution:function(E,A){var M;if(this.map.fractionalZoom){var J=0;var C=this.resolutions.length-1;var D=this.resolutions[J];var B=this.resolutions[C];var I;for(var F=0,G=this.resolutions.length;F<G;++F){I=this.resolutions[F];if(I>=E){D=I;J=F}if(I<=E){B=I;C=F;break}}var H=D-B;if(H>0){M=J+((D-E)/H)}else{M=J}}else{var K;var L=Number.POSITIVE_INFINITY;for(var F=0,G=this.resolutions.length;F<G;F++){if(A){K=Math.abs(this.resolutions[F]-E);if(K>L){break}L=K}else{if(this.resolutions[F]<E){break}}}M=Math.max(0,F-1)}return M},getLonLatFromViewPortPx:function(B){var E=null;if(B!=null){var D=this.map.getSize();var A=this.map.getCenter();if(A){var C=this.map.getResolution();var G=B.x-(D.w/2);var F=B.y-(D.h/2);E=new OpenLayers.LonLat(A.lon+G*C,A.lat-F*C);if(this.wrapDateLine){E=E.wrapDateLine(this.maxExtent)}}}return E},getViewPortPxFromLonLat:function(D){var B=null;if(D!=null){var A=this.map.getResolution();var C=this.map.getExtent();B=new OpenLayers.Pixel((1/A*(D.lon-C.left)),(1/A*(C.top-D.lat)))}return B},setOpacity:function(B){if(B!=this.opacity){this.opacity=B;for(var D=0,A=this.div.childNodes.length;D<A;++D){var C=this.div.childNodes[D].firstChild;OpenLayers.Util.modifyDOMElement(C,null,null,null,null,null,null,B)}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(A){this.div.style.zIndex=A},adjustBounds:function(B){if(this.gutter){var A=this.gutter*this.map.getResolution();B=new OpenLayers.Bounds(B.left-A,B.bottom-A,B.right+A,B.top+A)}if(this.wrapDateLine){var C={rightTolerance:this.getResolution()};B=B.wrapDateLine(this.maxExtent,C)}return B},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(B,C,A){this.bounds=B;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(C,A)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(A,B){if(!A){A="red"}if(!B){B=2}this.div.style.border=B+"px solid "+A},draw:function(A,B){OpenLayers.Util.modifyDOMElement(this.div,null,A,B);return this.div},onScreen:function(){var B=false;if(this.map){var A=this.map.getExtent();B=A.containsBounds(this.bounds,true,true)}return B},display:function(A){this.div.style.display=(A)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});(function(){var D=window.XMLHttpRequest;var H=!!window.controllers,E=window.document.all&&!window.opera;function C(){this._object=D?new D:new window.ActiveXObject("Microsoft.XMLHTTP")}if(H&&D.wrapped){C.wrapped=D.wrapped}C.UNSENT=0;C.OPENED=1;C.HEADERS_RECEIVED=2;C.LOADING=3;C.DONE=4;C.prototype.readyState=C.UNSENT;C.prototype.responseText="";C.prototype.responseXML=null;C.prototype.status=0;C.prototype.statusText="";C.prototype.onreadystatechange=null;C.onreadystatechange=null;C.onopen=null;C.onsend=null;C.onabort=null;C.prototype.open=function(L,O,K,P,J){this._async=K;var N=this,M=this.readyState;if(E){var I=function(){if(N._object.readyState!=C.DONE){A(N)}};if(K){window.attachEvent("onunload",I)}}this._object.onreadystatechange=function(){if(H&&!K){return }N.readyState=N._object.readyState;G(N);if(N._aborted){N.readyState=C.UNSENT;return }if(N.readyState==C.DONE){A(N);if(E&&K){window.detachEvent("onunload",I)}}if(M!=N.readyState){F(N)}M=N.readyState};if(C.onopen){C.onopen.apply(this,arguments)}this._object.open(L,O,K,P,J);if(!K&&H){this.readyState=C.OPENED;F(this)}};C.prototype.send=function(I){if(C.onsend){C.onsend.apply(this,arguments)}if(I&&I.nodeType){I=window.XMLSerializer?new window.XMLSerializer().serializeToString(I):I.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(I);if(H&&!this._async){this.readyState=C.OPENED;G(this);while(this.readyState<C.DONE){this.readyState++;F(this);if(this._aborted){return }}}};C.prototype.abort=function(){if(C.onabort){C.onabort.apply(this,arguments)}if(this.readyState>C.UNSENT){this._aborted=true}this._object.abort();A(this)};C.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};C.prototype.getResponseHeader=function(I){return this._object.getResponseHeader(I)};C.prototype.setRequestHeader=function(I,J){if(!this._headers){this._headers={}}this._headers[I]=J;return this._object.setRequestHeader(I,J)};C.prototype.toString=function(){return"[object XMLHttpRequest]"};C.toString=function(){return"[XMLHttpRequest]"};function F(I){if(I.onreadystatechange){I.onreadystatechange.apply(I)}if(C.onreadystatechange){C.onreadystatechange.apply(I)}}function B(J){var I=J.responseXML;if(E&&I&&!I.documentElement&&J.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){I=new ActiveXObject("Microsoft.XMLDOM");I.loadXML(J.responseText)}if(I){if((E&&I.parseError!=0)||(I.documentElement&&I.documentElement.tagName=="parsererror")){return null}}return I}function G(I){try{I.responseText=I._object.responseText}catch(J){}try{I.responseXML=B(I._object)}catch(J){}try{I.status=I._object.status}catch(J){}try{I.statusText=I._object.statusText}catch(J){}}function A(I){I._object.onreadystatechange=new window.Function;delete I._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(I,J){if(!J){J=[]}I.__func=this;I.__func(J[0],J[1],J[2],J[3],J[4]);delete I.__func}}OpenLayers.Request.XMLHttpRequest=C})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(A){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:A.statusText}))};OpenLayers.loadURL=function(D,G,B,E,C){if(typeof G=="string"){G=OpenLayers.Util.getParameters(G)}var F=(E)?E:OpenLayers.nullHandler;var A=(C)?C:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:D,params:G,success:F,failure:A,scope:B})};OpenLayers.parseXMLString=function(C){var A=C.indexOf("<");if(A>0){C=C.substring(A)}var B=OpenLayers.Util.Try(function(){var D=new ActiveXObject("Microsoft.XMLDOM");D.loadXML(C);return D},function(){return new DOMParser().parseFromString(C,"text/xml")},function(){var D=new XMLHttpRequest();D.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(C),false);if(D.overrideMimeType){D.overrideMimeType("text/xml")}D.send(null);return D.responseXML});return B};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(B){for(var A=0;A<this.responders.length;A++){if(B==this.responders[A]){return }}this.responders.push(B)},unregister:function(A){OpenLayers.Util.removeItem(this.reponders,A)},dispatch:function(F,C,E){var A;for(var B=0;B<this.responders.length;B++){A=this.responders[B];if(A[F]&&typeof A[F]=="function"){try{A[F].apply(A,[C,E])}catch(D){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(A){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,A||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)}}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(B,A){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[A]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(B,"http")){B=OpenLayers.ProxyHost+encodeURIComponent(B)}this.transport=OpenLayers.Ajax.getTransport();this.request(B)},request:function(B){this.url=B;this.method=this.options.method;var D=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){D._method=this.method;this.method="post"}this.parameters=D;if(D=OpenLayers.Util.getParameterString(D)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+D}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){D+="&_="}}}try{var A=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(A)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,A);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||D):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(C){this.dispatchException(C)}},onStateChange:function(){var A=this.transport.readyState;if(A>1&&!((A==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var E={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){E["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){E.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var C=this.options.requestHeaders;if(typeof C.push=="function"){for(var B=0,D=C.length;B<D;B+=2){E[C[B]]=C[B+1]}}else{for(var B in C){E[B]=C[B]}}}for(var A in E){this.transport.setRequestHeader(A,E[A])}},success:function(){var A=this.getStatus();return !A||(A>=200&&A<300)},getStatus:function(){try{return this.transport.status||0}catch(A){return 0}},respondToReadyState:function(A){var C=OpenLayers.Ajax.Request.Events[A];var B=new OpenLayers.Ajax.Response(this);if(C=="Complete"){try{this._complete=true;(this.options["on"+B.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(B)}catch(D){this.dispatchException(D)}var E=B.getHeader("Content-type")}try{(this.options["on"+C]||OpenLayers.Ajax.emptyFunction)(B);OpenLayers.Ajax.Responders.dispatch("on"+C,this,B)}catch(D){this.dispatchException(D)}if(C=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(A){try{return this.transport.getResponseHeader(A)}catch(B){return null}},dispatchException:function(C){var D=this.options.onException;if(D){D(this,C);OpenLayers.Ajax.Responders.dispatch("onException",this,C)}else{var E=false;var A=OpenLayers.Ajax.Responders.responders;for(var B=0;B<A.length;B++){if(A[B].onException){E=true;break}}if(E){OpenLayers.Ajax.Responders.dispatch("onException",this,C)}else{throw C}}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(C){this.request=C;var D=this.transport=C.transport,A=this.readyState=D.readyState;if((A>2&&!(!!(window.attachEvent&&!window.opera)))||A==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=D.responseText==null?"":String(D.responseText)}if(A==4){var B=D.responseXML;this.responseXML=B===undefined?null:B}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(A){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(A){return this.transport.getResponseHeader(A)}});OpenLayers.Ajax.getElementsByTagNameNS=function(B,A,C,E){var D=null;if(B.getElementsByTagNameNS){D=B.getElementsByTagNameNS(A,E)}else{D=B.getElementsByTagName(C+":"+E)}return D};OpenLayers.Ajax.serializeXMLToString=function(A){var B=new XMLSerializer();var C=B.serializeToString(A);return C};OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval})},panMap:function(A){this.panned=true;this.map.pan(this.handler.last.x-A.x,this.handler.last.y-A.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(A){if(this.panned){this.panMap(A);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,renderIntent:"default",initialize:function(C,A,B){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,A]);this.lonlat=null;this.geometry=C?C:null;this.state=null;this.attributes={};if(A){this.attributes=OpenLayers.Util.extend(this.attributes,A)}this.style=B?B:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(D){var C=false;if(this.layer&&this.layer.map){var A=this.layer.map.getExtent();if(D){var B=this.geometry.getBounds();C=A.intersectsBounds(B)}else{var E=A.toGeometry();C=E.intersects(this.geometry)}}return C},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(B,D,C){var A=false;if(this.geometry){A=this.geometry.atPoint(B,D,C)}return A},destroyPopup:function(){},move:function(A){if(!this.layer||!this.geometry.move){return }var B;if(A.CLASS_NAME=="OpenLayers.LonLat"){B=this.layer.getViewPortPxFromLonLat(A)}else{B=A}var D=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var C=this.layer.map.getResolution();this.geometry.move(C*(B.x-D.x),C*(D.y-B.y));this.layer.drawFeature(this);return D},toState:function(A){if(A==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=A;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(A==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=A;break}}else{if(A==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=A;break}}else{if(A==OpenLayers.State.UNKNOWN){this.state=A}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(C,B,A){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var B={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,B,{keyMask:this.keyMask})},setMap:function(A){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(A)}},startBox:function(A){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(F){var D=this.dragHandler.start.x;var B=this.dragHandler.start.y;var C=Math.abs(D-F.x);var A=Math.abs(B-F.y);this.zoomBox.style.width=Math.max(1,C)+"px";this.zoomBox.style.height=Math.max(1,A)+"px";this.zoomBox.style.left=F.x<D?F.x+"px":D+"px";this.zoomBox.style.top=F.y<B?F.y+"px":B+"px";var E=this.getBoxCharacteristics();if(E.newBoxModel){if(F.x>D){this.zoomBox.style.width=Math.max(1,C-E.xOffset)+"px"}if(F.y>B){this.zoomBox.style.height=Math.max(1,A-E.yOffset)+"px"}}},endBox:function(B){var A;if(Math.abs(this.dragHandler.start.x-B.x)>5||Math.abs(this.dragHandler.start.y-B.y)>5){var G=this.dragHandler.start;var F=Math.min(G.y,B.y);var C=Math.max(G.y,B.y);var E=Math.min(G.x,B.x);var D=Math.max(G.x,B.x);A=new OpenLayers.Bounds(E,C,D,F)}else{A=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[A])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var A=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var C=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var B=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:A,yOffset:C,newBoxModel:B}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(C,B,A){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,[C,B,A]);this.options=(A)?A:new Object()},setOptions:function(A){OpenLayers.Util.extend(this.options,A);OpenLayers.Util.extend(this,A)},activate:function(){var A=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var B={displayInLayerSwitcher:false,calculateInRange:function(){return true}};this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,B);this.map.addLayer(this.layer);A=true}return A},deactivate:function(){var A=false;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()}if(this.layer.map!=null){this.layer.destroy(false);if(this.feature){this.feature.destroy()}}this.layer=null;this.feature=null;A=true}return A},down:function(A){this.fixedRadius=!!(this.radius);var B=this.map.getLonLatFromPixel(A.xy);this.origin=new OpenLayers.Geometry.Point(B.lon,B.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()}if(this.persist){this.clear()}this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style)},move:function(C){var F=this.map.getLonLatFromPixel(C.xy);var A=new OpenLayers.Geometry.Point(F.lon,F.lat);if(this.irregular){var G=Math.sqrt(2)*Math.abs(A.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,G)}else{if(this.fixedRadius){this.origin=A}else{this.calculateAngle(A,C);this.radius=Math.max(this.map.getResolution()/2,A.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var D=A.x-this.origin.x;var B=A.y-this.origin.y;var E;if(B==0){E=D/(this.radius*Math.sqrt(2))}else{E=D/B}this.feature.geometry.resize(1,this.origin,E);this.feature.geometry.move(D/2,B/2)}this.layer.drawFeature(this.feature,this.style)},up:function(A){this.finalize();if(this.start==this.last){this.callback("done",[A.xy])}},out:function(A){this.finalize()},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var F,C,B,A;var D=this.feature.geometry.components[0];if(D.components.length!=(this.sides+1)){this.createGeometry();D=this.feature.geometry.components[0]}for(var E=0;E<this.sides;++E){A=D.components[E];F=this.angle+(E*2*Math.PI/this.sides);A.x=this.origin.x+(this.radius*Math.cos(F));A.y=this.origin.y+(this.radius*Math.sin(F));A.clearBounds()}},calculateAngle:function(A,B){var D=Math.atan2(A.y-this.origin.y,A.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!B[this.snapToggle])){var C=(Math.PI/180)*this.snapAngle;this.angle=Math.round(D/C)*C}else{this.angle=D}},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){this.layer.renderer.clear();this.layer.destroyFeatures()},callback:function(B,A){if(this.callbacks[B]){this.callbacks[B].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(B=="done"||B=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(B,A){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")}},destroy:function(){this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(A){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(OpenLayers.Util.getBrowserName()=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)"}if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane)}else{this.map.layerContainerDiv.appendChild(this.pane)}this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage()}},removeMap:function(A){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane);this.pane=null}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var G=this.map.getSize();var A=Math.min(G.w,300);var E=Math.min(G.h,200);var B=new OpenLayers.Size(A,E);var D=new OpenLayers.Pixel(G.w/2,G.h/2);var C=D.add(-B.w/2,-B.h/2);var F=OpenLayers.Util.createDiv(this.name+"_warning",C,B,null,null,null,"auto");F.style.padding="7px";F.style.backgroundColor="yellow";F.innerHTML=this.getWarningHTML();this.div.appendChild(F)},getWarningHTML:function(){return""},display:function(A){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(A){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(C,D,J){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var E=this.map.getCenter();var G=this.map.getZoom();if(E!=null){var F=this.getMapObjectCenter();var B=this.getOLLonLatFromMapObjectLonLat(F);var H=this.getMapObjectZoom();var M=this.getOLZoomFromMapObjectZoom(H);if(!(E.equals(B))||!(G==M)){if(J&&this.dragPanMapObject&&this.smoothDragPan){var I=this.map.getViewPortPxFromLonLat(B);var K=this.map.getViewPortPxFromLonLat(E);this.dragPanMapObject(K.x-I.x,I.y-K.y)}else{var A=this.getMapObjectLonLatFromOLLonLat(E);var L=this.getMapObjectZoomFromOLZoom(G);this.setMapObjectCenter(A,L,J)}}}}},getLonLatFromViewPortPx:function(A){var B=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var D=this.getMapObjectPixelFromOLPixel(A);var C=this.getMapObjectLonLatFromMapObjectPixel(D);B=this.getOLLonLatFromMapObjectLonLat(C)}return B},getViewPortPxFromLonLat:function(B){var A=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var D=this.getMapObjectLonLatFromOLLonLat(B);var C=this.getMapObjectPixelFromMapObjectLonLat(D);A=this.getOLPixelFromMapObjectPixel(C)}return A},getOLLonLatFromMapObjectLonLat:function(D){var A=null;if(D!=null){var C=this.getLongitudeFromMapObjectLonLat(D);var B=this.getLatitudeFromMapObjectLonLat(D);A=new OpenLayers.LonLat(C,B)}return A},getMapObjectLonLatFromOLLonLat:function(A){var B=null;if(A!=null){B=this.getMapObjectLonLatFromLonLat(A.lon,A.lat)}return B},getOLPixelFromMapObjectPixel:function(D){var B=null;if(D!=null){var A=this.getXFromMapObjectPixel(D);var C=this.getYFromMapObjectPixel(D);B=new OpenLayers.Pixel(A,C)}return B},getMapObjectPixelFromOLPixel:function(A){var B=null;if(A!=null){B=this.getMapObjectPixelFromXY(A.x,A.y)}return B},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var C=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var B=0,A=C.length;B<A;B++){var F=C[B];this[F]=(this.options[F]!=null)?this.options[F]:this.map[F]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var G;var E=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){G=this.maxZoomLevel-this.minZoomLevel+1}else{G=this.numZoomLevels}if(G!=null){this.numZoomLevels=Math.min(G,E)}else{this.numZoomLevels=E}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var D=0;this.resolutions=[];for(var B=this.minZoomLevel;B<=this.maxZoomLevel;B++){this.resolutions[D++]=this.RESOLUTIONS[B]}this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)}else{var A=null;var C=this.map.getSize();var B=this.getExtent();if((C!=null)&&(B!=null)){A=Math.max(B.getWidth()/C.w,B.getHeight()/C.h)}return A}},getExtent:function(){var C=null;var B=this.map.getSize();var E=new OpenLayers.Pixel(0,0);var F=this.getLonLatFromViewPortPx(E);var A=new OpenLayers.Pixel(B.w,B.h);var D=this.getLonLatFromViewPortPx(A);if((F!=null)&&(D!=null)){C=new OpenLayers.Bounds(F.lon,D.lat,D.lon,F.lat)}return C},getZoomForResolution:function(A){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var B=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(B)}},getOLZoomFromMapObjectZoom:function(A){var B=null;if(A!=null){B=A-this.minZoomLevel}return B},getMapObjectZoomFromOLZoom:function(A){var B=null;if(A!=null){B=A+this.minZoomLevel}return B},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(D,C,E,B){var A=arguments;A=[D,B];OpenLayers.Layer.prototype.initialize.apply(this,A);this.url=C;this.params=OpenLayers.Util.extend({},E)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(A){if(A==null){A=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.options)}A=OpenLayers.Layer.prototype.clone.apply(this,[A]);return A},setUrl:function(A){this.url=A},mergeNewParams:function(A){this.params=OpenLayers.Util.extend(this.params,A);return this.redraw()},redraw:function(A){if(A){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(E,D){var C=1;for(var B=0,A=E.length;B<A;B++){C*=E.charCodeAt(B)*this.URL_HASH_FACTOR;C-=Math.floor(C)}return D[Math.floor(C*D.length)]},getFullRequestString:function(F,E){var B=E||this.url;var G=OpenLayers.Util.extend({},this.params);G=OpenLayers.Util.extend(G,F);var A=OpenLayers.Util.getParameterString(G);if(B instanceof Array){B=this.selectUrl(A,B)}var D=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(B));for(var H in G){if(H.toUpperCase() in D){delete G[H]}}A=OpenLayers.Util.getParameterString(G);var I=B;if(A!=""){var C=B.charAt(B.length-1);if((C=="&")||(C=="?")){I+=A}else{if(B.indexOf("?")==-1){I+="?"+A}else{I+="&"+A}}}return I},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(B,A){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(B){if(B!=this.opacity){this.opacity=B;for(var C=0,A=this.markers.length;C<A;C++){this.markers[C].setOpacity(this.opacity)}}},moveTo:function(D,B,E){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(B||!this.drawn){for(var C=0,A=this.markers.length;C<A;C++){this.drawMarker(this.markers[C])}this.drawn=true}},addMarker:function(A){this.markers.push(A);if(this.opacity!=null){A.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){A.map=this.map;this.drawMarker(A)}},removeMarker:function(A){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,A);A.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(A){var B=this.map.getLayerPxFromLonLat(A.lonlat);if(B==null){A.display(false)}else{if(!A.isDrawn()){var C=A.draw(B);this.div.appendChild(C)}else{if(A.icon){A.icon.moveTo(B)}}}},getDataExtent:function(){var B=null;if(this.markers&&(this.markers.length>0)){var B=new OpenLayers.Bounds();for(var D=0,A=this.markers.length;D<A;D++){var C=this.markers[D];B.extend(C.lonlat)}}return B},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var A=null;if(this.sphericalMercator){A=this.map.calculateBounds()}else{A=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return A},initMercatorParameters:function(){this.RESOLUTIONS=[];var A=156543.0339;for(var B=0;B<=this.MAX_ZOOM_LEVEL;++B){this.RESOLUTIONS[B]=A/Math.pow(2,B)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(C,B){var A=C*20037508.34/180;var D=Math.log(Math.tan((90+B)*Math.PI/360))/(Math.PI/180);D=D*20037508.34/180;return new OpenLayers.LonLat(A,D)},inverseMercator:function(A,D){var C=(A/20037508.34)*180;var B=(D/20037508.34)*180;B=180/Math.PI*(2*Math.atan(Math.exp(B*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(C,B)},projectForward:function(A){var B=OpenLayers.Layer.SphericalMercator.forwardMercator(A.x,A.y);A.x=B.lon;A.y=B.lat;return A},projectInverse:function(A){var B=OpenLayers.Layer.SphericalMercator.inverseMercator(A.x,A.y);A.x=B.lon;A.y=B.lat;return A}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],featureAdded:function(){},handlerOptions:null,initialize:function(B,C,A){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[A]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(F,E){this.layer.events.triggerEvent("sketchmodified",{vertex:F,feature:E})},create:function(F,E){this.layer.events.triggerEvent("sketchstarted",{vertex:F,feature:E})}},this.callbacks);this.layer=B;var D=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(D){this.handlerOptions=this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":D})})}this.handler=new C(this,this.callbacks,this.handlerOptions)},drawFeature:function(C){var A=new OpenLayers.Feature.Vector(C);var B=this.layer.events.triggerEvent("sketchcomplete",{feature:A});if(B!==false){A.state=OpenLayers.State.INSERT;this.layer.addFeatures([A]);this.featureAdded(A);this.events.triggerEvent("featureadded",{feature:A})}},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:false,initialize:function(B,A){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[A]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new B(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(B,A){var C=this.active;if(C){this.deactivate()}this.handler=new B(this,this.callbacks,A);if(C){this.activate()}},measureComplete:function(A){if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}this.measure(A,"measure")},measurePartial:function(A,B){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(B,"measurepartial")},this),this.partialDelay)},measure:function(D,B){var C,A;if(D.CLASS_NAME.indexOf("LineString")>-1){C=this.getBestLength(D);A=1}else{C=this.getBestArea(D);A=2}this.events.triggerEvent(B,{measure:C[0],units:C[1],order:A,geometry:D})},getBestArea:function(F){var B=this.displaySystemUnits[this.displaySystem];var E,D;for(var C=0,A=B.length;C<A;++C){E=B[C];D=this.getArea(F,E);if(D>1){break}}return[D,E]},getArea:function(F,A){var B,C;if(this.geodesic){B=F.getGeodesicArea(this.map.getProjectionObject());C="m"}else{B=F.getArea();C=this.map.getUnits()}var E=OpenLayers.INCHES_PER_UNIT[A];if(E){var D=OpenLayers.INCHES_PER_UNIT[C];B*=Math.pow((D/E),2)}return B},getBestLength:function(F){var B=this.displaySystemUnits[this.displaySystem];var E,D;for(var C=0,A=B.length;C<A;++C){E=B[C];D=this.getLength(F,E);if(D>1){break}}return[D,E]},getLength:function(F,A){var B,C;if(this.geodesic){B=F.getGeodesicLength(this.map.getProjectionObject());C="m"}else{B=F.getLength();C=this.map.getUnits()}var E=OpenLayers.INCHES_PER_UNIT[A];if(E){var D=OpenLayers.INCHES_PER_UNIT[C];B*=(D/E)}return B},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,alwaysZoom:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(H){if(H instanceof OpenLayers.Bounds){if(!this.out){var I=this.map.getLonLatFromPixel(new OpenLayers.Pixel(H.left,H.bottom));var M=this.map.getLonLatFromPixel(new OpenLayers.Pixel(H.right,H.top));var B=new OpenLayers.Bounds(I.lon,I.lat,M.lon,M.lat)}else{var G=Math.abs(H.right-H.left);var J=Math.abs(H.top-H.bottom);var E=Math.min((this.map.size.h/J),(this.map.size.w/G));var N=this.map.getExtent();var A=this.map.getLonLatFromPixel(H.getCenterPixel());var C=A.lon-(N.getWidth()/2)*E;var F=A.lon+(N.getWidth()/2)*E;var L=A.lat-(N.getHeight()/2)*E;var D=A.lat+(N.getHeight()/2)*E;var B=new OpenLayers.Bounds(C,L,F,D)}var K=this.map.getZoom();this.map.zoomToExtent(B);if(K==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(K+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(H),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(H),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(A){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[A])},read:function(F){var E,D,H;var G=this.regExes.typeStr.exec(F);if(G){D=G[1].toLowerCase();H=G[2];if(this.parse[D]){E=this.parse[D].apply(this,[H])}if(this.internalProjection&&this.externalProjection){if(E&&E.CLASS_NAME=="OpenLayers.Feature.Vector"){E.geometry.transform(this.externalProjection,this.internalProjection)}else{if(E&&D!="geometrycollection"&&typeof E=="object"){for(var C=0,A=E.length;C<A;C++){var B=E[C];B.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return E},write:function(A){var F,I,H,D,B;if(A.constructor==Array){F=A;B=true}else{F=[A];B=false}var C=[];if(B){C.push("GEOMETRYCOLLECTION(")}for(var E=0,G=F.length;E<G;++E){if(B&&E>0){C.push(",")}I=F[E].geometry;H=I.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[H]){return null}if(this.internalProjection&&this.externalProjection){I=I.clone();I.transform(this.internalProjection,this.externalProjection)}D=this.extract[H].apply(this,[I]);C.push(H.toUpperCase()+"("+D+")")}if(B){C.push(")")}return C.join("")},extract:{point:function(A){return A.x+" "+A.y},multipoint:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push(this.extract.point.apply(this,[C.components[B]]))}return D.join(",")},linestring:function(B){var D=[];for(var C=0,A=B.components.length;C<A;++C){D.push(this.extract.point.apply(this,[B.components[C]]))}return D.join(",")},multilinestring:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push("("+this.extract.linestring.apply(this,[C.components[B]])+")")}return D.join(",")},polygon:function(C){var D=[];for(var B=0,A=C.components.length;B<A;++B){D.push("("+this.extract.linestring.apply(this,[C.components[B]])+")")}return D.join(",")},multipolygon:function(D){var C=[];for(var B=0,A=D.components.length;B<A;++B){C.push("("+this.extract.polygon.apply(this,[D.components[B]])+")")}return C.join(",")}},parse:{point:function(B){var A=OpenLayers.String.trim(B).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(A[0],A[1]))},multipoint:function(E){var C=OpenLayers.String.trim(E).split(",");var D=[];for(var B=0,A=C.length;B<A;++B){D.push(this.parse.point.apply(this,[C[B]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(D))},linestring:function(E){var C=OpenLayers.String.trim(E).split(",");var D=[];for(var B=0,A=C.length;B<A;++B){D.push(this.parse.point.apply(this,[C[B]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(D))},multilinestring:function(F){var C;var B=OpenLayers.String.trim(F).split(this.regExes.parenComma);var E=[];for(var D=0,A=B.length;D<A;++D){C=B[D].replace(this.regExes.trimParens,"$1");E.push(this.parse.linestring.apply(this,[C]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(E))},polygon:function(H){var C,B,F;var G=OpenLayers.String.trim(H).split(this.regExes.parenComma);var E=[];for(var D=0,A=G.length;D<A;++D){C=G[D].replace(this.regExes.trimParens,"$1");B=this.parse.linestring.apply(this,[C]).geometry;F=new OpenLayers.Geometry.LinearRing(B.components);E.push(F)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(E))},multipolygon:function(F){var D;var B=OpenLayers.String.trim(F).split(this.regExes.doubleParenComma);var E=[];for(var C=0,A=B.length;C<A;++C){D=B[C].replace(this.regExes.trimParens,"$1");E.push(this.parse.polygon.apply(this,[D]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(E))},geometrycollection:function(E){E=E.replace(/,\s*([A-Za-z])/g,"|$1");var D=OpenLayers.String.trim(E).split("|");var C=[];for(var B=0,A=D.length;B<A;++B){C.push(OpenLayers.Format.WKT.prototype.read.apply(this,[D[B]]))}return C}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031,0.00000536441802978515,0.00000268220901489257],type:null,sphericalMercator:false,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(B,A){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.addContainerPxFunction();if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{this.mapObject=new GMap2(this.div);if(typeof this.mapObject.getDragObject=="function"){this.dragObject=this.mapObject.getDragObject()}else{this.dragPanMapObject=null}this.termsOfUse=this.div.lastChild;this.div.removeChild(this.termsOfUse);if(this.isFixed){this.map.viewPortDiv.appendChild(this.termsOfUse)}else{this.map.layerContainerDiv.appendChild(this.termsOfUse)}this.termsOfUse.style.zIndex="1100";this.termsOfUse.style.display=this.div.style.display;this.termsOfUse.style.right="";this.termsOfUse.style.bottom="";this.termsOfUse.className="olLayerGoogleCopyright";this.poweredBy=this.div.lastChild;this.div.removeChild(this.poweredBy);if(this.isFixed){this.map.viewPortDiv.appendChild(this.poweredBy)}else{this.map.layerContainerDiv.appendChild(this.poweredBy)}this.poweredBy.style.zIndex="1100";this.poweredBy.style.display=this.div.style.display;this.poweredBy.style.right="";this.poweredBy.style.bottom="";this.poweredBy.className="olLayerGooglePoweredBy gmnoprint"}catch(A){OpenLayers.Console.error(A)}},setMap:function(A){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);if(this.type!=null){this.map.events.register("moveend",this,this.setMapType)}},setMapType:function(){if(this.mapObject.getCenter()!=null){if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)==-1){this.mapObject.addMapType(this.type)}this.mapObject.setMapType(this.type);this.map.events.unregister("moveend",this,this.setMapType)}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize()}else{if(!this._resized){var A=this;var B=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(B);delete A._resized;A.mapObject.checkResize();A.moveTo(A.map.getCenter(),A.map.getZoom())})}this._resized=true}},display:function(A){OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments);this.termsOfUse.style.display=this.div.style.display;this.poweredBy.style.display=this.div.style.display},removeMap:function(A){if(this.termsOfUse&&this.termsOfUse.parentNode){this.termsOfUse.parentNode.removeChild(this.termsOfUse);this.termsOfUse=null}if(this.poweredBy&&this.poweredBy.parentNode){this.poweredBy.parentNode.removeChild(this.poweredBy);this.poweredBy=null}OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(B){var C=null;if(B!=null){var A=B.getSouthWest();var D=B.getNorthEast();if(this.sphericalMercator){A=this.forwardMercator(A.lng(),A.lat());D=this.forwardMercator(D.lng(),D.lat())}else{A=new OpenLayers.LonLat(A.lng(),A.lat());D=new OpenLayers.LonLat(D.lng(),D.lat())}C=new OpenLayers.Bounds(A.lon,A.lat,D.lon,D.lat)}return C},getMapObjectBoundsFromOLBounds:function(C){var B=null;if(C!=null){var A=this.sphericalMercator?this.inverseMercator(C.bottom,C.left):new OpenLayers.LonLat(C.bottom,C.left);var D=this.sphericalMercator?this.inverseMercator(C.top,C.right):new OpenLayers.LonLat(C.top,C.right);B=new GLatLngBounds(new GLatLng(A.lat,A.lon),new GLatLng(D.lat,D.lon))}return B},addContainerPxFunction:function(){if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(B){var A=this.fromLatLngToDivPixel(B);var C=this.getContainer().firstChild.firstChild;A.x+=C.offsetLeft;A.y+=C.offsetTop;return A}}},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},setMapObjectCenter:function(A,B){this.mapObject.setCenter(A,B)},dragPanMapObject:function(B,A){this.dragObject.moveBy(new GSize(-B,A))},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getMapObjectLonLatFromMapObjectPixel:function(A){return this.mapObject.fromContainerPixelToLatLng(A)},getMapObjectPixelFromMapObjectLonLat:function(A){return this.mapObject.fromLatLngToContainerPixel(A)},getMapObjectZoomFromMapObjectBounds:function(A){return this.mapObject.getBoundsZoomLevel(A)},getLongitudeFromMapObjectLonLat:function(A){return this.sphericalMercator?this.forwardMercator(A.lng(),A.lat()).lon:A.lng()},getLatitudeFromMapObjectLonLat:function(B){var A=this.sphericalMercator?this.forwardMercator(B.lng(),B.lat()).lat:B.lat();return A},getMapObjectLonLatFromLonLat:function(D,B){var C;if(this.sphericalMercator){var A=this.inverseMercator(D,B);C=new GLatLng(A.lat,A.lon)}else{C=new GLatLng(B,D)}return C},getXFromMapObjectPixel:function(A){return A.x},getYFromMapObjectPixel:function(A){return A.y},getMapObjectPixelFromXY:function(A,B){return new GPoint(A,B)},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(C,B,D,A){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[]},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var F=0,B=this.grid.length;F<B;F++){var E=this.grid[F];for(var C=0,A=E.length;C<A;C++){var D=E[C];this.removeTileMonitoringHooks(D);D.destroy()}}this.grid=[]}},clone:function(A){if(A==null){A=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.options)}A=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[A]);if(this.tileSize!=null){A.tileSize=this.tileSize.clone()}A.grid=[];return A},moveTo:function(D,A,E){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);D=D||this.map.getExtent();if(D!=null){var C=!this.grid.length||A;var B=this.getTilesBounds();if(this.singleTile){if(C||(!E&&!B.containsBounds(D))){this.initSingleTile(D)}}else{if(C||!B.containsBounds(D,true)){this.initGriddedTiles(D)}else{this.moveGriddedTiles(D)}}}},setTileSize:function(A){if(this.singleTile){A=this.map.getSize().clone();A.h=parseInt(A.h*this.ratio);A.w=parseInt(A.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[A])},getGridBounds:function(){var A="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(A);return this.getTilesBounds()},getTilesBounds:function(){var E=null;if(this.grid.length){var A=this.grid.length-1;var D=this.grid[A][0];var B=this.grid[0].length-1;var C=this.grid[0][B];E=new OpenLayers.Bounds(D.bounds.left,D.bounds.bottom,C.bounds.right,C.bounds.top)}return E},initSingleTile:function(F){var A=F.getCenterLonLat();var H=F.getWidth()*this.ratio;var B=F.getHeight()*this.ratio;var G=new OpenLayers.Bounds(A.lon-(H/2),A.lat-(B/2),A.lon+(H/2),A.lat+(B/2));var D=new OpenLayers.LonLat(G.left,G.top);var C=this.map.getLayerPxFromLonLat(D);if(!this.grid.length){this.grid[0]=[]}var E=this.grid[0][0];if(!E){E=this.addTile(G,C);this.addTileMonitoringHooks(E);E.draw();this.grid[0][0]=E}else{E.moveTo(G,C)}this.removeExcessTiles(1,1)},calculateGridLayout:function(A,O,E){var K=E*this.tileSize.w;var C=E*this.tileSize.h;var I=A.left-O.left;var L=Math.floor(I/K)-this.buffer;var J=I/K-L;var F=-J*this.tileSize.w;var M=O.left+L*K;var B=A.top-(O.bottom+C);var H=Math.ceil(B/C)+this.buffer;var N=H-B/C;var D=-N*this.tileSize.h;var G=O.bottom+H*C;return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}},initGriddedTiles:function(I){var G=this.map.getSize();var V=Math.ceil(G.h/this.tileSize.h)+Math.max(1,2*this.buffer);var X=Math.ceil(G.w/this.tileSize.w)+Math.max(1,2*this.buffer);var O=this.maxExtent;var R=this.map.getResolution();var Q=this.calculateGridLayout(I,O,R);var F=Math.round(Q.tileoffsetx);var C=Math.round(Q.tileoffsety);var K=Q.tileoffsetlon;var N=Q.tileoffsetlat;var E=Q.tilelon;var J=Q.tilelat;this.origin=new OpenLayers.Pixel(F,C);var U=F;var W=K;var T=0;var A=parseInt(this.map.layerContainerDiv.style.left);var S=parseInt(this.map.layerContainerDiv.style.top);do{var H=this.grid[T++];if(!H){H=[];this.grid.push(H)}K=W;F=U;var D=0;do{var B=new OpenLayers.Bounds(K,N,K+E,N+J);var M=F;M-=A;var L=C;L-=S;var P=new OpenLayers.Pixel(M,L);var Y=H[D++];if(!Y){Y=this.addTile(B,P);this.addTileMonitoringHooks(Y);H.push(Y)}else{Y.moveTo(B,P,false)}K+=E;F+=this.tileSize.w}while((K<=I.right+E*this.buffer)||D<X);N-=J;C+=this.tileSize.h}while((N>=I.bottom-J*this.buffer)||T<V);this.removeExcessTiles(T,D);this.spiralTileLoad()},spiralTileLoad:function(){var B=[];var H=["right","down","left","up"];var G=0;var A=-1;var J=OpenLayers.Util.indexOf(H,"right");var K=0;while(K<H.length){var I=G;var C=A;switch(H[J]){case"right":C++;break;case"down":I++;break;case"left":C--;break;case"up":I--;break}var F=null;if((I<this.grid.length)&&(I>=0)&&(C<this.grid[0].length)&&(C>=0)){F=this.grid[I][C]}if((F!=null)&&(!F.queued)){B.unshift(F);F.queued=true;K=0;G=I;A=C}else{J=(J+1)%4;K++}}for(var D=0,E=B.length;D<E;D++){var F=B[D];F.draw();F.queued=false}},addTile:function(B,A){},addTileMonitoringHooks:function(A){A.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};A.events.register("loadstart",this,A.onLoadStart);A.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};A.events.register("loadend",this,A.onLoadEnd);A.events.register("unload",this,A.onLoadEnd)},removeTileMonitoringHooks:function(A){A.unload();A.events.un({loadstart:A.onLoadStart,loadend:A.onLoadEnd,unload:A.onLoadEnd,scope:this})},moveGriddedTiles:function(C){var B=this.buffer||1;while(true){var A=this.grid[0][0].position;var D=this.map.getViewPortPxFromLayerPx(A);if(D.x>-this.tileSize.w*(B-1)){this.shiftColumn(true)}else{if(D.x<-this.tileSize.w*B){this.shiftColumn(false)}else{if(D.y>-this.tileSize.h*(B-1)){this.shiftRow(true)}else{if(D.y<-this.tileSize.h*B){this.shiftRow(false)}else{break}}}}}},shiftRow:function(M){var C=(M)?0:(this.grid.length-1);var B=this.grid;var F=B[C];var E=this.map.getResolution();var H=(M)?-this.tileSize.h:this.tileSize.h;var G=E*-H;var L=(M)?B.pop():B.shift();for(var I=0,K=F.length;I<K;I++){var D=F[I];var A=D.bounds.clone();var J=D.position.clone();A.bottom=A.bottom+G;A.top=A.top+G;J.y=J.y+H;L[I].moveTo(A,J)}if(M){B.unshift(L)}else{B.push(L)}},shiftColumn:function(L){var D=(L)?-this.tileSize.w:this.tileSize.w;var C=this.map.getResolution();var J=C*D;for(var E=0,G=this.grid.length;E<G;E++){var K=this.grid[E];var I=(L)?0:(K.length-1);var B=K[I];var A=B.bounds.clone();var F=B.position.clone();A.left=A.left+J;A.right=A.right+J;F.x=F.x+D;var H=L?this.grid[E].pop():this.grid[E].shift();H.moveTo(A,F);if(L){K.unshift(H)}else{K.push(H)}}},removeExcessTiles:function(E,C){while(this.grid.length>E){var F=this.grid.pop();for(var B=0,A=F.length;B<A;B++){var D=F[B];this.removeTileMonitoringHooks(D);D.destroy()}}while(this.grid[0].length>C){for(var B=0,A=this.grid.length;B<A;B++){var F=this.grid[B];var D=F.pop();this.removeTileMonitoringHooks(D);D.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(D){var C=this.maxExtent;var F=this.getResolution();var E=F*this.tileSize.w;var B=F*this.tileSize.h;var H=this.getLonLatFromViewPortPx(D);var A=C.left+(E*Math.floor((H.lon-C.left)/E));var G=C.bottom+(B*Math.floor((H.lat-C.bottom)/B));return new OpenLayers.Bounds(A,G,A+E,G+B)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062],type:null,sphericalMercator:false,animationEnabled:true,initialize:function(B,A){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){var A=OpenLayers.Util.createDiv(this.name);var C=this.map.getSize();A.style.width=C.w+"px";A.style.height=C.h+"px";this.div.appendChild(A);try{this.mapObject=new VEMap(this.name)}catch(B){}if(this.mapObject!=null){try{this.mapObject.LoadMap(null,null,this.type,true);this.mapObject.AttachEvent("onmousedown",function(){return true})}catch(B){}this.mapObject.HideDashboard();if(typeof this.mapObject.SetAnimationEnabled=="function"){this.mapObject.SetAnimationEnabled(this.animationEnabled)}}if(!this.mapObject||!this.mapObject.vemapcontrol||!this.mapObject.vemapcontrol.PanMap||(typeof this.mapObject.vemapcontrol.PanMap!="function")){this.dragPanMapObject=null}},onMapResize:function(){this.mapObject.Resize(this.map.size.w,this.map.size.h)},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"VE",layerLib:"VirtualEarth"})},setMapObjectCenter:function(A,B){this.mapObject.SetCenterAndZoom(A,B)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(B,A){this.mapObject.vemapcontrol.PanMap(B,-A)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(A){return(typeof VEPixel!="undefined")?this.mapObject.PixelToLatLong(A):this.mapObject.PixelToLatLong(A.x,A.y)},getMapObjectPixelFromMapObjectLonLat:function(A){return this.mapObject.LatLongToPixel(A)},getLongitudeFromMapObjectLonLat:function(A){return this.sphericalMercator?this.forwardMercator(A.Longitude,A.Latitude).lon:A.Longitude},getLatitudeFromMapObjectLonLat:function(A){return this.sphericalMercator?this.forwardMercator(A.Longitude,A.Latitude).lat:A.Latitude},getMapObjectLonLatFromLonLat:function(D,B){var C;if(this.sphericalMercator){var A=this.inverseMercator(D,B);C=new VELatLong(A.lat,A.lon)}else{C=new VELatLong(B,D)}return C},getXFromMapObjectPixel:function(A){return A.x},getYFromMapObjectPixel:function(A){return A.y},getMapObjectPixelFromXY:function(A,B){return(typeof VEPixel!="undefined")?new VEPixel(A,B):new Msn.VE.Pixel(A,B)},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Layer.Yahoo=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125,0.00002145767211914062,0.00001072883605957031],type:null,sphericalMercator:false,initialize:function(B,A){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},loadMapObject:function(){try{var A=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,A);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();if(!this.mapObject.moveByXY||(typeof this.mapObject.moveByXY!="function")){this.dragPanMapObject=null}}catch(B){}},onMapResize:function(){try{var A=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(A)}catch(B){}},setMap:function(A){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var A=OpenLayers.Util.getElement("ygddfdiv");if(A!=null){if(A.parentNode!=null){A.parentNode.removeChild(A)}this.map.events.unregister("moveend",this,this.fixYahooEventPane)}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"Yahoo",layerLib:"Yahoo"})},getOLZoomFromMapObjectZoom:function(A){var B=null;if(A!=null){B=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[A]);B=18-B}return B},getMapObjectZoomFromOLZoom:function(A){var B=null;if(A!=null){B=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[A]);B=18-B}return B},setMapObjectCenter:function(A,B){this.mapObject.drawZoomAndCenter(A,B)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(B,A){this.mapObject.moveByXY({x:-B,y:A})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(A){return this.mapObject.convertXYLatLon(A)},getMapObjectPixelFromMapObjectLonLat:function(A){return this.mapObject.convertLatLonXY(A)},getLongitudeFromMapObjectLonLat:function(A){return this.sphericalMercator?this.forwardMercator(A.Lon,A.Lat).lon:A.Lon},getLatitudeFromMapObjectLonLat:function(A){return this.sphericalMercator?this.forwardMercator(A.Lon,A.Lat).lat:A.Lat},getMapObjectLonLatFromLonLat:function(D,C){var A;if(this.sphericalMercator){var B=this.inverseMercator(D,C);A=new YGeoPoint(B.lat,B.lon)}else{A=new YGeoPoint(C,D)}return A},getXFromMapObjectPixel:function(A){return A.x},getYFromMapObjectPixel:function(A){return A.y},getMapObjectPixelFromXY:function(A,B){return new YCoordPoint(A,B)},getMapObjectSizeFromOLSize:function(A){return new YSize(A.w,A.h)},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,initialize:function(A){this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},createCallback:function(C,A,B){return OpenLayers.Function.bind(function(){C.apply(this,[A,B])},this)},read:function(A){A=OpenLayers.Util.applyDefaults(A,this.options);var B=(A.readWithPOST!==undefined)?A.readWithPOST:this.readWithPOST;var C=new OpenLayers.Protocol.Response({requestType:"read"});if(A.filter&&A.filter instanceof OpenLayers.Filter.Spatial){if(A.filter.type==OpenLayers.Filter.Spatial.BBOX){A.params=OpenLayers.Util.extend(A.params,{bbox:A.filter.value.toArray()})}}if(B){C.priv=OpenLayers.Request.POST({url:A.url,callback:this.createCallback(this.handleRead,C,A),data:OpenLayers.Util.getParameterString(A.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{C.priv=OpenLayers.Request.GET({url:A.url,callback:this.createCallback(this.handleRead,C,A),params:A.params,headers:A.headers})}return C},handleRead:function(B,A){this.handleResponse(B,A)},create:function(B,A){A=OpenLayers.Util.applyDefaults(A,this.options);var C=new OpenLayers.Protocol.Response({reqFeatures:B,requestType:"create"});C.priv=OpenLayers.Request.POST({url:A.url,callback:this.createCallback(this.handleCreate,C,A),headers:A.headers,data:this.format.write(B)});return C},handleCreate:function(B,A){this.handleResponse(B,A)},update:function(C,B){var A=B.url||C.url||this.options.url;B=OpenLayers.Util.applyDefaults(B,this.options);var D=new OpenLayers.Protocol.Response({reqFeatures:C,requestType:"update"});D.priv=OpenLayers.Request.PUT({url:A,callback:this.createCallback(this.handleUpdate,D,B),headers:B.headers,data:this.format.write(C)});return D},handleUpdate:function(B,A){this.handleResponse(B,A)},"delete":function(C,B){var A=B.url||C.url||this.options.url;B=OpenLayers.Util.applyDefaults(B,this.options);var D=new OpenLayers.Protocol.Response({reqFeatures:C,requestType:"delete"});D.priv=OpenLayers.Request.DELETE({url:A,callback:this.createCallback(this.handleDelete,D,B),headers:B.headers});return D},handleDelete:function(B,A){this.handleResponse(B,A)},handleResponse:function(C,A){var B=C.priv;if(A.callback){if(B.status>=200&&B.status<300){if(C.requestType!="delete"){C.features=this.parseFeatures(B)}C.code=OpenLayers.Protocol.Response.SUCCESS}else{C.code=OpenLayers.Protocol.Response.FAILURE}A.callback.call(A.scope,C)}},parseFeatures:function(A){var B=A.responseXML;if(!B||!B.documentElement){B=A.responseText}if(!B||B.length<=0){return null}return this.format.read(B)},commit:function(B,P){P=OpenLayers.Util.applyDefaults(P,this.options);var D=[],L=0;var J={};J[OpenLayers.State.INSERT]=[];J[OpenLayers.State.UPDATE]=[];J[OpenLayers.State.DELETE]=[];var O,K,C=[];for(var E=0,I=B.length;E<I;++E){O=B[E];K=J[O.state];if(K){K.push(O);C.push(O)}}var G=(J[OpenLayers.State.INSERT].length>0?1:0)+J[OpenLayers.State.UPDATE].length+J[OpenLayers.State.DELETE].length;var N=true;var A=new OpenLayers.Protocol.Response({reqFeatures:C});function H(R){var Q=R.features?R.features.length:0;var T=new Array(Q);for(var S=0;S<Q;++S){T[S]=R.features[S].fid}A.insertIds=T;M.apply(this,[R])}function M(Q){this.callUserCallback(Q,P);N=N&&Q.success();L++;if(L>=G){if(P.callback){A.code=N?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;P.callback.apply(P.scope,[A])}}}var F=J[OpenLayers.State.INSERT];if(F.length>0){D.push(this.create(F,OpenLayers.Util.applyDefaults({callback:H,scope:this},P.create)))}F=J[OpenLayers.State.UPDATE];for(var E=F.length-1;E>=0;--E){D.push(this.update(F[E],OpenLayers.Util.applyDefaults({callback:M,scope:this},P.update)))}F=J[OpenLayers.State.DELETE];for(var E=F.length-1;E>=0;--E){D.push(this["delete"](F[E],OpenLayers.Util.applyDefaults({callback:M,scope:this},P["delete"])))}return D},abort:function(A){if(A){A.priv.abort()}},callUserCallback:function(C,A){var B=A[C.requestType];if(B&&B.callback){B.callback.call(B.scope,C)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(B,A){OpenLayers.Util.extend(this,A);this.rules=[];if(A&&A.rules){this.addRules(A.rules)}this.setDefaultStyle(B||OpenLayers.Feature.Vector.style["default"])},destroy:function(){for(var B=0,A=this.rules.length;B<A;B++){this.rules[B].destroy();this.rules[B]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(J){var A=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),J);var I=this.rules;var H,B;var C=[];var F=false;for(var D=0,E=I.length;D<E;D++){H=I[D];var G=H.evaluate(J);if(G){if(H instanceof OpenLayers.Rule&&H.elseFilter){C.push(H)}else{F=true;this.applySymbolizer(H,A,J)}}}if(F==false&&C.length>0){F=true;for(var D=0,E=C.length;D<E;D++){this.applySymbolizer(C[D],A,J)}}if(I.length>0&&F==false){A.display="none"}return A},applySymbolizer:function(F,D,B){var A=B.geometry?this.getSymbolizerPrefix(B.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var C=F.symbolizer[A]||F.symbolizer;if(this.defaultsPerSymbolizer===true){var E=this.defaultStyle;OpenLayers.Util.applyDefaults(C,{pointRadius:E.pointRadius});if(C.stroke===true||C.graphic===true){OpenLayers.Util.applyDefaults(C,{strokeWidth:E.strokeWidth,strokeColor:E.strokeColor,strokeOpacity:E.strokeOpacity,strokeDashstyle:E.strokeDashstyle,strokeLinecap:E.strokeLinecap})}if(C.fill===true||C.graphic===true){OpenLayers.Util.applyDefaults(C,{fillColor:E.fillColor,fillOpacity:E.fillOpacity})}if(C.graphic===true){OpenLayers.Util.applyDefaults(C,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})}}return this.createLiterals(OpenLayers.Util.extend(D,C),B)},createLiterals:function(D,C){var B=this.context||C.attributes||C.data;for(var A in this.propertyStyles){D[A]=OpenLayers.Style.createLiteral(D[A],B,C)}return D},findPropertyStyles:function(){var D={};var F=this.defaultStyle;this.addPropertyStyles(D,F);var H=this.rules;var E,G;for(var C=0,A=H.length;C<A;C++){E=H[C].symbolizer;for(var B in E){G=E[B];if(typeof G=="object"){this.addPropertyStyles(D,G)}else{this.addPropertyStyles(D,E);break}}}return D},addPropertyStyles:function(B,C){var D;for(var A in C){D=C[A];if(typeof D=="string"&&D.match(/\$\{\w+\}/)){B[A]=true}}return B},addRules:function(A){this.rules=this.rules.concat(A);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(A){this.defaultStyle=A;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(D){var C=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var B=0,A=C.length;B<A;B++){if(D.CLASS_NAME.indexOf(C[B])!=-1){return C[B]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(C,B,A){if(typeof C=="string"&&C.indexOf("${")!=-1){C=OpenLayers.String.format(C,B,[A]);C=(isNaN(C)||!C)?C:parseFloat(C)}return C};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,zoomBox:null,zoomWheelEnabled:true,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,initialize:function(A){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();this.zoomBox.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){if(this.handleRightClicks){this.map.viewPortDiv.oncontextmenu=function(){return false}}var A={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var B={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,A,B);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});this.activate()},defaultDblClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);this.map.setCenter(A,this.map.zoom+1)},defaultDblRightClick:function(B){var A=this.map.getLonLatFromViewPortPx(B.xy);this.map.setCenter(A,this.map.zoom-1)},wheelChange:function(H,C){var F=this.map.getZoom()+C;if(!this.map.isValidZoomLevel(F)){return }var I=this.map.getSize();var E=I.w/2-H.xy.x;var D=H.xy.y-I.h/2;var G=this.map.baseLayer.getResolutionForZoom(F);var A=this.map.getLonLatFromPixel(H.xy);var B=new OpenLayers.LonLat(A.lon+E*G,A.lat+D*G);this.map.setCenter(B,F)},wheelUp:function(A){this.wheelChange(A,1)},wheelDown:function(A){this.wheelChange(A,-1)},disableZoomWheel:function(){this.zoomWheelEnabled=false;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=true;if(this.active){this.handlers.wheel.activate()}},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(A){if(A){this.bounds=A.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(B){var A=this.getBounds();if(!A){this.setBounds(B)}else{this.bounds.extend(B)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(B,A){},getVertices:function(A){},atPoint:function(E,H,F){var C=false;var D=this.getBounds();if((D!=null)&&(E!=null)){var B=(H!=null)?H:0;var A=(F!=null)?F:0;var G=new OpenLayers.Bounds(this.bounds.left-B,this.bounds.bottom-A,this.bounds.right+B,this.bounds.top+A);C=G.containsLonLat(E)}return C},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(F){var G=arguments.callee.format;if(!G){G=new OpenLayers.Format.WKT();arguments.callee.format=G}var D;var B=G.read(F);if(B instanceof OpenLayers.Feature.Vector){D=B.geometry}else{if(B instanceof Array){var A=B.length;var E=new Array(A);for(var C=0;C<A;++C){E[C]=B[C].geometry}D=new OpenLayers.Geometry.Collection(E)}}return D};OpenLayers.Geometry.segmentsIntersect=function(A,b,B){var O=B&&B.point;var T=B&&B.tolerance;var E=false;var V=A.x1-b.x1;var Z=A.y1-b.y1;var L=A.x2-A.x1;var S=A.y2-A.y1;var P=b.y2-b.y1;var I=b.x2-b.x1;var X=(P*L)-(I*S);var D=(I*Z)-(P*V);var C=(L*Z)-(S*V);if(X==0){if(D==0&&C==0){E=true}}else{var Y=D/X;var W=C/X;if(Y>=0&&Y<=1&&W>=0&&W<=1){if(!O){E=true}else{var G=A.x1+(Y*L);var F=A.y1+(Y*S);E=new OpenLayers.Geometry.Point(G,F)}}}if(T){var N;if(E){if(O){var K=[A,b];var U,G,F;outer:for(var R=0;R<2;++R){U=K[R];for(var Q=1;Q<3;++Q){G=U["x"+Q];F=U["y"+Q];N=Math.sqrt(Math.pow(G-E.x,2)+Math.pow(F-E.y,2));if(N<T){E.x=G;E.y=F;break outer}}}}}else{var K=[A,b];var M,a,G,F,J,H;outer:for(var R=0;R<2;++R){M=K[R];a=K[(R+1)%2];for(var Q=1;Q<3;++Q){J={x:M["x"+Q],y:M["y"+Q]};H=OpenLayers.Geometry.distanceToSegment(J,a);if(H.distance<T){if(O){E=new OpenLayers.Geometry.Point(J.x,J.y)}else{E=true}break outer}}}}}return E};OpenLayers.Geometry.distanceToSegment=function(K,D){var C=K.x;var J=K.y;var B=D.x1;var I=D.y1;var A=D.x2;var F=D.y2;var M=A-B;var L=F-I;var H=((M*(C-B))+(L*(J-I)))/(Math.pow(M,2)+Math.pow(L,2));var G,E;if(H<=0){G=B;E=I}else{if(H>=1){G=A;E=F}else{G=B+H*M;E=I+H*L}}return{distance:Math.sqrt(Math.pow(G-C,2)+Math.pow(E-J,2)),x:G,y:E}};OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,useHttpTile:false,singleTile:false,useOverlay:false,useAsyncOverlay:true,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300,300),initialize:function(C,B,D,A){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(A==null||A.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(A&&A.useOverlay!=null){this.useOverlay=A.useOverlay}if(this.singleTile){if(this.useOverlay){OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS);if(!this.useAsyncOverlay){this.params.version="1.0.0"}}else{OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS)}}else{if(this.useHttpTile){OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS)}else{OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS)}this.setTileSize(this.defaultSize)}},clone:function(A){if(A==null){A=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.options)}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},addTile:function(B,A){return new OpenLayers.Tile.Image(this,A,B,null,this.tileSize)},getURL:function(A){var D;var B=A.getCenterLonLat();var H=this.map.getCurrentSize();if(this.singleTile){var E={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:H.h*this.ratio,setdisplaywidth:H.w*this.ratio,setviewcenterx:B.lon,setviewcentery:B.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var I={};I=OpenLayers.Util.extend(I,E);I.operation="GETVISIBLEMAPEXTENT";I.version="1.0.0";I.session=this.params.session;I.mapName=this.params.mapName;I.format="text/xml";D=this.getFullRequestString(I);OpenLayers.Request.GET({url:D,async:false})}D=this.getFullRequestString(E)}else{var G=this.map.getResolution();var F=Math.floor((A.left-this.maxExtent.left)/G);F=Math.round(F/this.tileSize.w);var C=Math.floor((this.maxExtent.top-A.top)/G);C=Math.round(C/this.tileSize.h);if(this.useHttpTile){D=this.getImageFilePath({tilecol:F,tilerow:C,scaleindex:this.resolutions.length-this.map.zoom-1})}else{D=this.getFullRequestString({tilecol:F,tilerow:C,scaleindex:this.resolutions.length-this.map.zoom-1})}}return D},getFullRequestString:function(F,E){var B=(E==null)?this.url:E;if(typeof B=="object"){B=B[Math.floor(Math.random()*B.length)]}var I=B;var G=OpenLayers.Util.extend({},this.params);G=OpenLayers.Util.extend(G,F);var D=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getArgs(B));for(var H in G){if(H.toUpperCase() in D){delete G[H]}}var A=OpenLayers.Util.getParameterString(G);A=A.replace(/,/g,"+");if(A!=""){var C=B.charAt(B.length-1);if((C=="&")||(C=="?")){I+=A}else{if(B.indexOf("?")==-1){I+="?"+A}else{I+="&"+A}}}return I},getImageFilePath:function(G,E){var C=(E==null)?this.url:E;if(typeof C=="object"){C=C[Math.floor(Math.random()*C.length)]}var B=C;var D="";var F="";if(G.tilerow<0){D="-"}if(G.tilerow==0){D+="0"}else{D+=Math.floor(Math.abs(G.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(G.tilecol<0){F="-"}if(G.tilecol==0){F+="0"}else{F+=Math.floor(Math.abs(G.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var A="/S"+Math.floor(G.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+D+"/C"+F+"/"+(G.tilerow%this.params.tileRowsPerFolder)+"_"+(G.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){A+="?"+this.params.querystring}B+=A;return B},calculateGridLayout:function(A,O,E){var K=E*this.tileSize.w;var C=E*this.tileSize.h;var I=A.left-O.left;var L=Math.floor(I/K)-this.buffer;var J=I/K-L;var F=-J*this.tileSize.w;var M=O.left+L*K;var B=O.top-A.top+C;var H=Math.floor(B/C)-this.buffer;var N=H-B/C;var D=N*this.tileSize.h;var G=O.top-C*H;return{tilelon:K,tilelat:C,tileoffsetlon:M,tileoffsetlat:G,tileoffsetx:F,tileoffsety:D}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(D,C,E,B){var A=[];A.push(D,C,E,B);OpenLayers.Layer.Grid.prototype.initialize.apply(this,A);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(B==null||B.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(A){if(A==null){A=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.options)}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},addTile:function(B,A){return new OpenLayers.Tile.Image(this,A,B,null,this.tileSize)},getURL:function(C){C=this.adjustBounds(C);var B=[C.left,C.bottom,C.right,C.top];var D=this.getImageSize();var A=this.getFullRequestString({mapext:B,imgext:B,map_size:[D.w,D.h],imgx:D.w/2,imgy:D.h/2,imgxy:[D.w,D.h]});return A},getFullRequestString:function(F,E){var B=(E==null)?this.url:E;var G=OpenLayers.Util.extend({},this.params);G=OpenLayers.Util.extend(G,F);var A=OpenLayers.Util.getParameterString(G);if(B instanceof Array){B=this.selectUrl(A,B)}var D=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(B));for(var H in G){if(H.toUpperCase() in D){delete G[H]}}A=OpenLayers.Util.getParameterString(G);var I=B;A=A.replace(/,/g,"+");if(A!=""){var C=B.charAt(B.length-1);if((C=="&")||(C=="?")){I+=A}else{if(B.indexOf("?")==-1){I+="?"+A}else{I+="&"+A}}}return I},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",exceptions:"application/vnd.ogc.se_inimage",format:"image/jpeg"},reproject:false,isBaseLayer:true,encodeBBOX:false,noMagic:false,initialize:function(D,C,E,B){var A=[];E=OpenLayers.Util.upperCaseObject(E);A.push(D,C,E,B);OpenLayers.Layer.Grid.prototype.initialize.apply(this,A);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((B==null)||(!B.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="image/jpeg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(A){if(A==null){A=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.options)}A=OpenLayers.Layer.Grid.prototype.clone.apply(this,[A]);return A},getURL:function(B){B=this.adjustBounds(B);var C=this.getImageSize();var D={BBOX:this.encodeBBOX?B.toBBOX():B.toArray(),WIDTH:C.w,HEIGHT:C.h};var A=this.getFullRequestString(D);return A},addTile:function(B,A){return new OpenLayers.Tile.Image(this,A,B,null,this.tileSize)},mergeNewParams:function(C){var B=OpenLayers.Util.upperCaseObject(C);var A=[B];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,A)},getFullRequestString:function(C,B){var A=this.map.getProjection();this.params.SRS=(A=="none")?null:A;return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(A){this.symbolizer={};OpenLayers.Util.extend(this,A);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var A in this.symbolizer){this.symbolizer[A]=null}this.symbolizer=null},evaluate:function(C){var B=this.getContext(C);var A=true;if(this.minScaleDenominator||this.maxScaleDenominator){var D=C.layer.map.getScale()}if(this.minScaleDenominator){A=D>=OpenLayers.Style.createLiteral(this.minScaleDenominator,B)}if(A&&this.maxScaleDenominator){A=D<OpenLayers.Style.createLiteral(this.maxScaleDenominator,B)}if(A&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){A=this.filter.evaluate(C)}else{A=this.filter.evaluate(B)}}return A},getContext:function(B){var A=this.context;if(!A){A=B.attributes||B.data}if(typeof this.context=="function"){A=this.context(B)}return A},clone:function(){var A=OpenLayers.Util.extend({},this);A.symbolizer={};for(var B in this.symbolizer){value=this.symbolizer[B];type=typeof value;if(type==="object"){A.symbolizer[B]=OpenLayers.Util.extend({},value)}else{if(type==="string"){A.symbolizer[B]=value}}}A.filter=this.filter&&this.filter.clone();A.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(A)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(C,A){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(C instanceof OpenLayers.Style){this.styles["default"]=C;this.styles.select=C;this.styles.temporary=C;this.styles["delete"]=C}else{if(typeof C=="object"){for(var B in C){if(C[B] instanceof OpenLayers.Style){this.styles[B]=C[B]}else{if(typeof C[B]=="object"){this.styles[B]=new OpenLayers.Style(C[B])}else{this.styles["default"]=new OpenLayers.Style(C);this.styles.select=new OpenLayers.Style(C);this.styles.temporary=new OpenLayers.Style(C);this.styles["delete"]=new OpenLayers.Style(C);break}}}}}OpenLayers.Util.extend(this,A)},destroy:function(){for(var A in this.styles){this.styles[A].destroy()}this.styles=null},createSymbolizer:function(B,C){if(!B){B=new OpenLayers.Feature.Vector()}if(!this.styles[C]){C="default"}B.renderIntent=C;var A={};if(this.extendDefault&&C!="default"){A=this.styles["default"].createSymbolizer(B)}return OpenLayers.Util.extend(A,this.styles[C].createSymbolizer(B))},addUniqueValueRules:function(B,D,F,A){var E=[];for(var C in F){E.push(new OpenLayers.Rule({symbolizer:F[C],context:A,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:D,value:C})}))}this.styles[B].addRules(E)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(A){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(A!=null){this.addComponents(A)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var B=[];for(var C=0,A=this.components.length;C<A;C++){B.push(this.components[C].toShortString())}return B.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var B=1,A=this.components.length;B<A;B++){this.extendBounds(this.components[B].getBounds())}}},addComponents:function(C){if(!(C instanceof Array)){C=[C]}for(var B=0,A=C.length;B<A;B++){this.addComponent(C[B])}},addComponent:function(B,A){var D=false;if(B){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,B.CLASS_NAME)>-1)){if(A!=null&&(A<this.components.length)){var E=this.components.slice(0,A);var C=this.components.slice(A,this.components.length);E.push(B);this.components=E.concat(C)}else{this.components.push(B)}B.parent=this;this.clearBounds();D=true}}return D},removeComponents:function(B){if(!(B instanceof Array)){B=[B]}for(var A=B.length-1;A>=0;--A){this.removeComponent(B[A])}},removeComponent:function(A){OpenLayers.Util.removeItem(this.components,A);this.clearBounds()},getLength:function(){var C=0;for(var B=0,A=this.components.length;B<A;B++){C+=this.components[B].getLength()}return C},getArea:function(){var C=0;for(var B=0,A=this.components.length;B<A;B++){C+=this.components[B].getArea()}return C},getGeodesicArea:function(B){var D=0;for(var C=0,A=this.components.length;C<A;C++){D+=this.components[C].getGeodesicArea(B)}return D},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(B){var D=0;for(var C=0,A=this.components.length;C<A;C++){D+=this.components[C].getGeodesicLength(B)}return D},move:function(B,D){for(var C=0,A=this.components.length;C<A;C++){this.components[C].move(B,D)}},rotate:function(D,B){for(var C=0,A=this.components.length;C<A;++C){this.components[C].rotate(D,B)}},resize:function(D,A,C){for(var B=0;B<this.components.length;++B){this.components[B].resize(D,A,C)}return this},distanceTo:function(G,H){var B=!(H&&H.edge===false);var A=B&&H&&H.details;var I,C;var D=Number.POSITIVE_INFINITY;for(var E=0,F=this.components.length;E<F;++E){I=this.components[E].distanceTo(G,H);distance=A?I.distance:I;if(distance<D){D=distance;C=I;if(D==0){break}}}return C},equals:function(D){var B=true;if(!D||!D.CLASS_NAME||(this.CLASS_NAME!=D.CLASS_NAME)){B=false}else{if(!(D.components instanceof Array)||(D.components.length!=this.components.length)){B=false}else{for(var C=0,A=this.components.length;C<A;++C){if(!this.components[C].equals(D.components[C])){B=false;break}}}}return B},transform:function(E,C){if(E&&C){for(var D=0,A=this.components.length;D<A;D++){var B=this.components[D];B.transform(E,C)}this.bounds=null}return this},intersects:function(D){var B=false;for(var C=0,A=this.components.length;C<A;++C){B=D.intersects(this.components[C]);if(B){break}}return B},getVertices:function(B){var C=[];for(var D=0,A=this.components.length;D<A;++D){Array.prototype.push.apply(C,this.components[D].getVertices(B))}return C},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(A,B){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(A);this.y=parseFloat(B)},clone:function(A){if(A==null){A=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(A,this);return A},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(F,J){var D=!(J&&J.edge===false);var A=D&&J&&J.details;var B,E,H,C,G,I;if(F instanceof OpenLayers.Geometry.Point){E=this.x;H=this.y;C=F.x;G=F.y;B=Math.sqrt(Math.pow(E-C,2)+Math.pow(H-G,2));I=!A?B:{x0:E,y0:H,x1:C,y1:G,distance:B}}else{I=F.distanceTo(this,J);if(A){I={x0:I.x1,y0:I.y1,x1:I.x0,y1:I.y0,distance:I.distance}}}return I},equals:function(A){var B=false;if(A!=null){B=((this.x==A.x&&this.y==A.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(A.x)&&isNaN(A.y)))}return B},toShortString:function(){return(this.x+", "+this.y)},move:function(A,B){this.x=this.x+A;this.y=this.y+B;this.clearBounds()},rotate:function(D,B){D*=Math.PI/180;var A=this.distanceTo(B);var C=D+Math.atan2(this.y-B.y,this.x-B.x);this.x=B.x+(A*Math.cos(C));this.y=B.y+(A*Math.sin(C));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(C,A,B){B=(B==undefined)?1:B;this.x=A.x+(C*B*(this.x-A.x));this.y=A.y+(C*(this.y-A.y));this.clearBounds();return this},intersects:function(B){var A=false;if(B.CLASS_NAME=="OpenLayers.Geometry.Point"){A=this.equals(B)}else{A=B.intersects(this)}return A},transform:function(B,A){if((B&&A)){OpenLayers.Projection.transform(this,B,A);this.bounds=null}return this},getVertices:function(A){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,selectedFeatures:null,unrenderedFeatures:null,reportError:true,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:false,initialize:function(C,B){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var D=0,A=this.strategies.length;D<A;D++){this.strategies[D].setLayer(this)}}},destroy:function(){if(this.strategies){var C,B,A;for(B=0,A=this.strategies.length;B<A;B++){C=this.strategies[B];if(C.autoDestroy){C.destroy()}}this.strategies=null}if(this.protocol){if(this.protocol.autoDestroy){this.protocol.destroy()}this.protocol=null}this.destroyFeatures();this.features=null;this.selectedFeatures=null;this.unrenderedFeatures=null;if(this.renderer){this.renderer.destroy()}this.renderer=null;this.geometryType=null;this.drawn=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},refresh:function(A){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",A)}},assignRenderer:function(){for(var C=0,A=this.renderers.length;C<A;C++){var B=OpenLayers.Renderer[this.renderers[C]];if(B&&B.prototype.supported()){this.renderer=new B(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(A){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;this.renderer.setSize(this.map.getSize())}},afterAdd:function(){if(this.strategies){var C,B,A;for(B=0,A=this.strategies.length;B<A;B++){C=this.strategies[B];if(C.autoActivate){C.activate()}}}},removeMap:function(C){if(this.strategies){var D,B,A;for(B=0,A=this.strategies.length;B<A;B++){D=this.strategies[B];if(D.autoActivate){D.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(G,B,H){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var E=true;if(!H){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var F=this.map.getExtent();E=this.renderer.setExtent(F,B);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!B&&E){for(var D in this.unrenderedFeatures){var C=this.unrenderedFeatures[D];this.drawFeature(C)}}}if(!this.drawn||B||!E){this.drawn=true;var C;for(var D=0,A=this.features.length;D<A;D++){this.renderer.locked=(D!==(A-1));C=this.features[D];this.drawFeature(C)}}},display:function(A){OpenLayers.Layer.prototype.display.apply(this,arguments);var B=this.div.style.display;if(B!=this.renderer.root.style.display){this.renderer.root.style.display=B}},addFeatures:function(B,I){if(!(B instanceof Array)){B=[B]}var G=!I||!I.silent;if(G){var A={features:B};var F=this.events.triggerEvent("beforefeaturesadded",A);if(F===false){return }B=A.features}for(var C=0,E=B.length;C<E;C++){if(C!=(B.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var H=B[C];if(this.geometryType&&!(H.geometry instanceof this.geometryType)){var D=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw D}this.features.push(H);H.layer=this;if(!H.style&&this.style){H.style=OpenLayers.Util.extend({},this.style)}if(G){if(this.events.triggerEvent("beforefeatureadded",{feature:H})===false){continue}this.preFeatureInsert(H)}this.drawFeature(H);if(G){this.events.triggerEvent("featureadded",{feature:H});this.onFeatureInsert(H)}}if(G){this.events.triggerEvent("featuresadded",{features:B})}},removeFeatures:function(E,A){if(!E||E.length===0){return }if(!(E instanceof Array)){E=[E]}if(E===this.features){E=E.slice()}var D=!A||!A.silent;for(var C=E.length-1;C>=0;C--){if(C!=0&&E[C-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var B=E[C];delete this.unrenderedFeatures[B.id];if(D){this.events.triggerEvent("beforefeatureremoved",{feature:B})}this.features=OpenLayers.Util.removeItem(this.features,B);B.layer=null;if(B.geometry){this.renderer.eraseFeatures(B)}if(OpenLayers.Util.indexOf(this.selectedFeatures,B)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,B)}if(D){this.events.triggerEvent("featureremoved",{feature:B})}}if(D){this.events.triggerEvent("featuresremoved",{features:E})}},destroyFeatures:function(D,A){var C=(D==undefined);if(C){D=this.features}if(D){this.removeFeatures(D,A);for(var B=D.length-1;B>=0;B--){D[B].destroy()}}},drawFeature:function(A,B){if(!this.drawn){return }if(typeof B!="object"){if(!B&&A.state===OpenLayers.State.DELETE){B="delete"}var C=B||A.renderIntent;B=A.style||this.style;if(!B){B=this.styleMap.createSymbolizer(A,C)}}if(!this.renderer.drawFeature(A,B)){this.unrenderedFeatures[A.id]=A}else{delete this.unrenderedFeatures[A.id]}},eraseFeatures:function(A){this.renderer.eraseFeatures(A)},getFeatureFromEvent:function(A){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var B=this.renderer.getFeatureIdFromEvent(A);return this.getFeatureById(B)},getFeatureById:function(D){var C=null;for(var B=0,A=this.features.length;B<A;++B){if(this.features[B].id==D){C=this.features[B];break}}return C},onFeatureInsert:function(A){},preFeatureInsert:function(A){},getDataExtent:function(){var B=null;if(this.features&&(this.features.length>0)){B=new OpenLayers.Bounds();for(var C=0,A=this.features.length;C<A;C++){B.extend(this.features[C].geometry.getBounds())}}return B},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(A,B){this.addComponent(A,B)},removePoint:function(A){this.removeComponent(A)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:false,drawing:false,mouseDown:false,lastDown:null,lastUp:null,persist:false,layerOptions:null,initialize:function(C,B,A){if(!(A&&A.layerOptions&&A.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var A=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:function(){return true}},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,A);this.map.addLayer(this.layer);return true},createFeature:function(A){var B=this.map.getLonLatFromPixel(A);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B.lon,B.lat));this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(B){var A=B?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(A,[this.geometryClone()]);if(B||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(A){OpenLayers.Event.stop(A);return false},dblclick:function(A){OpenLayers.Event.stop(A);return false},modifyFeature:function(A){var B=this.map.getLonLatFromPixel(A);this.point.geometry.x=B.lon;this.point.geometry.y=B.lat;this.callback("modify",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var A=this.point&&this.point.geometry;if(A&&this.multi){A=new OpenLayers.Geometry.MultiPoint([A])}return A},geometryClone:function(){var A=this.getGeometry();return A&&A.clone()},mousedown:function(A){if(!this.checkModifiers(A)){return true}if(this.lastDown&&this.lastDown.equals(A.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(A.xy)}else{this.modifyFeature(A.xy)}this.lastDown=A.xy;return false},mousemove:function(A){if(this.drawing){this.modifyFeature(A.xy)}return true},mouseup:function(A){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(A){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var C=0;if(this.components&&(this.components.length>1)){for(var B=1,A=this.components.length;B<A;B++){C+=this.components[B-1].distanceTo(this.components[B])}}return C},getGeodesicLength:function(B){var E=this;if(B){var C=new OpenLayers.Projection("EPSG:4326");if(!C.equals(B)){E=this.clone().transform(B,C)}}var F=0;if(E.components&&(E.components.length>1)){var H,G;for(var D=1,A=E.components.length;D<A;D++){H=E.components[D-1];G=E.components[D];F+=OpenLayers.Util.distVincenty({lon:H.x,lat:H.y},{lon:G.x,lat:G.y})}}return F*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(A){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(A){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(K){var C=false;var J=K.CLASS_NAME;if(J=="OpenLayers.Geometry.LineString"||J=="OpenLayers.Geometry.LinearRing"||J=="OpenLayers.Geometry.Point"){var N=this.getSortedSegments();var L;if(J=="OpenLayers.Geometry.Point"){L=[{x1:K.x,y1:K.y,x2:K.x,y2:K.y}]}else{L=K.getSortedSegments()}var Q,G,E,A,P,O,D,B;outer:for(var H=0,I=N.length;H<I;++H){Q=N[H];G=Q.x1;E=Q.x2;A=Q.y1;P=Q.y2;inner:for(var F=0,M=L.length;F<M;++F){O=L[F];if(O.x1>E){break}if(O.x2<G){continue}D=O.y1;B=O.y2;if(Math.min(D,B)>Math.max(A,P)){continue}if(Math.max(D,B)<Math.min(A,P)){continue}if(OpenLayers.Geometry.segmentsIntersect(Q,O)){C=true;break outer}}}}else{C=K.intersects(this)}return C},getSortedSegments:function(){var A=this.components.length-1;var B=new Array(A);for(var C=0;C<A;++C){point1=this.components[C];point2=this.components[C+1];if(point1.x<point2.x){B[C]={x1:point1.x,y1:point1.y,x2:point2.x,y2:point2.y}}else{B[C]={x1:point2.x,y1:point2.y,x2:point1.x,y2:point1.y}}}function D(F,E){return F.x1-E.x1}return B.sort(D)},splitWithSegment:function(Q,B){var C=!(B&&B.edge===false);var N=B&&B.tolerance;var A=[];var S=this.getVertices();var M=[];var U=[];var H=false;var E,D,K;var I,P,T;var F={point:true,tolerance:N};var G=null;for(var L=0,J=S.length-2;L<=J;++L){E=S[L];M.push(E.clone());D=S[L+1];T={x1:E.x,y1:E.y,x2:D.x,y2:D.y};K=OpenLayers.Geometry.segmentsIntersect(Q,T,F);if(K instanceof OpenLayers.Geometry.Point){if((K.x===Q.x1&&K.y===Q.y1)||(K.x===Q.x2&&K.y===Q.y2)||K.equals(E)||K.equals(D)){P=true}else{P=false}if(P||C){if(!K.equals(U[U.length-1])){U.push(K.clone())}if(L===0){if(K.equals(E)){continue}}if(K.equals(D)){continue}H=true;if(!K.equals(E)){M.push(K)}A.push(new OpenLayers.Geometry.LineString(M));M=[K.clone()]}}}if(H){M.push(D.clone());A.push(new OpenLayers.Geometry.LineString(M))}if(U.length>0){var O=Q.x1<Q.x2?1:-1;var R=Q.y1<Q.y2?1:-1;G={lines:A,points:U.sort(function(W,V){return(O*W.x-O*V.x)||(R*W.y-R*V.y)})}}return G},split:function(U,B){var K=null;var D=B&&B.mutual;var I,E,J,C;if(U instanceof OpenLayers.Geometry.LineString){var T=this.getVertices();var G,F,S,H,A,M;var P=[];J=[];for(var Q=0,L=T.length-2;Q<=L;++Q){G=T[Q];F=T[Q+1];S={x1:G.x,y1:G.y,x2:F.x,y2:F.y};C=C||[U];if(D){P.push(G.clone())}for(var O=0;O<C.length;++O){H=C[O].splitWithSegment(S,B);if(H){A=H.lines;if(A.length>0){A.unshift(O,1);Array.prototype.splice.apply(C,A);O+=A.length-2}if(D){for(var N=0,R=H.points.length;N<R;++N){M=H.points[N];if(!M.equals(G)){P.push(M);J.push(new OpenLayers.Geometry.LineString(P));if(M.equals(F)){P=[]}else{P=[M.clone()]}}}}}}}if(D&&J.length>0&&P.length>0){P.push(F.clone());J.push(new OpenLayers.Geometry.LineString(P))}}else{K=U.splitWith(this,B)}if(C&&C.length>1){E=true}else{C=[]}if(J&&J.length>1){I=true}else{J=[]}if(E||I){if(D){K=[J,C]}else{K=C}}return K},splitWith:function(B,A){return B.split(this,A)},getVertices:function(A){var B;if(A===true){B=[this.components[0],this.components[this.components.length-1]]}else{if(A===false){B=this.components.slice(1,this.components.length-1)}else{B=this.components.slice()}}return B},distanceTo:function(H,G){var I=!(G&&G.edge===false);var X=I&&G&&G.details;var O,E={};var R=Number.POSITIVE_INFINITY;if(H instanceof OpenLayers.Geometry.Point){var P=this.getSortedSegments();var N=H.x;var M=H.y;var V;for(var T=0,U=P.length;T<U;++T){V=P[T];O=OpenLayers.Geometry.distanceToSegment(H,V);if(O.distance<R){R=O.distance;E=O;if(R===0){break}}else{if(V.x2>N&&((M>V.y1&&M<V.y2)||(M<V.y1&&M>V.y2))){break}}}if(X){E={distance:E.distance,x0:E.x,y0:E.y,x1:N,y1:M}}else{E=E.distance}}else{if(H instanceof OpenLayers.Geometry.LineString){var D=this.getSortedSegments();var C=H.getSortedSegments();var B,A,L,W,F;var K=C.length;var J={point:true};outer:for(var T=0,U=D.length;T<U;++T){B=D[T];W=B.x1;F=B.y1;for(var S=0;S<K;++S){A=C[S];L=OpenLayers.Geometry.segmentsIntersect(B,A,J);if(L){R=0;E={distance:0,x0:L.x,y0:L.y,x1:L.x,y1:L.y};break outer}else{O=OpenLayers.Geometry.distanceToSegment({x:W,y:F},A);if(O.distance<R){R=O.distance;E={distance:R,x0:W,y0:F,x1:O.x,y1:O.y}}}}}if(!X){E=E.distance}if(R!==0){if(B){O=H.distanceTo(new OpenLayers.Geometry.Point(B.x2,B.y2),G);var Q=X?O.distance:O;if(Q<R){if(X){E={distance:R,x0:O.x1,y0:O.y1,x1:O.x0,y1:O.y0}}else{E=Q}}}}}else{E=H.distanceTo(this,G);if(X){E={distance:E.distance,x0:E.x1,y0:E.y1,x1:E.x0,y1:E.y0}}}}return E},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(A){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(A,B){var C=false;var D=this.components.pop();if(B!=null||!A.equals(D)){C=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var E=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[E]);return C},removeComponent:function(A){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var B=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[B])}},move:function(B,D){for(var C=0,A=this.components.length;C<A-1;C++){this.components[C].move(B,D)}},rotate:function(D,B){for(var C=0,A=this.components.length;C<A-1;++C){this.components[C].rotate(D,B)}},resize:function(E,B,D){for(var C=0,A=this.components.length;C<A-1;++C){this.components[C].resize(E,B,D)}return this},transform:function(E,C){if(E&&C){for(var D=0,A=this.components.length;D<A-1;D++){var B=this.components[D];B.transform(E,C)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var F=0;var E=0;for(var C=0;C<this.components.length-1;C++){var B=this.components[C];var H=this.components[C+1];F+=(B.x+H.x)*(B.x*H.y-H.x*B.y);E+=(B.y+H.y)*(B.x*H.y-H.x*B.y)}var D=-1*this.getArea();var A=F/(6*D);var G=E/(6*D)}return new OpenLayers.Geometry.Point(A,G)},getArea:function(){var E=0;if(this.components&&(this.components.length>2)){var D=0;for(var C=0,B=this.components.length;C<B-1;C++){var A=this.components[C];var F=this.components[C+1];D+=(A.x+F.x)*(F.y-A.y)}E=-D/2}return E},getGeodesicArea:function(B){var D=this;if(B){var C=new OpenLayers.Projection("EPSG:4326");if(!C.equals(B)){D=this.clone().transform(B,C)}}var F=0;var A=D.components&&D.components.length;if(A>2){var H,G;for(var E=0;E<A-1;E++){H=D.components[E];G=D.components[E+1];F+=OpenLayers.Util.rad(G.x-H.x)*(2+Math.sin(OpenLayers.Util.rad(H.y))+Math.sin(OpenLayers.Util.rad(G.y)))}F=F*6378137*6378137/2}return F},containsPoint:function(L){var R=OpenLayers.Number.limitSigDigs;var K=14;var J=R(L.x,K);var I=R(L.y,K);function Q(W,T,V,S,U){return(((T-S)*W)+((S*V)-(T*U)))/(V-U)}var A=this.components.length-1;var G,F,P,D,N,B,E,C;var H=0;for(var M=0;M<A;++M){G=this.components[M];P=R(G.x,K);D=R(G.y,K);F=this.components[M+1];N=R(F.x,K);B=R(F.y,K);if(D==B){if(I==D){if(P<=N&&(J>=P&&J<=N)||P>=N&&(J<=P&&J>=N)){H=-1;break}}continue}E=R(Q(I,P,D,N,B),K);if(E==J){if(D<B&&(I>=D&&I<=B)||D>B&&(I<=D&&I>=B)){H=-1;break}}if(E<=J){continue}if(P!=N&&(E<Math.min(P,N)||E>Math.max(P,N))){continue}if(D<B&&(I>=D&&I<B)||D>B&&(I<D&&I>=B)){++H}}var O=(H==-1)?1:!!(H&1);return O},intersects:function(D){var B=false;if(D.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.containsPoint(D)}else{if(D.CLASS_NAME=="OpenLayers.Geometry.LineString"){B=D.intersects(this)}else{if(D.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){B=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[D])}else{for(var C=0,A=D.components.length;C<A;++C){B=D.components[C].intersects(this);if(B){break}}}}}return B},getVertices:function(A){return(A===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(K,P){var G=null;var O=P&&P.mutual;var L,A,N,J,B;var E=[];var M=[K];for(var F=0,H=this.components.length;F<H;++F){A=this.components[F];J=false;for(var D=0;D<M.length;++D){L=A.split(M[D],P);if(L){if(O){N=L[0];for(var C=0,I=N.length;C<I;++C){if(C===0&&E.length){E[E.length-1].addComponent(N[C])}else{E.push(new OpenLayers.Geometry.MultiLineString([N[C]]))}}J=true;L=L[1]}if(L.length){L.unshift(D,1);Array.prototype.splice.apply(M,L);break}}}if(!J){if(E.length){E[E.length-1].addComponent(A.clone())}else{E=[new OpenLayers.Geometry.MultiLineString(A.clone())]}}}if(E&&E.length>1){J=true}else{E=[]}if(M&&M.length>1){B=true}else{M=[]}if(J||B){if(O){G=[E,M]}else{G=M}}return G},splitWith:function(K,P){var G=null;var O=P&&P.mutual;var L,C,N,J,A,E,M;if(K instanceof OpenLayers.Geometry.LineString){M=[];E=[K];for(var F=0,H=this.components.length;F<H;++F){A=false;C=this.components[F];for(var D=0;D<E.length;++D){L=E[D].split(C,P);if(L){if(O){N=L[0];if(N.length){N.unshift(D,1);Array.prototype.splice.apply(E,N);D+=N.length-2}L=L[1];if(L.length===0){L=[C.clone()]}}for(var B=0,I=L.length;B<I;++B){if(B===0&&M.length){M[M.length-1].addComponent(L[B])}else{M.push(new OpenLayers.Geometry.MultiLineString([L[B]]))}}A=true}}if(!A){if(M.length){M[M.length-1].addComponent(C.clone())}else{M=[new OpenLayers.Geometry.MultiLineString([C.clone()])]}}}}else{G=K.split(this)}if(E&&E.length>1){J=true}else{E=[]}if(M&&M.length>1){A=true}else{M=[]}if(J||A){if(O){G=[E,M]}else{G=M}}return G},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(C,B,A){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(A){var B=this.control.map.getLonLatFromPixel(A);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B.lon,B.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(A){this.layer.removeFeatures([this.point]);var B=this.control.map.getLonLatFromPixel(A);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B.lon,B.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},freehandMode:function(A){return(this.freehandToggle&&A[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(A){var B=this.control.map.getLonLatFromPixel(A);this.point.geometry.x=B.lon;this.point.geometry.y=B.lat;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var A=this.line&&this.line.geometry;if(A&&this.multi){A=new OpenLayers.Geometry.MultiLineString([A])}return A},mousedown:function(A){if(this.lastDown&&this.lastDown.equals(A.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(A.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(A.xy)){this.addPoint(A.xy)}}this.mouseDown=true;this.lastDown=A.xy;this.drawing=true;return false},mousemove:function(A){if(this.drawing){if(this.mouseDown&&this.freehandMode(A)){this.addPoint(A.xy)}else{this.modifyFeature(A.xy)}}return true},mouseup:function(A){this.mouseDown=false;if(this.drawing){if(this.freehandMode(A)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(A.xy)}this.lastUp=A.xy}return false}return true},dblclick:function(A){if(!this.freehandMode(A)){var B=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[B]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var C=0;if(this.components&&(this.components.length>0)){C+=Math.abs(this.components[0].getArea());for(var B=1,A=this.components.length;B<A;B++){C-=Math.abs(this.components[B].getArea())}}return C},getGeodesicArea:function(B){var D=0;if(this.components&&(this.components.length>0)){D+=Math.abs(this.components[0].getGeodesicArea(B));for(var C=1,A=this.components.length;C<A;C++){D-=Math.abs(this.components[C].getGeodesicArea(B))}}return D},containsPoint:function(A){var E=this.components.length;var C=false;if(E>0){C=this.components[0].containsPoint(A);if(C!==1){if(C&&E>1){var D;for(var B=1;B<E;++B){D=this.components[B].containsPoint(A);if(D){if(D===1){C=1}else{C=false}break}}}}}return C},intersects:function(E){var B=false;var D,A;if(E.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.containsPoint(E)}else{if(E.CLASS_NAME=="OpenLayers.Geometry.LineString"||E.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(D=0,A=this.components.length;D<A;++D){B=E.intersects(this.components[D]);if(B){break}}if(!B){for(D=0,A=E.components.length;D<A;++D){B=this.containsPoint(E.components[D]);if(B){break}}}}else{for(D=0,A=E.components.length;D<A;++D){B=this.intersects(E.components[D]);if(B){break}}}}if(!B&&E.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var C=this.components[0];for(D=0,A=C.components.length;D<A;++D){B=E.containsPoint(C.components[D]);if(B){break}}}return B},distanceTo:function(D,B){var C=!(B&&B.edge===false);var A;if(!C&&this.intersects(D)){A=0}else{A=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[D,B])}return A},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(I,F,B,K){var C=Math.PI*((1/B)-(1/2));if(K){C+=(K/180)*Math.PI}var A,H,G;var J=[];for(var E=0;E<B;++E){A=C+(E*2*Math.PI/B);H=I.x+(F*Math.cos(A));G=I.y+(F*Math.sin(A));J.push(new OpenLayers.Geometry.Point(H,G))}var D=new OpenLayers.Geometry.LinearRing(J);return new OpenLayers.Geometry.Polygon([D])};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(A){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(C,B,A){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(A){var B=this.control.map.getLonLatFromPixel(A);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B.lon,B.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var A=this.polygon&&this.polygon.geometry;if(A&&this.multi){A=new OpenLayers.Geometry.MultiPolygon([A])}return A},dblclick:function(A){if(!this.freehandMode(A)){var B=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[B]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.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:true,xy:true,initialize:function(A){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[A])},read:function(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var E=this.getElementsByTagNameNS(D.documentElement,this.gmlns,this.featureName);var C=[];for(var B=0;B<E.length;B++){var A=this.parseFeature(E[B]);if(A){C.push(A)}}return C},parseFeature:function(C){var D=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope","Box"];var I,F,J,B;for(var H=0;H<D.length;++H){I=D[H];F=this.getElementsByTagNameNS(C,this.gmlns,I);if(F.length>0){var B=this.parseGeometry[I.toLowerCase()];if(B){J=B.apply(this,[F[0]]);if(this.internalProjection&&this.externalProjection){J.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:I}))}break}}var G;if(this.extractAttributes){G=this.parseAttributes(C)}var K=new OpenLayers.Feature.Vector(J,G);K.gml={featureType:C.firstChild.nodeName.split(":")[1],featureNS:C.firstChild.namespaceURI,featureNSPrefix:C.firstChild.prefix};var A=C.firstChild;var E;while(A){if(A.nodeType==1){E=A.getAttribute("fid")||A.getAttribute("id");if(E){break}}A=A.nextSibling}K.fid=E;return K},parseGeometry:{point:function(D){var B,A;var E=[];var B=this.getElementsByTagNameNS(D,this.gmlns,"pos");if(B.length>0){A=B[0].firstChild.nodeValue;A=A.replace(this.regExes.trimSpace,"");E=A.split(this.regExes.splitSpace)}if(E.length==0){B=this.getElementsByTagNameNS(D,this.gmlns,"coordinates");if(B.length>0){A=B[0].firstChild.nodeValue;A=A.replace(this.regExes.removeSpace,"");E=A.split(",")}}if(E.length==0){B=this.getElementsByTagNameNS(D,this.gmlns,"coord");if(B.length>0){var F=this.getElementsByTagNameNS(B[0],this.gmlns,"X");var C=this.getElementsByTagNameNS(B[0],this.gmlns,"Y");if(F.length>0&&C.length>0){E=[F[0].firstChild.nodeValue,C[0].firstChild.nodeValue]}}}if(E.length==2){E[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(E[0],E[1],E[2])}else{return new OpenLayers.Geometry.Point(E[1],E[0],E[2])}},multipoint:function(E){var B=this.getElementsByTagNameNS(E,this.gmlns,"Point");var D=[];if(B.length>0){var A;for(var C=0;C<B.length;++C){A=this.parseGeometry.point.apply(this,[B[C]]);if(A){D.push(A)}}}return new OpenLayers.Geometry.MultiPoint(D)},linestring:function(C,E){var D,B;var L=[];var M=[];D=this.getElementsByTagNameNS(C,this.gmlns,"posList");if(D.length>0){B=this.getChildValue(D[0]);B=B.replace(this.regExes.trimSpace,"");L=B.split(this.regExes.splitSpace);var H=parseInt(D[0].getAttribute("dimension"));var F,K,J,I;for(var G=0;G<L.length/H;++G){F=G*H;K=L[F];J=L[F+1];I=(H==2)?null:L[F+2];if(this.xy){M.push(new OpenLayers.Geometry.Point(K,J,I))}else{M.push(new OpenLayers.Geometry.Point(J,K,I))}}}if(L.length==0){D=this.getElementsByTagNameNS(C,this.gmlns,"coordinates");if(D.length>0){B=this.getChildValue(D[0]);B=B.replace(this.regExes.trimSpace,"");B=B.replace(this.regExes.trimComma,",");var A=B.split(this.regExes.splitSpace);for(var G=0;G<A.length;++G){L=A[G].split(",");if(L.length==2){L[2]=null}if(this.xy){M.push(new OpenLayers.Geometry.Point(L[0],L[1],L[2]))}else{M.push(new OpenLayers.Geometry.Point(L[1],L[0],L[2]))}}}}var N=null;if(M.length!=0){if(E){N=new OpenLayers.Geometry.LinearRing(M)}else{N=new OpenLayers.Geometry.LineString(M)}}return N},multilinestring:function(E){var B=this.getElementsByTagNameNS(E,this.gmlns,"LineString");var D=[];if(B.length>0){var A;for(var C=0;C<B.length;++C){A=this.parseGeometry.linestring.apply(this,[B[C]]);if(A){D.push(A)}}}return new OpenLayers.Geometry.MultiLineString(D)},polygon:function(E){var B=this.getElementsByTagNameNS(E,this.gmlns,"LinearRing");var D=[];if(B.length>0){var A;for(var C=0;C<B.length;++C){A=this.parseGeometry.linestring.apply(this,[B[C],true]);if(A){D.push(A)}}}return new OpenLayers.Geometry.Polygon(D)},multipolygon:function(E){var A=this.getElementsByTagNameNS(E,this.gmlns,"Polygon");var D=[];if(A.length>0){var C;for(var B=0;B<A.length;++B){C=this.parseGeometry.polygon.apply(this,[A[B]]);if(C){D.push(C)}}}return new OpenLayers.Geometry.MultiPolygon(D)},envelope:function(B){var E=[];var A;var F;var J=this.getElementsByTagNameNS(B,this.gmlns,"lowerCorner");if(J.length>0){var H=[];if(J.length>0){A=J[0].firstChild.nodeValue;A=A.replace(this.regExes.trimSpace,"");H=A.split(this.regExes.splitSpace)}if(H.length==2){H[2]=null}if(this.xy){var D=new OpenLayers.Geometry.Point(H[0],H[1],H[2])}else{var D=new OpenLayers.Geometry.Point(H[1],H[0],H[2])}}var G=this.getElementsByTagNameNS(B,this.gmlns,"upperCorner");if(G.length>0){var H=[];if(G.length>0){A=G[0].firstChild.nodeValue;A=A.replace(this.regExes.trimSpace,"");H=A.split(this.regExes.splitSpace)}if(H.length==2){H[2]=null}if(this.xy){var I=new OpenLayers.Geometry.Point(H[0],H[1],H[2])}else{var I=new OpenLayers.Geometry.Point(H[1],H[0],H[2])}}if(D&&I){E.push(new OpenLayers.Geometry.Point(D.x,D.y));E.push(new OpenLayers.Geometry.Point(I.x,D.y));E.push(new OpenLayers.Geometry.Point(I.x,I.y));E.push(new OpenLayers.Geometry.Point(D.x,I.y));E.push(new OpenLayers.Geometry.Point(D.x,D.y));var C=new OpenLayers.Geometry.LinearRing(E);F=new OpenLayers.Geometry.Polygon([C])}return F}},parseAttributes:function(E){var F={};var A=E.firstChild;var D,G,C,J,I,B,H;while(A){if(A.nodeType==1){D=A.childNodes;for(G=0;G<D.length;++G){C=D[G];if(C.nodeType==1){J=C.childNodes;if(J.length==1){I=J[0];if(I.nodeType==3||I.nodeType==4){B=(C.prefix)?C.nodeName.split(":")[1]:C.nodeName;H=I.nodeValue.replace(this.regExes.trimSpace,"");F[B]=H}}else{F[C.nodeName.split(":").pop()]=null}}}break}A=A.nextSibling}return F},write:function(C){if(!(C instanceof Array)){C=[C]}var B=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var A=0;A<C.length;A++){B.appendChild(this.createFeatureXML(C[A]))}return OpenLayers.Format.XML.prototype.write.apply(this,[B])},createFeatureXML:function(J){var H=J.geometry;var E=this.buildGeometryNode(H);var I=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);I.appendChild(E);var A=this.createElementNS(this.gmlns,"gml:"+this.featureName);var K=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var C=J.fid||J.id;K.setAttribute("fid",C);K.appendChild(I);for(var G in J.attributes){var F=this.createTextNode(J.attributes[G]);var D=G.substring(G.lastIndexOf(":")+1);var B=this.createElementNS(this.featureNS,this.featurePrefix+":"+D);B.appendChild(F);K.appendChild(B)}A.appendChild(K);return A},buildGeometryNode:function(D){if(this.externalProjection&&this.internalProjection){D=D.clone();D.transform(this.internalProjection,this.externalProjection)}var C=D.CLASS_NAME;var B=C.substring(C.lastIndexOf(".")+1);var A=this.buildGeometry[B.toLowerCase()];return A.apply(this,[D])},buildGeometry:{point:function(B){var A=this.createElementNS(this.gmlns,"gml:Point");A.appendChild(this.buildCoordinatesNode(B));return A},multipoint:function(F){var D=this.createElementNS(this.gmlns,"gml:MultiPoint");var C=F.components;var B,E;for(var A=0;A<C.length;A++){B=this.createElementNS(this.gmlns,"gml:pointMember");E=this.buildGeometry.point.apply(this,[C[A]]);B.appendChild(E);D.appendChild(B)}return D},linestring:function(B){var A=this.createElementNS(this.gmlns,"gml:LineString");A.appendChild(this.buildCoordinatesNode(B));return A},multilinestring:function(F){var D=this.createElementNS(this.gmlns,"gml:MultiLineString");var A=F.components;var C,E;for(var B=0;B<A.length;++B){C=this.createElementNS(this.gmlns,"gml:lineStringMember");E=this.buildGeometry.linestring.apply(this,[A[B]]);C.appendChild(E);D.appendChild(C)}return D},linearring:function(B){var A=this.createElementNS(this.gmlns,"gml:LinearRing");A.appendChild(this.buildCoordinatesNode(B));return A},polygon:function(G){var D=this.createElementNS(this.gmlns,"gml:Polygon");var F=G.components;var C,E,B;for(var A=0;A<F.length;++A){B=(A==0)?"outerBoundaryIs":"innerBoundaryIs";C=this.createElementNS(this.gmlns,"gml:"+B);E=this.buildGeometry.linearring.apply(this,[F[A]]);C.appendChild(E);D.appendChild(C)}return D},multipolygon:function(F){var D=this.createElementNS(this.gmlns,"gml:MultiPolygon");var A=F.components;var E,B;for(var C=0;C<A.length;++C){E=this.createElementNS(this.gmlns,"gml:polygonMember");B=this.buildGeometry.polygon.apply(this,[A[C]]);E.appendChild(B);D.appendChild(E)}return D},bounds:function(B){var A=this.createElementNS(this.gmlns,"gml:Box");A.appendChild(this.buildCoordinatesNode(B));return A}},buildCoordinatesNode:function(F){var A=this.createElementNS(this.gmlns,"gml:coordinates");A.setAttribute("decimal",".");A.setAttribute("cs",",");A.setAttribute("ts"," ");var E=[];if(F instanceof OpenLayers.Bounds){E.push(F.left+","+F.bottom);E.push(F.right+","+F.top)}else{var C=(F.components)?F.components:[F];for(var B=0;B<C.length;B++){E.push(C[B].x+","+C[B].y)}}var D=this.createTextNode(E.join(" "));A.appendChild(D);return A},CLASS_NAME:"OpenLayers.Format.GML"});if(!OpenLayers.Format.GML){OpenLayers.Format.GML={}}OpenLayers.Format.GML.Base=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs"},defaultPrefix:"gml",schemaLocation:null,featureType:null,featureNS:null,geometryName:"geometry",extractAttributes:true,srsName:null,xy:true,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)},initialize:function(A){OpenLayers.Format.XML.prototype.initialize.apply(this,[A]);this.setGeometryTypes();if(A&&A.featureNS){this.setNamespace("feature",A.featureNS)}this.singleFeatureType=!A||(typeof A.featureType==="string")},read:function(E){if(typeof E=="string"){E=OpenLayers.Format.XML.prototype.read.apply(this,[E])}if(E&&E.nodeType==9){E=E.documentElement}var C=[];this.readNode(E,{features:C});if(C.length==0){var D=this.getElementsByTagNameNS(E,this.namespaces.gml,"featureMember");if(D.length){for(var B=0,A=D.length;B<A;++B){this.readNode(D[B],{features:C})}}else{var D=this.getElementsByTagNameNS(E,this.namespaces.gml,"featureMembers");if(D.length){this.readNode(D[0],{features:C})}}}return C},readers:{gml:{featureMember:function(A,B){this.readChildNodes(A,B)},featureMembers:function(A,B){this.readChildNodes(A,B)},name:function(A,B){B.name=this.getChildValue(A)},boundedBy:function(B,C){var A={};this.readChildNodes(B,A);if(A.components&&A.components.length>0){C.bounds=A.components[0]}},Point:function(B,A){var C={points:[]};this.readChildNodes(B,C);if(!A.components){A.components=[]}A.components.push(C.points[0])},coordinates:function(E,G){var H=this.getChildValue(E).replace(this.regExes.trimSpace,"");H=H.replace(this.regExes.trimComma,",");var A=H.split(this.regExes.splitSpace);var F;var D=A.length;var C=new Array(D);for(var B=0;B<D;++B){F=A[B].split(",");if(this.xy){C[B]=new OpenLayers.Geometry.Point(F[0],F[1],F[2])}else{C[B]=new OpenLayers.Geometry.Point(F[1],F[0],F[2])}}G.points=C},coord:function(A,B){var C={};this.readChildNodes(A,C);if(!B.points){B.points=[]}B.points.push(new OpenLayers.Geometry.Point(C.x,C.y,C.z))},X:function(A,B){B.x=this.getChildValue(A)},Y:function(A,B){B.y=this.getChildValue(A)},Z:function(A,B){B.z=this.getChildValue(A)},MultiPoint:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.MultiPoint(C.components)]},pointMember:function(A,B){this.readChildNodes(A,B)},LineString:function(B,A){var C={};this.readChildNodes(B,C);if(!A.components){A.components=[]}A.components.push(new OpenLayers.Geometry.LineString(C.points))},MultiLineString:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.MultiLineString(C.components)]},lineStringMember:function(A,B){this.readChildNodes(A,B)},Polygon:function(B,A){var C={outer:null,inner:[]};this.readChildNodes(B,C);C.inner.unshift(C.outer);if(!A.components){A.components=[]}A.components.push(new OpenLayers.Geometry.Polygon(C.inner))},LinearRing:function(B,C){var A={};this.readChildNodes(B,A);C.components=[new OpenLayers.Geometry.LinearRing(A.points)]},MultiPolygon:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.MultiPolygon(C.components)]},polygonMember:function(A,B){this.readChildNodes(A,B)},GeometryCollection:function(B,A){var C={components:[]};this.readChildNodes(B,C);A.components=[new OpenLayers.Geometry.Collection(C.components)]},geometryMember:function(A,B){this.readChildNodes(A,B)}},feature:{"*":function(C,D){var A;var B=C.localName||C.nodeName.split(":").pop();if(!this.singleFeatureType&&(OpenLayers.Util.indexOf(this.featureType,B)!=-1)){A="_typeName"}else{if(B==this.featureType){A="_typeName"}else{if(C.childNodes.length==0||(C.childNodes.length==1&&C.firstChild.nodeType==3)){if(this.extractAttributes){A="_attribute"}}else{A="_geometry"}}}if(A){this.readers.feature[A].apply(this,[C,D])}},_typeName:function(C,D){var A={components:[],attributes:{}};this.readChildNodes(C,A);if(A.name){A.attributes.name=A.name}var B=new OpenLayers.Feature.Vector(A.components[0],A.attributes);if(!this.singleFeatureType){B.type=C.nodeName.split(":").pop();B.namespace=C.namespaceURI}var E=C.getAttribute("fid")||this.getAttributeNS(C,this.namespaces.gml,"id");if(E){B.fid=E}if(this.internalProjection&&this.externalProjection&&B.geometry){B.geometry.transform(this.externalProjection,this.internalProjection)}if(A.bounds){B.geometry.bounds=A.bounds}D.features.push(B)},_geometry:function(A,B){this.readChildNodes(A,B)},_attribute:function(B,D){var A=B.localName||B.nodeName.split(":").pop();var C=this.getChildValue(B);D.attributes[A]=C}},wfs:{FeatureCollection:function(A,B){this.readChildNodes(A,B)}}},write:function(C){var B;if(C instanceof Array){B="featureMembers"}else{B="featureMember"}var A=this.writeNode("gml:"+B,C);this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},writers:{gml:{featureMember:function(A){var B=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",A,B);return B},MultiPoint:function(C){var B=this.createElementNSPlus("gml:MultiPoint");for(var A=0;A<C.components.length;++A){this.writeNode("pointMember",C.components[A],B)}return B},pointMember:function(B){var A=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",B,A);return A},MultiLineString:function(C){var B=this.createElementNSPlus("gml:MultiLineString");for(var A=0;A<C.components.length;++A){this.writeNode("lineStringMember",C.components[A],B)}return B},lineStringMember:function(B){var A=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",B,A);return A},MultiPolygon:function(C){var B=this.createElementNSPlus("gml:MultiPolygon");for(var A=0;A<C.components.length;++A){this.writeNode("polygonMember",C.components[A],B)}return B},polygonMember:function(B){var A=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",B,A);return A},GeometryCollection:function(D){var C=this.createElementNSPlus("gml:GeometryCollection");for(var B=0,A=D.components.length;B<A;++B){this.writeNode("geometryMember",D.components[B],C)}return C},geometryMember:function(B){var A=this.createElementNSPlus("gml:geometryMember");var C=this.writeNode("feature:_geometry",B);A.appendChild(C.firstChild);return A}},feature:{_typeName:function(B){var C=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:B.fid}});if(B.geometry){this.writeNode("feature:_geometry",B.geometry,C)}for(var A in B.attributes){var D=B.attributes[A];if(D!=null){this.writeNode("feature:_attribute",{name:A,value:D},C)}}return C},_geometry:function(C){if(this.externalProjection&&this.internalProjection){C=C.clone().transform(this.internalProjection,this.externalProjection)}var B=this.createElementNSPlus("feature:"+this.geometryName);var A=this.geometryTypes[C.CLASS_NAME];var D=this.writeNode("gml:"+A,C,B);if(this.srsName){D.setAttribute("srsName",this.srsName)}return B},_attribute:function(A){return this.createElementNSPlus("feature:"+A.name,{value:A.value})}},wfs:{FeatureCollection:function(C){var D=this.createElementNSPlus("wfs:FeatureCollection");for(var B=0,A=C.length;B<A;++B){this.writeNode("gml:featureMember",C[B],D)}return D}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(A){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[A])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(B,A){var C={};this.readChildNodes(B,C);A.outer=C.components[0]},innerBoundaryIs:function(B,A){var C={};this.readChildNodes(B,C);A.inner.push(C.components[0])},Box:function(D,B){var E={};this.readChildNodes(D,E);if(!B.components){B.components=[]}var C=E.points[0];var A=E.points[1];B.components.push(new OpenLayers.Bounds(C.x,C.y,A.x,A.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(C){var B;if(C instanceof Array){B="wfs:FeatureCollection"}else{B="gml:featureMember"}var A=this.writeNode(B,C);this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(B){var A=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[B],A);return A},coordinates:function(D){var C=D.length;var E=new Array(C);var A;for(var B=0;B<C;++B){A=D[B];if(this.xy){E[B]=A.x+","+A.y}else{E[B]=A.y+","+A.x}if(A.z!=undefined){E[B]+=","+A.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(C==1)?E[0]:E.join(" ")})},LineString:function(B){var A=this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",B.components,A);return A},Polygon:function(C){var B=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",C.components[0],B);for(var A=1;A<C.components.length;++A){this.writeNode("innerBoundaryIs",C.components[A],B)}return B},outerBoundaryIs:function(A){var B=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",A,B);return B},innerBoundaryIs:function(A){var B=this.createElementNSPlus("gml:innerBoundaryIs");this.writeNode("LinearRing",A,B);return B},LinearRing:function(A){var B=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",A.components,B);return B},Box:function(B){var A=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:B.left,y:B.bottom},{x:B.right,y:B.top}],A);if(this.srsName){A.setAttribute("srsName",this.srsName)}return A}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:false,multiCurve:true,surface:false,multiSurface:true,initialize:function(A){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[A])},readers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(A,B){this.readChildNodes(A,B)},Curve:function(B,A){var C={points:[]};this.readChildNodes(B,C);if(!A.components){A.components=[]}A.components.push(new OpenLayers.Geometry.LineString(C.points))},segments:function(A,B){this.readChildNodes(A,B)},LineStringSegment:function(B,A){var C={};this.readChildNodes(B,C);if(C.points){Array.prototype.push.apply(A.points,C.points)}},pos:function(B,D){var E=this.getChildValue(B).replace(this.regExes.trimSpace,"");var C=E.split(this.regExes.splitSpace);var A;if(this.xy){A=new OpenLayers.Geometry.Point(C[0],C[1],C[2])}else{A=new OpenLayers.Geometry.Point(C[1],C[0],C[2])}D.points=[A]},posList:function(A,D){var H=this.getChildValue(A).replace(this.regExes.trimSpace,"");var K=H.split(this.regExes.splitSpace);var E=parseInt(A.getAttribute("dimension"))||2;var B,L,J,G;var I=K.length/E;var M=new Array(I);for(var C=0,F=K.length;C<F;C+=E){L=K[C];J=K[C+1];G=(E==2)?undefined:K[C+2];if(this.xy){M[C/E]=new OpenLayers.Geometry.Point(L,J,G)}else{M[C/E]=new OpenLayers.Geometry.Point(J,L,G)}}D.points=M},Surface:function(A,B){this.readChildNodes(A,B)},patches:function(A,B){this.readChildNodes(A,B)},PolygonPatch:function(A,B){this.readers.gml.Polygon.apply(this,[A,B])},exterior:function(B,A){var C={};this.readChildNodes(B,C);A.outer=C.components[0]},interior:function(B,A){var C={};this.readChildNodes(B,C);A.inner.push(C.components[0])},MultiCurve:function(B,A){var C={components:[]};this.readChildNodes(B,C);if(C.components.length>0){A.components=[new OpenLayers.Geometry.MultiLineString(C.components)]}},curveMember:function(A,B){this.readChildNodes(A,B)},MultiSurface:function(B,A){var C={components:[]};this.readChildNodes(B,C);if(C.components.length>0){A.components=[new OpenLayers.Geometry.MultiPolygon(C.components)]}},surfaceMember:function(A,B){this.readChildNodes(A,B)},surfaceMembers:function(A,B){this.readChildNodes(A,B)},pointMembers:function(A,B){this.readChildNodes(A,B)},lineStringMembers:function(A,B){this.readChildNodes(A,B)},polygonMembers:function(A,B){this.readChildNodes(A,B)},geometryMembers:function(A,B){this.readChildNodes(A,B)},Envelope:function(D,B){var E={points:new Array(2)};this.readChildNodes(D,E);if(!B.components){B.components=[]}var C=E.points[0];var A=E.points[1];B.components.push(new OpenLayers.Bounds(C.x,C.y,A.x,A.y))},lowerCorner:function(B,A){var C={};this.readers.gml.pos.apply(this,[B,C]);A.points[0]=C.points[0]},upperCorner:function(B,A){var C={};this.readers.gml.pos.apply(this,[B,C]);A.points[1]=C.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(C){var B;if(C instanceof Array){B="featureMembers"}else{B="featureMember"}var A=this.writeNode("gml:"+B,C);this.setAttributeNS(A,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[A])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(C){var D=this.createElementNSPlus("gml:featureMembers");for(var B=0,A=C.length;B<A;++B){this.writeNode("feature:_typeName",C[B],D)}return D},Point:function(B){var A=this.createElementNSPlus("gml:Point");this.writeNode("pos",B,A);return A},pos:function(A){var B=(this.xy)?(A.x+" "+A.y):(A.y+" "+A.x);return this.createElementNSPlus("gml:pos",{value:B})},LineString:function(B){var A=this.createElementNSPlus("gml:LineString");this.writeNode("posList",B.components,A);return A},Curve:function(B){var A=this.createElementNSPlus("gml:Curve");this.writeNode("segments",B,A);return A},segments:function(B){var A=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",B,A);return A},LineStringSegment:function(B){var A=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",B.components,A);return A},posList:function(D){var B=D.length;var E=new Array(B);var A;for(var C=0;C<B;++C){A=D[C];if(this.xy){E[C]=A.x+" "+A.y}else{E[C]=A.y+" "+A.x}}return this.createElementNSPlus("gml:posList",{value:E.join(" ")})},Surface:function(B){var A=this.createElementNSPlus("gml:Surface");this.writeNode("patches",B,A);return A},patches:function(B){var A=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",B,A);return A},PolygonPatch:function(D){var C=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",D.components[0],C);for(var B=1,A=D.components.length;B<A;++B){this.writeNode("interior",D.components[B],C)}return C},Polygon:function(D){var C=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",D.components[0],C);for(var B=1,A=D.components.length;B<A;++B){this.writeNode("interior",D.components[B],C)}return C},exterior:function(A){var B=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",A,B);return B},interior:function(A){var B=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",A,B);return B},LinearRing:function(A){var B=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",A.components,B);return B},MultiCurve:function(D){var C=this.createElementNSPlus("gml:MultiCurve");for(var B=0,A=D.components.length;B<A;++B){this.writeNode("curveMember",D.components[B],C)}return C},curveMember:function(B){var A=this.createElementNSPlus("gml:curveMember");if(this.curve){this.writeNode("Curve",B,A)}else{this.writeNode("LineString",B,A)}return A},MultiSurface:function(D){var C=this.createElementNSPlus("gml:MultiSurface");for(var B=0,A=D.components.length;B<A;++B){this.writeNode("surfaceMember",D.components[B],C)}return C},surfaceMember:function(A){var B=this.createElementNSPlus("gml:surfaceMember");if(this.surface){this.writeNode("Surface",A,B)}else{this.writeNode("Polygon",A,B)}return B},Envelope:function(B){var A=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",B,A);this.writeNode("upperCorner",B,A);if(this.srsName){A.setAttribute("srsName",this.srsName)}return A},lowerCorner:function(A){var B=(this.xy)?(A.left+" "+A.bottom):(A.bottom+" "+A.left);return this.createElementNSPlus("gml:lowerCorner",{value:B})},upperCorner:function(A){var B=(this.xy)?(A.right+" "+A.top):(A.top+" "+A.right);return this.createElementNSPlus("gml:upperCorner",{value:B})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":(this.curve===true)?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":(this.multiCurve===false)?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":(this.surface===true)?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":(this.multiSurface===false)?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});var MooTools={version:"1.2.2",build:"f0491d62fbb7e906789aa3733d6a67d43e5af7c9"};var Native=function(K){K=K||{};var A=K.name;var I=K.legacy;var B=K.protect;var C=K.implement;var H=K.generics;var F=K.initialize;var G=K.afterImplement||function(){};var D=F||I;H=H!==false;D.constructor=Native;D.$family={name:"native"};if(I&&F){D.prototype=I.prototype}D.prototype.constructor=D;if(A){var E=A.toLowerCase();D.prototype.$family={name:E};Native.typize(D,E)}var J=function(N,L,O,M){if(!B||M||!N.prototype[L]){N.prototype[L]=O}if(H){Native.genericize(N,L,B)}G.call(N,L,O);return N};D.alias=function(N,L,O){if(typeof N=="string"){if((N=this.prototype[N])){return J(this,L,N,O)}}for(var M in N){this.alias(M,N[M],L)}return this};D.implement=function(M,L,O){if(typeof M=="string"){return J(this,M,L,O)}for(var N in M){J(this,N,M[N],L)}return this};if(C){D.implement(C)}return D};Native.genericize=function(B,C,A){if((!A||!B[C])&&typeof B.prototype[C]=="function"){B[C]=function(){var D=Array.prototype.slice.call(arguments);return B.prototype[C].apply(D.shift(),D)}}};Native.implement=function(D,C){for(var B=0,A=D.length;B<A;B++){D[B].implement(C)}};Native.typize=function(A,B){if(!A.type){A.type=function(C){return($type(C)===B)}}};(function(){var A={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var G in A){new Native({name:G,initialize:A[G],protect:true})}var D={"boolean":Boolean,"native":Native,object:Object};for(var C in D){Native.typize(D[C],C)}var F={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var E in F){for(var B=F[E].length;B--;){Native.genericize(window[E],F[E][B],true)}}})();var Hash=new Native({name:"Hash",initialize:function(A){if($type(A)=="hash"){A=$unlink(A.getClean())}for(var B in A){this[B]=A[B]}return this}});Hash.implement({forEach:function(B,C){for(var A in this){if(this.hasOwnProperty(A)){B.call(C,this[A],A,this)}}},getClean:function(){var B={};for(var A in this){if(this.hasOwnProperty(A)){B[A]=this[A]}}return B},getLength:function(){var B=0;for(var A in this){if(this.hasOwnProperty(A)){B++}}return B}});Hash.alias("forEach","each");Array.implement({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}}});Array.alias("forEach","each");function $A(B){if(B.item){var A=B.length,C=new Array(A);while(A--){C[A]=B[A]}return C}return Array.prototype.slice.call(B)}function $arguments(A){return function(){return arguments[A]}}function $chk(A){return !!(A||A===0)}function $clear(A){clearTimeout(A);clearInterval(A);return null}function $defined(A){return(A!=undefined)}function $each(C,B,D){var A=$type(C);((A=="arguments"||A=="collection"||A=="array")?Array:Hash).each(C,B,D)}function $empty(){}function $extend(C,A){for(var B in (A||{})){C[B]=A[B]}return C}function $H(A){return new Hash(A)}function $lambda(A){return(typeof A=="function")?A:function(){return A}}function $merge(){var A=Array.slice(arguments);A.unshift({});return $mixin.apply(null,A)}function $mixin(E){for(var D=1,A=arguments.length;D<A;D++){var B=arguments[D];if($type(B)!="object"){continue}for(var C in B){var G=B[C],F=E[C];E[C]=(F&&$type(G)=="object"&&$type(F)=="object")?$mixin(F,G):$unlink(G)}}return E}function $pick(){for(var B=0,A=arguments.length;B<A;B++){if(arguments[B]!=undefined){return arguments[B]}}return null}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $splat(B){var A=$type(B);return(A)?((A!="array"&&A!="arguments")?[B]:B):[]}var $time=Date.now||function(){return +new Date};function $try(){for(var B=0,A=arguments.length;B<A;B++){try{return arguments[B]()}catch(C){}}return null}function $type(A){if(A==undefined){return false}if(A.$family){return(A.$family.name=="number"&&!isFinite(A))?false:A.$family.name}if(A.nodeName){switch(A.nodeType){case 1:return"element";case 3:return(/\S/).test(A.nodeValue)?"textnode":"whitespace"}}else{if(typeof A.length=="number"){if(A.callee){return"arguments"}else{if(A.item){return"collection"}}}}return typeof A}function $unlink(C){var B;switch($type(C)){case"object":B={};for(var E in C){B[E]=$unlink(C[E])}break;case"hash":B=new Hash(C);break;case"array":B=[];for(var D=0,A=C.length;D<A;D++){B[D]=$unlink(C[D])}break;default:return C}return B}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925))},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4)},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419)},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18)}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var B in this.Engines){var A=this.Engines[B]();if(A){this.Engine={name:B,version:A};this.Engine[B]=this.Engine[B+A]=true;break}}return{name:B,version:A}};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var A=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(A[0]||0+"."+A[1],10)||0,build:parseInt(A[2],10)||0}})();function $exec(B){if(!B){return B}if(window.execScript){window.execScript(B)}else{var A=document.createElement("script");A.setAttribute("type","text/javascript");A[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=B;document.head.appendChild(A);document.head.removeChild(A)}return B}Native.UID=1;var $uid=(Browser.Engine.trident)?function(A){return(A.uid||(A.uid=[Native.UID++]))[0]}:function(A){return A.uid||(A.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(A){$uid(A);if(!A.Element){A.Element=$empty;if(Browser.Engine.webkit){A.document.createElement("iframe")}A.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}A.document.window=A;return $extend(A,Window.Prototype)},afterImplement:function(B,A){window[B]=Window.Prototype[B]=A}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(A){$uid(A);A.head=A.getElementsByTagName("head")[0];A.html=A.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){A.execCommand("BackgroundImageCache",false,true)})}if(Browser.Engine.trident){A.window.attachEvent("onunload",function(){A.window.detachEvent("onunload",arguments.callee);A.head=A.html=A.window=null})}return $extend(A,Document.Prototype)},afterImplement:function(B,A){document[B]=Document.Prototype[B]=A}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},clean:function(){return this.filter($defined)},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},link:function(C){var A={};for(var E=0,B=this.length;E<B;E++){for(var D in C){if(C[D](this[E])){A[D]=this[E];delete C[D];break}}}return A},contains:function(A,B){return this.indexOf(A,B)!=-1},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(A){if(!this.contains(A)){this.push(A)}return this},combine:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},erase:function(B){for(var A=this.length;A--;A){if(this[A]===B){this.splice(A,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var D=[];for(var B=0,A=this.length;B<A;B++){var C=$type(this[B]);if(!C){continue}D=D.concat((C=="array"||C=="collection"||C=="arguments")?Array.flatten(this[B]):this[B])}return D},hexToRgb:function(B){if(this.length!=3){return null}var A=this.map(function(C){if(C.length==1){C+=C}return C.toInt(16)});return(B)?A:"rgb("+A+")"},rgbToHex:function(D){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return(D)?B:"#"+B.join("")}});Function.implement({extend:function(A){for(var B in A){this[B]=A[B]}return this},create:function(B){var A=this;B=B||{};return function(D){var C=B.arguments;C=(C!=undefined)?$splat(C):Array.slice(arguments,(B.event)?1:0);if(B.event){C=[D||window.event].extend(C)}var E=function(){return A.apply(B.bind||null,C)};if(B.delay){return setTimeout(E,B.delay)}if(B.periodical){return setInterval(E,B.periodical)}if(B.attempt){return $try(E)}return E()}},run:function(A,B){return this.apply(B,$splat(A))},pass:function(A,B){return this.create({bind:B,arguments:A})},bind:function(B,A){return this.create({bind:B,arguments:A})},bindWithEvent:function(B,A){return this.create({bind:B,arguments:A,event:true})},attempt:function(A,B){return this.create({bind:B,arguments:A,attempt:true})()},delay:function(B,C,A){return this.create({bind:C,arguments:A,delay:B})()},periodical:function(C,B,A){return this.create({bind:B,arguments:A,periodical:C})()}});Number.implement({limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B,C){for(var A=0;A<this;A++){B.call(C,A,this)}},toFloat:function(){return parseFloat(this)},toInt:function(A){return parseInt(this,A||10)}});Number.alias("times","each");(function(B){var A={};B.each(function(C){if(!Number[C]){A[C]=function(){return Math[C].apply(null,[this].concat($A(arguments)))}}});Number.implement(A)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(A,B){return((typeof A=="string")?new RegExp(A,B):A).test(this)},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(A){return("-"+A.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(A){return parseInt(this,A||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):null},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):null},stripScripts:function(B){var A="";var C=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){A+=arguments[1]+"\n";return""});if(B===true){$exec(A)}else{if($type(B)=="function"){B(A,C)}}return C},substitute:function(A,B){return this.replace(B||(/\\?\{([^{}]+)\}/g),function(D,C){if(D.charAt(0)=="\\"){return D.slice(1)}return(A[C]!=undefined)?A[C]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(B){for(var A in this){if(this.hasOwnProperty(A)&&this[A]===B){return A}}return null},hasValue:function(A){return(Hash.keyOf(this,A)!==null)},extend:function(A){Hash.each(A,function(C,B){Hash.set(this,B,C)},this);return this},combine:function(A){Hash.each(A,function(C,B){Hash.include(this,B,C)},this);return this},erase:function(A){if(this.hasOwnProperty(A)){delete this[A]}return this},get:function(A){return(this.hasOwnProperty(A))?this[A]:null},set:function(A,B){if(!this[A]||this.hasOwnProperty(A)){this[A]=B}return this},empty:function(){Hash.each(this,function(B,A){delete this[A]},this);return this},include:function(A,B){if(this[A]==undefined){this[A]=B}return this},map:function(B,C){var A=new Hash;Hash.each(this,function(E,D){A.set(D,B.call(C,E,D,this))},this);return A},filter:function(B,C){var A=new Hash;Hash.each(this,function(E,D){if(B.call(C,E,D,this)){A.set(D,E)}},this);return A},every:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&!B.call(C,this[A],A)){return false}}return true},some:function(B,C){for(var A in this){if(this.hasOwnProperty(A)&&B.call(C,this[A],A)){return true}}return false},getKeys:function(){var A=[];Hash.each(this,function(C,B){A.push(B)});return A},getValues:function(){var A=[];Hash.each(this,function(B){A.push(B)});return A},toQueryString:function(A){var B=[];Hash.each(this,function(F,E){if(A){E=A+"["+E+"]"}var D;switch($type(F)){case"object":D=Hash.toQueryString(F,E);break;case"array":var C={};F.each(function(H,G){C[G]=H});D=Hash.toQueryString(C,E);break;default:D=E+"="+encodeURIComponent(F)}if(F!=undefined){B.push(D)}});return B.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(A,F){F=F||window;var K=F.document;A=A||F.event;if(A.$extended){return A}this.$extended=true;var J=A.type;var G=A.target||A.srcElement;while(G&&G.nodeType==3){G=G.parentNode}if(J.test(/key/)){var B=A.which||A.keyCode;var M=Event.Keys.keyOf(B);if(J=="keydown"){var D=B-111;if(D>0&&D<13){M="f"+D}}M=M||String.fromCharCode(B).toLowerCase()}else{if(J.match(/(click|mouse|menu)/i)){K=(!K.compatMode||K.compatMode=="CSS1Compat")?K.html:K.body;var I={x:A.pageX||A.clientX+K.scrollLeft,y:A.pageY||A.clientY+K.scrollTop};var C={x:(A.pageX)?A.pageX-F.pageXOffset:A.clientX,y:(A.pageY)?A.pageY-F.pageYOffset:A.clientY};if(J.match(/DOMMouseScroll|mousewheel/)){var H=(A.wheelDelta)?A.wheelDelta/120:-(A.detail||0)/3}var E=(A.which==3)||(A.button==2);var L=null;if(J.match(/over|out/)){switch(J){case"mouseover":L=A.relatedTarget||A.fromElement;break;case"mouseout":L=A.relatedTarget||A.toElement}if(!(function(){while(L&&L.nodeType==3){L=L.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){L=false}}}}return $extend(this,{event:A,type:J,page:I,client:C,rightClick:E,wheel:H,relatedTarget:L,target:G,code:B,key:M,shift:A.shiftKey,control:A.ctrlKey,alt:A.altKey,meta:A.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});function Class(B){if(B instanceof Function){B={initialize:B}}var A=function(){Object.reset(this);if(A._prototyping){return this}this._current=$empty;var C=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return C}.extend(this);A.implement(B);A.constructor=Class;A.prototype.constructor=A;return A}Function.prototype.protect=function(){this._protected=true;return this};Object.reset=function(A,C){if(C==null){for(var E in A){Object.reset(A,E)}return A}delete A[C];switch($type(A[C])){case"object":var D=function(){};D.prototype=A[C];var B=new D;A[C]=Object.reset(B);break;case"array":A[C]=$unlink(A[C]);break}return A};new Native({name:"Class",initialize:Class}).extend({instantiate:function(B){B._prototyping=true;var A=new B;delete B._prototyping;return A},wrap:function(A,B,C){if(C._origin){C=C._origin}return function(){if(C._protected&&this._current==null){throw new Error('The method "'+B+'" cannot be called.')}var E=this.caller,F=this._current;this.caller=F;this._current=arguments.callee;var D=C.apply(this,arguments);this._current=F;this.caller=E;return D}.extend({_owner:A,_origin:C,_name:B})}});Class.implement({implement:function(A,D){if($type(A)=="object"){for(var E in A){this.implement(E,A[E])}return this}var F=Class.Mutators[A];if(F){D=F.call(this,D);if(D==null){return this}}var C=this.prototype;switch($type(D)){case"function":if(D._hidden){return this}C[A]=Class.wrap(this,A,D);break;case"object":var B=C[A];if($type(B)=="object"){$mixin(B,D)}else{C[A]=$unlink(D)}break;case"array":C[A]=$unlink(D);break;default:C[A]=D}return this}});Class.Mutators={Extends:function(A){this.parent=A;this.prototype=Class.instantiate(A);this.implement("parent",function(){var B=this.caller._name,C=this.caller._owner.parent.prototype[B];if(!C){throw new Error('The method "'+B+'" has no parent.')}return C.apply(this,arguments)}.protect())},Implements:function(A){$splat(A).each(function(B){if(B instanceof Function){B=Class.instantiate(B)}this.implement(B)},this)}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){this.$chain.empty();return this}});var Events=new Class({$events:{},addEvent:function(C,B,A){C=Events.removeOn(C);if(B!=$empty){this.$events[C]=this.$events[C]||[];this.$events[C].include(B);if(A){B.internal=true}}return this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},fireEvent:function(C,B,A){C=Events.removeOn(C);if(!this.$events||!this.$events[C]){return this}this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})()},this);return this},removeEvent:function(B,A){B=Events.removeOn(B);if(!this.$events[B]){return this}if(!A.internal){this.$events[B].erase(A)}return this},removeEvents:function(C){if($type(C)=="object"){for(var D in C){this.removeEvent(D,C[D])}return this}if(C){C=Events.removeOn(C)}for(var D in this.$events){if(C&&C!=D){continue}var B=this.$events[D];for(var A=B.length;A--;A){this.removeEvent(D,B[A])}}return this}});Events.removeOn=function(A){return A.replace(/^on([A-Z])/,function(B,C){return C.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var A in this.options){if($type(this.options[A])!="function"||!(/^on[A-Z]/).test(A)){continue}this.addEvent(A,this.options[A]);delete this.options[A]}return this}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(A,B){var C=Element.Constructors.get(A);if(C){return C(B)}if(typeof A=="string"){return document.newElement(A,B)}return $(A).set(B)},afterImplement:function(A,B){Element.Prototype[A]=B;if(Array[A]){return }Elements.implement(A,function(){var C=[],G=true;for(var E=0,D=this.length;E<D;E++){var F=this[E][A].apply(this[E],arguments);C.push(F);if(G){G=($type(F)=="element")}}return(G)?new Elements(C):C})}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var E=Array.link(arguments,{properties:Object.type,iframe:$defined});var C=E.properties||{};var B=$(E.iframe)||false;var D=C.onload||$empty;delete C.onload;C.id=C.name=$pick(C.id,C.name,B.id,B.name,"IFrame_"+$time());B=new Element(B||"iframe",C);var A=function(){var F=$try(function(){return B.contentWindow.location.host});if(F&&F==window.location.host){var G=new Window(B.contentWindow);new Document(B.contentWindow.document);$extend(G.Element.prototype,Element.Prototype)}D.call(B.contentWindow,B.contentWindow.document)};(window.frames[C.id])?A():B.addListener("load",A);return B}});var Elements=new Native({initialize:function(F,B){B=$extend({ddup:true,cash:true},B);F=F||[];if(B.ddup||B.cash){var G={},E=[];for(var C=0,A=F.length;C<A;C++){var D=$.element(F[C],!B.cash);if(B.ddup){if(G[D.uid]){continue}G[D.uid]=true}E.push(D)}F=E}return(B.cash)?$extend(F,this):F}});Elements.implement({filter:function(A,B){if(!A){return this}return new Elements(Array.filter(this,(typeof A=="string")?function(C){return C.match(A)}:A,B))}});Document.implement({newElement:function(A,B){if(Browser.Engine.trident&&B){["name","type","checked"].each(function(C){if(!B[C]){return }A+=" "+C+'="'+B[C]+'"';if(C!="checked"){delete B[C]}});A="<"+A+">"}return $.element(this.createElement(A)).set(B)},newTextNode:function(A){return this.createTextNode(A)},getDocument:function(){return this},getWindow:function(){return this.window}});Window.implement({$:function(B,C){if(B&&B.$family&&B.uid){return B}var A=$type(B);return($[A])?$[A](B,C,this.document):null},$$:function(A){if(arguments.length==1&&typeof A=="string"){return this.document.getElements(A)}var F=[];var C=Array.flatten(arguments);for(var D=0,B=C.length;D<B;D++){var E=C[D];switch($type(E)){case"element":F.push(E);break;case"string":F.extend(this.document.getElements(E,true))}}return new Elements(F)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(C,B,A){C=A.getElementById(C);return(C)?$.element(C,B):null};$.element=function(A,D){$uid(A);if(!D&&!A.$family&&!(/^object|embed$/i).test(A.tagName)){var B=Element.Prototype;for(var C in B){A[C]=B[C]}}return A};$.object=function(B,C,A){if(B.toElement){return $.element(B.toElement(A),C)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(A,B){return $(this.getElements(A,true)[0]||null,B)},getElements:function(A,D){A=A.split(",");var C=[];var B=(A.length>1);A.each(function(E){var F=this.getElementsByTagName(E.trim());(B)?C.extend(F):C=F},this);return new Elements(C,{ddup:B,cash:!D})}});(function(){var H={},F={};var I={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var C=function(L){return(F[L]||(F[L]={}))};var G=function(N,L){if(!N){return }var M=N.uid;if(Browser.Engine.trident){if(N.clearAttributes){var P=L&&N.cloneNode(false);N.clearAttributes();if(P){N.mergeAttributes(P)}}else{if(N.removeEvents){N.removeEvents()}}if((/object/i).test(N.tagName)){for(var O in N){if(typeof N[O]=="function"){N[O]=$empty}}Element.dispose(N)}}if(!M){return }H[M]=F[M]=null};var D=function(){Hash.each(H,G);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(G)}if(window.CollectGarbage){CollectGarbage()}H={};F={}};var J=function(N,L,S,M,P,R){var O=N[S||L];var Q=[];while(O){if(O.nodeType==1&&(!M||Element.match(O,M))){if(!P){return $(O,R)}Q.push(O)}O=O[L]}return(P)?new Elements(Q,{ddup:false,cash:!R}):null};var E={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var B=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var K=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];B=B.associate(B);Hash.extend(E,B);Hash.extend(E,K.associate(K.map(String.toLowerCase)));var A={before:function(M,L){if(L.parentNode){L.parentNode.insertBefore(M,L)}},after:function(M,L){if(!L.parentNode){return }var N=L.nextSibling;(N)?L.parentNode.insertBefore(M,N):L.parentNode.appendChild(M)},bottom:function(M,L){L.appendChild(M)},top:function(M,L){var N=L.firstChild;(N)?L.insertBefore(M,N):L.appendChild(M)}};A.inside=A.bottom;Hash.each(A,function(L,M){M=M.capitalize();Element.implement("inject"+M,function(N){L(this,$(N,true));return this});Element.implement("grab"+M,function(N){L($(N,true),this);return this})});Element.implement({set:function(O,M){switch($type(O)){case"object":for(var N in O){this.set(N,O[N])}break;case"string":var L=Element.Properties.get(O);(L&&L.set)?L.set.apply(this,Array.slice(arguments,1)):this.setProperty(O,M)}return this},get:function(M){var L=Element.Properties.get(M);return(L&&L.get)?L.get.apply(this,Array.slice(arguments,1)):this.getProperty(M)},erase:function(M){var L=Element.Properties.get(M);(L&&L.erase)?L.erase.apply(this):this.removeProperty(M);return this},setProperty:function(M,N){var L=E[M];if(N==undefined){return this.removeProperty(M)}if(L&&B[M]){N=!!N}(L)?this[L]=N:this.setAttribute(M,""+N);return this},setProperties:function(L){for(var M in L){this.setProperty(M,L[M])}return this},getProperty:function(M){var L=E[M];var N=(L)?this[L]:this.getAttribute(M,2);return(B[M])?!!N:(L)?N:N||null},getProperties:function(){var L=$A(arguments);return L.map(this.getProperty,this).associate(L)},removeProperty:function(M){var L=E[M];(L)?this[L]=(L&&B[M])?false:"":this.removeAttribute(M);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},hasClass:function(L){return this.className.contains(L," ")},addClass:function(L){if(!this.hasClass(L)){this.className=(this.className+" "+L).clean()}return this},removeClass:function(L){this.className=this.className.replace(new RegExp("(^|\\s)"+L+"(?:\\s|$)"),"$1");return this},toggleClass:function(L){return this.hasClass(L)?this.removeClass(L):this.addClass(L)},adopt:function(){Array.flatten(arguments).each(function(L){L=$(L,true);if(L){this.appendChild(L)}},this);return this},appendText:function(M,L){return this.grab(this.getDocument().newTextNode(M),L)},grab:function(M,L){A[L||"bottom"]($(M,true),this);return this},inject:function(M,L){A[L||"bottom"](this,$(M,true));return this},replaces:function(L){L=$(L,true);L.parentNode.replaceChild(this,L);return this},wraps:function(M,L){M=$(M,true);return this.replaces(M).grab(M,L)},getPrevious:function(L,M){return J(this,"previousSibling",null,L,false,M)},getAllPrevious:function(L,M){return J(this,"previousSibling",null,L,true,M)},getNext:function(L,M){return J(this,"nextSibling",null,L,false,M)},getAllNext:function(L,M){return J(this,"nextSibling",null,L,true,M)},getFirst:function(L,M){return J(this,"nextSibling","firstChild",L,false,M)},getLast:function(L,M){return J(this,"previousSibling","lastChild",L,false,M)},getParent:function(L,M){return J(this,"parentNode",null,L,false,M)},getParents:function(L,M){return J(this,"parentNode",null,L,true,M)},getSiblings:function(L,M){return this.getParent().getChildren(L,M).erase(this)},getChildren:function(L,M){return J(this,"nextSibling","firstChild",L,true,M)},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(O,N){var M=this.ownerDocument.getElementById(O);if(!M){return null}for(var L=M.parentNode;L!=this;L=L.parentNode){if(!L){return null}}return $.element(M,N)},getSelected:function(){return new Elements($A(this.options).filter(function(L){return L.selected}))},getComputedStyle:function(M){if(this.currentStyle){return this.currentStyle[M.camelCase()]}var L=this.getDocument().defaultView.getComputedStyle(this,null);return(L)?L.getPropertyValue([M.hyphenate()]):null},toQueryString:function(){var L=[];this.getElements("input, select, textarea",true).each(function(M){if(!M.name||M.disabled){return }var N=(M.tagName.toLowerCase()=="select")?Element.getSelected(M).map(function(O){return O.value}):((M.type=="radio"||M.type=="checkbox")&&!M.checked)?null:M.value;$splat(N).each(function(O){if(typeof O!="undefined"){L.push(M.name+"="+encodeURIComponent(O))}})});return L.join("&")},clone:function(O,L){O=O!==false;var R=this.cloneNode(O);var N=function(V,U){if(!L){V.removeAttribute("id")}if(Browser.Engine.trident){V.clearAttributes();V.mergeAttributes(U);V.removeAttribute("uid");if(V.options){var W=V.options,S=U.options;for(var T=W.length;T--;){W[T].selected=S[T].selected}}}var X=I[U.tagName.toLowerCase()];if(X&&U[X]){V[X]=U[X]}};if(O){var P=R.getElementsByTagName("*"),Q=this.getElementsByTagName("*");for(var M=P.length;M--;){N(P[M],Q[M])}}N(R,this);return $(R)},destroy:function(){Element.empty(this);Element.dispose(this);G(this,true);return null},empty:function(){$A(this.childNodes).each(function(L){Element.destroy(L)});return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},hasChild:function(L){L=$(L,true);if(!L){return false}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(L.tagName)).contains(L)}return(this.contains)?(this!=L&&this.contains(L)):!!(this.compareDocumentPosition(L)&16)},match:function(L){return(!L||(L==this)||(Element.get(this,"tag")==L))}});Native.implement([Element,Window,Document],{addListener:function(O,N){if(O=="unload"){var L=N,M=this;N=function(){M.removeListener("unload",N);L()}}else{H[this.uid]=this}if(this.addEventListener){this.addEventListener(O,N,false)}else{this.attachEvent("on"+O,N)}return this},removeListener:function(M,L){if(this.removeEventListener){this.removeEventListener(M,L,false)}else{this.detachEvent("on"+M,L)}return this},retrieve:function(M,L){var O=C(this.uid),N=O[M];if(L!=undefined&&N==undefined){N=O[M]=L}return $pick(N)},store:function(M,L){var N=C(this.uid);N[M]=L;return this},eliminate:function(L){var M=C(this.uid);delete M[L];return this}});window.addListener("unload",D)})();Element.Properties=new Hash;Element.Properties.style={set:function(A){this.style.cssText=A},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.html=(function(){var C=document.createElement("div");var A={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};A.thead=A.tfoot=A.tbody;var B={set:function(){var E=Array.flatten(arguments).join("");var F=Browser.Engine.trident&&A[this.get("tag")];if(F){var G=C;G.innerHTML=F[1]+E+F[2];for(var D=F[0];D--;){G=G.firstChild}this.empty().adopt(G.childNodes)}else{this.innerHTML=E}}};B.erase=B.set;return B})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText}var A=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var B=A.innerText;A.destroy();return B}}}Element.Properties.events={set:function(A){this.addEvents(A)}};Native.implement([Element,Window,Document],{addEvent:function(E,G){var H=this.retrieve("events",{});H[E]=H[E]||{keys:[],values:[]};if(H[E].keys.contains(G)){return this}H[E].keys.push(G);var F=E,A=Element.Events.get(E),C=G,I=this;if(A){if(A.onAdd){A.onAdd.call(this,G)}if(A.condition){C=function(J){if(A.condition.call(this,J)){return G.call(this,J)}return true}}F=A.base||F}var D=function(){return G.call(I)};var B=Element.NativeEvents[F];if(B){if(B==2){D=function(J){J=new Event(J,I.getWindow());if(C.call(I,J)===false){J.stop()}}}this.addListener(F,D)}H[E].values.push(D);return this},removeEvent:function(C,B){var A=this.retrieve("events");if(!A||!A[C]){return this}var F=A[C].keys.indexOf(B);if(F==-1){return this}A[C].keys.splice(F,1);var E=A[C].values.splice(F,1)[0];var D=Element.Events.get(C);if(D){if(D.onRemove){D.onRemove.call(this,B)}C=D.base||C}return(Element.NativeEvents[C])?this.removeListener(C,E):this},addEvents:function(A){for(var B in A){this.addEvent(B,A[B])}return this},removeEvents:function(A){if($type(A)=="object"){for(var C in A){this.removeEvent(C,A[C])}return this}var B=this.retrieve("events");if(!B){return this}if(!A){for(var C in B){this.removeEvents(C)}this.eliminate("events")}else{if(B[A]){while(B[A].keys[0]){this.removeEvent(A,B[A].keys[0])}B[A]=null}}return this},fireEvent:function(D,B,A){var C=this.retrieve("events");if(!C||!C[D]){return this}C[D].keys.each(function(E){E.create({bind:this,delay:A,"arguments":B})()},this);return this},cloneEvents:function(D,A){D=$(D);var C=D.retrieve("events");if(!C){return this}if(!A){for(var B in C){this.cloneEvents(D,B)}}else{if(C[A]){C[A].keys.each(function(E){this.addEvent(A,E)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var A=function(B){var C=B.relatedTarget;if(C==undefined){return true}if(C===false){return false}return($type(this)!="document"&&C!=this&&C.prefix!="xul"&&!this.hasChild(C))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:A},mouseleave:{base:"mouseout",condition:A},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(A){this.setStyles(A)}};Element.Properties.opacity={set:function(A,B){if(!B){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=A;this.store("opacity",A)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(A){return this.set("opacity",A,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(B,A){switch(B){case"opacity":return this.set("opacity",parseFloat(A));case"float":B=(Browser.Engine.trident)?"styleFloat":"cssFloat"}B=B.camelCase();if($type(A)!="string"){var C=(Element.Styles.get(B)||"@").split(" ");A=$splat(A).map(function(E,D){if(!C[D]){return""}return($type(E)=="number")?C[D].replace("@",Math.round(E)):E}).join(" ")}else{if(A==String(Number(A))){A=Math.round(A)}}this.style[B]=A;return this},getStyle:function(G){switch(G){case"opacity":return this.get("opacity");case"float":G=(Browser.Engine.trident)?"styleFloat":"cssFloat"}G=G.camelCase();var A=this.style[G];if(!$chk(A)){A=[];for(var F in Element.ShortStyles){if(G!=F){continue}for(var E in Element.ShortStyles[F]){A.push(this.getStyle(E))}return A.join(" ")}A=this.getComputedStyle(G)}if(A){A=String(A);var C=A.match(/rgba?\([\d\s,]+\)/);if(C){A=A.replace(C[0],C[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(A,10)))){if(G.test(/^(height|width)$/)){var B=(G=="width")?["left","right"]:["top","bottom"],D=0;B.each(function(H){D+=this.getStyle("border-"+H+"-width").toInt()+this.getStyle("padding-"+H).toInt()},this);return this["offset"+G.capitalize()]-D+"px"}if((Browser.Engine.presto)&&String(A).test("px")){return A}if(G.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return A},setStyles:function(B){for(var A in B){this.setStyle(A,B[A])}return this},getStyles:function(){var A={};Array.each(arguments,function(B){A[B]=this.getStyle(B)},this);return A}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(G){var F=Element.ShortStyles;var B=Element.Styles;["margin","padding"].each(function(H){var I=H+G;F[H][I]=B[I]="@px"});var E="border"+G;F.border[E]=B[E]="@px @ rgb(@, @, @)";var D=E+"Width",A=E+"Style",C=E+"Color";F[E]={};F.borderWidth[D]=F[E][D]=B[D]="@px";F.borderStyle[A]=F[E][A]=B[A]="@";F.borderColor[C]=F[E][C]=B[C]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(H,I){if(B(this)){this.getWindow().scrollTo(H,I)}else{this.scrollLeft=H;this.scrollTop=I}return this},getSize:function(){if(B(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(B(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(B(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var I=this,H={x:0,y:0};while(I&&!B(I)){H.x+=I.scrollLeft;H.y+=I.scrollTop;I=I.parentNode}return H},getOffsetParent:function(){var H=this;if(B(H)){return null}if(!Browser.Engine.trident){return H.offsetParent}while((H=H.parentNode)&&!B(H)){if(D(H,"position")!="static"){return H}}return null},getOffsets:function(){if(Browser.Engine.trident){var L=this.getBoundingClientRect(),J=this.getDocument().documentElement;var M=D(this,"position")=="fixed";return{x:L.left+((M)?0:J.scrollLeft)-J.clientLeft,y:L.top+((M)?0:J.scrollTop)-J.clientTop}}var I=this,H={x:0,y:0};if(B(this)){return H}while(I&&!B(I)){H.x+=I.offsetLeft;H.y+=I.offsetTop;if(Browser.Engine.gecko){if(!F(I)){H.x+=C(I);H.y+=G(I)}var K=I.parentNode;if(K&&D(K,"overflow")!="visible"){H.x+=C(K);H.y+=G(K)}}else{if(I!=this&&Browser.Engine.webkit){H.x+=C(I);H.y+=G(I)}}I=I.offsetParent}if(Browser.Engine.gecko&&!F(this)){H.x-=C(this);H.y-=G(this)}return H},getPosition:function(K){if(B(this)){return{x:0,y:0}}var L=this.getOffsets(),I=this.getScrolls();var H={x:L.x-I.x,y:L.y-I.y};var J=(K&&(K=$(K)))?K.getPosition():{x:0,y:0};return{x:H.x-J.x,y:H.y-J.y}},getCoordinates:function(J){if(B(this)){return this.getWindow().getCoordinates()}var H=this.getPosition(J),I=this.getSize();var K={left:H.x,top:H.y,width:I.x,height:I.y};K.right=K.left+K.width;K.bottom=K.top+K.height;return K},computePosition:function(H){return{left:H.x-E(this,"margin-left"),top:H.y-E(this,"margin-top")}},position:function(H){return this.setStyles(this.computePosition(H))}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var I=this.getWindow();return{x:I.innerWidth,y:I.innerHeight}}var H=A(this);return{x:H.clientWidth,y:H.clientHeight}},getScroll:function(){var I=this.getWindow(),H=A(this);return{x:I.pageXOffset||H.scrollLeft,y:I.pageYOffset||H.scrollTop}},getScrollSize:function(){var I=A(this),H=this.getSize();return{x:Math.max(I.scrollWidth,H.x),y:Math.max(I.scrollHeight,H.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var H=this.getSize();return{top:0,left:0,bottom:H.y,right:H.x,height:H.y,width:H.x}}});var D=Element.getComputedStyle;function E(H,I){return D(H,I).toInt()||0}function F(H){return D(H,"-moz-box-sizing")=="border-box"}function G(H){return E(H,"border-top-width")}function C(H){return E(H,"border-left-width")}function B(H){return(/^(?:body|html)$/i).test(H.tagName)}function A(H){var I=H.getDocument();return(!I.compatMode||I.compatMode=="CSS1Compat")?I.html:I.body}})();Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(H,G){H=H.split(",");var C,E={};for(var D=0,B=H.length;D<B;D++){var A=H[D],F=Selectors.Utils.search(this,A,E);if(D!=0&&F.item){F=$A(F)}C=(D==0)?F:(C.item)?$A(C).concat(F):C.concat(F)}return new Elements(C,{ddup:(H.length>1),cash:!G})}});Element.implement({match:function(B){if(!B||(B==this)){return true}var D=Selectors.Utils.parseTagAndID(B);var A=D[0],E=D[1];if(!Selectors.Filters.byID(this,E)||!Selectors.Filters.byTag(this,A)){return false}var C=Selectors.Utils.parseSelector(B);return(C)?Selectors.Utils.filter(this,C,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(B,C){if(!C){return true}var A=$uid(B);if(!C[A]){return C[A]=true}return false},parseNthArgument:function(F){if(Selectors.Cache.nth[F]){return Selectors.Cache.nth[F]}var C=F.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!C){return false}var E=parseInt(C[1],10);var B=(E||E===0)?E:1;var D=C[2]||false;var A=parseInt(C[3],10)||0;if(B!=0){A--;while(A<1){A+=B}while(A>=B){A-=B}}else{B=A;D="index"}switch(D){case"n":C={a:B,b:A,special:"n"};break;case"odd":C={a:2,b:0,special:"n"};break;case"even":C={a:2,b:1,special:"n"};break;case"first":C={a:0,special:"index"};break;case"last":C={special:"last-child"};break;case"only":C={special:"only-child"};break;default:C={a:(B-1),special:"index"}}return Selectors.Cache.nth[F]=C},parseSelector:function(E){if(Selectors.Cache.parsed[E]){return Selectors.Cache.parsed[E]}var D,H={classes:[],pseudos:[],attributes:[]};while((D=Selectors.RegExps.combined.exec(E))){var I=D[1],G=D[2],F=D[3],B=D[5],C=D[6],J=D[7];if(I){H.classes.push(I)}else{if(C){var A=Selectors.Pseudo.get(C);if(A){H.pseudos.push({parser:A,argument:J})}else{H.attributes.push({name:C,operator:"=",value:J})}}else{if(G){H.attributes.push({name:G,operator:F,value:B})}}}}if(!H.classes.length){delete H.classes}if(!H.attributes.length){delete H.attributes}if(!H.pseudos.length){delete H.pseudos}if(!H.classes&&!H.attributes&&!H.pseudos){H=null}return Selectors.Cache.parsed[E]=H},parseTagAndID:function(B){var A=B.match(Selectors.RegExps.tag);var C=B.match(Selectors.RegExps.id);return[(A)?A[1]:"*",(C)?C[1]:false]},filter:function(F,C,E){var D;if(C.classes){for(D=C.classes.length;D--;D){var G=C.classes[D];if(!Selectors.Filters.byClass(F,G)){return false}}}if(C.attributes){for(D=C.attributes.length;D--;D){var B=C.attributes[D];if(!Selectors.Filters.byAttribute(F,B.name,B.operator,B.value)){return false}}}if(C.pseudos){for(D=C.pseudos.length;D--;D){var A=C.pseudos[D];if(!Selectors.Filters.byPseudo(F,A.parser,A.argument,E)){return false}}}return true},getByTagAndID:function(B,A,D){if(D){var C=(B.getElementById)?B.getElementById(D,true):Element.getElementById(B,D,true);return(C&&Selectors.Filters.byTag(C,A))?[C]:[]}else{return B.getElementsByTagName(A)}},search:function(I,H,N){var B=[];var C=H.trim().replace(Selectors.RegExps.splitter,function(Y,X,W){B.push(X);return":)"+W}).split(":)");var J,E,U;for(var T=0,P=C.length;T<P;T++){var S=C[T];if(T==0&&Selectors.RegExps.quick.test(S)){J=I.getElementsByTagName(S);continue}var A=B[T-1];var K=Selectors.Utils.parseTagAndID(S);var V=K[0],L=K[1];if(T==0){J=Selectors.Utils.getByTagAndID(I,V,L)}else{var D={},G=[];for(var R=0,Q=J.length;R<Q;R++){G=Selectors.Getters[A](G,J[R],V,L,D)}J=G}var F=Selectors.Utils.parseSelector(S);if(F){E=[];for(var O=0,M=J.length;O<M;O++){U=J[O];if(Selectors.Utils.filter(U,F,N)){E.push(U)}}J=E}}return J}};Selectors.Getters={" ":function(H,G,I,A,E){var D=Selectors.Utils.getByTagAndID(G,I,A);for(var C=0,B=D.length;C<B;C++){var F=D[C];if(Selectors.Utils.chk(F,E)){H.push(F)}}return H},">":function(H,G,I,A,F){var C=Selectors.Utils.getByTagAndID(G,I,A);for(var E=0,D=C.length;E<D;E++){var B=C[E];if(B.parentNode==G&&Selectors.Utils.chk(B,F)){H.push(B)}}return H},"+":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(Selectors.Utils.chk(B,D)&&Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B)}break}}return C},"~":function(C,B,A,E,D){while((B=B.nextSibling)){if(B.nodeType==1){if(!Selectors.Utils.chk(B,D)){break}if(Selectors.Filters.byTag(B,A)&&Selectors.Filters.byID(B,E)){C.push(B)}}}return C}};Selectors.Filters={byTag:function(B,A){return(A=="*"||(B.tagName&&B.tagName.toLowerCase()==A))},byID:function(A,B){return(!B||(A.id&&A.id==B))},byClass:function(B,A){return(B.className&&B.className.contains(A," "))},byPseudo:function(A,D,C,B){return D.call(A,C,B)},byAttribute:function(C,D,B,E){var A=Element.prototype.getProperty.call(C,D);if(!A){return(B=="!=")}if(!B||E==undefined){return true}switch(B){case"=":return(A==E);case"*=":return(A.contains(E));case"^=":return(A.substr(0,E.length)==E);case"$=":return(A.substr(A.length-E.length)==E);case"!=":return(A!=E);case"~=":return A.contains(E," ");case"|=":return A.contains(E,"-")}return false}};Selectors.Pseudo=new Hash({checked:function(){return this.checked},empty:function(){return !(this.innerText||this.textContent||"").length},not:function(A){return !Element.match(this,A)},contains:function(A){return(this.innerText||this.textContent||"").contains(A)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false}}return true},"only-child":function(){var B=this;while((B=B.previousSibling)){if(B.nodeType==1){return false}}var A=this;while((A=A.nextSibling)){if(A.nodeType==1){return false}}return true},"nth-child":function(G,E){G=(G==undefined)?"n":G;var C=Selectors.Utils.parseNthArgument(G);if(C.special!="n"){return Selectors.Pseudo[C.special].call(this,C.a,E)}var F=0;E.positions=E.positions||{};var D=$uid(this);if(!E.positions[D]){var B=this;while((B=B.previousSibling)){if(B.nodeType!=1){continue}F++;var A=E.positions[$uid(B)];if(A!=undefined){F=A+F;break}}E.positions[D]=F}return(E.positions[D]%C.a==C.b)},index:function(A){var B=this,C=0;while((B=B.previousSibling)){if(B.nodeType==1&&++C>A){return false}}return(C==A)},even:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n+1",A)},odd:function(B,A){return Selectors.Pseudo["nth-child"].call(this,"2n",A)},selected:function(){return this.selected}});Element.Events.domready={onAdd:function(A){if(Browser.loaded){A.call(this)}}};(function(){var B=function(){if(Browser.loaded){return }Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};if(Browser.Engine.trident){var A=document.createElement("div");(function(){($try(function(){A.doScroll("left");return $(A).inject(document.body).set("html","temp").dispose()}))?B():arguments.callee.delay(50)})()}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?B():arguments.callee.delay(50)})()}else{window.addEvent("load",B);document.addEvent("DOMContentLoaded",B)}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(A){return JSON.$specialChars[A]||"\\u00"+Math.floor(A.charCodeAt()/16).toString(16)+(A.charCodeAt()%16).toString(16)},encode:function(B){switch($type(B)){case"string":return'"'+B.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(B.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var A=[];Hash.each(B,function(E,D){var C=JSON.encode(E);if(C){A.push(JSON.encode(D)+":"+C)}});return"{"+A+"}";case"number":case"boolean":return String(B);case false:return"null"}return null},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(B,A){this.key=B;this.setOptions(A)},write:function(B){B=encodeURIComponent(B);if(this.options.domain){B+="; domain="+this.options.domain}if(this.options.path){B+="; path="+this.options.path}if(this.options.duration){var A=new Date();A.setTime(A.getTime()+this.options.duration*24*60*60*1000);B+="; expires="+A.toGMTString()}if(this.options.secure){B+="; secure"}this.options.document.cookie=this.key+"="+B;return this},read:function(){var A=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(A)?decodeURIComponent(A[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(B,C,A){return new Cookie(B,A).write(C)};Cookie.read=function(A){return new Cookie(A).read()};Cookie.dispose=function(B,A){return new Cookie(B,A).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(L,M){this.instance="Swiff_"+$time();this.setOptions(M);M=this.options;var B=this.id=M.id||this.instance;var A=$(M.container);Swiff.CallBacks[this.instance]={};var E=M.params,G=M.vars,F=M.callBacks;var H=$extend({height:M.height,width:M.width},M.properties);var K=this;for(var D in F){Swiff.CallBacks[this.instance][D]=(function(N){return function(){return N.apply(K.object,arguments)}})(F[D]);G[D]="Swiff.CallBacks."+this.instance+"."+D}E.flashVars=Hash.toQueryString(G);if(Browser.Engine.trident){H.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";E.movie=L}else{H.type="application/x-shockwave-flash";H.data=L}var J='<object id="'+B+'"';for(var I in H){J+=" "+I+'="'+H[I]+'"'}J+=">";for(var C in E){if(E[C]){J+='<param name="'+C+'" value="'+E[C]+'" />'}}J+="</object>";this.object=((A)?A.empty():new Element("div")).set("html",J).firstChild},replaces:function(A){A=$(A,true);A.parentNode.replaceChild(this.toElement(),A);return this},inject:function(A){$(A,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(A){this.subject=this.subject||this;this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var B=this.options.wait;if(B===false){this.options.link="cancel"}},getTransition:function(){return function(A){return -(Math.cos(Math.PI*A)-1)/2}},step:function(){var A=$time();if(A<this.time+this.options.duration){var B=this.transition((A-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,B))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(A){return A},compute:function(C,B,A){return Fx.compute(C,B,A)},check:function(){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},start:function(B,A){if(!this.check(B,A)){return this}this.from=B;this.to=A;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(C,B,A){return(B-C)*A+C};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(D,E,B){B=$splat(B);var C=B[1];if(!$chk(C)){B[1]=B[0];B[0]=D.getStyle(E)}var A=B.map(this.parse);return{from:A[0],to:A[1]}},parse:function(A){A=$lambda(A)();A=(typeof A=="string")?A.split(" "):$splat(A);return A.map(function(C){C=String(C);var B=false;Fx.CSS.Parsers.each(function(F,E){if(B){return }var D=F.parse(C);if($chk(D)){B={value:D,parser:F}}});B=B||{value:C,parser:Fx.CSS.Parsers.String};return B})},compute:function(D,C,B){var A=[];(Math.min(D.length,C.length)).times(function(E){A.push({value:D[E].parser.compute(D[E].value,C[E].value,B),parser:D[E].parser})});A.$family={name:"fx:css:value"};return A},serve:function(C,B){if($type(C)!="fx:css:value"){C=this.parse(C)}var A=[];C.each(function(D){A=A.concat(D.parser.serve(D.value,B))});return A},render:function(A,D,C,B){A.setStyle(D,this.serve(C,B))},search:function(A){if(Fx.CSS.Cache[A]){return Fx.CSS.Cache[A]}var B={};Array.each(document.styleSheets,function(E,D){var C=E.href;if(C&&C.contains("://")&&!C.contains(document.domain)){return }var F=E.rules||E.cssRules;Array.each(F,function(I,G){if(!I.style){return }var H=(I.selectorText)?I.selectorText.replace(/^\w+/,function(J){return J.toLowerCase()}):null;if(!H||!H.test("^"+A+"$")){return }Element.Styles.each(function(K,J){if(!I.style[J]||Element.ShortStyles[J]){return }K=String(I.style[J]);B[J]=(K.test(/^rgb/))?K.rgbToHex():K})})});return Fx.CSS.Cache[A]=B}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(A){if(A.match(/^#[0-9a-f]{3,6}$/i)){return A.hexToRgb(true)}return((A=A.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[A[1],A[2],A[3]]:false},compute:function(C,B,A){return C.map(function(E,D){return Math.round(Fx.compute(C[D],B[D],A))})},serve:function(A){return A.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(B,A){return(A)?B+A:B}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(B,A){if(arguments.length==1){A=B;B=this.property||this.options.property}this.render(this.element,B,A,this.options.unit);return this},start:function(C,E,D){if(!this.check(C,E,D)){return this}var B=Array.flatten(arguments);this.property=this.options.property||B.shift();var A=this.prepare(this.element,this.property,B);return this.parent(A.from,A.to)}});Element.Properties.tween={set:function(A){var B=this.retrieve("tween");if(B){B.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("tween")){if(A||!this.retrieve("tween:options")){this.set("tween",A)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(A,C,B){this.get("tween").start(arguments);return this},fade:function(C){var E=this.get("tween"),D="opacity",A;C=$pick(C,"toggle");switch(C){case"in":E.start(D,1);break;case"out":E.start(D,0);break;case"show":E.set(D,1);break;case"hide":E.set(D,0);break;case"toggle":var B=this.retrieve("fade:flag",this.get("opacity")==1);E.start(D,(B)?0:1);this.store("fade:flag",!B);A=true;break;default:E.start(D,arguments)}if(!A){this.eliminate("fade:flag")}return this},highlight:function(C,A){if(!A){A=this.retrieve("highlight:original",this.getStyle("background-color"));A=(A=="transparent")?"#fff":A}var B=this.get("tween");B.start("background-color",C||"#ffff88",A).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));B.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(B,A){this.element=this.subject=$(B);this.parent(A)},set:function(A){if(typeof A=="string"){A=this.search(A)}for(var B in A){this.render(this.element,B,A[B],this.options.unit)}return this},compute:function(E,D,C){var A={};for(var B in E){A[B]=this.parent(E[B],D[B],C)}return A},start:function(B){if(!this.check(B)){return this}if(typeof B=="string"){B=this.search(B)}var E={},D={};for(var C in B){var A=this.prepare(this.element,C,B[C]);E[C]=A.from;D[C]=A.to}return this.parent(E,D)}});Element.Properties.morph={set:function(A){var B=this.retrieve("morph");if(B){B.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("morph")){if(A||!this.retrieve("morph:options")){this.set("morph",A)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(A){this.get("morph").start(A);return this}});Fx.implement({getTransition:function(){var A=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof A=="string"){var B=A.split(":");A=Fx.Transitions;A=A[B[0]]||A[B[0].capitalize()];if(B[1]){A=A["ease"+B[1].capitalize()+(B[2]?B[2].capitalize():"")]}}return A}});Fx.Transition=function(B,A){A=$splat(A);return $extend(B,{easeIn:function(C){return B(C,A)},easeOut:function(C){return 1-B(1-C,A)},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B])}};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=A*A-Math.pow((11-6*B-11*D)/4,2);break}}return C},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(A){this.xhr=new Browser.Request();this.setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return }this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}this.xhr.onreadystatechange=$empty},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(A){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(A)}return A.stripScripts(this.options.evalScripts)},success:function(B,A){this.onSuccess(this.processScripts(B),A)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(A,B){this.headers.set(A,B);return this},getHeader:function(A){return $try(function(){return this.xhr.getResponseHeader(A)}.bind(this))},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(J){if(!this.check(J)){return this}this.running=true;var H=$type(J);if(H=="string"||H=="element"){J={data:J}}var D=this.options;J=$extend({data:D.data,url:D.url,method:D.method},J);var F=J.data,B=J.url,A=J.method;switch($type(F)){case"element":F=$(F).toQueryString();break;case"object":case"hash":F=Hash.toQueryString(F)}if(this.options.format){var I="format="+this.options.format;F=(F)?I+"&"+F:I}if(this.options.emulation&&["put","delete"].contains(A)){var G="_method="+A;F=(F)?G+"&"+F:G;A="post"}if(this.options.urlEncoded&&A=="post"){var C=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+C)}if(this.options.noCache){var E="noCache="+new Date().getTime();F=(F)?E+"&"+F:E}if(F&&A=="get"){B=B+(B.contains("?")?"&":"?")+F;F=null}this.xhr.open(A.toUpperCase(),B,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(L,K){try{this.xhr.setRequestHeader(K,L)}catch(M){this.fireEvent("exception",[K,L])}},this);this.fireEvent("request");this.xhr.send(F);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var A={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(B){A[B]=function(){var C=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(C,{method:B.toLowerCase()}))}});Request.implement(A)})();Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(C){var B=C.match(/<body[^>]*>([\s\S]*?)<\/body>/i);C=(B)?B[1]:C;var A=new Element("div");return $try(function(){var D="<root>"+C+"</root>",G;if(Browser.Engine.trident){G=new ActiveXObject("Microsoft.XMLDOM");G.async=false;G.loadXML(D)}else{G=new DOMParser().parseFromString(D,"text/xml")}D=G.getElementsByTagName("root")[0];if(!D){return }for(var F=0,E=D.childNodes.length;F<E;F++){var H=Element.clone(D.childNodes[F],true,true);if(H){A.grab(H)}}return A})||A.set("html",C)},success:function(D){var C=this.options,B=this.response;B.html=D.stripScripts(function(E){B.javascript=E});var A=this.processHTML(B.html);B.tree=A.childNodes;B.elements=A.getElements("*");if(C.filter){B.tree=B.elements.filter(C.filter)}if(C.update){$(C.update).empty().set("html",B.html)}else{if(C.append){$(C.append).adopt(A.getChildren())}}if(C.evalScripts){$exec(B.javascript)}this.onSuccess(B.tree,B.elements,B.html,B.javascript)}});Element.Properties.send={set:function(A){var B=this.retrieve("send");if(B){B.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},A))},get:function(A){if(A||!this.retrieve("send")){if(A||!this.retrieve("send:options")){this.set("send",A)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.Properties.load={set:function(A){var B=this.retrieve("load");if(B){B.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},A))},get:function(A){if(A||!this.retrieve("load")){if(A||!this.retrieve("load:options")){this.set("load",A)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({send:function(A){var B=this.get("send");B.send({data:this,url:A||B.options.url});return this},load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(A){this.parent(A);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(A){this.response.json=JSON.decode(A,this.options.secure);this.onSuccess(this.response.json,A)}});MooTools.More={version:"1.2.2.1"};(function(){var A={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};var B;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(C){if(!A.languages[C]){return this}A.language=C;this.load();this.fireEvent("langChange",C);return this},load:function(){var C=this.cascade(this.getCurrentLanguage());B={};$each(C,function(E,D){B[D]=this.lambda(E)},this)},getCurrentLanguage:function(){return A.language},addLanguage:function(C){A.languages[C]=A.languages[C]||{};return this},cascade:function(E){var C=(A.languages[E]||{}).cascades||[];C.combine(A.cascades);C.erase(E).push(E);var D=C.map(function(F){return A.languages[F]},this);return $merge.apply(this,D)},lambda:function(C){(C||{}).get=function(E,D){return $lambda(C[E]).apply(this,$splat(D))};return C},get:function(E,D,C){if(B&&B[E]){return(D?B[E].get(D,C):B[E])}},set:function(D,E,C){this.addLanguage(D);langData=A.languages[D];if(!langData[E]){langData[E]={}}$extend(langData[E],C);if(D==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",D)}return this},list:function(){return Hash.getKeys(A.languages)}})})();var Log=new Class({log:function(){Log.logger.call(this,arguments)}});Log.logged=[];Log.logger=function(){if(window.console&&console.log){console.log.apply(console,arguments)}else{Log.logged.push(arguments)}};Class.refactor=function(B,A){$each(A,function(E,D){var C=B.prototype[D];if(C&&(C=C._origin)&&typeof E=="function"){B.implement(D,function(){var F=this.previous;this.previous=C;var G=E.apply(this,arguments);this.previous=F;return G})}else{B.implement(D,E)}});return B};Class.Mutators.Binds=function(A){return A};Class.Mutators.initialize=function(A){return function(){$splat(this.Binds).each(function(B){var C=this[B];if(C){this[B]=C.bind(this)}},this);return A.apply(this,arguments)}};Class.Occlude=new Class({occlude:function(C,B){B=$(B||this.element);var A=B.retrieve(C||this.property);if(A&&!$defined(this.occluded)){this.occluded=A}else{this.occluded=false;B.store(C||this.property,this)}return this.occluded}});(function(){var B={wait:function(C){return this.chain(function(){this.callChain.delay($pick(C,500),this)}.bind(this))}};Chain.implement(B);if(window.Fx){Fx.implement(B);["Css","Tween","Elements"].each(function(C){if(Fx[C]){Fx[C].implement(B)}})}try{Element.implement({chains:function(C){$splat($pick(C,["tween","morph","reveal"])).each(function(D){D=this.get(D);if(!D){return }D.setOptions({link:"chain"})},this);return this},pauseFx:function(D,C){this.chains(C).get($pick(C,"tween")).wait(D);return this}})}catch(A){}})();Array.implement({min:function(){return Math.min.apply(null,this)},max:function(){return Math.max.apply(null,this)},average:function(){return this.length?this.sum()/this.length:0},sum:function(){var A=0,B=this.length;if(B){do{A+=this[--B]}while(B)}return A},unique:function(){return[].combine(this)}});(function(){new Native({name:"Date",initialize:Date,protect:true});["now","parse","UTC"].each(function(D){Native.genericize(Date,D,true)});Date.Methods={};["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","UTCDate","UTCDay","UTCFullYear","AMPM","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(D){Date.Methods[D.toLowerCase()]=D});$each({ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"},function(E,D){Date.Methods[D]=E});var C=function(E,D){return"0".repeat(D-E.toString().length)+E};Date.implement({set:function(G,E){switch($type(G)){case"object":for(var F in G){this.set(F,G[F])}break;case"string":G=G.toLowerCase();var D=Date.Methods;if(D[G]){this["set"+D[G]](E)}}return this},get:function(E){E=E.toLowerCase();var D=Date.Methods;if(D[E]){return this["get"+D[E]]()}return null},clone:function(){return new Date(this.get("time"))},increment:function(D,E){return this.multiply(D,E)},decrement:function(D,E){return this.multiply(D,E,false)},multiply:function(E,J,D){E=E||"day";J=$pick(J,1);D=$pick(D,true);var K=D?1:-1;var H=this.format("%m").toInt()-1;var F=this.format("%Y").toInt();var G=this.get("time");var I=0;switch(E){case"year":J.times(function(L){if(Date.isLeapYear(F+L)&&H>1&&K>0){L++}if(Date.isLeapYear(F+L)&&H<=1&&K<0){L--}I+=Date.units.year(F+L)});break;case"month":J.times(function(N){if(K<0){N++}var M=H+(N*K);var L=L;if(M<0){L--;M=12+M}if(M>11||M<0){L+=(M/12).toInt()*K;M=M%12}I+=Date.units.month(M,L)});break;case"day":return this.set("date",this.get("date")+(K*J));default:I=Date.units[E]()*J;break}this.set("time",G+(I*K));return this},isLeapYear:function(){return Date.isLeapYear(this.get("year"))},clearTime:function(){["hr","min","sec","ms"].each(function(D){this.set(D,0)},this);return this},diff:function(G,E){E=E||"day";if($type(G)=="string"){G=Date.parse(G)}switch(E){case"year":return G.format("%Y").toInt()-this.format("%Y").toInt();break;case"month":var D=(G.format("%Y").toInt()-this.format("%Y").toInt())*12;return D+G.format("%m").toInt()-this.format("%m").toInt();break;default:var F=G.get("time")-this.get("time");if(F<0&&Date.units[E]()>(-1*(F))){return 0}else{if(F>=0&&F<Date.units[E]()){return 0}}return((G.get("time")-this.get("time"))/Date.units[E]()).round()}return null},getWeek:function(){var D=(new Date(this.get("year"),0,1)).get("date");return Math.round((this.get("dayofyear")+(D>3?D-4:D+3))/7)},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")},getGMTOffset:function(){var D=this.get("timezoneOffset");return((D>0)?"-":" + ")+C(Math.floor(Math.abs(D)/60),2)+C(D%60,2)},parse:function(D){this.set("time",Date.parse(D));return this},isValid:function(D){return !!(D||this).valueOf()},format:function(D){if(!this.isValid()){return"invalid date"}D=D||"%x %X";D=({db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"})[D.toLowerCase()]||D;var E=this;return D.replace(/\%([aAbBcdHIjmMpSUWwxXyYTZ\%])/g,function(F,G){switch(G){case"a":return Date.getMsg("days")[E.get("day")].substr(0,3);case"A":return Date.getMsg("days")[E.get("day")];case"b":return Date.getMsg("months")[E.get("month")].substr(0,3);case"B":return Date.getMsg("months")[E.get("month")];case"c":return E.toString();case"d":return C(E.get("date"),2);case"H":return C(E.get("hr"),2);case"I":return((E.get("hr")%12)||12);case"j":return C(E.get("dayofyear"),3);case"m":return C((E.get("mo")+1),2);case"M":return C(E.get("min"),2);case"p":return Date.getMsg(E.get("hr")<12?"AM":"PM");case"S":return C(E.get("seconds"),2);case"U":return C(E.get("week"),2);case"W":throw new Error("%W is not supported yet");case"w":return E.get("day");case"x":return E.format(Date.getMsg("shortDate"));case"X":return E.format(Date.getMsg("shortTime"));case"y":return E.get("year").toString().substr(2);case"Y":return E.get("year");case"T":return E.get("GMTOffset");case"Z":return E.get("Timezone");case"%":return"%"}return G})},setAMPM:function(D){D=D.toUpperCase();if(this.format("%H").toInt()>11&&D=="AM"){return this.decrement("hour",12)}else{if(this.format("%H").toInt()<12&&D=="PM"){return this.increment("hour",12)}}return this}});Date.alias("diff","compare");Date.alias("format","strftime");var B=Date.parse;var A=function(E,D){if(Date.isLeapYear(D.toInt())&&E===1){return 29}return[31,28,31,30,31,30,31,31,30,31,30,31][E]};$extend(Date,{getMsg:function(E,D){return MooTools.lang.get("Date",E,D)},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(F,D){var E=new Date();return A($pick(F,E.format("%m").toInt()),$pick(D,E.format("%Y").toInt()))*86400000},year:function(D){D=D||new Date().format("%Y").toInt();return Date.isLeapYear(D.toInt())?31622400000:31536000000}},isLeapYear:function(D){return new Date(D,1,29).getDate()==29},fixY2K:function(E){if(!isNaN(E)){var D=new Date(E);if(D.get("year")<2000&&E.toString().indexOf(D.get("year"))<0){D.increment("year",100)}return D}else{return E}},parse:function(F){var E=$type(F);if(E=="number"){return new Date(F)}if(E!="string"){return F}if(!F.length){return null}var D;Date.parsePatterns.each(function(I,G){if(D){return }var H=I.re.exec(F);if(H){D=I.handler(H)}});return D||new Date(B(F))},parseDay:function(D,G){var F=-1;switch($type(D)){case"number":F=Date.getMsg("days")[D-1]||false;if(!F){throw new Error("Invalid day index value must be between 1 and 7")}break;case"string":var E=Date.getMsg("days").filter(function(H){return this.test(H)},new RegExp("^"+D,"i"));if(!E.length){throw new Error("Invalid day string")}if(E.length>1){throw new Error("Ambiguous day")}F=E[0]}return(G)?Date.getMsg("days").indexOf(F):F},parseMonth:function(G,F){var E=-1;switch($type(G)){case"object":E=Date.getMsg("months")[G.get("mo")];break;case"number":E=Date.getMsg("months")[G-1]||false;if(!E){throw new Error("Invalid month index value must be between 1 and 12:"+index)}break;case"string":var D=Date.getMsg("months").filter(function(H){return this.test(H)},new RegExp("^"+G,"i"));if(!D.length){throw new Error("Invalid month string")}if(D.length>1){throw new Error("Ambiguous month")}E=D[0]}return(F)?Date.getMsg("months").indexOf(E):E},parseUTC:function(E){var D=new Date(E);var F=Date.UTC(D.get("year"),D.get("mo"),D.get("date"),D.get("hr"),D.get("min"),D.get("sec"));return new Date(F)},orderIndex:function(D){return Date.getMsg("dateOrder").indexOf(D)+1},parsePatterns:[{re:/^(\d{4})[\.\-\/](\d{1,2})[\.\-\/](\d{1,2})$/,handler:function(D){return new Date(D[1],D[2]-1,D[3])}},{re:/^(\d{4})[\.\-\/](\d{1,2})[\.\-\/](\d{1,2})\s(\d{1,2}):(\d{1,2})(?:\:(\d{1,2}))?(\w{2})?$/,handler:function(D){var E=new Date(D[1],D[2]-1,D[3]);E.set("hr",D[4]);E.set("min",D[5]);E.set("sec",D[6]||0);if(D[7]){E.set("ampm",D[7])}return E}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})$/,handler:function(D){var E=new Date(D[Date.orderIndex("year")],D[Date.orderIndex("month")]-1,D[Date.orderIndex("date")]);return Date.fixY2K(E)}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})\s(\d{1,2})[:\.](\d{1,2})(?:[\:\.](\d{1,2}))?(\w{2})?$/,handler:function(D){var E=new Date(D[Date.orderIndex("year")],D[Date.orderIndex("month")]-1,D[Date.orderIndex("date")]);E.set("hr",D[4]);E.set("min",D[5]);E.set("sec",D[6]||0);if(D[7]){E.set("ampm",D[7])}return Date.fixY2K(E)}}]})})();["LastDayOfMonth","Ordinal"].each(function(A){Date.Methods[A.toLowerCase()]=A});Date.implement({timeDiffInWords:function(A){return Date.distanceOfTimeInWords(this,A||new Date)},getOrdinal:function(A){return Date.getMsg("ordinal",A||this.get("date"))},getDayOfYear:function(){return((Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+1,0,0,0)-Date.UTC(this.getFullYear(),0,1,0,0,0))/Date.units.day())},getLastDayOfMonth:function(){var A=this.clone();A.setMonth(A.getMonth()+1,0);return A.getDate()}});Date.alias("timeDiffInWords","timeAgoInWords");$extend(Date,{distanceOfTimeInWords:function(B,A){return this.getTimePhrase(((A.getTime()-B.getTime())/1000).toInt(),B,A)},getTimePhrase:function(D,C,A){var B=function(){var E;if(D>=0){E="Ago"}else{D=D*-1;E="Until"}if(D<60){return Date.getMsg("lessThanMinute"+E,D)}else{if(D<120){return Date.getMsg("minute"+E,D)}else{if(D<(45*60)){D=(D/60).round();return Date.getMsg("minutes"+E,D)}else{if(D<(90*60)){return Date.getMsg("hour"+E,D)}else{if(D<(24*60*60)){D=(D/3600).round();return Date.getMsg("hours"+E,D)}else{if(D<(48*60*60)){return Date.getMsg("day"+E,D)}else{D=(D/86400).round();return Date.getMsg("days"+E,D)}}}}}}};return B().substitute({delta:D})}});Date.parsePatterns.extend([{re:/^(\d{4})(?:-?(\d{2})(?:-?(\d{2})(?:[T ](\d{2})(?::?(\d{2})(?::?(\d{2})(?:\.(\d+))?)?)?(?:Z|(?:([-+])(\d{2})(?::?(\d{2}))?)?)?)?)?)?$/,handler:function(A){var C=0;var B=new Date(A[1],0,1);if(A[3]){B.set("date",A[3])}if(A[2]){B.set("mo",A[2]-1)}if(A[4]){B.set("hr",A[4])}if(A[5]){B.set("min",A[5])}if(A[6]){B.set("sec",A[6])}if(A[7]){B.set("ms",("0."+A[7]).toInt()*1000)}if(A[9]){C=(A[9].toInt()*60)+A[10].toInt();C*=((A[8]=="-")?1:-1)}B.setTime((B*1)+(C*60*1000).toInt());return B}},{re:/^tod/i,handler:function(){return new Date()}},{re:/^tom/i,handler:function(){return new Date().increment()}},{re:/^yes/i,handler:function(){return new Date().decrement()}},{re:/^(\d{1,2})(st|nd|rd|th)?$/i,handler:function(A){var B=new Date();B.set("date",A[1].toInt());return B}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,handler:function(A){var B=new Date();B.set("mo",Date.parseMonth(A[2],true),A[1].toInt());return B}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i,handler:function(A){var B=new Date();B.set("mo",Date.parseMonth(A[2],true),A[1].toInt());B.setYear(A[3]);return B}},{re:/^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,handler:function(A){var B=new Date();B.set("mo",Date.parseMonth(A[1],true),A[2].toInt());B.setYear(A[3]);return B}},{re:/^next (\w+)$/i,handler:function(D){var E=new Date();var B=E.getDay();var C=Date.parseDay(D[1],true);var A=C-B;if(C<=B){A+=7}E.set("date",E.getDate()+A);return E}},{re:/^\d+\s[a-zA-z]..\s\d.\:\d.$/,handler:function(B){var C=new Date();B=B[0].split(" ");C.set("date",B[0]);var A;Date.getMsg("months").each(function(E,D){if(new RegExp("^"+B[1]).test(E)){A=D}});C.set("mo",A);C.set("hr",B[2].split(":")[0]);C.set("min",B[2].split(":")[1]);C.set("ms",0);return C}},{re:/^last (\w+)$/i,handler:function(A){return Date.parse("next "+A[0]).decrement("day",7)}}]);Hash.implement({getFromPath:function(A){var B=this.getClean();A.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(C){if(!B){return null}var D=arguments[2]||arguments[1]||arguments[0];B=(D in B)?B[D]:null;return C});return B},cleanValues:function(A){A=A||$defined;this.each(function(C,B){if(!A(C)){this.erase(B)}},this);return this},run:function(){var A=arguments;this.each(function(C,B){if($type(C)=="function"){C.run(A)}})}});(function(){var B=["Ã€","Ã ","Ã�","Ã¡","Ã‚","Ã¢","Ãƒ","Ã£","Ã„","Ã¤","Ã…","Ã¥","Ä‚","Äƒ","Ä„","Ä…","Ä†","Ä‡","ÄŒ","Ä�","Ã‡","Ã§","ÄŽ","Ä�","Ä�","Ä‘","Ãˆ","Ã¨","Ã‰","Ã©","ÃŠ","Ãª","Ã‹","Ã«","Äš","Ä›","Ä˜","Ä™","Äž","ÄŸ","ÃŒ","Ã¬","Ã�","Ã","ÃŽ","Ã®","Ã�","Ã¯","Ä¹","Äº","Ä½","Ä¾","Å�","Å‚","Ã‘","Ã±","Å‡","Åˆ","Åƒ","Å„","Ã’","Ã²","Ã“","Ã³","Ã”","Ã´","Ã•","Ãµ","Ã–","Ã¶","Ã˜","Ã¸","Å‘","Å˜","Å™","Å”","Å•","Å ","Å¡","Åž","ÅŸ","Åš","Å›","Å¤","Å¥","Å¤","Å¥","Å¢","Å£","Ã™","Ã¹","Ãš","Ãº","Ã›","Ã»","Ãœ","Ã¼","Å®","Å¯","Å¸","Ã¿","Ã½","Ã�","Å½","Å¾","Å¹","Åº","Å»","Å¼","Ãž","Ã¾","Ã�","Ã°","ÃŸ","Å’","Å“","Ã†","Ã¦","Âµ"];var A=["A","a","A","a","A","a","A","a","Ae","ae","A","a","A","a","A","a","C","c","C","c","C","c","D","d","D","d","E","e","E","e","E","e","E","e","E","e","E","e","G","g","I","i","I","i","I","i","I","i","L","l","L","l","L","l","N","n","N","n","N","n","O","o","O","o","O","o","O","o","Oe","oe","O","o","o","R","r","R","r","S","s","S","s","S","s","T","t","T","t","T","t","U","u","U","u","U","u","Ue","ue","U","u","Y","y","Y","y","Z","z","Z","z","Z","z","TH","th","DH","dh","ss","OE","oe","AE","ae","u"];var C={"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"};String.implement({standardize:function(){var D=this;B.each(function(F,E){D=D.replace(new RegExp(F,"g"),A[E])});return D},repeat:function(D){return new Array(D+1).join(this)},pad:function(E,G,D){if(this.length>=E){return this}G=G||" ";var F=G.repeat(E-this.length).substr(0,E-this.length);if(!D||D=="right"){return this+F}if(D=="left"){return F+this}return F.substr(0,(F.length/2).floor())+this+F.substr(0,(F.length/2).ceil())},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},tidy:function(){var D=this.toString();$each(C,function(F,E){D=D.replace(new RegExp(E,"g"),F)});return D}})})();String.implement({parseQueryString:function(){var B=this.split(/[&;]/),A={};if(B.length){B.each(function(G){var C=G.indexOf("="),D=C<0?[""]:G.substr(0,C).match(/[^\]\[]+/g),E=decodeURIComponent(G.substr(C+1)),F=A;D.each(function(I,H){var J=F[I];if(H<D.length-1){F=F[I]=J||{}}else{if($type(J)=="array"){J.push(E)}else{F[I]=$defined(J)?[J,E]:E}}})})}return A},cleanQueryString:function(A){return this.split("&").filter(function(E){var B=E.indexOf("="),C=B<0?"":E.substr(0,B),D=E.substr(B+1);return A?A.run([C,D]):$chk(D)}).join("&")}});var URI=new Class({Implements:Options,regex:/^(?:(\w+):)?(?:\/\/(?:(?:([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)?(\.\.?$|(?:[^?#\/]*\/)*)([^?#]*)(?:\?([^#]*))?(?:#(.*))?/,parts:["scheme","user","password","host","port","directory","file","query","fragment"],schemes:{http:80,https:443,ftp:21,rtsp:554,mms:1755,file:0},initialize:function(B,A){this.setOptions(A);var C=this.options.base||URI.base;B=B||C;if(B&&B.parsed){this.parsed=$unlink(B.parsed)}else{this.set("value",B.href||B.toString(),C?new URI(C):false)}},parse:function(C,B){var A=C.match(this.regex);if(!A){return false}A.shift();return this.merge(A.associate(this.parts),B)},merge:function(B,A){if(!B.scheme&&!A.scheme){return false}if(A){this.parts.every(function(C){if(B[C]){return false}B[C]=A[C]||"";return true})}B.port=B.port||this.schemes[B.scheme.toLowerCase()];B.directory=B.directory?this.parseDirectory(B.directory,A?A.directory:""):"/";return B},parseDirectory:function(B,C){B=(B.substr(0,1)=="/"?"":(C||"/"))+B;if(!B.test(URI.regs.directoryDot)){return B}var A=[];B.replace(URI.regs.endSlash,"").split("/").each(function(D){if(D==".."&&A.length>0){A.pop()}else{if(D!="."){A.push(D)}}});return A.join("/")+"/"},combine:function(A){return A.value||A.scheme+"://"+(A.user?A.user+(A.password?":"+A.password:"")+"@":"")+(A.host||"")+(A.port&&A.port!=this.schemes[A.scheme]?":"+A.port:"")+(A.directory||"/")+(A.file||"")+(A.query?"?"+A.query:"")+(A.fragment?"#"+A.fragment:"")},set:function(B,D,C){if(B=="value"){var A=D.match(URI.regs.scheme);if(A){A=A[1]}if(A&&!$defined(this.schemes[A.toLowerCase()])){this.parsed={scheme:A,value:D}}else{this.parsed=this.parse(D,(C||this).parsed)||(A?{scheme:A,value:D}:{value:D})}}else{this.parsed[B]=D}return this},get:function(A,B){switch(A){case"value":return this.combine(this.parsed,B?B.parsed:false);case"data":return this.getData()}return this.parsed[A]||undefined},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(C,B){var A=this.get(B||"query");if(!$chk(A)){return C?null:{}}var D=A.parseQueryString();return C?D[C]:D},setData:function(A,C,B){if($type(arguments[0])=="string"){A=this.getData();A[arguments[0]]=arguments[1]}else{if(C){A=$merge(this.getData(),A)}}return this.set(B||"query",Hash.toQueryString(A))},clearData:function(A){return this.set(A||"query","")}});["toString","valueOf"].each(function(A){URI.prototype[A]=function(){return this.get("value")}});URI.regs={endSlash:/\/$/,scheme:/^(\w+):/,directoryDot:/\.\/|\.$/};URI.base=new URI($$("base[href]").getLast(),{base:document.location});String.implement({toURI:function(A){return new URI(this,A)}});URI=Class.refactor(URI,{combine:function(F,E){if(!E||F.scheme!=E.scheme||F.host!=E.host||F.port!=E.port){return this.previous.apply(this,arguments)}var A=F.file+(F.query?"?"+F.query:"")+(F.fragment?"#"+F.fragment:"");if(!E.directory){return(F.directory||(F.file?"":"./"))+A}var D=E.directory.split("/"),C=F.directory.split("/"),G="",H;var B=0;for(H=0;H<D.length&&H<C.length&&D[H]==C[H];H++){}for(B=0;B<D.length-H-1;B++){G+="../"}for(B=H;B<C.length-1;B++){G+=C[B]+"/"}return(G||(F.file?"":"./"))+A},toAbsolute:function(A){A=new URI(A);if(A){A.set("directory","").set("file","")}return this.toRelative(A)},toRelative:function(A){return this.get("value",new URI(A))}});Element.implement({tidy:function(){this.set("value",this.get("value").tidy())},getTextInRange:function(B,A){return this.get("value").substring(B,A)},getSelectedText:function(){if(document.selection&&document.selection.createRange){return document.selection.createRange().text}return this.getTextInRange(this.getSelectionStart(),this.getSelectionEnd())},getSelectedRange:function(){if($defined(this.selectionStart)){return{start:this.selectionStart,end:this.selectionEnd}}var E={start:0,end:0};var A=this.getDocument().selection.createRange();if(!A||A.parentElement()!=this){return E}var C=A.duplicate();if(this.type=="text"){E.start=0-C.moveStart("character",-100000);E.end=E.start+A.text.length}else{var B=this.get("value");var D=B.length-B.match(/[\n\r]*$/)[0].length;C.moveToElementText(this);C.setEndPoint("StartToEnd",A);E.end=D-C.text.length;C.setEndPoint("StartToStart",A);E.start=D-C.text.length}return E},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(A){if(A=="end"){A=this.get("value").length}this.selectRange(A,A);return this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(E,A){if(this.createTextRange){var C=this.get("value");var D=C.substr(E,A-E).replace(/\r/g,"").length;E=C.substr(0,E).replace(/\r/g,"").length;var B=this.createTextRange();B.collapse(true);B.moveEnd("character",E+D);B.moveStart("character",E);B.select()}else{this.focus();this.setSelectionRange(E,A)}return this},insertAtCursor:function(B,A){var D=this.getSelectedRange();var C=this.get("value");this.set("value",C.substring(0,D.start)+B+C.substring(D.end,C.length));if($pick(A,true)){this.selectRange(D.start,D.start+B.length)}else{this.setCaretPosition(D.start+B.length)}return this},insertAroundCursor:function(B,A){B=$extend({before:"",defaultMiddle:"",after:""},B);var C=this.getSelectedText()||B.defaultMiddle;var G=this.getSelectedRange();var F=this.get("value");if(G.start==G.end){this.set("value",F.substring(0,G.start)+B.before+C+B.after+F.substring(G.end,F.length));this.selectRange(G.start+B.before.length,G.end+B.before.length+C.length)}else{var D=F.substring(G.start,G.end);this.set("value",F.substring(0,G.start)+B.before+D+B.after+F.substring(G.end,F.length));var E=G.start+B.before.length;if($pick(A,true)){this.selectRange(E,E+D.length)}else{this.setCaretPosition(E+F.length)}}return this}});Element.implement({measure:function(E){var G=function(H){return !!(!H||H.offsetHeight||H.offsetWidth)};if(G(this)){return E.apply(this)}var D=this.getParent(),B=[],F=[];while(!G(D)&&D!=document.body){B.push(D.expose());D=D.getParent()}var C=this.expose();var A=E.apply(this);C();B.each(function(H){H()});return A},expose:function(){if(this.getStyle("display")!="none"){return $empty}var A=this.getStyles("display","position","visibility");return this.setStyles({display:"block",position:"absolute",visibility:"hidden"}).setStyles.pass(A,this)},getDimensions:function(A){A=$merge({computeSize:false},A);var D={};var C=function(F,E){return(E.computeSize)?F.getComputedSize(E):F.getSize()};if(this.getStyle("display")=="none"){D=this.measure(function(){return C(this,A)})}else{try{D=C(this,A)}catch(B){}}return $chk(D.x)?$extend(D,{width:D.x,height:D.y}):$extend(D,{x:D.width,y:D.height})},getComputedSize:function(A){A=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},A);var C={width:0,height:0};switch(A.mode){case"vertical":delete C.width;delete A.plains.width;break;case"horizontal":delete C.height;delete A.plains.height;break}var B=[];$each(A.plains,function(G,F){G.each(function(H){A.styles.each(function(I){B.push((I=="border")?I+"-"+H+"-width":I+"-"+H)})})});var E={};B.each(function(F){E[F]=this.getComputedStyle(F)},this);var D=[];$each(A.plains,function(G,F){var H=F.capitalize();C["total"+H]=0;C["computed"+H]=0;G.each(function(I){C["computed"+I.capitalize()]=0;B.each(function(K,J){if(K.test(I)){E[K]=E[K].toInt()||0;C["total"+H]=C["total"+H]+E[K];C["computed"+I.capitalize()]=C["computed"+I.capitalize()]+E[K]}if(K.test(I)&&F!=K&&(K.test("border")||K.test("padding"))&&!D.contains(K)){D.push(K);C["computed"+H]=C["computed"+H]-E[K]}})})});["Width","Height"].each(function(G){var F=G.toLowerCase();if(!$chk(C[F])){return }C[F]=C[F]+this["offset"+G]+C["computed"+G];C["total"+G]=C[F]+C["total"+G];delete C["computed"+G]},this);return $extend(E,C)}});(function(){var A=false;window.addEvent("domready",function(){var B=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);A=(B.offsetTop===0);B.dispose()});Element.implement({pin:function(C){if(this.getStyle("display")=="none"){return null}var D;if(C!==false){D=this.getPosition();if(!this.retrieve("pinned")){var F={top:D.y-window.getScroll().y,left:D.x-window.getScroll().x};if(A){this.setStyle("position","fixed").setStyles(F)}else{this.store("pinnedByJS",true);this.setStyles({position:"absolute",top:D.y,left:D.x});this.store("scrollFixer",(function(){if(this.retrieve("pinned")){this.setStyles({top:F.top.toInt()+window.getScroll().y,left:F.left.toInt()+window.getScroll().x})}}).bind(this));window.addEvent("scroll",this.retrieve("scrollFixer"))}this.store("pinned",true)}}else{var E;if(!Browser.Engine.trident){if(this.getParent().getComputedStyle("position")!="static"){E=this.getParent()}else{E=this.getParent().getOffsetParent()}}D=this.getPosition(E);this.store("pinned",false);var B;if(A&&!this.retrieve("pinnedByJS")){B={top:D.y+window.getScroll().y,left:D.x+window.getScroll().x}}else{this.store("pinnedByJS",false);window.removeEvent("scroll",this.retrieve("scrollFixer"));B={top:D.y,left:D.x}}this.setStyles($merge(B,{position:"absolute"}))}return this.addClass("isPinned")},unpin:function(){return this.pin(false).removeClass("isPinned")},togglepin:function(){this.pin(!this.retrieve("pinned"))}})})();(function(){var A=Element.prototype.position;Element.implement({position:function(R){if(R&&($defined(R.x)||$defined(R.y))){return A?A.apply(this,arguments):this}$each(R||{},function(T,S){if(!$defined(T)){delete R[S]}});R=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,allowNegative:false},R);var B={x:0,y:0};var H=false;var C=this.measure(function(){return $(this.getOffsetParent())});if(C&&C!=this.getDocument().body){B=C.measure(function(){return this.getPosition()});H=true;R.offset.x=R.offset.x-B.x;R.offset.y=R.offset.y-B.y}var Q=function(S){if($type(S)!="string"){return S}S=S.toLowerCase();var T={};if(S.test("left")){T.x="left"}else{if(S.test("right")){T.x="right"}else{T.x="center"}}if(S.test("upper")||S.test("top")){T.y="top"}else{if(S.test("bottom")){T.y="bottom"}else{T.y="center"}}return T};R.edge=Q(R.edge);R.position=Q(R.position);if(!R.edge){if(R.position.x=="center"&&R.position.y=="center"){R.edge={x:"center",y:"center"}}else{R.edge={x:"left",y:"top"}}}this.setStyle("position","absolute");var P=$(R.relativeTo)||document.body;var I=P==document.body?window.getScroll():P.getPosition();var O=I.y;var G=I.x;if(Browser.Engine.trident){var L=P.getScrolls();O+=L.y;G+=L.x}var J=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});if(R.ignoreMargins){R.offset.x=R.offset.x-J["margin-left"];R.offset.y=R.offset.y-J["margin-top"]}var N={};var D=R.offset.y;var E=R.offset.x;var K=window.getSize();switch(R.position.x){case"left":N.x=G+E;break;case"right":N.x=G+E+P.offsetWidth;break;default:N.x=G+((P==document.body?K.x:P.offsetWidth)/2)+E;break}switch(R.position.y){case"top":N.y=O+D;break;case"bottom":N.y=O+D+P.offsetHeight;break;default:N.y=O+((P==document.body?K.y:P.offsetHeight)/2)+D;break}if(R.edge){var M={};switch(R.edge.x){case"left":M.x=0;break;case"right":M.x=-J.x-J.computedRight-J.computedLeft;break;default:M.x=-(J.x/2);break}switch(R.edge.y){case"top":M.y=0;break;case"bottom":M.y=-J.y-J.computedTop-J.computedBottom;break;default:M.y=-(J.y/2);break}N.x=N.x+M.x;N.y=N.y+M.y}N={left:((N.x>=0||H||R.allowNegative)?N.x:0).toInt(),top:((N.y>=0||H||R.allowNegative)?N.y:0).toInt()};if(P.getStyle("position")=="fixed"||R.relFixedPosition){var F=window.getScroll();N.top=N.top.toInt()+F.y;N.left=N.left.toInt()+F.x}if(R.returnPos){return N}else{this.setStyles(N)}return this}})})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var B;try{if("none"!=this.getStyle("display")){B=this.getStyle("display")}}catch(A){}return this.store("originalDisplay",B||"block").setStyle("display","none")},show:function(A){return this.setStyle("display",A||this.retrieve("originalDisplay")||"block")},swapClass:function(A,B){return this.removeClass(A).addClass(B)}});var InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:function(A){return true}},initialize:function(B,A){this.setOptions(A);this.className=B},test:function(B,A){if($(B)){return this.options.test($(B),A||this.getProps(B))}else{return false}},getError:function(C,A){var B=this.options.errorMsg;if($type(B)=="function"){B=B($(C),A||this.getProps(C))}return B},getProps:function(A){if(!$(A)){return{}}return A.get("validatorProps")}});Element.Properties.validatorProps={set:function(A){return this.eliminate("validatorProps").store("validatorProps",A)},get:function(A){if(A){this.set(A)}if(this.retrieve("validatorProps")){return this.retrieve("validatorProps")}if(this.getProperty("validatorProps")){try{this.store("validatorProps",JSON.decode(this.getProperty("validatorProps")))}catch(C){return{}}}else{var B=this.get("class").split(" ").filter(function(D){return D.test(":")});if(!B.length){this.store("validatorProps",{})}else{A={};B.each(function(D){var E=D.split(":");if(E[1]){try{A[E[0]]=JSON.decode(E[1])}catch(F){}}});this.store("validatorProps",A)}}return this.retrieve("validatorProps")}};var FormValidator=new Class({Implements:[Options,Events],Binds:["onSubmit"],options:{fieldSelectors:"input, select, textarea",ignoreHidden:true,useTitles:false,evaluateOnSubmit:true,evaluateFieldsOnBlur:true,evaluateFieldsOnChange:true,serial:true,stopOnFailure:true,warningPrefix:function(){return FormValidator.getMsg("warningPrefix")||"Warning: "},errorPrefix:function(){return FormValidator.getMsg("errorPrefix")||"Error: "}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.element.store("validator",this);this.warningPrefix=$lambda(this.options.warningPrefix)();this.errorPrefix=$lambda(this.options.errorPrefix)();if(this.options.evaluateOnSubmit){this.element.addEvent("submit",this.onSubmit)}if(this.options.evaluateFieldsOnBlur){this.watchFields(this.getFields())}},toElement:function(){return this.element},getFields:function(){return(this.fields=this.element.getElements(this.options.fieldSelectors))},watchFields:function(A){A.each(function(B){B.addEvent("blur",this.validateField.pass([B,false],this));if(this.options.evaluateFieldsOnChange){B.addEvent("change",this.validateField.pass([B,true],this))}},this)},onSubmit:function(A){if(!this.validate(A)&&A){A.preventDefault()}else{this.reset()}},reset:function(){this.getFields().each(this.resetField,this);return this},validate:function(B){var A=this.getFields().map(function(C){return this.validateField(C,true)},this).every(function(C){return C});this.fireEvent("formValidate",[A,this.element,B]);if(this.options.stopOnFailure&&!A&&B){B.preventDefault()}return A},validateField:function(I,A){if(this.paused){return true}I=$(I);var D=!I.hasClass("validation-failed");var F,H;if(this.options.serial&&!A){F=this.element.getElement(".validation-failed");H=this.element.getElement(".warning")}if(I&&(!F||A||I.hasClass("validation-failed")||(F&&!this.options.serial))){var C=I.className.split(" ").some(function(J){return this.getValidator(J)},this);var G=[];I.className.split(" ").each(function(J){if(J&&!this.test(J,I)){G.include(J)}},this);D=G.length===0;if(C&&!I.hasClass("warnOnly")){if(D){I.addClass("validation-passed").removeClass("validation-failed");this.fireEvent("elementPass",I)}else{I.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("elementFail",[I,G])}}if(!H){var E=I.className.split(" ").some(function(J){if(J.test("^warn-")||I.hasClass("warnOnly")){return this.getValidator(J.replace(/^warn-/,""))}else{return null}},this);I.removeClass("warning");var B=I.className.split(" ").map(function(J){if(J.test("^warn-")||I.hasClass("warnOnly")){return this.test(J.replace(/^warn-/,""),I,true)}else{return null}},this)}}return D},test:function(B,D,E){var A=this.getValidator(B);D=$(D);if(D.hasClass("ignoreValidation")){return true}E=$pick(E,false);if(D.hasClass("warnOnly")){E=true}var C=A?A.test(D):true;if(A&&this.isVisible(D)){this.fireEvent("elementValidate",[C,D,B,E])}if(E){return true}return C},isVisible:function(A){if(!this.options.ignoreHidden){return true}while(A!=document.body){if($(A).getStyle("display")=="none"){return false}A=A.getParent()}return true},resetField:function(A){A=$(A);if(A){A.className.split(" ").each(function(B){if(B.test("^warn-")){B=B.replace(/^warn-/,"")}A.removeClass("validation-failed");A.removeClass("warning");A.removeClass("validation-passed")},this)}return this},stop:function(){this.paused=true;return this},start:function(){this.paused=false;return this},ignoreField:function(A,B){A=$(A);if(A){this.enforceField(A);if(B){A.addClass("warnOnly")}else{A.addClass("ignoreValidation")}}return this},enforceField:function(A){A=$(A);if(A){A.removeClass("warnOnly").removeClass("ignoreValidation")}return this}});FormValidator.getMsg=function(A){return MooTools.lang.get("FormValidator",A)};FormValidator.adders={validators:{},add:function(B,A){this.validators[B]=new InputValidator(B,A);if(!this.initialize){this.implement({validators:this.validators})}},addAllThese:function(A){$A(A).each(function(B){this.add(B[0],B[1])},this)},getValidator:function(A){return this.validators[A.split(":")[0]]}};$extend(FormValidator,FormValidator.adders);FormValidator.implement(FormValidator.adders);FormValidator.add("IsEmpty",{errorMsg:false,test:function(A){if(A.type=="select-one"||A.type=="select"){return !(A.selectedIndex>=0&&A.options[A.selectedIndex].value!="")}else{return((A.get("value")==null)||(A.get("value").length==0))}}});FormValidator.addAllThese([["required",{errorMsg:function(){return FormValidator.getMsg("required")},test:function(A){return !FormValidator.getValidator("IsEmpty").test(A)}}],["minLength",{errorMsg:function(A,B){if($type(B.minLength)){return FormValidator.getMsg("minLength").substitute({minLength:B.minLength,length:A.get("value").length})}else{return""}},test:function(A,B){if($type(B.minLength)){return(A.get("value").length>=$pick(B.minLength,0))}else{return true}}}],["maxLength",{errorMsg:function(A,B){if($type(B.maxLength)){return FormValidator.getMsg("maxLength").substitute({maxLength:B.maxLength,length:A.get("value").length})}else{return""}},test:function(A,B){return(A.get("value").length<=$pick(B.maxLength,10000))}}],["validate-integer",{errorMsg:FormValidator.getMsg.pass("integer"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^-?[1-9]\d*$/).test(A.get("value"))}}],["validate-numeric",{errorMsg:FormValidator.getMsg.pass("numeric"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(A.get("value"))}}],["validate-digits",{errorMsg:FormValidator.getMsg.pass("digits"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^[\d() .:\-\+#]+$/.test(A.get("value")))}}],["validate-alpha",{errorMsg:FormValidator.getMsg.pass("alpha"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^[a-zA-Z]+$/).test(A.get("value"))}}],["validate-alphanum",{errorMsg:FormValidator.getMsg.pass("alphanum"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||!(/\W/).test(A.get("value"))}}],["validate-date",{errorMsg:function(A,B){if(Date.parse){var C=B.dateFormat||"%x";return FormValidator.getMsg("dateSuchAs").substitute({date:new Date().format(C)})}else{return FormValidator.getMsg("dateInFormatMDY")}},test:function(A,B){if(FormValidator.getValidator("IsEmpty").test(A)){return true}var F;if(Date.parse){var E=B.dateFormat||"%x";F=Date.parse(A.get("value"));var D=F.format(E);if(D!="invalid date"){A.set("value",D)}return !isNaN(F)}else{var C=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!C.test(A.get("value"))){return false}F=new Date(A.get("value").replace(C,"$1/$2/$3"));return(parseInt(RegExp.$1,10)==(1+F.getMonth()))&&(parseInt(RegExp.$2,10)==F.getDate())&&(parseInt(RegExp.$3,10)==F.getFullYear())}}}],["validate-email",{errorMsg:FormValidator.getMsg.pass("email"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i).test(A.get("value"))}}],["validate-url",{errorMsg:FormValidator.getMsg.pass("url"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(A.get("value"))}}],["validate-currency-dollar",{errorMsg:FormValidator.getMsg.pass("currencyDollar"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/).test(A.get("value"))}}],["validate-one-required",{errorMsg:FormValidator.getMsg.pass("oneRequired"),test:function(A,B){var C=$(B["validate-one-required"])||A.parentNode;return C.getElements("input").some(function(D){if(["checkbox","radio"].contains(D.get("type"))){return D.get("checked")}return D.get("value")})}}]]);Element.Properties.validator={set:function(A){var B=this.retrieve("validator");if(B){B.setOptions(A)}return this.store("validator:options")},get:function(A){if(A||!this.retrieve("validator")){if(A||!this.retrieve("validator:options")){this.set("validator",A)}this.store("validator",new FormValidator(this,this.retrieve("validator:options")))}return this.retrieve("validator")}};Element.implement({validate:function(A){this.set("validator",A);return this.get("validator",A).validate()}});FormValidator.Inline=new Class({Extends:FormValidator,options:{scrollToErrorsOnSubmit:true,scrollFxOptions:{offset:{y:-20}}},initialize:function(B,A){this.parent(B,A);this.addEvent("onElementValidate",function(G,F,E,H){var D=this.getValidator(E);if(!G&&D.getError(F)){if(H){F.addClass("warning")}var C=this.makeAdvice(E,F,D.getError(F),H);this.insertAdvice(C,F);this.showAdvice(E,F)}else{this.hideAdvice(E,F)}})},makeAdvice:function(D,F,C,G){var E=(G)?this.warningPrefix:this.errorPrefix;E+=(this.options.useTitles)?F.title||C:C;var A=(G)?"warning-advice":"validation-advice";var B=this.getAdvice(D,F);if(B){B=B.clone(true).set("html",E).replaces(B)}else{B=new Element("div",{html:E,styles:{display:"none"},id:"advice-"+D+"-"+this.getFieldId(F)}).addClass(A)}F.store("advice-"+D,B);return B},getFieldId:function(A){return A.id?A.id:A.id="input_"+A.name},showAdvice:function(B,C){var A=this.getAdvice(B,C);if(A&&!C.retrieve(this.getPropName(B))&&(A.getStyle("display")=="none"||A.getStyle("visiblity")=="hidden"||A.getStyle("opacity")==0)){C.store(this.getPropName(B),true);if(A.reveal){A.reveal()}else{A.setStyle("display","block")}}},hideAdvice:function(B,C){var A=this.getAdvice(B,C);if(A&&C.retrieve(this.getPropName(B))){C.store(this.getPropName(B),false);if(A.dissolve){A.dissolve()}else{A.setStyle("display","none")}}},getPropName:function(A){return"advice"+A},resetField:function(A){A=$(A);if(!A){return this}this.parent(A);A.className.split(" ").each(function(B){this.hideAdvice(B,A)},this);return this},getAllAdviceMessages:function(D,C){var B=[];if(D.hasClass("ignoreValidation")&&!C){return B}var A=D.className.split(" ").some(function(G){var E=G.test("^warn-")||D.hasClass("warnOnly");if(E){G=G.replace(/^warn-/,"")}var F=this.getValidator(G);if(!F){return }B.push({message:F.getError(D),warnOnly:E,passed:F.test(),validator:F})},this);return B},getAdvice:function(A,B){return B.retrieve("advice-"+A)},insertAdvice:function(A,C){var B=C.get("validatorProps");if(!B.msgPos||!$(B.msgPos)){if(C.type.toLowerCase()=="radio"){C.getParent().adopt(A)}else{A.inject($(C),"after")}}else{$(B.msgPos).grab(A)}},validate:function(H,G){var A=this.parent(H,G);if(this.options.scrollToErrorsOnSubmit&&!A){var C=$(this).getElement(".validation-failed");var E=$(this).getParent();var B=function(I){return I.getScrollSize().y!=I.getSize().y};var D;while(E!=document.body&&!B(E)){E=E.getParent()}var F=E.retrieve("fvScroller");if(!F&&window.Fx&&Fx.Scroll){F=new Fx.Scroll(E,{transition:"quad:out",offset:{y:-20}});E.store("fvScroller",F)}if(C){if(F){F.toElement(C)}else{E.scrollTo(E.getScroll().x,C.getPosition(E).y-20)}}}}});FormValidator.addAllThese([["validate-enforce-oncheck",{test:function(A,B){if(A.checked){var C=A.getParent("form").retrieve("validator");if(!C){return true}(B.toEnforce||$(B.enforceChildrenOf).getElements("input, select, textarea")).map(function(D){C.enforceField(D)})}return true}}],["validate-ignore-oncheck",{test:function(A,B){if(A.checked){var C=A.getParent("form").retrieve("validator");if(!C){return true}(B.toIgnore||$(B.ignoreChildrenOf).getElements("input, select, textarea")).each(function(D){C.ignoreField(D);C.resetField(D)})}return true}}],["validate-nospace",{errorMsg:function(){return FormValidator.getMsg("noSpace")},test:function(A,B){return !A.get("value").test(/\s/)}}],["validate-toggle-oncheck",{test:function(B,C){var D=B.getParent("form").retrieve("validator");if(!D){return true}var A=C.toToggle||$(C.toToggleChildrenOf).getElements("input, select, textarea");if(!B.checked){A.each(function(E){D.ignoreField(E);D.resetField(E)})}else{A.each(function(E){D.enforceField(E)})}return true}}],["validate-reqchk-bynode",{errorMsg:function(){return FormValidator.getMsg("reqChkByNode")},test:function(A,B){return($(B.nodeId).getElements(B.selector||"input[type=checkbox], input[type=radio]")).some(function(C){return C.checked})}}],["validate-required-check",{errorMsg:function(A,B){return B.useTitle?A.get("title"):FormValidator.getMsg("requiredChk")},test:function(A,B){return !!A.checked}}],["validate-reqchk-byname",{errorMsg:function(A,B){return FormValidator.getMsg("reqChkByName").substitute({label:B.label||A.get("type")})},test:function(B,D){var C=D.groupName||B.get("name");var A=$$(document.getElementsByName(C)).some(function(G,F){return G.checked});var E=B.getParent("form").retrieve("validator");if(A&&E){E.resetField(B)}return A}}],["validate-match",{errorMsg:function(A,B){return FormValidator.getMsg("match").substitute({matchName:B.matchName||$(B.matchInput).get("name")})},test:function(B,C){var D=B.get("value");var A=$(C.matchInput)&&$(C.matchInput).get("value");return D&&A?D==A:true}}],["validate-after-date",{errorMsg:function(A,B){return FormValidator.getMsg("afterDate").substitute({label:B.afterLabel||(B.afterElement?FormValidator.getMsg("startDate"):FormValidator.getMsg("currentDate"))})},test:function(B,C){var D=$(C.afterElement)?Date.parse($(C.afterElement).get("value")):new Date();var A=Date.parse(B.get("value"));return A&&D?A>=D:true}}],["validate-before-date",{errorMsg:function(A,B){return FormValidator.getMsg("beforeDate").substitute({label:B.beforeLabel||(B.beforeElement?FormValidator.getMsg("endDate"):FormValidator.getMsg("currentDate"))})},test:function(B,C){var D=Date.parse(B.get("value"));var A=$(C.beforeElement)?Date.parse($(C.beforeElement).get("value")):new Date();return A&&D?A>=D:true}}],["validate-custom-required",{errorMsg:function(){return FormValidator.getMsg("required")},test:function(A,B){return A.get("value")!=B.emptyValue}}],["validate-same-month",{errorMsg:function(A,B){var C=$(B.sameMonthAs)&&$(B.sameMonthAs).get("value");var D=A.get("value");if(D!=""){return FormValidator.getMsg(C?"sameMonth":"startMonth")}},test:function(A,B){var D=Date.parse(A.get("value"));var C=Date.parse($(B.sameMonthAs)&&$(B.sameMonthAs).get("value"));return D&&C?D.format("%B")==C.format("%B"):true}}]]);var OverText=new Class({Implements:[Options,Events,Class.Occlude],Binds:["reposition","assert","focus"],options:{positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},poll:false,pollInterval:250},property:"OverText",initialize:function(B,A){this.element=$(B);if(this.occlude()){return this.occluded}this.setOptions(A);this.attach(this.element);OverText.instances.push(this);if(this.options.poll){this.poll()}return this},toElement:function(){return this.element},attach:function(){var A=this.options.textOverride||this.element.get("alt")||this.element.get("title");if(!A){return }this.text=new Element("div",{"class":"overTxtDiv",styles:{lineHeight:"normal",position:"absolute"},html:A,events:{click:this.hide.pass(true,this)}}).inject(this.element,"after");this.element.addEvents({focus:this.focus,blur:this.assert,change:this.assert}).store("OverTextDiv",this.text);window.addEvent("resize",this.reposition.bind(this));this.assert();this.reposition()},startPolling:function(){this.pollingPaused=false;return this.poll()},poll:function(A){if(this.poller&&!A){return this}var B=function(){if(!this.pollingPaused){this.assert()}}.bind(this);if(A){$clear(this.poller)}else{this.poller=B.periodical(this.options.pollInterval,this)}return this},stopPolling:function(){this.pollingPaused=true;return this.poll(true)},focus:function(){if(!this.text.isDisplayed()||this.element.get("disabled")){return }this.hide()},hide:function(){if(this.text.isDisplayed()&&!this.element.get("disabled")){this.text.hide();this.fireEvent("textHide",[this.text,this.element]);this.pollingPaused=true;try{this.element.fireEvent("focus").focus()}catch(A){}}return this},show:function(){if(!this.text.isDisplayed()){this.text.show();this.reposition();this.fireEvent("textShow",[this.text,this.element]);this.pollingPaused=false}return this},assert:function(){this[this.test()?"show":"hide"]()},test:function(){var A=this.element.get("value");return !A},reposition:function(){try{this.assert();if(!this.element.getParent()||!this.element.offsetHeight){return this.hide()}if(this.test()){this.text.position($merge(this.options.positionOptions,{relativeTo:this.element}))}}catch(A){}return this}});OverText.instances=[];OverText.update=function(){return OverText.instances.map(function(A){if(A.element&&A.text){return A.reposition()}return null})};if(window.Fx&&Fx.Reveal){Fx.Reveal.implement({hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed, .overTxtDiv":false})}Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.subject=$$(B);this.parent(A)},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=this.parent(A[B],E[B],I)}}return C},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D],this.options.unit)}}return this},start:function(C){if(!this.check(C)){return this}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to}}return this.parent(H,I)}});var Accordion=Fx.Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false,trigger:"click",initialDisplayFx:true},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(C.elements,C.options);this.togglers=$$(C.togglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var B=0,A=this.togglers.length;B<A;B++){this.addSection(this.togglers[B],this.elements[B])}this.elements.each(function(E,D){if(this.options.show===D){this.fireEvent("active",[this.togglers[D],E])}else{for(var F in this.effects){E.setStyle(F,0)}}},this);if($chk(this.options.display)){this.display(this.options.display,this.options.initialDisplayFx)}},addSection:function(D,B){D=$(D);B=$(B);var E=this.togglers.contains(D);this.togglers.include(D);this.elements.include(B);var A=this.togglers.indexOf(D);D.addEvent(this.options.trigger,this.display.bind(this,A));if(this.options.height){B.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){B.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}B.fullOpacity=1;if(this.options.fixedWidth){B.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){B.fullHeight=this.options.fixedHeight}B.setStyle("overflow","hidden");if(!E){for(var C in this.effects){B.setStyle(C,0)}}return this},display:function(A,B){B=$pick(B,true);A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this}this.previous=A;var C={};this.elements.each(function(F,E){C[E]={};var D=(E!=A)||(this.options.alwaysHide&&(F.offsetHeight>0));this.fireEvent(D?"background":"active",[this.togglers[E],F]);for(var G in this.effects){C[E][G]=D?0:F[this.effects[G]]}},this);return B?this.start(C):this.set(C)}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(A){return this.parent(this.element.position($merge(this.options,A,{returnPos:true})))}});Element.Properties.move={set:function(A){var B=this.retrieve("move");if(B){B.cancel()}return this.eliminate("move").store("move:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("move")){if(A||!this.retrieve("move:options")){this.set("move",A)}this.store("move",new Fx.Move(this,this.retrieve("move:options")))}return this.retrieve("move")}};Element.implement({move:function(A){this.get("move").start(A);return this}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true;this.showing=false;this.hidden=true;var D=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var F=(this.element.style.height===""||this.element.style.height=="auto");this.element.setStyle("display","block");if(this.options.transitionOpacity){D.opacity=1}var B={};$each(D,function(H,G){B[G]=[H,0]},this);var E=this.element.getStyle("overflow");this.element.setStyle("overflow","hidden");var A=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false;$each(D,function(H,G){D[G]=H},this);this.element.setStyles($merge({display:"none",overflow:E},D));if(F){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(A){A.setStyle("visibility","visible")}}this.fireEvent("hide",this.element);this.callChain()}.bind(this));if(A){A.setStyle("visibility","hidden")}this.start(B)}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this))}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel();this.dissolve()}}}}catch(C){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("hide",this.element)}return this},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true;this.hiding=false;this.hidden=false;var F,D;this.element.measure(function(){F=(this.element.style.height===""||this.element.style.height=="auto");D=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode})}.bind(this));$each(D,function(H,G){D[G]=H});if($chk(this.options.heightOverride)){D.height=this.options.heightOverride.toInt()}if($chk(this.options.widthOverride)){D.width=this.options.widthOverride.toInt()}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);D.opacity=1}var B={height:0,display:this.options.display};$each(D,function(H,G){B[G]=0});var E=this.element.getStyle("overflow");this.element.setStyles($merge(B,{overflow:"hidden"}));var A=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;if(A){A.setStyle("visibility","hidden")}this.start(D);this.$chain.unshift(function(){this.element.setStyle("overflow",E);if(!this.options.heightOverride&&F){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(!this.hidden){this.showing=false}if(A){A.setStyle("visibility","visible")}this.callChain();this.fireEvent("show",this.element)}.bind(this))}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this))}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal()}}}}catch(C){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element);this.fireEvent("show",this.element)}return this},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal()}else{this.dissolve()}return this}});Element.Properties.reveal={set:function(A){var B=this.retrieve("reveal");if(B){B.cancel()}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},A))},get:function(A){if(A||!this.retrieve("reveal")){if(A||!this.retrieve("reveal:options")){this.set("reveal",A)}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options")))}return this.retrieve("reveal")}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(A){this.get("reveal",A).reveal();return this},dissolve:function(A){this.get("reveal",A).dissolve();return this},nix:function(){var A=Array.link(arguments,{destroy:Boolean.type,options:Object.type});this.get("reveal",A.options).dissolve().chain(function(){this[A.destroy?"destroy":"dispose"]()}.bind(this));return this},wink:function(){var B=Array.link(arguments,{duration:Number.type,options:Object.type});var A=this.get("reveal",B.options);A.reveal().chain(function(){(function(){A.dissolve()}).delay(B.duration||2000)})}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.element=this.subject=$(B);this.parent(A);var D=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var C=this.element;if(this.options.wheelStops){this.addEvent("start",function(){C.addEvent("mousewheel",D)},true);this.addEvent("complete",function(){C.removeEvent("mousewheel",D)},true)}},set:function(){var A=Array.flatten(arguments);this.element.scrollTo(A[0],A[1])},compute:function(C,B,A){return[0,1].map(function(D){return Fx.compute(C[D],B[D],A)})},start:function(C,H){if(!this.check(C,H)){return this}var E=this.element.getSize(),F=this.element.getScrollSize();var B=this.element.getScroll(),D={x:C,y:H};for(var G in D){var A=F[G]-E[G];if($chk(D[G])){D[G]=($type(D[G])=="number")?D[G].limit(0,A):A}else{D[G]=B[G]}D[G]+=this.options.offset[G]}return this.parent([B.x,B.y],[D.x,D.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(B){var A=$(B).getPosition(this.element);return this.start(A.x,A.y)}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper)}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);return this},compute:function(C,B,A){return[0,1].map(function(D){return Fx.compute(C[D],B[D],A)})},start:function(B,E){if(!this.check(B,E)){return this}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(C==0)?A:G}return this.parent(F[0],F[1])},slideIn:function(A){return this.start("in",A)},slideOut:function(A){return this.start("out",A)},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(A){return this.start("toggle",A)}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel()}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B))},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A)}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")))}return this.retrieve("slide")}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[C?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E)}if(!A){this.eliminate("slide:flag")}return this}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=C||document;this.doc=C.getDocument();var D=C.getWindow();this.parent(this.doc,B);this.links=this.options.links?$$(this.options.links):$$(this.doc.links);var A=D.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(F){if(F.href.indexOf(A)!=0){return }var E=F.href.substr(A.length);if(E){this.useLink(F,E)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){D.location.hash=this.anchor},true)}},useLink:function(C,A){var B;C.addEvent("click",function(D){if(B!==false&&!B){B=$(A)||this.doc.getElement("a[name="+A+"]")}if(B){D.preventDefault();this.anchor=A;this.toElement(B);C.blur()}}.bind(this))}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(B,A){this.parent(B,A);this.elements.each(function(C){if(C.getStyle("position")=="static"){C.setStyle("position","relative")}});this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(B,A){return A})},sort:function(E){if($type(E)!="array"){return false}var I=0;var A=0;var H={};var D=this.options.mode=="vertical";var F=this.elements.map(function(M,J){var L=M.getComputedSize({styles:["border","padding","margin"]});var N;if(D){N={top:I,margin:L["margin-top"],height:L.totalHeight};I+=N.height-L["margin-top"]}else{N={left:A,margin:L["margin-left"],width:L.totalWidth};A+=N.width}var K=D?"top":"left";H[J]={};var O=M.getStyle(K).toInt();H[J][K]=O||0;return N},this);this.set(H);E=E.map(function(J){return J.toInt()});if(E.length!=this.elements.length){this.currentOrder.each(function(J){if(!E.contains(J)){E.push(J)}});if(E.length>this.elements.length){E.splice(this.elements.length-1,E.length-this.elements.length)}}I=0;A=0;var B=0;var C={};E.each(function(L,J){var K={};if(D){K.top=I-F[L].top-B;I+=F[L].height}else{K.left=A-F[L].left;A+=F[L].width}B=B+F[L].margin;C[L]=K},this);var G={};$A(E).sort().each(function(J){G[J]=C[J]});this.start(G);this.currentOrder=E;return this},rearrangeDOM:function(A){A=A||this.currentOrder;var B=this.elements[0].getParent();var C=[];this.elements.setStyle("opacity",0);A.each(function(D){C.push(this.elements[D].inject(B).setStyles({top:0,left:0}))},this);this.elements.setStyle("opacity",1);this.elements=$$(C);this.setDefaultOrder();return this},getDefaultOrder:function(){return this.elements.map(function(B,A){return A})},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(A){return this.sort(A.map(function(B){return this.elements.indexOf(B)},this))},swap:function(C,B){if($type(C)=="element"){C=this.elements.indexOf(C)}if($type(B)=="element"){B=this.elements.indexOf(B)}var A=$A(this.currentOrder);A[this.currentOrder.indexOf(C)]=B;A[this.currentOrder.indexOf(B)]=C;this.sort(A)}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=((A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(C){if(this.options.preventDefault){C.preventDefault()}this.mouse.start=C.page;this.fireEvent("beforeStart",this.element);var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt()}else{this.value.now[D]=this.element[this.options.modifiers[D]]}if(this.options.invert){this.value.now[D]*=-1}this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])()}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(A){if(this.options.preventDefault){A.preventDefault()}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,A]).fireEvent("snap",this.element)}},drag:function(A){if(this.options.preventDefault){A.preventDefault()}this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1]}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0]}}}if(this.options.grid[B]){this.value.now[B]-=((this.value.now[B]-this.limit[B][0])%this.options.grid[B])}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}else{this.element[this.options.modifiers[B]]=this.value.now[B]}}this.fireEvent("drag",[this.element,A])},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(A){this.fireEvent("complete",[this.element,A])}}});Element.implement({makeResizable:function(A){var B=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},A));this.store("resizer",B);return B.addEvent("drag",function(){this.fireEvent("resize",B)}.bind(this))}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body)}var A=this.element.getStyle("position");if(A=="static"){A="absolute"}if([this.element.getStyle("left"),this.element.getStyle("top")].contains("auto")){this.element.position(this.element.getPosition(this.element.offsetParent))}this.element.setStyle("position",A);this.addEvent("start",this.checkDroppables,true);this.overed=null},start:function(F){if(this.container){var B=this.container.getCoordinates(this.element.getOffsetParent()),C={},E={};["top","right","bottom","left"].each(function(G){C[G]=this.container.getStyle("border-"+G).toInt();E[G]=this.element.getStyle("margin-"+G).toInt()},this);var D=this.element.offsetWidth+E.left+E.right;var A=this.element.offsetHeight+E.top+E.bottom;if(this.options.includeMargins){$each(E,function(H,G){E[G]=0})}if(this.container==this.element.getOffsetParent()){this.options.limit={x:[0-E.left,B.right-C.left-C.right-D+E.right],y:[0-E.top,B.bottom-C.top-C.bottom-A+E.bottom]}}else{this.options.limit={x:[B.left+C.left-E.left,B.right-C.right-D+E.right],y:[B.top+C.top-E.top,B.bottom-C.bottom-A+E.bottom]}}}if(this.options.precalculate){this.positions=this.droppables.map(function(G){return G.getCoordinates()})}this.parent(F)},checkAgainst:function(C,B){C=(this.positions)?this.positions[B]:C.getCoordinates();var A=this.mouse.now;return(A.x>C.left&&A.x<C.right&&A.y<C.bottom&&A.y>C.top)},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(A){this.fireEvent("enter",[this.element,A])}this.overed=A}},drag:function(A){this.parent(A);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables()}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,A]);this.overed=null;return this.parent(A)}});Element.implement({makeDraggable:function(A){var B=new Drag.Move(this,A);this.store("dragger",B);return B}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step)}this.knob.setStyle(this.property,A)},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(F,A,E){this.setOptions(E);this.element=$(F);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;var G,B={},D={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";G="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";G="offsetWidth"}this.half=this.knob[G]/2;this.full=this.element[G]-this.knob[G]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);D[this.axis]=this.property;B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.bound={clickedElement:this.clickedElement.bind(this),scrolledElement:this.scrolledElement.bindWithEvent(this),draggedKnob:this.draggedKnob.bind(this)};var C={snap:0,limit:B,modifiers:D,onDrag:this.bound.draggedKnob,onStart:this.bound.draggedKnob,onBeforeStart:(function(){this.isDragging=true}).bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end()}.bind(this)};if(this.options.snap){C.grid=Math.ceil(this.stepWidth);C.limit[this.axis][1]=this.full}this.drag=new Drag(this.knob,C);this.attach()},attach:function(){this.element.addEvent("mousedown",this.bound.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.bound.scrolledElement)}this.drag.attach();return this},detach:function(){this.element.removeEvent("mousedown",this.bound.clickedElement);this.element.removeEvent("mousewheel",this.bound.scrolledElement);this.drag.detach();return this},set:function(A){if(!((this.range>0)^(A<this.min))){A=this.min}if(!((this.range>0)^(A>this.max))){A=this.max}this.step=Math.round(A);this.checkStep();this.fireEvent("tick",this.toPosition(this.step));this.end();return this},clickedElement:function(C){if(this.isDragging||C.target==this.knob){return }var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.half;A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.fireEvent("tick",A);this.end()},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop()},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B},toPosition:function(A){return(this.full*Math.abs(this.min-A))/(this.steps*this.stepSize)-this.options.offset}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert))}},attach:function(){this.addLists(this.lists);return this},detach:function(){this.lists=this.removeLists(this.lists);return this},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B)},this);return this},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren())},this);return this},removeItems:function(){return $$(Array.flatten(arguments).map(function(A){this.elements.erase(A);var B=A.retrieve("sortables:start");(this.options.handle?A.getElement(this.options.handle)||A:A).removeEvent("mousedown",B);return A},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(A){this.lists.erase(A);this.removeItems(A.getChildren());return A},this))},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body)}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list)}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()))},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list)}return A.erase(this.clone).erase(this.element)},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables()}else{A=this.element.getAllPrevious().contains(B)?"before":"after"}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone])},start:function(B,A){if(!this.idle){return }this.idle=false;this.element=A;this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(B)},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");var B=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this))}else{this.reset()}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element)},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id")},this)},this);var A=C.index;if(this.lists.length==1){A=0}return $chk(A)&&A>=0&&A<this.lists.length?B[A]:B}});Request.JSONP=new Class({Implements:[Chain,Events,Options,Log],options:{url:"",data:{},retries:0,timeout:0,link:"ignore",callbackKey:"callback",injectScript:document.head},initialize:function(A){this.setOptions(A);this.running=false;this.requests=0;this.triesRemaining=[]},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(C){if(!$chk(arguments[1])&&!this.check(C)){return this}var E=$type(C),A=this.options,B=$chk(arguments[1])?arguments[1]:this.requests++;if(E=="string"||E=="element"){C={data:C}}C=$extend({data:A.data,url:A.url},C);if(!$chk(this.triesRemaining[B])){this.triesRemaining[B]=this.options.retries}var D=this.triesRemaining[B];(function(){var F=this.getScript(C);this.log("JSONP retrieving script with url: "+F.get("src"));this.fireEvent("request",F);this.running=true;(function(){if(D){this.triesRemaining[B]=D-1;if(F){F.destroy();this.request(C,B);this.fireEvent("retry",this.triesRemaining[B])}}else{if(F&&this.options.timeout){F.destroy();this.cancel();this.fireEvent("failure")}}}).delay(this.options.timeout,this)}).delay(Browser.Engine.trident?50:0,this);return this},cancel:function(){if(!this.running){return this}this.running=false;this.fireEvent("cancel");return this},getScript:function(C){var B=Request.JSONP.counter,D;Request.JSONP.counter++;switch($type(C.data)){case"element":D=$(C.data).toQueryString();break;case"object":case"hash":D=Hash.toQueryString(C.data)}var E=C.url+(C.url.test("\\?")?"&":"?")+(C.callbackKey||this.options.callbackKey)+"=Request.JSONP.request_map.request_"+B+(D?"&"+D:"");if(E.length>2083){this.log("JSONP "+E+" will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs")}var A=new Element("script",{type:"text/javascript",src:E});Request.JSONP.request_map["request_"+B]=function(F){this.success(F,A)}.bind(this);return A.inject(this.options.injectScript)},success:function(B,A){if(A){A.destroy()}this.running=false;this.log("JSONP successfully retrieved: ",B);this.fireEvent("complete",[B]).fireEvent("success",[B]).callChain()}});Request.JSONP.counter=0;Request.JSONP.request_map={};Request.Queue=new Class({Implements:[Options,Events],Binds:["attach","request","complete","cancel","success","failure","exception"],options:{stopOnFailure:true,autoAdvance:true,concurrent:1,requests:{}},initialize:function(A){this.setOptions(A);this.requests=new Hash;this.addRequests(this.options.requests);this.queue=[];this.reqBinders={}},addRequest:function(A,B){this.requests.set(A,B);this.attach(A,B);return this},addRequests:function(A){$each(A,this.addRequest,this);return this},getName:function(A){return this.requests.keyOf(A)},attach:function(A,B){if(B._groupSend){return this}["request","complete","cancel","success","failure","exception"].each(function(C){if(!this.reqBinders[A]){this.reqBinders[A]={}}this.reqBinders[A][C]=function(){this["on"+C.capitalize()].apply(this,[A,B].extend(arguments))}.bind(this);B.addEvent(C,this.reqBinders[A][C])},this);B._groupSend=B.send;B.send=function(C){this.send(A,C);return B}.bind(this);return this},removeRequest:function(B){var A=$type(B)=="object"?this.getName(B):B;if(!A&&$type(A)!="string"){return this}B=this.requests.get(A);if(!B){return this}["request","complete","cancel","success","failure","exception"].each(function(C){B.removeEvent(C,this.reqBinders[A][C])},this);B.send=B._groupSend;delete B._groupSend;return this},getRunning:function(){return this.requests.filter(function(A){return A.running})},isRunning:function(){return !!this.getRunning().getKeys().length},send:function(B,A){var C=function(){this.requests.get(B)._groupSend(A);this.queue.erase(C)}.bind(this);C.name=B;if(this.getRunning().getKeys().length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(C)}else{C()}return this},hasNext:function(A){return(!A)?!!this.queue.length:!!this.queue.filter(function(B){return B.name==A}).length},resume:function(){this.error=false;(this.options.concurrent-this.getRunning().getKeys().length).times(this.runNext,this);return this},runNext:function(A){if(!this.queue.length){return this}if(!A){this.queue[0]()}else{var B;this.queue.each(function(C){if(!B&&C.name==A){B=true;C()}})}return this},runAll:function(){this.queue.each(function(A){A()});return this},clear:function(A){if(!A){this.queue.empty()}else{this.queue=this.queue.map(function(B){if(B.name!=A){return B}else{return false}}).filter(function(B){return B})}return this},cancel:function(A){this.requests.get(A).cancel();return this},onRequest:function(){this.fireEvent("request",arguments)},onComplete:function(){this.fireEvent("complete",arguments)},onCancel:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("cancel",arguments)},onSuccess:function(){if(this.options.autoAdvance&&!this.error){this.runNext()}this.fireEvent("success",arguments)},onFailure:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("failure",arguments)},onException:function(){this.error=true;if(!this.options.stopOnFailure&&this.options.autoAdvance){this.runNext()}this.fireEvent("exception",arguments)}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(B){var A=(function(){if(!this.running){this.send({data:B})}});this.timer=A.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(C){$clear(this.timer);if(C){this.lastDelay=this.options.delay}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit)}this.timer=A.delay(this.lastDelay,this)};this.addEvent("complete",this.completeCheck);return this},stopTimer:function(){$clear(this.timer);this.removeEvent("complete",this.completeCheck);return this}});var Asset={javascript:function(F,D){D=$extend({onload:$empty,document:document,check:$lambda(true)},D);var B=new Element("script",{src:F,type:"text/javascript"});var E=D.onload.bind(B),A=D.check,G=D.document;delete D.onload;delete D.check;delete D.document;B.addEvents({load:E,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){E()}}}).set(D);if(Browser.Engine.webkit419){var C=(function(){if(!$try(A)){return }$clear(C);E()}).periodical(50)}return B.inject(G.head)},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head)},image:function(C,B){B=$merge({onload:$empty,onabort:$empty,onerror:$empty},B);var D=new Image();var A=$(D)||new Element("img");["load","abort","error"].each(function(E){var F="on"+E;var G=B[F];delete B[F];D[F]=function(){if(!D){return }if(!A.parentNode){A.width=D.width;A.height=D.height}D=D.onload=D.onabort=D.onerror=null;G.delay(1,A,A);A.fireEvent(E,A,1)}});D.src=A.src=C;if(D&&D.complete){D.onload.delay(1)}return A.set(B)},images:function(D,C){C=$merge({onComplete:$empty,onProgress:$empty},C);D=$splat(D);var A=[];var B=0;return new Elements(D.map(function(E){return Asset.image(E,{onload:function(){C.onProgress.call(this,B,D.indexOf(E));B++;if(B==D.length){C.onComplete()}}})}))}};var Color=new Native({initialize:function(B,C){if(arguments.length>=3){C="rgb";B=Array.slice(arguments,0,3)}else{if(typeof B=="string"){if(B.match(/rgb/)){B=B.rgbToHex().hexToRgb(true)}else{if(B.match(/hsb/)){B=B.hsbToRgb()}else{B=B.hexToRgb(true)}}}}C=C||"rgb";switch(C){case"hsb":var A=B;B=B.hsbToRgb();B.hsb=A;break;case"hex":B=B.hexToRgb(true);break}B.rgb=B.slice(0,3);B.hsb=B.hsb||B.rgbToHsb();B.hex=B.rgbToHex();return $extend(B,this)}});Color.implement({mix:function(){var A=Array.slice(arguments);var C=($type(A.getLast())=="number")?A.pop():50;var B=this.slice();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C))}});return new Color(B,"rgb")},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")}});var $RGB=function(C,B,A){return new Color([C,B,A],"rgb")};var $HSB=function(C,B,A){return new Color([C,B,A],"hsb")};var $HEX=function(A){return new Color(A,"hex")};Array.implement({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A}else{if(C==I){G=2+D-L}else{G=4+A-D}}G/=6;if(G<0){G++}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)]},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C]}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D]}}return false}});String.implement({rgbToHsb:function(){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHsb():null},hsbToRgb:function(){var A=this.match(/\d{1,3}/g);return(A)?A.hsbToRgb():null}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]))},this);return this},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false},this);if(!D){return }this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A)},this)}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(B,A){this.parent(B,A);this.load()},save:function(){var A=JSON.encode(this.hash);if(!A||A.length>4096){return false}if(A=="{}"){this.dispose()}else{this.write(A)}return true},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this}});Hash.each(Hash.prototype,function(B,A){if(typeof B=="function"){Hash.Cookie.implement(A,function(){var C=B.apply(this.hash,arguments);if(this.options.autoSave){this.save()}return C})}});var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:true||(Browser.Engine.trident4||(Browser.Engine.gecko&&!Browser.Engine.gecko19&&Browser.Platform.mac))},property:"IframeShim",initialize:function(B,A){this.element=$(B);if(this.occlude()){return this.occluded}this.setOptions(A);this.makeShim();return this},makeShim:function(){if(this.options.browsers){var C=this.element.getStyle("zIndex").toInt();if(!C){var B=this.element.getStyle("position");if(B=="static"||!B){this.element.setStyle("position","relative")}this.element.setStyle("zIndex",C||1)}C=($chk(this.options.zIndex)&&C>this.options.zIndex)?this.options.zIndex:C-1;if(C<0){C=1}this.shim=new Element("iframe",{src:(window.location.protocol=="https")?"://0":"javascript:void(0)",scrolling:"no",frameborder:0,styles:{zIndex:C,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this);var A=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject")}).bind(this);if(Browser.Engine.trident&&!IframeShim.ready){window.addEvent("load",A)}else{A()}}else{this.position=this.hide=this.show=this.dispose=$lambda(this)}},position:function(){if(!IframeShim.ready){return this}var A=this.element.measure(function(){return this.getSize()});if($type(this.options.margin)){A.x=A.x-(this.options.margin*2);A.y=A.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin}if(this.shim){this.shim.set({width:A.x,height:A.y}).position({relativeTo:this.element,offset:this.options.offset})}return this},hide:function(){if(this.shim){this.shim.setStyle("display","none")}return this},show:function(){if(this.shim){this.shim.setStyle("display","block")}return this.position()},dispose:function(){if(this.shim){this.shim.dispose()}return this},destroy:function(){if(this.shim){this.shim.destroy()}return this}});window.addEvent("load",function(){IframeShim.ready=true});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)},fps:50},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.listener=($type(this.element)!="element")?$(this.element.getDocument().body):this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)}},start:function(){this.listener.addEvents({mouseenter:this.bound.attach,mouseleave:this.bound.detach})},stop:function(){this.listener.removeEvents({mouseenter:this.bound.attach,mouseleave:this.bound.detach});this.timer=$clear(this.timer)},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords)},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);this.timer=$clear(this.timer)},getCoords:function(A){this.page=(this.listener.get("tag")=="body")?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this)}},scroll:function(){var B=this.element.getSize(),A=this.element.getScroll(),F=this.element.getOffsets(),C=this.element.getScrollSize(),E={x:0,y:0};for(var D in this.page){if(this.page[D]<(this.options.area+F[D])&&A[D]!=0){E[D]=(this.page[D]-this.options.area-F[D])*this.options.velocity}else{if(this.page[D]+this.options.area>(B[D]+F[D])&&A[D]+B[D]!=C[D]){E[D]=(this.page[D]-B[D]+this.options.area-F[D])*this.options.velocity}}}if(E.y||E.x){this.fireEvent("change",[A.x+E.x,A.y+E.y])}}});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(A){A.setStyle("visibility","visible")},onHide:function(A){A.setStyle("visibility","hidden")},title:"title",text:function(A){return A.get("rel")||A.get("href")},showDelay:100,hideDelay:100,className:null,offset:{x:16,y:16},fixed:false},initialize:function(){var A=Array.link(arguments,{options:Object.type,elements:$defined});if(A.options&&A.options.offsets){A.options.offset=A.options.offsets}this.setOptions(A.options);this.container=new Element("div",{"class":"tip"});this.tip=this.getTip();if(A.elements){this.attach(A.elements)}},getTip:function(){return new Element("div",{"class":this.options.className,styles:{visibility:"hidden",display:"none",position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body)},attach:function(B){var A=function(D,C){if(D==null){return""}return $type(D)=="function"?D(C):C.get(D)};$$(B).each(function(D){var E=A(this.options.title,D);D.erase("title").store("tip:native",E).retrieve("tip:title",E);D.retrieve("tip:text",A(this.options.text,D));var C=["enter","leave"];if(!this.options.fixed){C.push("move")}C.each(function(F){D.addEvent("mouse"+F,D.retrieve("tip:"+F,this["element"+F.capitalize()].bindWithEvent(this,D)))},this)},this);return this},detach:function(A){$$(A).each(function(C){["enter","leave","move"].each(function(D){C.removeEvent("mouse"+D,C.retrieve("tip:"+D)||$empty)});C.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");if($type(this.options.title)=="string"&&this.options.title=="title"){var B=C.retrieve("tip:native");if(B){C.set("title",B)}}},this);return this},elementEnter:function(B,A){$A(this.container.childNodes).each(Element.dispose);["title","text"].each(function(D){var C=A.retrieve("tip:"+D);if(!C){return }this[D+"Element"]=new Element("div",{"class":"tip-"+D}).inject(this.container);this.fill(this[D+"Element"],C)},this);this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this,A);this.tip.setStyle("display","block");this.position((!this.options.fixed)?B:{page:A.getPosition()})},elementLeave:function(B,A){$clear(this.timer);this.tip.setStyle("display","none");this.timer=this.hide.delay(this.options.hideDelay,this,A)},elementMove:function(A){this.position(A)},position:function(D){var B=window.getSize(),A=window.getScroll(),E={x:this.tip.offsetWidth,y:this.tip.offsetHeight},C={x:"left",y:"top"},F={};for(var G in C){F[C[G]]=D.page[G]+this.options.offset[G];if((F[C[G]]+E[G]-A[G])>B[G]){F[C[G]]=D.page[G]-this.options.offset[G]-E[G]}}this.tip.setStyles(F)},fill:function(A,B){if(typeof B=="string"){A.set("html",B)}else{A.adopt(B)}},show:function(A){this.fireEvent("show",[this.tip,A])},hide:function(A){this.fireEvent("hide",[this.tip,A])}});MooTools.lang.set("en-US","Date",{months:["January","February","March","April","May","June","July","August","September","October","November","December"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dateOrder:["month","date","year"],shortDate:"%m/%d/%Y",shortTime:"%I:%M%p",AM:"AM",PM:"PM",ordinal:function(A){return(A>3&&A<21)?"th":["th","st","nd","rd","th"][Math.min(A%10,4)]},lessThanMinuteAgo:"less than a minute ago",minuteAgo:"about a minute ago",minutesAgo:"{delta} minutes ago",hourAgo:"about an hour ago",hoursAgo:"about {delta} hours ago",dayAgo:"1 day ago",daysAgo:"{delta} days ago",lessThanMinuteUntil:"less than a minute from now",minuteUntil:"about a minute from now",minutesUntil:"{delta} minutes from now",hourUntil:"about an hour from now",hoursUntil:"about {delta} hours from now",dayUntil:"1 day from now",daysUntil:"{delta} days from now"});MooTools.lang.set("en-US","FormValidator",{required:"This field is required.",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use letters only (a-z) with in this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".',url:"Please enter a valid URL such as http://www.google.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: ",noSpace:"There can be no spaces in this input.",reqChkByNode:"No items are selected.",requiredChk:"This field is required.",reqChkByName:"Please select a {label}.",match:"This field needs to match the {matchName} field",startDate:"the start date",endDate:"the end date",currendDate:"the current date",afterDate:"The date should be the same or after {label}.",beforeDate:"The date should be the same or before {label}.",startMonth:"Please select a start month",sameMonth:"These two dates must be in the same month - you must change one or the other."});window.addEvent("load",function(){if(!("console" in window)||!("firebug" in window.console)){var B=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var A=0;A<B.length;++A){window.console[B[A]]=function(){}}}});Class.Mutators.Family=function(A,B){if($defined(B)){A.$family={name:B};$[B]=$.object;return A}else{this.implement("$family",{name:A})}};if(typeof Jx=="undefined"){var Jx={};(function(){var C=document.getElementsByTagName("SCRIPT");for(var A=0;A<C.length;A++){var B=C[A].src;var D=/(.*[jx|js|lib])\/jxlib(.*)/.exec(B);if(D&&D[0]){Jx.aPixel=document.createElement("img",{alt:"",title:""});Jx.aPixel.src=D[1]+"/a_pixel.png";Jx.baseURL=Jx.aPixel.src.substring(0,Jx.aPixel.src.indexOf("a_pixel.png"))}}var E=C[0].src;if(E.contains("app:")){Jx.isAir=true}else{Jx.isAir=false}})()}Jx.applyPNGFilter=function(C){var A=Jx.aPixel.src;if(C.src!=A){var B=C.src;C.src=A;C.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+B+"',sizingMethod='scale')"}};Jx.imgQueue=[];Jx.imgLoaded={};Jx.imagesLoading=0;Jx.addToImgQueue=function(A){if(Jx.imgLoaded[A.src]){A.element.src=A.src}else{Jx.imgQueue.push(A);Jx.imgLoaded[A.src]=true}Jx.checkImgQueue()};Jx.checkImgQueue=function(){while(Jx.imagesLoading<2&&Jx.imgQueue.length>0){Jx.loadNextImg()}};Jx.loadNextImg=function(){var A=Jx.imgQueue.shift();if(A){++Jx.imagesLoading;A.element.onload=function(){--Jx.imagesLoading;Jx.checkImgQueue()};A.element.onerror=function(){--Jx.imagesLoading;Jx.checkImgQueue()};A.element.src=A.src}};Jx.createIframeShim=function(){return new Element("iframe",{"class":"jxIframeShim",scrolling:"no",frameborder:0})};Jx.getNumber=function(C,B){var A=C===null||isNaN(parseInt(C,10))?(B||0):parseInt(C,10);return A};Jx.getPageDimensions=function(){return{width:window.getWidth(),height:window.getHeight()}};Element.implement({getBoxSizing:function(){var B="content-box";if(Browser.Engine.trident||Browser.Engine.presto){var A=document.compatMode;if(A=="BackCompat"||A=="QuirksMode"){B="border-box"}else{B="content-box"}}else{if(arguments.length===0){node=document.documentElement}var C=this.getStyle("-moz-box-sizing");if(!C){C=this.getStyle("box-sizing")}B=(C?C:"content-box")}return B},getContentBoxSize:function(){var A=this.offsetWidth;var C=this.offsetHeight;var D=this.getPaddingSize();var B=this.getBorderSize();A=A-D.left-D.right-B.left-B.right;C=C-D.bottom-D.top-B.bottom-B.top;return{width:A,height:C}},getBorderBoxSize:function(){var A=this.offsetWidth;var B=this.offsetHeight;return{width:A,height:B}},getMarginBoxSize:function(){var C=this.getMarginSize();var A=this.offsetWidth+C.left+C.right;var B=this.offsetHeight+C.top+C.bottom;return{width:A,height:B}},setContentBoxSize:function(C){if(this.getBoxSizing()=="border-box"){var E=this.getPaddingSize();var B=this.getBorderSize();if(typeof C.width!="undefined"){var D=(C.width+E.left+E.right+B.left+B.right);if(D<0){D=0}this.style.width=D+"px"}if(typeof C.height!="undefined"){var A=(C.height+E.top+E.bottom+B.top+B.bottom);if(A<0){A=0}this.style.height=A+"px"}}else{if(typeof C.width!="undefined"){this.style.width=C.width+"px"}if(typeof C.height!="undefined"){this.style.height=C.height+"px"}}},setBorderBoxSize:function(C){if(this.getBoxSizing()=="content-box"){var F=this.getPaddingSize();var B=this.getBorderSize();var E=this.getMarginSize();if(typeof C.width!="undefined"){var D=(C.width-F.left-F.right-B.left-B.right-E.left-E.right);if(D<0){D=0}this.style.width=D+"px"}if(typeof C.height!="undefined"){var A=(C.height-F.top-F.bottom-B.top-B.bottom-E.top-E.bottom);if(A<0){A=0}this.style.height=A+"px"}}else{if(typeof C.width!="undefined"&&C.width>=0){this.style.width=C.width+"px"}if(typeof C.height!="undefined"&&C.height>=0){this.style.height=C.height+"px"}}},getPaddingSize:function(){var B=Jx.getNumber(this.getStyle("padding-left"));var C=Jx.getNumber(this.getStyle("padding-top"));var D=Jx.getNumber(this.getStyle("padding-right"));var A=Jx.getNumber(this.getStyle("padding-bottom"));return{left:B,top:C,right:D,bottom:A}},getBorderSize:function(){var B=Jx.getNumber(this.getStyle("border-left-width"));var C=Jx.getNumber(this.getStyle("border-top-width"));var D=Jx.getNumber(this.getStyle("border-right-width"));var A=Jx.getNumber(this.getStyle("border-bottom-width"));return{left:B,top:C,right:D,bottom:A}},getMarginSize:function(){var B=Jx.getNumber(this.getStyle("margin-left"));var C=Jx.getNumber(this.getStyle("margin-top"));var D=Jx.getNumber(this.getStyle("margin-right"));var A=Jx.getNumber(this.getStyle("margin-bottom"));return{left:B,top:C,right:D,bottom:A}},descendantOf:function(B){var A=$(this.parentNode);while(A!=B&&A&&A.parentNode&&A.parentNode!=A){A=$(A.parentNode)}return A==B},findElement:function(B){var C=this;var A=C.tagName;while(C.tagName!=B&&C&&C.parentNode&&C.parentNode!=C){C=$(C.parentNode)}return C.tagName==B?C:false}});Jx.ContentLoader=new Class({contentIsLoaded:false,loadContent:function(A){A=$(A);if(this.options.content){var C;if(this.options.content.domObj){C=$(this.options.content.domObj)}else{C=$(this.options.content)}if(C){if(this.options.content.addTo){this.options.content.addTo(A)}else{A.appendChild(C)}this.contentIsLoaded=true}else{A.innerHTML=this.options.content;this.contentIsLoaded=true}}else{if(this.options.contentURL){this.contentIsLoaded=false;this.req=new Request({url:this.options.contentURL,method:"get",evalScripts:true,onSuccess:(function(D){A.innerHTML=D;this.contentIsLoaded=true;if(Jx.isAir){$clear(this.reqTimeout)}this.fireEvent("contentLoaded",this)}).bind(this),onFailure:(function(){this.contentIsLoaded=true;this.fireEvent("contentLoadFailed",this)}).bind(this),headers:{"If-Modified-Since":"Sat, 1 Jan 2000 00:00:00 GMT"}});this.req.send();if(Jx.isAir){var B=$defined(this.options.timeout)?this.options.timeout:10000;this.reqTimeout=this.checkRequest.delay(B,this)}}else{this.contentIsLoaded=true}}if(this.options.contentId){A.id=this.options.contentId}if(this.contentIsLoaded){this.fireEvent("contentLoaded",this)}},processContent:function(A){$A(A.childNodes).each(function(B){if(B.tagName=="INPUT"||B.tagName=="SELECT"||B.tagName=="TEXTAREA"){if(B.type=="button"){B.addEvent("click",function(){this.fireEvent("click",this,B)})}else{B.addEvent("change",function(){this.fireEvent("change",B)})}}else{if(B.childNodes){this.processContent(B)}}},this)}});if(Jx.isAir){Jx.ContentLoader.implement({checkRequest:function(){if(this.req.xhr.readyState===1){$clear(this.reqTimeout);this.req.cancel();this.contentIsLoaded=true;this.fireEvent("contentLoadFailed",this)}}})}Jx.AutoPosition=new Class({position:function(G,C,P){G=$(G);C=$(C);var B=$splat(P.horizontal||["center center"]);var H=$splat(P.vertical||["center center"]);var F=$merge({top:0,right:0,bottom:0,left:0},P.offsets||{});var M=C.getCoordinates();var J;var L;if(!$(G.parentNode)||G.parentNode==document.body){J=Jx.getPageDimensions();L=$(document.body).getScroll()}else{J=$(G.parentNode).getContentBoxSize();L=$(G.parentNode).getScroll()}if(C==document.body){M.left+=L.x;M.top+=L.y}else{if(G.parentNode==C){M.left=0;M.top=0}}var O=G.getMarginBoxSize();var E;var N;var K;var A;var D;if(!B.some(function(Q){var R=Q.split(" ");if(R.length!=2){return false}if(!isNaN(parseInt(R[0],10))){D=parseInt(R[0],10);if(D>=0){E=D}else{E=M.left+M.width+D}}else{switch(R[0]){case"right":E=M.left+M.width;break;case"center":E=M.left+Math.round(M.width/2);break;case"left":default:E=M.left;break}}if(!isNaN(parseInt(R[1],10))){D=parseInt(R[1],10);if(D<0){N=E+D;E=N-O.width}else{E+=D;N=E+O.width}N=M.left+M.width+parseInt(R[1],10);E=N-O.width}else{switch(R[1]){case"left":E-=F.left;N=E+O.width;break;case"right":E+=F.right;N=E;E=E-O.width;break;case"center":default:E=E-Math.round(O.width/2);N=E+O.width;break}}return(E>=L.x&&N<=L.x+J.width)})){if(N>J.width){E=L.x+J.width-O.width}if(E<0){E=0}}G.setStyle("left",E);if(!H.some(function(Q){var R=Q.split(" ");if(R.length!=2){return false}if(!isNaN(parseInt(R[0],10))){K=parseInt(R[0],10)}else{switch(R[0]){case"bottom":K=M.top+M.height;break;case"center":K=M.top+Math.round(M.height/2);break;case"top":default:K=M.top;break}}if(!isNaN(parseInt(R[1],10))){var S=parseInt(R[1],10);if(S>=0){K+=S;A=K+O.height}else{A=K+S;K=A-O.height}}else{switch(R[1]){case"top":K-=F.top;A=K+O.height;break;case"bottom":K+=F.bottom;A=K;K=K-O.height;break;case"center":default:K=K-Math.round(O.height/2);A=K+O.height;break}}return(K>=L.y&&A<=L.y+J.height)})){if(A>J.height){K=L.y+J.height-O.height}if(K<0){K=0}}G.setStyle("top",K);var I=G.retrieve("jxLayout");if(I){I.options.left=E;I.options.top=K}}});Jx.Chrome=new Class({chrome:null,makeChrome:function(A){var C=new Element("div",{"class":"jxChrome",events:{contextmenu:function(D){D.stop()}}});A.adopt(C);this.chromeOffsets=C.getPaddingSize();C.setStyle("padding",0);var B=C.getStyle("backgroundImage");if(B!=null){if(!(B.contains("http://")||B.contains("https://")||B.contains("file://")||B.contains("app:/"))){B=null}else{B=B.slice(4,-1);if(B.charAt(0)=='"'){B=B.slice(1,-1)}C.setStyle("backgroundImage","none");["TR","TL","BL","BR"].each(function(D){C.adopt(new Element("div",{"class":"jxChrome"+D}).adopt(new Element("img",{"class":"png24",src:B,alt:"",title:""})))},this)}}if(!window.opera){C.adopt(Jx.createIframeShim())}C.dispose();this.chrome=C},showChrome:function(A){A=$(A);if(!this.chrome){this.makeChrome(A)}this.resizeChrome(A);if(A&&this.chrome.parentNode!==A){A.adopt(this.chrome)}},hideChrome:function(){if(this.chrome){this.chrome.dispose()}},resizeChrome:function(A){if(this.chrome&&Browser.Engine.trident){this.chrome.setContentBoxSize($(A).getBorderBoxSize())}}});Jx.Addable=new Class({addable:null,addTo:function(A,B){$(this.addable||this.domObj).inject(A,B);this.fireEvent("addTo",this);return this},toElement:function(){return this.addable||this.domObj}});Jx.Button=new Class({Family:"Jx.Button",Implements:[Options,Events,Jx.Addable],domObj:null,options:{id:"",type:"Button",image:"",tooltip:"",label:"",toggle:false,toggleClass:"Toggle",halign:"center",valign:"middle",active:false,enabled:true,container:"div"},initialize:function(D){this.setOptions(D);var H=new Element(this.options.container,{"class":"jx"+this.options.type+"Container"});if(this.options.toggle&&this.options.toggleClass){H.addClass("jx"+this.options.type+this.options.toggleClass)}var G;var A;var C=new Element("a",{"class":"jx"+this.options.type,href:"javascript:void(0)",title:this.options.tooltip,alt:this.options.tooltip,events:{click:this.clicked.bindWithEvent(this),drag:(function(I){I.stop()}).bindWithEvent(this),mousedown:(function(I){this.domA.addClass("jx"+this.options.type+"Pressed");G=true;A=true;this.focus()}).bindWithEvent(this),mouseup:(function(I){this.domA.removeClass("jx"+this.options.type+"Pressed");A=false}).bindWithEvent(this),mouseleave:(function(I){this.domA.removeClass("jx"+this.options.type+"Pressed")}).bindWithEvent(this),mouseenter:(function(I){if(G&&A){this.domA.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keydown:(function(I){if(I.key=="enter"){this.domA.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keyup:(function(I){if(I.key=="enter"){this.domA.removeClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),blur:function(){G=false}}});H.adopt(C);if(typeof Drag!="undefined"){new Drag(C,{onStart:function(){this.stop()}})}var F=new Element("span",{"class":"jx"+this.options.type+"Content"});C.adopt(F);if(this.options.image||!this.options.label){var E=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,title:this.options.tooltip,alt:this.options.tooltip});if(this.options.image&&this.options.image.indexOf("a_pixel.png")==-1){E.setStyle("backgroundImage","url("+this.options.image+")")}F.appendChild(E);if(this.options.imageClass){E.addClass(this.options.imageClass)}this.domImg=E}var B=new Element("span",{html:this.options.label});if(this.options.label){B.addClass("jx"+this.options.type+"Label")}F.appendChild(B);if(this.options.id){H.id=this.options.id}if(this.options.halign=="left"){H.addClass("jx"+this.options.type+"ContentLeft")}if(this.options.valign=="top"){H.addClass("jx"+this.options.type+"ContentTop")}this.domA=C;this.domLabel=B;this.domObj=H;this.setEnabled(this.options.enabled);if(this.options.active){this.options.active=false;this.setActive(true)}},clicked:function(A){if(this.options.enabled){if(this.options.toggle){this.setActive(!this.options.active)}else{this.fireEvent("click",{obj:this,event:A})}}},isEnabled:function(){return this.options.enabled},setEnabled:function(A){this.options.enabled=A;if(this.options.enabled){this.domObj.removeClass("jxDisabled")}else{this.domObj.addClass("jxDisabled")}},isActive:function(){return this.options.active},setActive:function(A){if(this.options.active==A){return }this.options.active=A;if(this.options.active){this.domA.addClass("jx"+this.options.type+"Active");this.fireEvent("down",this)}else{this.domA.removeClass("jx"+this.options.type+"Active");this.fireEvent("up",this)}},setImage:function(B){this.options.image=B;if(B){if(!this.domImg){var A=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.imageClass){A.addClass(this.options.imageClass)}this.domA.firstChild.grab(A,"top");this.domImg=A}this.domImg.setStyle("backgroundImage","url("+this.options.image+")")}else{if(this.domImg){this.domImg.dispose();this.domImg=null}}},setLabel:function(A){this.domLabel.set("html",A);if(!A&&this.domLabel.hasClass("jxButtonLabel")){this.domLabel.removeClass("jxButtonLabel")}else{if(A&&!this.domLabel.hasClass("jxButtonLabel")){this.domLabel.addClass("jxButtonLabel")}}},getLabel:function(){return this.domLabel?this.domLabel.innerHTML:""},setTooltip:function(A){if(this.domA){this.domA.set({title:A,alt:A})}},focus:function(){this.domA.focus()},blur:function(){this.domA.blur()}});Jx.Button.Flyout=new Class({Family:"Jx.Button.Flyout",Extends:Jx.Button,Implements:[Jx.ContentLoader,Jx.AutoPosition,Jx.Chrome],content:null,initialize:function(A){if(!Jx.Button.Flyout.Stack){Jx.Button.Flyout.Stack=[]}this.parent(A);this.domA.addClass("jx"+this.options.type+"Flyout");this.contentContainer=new Element("div",{"class":"jxFlyout"});this.content=new Element("div",{"class":"jxFlyoutContent"});if(this.options.contentClass){this.content.addClass(this.options.contentClass)}this.contentContainer.adopt(this.content);this.content.store("jxFlyout",this);this.loadContent(this.content);this.keypressWatcher=this.keypressHandler.bindWithEvent(this);this.hideWatcher=this.clickHandler.bindWithEvent(this)},clicked:function(C){if(!this.options.enabled){return }if(!this.owner){this.owner=document.body;var B=$(this.domObj.parentNode);while(B!=document.body&&this.owner==document.body){var A=B.retrieve("jxFlyout");if(A){this.owner=A;break}else{B=$(B.parentNode)}}}if(Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1]==this){this.hide();return }else{if(this.owner!=document.body){if(this.owner.currentFlyout==this){this.hide();return }else{if(this.owner.currentFlyout){this.owner.currentFlyout.hide()}}this.owner.currentFlyout=this}else{while(Jx.Button.Flyout.Stack.length){Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1].hide()}}}Jx.Button.Flyout.Stack.push(this);this.options.active=true;this.domA.addClass("jx"+this.options.type+"Active");this.contentContainer.setStyle("visibility","hidden");$(document.body).adopt(this.contentContainer);this.content.getChildren().each(function(D){if(D.resize){D.resize()}});this.showChrome(this.contentContainer);this.position(this.contentContainer,this.domObj,{horizontal:["left left","right right"],vertical:["bottom top","top bottom"],offsets:this.chromeOffsets});this.contentContainer.setContentBoxSize($(this.content).getMarginBoxSize());this.contentContainer.setStyle("visibility","");document.addEvent("keydown",this.keypressWatcher);document.addEvent("click",this.hideWatcher);this.fireEvent("open",this)},hide:function(){if(this.owner!=document.body){this.owner.currentFlyout=null}Jx.Button.Flyout.Stack.pop();this.setActive(false);this.contentContainer.dispose();document.removeEvent("keydown",this.keypressWatcher);document.removeEvent("click",this.hideWatcher);this.fireEvent("close",this)},clickHandler:function(B){B=new Event(B);var C=$(B.target);var A=Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1];if(!C.descendantOf(A.content)&&!C.descendantOf(A.domObj)){A.hide()}},keypressHandler:function(A){A=new Event(A);if(A.key=="esc"){Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1].hide()}}});Jx.Layout=new Class({Family:"Jx.Layout",Implements:[Options,Events],options:{propagate:true,position:"absolute",left:0,right:0,top:0,bottom:0,width:null,height:null,minWidth:0,minHeight:0,maxWidth:-1,maxHeight:-1},initialize:function(B,A){this.setOptions(A);this.domObj=$(B);this.domObj.resize=this.resize.bind(this);this.domObj.setStyle("position",this.options.position);this.domObj.store("jxLayout",this);if(document.body==this.domObj.parentNode){window.addEvent("resize",this.windowResize.bindWithEvent(this));window.addEvent("load",this.windowResize.bind(this))}},windowResize:function(){this.resize();if(this.resizeTimer){$clear(this.resizeTimer);this.resizeTimer=null}this.resizeTimer=this.resize.delay(50,this)},resize:function(K){this.resizeTimer=null;var B=false;if(K){for(var F in K){if(F=="forceResize"){continue}if(this.options[F]!=K[F]){B=true;this.options[F]=K[F]}}if(K.forceResize){B=true}}if(!$(this.domObj.parentNode)){return }var C;if(this.domObj.parentNode.tagName=="BODY"){C=Jx.getPageDimensions()}else{C=$(this.domObj.parentNode).getContentBoxSize()}if(this.lastParentSize&&!B){B=(this.lastParentSize.width!=C.width||this.lastParentSize.height!=C.height)}else{B=true}this.lastParentSize=C;if(!B){return }var D,J,I,G;if(this.options.left!=null){D=this.options.left;if(this.options.right==null){if(this.options.width==null){I=C.width-D;if(I<this.options.minWidth){I=this.options.minWidth}if(this.options.maxWidth>=0&&I>this.options.maxWidth){I=this.options.maxWidth}}else{I=this.options.width}}else{if(this.options.width==null){I=C.width-D-this.options.right;if(I<this.options.minWidth){I=this.options.minWidth}if(this.options.maxWidth>=0&&I>this.options.maxWidth){I=this.options.maxWidth}}else{I=this.options.width}}}else{if(this.options.right==null){if(this.options.width==null){D=0;I=C.width;if(this.options.maxWidth>=0&&I>this.options.maxWidth){D=D+parseInt(I-this.options.maxWidth)/2;I=this.options.maxWidth}}else{I=this.options.width;D=parseInt((C.width-I)/2);if(D<0){D=0}}}else{if(this.options.width!=null){I=this.options.width;D=C.width-I-this.options.right;if(D<0){D=0}}else{D=0;I=C.width-this.options.right;if(I<this.options.minWidth){I=this.options.minWidth}if(this.options.maxWidth>=0&&I>this.options.maxWidth){D=I-this.options.maxWidth-this.options.right;I=this.options.maxWidth}}}}if(this.options.top!=null){J=this.options.top;if(this.options.bottom==null){if(this.options.height==null){G=C.height-J;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){G=this.options.maxHeight}}else{G=this.options.height;if(this.options.maxHeight>=0&&G>this.options.maxHeight){J=G-this.options.maxHeight;G=this.options.maxHeight}}}else{if(this.options.height==null){G=C.height-J-this.options.bottom;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){G=this.options.maxHeight}}else{G=this.options.height}}}else{if(this.options.bottom==null){if(this.options.height==null){J=0;G=C.height;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){J=parseInt((C.height-this.options.maxHeight)/2);G=this.options.maxHeight}}else{G=this.options.height;J=parseInt((C.height-G)/2);if(J<0){J=0}}}else{if(this.options.height!=null){G=this.options.height;J=C.height-G-this.options.bottom;if(J<0){J=0}}else{J=0;G=C.height-this.options.bottom;if(G<this.options.minHeight){G=this.options.minHeight}if(this.options.maxHeight>=0&&G>this.options.maxHeight){J=C.height-this.options.maxHeight-this.options.bottom;G=this.options.maxHeight}}}}var E={width:I};if(this.options.position=="absolute"){var H=$(this.domObj.parentNode).getPaddingSize();this.domObj.setStyles({position:this.options.position,left:D+H.left,top:J+H.top});E.height=G}else{if(this.options.height){E.height=this.options.height}}this.domObj.setBorderBoxSize(E);if(this.options.propagate){var A={forceResize:K?K.forceResize:false};$A(this.domObj.childNodes).each(function(L){if(L.resize&&L.getStyle("display")!="none"){L.resize.delay(0,L,A)}})}this.fireEvent("sizeChange",this)}});Jx.Button.Tab=new Class({Family:"Jx.Button.Tab",Extends:Jx.Button,Implements:[Jx.ContentLoader],content:null,initialize:function(B){this.parent($merge(B,{type:"Tab",toggle:true}));this.content=new Element("div",{"class":"tabContent"});new Jx.Layout(this.content,B);this.loadContent(this.content);var C=this;this.addEvent("down",function(){C.content.addClass("tabContentActive")});this.addEvent("up",function(){C.content.removeClass("tabContentActive")});if(this.options.close){this.domObj.addClass("jxTabClose");var A=new Element("a",{"class":"jxTabClose",events:{click:(function(){this.fireEvent("close")}).bind(this)}});A.adopt(new Element("img",{src:Jx.aPixel.src,alt:"",title:""}));this.domObj.adopt(A)}},clicked:function(A){if(this.options.enabled){this.setActive(true)}}});Jx.ColorPalette=new Class({Family:"Jx.ColorPalette",Implements:[Options,Events,Jx.Addable],domObj:null,options:{parent:null,color:"#000000",alpha:1,hexColors:["00","33","66","99","CC","FF"],alphaLabel:"alpha (%)"},initialize:function(C){this.setOptions(C);this.domObj=new Element("div",{id:this.options.id,"class":"jxColorPalette"});var H=new Element("div",{"class":"jxColorBar"});var Q=new Element("div",{"class":"jxColorPreview"});this.selectedSwatch=new Element("div",{"class":"jxColorSelected"});this.previewSwatch=new Element("div",{"class":"jxColorHover"});Q.adopt(this.selectedSwatch);Q.adopt(this.previewSwatch);H.adopt(Q);this.colorInputLabel=new Element("label",{"class":"jxColorLabel",html:"#"});H.adopt(this.colorInputLabel);var K=this.changed.bind(this);this.colorInput=new Element("input",{"class":"jxHexInput",type:"text",maxLength:6,events:{keyup:K,blur:K,change:K}});H.adopt(this.colorInput);this.alphaLabel=new Element("label",{"class":"jxAlphaLabel",html:this.options.alphaLabel});H.adopt(this.alphaLabel);this.alphaInput=new Element("input",{"class":"jxAlphaInput",type:"text",maxLength:3,events:{keyup:this.alphaChanged.bind(this)}});H.adopt(this.alphaInput);this.domObj.adopt(H);var I=this.swatchClick.bindWithEvent(this);var G=this.swatchOver.bindWithEvent(this);var P=new Element("table",{"class":"jxColorGrid"});var A=new Element("tbody");P.adopt(A);for(var N=0;N<12;N++){var B=new Element("tr");for(var L=-3;L<18;L++){var F=false;var J,O,R;if(L<0){if(L==-3||L==-1){J=O=R=0;F=true}else{if(N<6){J=O=R=N}else{if(N==6){J=5;O=0;R=0}else{if(N==7){J=0;O=5;R=0}else{if(N==8){J=0;O=0;R=5}else{if(N==9){J=5;O=5;R=0}else{if(N==10){J=0;O=5;R=5}else{if(N==11){J=5;O=0;R=5}}}}}}}}}else{J=parseInt(N/6)*3+parseInt(L/6);O=L%6;R=N%6}var D="#"+this.options.hexColors[J]+this.options.hexColors[O]+this.options.hexColors[R];var E=new Element("td");if(!F){E.setStyle("backgroundColor",D);var S=new Element("a",{"class":"colorSwatch "+(((J>2&&O>2)||(J>2&&R>2)||(O>2&&R>2))?"borderBlack":"borderWhite"),href:"javascript:void(0)",title:D,alt:D,events:{mouseover:G,click:I}});S.store("swatchColor",D);E.adopt(S)}else{E.addClass("emptyCell");var M=new Element("span");E.adopt(M)}B.adopt(E)}A.adopt(B)}this.domObj.adopt(P);this.updateSelected();if(this.options.parent){this.addTo(this.options.parent)}},swatchOver:function(B){var A=B.target;this.previewSwatch.setStyle("backgroundColor",A.retrieve("swatchColor"))},swatchClick:function(B){var A=B.target;this.options.color=A.retrieve("swatchColor");this.updateSelected();this.fireEvent("click",this)},changed:function(){var A=this.colorInput.value;if(A.substring(0,1)=="#"){A=A.substring(1)}if(A.toLowerCase().match(/^[0-9a-f]{6}$/)){this.options.color="#"+A.toUpperCase();this.updateSelected()}},alphaChanged:function(){var A=this.alphaInput.value;if(A.match(/^[0-9]{1,3}$/)){this.options.alpha=parseFloat(A/100);this.updateSelected()}},setColor:function(A){this.colorInput.value=A;this.changed()},setAlpha:function(A){this.alphaInput.value=A;this.alphaChanged()},updateSelected:function(){var A={backgroundColor:this.options.color};this.colorInput.value=this.options.color.substring(1);this.alphaInput.value=parseInt(this.options.alpha*100);if(this.options.alpha<1){A.opacity=this.options.alpha;A.filter="Alpha(opacity="+(this.options.alpha*100)+")"}else{A.opacity="";A.filter=""}this.selectedSwatch.setStyles(A);this.previewSwatch.setStyles(A);this.fireEvent("change",this)}});Jx.Button.Color=new Class({Family:"Jx.Button.Color",Extends:Jx.Button.Flyout,swatch:null,options:{color:"#000000",alpha:100},initialize:function(A){if(!Jx.Button.Color.ColorPalette){Jx.Button.Color.ColorPalette=new Jx.ColorPalette(this.options)}var B=new Element("span",{"class":"jxButtonSwatch"});this.selectedSwatch=new Element("span");B.appendChild(this.selectedSwatch);this.colorChangeFn=this.changed.bind(this);this.hideFn=this.hide.bind(this);A.image=Jx.aPixel.src;this.parent(A);B.replaces(this.domImg);this.updateSwatch()},clicked:function(){if(Jx.Button.Color.ColorPalette.currentButton){Jx.Button.Color.ColorPalette.currentButton.hide()}Jx.Button.Color.ColorPalette.currentButton=this;Jx.Button.Color.ColorPalette.addEvent("change",this.colorChangeFn);Jx.Button.Color.ColorPalette.addEvent("click",this.hideFn);this.content.appendChild(Jx.Button.Color.ColorPalette.domObj);Jx.Button.Color.ColorPalette.domObj.setStyle("display","block");Jx.Button.Flyout.prototype.clicked.apply(this,arguments);Jx.Button.Color.ColorPalette.options.color=this.options.color;Jx.Button.Color.ColorPalette.options.alpha=this.options.alpha/100;Jx.Button.Color.ColorPalette.updateSelected()},hide:function(){this.setActive(false);Jx.Button.Color.ColorPalette.removeEvent("change",this.colorChangeFn);Jx.Button.Color.ColorPalette.removeEvent("click",this.hideFn);Jx.Button.Flyout.prototype.hide.apply(this,arguments);Jx.Button.Color.ColorPalette.currentButton=null},setColor:function(A){this.options.color=A;this.updateSwatch()},setAlpha:function(A){this.options.alpha=A;this.updateSwatch()},changed:function(A){var B=false;if(this.options.color!=A.options.color){this.options.color=A.options.color;B=true}if(this.options.alpha!=A.options.alpha*100){this.options.alpha=A.options.alpha*100;B=true}if(B){this.updateSwatch();this.fireEvent("change",this)}},updateSwatch:function(){var A={backgroundColor:this.options.color};if(this.options.alpha<100){A.filter="Alpha(opacity="+(this.options.alpha)+")";A.opacity=this.options.alpha/100}else{A.opacity="";A.filter=""}this.selectedSwatch.setStyles(A)}});Jx.Menu=new Class({Family:"Jx.Menu",Implements:[Options,Events,Jx.AutoPosition,Jx.Chrome,Jx.Addable],domObj:null,button:null,subDomObj:null,items:null,initialize:function(A){this.setOptions(A);if(!Jx.Menu.Menus){Jx.Menu.Menus=[]}this.items=[];this.contentContainer=new Element("div",{"class":"jxMenuContainer",events:{contextmenu:function(B){B.stop()}}});this.subDomObj=new Element("ul",{"class":"jxMenu"});this.contentContainer.adopt(this.subDomObj);if(A){this.button=new Jx.Button($merge(A,{onClick:this.show.bind(this)}));this.button.domA.addClass("jxButtonMenu");this.button.domA.addEvent("mouseover",this.onMouseOver.bindWithEvent(this));this.domObj=this.button.domObj}this.hideWatcher=this.hide.bindWithEvent(this);this.keypressWatcher=this.keypressHandler.bindWithEvent(this);if(this.options.parent){this.addTo(this.options.parent)}},add:function(){$A(arguments).flatten().each(function(A){this.items.push(A);A.setOwner(this);this.subDomObj.adopt(A.domObj)},this);return this},deactivate:function(){this.hide()},onMouseOver:function(A){if(Jx.Menu.Menus[0]&&Jx.Menu.Menus[0]!=this){this.show({event:A})}},eventInMenu:function(D){var C=$(D.target);if(!C){return false}if(C.descendantOf(this.domObj)||C.descendantOf(this.subDomObj)){return true}else{var B=C.findElement("ul");if(B){var E=B.retrieve("jxSubMenu");if(E){var A=E.owner;while(A){if(A==this){return true}A=A.owner}}}return false}},hide:function(A){if(A){if(this.visibleItem&&this.visibleItem.eventInMenu){if(this.visibleItem.eventInMenu(A)){return }}else{if(this.eventInMenu(A)){return }}}if(Jx.Menu.Menus[0]&&Jx.Menu.Menus[0]==this){Jx.Menu.Menus[0]=null}if(this.button&&this.button.domA){this.button.domA.removeClass("jx"+this.button.options.type+"Active")}this.items.each(function(B){B.hide(A)});document.removeEvent("mousedown",this.hideWatcher);document.removeEvent("keydown",this.keypressWatcher);this.contentContainer.setStyle("display","none");this.fireEvent("hide",this)},show:function(B){var A=B.event;if(Jx.Menu.Menus[0]){if(Jx.Menu.Menus[0]!=this){Jx.Menu.Menus[0].button.blur();Jx.Menu.Menus[0].hide(A)}else{this.hide();return }}if(this.items.length===0){return }Jx.Menu.Menus[0]=this;this.button.focus();this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.showChrome(this.contentContainer);this.position(this.contentContainer,this.button.domObj,{horizontal:["left left"],vertical:["bottom top","top bottom"],offsets:this.chromeOffsets});this.contentContainer.setStyle("visibility","");if(this.button&&this.button.domA){this.button.domA.addClass("jx"+this.button.options.type+"Active")}if(A){}document.addEvent("mousedown",this.hideWatcher);document.addEvent("keydown",this.keypressWatcher);this.fireEvent("show",this)},setVisibleItem:function(A){if(this.visibleItem!=A){if(this.visibleItem&&this.visibleItem.hide){this.visibleItem.hide()}this.visibleItem=A;this.visibleItem.show()}},keypressHandler:function(A){A=new Event(A);if(A.key=="esc"){this.hide()}}});Jx.ButtonSet=new Class({Family:"Jx.ButtonSet",Implements:[Options,Events],buttons:null,initialize:function(A){this.setOptions(A);this.buttons=[];this.buttonChangedHandler=this.buttonChanged.bind(this)},add:function(){$A(arguments).each(function(A){if(A.domObj.hasClass("jx"+A.options.type+"Toggle")){A.domObj.removeClass("jx"+A.options.type+"Toggle");A.domObj.addClass("jx"+A.options.type+"Set")}A.addEvent("down",this.buttonChangedHandler);var B=this;A.setActive=function(C){if(this.options.active&&B.activeButton==this){return }else{Jx.Button.prototype.setActive.apply(this,[C])}};if(!this.activeButton||A.options.active){A.options.active=false;A.setActive(true)}this.buttons.push(A)},this);return this},remove:function(A){this.buttons.erase(A);if(this.activeButton==A){if(this.buttons.length){this.buttons[0].setActive(true)}A.removeEvent("down",this.buttonChangedHandler);A.setActive=Jx.Button.prototype.setActive}},setActiveButton:function(B){var A=this.activeButton;this.activeButton=B;if(A&&A!=B){A.setActive(false)}},buttonChanged:function(A){this.setActiveButton(A);this.fireEvent("change",this)}});Jx.Button.Multi=new Class({Family:"Jx.Button.Multi",Extends:Jx.Button,activeButton:null,buttons:null,initialize:function(C){this.parent(C);this.buttons=[];this.domA.addClass("jxButtonMulti");this.menu=new Jx.Menu();this.menu.button=this;this.buttonSet=new Jx.ButtonSet();this.clickHandler=this.clicked.bind(this);var A=new Element("a",{"class":"jxButtonDisclose",href:"javascript:void(0)"});var B=this;var D;A.addEvents({click:(function(E){if(this.items.length===0){return }if(!B.options.enabled){return }this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.showChrome(this.contentContainer);this.position(this.contentContainer,this.button.domObj,{horizontal:["right right"],vertical:["bottom top","top bottom"],offsets:this.chromeOffsets});this.contentContainer.setStyle("visibility","");document.addEvent("mousedown",this.hideWatcher);document.addEvent("keyup",this.keypressWatcher);this.fireEvent("show",this)}).bindWithEvent(this.menu),mouseenter:(function(){$(this.domObj.firstChild).addClass("jxButtonHover");if(D){A.addClass("jx"+this.options.type+"Pressed")}}).bind(this),mouseleave:(function(){$(this.domObj.firstChild).removeClass("jxButtonHover");A.removeClass("jx"+this.options.type+"Pressed")}).bind(this),mousedown:(function(E){A.addClass("jx"+this.options.type+"Pressed");D=true;this.focus()}).bindWithEvent(this),mouseup:(function(E){A.removeClass("jx"+this.options.type+"Pressed")}).bindWithEvent(this),keydown:(function(E){if(E.key=="enter"){A.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keyup:(function(E){if(E.key=="enter"){A.removeClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),blur:function(){D=false}});if(typeof Drag!="undefined"){new Drag(A,{onStart:function(){this.stop()}})}this.menu.addEvents({show:(function(){this.domA.addClass("jxButtonActive")}).bind(this),hide:(function(){if(this.options.active){this.domA.addClass("jxButtonActive")}}).bind(this)});A.adopt(new Element("img",{src:Jx.aPixel.src,alt:"",title:""}));this.domObj.adopt(A);this.discloser=A;if(this.options.items){this.add(this.options.items)}},add:function(){$A(arguments).flatten().each(function(B){if(!B instanceof Jx.Button){return }this.buttons.push(B);var D=this.setButton.bind(this,B);var C=$merge(B.options,{toggle:true,onClick:D});if(!C.label){C.label="&nbsp;"}if(!C.image||C.image.indexOf("a_pixel")!=-1){delete C.image}var A=new Jx.Menu.Item(C);this.buttonSet.add(A);this.menu.add(A);B.multiButton=A;B.domA.addClass("jxButtonMulti");if(!this.activeButton){this.domA.dispose();this.setActiveButton(B)}},this)},remove:function(A){if(!A||!A.multiButton){return }if(this.menu.remove(A.multiButton)){A.multiButton=null;if(this.activeButton==A){if(!this.buttons.some(function(B){if(B!=A){this.setActiveButton(B);return true}else{return false}},this)){this.setActiveButton(null)}}this.buttons.erase(A)}},setActiveButton:function(A){if(this.activeButton){this.activeButton.domA.dispose();this.activeButton.domA.removeEvent(this.clickHandler)}if(A&&A.domA){this.domObj.grab(A.domA,"top");this.domA=A.domA;this.domA.addEvent("click",this.clickHandler);if(this.options.toggle){this.options.active=false;this.setActive(true)}}this.activeButton=A},setButton:function(A){this.setActiveButton(A);A.clicked()}});Jx.Menu.Item=new Class({Family:"Jx.Menu.Item",Extends:Jx.Button,owner:null,options:{enabled:true,image:null,label:"&nbsp;",toggleClass:"Toggle"},initialize:function(A){this.parent($merge({image:Jx.aPixel.src},A,{container:"li",type:"MenuItem",toggleClass:(A.image?null:this.options.toggleClass)}));this.domObj.addEvent("mouseover",this.onMouseOver.bindWithEvent(this))},setOwner:function(A){this.owner=A},hide:function(){this.blur()},show:$empty,clicked:function(A){if(this.options.enabled){if(this.options.toggle){this.setActive(!this.options.active)}this.fireEvent("click",this);if(this.owner&&this.owner.deactivate){this.owner.deactivate(A.event)}}},onMouseOver:function(A){if(this.owner&&this.owner.setVisibleItem){this.owner.setVisibleItem(this)}this.show(A)}});Jx.Button.Combo=new Class({Family:"Jx.Button.Combo",Extends:Jx.Button.Multi,domObj:null,ul:null,currentSelection:null,options:{editable:false,label:""},initialize:function(A){this.parent();this.setOptions(A);this.domA.removeClass("jxButtonMulti");if(this.options.editable){var B=new Element("span",{"class":"jxButton"});B.adopt(this.domA.firstChild);this.domA=B.replaces(this.domA);this.domA.addClass("jxButtonComboDefault");this.domA.addClass("jxButtonEditCombo");this.domInput=new Element("input",{type:"text",events:{change:this.valueChanged.bindWithEvent(this),keydown:this.onKeyPress.bindWithEvent(this),focus:(function(){if(this.domA.hasClass("jxButtonComboDefault")){this.domInput.value="";this.domA.removeClass("jxButtonComboDefault")}}).bind(this)},value:this.options.label});this.domLabel.empty();this.domLabel.addClass("jxComboInput");this.domLabel.adopt(this.domInput)}else{this.discloser.dispose();this.domA.addClass("jxButtonCombo");this.addEvent("click",(function(C){this.discloser.fireEvent("click",C)}).bindWithEvent(this))}this.buttonSet=new Jx.ButtonSet({onChange:(function(F){var E=F.activeButton;this.domA.removeClass("jxButtonComboDefault");if(this.options.editable){this.domInput.value=E.options.label}else{var C=E.options.label;if(C=="&nbsp;"){C=""}this.setLabel(C)}var D=E.options.image;if(D.indexOf("a_pixel")!=-1){D=""}this.setImage(D);if(this.options.imageClass&&this.domImg){this.domImg.removeClass(this.options.imageClass)}if(E.options.imageClass&&this.domImg){this.options.imageClass=E.options.imageClass;this.domImg.addClass(E.options.imageClass)}this.fireEvent("change",this)}).bind(this)});if(this.options.items){this.add(this.options.items)}this.setEnabled(this.options.enabled)},setEnabled:function(A){this.options.enabled=A;if(this.options.enabled){this.domObj.removeClass("jxDisabled");if(this.domInput){this.domInput.disabled=false}}else{this.domObj.addClass("jxDisabled");if(this.domInput){this.domInput.disabled=true}}},valueChanged:function(){this.fireEvent("change",this)},onKeyPress:function(A){if(A.key=="enter"){this.valueChanged()}},add:function(){$A(arguments).flatten().each(function(B){var A=new Jx.Menu.Item($merge(B,{toggle:true}));this.menu.add(A);this.buttonSet.add(A)},this)},remove:function(A){},setValue:function(A){if(this.options.editable){this.domInput.value=A}else{this.setLabel(A)}},getValue:function(){value="";if(this.options.editable){value=this.domInput.value}else{value=this.getLabel()}return value}});Jx.Panel=new Class({Family:"Jx.Panel",Implements:[Options,Events,Jx.ContentLoader,Jx.Addable],toolbarContainers:{top:null,right:null,bottom:null,left:null},options:{position:"absolute",type:"Panel",id:"",label:"&nbsp;",height:null,collapse:true,collapseTooltip:"Collapse/Expand Panel",collapseLabel:"Collapse",expandLabel:"Expand",maximizeTooltip:"Maximize Panel",maximizeLabel:"Maximize",close:false,closeTooltip:"Close Panel",closeLabel:"Close",closed:false,hideTitle:false,toolbars:[]},initialize:function(I){this.setOptions(I);this.toolbars=I?I.toolbars||[]:[];if($defined(this.options.height)&&!$defined(I.position)){this.options.position="relative"}this.title=new Element("div",{"class":"jx"+this.options.type+"Title"});var A=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.image){A.setStyle("backgroundImage","url("+this.options.image+")")}this.title.adopt(A);this.labelObj=new Element("span",{"class":"jx"+this.options.type+"Label",html:this.options.label});this.title.adopt(this.labelObj);var F=new Element("div",{"class":"jx"+this.options.type+"Controls"});var B=new Element("div");F.adopt(B);this.toolbar=new Jx.Toolbar({parent:B});this.title.adopt(F);var C=this;if(this.options.menu){this.menu=new Jx.Menu({image:Jx.aPixel.src});this.menu.domObj.addClass("jx"+this.options.type+"Menu");this.menu.domObj.addClass("jxButtonContentLeft");this.toolbar.add(this.menu)}if(this.options.collapse){var E=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.collapseTooltip,onClick:function(){C.toggleCollapse()}});E.domObj.addClass("jx"+this.options.type+"Collapse");this.toolbar.add(E);if(this.menu){var H=new Jx.Menu.Item({label:this.options.collapseLabel,onClick:function(){C.toggleCollapse()}});this.addEvents({collapse:function(){H.setLabel(this.options.expandLabel)},expand:function(){H.setLabel(this.options.collapseLabel)}});this.menu.add(H)}}if(this.options.maximize){var E=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.maximizeTooltip,onClick:function(){C.maximize()}});E.domObj.addClass("jx"+this.options.type+"Maximize");this.toolbar.add(E);if(this.menu){var H=new Jx.Menu.Item({label:this.options.maximizeLabel,onClick:function(){C.maximize()}});this.menu.add(H)}}if(this.options.close){var E=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.closeTooltip,onClick:function(){C.close()}});E.domObj.addClass("jx"+this.options.type+"Close");this.toolbar.add(E);if(this.menu){var H=new Jx.Menu.Item({label:this.options.closeLabel,onClick:function(){C.close()}});this.menu.add(H)}}this.title.addEvent("dblclick",function(){C.toggleCollapse()});this.domObj=new Element("div",{"class":"jx"+this.options.type});if(this.options.id){this.domObj.id=this.options.id}var D=new Jx.Layout(this.domObj,$merge(this.options,{propagate:false}));var G=this.layoutContent.bind(this);D.addEvent("sizeChange",G);if(!this.options.hideTitle){this.domObj.adopt(this.title)}this.contentContainer=new Element("div",{"class":"jx"+this.options.type+"ContentContainer"});this.domObj.adopt(this.contentContainer);if($type(this.options.toolbars)=="array"){this.options.toolbars.each(function(K){var J=K.options.position;var L=this.toolbarContainers[J];if(!L){var L=new Element("div");new Jx.Layout(L);this.contentContainer.adopt(L);this.toolbarContainers[J]=L}K.addTo(L)},this)}this.content=new Element("div",{"class":"jx"+this.options.type+"Content"});this.contentContainer.adopt(this.content);new Jx.Layout(this.contentContainer);new Jx.Layout(this.content);this.loadContent(this.content);this.toggleCollapse(this.options.closed);this.addEvent("addTo",function(){this.domObj.resize()});if(this.options.parent){this.addTo(this.options.parent)}},layoutContent:function(){var F=0;var G=0;var A=0;var C=0;var I=0;var H;var D;var E;if(!this.options.hideTitle&&this.title.parentNode==this.domObj){F=this.title.getMarginBoxSize().height}var B=this.domObj.getContentBoxSize();if(B.height>F){this.contentContainer.setStyle("display","block");this.options.closed=false;this.contentContainer.resize({top:F,height:null,bottom:0});["left","right"].each(function(J){if(this.toolbarContainers[J]){this.toolbarContainers[J].style.width="auto"}},this);["top","bottom"].each(function(J){if(this.toolbarContainers[J]){this.toolbarContainers[J].style.height=""}},this);if($type(this.options.toolbars)=="array"){this.options.toolbars.each(function(J){E=J.options.position;H=this.toolbarContainers[E];if(Browser.Engine.trident4){var L=$(H.parentNode);H.style.visibility="hidden";$(document.body).adopt(H)}var K=H.getBorderBoxSize();if(Browser.Engine.trident4){L.adopt(H);H.style.visibility=""}switch(E){case"top":G=K.height;break;case"bottom":A=K.height;break;case"left":C=K.width;break;case"right":I=K.width;break}},this)}H=this.toolbarContainers.top;if(H){H.resize({top:0,left:C,right:I,bottom:null,height:G,width:null})}H=this.toolbarContainers.bottom;if(H){H.resize({top:null,left:C,right:I,bottom:0,height:A,width:null})}H=this.toolbarContainers.left;if(H){H.resize({top:G,left:0,right:null,bottom:A,height:null,width:C})}H=this.toolbarContainers.right;if(H){H.resize({top:G,left:null,right:0,bottom:A,height:null,width:I})}this.content.resize({top:G,bottom:A,left:C,right:I})}else{this.contentContainer.setStyle("display","none");this.options.closed=true}this.fireEvent("sizeChange",this)},setLabel:function(A){this.labelObj.innerHTML=A},getLabel:function(){return this.labelObj.innerHTML},finalize:function(){this.domObj=null;this.deregisterIds()},maximize:function(){if(this.manager){this.manager.maximizePanel(this)}},setContent:function(A){this.content.innerHTML=A;this.bContentReady=true},setContentURL:function(B){this.bContentReady=false;this.setBusy(true);if(arguments[1]){this.onContentReady=arguments[1]}if(B.indexOf("?")==-1){B=B+"?"}var A=new Request({url:B,method:"get",evalScripts:true,onSuccess:this.panelContentLoaded.bind(this),requestHeaders:["If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT"]}).send()},panelContentLoaded:function(A){this.content.innerHTML=A;this.bContentReady=true;this.setBusy(false);if(this.onContentReady){window.setTimeout(this.onContentReady.bind(this),1)}},setBusy:function(A){this.busyCount+=A?1:-1;if(this.loadingObj){this.loadingObj.img.style.visibility=(this.busyCount>0)?"visible":"hidden"}},toggleCollapse:function(C){if($defined(C)){this.options.closed=C}else{this.options.closed=!this.options.closed}if(this.options.closed){if(!this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.addClass("jx"+this.options.type+"Min");this.contentContainer.setStyle("display","none");var B=this.domObj.getMarginSize();var A=B.top+B.bottom;if(this.title.parentNode==this.domObj){A+=this.title.getMarginBoxSize().height}this.domObj.resize({height:A});this.fireEvent("collapse",this)}}else{if(this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.removeClass("jx"+this.options.type+"Min");this.contentContainer.setStyle("display","block");this.domObj.resize({height:this.options.height});this.fireEvent("expand",this)}}},close:function(){this.domObj.dispose();this.fireEvent("close",this)}});Jx.Dialog=new Class({Family:"Jx.Dialog",Extends:Jx.Panel,Implements:[Jx.AutoPosition,Jx.Chrome],blanket:null,options:{modal:true,position:"absolute",width:250,height:250,horizontal:"center center",vertical:"center center",label:"New Dialog",id:"",parent:null,resize:false,resizeTooltip:"",move:true,close:true},initialize:function(A){this.isOpening=false;this.firstShow=true;this.parent($merge({parent:document.body},A,{type:"Dialog",position:"absolute"}));this.options.parent=$(this.options.parent);if(this.options.modal){this.blanket=new Element("div",{"class":"jxDialogModal",styles:{display:"none",zIndex:-1}});this.blanket.resize=(function(){var B=$(document.body).getScrollSize();this.setStyles({width:B.x,height:B.y})}).bind(this.blanket);this.options.parent.adopt(this.blanket);window.addEvent("resize",this.blanket.resize)}this.domObj.setStyle("display","none");this.options.parent.adopt(this.domObj);if(this.options.move&&typeof Drag!="undefined"){this.title.addClass("jxDialogMoveable");new Drag(this.domObj,{handle:this.title,onBeforeStart:(function(){Jx.Dialog.orderDialogs(this)}).bind(this),onStart:(function(){this.contentContainer.setStyle("visibility","hidden");this.chrome.addClass("jxChromeDrag")}).bind(this),onComplete:(function(){this.chrome.removeClass("jxChromeDrag");this.contentContainer.setStyle("visibility","");var C=Math.max(this.chromeOffsets.left,parseInt(this.domObj.style.left,10));var B=Math.max(this.chromeOffsets.top,parseInt(this.domObj.style.top,10));this.options.horizontal=C+" left";this.options.vertical=B+" top";this.position(this.domObj,this.options.parent,this.options);this.options.left=parseInt(this.domObj.style.left,10);this.options.top=parseInt(this.domObj.style.top,10);if(!this.options.closed){this.domObj.resize(this.options)}}).bind(this)})}if(this.options.resize&&typeof Drag!="undefined"){this.resizeHandle=new Element("div",{"class":"jxDialogResize",title:this.options.resizeTooltip,styles:{display:this.options.closed?"none":"block"}});this.domObj.appendChild(this.resizeHandle);this.resizeHandleSize=this.resizeHandle.getSize();this.resizeHandle.setStyles({bottom:this.resizeHandleSize.height,right:this.resizeHandleSize.width});this.domObj.makeResizable({handle:this.resizeHandle,onStart:(function(){this.contentContainer.setStyle("visibility","hidden");this.chrome.addClass("jxChromeDrag")}).bind(this),onDrag:(function(){this.resizeChrome(this.domObj)}).bind(this),onComplete:(function(){this.chrome.removeClass("jxChromeDrag");var B=this.domObj.getMarginBoxSize();this.options.width=B.width;this.options.height=B.height;this.layoutContent();this.domObj.resize(this.options);this.contentContainer.setStyle("visibility","");this.fireEvent("resize");this.resizeChrome(this.domObj)}).bind(this)})}this.domObj.addEvent("mousedown",(function(){Jx.Dialog.orderDialogs(this)}).bind(this))},resize:function(B,A,C){this.options.width=B;this.options.height=A;if(this.domObj.getStyle("display")!="none"){this.layoutContent();this.domObj.resize(this.options);this.fireEvent("resize");this.resizeChrome(this.domObj);if(C){this.position(this.domObj,this.options.parent,this.options)}}else{this.firstShow=false}},sizeChanged:function(){if(!this.options.closed){this.layoutContent()}},toggleCollapse:function(C){if($defined(C)){this.options.closed=C}else{this.options.closed=!this.options.closed}if(this.options.closed){if(!this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.addClass("jx"+this.options.type+"Min")}this.contentContainer.setStyle("display","none");if(this.resizeHandle){this.resizeHandle.setStyle("display","none")}}else{if(this.domObj.hasClass("jx"+this.options.type+"Min")){this.domObj.removeClass("jx"+this.options.type+"Min")}this.contentContainer.setStyle("display","block");if(this.resizeHandle){this.resizeHandle.setStyle("display","block")}}if(this.options.closed){var B=this.domObj.getMarginSize();var A=this.title.getMarginBoxSize();this.domObj.resize({height:B.top+A.height+B.bottom});this.fireEvent("collapse")}else{this.domObj.resize(this.options);this.fireEvent("expand")}this.showChrome(this.domObj)},show:function(){this.domObj.setStyles({display:"block",visibility:"hidden"});if(this.blanket){this.blanket.resize()}Jx.Dialog.orderDialogs(this);if(this.blanket){this.blanket.setStyles({visibility:"visible",display:"block"})}if(this.options.closed){var B=this.domObj.getMarginSize();var A=this.title.getMarginBoxSize();this.domObj.resize({height:B.top+A.height+B.bottom})}else{this.domObj.resize(this.options)}if(this.firstShow){this.contentContainer.resize({forceResize:true});this.layoutContent();this.firstShow=false;if(this.chrome){this.chrome.dispose();this.chrome=null}}this.showChrome(this.domObj);this.position(this.domObj,this.options.parent,this.options);this.domObj.setStyle("visibility","")},hide:function(){Jx.Dialog.Stack.erase(this);Jx.Dialog.ZIndex--;this.domObj.setStyle("display","none");if(this.blanket){this.blanket.setStyle("visibility","hidden");Jx.Dialog.ZIndex--}},openURL:function(A){if(A){this.options.contentURL=A;this.loadContent(this.content)}this.open()},open:function(){if(!this.isOpening){this.isOpening=true}if(this.contentIsLoaded){this.show();this.fireEvent("open",this);this.isOpening=false}else{this.addEvent("contentLoaded",this.open.bind(this))}},close:function(){this.isOpening=false;this.hide();this.fireEvent("close")}});Jx.Dialog.Stack=[];Jx.Dialog.BaseZIndex=null;Jx.Dialog.orderDialogs=function(A){Jx.Dialog.Stack.erase(A).push(A);if(Jx.Dialog.BaseZIndex===null){Jx.Dialog.BaseZIndex=Math.max(Jx.Dialog.Stack[0].domObj.getStyle("zIndex").toInt(),1)}Jx.Dialog.Stack.each(function(D,B){var C=Jx.Dialog.BaseZIndex+(B*2);if(D.blanket){D.blanket.setStyle("zIndex",C-1)}D.domObj.setStyle("zIndex",C)})};Jx.Splitter=new Class({Family:"Jx.Splitter",Implements:[Options],domObj:null,elements:null,bars:null,firstUpdate:true,options:{useChildren:false,splitInto:2,elements:null,containerOptions:[],barOptions:[],layout:"horizontal",snaps:[],barTooltip:"drag this bar to resize",onStart:null,onFinish:null},initialize:function(A,L){this.setOptions(L);this.domObj=$(A);this.domObj.addClass("jxSplitContainer");var K=this.domObj.retrieve("jxLayout");if(K){K.addEvent("sizeChange",this.sizeChanged.bind(this))}this.elements=[];this.bars=[];var J=2;if(this.options.useChildren){this.elements=this.domObj.getChildren();J=this.elements.length}else{J=this.options.elements?this.options.elements.length:this.options.splitInto;for(var G=0;G<J;G++){var D;if(this.options.elements&&this.options.elements[G]){if(L.elements[G].domObj){D=L.elements[G].domObj}else{D=$(this.options.elements[G])}if(!D){D=this.prepareElement();D.id=this.options.elements[G]}}else{D=this.prepareElement()}this.elements[G]=D;this.domObj.adopt(this.elements[G])}}this.elements.each(function(M){M.addClass("jxSplitArea")});for(var G=0;G<J;G++){var I=this.elements[G].retrieve("jxLayout");if(!I){new Jx.Layout(this.elements[G],this.options.containerOptions[G])}else{I.resize({position:"absolute"})}}for(var G=1;G<J;G++){var H;if(this.options.prepareBar){H=this.options.prepareBar(G-1)}else{H=this.prepareBar()}H.store("splitterObj",this);H.store("leftSide",this.elements[G-1]);H.store("rightSide",this.elements[G]);this.elements[G-1].store("rightBar",H);this.elements[G].store("leftBar",H);this.domObj.adopt(H);this.bars[G-1]=H}if($defined(Drag)){this.establishConstraints()}for(var G=0;G<this.options.barOptions.length;G++){if(!this.bars[G]){continue}var B=this.options.barOptions[G];if(B&&B.snap&&(B.snap=="before"||B.snap=="after")){var F;if(B.snap=="before"){F=this.bars[G].retrieve("leftSide")}else{if(B.snap=="after"){F=this.bars[G].retrieve("rightSide")}}var E;var C;if(B.snapElement){E=B.snapElement;C=B.snapEvents||["click","dblclick"]}else{E=this.bars[G];C=B.snapEvents||["dblclick"]}if(!E.parentNode){this.bars[G].adopt(E)}new Jx.Splitter.Snap(E,F,this,C)}}for(var G=0;G<this.options.snaps.length;G++){if(this.options.snaps[G]){new Jx.Splitter.Snap(this.options.snaps[G],this.elements[G],this)}}this.sizeChanged()},prepareElement:function(){var A=new Element("div",{styles:{position:"absolute"}});return A},prepareBar:function(){var A=new Element("div",{"class":"jxSplitBar"+this.options.layout.capitalize(),title:this.options.barTitle});return A},establishConstraints:function(){var A={x:null,y:null};var B;if(this.options.layout=="horizontal"){A.x="left";B=this.dragHorizontal}else{A.y="top";B=this.dragVertical}if(typeof Drag!="undefined"){this.bars.each(function(D){var C;new Drag(D,{modifiers:A,onSnap:function(E){E.addClass("jxSplitBarDrag")},onComplete:(function(E){C.destroy();E.removeClass("jxSplitBarDrag");if(E.retrieve("splitterObj")!=this){return }B.apply(this,[E])}).bind(this),onStart:(function(E){C=new Element("div",{"class":"jxSplitterMask"}).inject(E,"after");if(this.options.onStart){this.options.onStart()}}).bind(this),onFinish:(function(){if(this.options.onFinish){this.options.onFinish()}}).bind(this)})},this)}},dragHorizontal:function(F){var A=parseInt(F.style.left);var H=F.retrieve("leftSide");var C=F.retrieve("rightSide");var D=H.retrieve("jxLayout");var G=C.retrieve("jxLayout");var E=this.domObj.getPaddingSize().left;var I,O,K;var N=F.retrieve("size");if(!N){N=F.getBorderBoxSize();F.store("size",N)}I=A+N.width-E;var B=this.domObj.getContentBoxSize();if(G.options.width!=null){O=G.options.width+G.options.left-I;K=B.width-I-O}else{O=B.width-G.options.right-I;K=G.options.right}if(O<0){O=0}if(O<G.options.minWidth){O=G.options.minWidth}if(G.options.maxWidth>=0&&O>G.options.maxWidth){O=G.options.maxWidth}I=B.width-K-O;A=I-N.width;var J,M;J=D.options.left;M=A-J;if(M<0){M=0}if(M<D.options.minWidth){M=D.options.minWidth}if(D.options.maxWidth>=0&&M>D.options.maxWidth){M=D.options.maxWidth}if(J+M!=A){A=J+M;var L=A+N.width-I;I+=L;O-=L}F.style.left=E+A+"px";if(D.options.width==null){var B=this.domObj.getContentBoxSize();H.resize({right:B.width-J-M})}else{H.resize({width:M})}if(G.options.width==null){C.resize({left:I})}else{C.resize({left:I,width:O})}},dragVertical:function(F){var J=parseInt(F.style.top);var D=F.retrieve("leftSide");var A=F.retrieve("rightSide");var E=D.retrieve("jxLayout");var H=A.retrieve("jxLayout");var N=this.domObj.getPaddingSize().top;var O=F.retrieve("size");if(!O){O=F.getBorderBoxSize();F.store("size",O)}var B=this.domObj.getContentBoxSize();var C,M,K;C=J+O.height-N;if(H.options.height!=null){M=H.options.height+H.options.top-C;K=B.height-C-M}else{M=B.height-H.options.bottom-C;K=H.options.bottom}if(M<0){M=0}if(M<H.options.minHeight){M=H.options.minHeight}if(H.options.maxHeight>=0&&M>H.options.maxHeight){M=H.options.maxHeight}C=B.height-K-M;J=C-O.height;var I,G;I=E.options.top;G=J-I;if(G<0){G=0}if(G<E.options.minHeight){G=E.options.minHeight}if(E.options.maxHeight>=0&&G>E.options.maxHeight){G=E.options.maxHeight}if(I+G!=J){J=I+G;var L=J+O.height-C;C+=L;M-=L}F.style.top=N+J+"px";if(E.options.height==null){D.resize({bottom:B.height-I-G})}else{D.resize({height:G})}if(H.options.height==null){A.resize({top:C})}else{A.resize({top:C,height:M})}},sizeChanged:function(){if(this.options.layout=="horizontal"){this.horizontalResize()}else{this.verticalResize()}},horizontalResize:function(){var O=this.domObj.getContentBoxSize().width;var D=O;for(var E=0;E<this.bars.length;E++){var L=this.bars[E];var Q=L.retrieve("size");if(!Q||Q.width==0){Q=L.getBorderBoxSize();L.store("size",Q)}O-=Q.width}var I=0;var H;for(var E=0;E<this.elements.length;E++){var K=this.elements[E];H=K.retrieve("jxLayout").options;if(H.width!=null){O-=parseInt(H.width)}else{var N=0;if(H.right!=0||H.left!=0){N=K.getBorderBoxSize().width}O-=N;I++}}if(I==0){O+=H.width;H.width=null;I=1}var G=parseInt(O/I);var P=O%I;var B=this.domObj.getPaddingSize().left;var C=0;for(var E=0;E<this.elements.length;E++){var K=this.elements[E];var J=K.retrieve("jxLayout");var H=J.options;if(H.width!=null){J.resize({left:C});C+=H.width}else{var M=G;if(I==1){M+=P}I--;var N=0;if(H.right!=0||H.left!=0){N=K.getBorderBoxSize().width+M}else{N=M}if(N<0){if(I>0){G=G+N/I}N=0}if(N<H.minWidth){if(I>0){G=G+(N-H.minWidth)/I}N=H.minWidth}if(H.maxWidth>=0&&N>H.maxWidth){if(I>0){G=G+(N-H.maxWidth)/I}N=K.options.maxWidth}var A=D-C-N;J.resize({left:C,right:A});C+=N}var F=K.retrieve("rightBar");if(F){F.setStyle("left",B+C);C+=F.retrieve("size").width}}},verticalResize:function(){var N=this.domObj.getContentBoxSize().height;var B=N;for(var D=0;D<this.bars.length;D++){var L=this.bars[D];var Q=L.retrieve("size");if(!Q||Q.height==0){Q=L.getBorderBoxSize();L.store("size",Q)}N-=Q.height}var I=0;var H;for(var D=0;D<this.elements.length;D++){var K=this.elements[D];H=K.retrieve("jxLayout").options;if(H.height!=null){N-=parseInt(H.height)}else{var G=0;if(H.bottom!=0||H.top!=0){G=K.getBorderBoxSize().height}N-=G;I++}}if(I==0){N+=H.height;H.height=null;I=1}var F=parseInt(N/I);var O=N%I;var P=this.domObj.getPaddingSize().top;var C=0;for(var D=0;D<this.elements.length;D++){var K=this.elements[D];var J=K.retrieve("jxLayout");var H=J.options;if(H.height!=null){J.resize({top:C});C+=H.height}else{var M=F;if(I==1){M+=O}I--;var G=0;if(H.bottom!=0||H.top!=0){G=K.getBorderBoxSize().height+M}else{G=M}if(G<0){if(I>0){F=F+G/I}G=0}if(G<H.minHeight){if(I>0){F=F+(G-H.minHeight)/I}G=H.minHeight}if(H.maxHeight>=0&&G>H.maxHeight){if(I>0){F=F+(G-H.maxHeight)/I}G=H.maxHeight}var A=B-C-G;J.resize({top:C,bottom:A});C+=G}var E=K.retrieve("rightBar");if(E){E.style.top=P+C+"px";C+=E.retrieve("size").height}}}});Jx.PanelSet=new Class({Family:"Jx.PanelSet",Implements:[Options,Events,Jx.Addable],options:{parent:null,panels:[],barTooltip:"drag this bar to resize"},panels:null,height:null,firstLayout:true,initialize:function(A){if(A&&A.panels){this.panels=A.panels;A.panels=null}this.setOptions(A);this.domObj=new Element("div");new Jx.Layout(this.domObj);var C=new Element("div",{styles:{position:"absolute"}});new Jx.Layout(C,{minHeight:0,maxHeight:0,height:0});var B=[C];this.panels.each(function(D){B.push(D.domObj);D.options.hideTitle=true;D.contentContainer.resize({top:0});D.toggleCollapse=this.maximizePanel.bind(this,D);D.domObj.store("Jx.Panel",D);D.manager=this},this);this.splitter=new Jx.Splitter(this.domObj,{splitInto:this.panels.length+1,layout:"vertical",elements:B,prepareBar:(function(F){var G=new Element("div",{"class":"jxPanelBar",title:this.options.barTooltip});var D=this.panels[F];D.title.setStyle("visibility","hidden");$(document.body).adopt(D.title);var E=D.title.getBorderBoxSize();G.adopt(D.title);D.title.setStyle("visibility","");G.setStyle("height",E.height);G.store("size",E);return G}).bind(this)});this.addEvent("addTo",function(){$(this.domObj.parentNode).setStyle("overflow","hidden");this.domObj.resize()});if(this.options.parent){this.addTo(this.options.parent)}},maximizePanel:function(C){var F=this.domObj.getContentBoxSize().height;var B=F;var K=C.domObj.retrieve("jxLayout").options.maxHeight;var I;for(var H=1;H<this.splitter.elements.length;H++){var D=this.splitter.elements[H];B-=D.retrieve("leftBar").getBorderBoxSize().height;if(D!==C.domObj){var G=D.retrieve("Jx.Panel");var E=D.retrieve("jxLayout").options;B-=E.minHeight}else{I=H}}if(K==-1||K>=B){K=B;B=0}else{B=B-K}var L=0;for(var H=1;H<this.splitter.elements.length;H++){var D=this.splitter.elements[H];L+=D.retrieve("leftBar").getBorderBoxSize().height;if(D!==C.domObj){var G=D.retrieve("Jx.Panel");var E=D.retrieve("jxLayout").options;var J=$chk(E.height)?E.height:D.getBorderBoxSize().height;if(B>0){if(B>=J){B-=J;D.resize({top:L,height:J});L+=J}else{if(B>E.minHeight){D.resize({top:L,height:B});L+=B;B=0}else{D.resize({top:L,height:E.minHeight});L+=E.minHeight}}}else{D.resize({top:L,height:E.minHeight});L+=E.minHeight}D.retrieve("rightBar").style.top=L+"px"}else{break}}var A=F;for(var H=this.splitter.elements.length-1;H>0;H--){D=this.splitter.elements[H];if(D!==C.domObj){var E=D.retrieve("jxLayout").options;var J=$chk(E.height)?E.height:D.getBorderBoxSize().height;if(B>0){if(B>=J){A-=J;B-=J;D.resize({top:A,height:J})}else{if(B>E.minHeight){A-=B;D.resize({top:A,height:B});B=0}else{A-=E.minHeight;D.resize({top:A,height:E.minHeight})}}}else{A-=E.minHeight;D.resize({top:A,height:E.minHeight,bottom:null})}A-=D.retrieve("leftBar").getBorderBoxSize().height;D.retrieve("leftBar").style.top=A+"px"}else{break}}C.domObj.resize({top:L,height:K,bottom:null})}});Jx.Grid=new Class({Family:"Jx.Grid",Implements:[Options,Events,Jx.Addable],domObj:null,model:null,options:{parent:null,alternateRowColors:false,rowHeaders:false,columnHeaders:false,rowSelection:false,columnSelection:false,cellPrelight:false,rowPrelight:false,columnPrelight:false,rowHeaderPrelight:false,columnHeaderPrelight:false,cellSelection:false},initialize:function(A){this.setOptions(A);this.domObj=new Element("div");new Jx.Layout(this.domObj,{onSizeChange:this.resize.bind(this)});if(this.options.parent){this.addTo(this.options.parent)}this.rowColObj=new Element("div",{"class":"jxGridContainer"});this.colObj=new Element("div",{"class":"jxGridContainer"});this.colTable=new Element("table",{"class":"jxGridTable"});this.colTableHead=new Element("thead");this.colTable.appendChild(this.colTableHead);this.colTableBody=new Element("tbody");this.colTable.appendChild(this.colTableBody);this.colObj.appendChild(this.colTable);this.rowObj=new Element("div",{"class":"jxGridContainer"});this.rowTable=new Element("table",{"class":"jxGridTable"});this.rowTableHead=new Element("thead");this.rowTable.appendChild(this.rowTableHead);this.rowObj.appendChild(this.rowTable);this.gridObj=new Element("div",{"class":"jxGridContainer",styles:{overflow:"scroll"}});this.gridTable=new Element("table",{"class":"jxGridTable"});this.gridTableBody=new Element("tbody");this.gridTable.appendChild(this.gridTableBody);this.gridObj.appendChild(this.gridTable);this.domObj.appendChild(this.rowColObj);this.domObj.appendChild(this.rowObj);this.domObj.appendChild(this.colObj);this.domObj.appendChild(this.gridObj);this.gridObj.addEvent("scroll",this.onScroll.bind(this));this.gridObj.addEvent("click",this.onClickGrid.bindWithEvent(this));this.rowObj.addEvent("click",this.onClickRowHeader.bindWithEvent(this));this.colObj.addEvent("click",this.onClickColumnHeader.bindWithEvent(this));this.gridObj.addEvent("mousemove",this.onMouseMoveGrid.bindWithEvent(this));this.rowObj.addEvent("mousemove",this.onMouseMoveRowHeader.bindWithEvent(this));this.colObj.addEvent("mousemove",this.onMouseMoveColumnHeader.bindWithEvent(this))},onScroll:function(){this.colObj.scrollLeft=this.gridObj.scrollLeft;this.rowObj.scrollTop=this.gridObj.scrollTop},resize:function(){if(!this.model){return }var C=this.options.columnHeaders?this.model.getColumnHeaderHeight():1;var A=this.options.rowHeaders?this.model.getRowHeaderWidth():1;var B=Element.getContentBoxSize(this.domObj);this.rowColObj.setStyles({width:A-1,height:C-1});this.rowObj.setStyles({top:C,left:0,width:A-1,height:B.height-C-1});this.colObj.setStyles({top:0,left:A,width:B.width-A-1,height:C-1});this.gridObj.setStyles({top:C,left:A,width:B.width-A-1,height:B.height-C-1})},setModel:function(A){this.model=A;if(this.model){if(this.domObj.resize){this.domObj.resize()}this.createGrid();this.resize()}else{this.destroyGrid()}},destroyGrid:function(){var A=this.colTableHead.cloneNode(false);this.colTable.replaceChild(A,this.colTableHead);this.colTableHead=A;A=this.colTableBody.cloneNode(false);this.colTable.replaceChild(A,this.colTableBody);this.colTableBody=A;A=this.rowTableHead.cloneNode(false);this.rowTable.replaceChild(A,this.rowTableHead);this.rowTableHead=A;A=this.gridTableBody.cloneNode(false);this.gridTable.replaceChild(A,this.gridTableBody);this.gridTableBody=A},createGrid:function(){this.destroyGrid();if(this.model){var L=this.model;var E=L.getColumnCount();var Q=L.getRowCount();if(this.options.columnHeaders){var N=L.getColumnHeaderHeight();var P=new Element("tr");this.colTableHead.appendChild(P);var M=new Element("tr");this.colTableBody.appendChild(M);var C=new Element("th",{styles:{width:0,height:0}});P.appendChild(C);C=C.cloneNode(true);C.setStyle("height",N);M.appendChild(C);for(var K=0;K<E;K++){var J=L.getColumnWidth(K);C=new Element("th",{"class":"jxGridColHeadHide",styles:{width:J}});var B=new Element("p",{styles:{height:0,width:J}});C.appendChild(B);P.appendChild(C);C=new Element("th",{"class":"jxGridColHead",html:L.getColumnHeaderHTML(K)});M.appendChild(C)}var C=new Element("th",{styles:{width:1000,height:0}});P.appendChild(C);C=C.cloneNode(true);C.setStyle("height",N-1);C.className="jxGridColHead";M.appendChild(C)}if(this.options.rowHeaders){var H=L.getRowHeaderWidth();var O=new Element("tr");var G=new Element("td",{styles:{width:0,height:0}});O.appendChild(G);var C=new Element("th",{styles:{width:H,height:0}});O.appendChild(C);this.rowTableHead.appendChild(O);for(var K=0;K<Q;K++){var A=L.getRowHeight(K);var O=new Element("tr");var G=new Element("td",{"class":"jxGridRowHeadHide",styles:{width:0,height:A}});var B=new Element("p",{styles:{width:0,height:A}});G.appendChild(B);O.appendChild(G);var C=new Element("th",{"class":"jxGridRowHead",html:L.getRowHeaderHTML(K)});O.appendChild(C);this.rowTableHead.appendChild(O)}var O=new Element("tr");var G=new Element("td",{styles:{width:0,height:1000}});O.appendChild(G);var C=new Element("th",{"class":"jxGridRowHead",styles:{width:H,height:1000}});O.appendChild(C);this.rowTableHead.appendChild(O)}var N=L.getColumnHeaderHeight();var M=new Element("tr");this.gridTableBody.appendChild(M);var G=new Element("td",{styles:{width:0,height:0}});M.appendChild(G);for(var K=0;K<E;K++){var J=L.getColumnWidth(K);G=new Element("td",{"class":"jxGridColHeadHide",styles:{width:J}});var B=new Element("p",{styles:{width:J,height:0}});G.appendChild(B);M.appendChild(G)}for(var I=0;I<Q;I++){var A=L.getRowHeight(I);var D=A;var O=new Element("tr");this.gridTableBody.appendChild(O);var G=new Element("td",{"class":"jxGridRowHeadHide",styles:{width:0,height:A}});var B=new Element("p",{styles:{height:A}});G.appendChild(B);O.appendChild(G);for(var K=0;K<E;K++){var J=L.getColumnWidth(K);G=new Element("td",{"class":"jxGridCell"});G.innerHTML=L.getValueAt(I,K);O.appendChild(G);var F=G.getSize();if(F.height>D){D=F.height}}if(document.all){D-=1}if(this.options.rowHeaders){this.setRowHeaderHeight(I,D)}if(this.options.alternateRowColors){O.className=(I%2)?"jxGridRowOdd":"jxGridRowEven"}else{O.className="jxGridRowAll"}}}},setRowHeaderHeight:function(B,A){this.rowTableHead.childNodes[B+1].childNodes[0].childNodes[0].style.height=(A)+"px"},gridChanged:function(B,D,A,C){if(this.model==B){this.gridObj.childNodes[D].childNodes[A].innerHTML=C}},prelightRowHeader:function(B){var A=(B>=0&&B<this.rowTableHead.rows.length-1)?this.rowTableHead.rows[B+1].cells[1]:null;if(this.prelitRowHeader!=A){if(this.prelitRowHeader){this.prelitRowHeader.removeClass("jxGridRowHeaderPrelight")}this.prelitRowHeader=A;if(this.prelitRowHeader){this.prelitRowHeader.addClass("jxGridRowHeaderPrelight")}}},prelightColumnHeader:function(B){if(this.colTableBody.rows.length==0){return }var A=(B>=0&&B<this.colTableBody.rows[0].cells.length-1)?this.colTableBody.rows[0].cells[B+1]:null;if(this.prelitColumnHeader!=A){if(this.prelitColumnHeader){this.prelitColumnHeader.removeClass("jxGridColumnHeaderPrelight")}this.prelitColumnHeader=A;if(this.prelitColumnHeader){this.prelitColumnHeader.addClass("jxGridColumnHeaderPrelight")}}},prelightRow:function(B){var A=(B>=0&&B<this.gridTableBody.rows.length-1)?this.gridTableBody.rows[B+1]:null;if(this.prelitRow!=B){if(this.prelitRow){this.prelitRow.removeClass("jxGridRowPrelight")}this.prelitRow=A;if(this.prelitRow){this.prelightRowHeader(B);this.prelitRow.addClass("jxGridRowPrelight")}}},prelightColumn:function(A){if(A>=0&&A<this.gridTable.rows[0].cells.length){if($chk(this.prelitColumn)){for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[this.prelitColumn+1].removeClass("jxGridColumnPrelight")}}this.prelitColumn=A;for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[A+1].addClass("jxGridColumnPrelight")}}this.prelightColumnHeader(A)},prelightCell:function(B,A){var C=(B>=0&&A>=0&&B<this.gridTableBody.rows.length-1&&A<this.gridTableBody.rows[B+1].cells.length-1)?this.gridTableBody.rows[B+1].cells[A+1]:null;if(this.prelitCell!=C){if(this.prelitCell){this.prelitCell.removeClass("jxGridCellPrelight")}this.prelitCell=C;if(this.prelitCell){this.prelitCell.addClass("jxGridCellPrelight")}}},selectCell:function(B,A){var C=(B>=0&&A>=0&&B<this.gridTableBody.rows.length-1&&A<this.gridTableBody.rows[B+1].cells.length-1)?this.gridTableBody.rows[B+1].cells[A+1]:null;if(!C){return }if(this.selectedCell){this.selectedCell.removeClass("jxGridCellSelected")}this.selectedCell=C;this.selectedCell.addClass("jxGridCellSelected")},selectRowHeader:function(C,B){var A=(C>=0&&C<this.rowTableHead.rows.length-1)?this.rowTableHead.rows[C+1].cells[1]:null;if(!A){return }if(B){A.addClass("jxGridRowHeaderSelected")}else{A.removeClass("jxGridRowHeaderSelected")}},selectRow:function(C,A){var B=(C>=0&&C<this.gridTableBody.rows.length-1)?this.gridTableBody.rows[C+1]:null;if(B){if(A){B.addClass("jxGridRowSelected")}else{B.removeClass("jxGridRowSelected")}this.selectRowHeader(C,A)}},selectColumnHeader:function(B,C){if(this.colTableBody.rows.length==0){return }var A=(B>=0&&B<this.colTableBody.rows[0].cells.length-1)?this.colTableBody.rows[0].cells[B+1]:null;if(A==null){return }if(C){A.addClass("jxGridColumnHeaderSelected")}else{A.removeClass("jxGridColumnHeaderSelected")}},selectColumn:function(A,C){if(A>=0&&A<this.gridTable.rows[0].cells.length){if(C){for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[A+1].addClass("jxGridColumnSelected")}}else{for(var B=0;B<this.gridTable.rows.length;B++){this.gridTable.rows[B].cells[A+1].removeClass("jxGridColumnSelected")}}this.selectColumnHeader(A,C)}},onMouseMoveGrid:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.cellPrelight){this.prelightCell(A.row,A.column)}if(this.options.rowPrelight){this.prelightRow(A.row)}if(this.options.rowHeaderPrelight){this.prelightRowHeader(A.row)}if(this.options.columnPrelight){this.prelightColumn(A.column)}if(this.options.columnHeaderPrelight){this.prelightColumnHeader(A.column)}},onMouseMoveRowHeader:function(B){if(this.options.rowPrelight){var A=this.getRowColumnFromEvent(B);this.prelightRow(A.row)}},onMouseMoveColumnHeader:function(B){if(this.options.columnPrelight){var A=this.getRowColumnFromEvent(B);this.prelightColumn(A.column)}},onClickGrid:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.cellSelection&&this.model.cellSelected){this.model.cellSelected(this,A.row,A.column)}if(this.options.rowSelection&&this.model.rowSelected){this.model.rowSelected(this,A.row)}if(this.options.columnSelection&&this.model.columnSelected){this.model.columnSelected(this,A.column)}},onClickRowHeader:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.rowSelection&&this.model.rowSelected){this.model.rowSelected(this,A.row)}},onClickColumnHeader:function(B){var A=this.getRowColumnFromEvent(B);if(this.options.columnSelection&&this.model.columnSelected){this.model.columnSelected(this,A.column)}},getRowColumnFromEvent:function(D){var F=D.target;if(F.tagName!="TD"&&F.tagName!="TH"){return{row:-1,column:-1}}var C=F.parentNode;var A=F.cellIndex-1;var E=C.rowIndex-1;if(A==-1){for(var B=0;B<C.childNodes.length;B++){if(C.childNodes[B]==F){A=B-1;break}}}return{row:E,column:A}}});Jx.Grid.Model=new Class({Family:"Jx.Grid.Model",Implements:[Events,Options],options:{colHeaderHeight:28,rowHeaderWidth:28,colWidth:50,rowHeight:20,rowHeaders:null,columnHeaders:null},data:null,initialize:function(B,A){this.data=B||[];this.setOptions(A)},getColumnCount:function(){return(this.data&&this.data[0])?this.data[0].length:0},getColumnHeaderHTML:function(A){return this.options.columnHeaders?this.options.columnHeaders[A]:A+1},getColumnHeaderHeight:function(){return this.options.colHeaderHeight},getColumnWidth:function(A){return this.options.colWidth},getRowHeaderHTML:function(A){return this.options.rowHeaders?this.options.rowHeaders[A]:A+1},getRowHeaderWidth:function(){return this.options.rowHeaderWidth},getRowHeight:function(A){return this.options.rowHeight},getRowCount:function(){return this.data.length},getValueAt:function(B,A){return(this.data&&$chk(this.data[B]))?this.data[B][A]:""},setColumnWidth:function(){},isCellEditable:function(){return false},setValueAt:function(C,A,B){},rowSelected:function(A,B){if(this.selectedRow!=null){A.selectRow(this.selectedRow,false)}this.selectedRow=B;A.selectRow(B,true);this.fireEvent("select-row",B)},columnSelected:function(B,A){if(this.selectedCol!=null){B.selectColumn(this.selectedCol,false)}this.selectedCol=A;B.selectColumn(A,true);this.fireEvent("select-column",A)},cellSelected:function(B,C,A){B.selectCell(C,A);this.fireEvent("select-cell",[C,A])}});Jx.Menu.Context=new Class({Family:"Jx.Menu.Context",Extends:Jx.Menu,initialize:function(A){this.parent();if($(A)){$(A).addEvent("contextmenu",this.show.bindWithEvent(this))}},show:function(A){if(this.items.length==0){return }this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.position(this.contentContainer,document.body,{horizontal:[A.page.x+" left"],vertical:[A.page.y+" top",A.page.y+" bottom"],offsets:this.chromeOffsets});this.contentContainer.setStyle("visibility","");this.showChrome(this.contentContainer);document.addEvent("mousedown",this.hideWatcher);document.addEvent("keyup",this.keypressWatcher);A.stop()}});Jx.Menu.Separator=new Class({Family:"Jx.Menu.Separator",domObj:null,owner:null,initialize:function(){this.domObj=new Element("li",{"class":"jxMenuItem"});var A=new Element("span",{"class":"jxMenuSeparator",html:"&nbsp;"});this.domObj.appendChild(A)},setOwner:function(A){this.owner=A},hide:$empty,show:$empty});Jx.Menu.SubMenu=new Class({Family:"Jx.Menu.SubMenu",Extends:Jx.Menu.Item,Implements:[Jx.AutoPosition,Jx.Chrome],subDomObj:null,owner:null,visibleItem:null,items:null,initialize:function(A){this.open=false;this.items=[];this.parent(A);this.domA.addClass("jxButtonSubMenu");this.contentContainer=new Element("div",{"class":"jxMenuContainer"});this.subDomObj=new Element("ul",{"class":"jxSubMenu"});this.contentContainer.adopt(this.subDomObj)},setOwner:function(A){this.owner=A},show:function(){if(this.open||this.items.length==0){return }this.contentContainer.setStyle("visibility","hidden");this.contentContainer.setStyle("display","block");$(document.body).adopt(this.contentContainer);this.contentContainer.setContentBoxSize(this.subDomObj.getMarginBoxSize());this.showChrome(this.contentContainer);this.position(this.contentContainer,this.domObj,{horizontal:["right left","left right"],vertical:["top top"],offsets:this.chromeOffsets});this.open=true;this.contentContainer.setStyle("visibility","");this.setActive(true)},eventInMenu:function(A){if(this.visibleItem&&this.visibleItem.eventInMenu&&this.visibleItem.eventInMenu(A)){return true}return $(A.target).descendantOf(this.domObj)||$(A.target).descendantOf(this.subDomObj)||this.items.some(function(B){return B instanceof Jx.Menu.SubMenu&&B.eventInMenu(A)})},hide:function(){if(!this.open){return }this.open=false;this.items.each(function(A){A.hide()});this.contentContainer.setStyle("display","none");this.visibleItem=null},add:function(){var A=this;$A(arguments).each(function(B){A.items.push(B);B.setOwner(A);A.subDomObj.adopt(B.domObj)});return this},insertBefore:function(C,D){var B=false;for(var A=0;A<this.items.length;A++){if(this.items[A]==D){this.items.splice(A,0,C);this.subDomObj.insertBefore(C.domObj,D.domObj);B=true;break}}if(!B){this.add(C)}},remove:function(B){for(var A=0;A<this.items.length;A++){if(this.items[A]==B){this.items.splice(A,1);this.subDomObj.removeChild(B.domObj);break}}},deactivate:function(A){if(this.owner){this.owner.deactivate(A)}},isActive:function(){if(this.owner){return this.owner.isActive()}else{return false}},setActive:function(A){if(this.owner&&this.owner.setActive){this.owner.setActive(A)}},setVisibleItem:function(A){if(this.visibleItem!=A){if(this.visibleItem&&this.visibleItem.hide){this.visibleItem.hide()}this.visibleItem=A;this.visibleItem.show()}}});Jx.Splitter.Snap=new Class({Family:"Jx.Splitter.Snap",snap:null,element:null,splitter:null,layout:"vertical",initialize:function(A,F,G,E){this.snap=A;this.element=F;var D=F.retrieve("jxLayout");D.addEvent("sizeChange",this.sizeChange.bind(this));this.splitter=G;this.layout=G.options.layout;var B=D.options;var C=this.element.getContentBoxSize();if(this.layout=="vertical"){this.originalSize=C.height;this.minimumSize=B.minHeight?B.minHeight:0}else{this.originalSize=C.width;this.minimumSize=B.minWidth?B.minWidth:0}E.each(function(H){A.addEvent(H,this.toggleElement.bind(this))},this)},toggleElement:function(){var A={};if(this.layout=="vertical"){if(this.element.clientHeight<=this.minimumSize){A.height=this.originalSize}else{this.originalSize=this.element.clientHeight;A.height=this.minimumSize}}else{if(this.element.clientWidth<=this.minimumSize){A.width=this.originalSize}else{this.originalSize=this.element.clientWidth;A.width=this.minimumSize}}this.element.resize(A);this.splitter.sizeChanged()},sizeChange:function(){var A=this.element.getContentBoxSize();if(this.layout=="vertical"){if(this.element.clientHeight==this.minimumSize){this.snap.addClass("jxSnapClosed");this.snap.removeClass("jxSnapOpened")}else{this.snap.addClass("jxSnapOpened");this.snap.removeClass("jxSnapClosed")}}else{if(this.element.clientWidth==this.minimumSize){this.snap.addClass("jxSnapClosed");this.snap.removeClass("jxSnapOpened")}else{this.snap.addClass("jxSnapOpened");this.snap.removeClass("jxSnapClosed")}}}});Jx.Toolbar=new Class({Family:"Jx.Toolbar",Implements:[Options,Events],items:null,domObj:null,isActive:false,options:{type:"Toolbar",position:"top",parent:null,autoSize:false,scroll:true},initialize:function(A){this.setOptions(A);this.items=[];this.domObj=new Element("ul",{id:this.options.id,"class":"jx"+this.options.type});if(this.options.parent){this.addTo(this.options.parent)}this.deactivateWatcher=this.deactivate.bindWithEvent(this);if(this.options.items){this.add(this.options.items)}},addTo:function(A){var B=$(A).retrieve("jxBarContainer");if(!B){B=new Jx.Toolbar.Container({parent:A,position:this.options.position,autoSize:this.options.autoSize,scroll:this.options.scroll})}B.add(this);return this},add:function(){$A(arguments).flatten().each(function(A){if(A.domObj){A=A.domObj}if(A.tagName=="LI"){if(!A.hasClass("jxToolItem")){A.addClass("jxToolItem")}this.domObj.appendChild(A)}else{var B=new Jx.Toolbar.Item(A);this.domObj.appendChild(B.domObj)}},this);if(arguments.length>0){this.fireEvent("add",this)}return this},remove:function(B){if(B.domObj){B=B.domObj}var A=B.findElement("LI");if(A&&A.parentNode==this.domObj){B.dispose();A.dispose();this.fireEvent("remove",this)}else{return null}},deactivate:function(){this.items.each(function(A){A.hide()});this.setActive(false)},isActive:function(){return this.isActive},setActive:function(A){this.isActive=A;if(this.isActive){document.addEvent("click",this.deactivateWatcher)}else{document.removeEvent("click",this.deactivateWatcher)}},setVisibleItem:function(A){if(this.visibleItem&&this.visibleItem.hide&&this.visibleItem!=A){this.visibleItem.hide()}this.visibleItem=A;if(this.isActive()){this.visibleItem.show()}},showItem:function(A){this.fireEvent("show",A)}});Jx.TabSet=new Class({Family:"Jx.TabSet",Implements:[Options,Events],tabs:null,domObj:null,initialize:function(B,A){this.setOptions(A);this.tabs=[];this.domObj=$(B);if(!this.domObj.hasClass("jxTabSetContainer")){this.domObj.addClass("jxTabSetContainer")}this.setActiveTabFn=this.setActiveTab.bind(this)},resizeTabBox:function(){if(this.activeTab&&this.activeTab.content.resize){this.activeTab.content.resize({forceResize:true})}},add:function(){$A(arguments).each(function(A){if(A instanceof Jx.Button.Tab){A.addEvent("down",this.setActiveTabFn);A.tabSet=this;this.domObj.appendChild(A.content);this.tabs.push(A);if((!this.activeTab||A.options.active)&&A.options.enabled){A.options.active=false;A.setActive(true)}}},this);return this},remove:function(A){if(A instanceof Jx.Button.Tab&&this.tabs.indexOf(A)!=-1){this.tabs.erase(A);if(this.activeTab==A){if(this.tabs.length){this.tabs[0].setActive(true)}}A.removeEvent("down",this.setActiveTabFn);A.content.dispose()}},setActiveTab:function(A){if(this.activeTab&&this.activeTab!=A){this.activeTab.setActive(false)}this.activeTab=A;if(this.activeTab.content.resize){this.activeTab.content.resize({forceResize:true})}this.fireEvent("tabChange",[this,A])}});Jx.TabBox=new Class({Family:"Jx.TabBox",Implements:[Options,Events,Jx.Addable],options:{parent:null,position:"top",height:null,width:null,scroll:true},tabBar:null,tabSet:null,initialize:function(A){this.setOptions(A);this.tabBar=new Jx.Toolbar({type:"TabBar",position:this.options.position,scroll:this.options.scroll});this.panel=new Jx.Panel({toolbars:[this.tabBar],hideTitle:true,height:this.options.height,width:this.options.width});this.panel.domObj.addClass("jxTabBox");this.tabSet=new Jx.TabSet(this.panel.content);this.tabSet.addEvent("tabChange",function(B,C){this.showItem(C)}.bind(this.tabBar));this.domObj=this.panel.domObj;this.panel.addEvent("sizeChange",(function(){this.tabSet.resizeTabBox();this.tabBar.domObj.getParent(".jxBarContainer").retrieve("jxBarContainer").update()}).bind(this));this.tabBar.addEvents({add:(function(){this.domObj.resize({forceResize:true})}).bind(this),remove:(function(){this.domObj.resize({forceResize:true})}).bind(this)});this.addEvent("addTo",function(){this.domObj.resize({forceResize:true})});if(this.options.parent){this.addTo(this.options.parent)}},add:function(){this.tabBar.add.apply(this.tabBar,arguments);this.tabSet.add.apply(this.tabSet,arguments);$A(arguments).flatten().each(function(A){A.addEvents({close:(function(){this.tabBar.remove(A);this.tabSet.remove(A)}).bind(this)})},this);return this},remove:function(A){this.tabBar.remove(A);this.tabSet.remove(A)}});Jx.Toolbar.Container=new Class({Family:"Jx.Toolbar.Container",Implements:[Options,Events,Jx.Addable],domObj:null,options:{parent:null,position:"top",autoSize:false,scroll:true},initialize:function(A){this.setOptions(A);var B=$(this.options.parent);this.domObj=B||new Element("div");this.domObj.addClass("jxBarContainer");if(this.options.scroll){this.scroller=new Element("div",{"class":"jxBarScroller"});this.domObj.adopt(this.scroller)}this.domObj.store("jxBarContainer",this);if(["top","right","bottom","left"].contains(this.options.position)){this.domObj.addClass("jxBar"+this.options.position.capitalize())}else{this.domObj.addClass("jxBarTop");this.options.position="top"}if(this.options.scroll&&["top","bottom"].contains(this.options.position)){this.addEvent("addTo",this.update.bind(this));if(typeof Fx!="undefined"&&typeof Fx.Tween!="undefined"){this.scrollFx=scrollFx=new Fx.Tween(this.scroller,{link:"chain"})}this.scrollLeft=new Jx.Button({image:Jx.aPixel.src}).addTo(this.domObj);this.scrollLeft.domObj.addClass("jxBarScrollLeft");this.scrollLeft.addEvents({click:(function(){var E=0;var C=this.scroller.getStyle("left");if(C){E=C.toInt()}if(isNaN(E)){E=0}var D=Math.min(E+100,0);if(D>=0){this.scrollLeft.domObj.setStyle("visibility","hidden")}this.scrollRight.domObj.setStyle("visibility","");if($defined(this.scrollFx)){this.scrollFx.start("left",E,D)}else{this.scroller.setStyle("left",D)}}).bind(this)});this.scrollRight=new Jx.Button({image:Jx.aPixel.src}).addTo(this.domObj);this.scrollRight.domObj.addClass("jxBarScrollRight");this.scrollRight.addEvents({click:(function(){var E=0;var C=this.scroller.getStyle("left");if(C){E=C.toInt()}if(isNaN(E)){E=0}var D=Math.max(E-100,this.scrollWidth);if(D==this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden")}this.scrollLeft.domObj.setStyle("visibility","");if($defined(this.scrollFx)){this.scrollFx.start("left",E,D)}else{this.scroller.setStyle("left",D)}}).bind(this)})}else{this.options.scroll=false}if(this.options.toolbars){this.add(this.options.toolbars)}},update:function(){if(this.options.autoSize){(function(){var A=0;this.scroller.getChildren().each(function(B){A+=B.getSize().x});this.domObj.setStyles({width:A});this.measure()}).delay(1,this)}else{this.measure()}},measure:function(){if((!this.scrollLeftSize||!this.scrollLeftSize.x)&&this.domObj.parentNode){this.scrollLeftSize=this.scrollLeft.domObj.getSize();this.scrollRightSize=this.scrollRight.domObj.getSize()}this.scrollWidth=this.domObj.getSize().x;this.scroller.getChildren().each(function(D){this.scrollWidth-=D.getSize().x},this);if(this.scrollWidth<0){var A=0;var B=this.scroller.getStyle("left");if(B){A=B.toInt()}if(A<0){this.scrollLeft.domObj.setStyle("visibility","")}else{this.scrollLeft.domObj.setStyle("visibility","hidden")}if(A<=this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden");if(A<this.scrollWidth){if($defined(this.scrollFx)){this.scrollFx.start("left",A,this.scrollWidth)}else{this.scroller.setStyle("left",this.scrollWidth)}}}else{this.scrollRight.domObj.setStyle("visibility","")}}else{this.scrollLeft.domObj.setStyle("visibility","hidden");this.scrollRight.domObj.setStyle("visibility","hidden");var C=0;var B=this.scroller.getStyle("left");if(B){C=B.toInt()}if(!isNaN(C)&&C!==0){if($defined(this.scrollFx)){this.scrollFx.start("left",0)}else{this.scroller.setStyle("left",0)}}}},add:function(){$A(arguments).flatten().each(function(A){if(this.options.scroll){A.addEvent("add",this.update.bind(this));A.addEvent("remove",this.update.bind(this));A.addEvent("show",this.scrollIntoView.bind(this))}if(this.scroller){this.scroller.adopt(A.domObj)}else{this.domObj.adopt(A.domObj)}this.domObj.addClass("jx"+A.options.type+this.options.position.capitalize())},this);if(this.options.scroll){this.update()}if(arguments.length>0){this.fireEvent("add",this)}return this},remove:function(A){},scrollIntoView:function(D){var C=this.domObj.getSize().x;var F=D.domObj.getCoordinates(this.scroller);var B=0;var E=this.scroller.getStyle("left");if(E){B=E.toInt()}if(B==="auto"||B.length<=0){B=0}else{B=B.toInt()}var H=this.scrollLeftSize?this.scrollLeftSize.x:0;var A=this.scrollRightSize?this.scrollRightSize.x:0;var G=B;if(B<-F.left+H){G=-F.left+H;if(G>=0){G=0}}else{if(C-F.right-A<B){G=C-F.right-A;if(G<this.scrollWidth){G=this.scrollWidth}}}if(G<0){this.scrollLeft.domObj.setStyle("visibility","")}else{this.scrollLeft.domObj.setStyle("visibility","hidden")}if(G<=this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden")}else{this.scrollRight.domObj.setStyle("visibility","")}if(G!=B){if($defined(this.scrollFx)){this.scrollFx.start("left",G)}else{this.scroller.setStyle("left",G)}}}});Jx.Toolbar.Item=new Class({Family:"Jx.Toolbar.Item",Implements:[Options],options:{active:true},domObj:null,initialize:function(A){this.al=[];this.domObj=new Element("li",{"class":"jxToolItem"});if(A){if(A.domObj){this.domObj.appendChild(A.domObj);if(A instanceof Jx.Button.Tab){this.domObj.addClass("jxTabItem")}}else{this.domObj.appendChild(A);if(A.hasClass("jxTab")){this.domObj.addClass("jxTabItem")}}}}});Jx.Toolbar.Separator=new Class({Family:"Jx.Toolbar.Separator",domObj:null,initialize:function(){this.domObj=new Element("li",{"class":"jxToolItem"});this.domSpan=new Element("span",{"class":"jxBarSeparator"});this.domObj.appendChild(this.domSpan)}});Jx.TreeItem=new Class({Family:"Jx.TreeItem",Implements:[Options,Events],domObj:null,owner:null,options:{label:"",data:null,contextMenu:null,enabled:true,type:"Item",image:null,imageClass:""},initialize:function(A){this.setOptions(A);this.domObj=new Element("li",{"class":"jxTree"+this.options.type});if(this.options.id){this.domObj.id=this.options.id}this.domNode=new Element("img",{"class":"jxTreeImage",src:Jx.aPixel.src,alt:"",title:""});this.domObj.appendChild(this.domNode);this.domLabel=(this.options.draw)?this.options.draw.apply(this):this.draw();this.domObj.appendChild(this.domLabel);this.domObj.store("jxTreeItem",this);if(!this.options.enabled){this.domObj.addClass("jxDisabled")}},draw:function(){var C=new Element("img",{"class":"jxTreeIcon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.image){C.setStyle("backgroundImage","url("+this.options.image+")")}if(this.options.imageClass){C.addClass(this.options.imageClass)}var D;var A;var B=new Element("a",{href:"javascript:void(0)",html:this.options.label});B.addEvents({click:this.selected.bind(this),dblclick:this.selected.bind(this),drag:function(E){E.stop()},contextmenu:function(E){E.stop()},mousedown:(function(E){B.addClass("jxTreeItemPressed");D=true;A=true;B.focus();if(E.rightClick&&this.options.contextMenu){this.options.contextMenu.show(E)}}).bind(this),mouseup:function(E){B.removeClass("jxTreeItemPressed");A=false},mouseleave:function(E){B.removeClass("jxTreeItemPressed")},mouseenter:function(E){if(D&&A){B.addClass("jxTreeItemPressed")}},keydown:function(E){if(E.key=="enter"){B.addClass("jxTreeItemPressed")}},keyup:function(E){if(E.key=="enter"){B.removeClass("jxTreeItemPressed")}},blur:function(){D=false}});B.appendChild(C);if(typeof Drag!="undefined"){new Drag(B,{onStart:function(){this.stop()}})}return B},finalize:function(){this.finalizeItem()},finalizeItem:function(){if(!this.domObj){return }this.options=null;this.domObj.dispose();this.domObj=null;this.owner=null},clone:function(){return new Jx.TreeItem(this.options)},update:function(B){var A=(arguments.length>1)?arguments[1]:(this.owner&&this.owner.isLastNode(this));if(A){this.domObj.removeClass("jxTree"+this.options.type);this.domObj.addClass("jxTree"+this.options.type+"Last")}else{this.domObj.removeClass("jxTree"+this.options.type+"Last");this.domObj.addClass("jxTree"+this.options.type)}},selected:function(A){this.fireEvent("click",this)},getName:function(){return this.options.label},propertyChanged:function(A){this.options.enabled=A.isEnabled();if(this.options.enabled){this.domObj.removeClass("jxDisabled")}else{this.domObj.addClass("jxDisabled")}}});Jx.TreeFolder=new Class({Family:"Jx.TreeFolder",Extends:Jx.TreeItem,subDomObj:null,nodes:null,options:{open:false},initialize:function(A){this.parent($merge(A,{type:"Branch"}));$(this.domNode).addEvent("click",this.clicked.bindWithEvent(this));this.addEvent("click",this.clicked.bindWithEvent(this));this.nodes=[];this.subDomObj=new Element("ul",{"class":"jxTree"});this.domObj.appendChild(this.subDomObj);if(this.options.open){this.expand()}else{this.collapse()}},finalize:function(){this.finalizeFolder();this.finalizeItem();this.subDomObj.dispose();this.subDomObj=null},finalizeFolder:function(){this.domObj.childNodes[0].removeEvents();for(var A=this.nodes.length-1;A>=0;A--){this.nodes[A].finalize();this.nodes.pop()}},clone:function(){var A=new Jx.TreeFolder(this.options);this.nodes.each(function(B){A.append(B.clone())});return A},isLastNode:function(A){if(this.nodes.length==0){return false}else{return this.nodes[this.nodes.length-1]==A}},update:function(C){if(!this.parent){return }var B=false;if(arguments.length>1){B=arguments[1]}else{B=(this.owner&&this.owner.isLastNode(this))}var D="jxTree"+this.options.type;D+=B?"Last":"";D+=this.options.open?"Open":"Closed";this.domObj.className=D;if(B){this.subDomObj.className="jxTree"}else{this.subDomObj.className="jxTree jxTreeNest"}if(this.nodes&&C){var A=this;this.nodes.each(function(F,E){F.update(false,E==A.nodes.length-1)})}},append:function(A){A.owner=this;this.nodes.push(A);this.subDomObj.appendChild(A.domObj);this.update(true);return this},insert:function(D,B){D.owner=this;if(!B){this.nodes.unshift(D);if(this.subDomObj.childNodes.length==0){this.subDomObj.appendChild(D.domObj)}else{this.subDomObj.insertBefore(D.domObj,this.subDomObj.childNodes[0])}}else{var A=false;for(var C=0;C<this.nodes.length;C++){if(this.nodes[C]==B){C=C+1;if(C<this.nodes.length){this.nodes.splice(C,0,D);this.subDomObj.insertBefore(D.domObj,this.subDomObj.childNodes[C]);A=true;break}}}if(!A){this.nodes.push(D);this.subDomObj.appendChild(D.domObj)}}this.update(true);return this},remove:function(B){B.owner=null;for(var A=0;A<this.nodes.length;A++){if(this.nodes[A]==B){this.nodes.splice(A,1);this.subDomObj.removeChild(this.subDomObj.childNodes[A]);break}}this.update(true);return this},replace:function(D,B){var A=false;for(var C=0;C<this.nodes.length;C++){if(this.nodes[C]==B){if(C<this.nodes.length){D.owner=this;this.nodes.splice(C,1,D);this.subDomObj.replaceChild(D.domObj,B.domObj);return true}}}return false},clicked:function(A){if(this.options.open){this.collapse()}else{this.expand()}},expand:function(){this.options.open=true;this.subDomObj.setStyle("display","block");this.update(true);this.fireEvent("disclosed",this)},collapse:function(){this.options.open=false;this.subDomObj.setStyle("display","none");this.update(true);this.fireEvent("disclosed",this)},findChild:function(C){if(C.length==0){return this}if(C.length==1){for(var B=0;B<this.nodes.length;B++){if(this.nodes[B].getName()==C[0]){return this.nodes[B]}}return null}var A=C.shift();for(var B=0;B<this.nodes.length;B++){if(this.nodes[B].getName()==A&&this.nodes[B].findChild){return this.nodes[B].findChild(C)}}return null}});Jx.Tree=new Class({Extends:Jx.TreeFolder,Implements:[Jx.Addable],Family:"Jx.Tree",initialize:function(A){this.parent(A);this.subDomObj=new Element("ul",{"class":"jxTreeRoot"});this.nodes=[];this.isOpen=true;this.addable=this.subDomObj;if(this.options.parent){this.addTo(this.options.parent)}},finalize:function(){this.clear();this.subDomObj.parentNode.removeChild(this.subDomObj)},clear:function(){for(var A=this.nodes.length-1;A>=0;A--){this.subDomObj.removeChild(this.nodes[A].domObj);this.nodes[A].finalize();this.nodes.pop()}},update:function(A){var B=true;if(this.subDomObj){if(B){this.subDomObj.removeClass("jxTreeNest")}else{this.subDomObj.addClass("jxTreeNest")}}if(this.nodes&&A){this.nodes.each(function(C){C.update(false)})}},append:function(A){A.owner=this;this.nodes.push(A);this.subDomObj.appendChild(A.domObj);this.update(true);return this}});Fusion.Error=OpenLayers.Class({type:null,message:null,initialize:function(A,B){this.type=A;this.message=B},alert:function(){var A=this.typeToString(this.type);alert(OpenLayers.i18n("fusionError",{type:A,message:this.message}))},toString:function(){var A=this.typeToString(this.type);return A+": "+this.message},typeToString:function(A){switch(A){case Fusion.Error.FATAL:return"FATAL";case Fusion.Error.WARNING:return"WARNING";case Fusion.Error.NOTICE:return"NOTICE";default:return"UNKNOWN ("+A+")"}}});Fusion.Error.FATAL=0;Fusion.Error.WARNING=1;Fusion.Error.NOTICE=2;Fusion.Lib.EventMgr=OpenLayers.Class({events:null,initialize:function(){if(!this.events){this.events=[]}},destroy:function(){this.events=[]},registerEventID:function(A){if(!this.events){this.events=[]}if(!A){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,OpenLayers.i18n("regsiterEventError")))}var B=new String(A);if(!this.events[A]){this.events[A]=[]}},registerForEvent:function(A,C){var B=new String(A);this.events[A].push(C)},deregisterForEvent:function(C,E){var D=new String(C);var A=false;if(!this.events[C]){return false}for(var B=0;B<this.events[C].length;B++){if(this.events[C][B]==E){this.events[C].splice(B,1);A=true}}return A},triggerEvent:function(B){var C=new String(B);if(!this.events||!this.events[B]){return false}for(var A=0;A<this.events[B].length;A++){this.events[B][A].apply(null,arguments)}return true}});Fusion.events=[];Fusion.registerEventID=Fusion.Lib.EventMgr.prototype.registerEventID;Fusion.registerForEvent=Fusion.Lib.EventMgr.prototype.registerForEvent;Fusion.triggerEvent=Fusion.Lib.EventMgr.prototype.triggerEvent;Fusion.Event.FUSION_INITIALIZED=Fusion.Event.lastEventId++;Fusion.Event.FUSION_ERROR=Fusion.Event.lastEventId++;Fusion.registerEventID(Fusion.Event.FUSION_INITIALIZED);Fusion.registerEventID(Fusion.Event.FUSION_ERROR);Fusion.Lib.ApplicationDefinition=OpenLayers.Class({mapGroups:null,widgetSets:null,oBroker:null,searchDefinitions:null,searchCategories:null,initialize:function(A){this.sessionId=A;this.oBroker=Fusion.getBroker();this.applicationDefinition=Fusion.getApplicationDefinitionURL();this.widgetSets=[];this.mapGroups={};this.searchDefinitions=[];this.searchCategories=[];this.parse()},parse:function(){if(this.applicationDefinition==""){return null}if((this.applicationDefinition.match("Library://")==null)&&(this.applicationDefinition.match("Session:")==null)){if(Fusion.appDefJson){this.parseAppDef(Fusion.appDefJson)}else{Fusion.getXmlAsJson(this.applicationDefinition,OpenLayers.Function.bind(this.getAppDefCB,this))}}else{if(!this.sessionId){window.setTimeout(OpenLayers.Function.bind(this.createSessionThenGetAppDef,this),5)}else{window.setTimeout(OpenLayers.Function.bind(this.getAppDef,this),5)}}return true},createSessionThenGetAppDef:function(){var A=Fusion.getScriptLanguage();var C="layers/MapGuide/"+A+"/CreateSession."+A;var B={onSuccess:OpenLayers.Function.bind(this.createSessionThenGetAppDefCB,this)};Fusion.ajaxRequest(C,B)},createSessionThenGetAppDefCB:function(xhr){if(xhr&&typeof (xhr)=="object"&&xhr.responseText){var o;eval("o="+xhr.responseText);this.sessionId=o.sessionId;Fusion.sessionId=this.sessionId}this.getAppDef()},getAppDef:function(){var A=new Fusion.Lib.MGRequest.MGGetResourceContent(this.applicationDefinition);A.parameters.session=this.sessionId;A.parameters.format="application/json";this.oBroker.dispatchRequest(A,OpenLayers.Function.bind(this.getAppDefCB,this))},getAppDefCB:function(xhr){var o;eval("o="+xhr.responseText);this.parseAppDef(o);Fusion.setLoadState(Fusion.LOAD_WIDGETS)},parseAppDef:function(N){var A=N.ApplicationDefinition;if(A.Title){var K=A.Title[0];document.title=K}if(A.MapSet){var I=A.MapSet[0];if(I.MapGroup instanceof Array){for(var F=0;F<I.MapGroup.length;F++){var C=new Fusion.Lib.ApplicationDefinition.MapGroup(I.MapGroup[F]);this.mapGroups[C.mapId]=C}}}else{Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("appDefParseError")))}if(A.WidgetSet){for(var F=0;F<A.WidgetSet.length;F++){var D=new Fusion.Lib.ApplicationDefinition.WidgetSet(A.WidgetSet[F]);this.widgetSets.push(D)}}else{Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("widgetSetParseError")))}if(A.Extension){var M=A.Extension[0];if(M.SearchDefinitions instanceof Array){var G=M.SearchDefinitions[0];if(G.SearchCategory instanceof Array){for(var F=0;F<G.SearchCategory.length;F++){var J={};var B=G.SearchCategory[F];J.id=B["@id"];J.name=B["@name"];J.layer=B.Layer?B.Layer[0]:"";J.searchDefinitions=[];this.searchCategories[J.id]=J;var L=B.SearchDefinition;for(var E=0;E<L.length;E++){var H=new Fusion.Lib.ApplicationDefinition.SearchDefinition(L[E]);H.category=J;J.searchDefinitions[H.id]=H;this.searchDefinitions[H.id]=H}}}}}},create:function(){for(var A=0;A<this.widgetSets.length;A++){this.widgetSets[A].create(this)}},getMapByName:function(A){var C=null;for(var B=0;B<this.widgetSets.length;B++){C=this.widgetSets[B].getMapByName(A);if(C){break}}return C},getMapById:function(C){var B=null;for(var A=0;A<this.widgetSets.length;A++){B=this.widgetSets[A].mapWidget;if(B.mapId==C){break}}return B},getMapByIndice:function(B){var A=null;if(this.widgetSets.length>B){A=this.widgetSets[B].getMapWidget()}return A},getMapGroup:function(A){return this.mapGroups[A]},getWidgetsByType:function(C){var B=[];for(var A=0;A<this.widgetSets.length;A++){B=B.concat(this.widgetSets[A].getWidgetsByType(C))}return B}});Fusion.Lib.ApplicationDefinition.MapGroup=OpenLayers.Class({initialView:null,maps:null,initialize:function(H){this.mapId=H["@id"][0];this.maps=[];if(H.InitialView){var C=H.InitialView[0];if(C.CenterX&&C.CenterY&&C.Scale){this.setInitialView({x:parseFloat(C.CenterX[0]),y:parseFloat(C.CenterY[0]),scale:parseFloat(C.Scale[0])})}else{if(C.MinX&&C.MinY&&C.MaxX&&C.MaxY){this.setInitialView({minX:parseFloat(C.MinX[0]),minY:parseFloat(C.MinY[0]),maxX:parseFloat(C.MaxX[0]),maxY:parseFloat(C.MaxY[0])})}else{}}}if(H.Map instanceof Array){for(var E=0;E<H.Map.length;E++){var A=new Fusion.Lib.ApplicationDefinition.Map(H.Map[E]);var L={groups:[],layers:[]};var I={layerEvents:{},groupEvents:{}};if(H.Map[E].Extension){var K=H.Map[E].Extension[0];if(K.Links){if(K.Links[0].Group instanceof Array){for(var D=0;D<K.Links[0].Group.length;D++){var J=K.Links[0].Group[D];L.groups.push({name:J.Name[0],url:J.Url[0]})}}if(K.Links[0].Layer instanceof Array){for(var D=0;D<K.Links[0].Layer.length;D++){var F=K.Links[0].Layer[D];L.layers.push({name:F.Name[0],url:F.Url[0]})}}}if(K.MapEvents){if(K.MapEvents[0].Layer instanceof Array){for(var D=0;D<K.MapEvents[0].Layer.length;D++){var F=K.MapEvents[0].Layer[D];var B={};B.name=F.Name[0];B.onEnable=[];if(F.OnEnable instanceof Array){B.onEnable=this.parseMapEventSubBlock(F.OnEnable[0])}B.onDisable=[];if(F.OnDisable instanceof Array){B.onDisable=this.parseMapEventSubBlock(F.OnDisable[0])}I.layerEvents[B.name]=B}}if(K.MapEvents[0].Group instanceof Array){for(var D=0;D<K.MapEvents[0].Group.length;D++){var J=K.MapEvents[0].Group[D];var G={};G.name=J.Name[0];G.onEnable=[];if(F.OnEnable instanceof Array){G.onEnable=this.parseMapEventSubBlock(J.OnEnable[0])}G.onDisable=[];if(F.OnDisable instanceof Array){G.onDisable=this.parseMapEventSubBlock(J.OnDisable[0])}I.groupEvents[G.name]=G}}}}A.mapInfo={links:L,mapEvents:I};this.maps.push(A)}}else{}},parseMapEventSubBlock:function(E){var A=[];if(E.Layer&&E.Layer instanceof Array){for(var C=0;C<E.Layer.length;C++){var B=E.Layer[C];A.push({type:"layer",name:B.Name[0],enable:B.Enable[0]=="true"?true:false})}}if(E.Group&&E.Group instanceof Array){for(var C=0;C<E.Group.length;C++){var D=E.Group[C];A.push({type:"group",name:D.Name[0],enable:D.Enable[0]=="true"?true:false})}}return A},getInitialView:function(){return this.initialView},setInitialView:function(A){this.initialView=A}});Fusion.Lib.ApplicationDefinition.Map=OpenLayers.Class({type:null,singleTile:false,extension:null,initialize:function(D){this.type=D.Type[0];if(D.SingleTile){var A=D.SingleTile[0].toLowerCase();this.singleTile=(A=="true")?true:false}if(D.Extension){this.extension=D.Extension[0]}else{this.extension={}}this.resourceId=this.extension.ResourceId?this.extension.ResourceId[0]:"";var B=this.extension.Options;this.layerOptions={};if(B&&B[0]){for(var C in B[0]){this.layerOptions[C]=B[0][C][0];if(this.layerOptions[C].toLowerCase()=="true"){this.layerOptions[C]=true}else{if(this.layerOptions[C].toLowerCase()=="false"){this.layerOptions[C]=false}}if(C=="maxExtent"||C=="minExtent"){this.layerOptions[C]=OpenLayers.Bounds.fromString(this.layerOptions[C])}}}var E=this.extension.Parameters;this.layerParams={};if(E&&E[0]){for(var C in E[0]){this.layerParams[C]=E[0][C][0]}}switch(this.type){case"MapGuide":case"MapServer":if(!Fusion.Layers[this.type]){Fusion.require("layers/"+this.type+"/"+this.type+".js")}break;default:if(!Fusion.Layers.Generic){Fusion.require("layers/Generic/Generic.js")}break}}});Fusion.Lib.ApplicationDefinition.WidgetSet=OpenLayers.Class({containers:null,containersByName:null,widgetTags:null,widgetTagsByName:null,widgetInstances:null,mapWidget:null,mapId:null,initialize:function(C){this.containers=[];this.widgetTags=[];this.widgetInstances=[];this.widgetTagsByName={};this.containersByName={};if(C.MapWidget){for(var B=0;B<C.MapWidget.length;B++){var D=new Fusion.Lib.ApplicationDefinition.Widget(C.MapWidget[B]);D.widgetSet=this;this.mapWidgetTag=D;this.mapId=C.MapWidget[B].MapId[0]}}if(C.Widget){for(var B=0;B<C.Widget.length;B++){var D=new Fusion.Lib.ApplicationDefinition.Widget(C.Widget[B]);D.widgetSet=this;this.widgetTags.push(D);this.widgetTagsByName[D.name]=D}}if(C.Container){for(var B=0;B<C.Container.length;B++){var A=new Fusion.Lib.ApplicationDefinition.Container(C.Container[B]);this.containers.push(A);this.containersByName[A.name]=A}}},addWidgetInstance:function(A){this.widgetInstances.push(A)},getMapWidget:function(){return this.mapWidget},create:function(A){var D=null;var C=Fusion.getQueryParam("mapid");if(C.length>0){D=A.getMapGroup(C);if(D){this.mapId=C}else{Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"can't find MapGroup: "+C+" - reverting to default map"))}}if(!D){D=A.getMapGroup(this.mapId)}this.mapWidget=new Fusion.Widget.Map(this.mapWidgetTag,D,this);this.mapWidget.setMenu();$(this.mapWidgetTag.name).widget=this.mapWidget;for(var B=0;B<this.widgetTags.length;B++){this.widgetTags[B].create(this)}for(var B=0;B<this.containers.length;B++){this.containers[B].create(this)}},getMapByName:function(A){var B=null;if(this.mapWidget.getMapName()==A){B=this.mapWidget}return B},getWidgetsByType:function(C){var B=[];for(var A=0;A<this.widgetInstances.length;A++){if(this.widgetInstances[A].type==C){B.push(this.widgetInstances[A])}}return B},getWidgetByName:function(A){return this.widgetTagsByName[A]},getContainerByName:function(A){return this.containersByName[A]}});Fusion.Lib.ApplicationDefinition.Container=OpenLayers.Class({name:null,type:null,validPositions:["top","left","bottom","right"],position:"top",items:null,initialize:function(C){this.type=C.Type[0];this.name=C.Name[0];var A=C.Position?C.Position[0].toLowerCase():this.position;for(var B=0;B<this.validPositions.length;B++){if(this.validPositions[B]==A){this.position=A;break}}this.items=[];if(C.Item){for(var B=0;B<C.Item.length;B++){var D=new Fusion.Lib.ApplicationDefinition.Item(C.Item[B]);this.items.push(D)}}else{}},create:function(C){var A;if(this.type=="Toolbar"||this.type=="Statusbar"){if($(this.name)){A=new Jx.Toolbar({parent:this.name,position:this.position});$(this.name).container=A;this.createWidgets(C,A)}}else{if(this.type=="Splitterbar"){if($(this.name)){A=new Jx.Splitter(this.name,{splitInto:this.items.length});for(var B=0;B<this.items.length;B++){A.elements[B].id=this.name+"_"+B}$(this.name).container=A;this.createWidgets(C,A)}}}if(A&&A.domObj.jxLayout){A.domObj.jxLayout.resize({forceResize:true})}},createWidgets:function(C,A){for(var B=0;B<this.items.length;B++){this.items[B].create(C,A,this.name+"_"+B)}}});Fusion.Lib.ApplicationDefinition.Widget=OpenLayers.Class({name:null,type:null,statusText:null,location:null,imageUrl:null,imageClass:null,tooltip:null,label:null,disabled:null,extension:null,initialize:function(A){if(A){this.type=A.Type[0];this.name=A.Name?A.Name[0]:"";this.statusText=A.StatusText?A.StatusText[0]:"";this.statusText=OpenLayers.i18n(this.statusText);this.location=A.Location?A.Location[0]:"widgets/";if(this.location.slice(-1)!="/"){this.location+="/"}this.imageUrl=A.ImageUrl?A.ImageUrl[0]:"";this.imageClass=A.ImageClass?A.ImageClass[0]:"";this.tooltip=A.Tooltip?A.Tooltip[0]:"";this.tooltip=OpenLayers.i18n(this.tooltip);this.label=A.Label?A.Label[0]:"";this.label=OpenLayers.i18n(this.label);this.disabled=A.Disabled?(A.Disabled[0].toLowerCase()=="true"?true:false):false;if(A.Extension){this.extension=A.Extension[0]}else{this.extension={}}if(!Fusion.Widget[this.type]){Fusion.require(this.location+this.type+".js")}}},getMapWidget:function(){if(this.widgetSet){return this.widgetSet.getMapWidget()}else{return null}},create:function(widgetSet,widgetName){var widget=null;this.widgetSet=widgetSet;var oldName=this.name;if(typeof widgetName=="undefined"){widgetName=this.name}if(widgetName!=null&&(widgetName==""||$(widgetName)!=null)){this.name=widgetName;widget=eval("new Fusion.Widget."+this.type+"(this)");widgetSet.addWidgetInstance(widget);if($(this.name)){widget.id=this.name;$(this.name).widget=widget;if(widget.uiClass){widget.setUiObject(new widget.uiClass({label:this.label,image:this.imageUrl,imageClass:this.imageClass,toggle:this.isExclusive}));if(widget.uiObj.addTo){widget.uiObj.addTo($(this.name))}if(widget.uiObj.setEnabled){widget.uiObj.setEnabled(widget.isEnabled());widget.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){widget.uiObj.setEnabled(widget.isEnabled())})}}}this.name=oldName}return widget}});Fusion.Lib.ApplicationDefinition.Item=OpenLayers.Class({uniqueId:[0],type:null,initialize:function(A){this.type=A.Function[0];switch(this.type){case"Widget":this.widgetName=A.Widget[0];break;case"Flyout":this.flyout=new Fusion.Lib.ApplicationDefinition.Flyout(A);break;case"Multi":this.multi=new Fusion.Lib.ApplicationDefinition.Multi(A);break;case"Separator":break}},create:function(E,B,I){switch(this.type){case"Widget":var F=E.getWidgetByName(this.widgetName);if(F){var A="FusionItem"+this.uniqueId[0];this.uniqueId[0]++;if(B instanceof Jx.Toolbar){var G=F.create(E,"");if(!G.uiClass){G.uiClass=Jx.Toolbar.Item;G.setUiObject(new G.uiClass())}else{if(G.uiClass==Jx.Button||G.uiClass==Jx.Button.Color||G.uiClass==Jx.Menu||G.uiClass==Jx.Button.Flyout){G.setUiObject(new G.uiClass({label:F.label,image:F.imageUrl,imageClass:F.imageClass,toggle:G.isExclusive}))}}B.add(G.uiObj);if(G.uiObj.setEnabled){G.uiObj.setEnabled(G.isEnabled());G.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){G.uiObj.setEnabled(G.isEnabled())})}}else{if(B instanceof Jx.Splitter){var G=F.create(E,I)}else{if(B instanceof Jx.Menu||B instanceof Jx.Menu.Context||B instanceof Jx.Menu.SubMenu){var G=F.create(E,"");if(!G.uiClass||G.uiClass==Jx.Button){G.uiClass=Jx.Menu.Item}else{if(G.uiClass==Jx.Menu){G.uiClass=Jx.Menu.SubMenu}}G.setUiObject(new G.uiClass({label:F.label,image:F.imageUrl,imageClass:F.imageClass,toggle:G.isExclusive}));B.add(G.uiObj);if(G.uiObj.setEnabled){G.uiObj.setEnabled(G.isEnabled());G.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){G.uiObj.setEnabled(G.isEnabled())})}}else{if(B instanceof Jx.Button.Multi){var G=F.create(E,"");G.uiClass=Jx.Button;G.setUiObject(new G.uiClass({label:F.label,image:F.imageUrl,imageClass:F.imageClass,toggle:G.isExclusive}));B.add(G.uiObj);if(G.uiObj.setEnabled){G.uiObj.setEnabled(G.isEnabled());G.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){G.uiObj.setEnabled(G.isEnabled())})}}}}}}else{Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"can't find widget: "+this.widgetName))}break;case"Flyout":var D;var C={label:this.flyout.label,tooltip:this.flyout.tooltip,image:this.flyout.imageUrl,imageClass:this.flyout.imageClass};if(B instanceof Jx.Toolbar){D=new Jx.Menu(C)}else{if(B instanceof Jx.Menu||B instanceof Jx.Menu.Context||B instanceof Jx.Menu.SubMenu){D=new Jx.Menu.SubMenu(C)}}B.add(D);this.flyout.create(E,D);break;case"Multi":var H;var C={label:this.multi.label,tooltip:this.multi.tooltip,image:this.multi.imageUrl,imageClass:this.multi.imageClass};H=new Jx.Button.Multi(C);B.add(H);this.multi.create(E,H);break;case"Separator":if(B instanceof Jx.Toolbar){B.add(new Jx.Toolbar.Separator())}else{if(B instanceof (Jx.Menu)||B instanceof (Jx.Menu.SubMenu)||B instanceof (Jx.Menu.Context)){B.add(new Jx.Menu.Separator())}}break}}});Fusion.Lib.ApplicationDefinition.Flyout=OpenLayers.Class({label:null,tooltip:null,description:null,imageUrl:null,items:null,initialize:function(B){this.label=B.Label?B.Label[0]:"";this.tooltip=B.Tooltip?B.Tooltip[0]:"";this.description=B.Description?B.Description[0]:"";this.imageUrl=B.ImageUrl?B.ImageUrl[0]:"";this.items=[];if(B.Item instanceof Array){for(var A=0;A<B.Item.length;A++){this.items.push(new Fusion.Lib.ApplicationDefinition.Item(B.Item[A]))}}},create:function(B,C){for(var A=0;A<this.items.length;A++){this.items[A].create(B,C)}}});Fusion.Lib.ApplicationDefinition.Multi=OpenLayers.Class({label:null,tooltip:null,description:null,imageUrl:null,items:null,initialize:function(B){this.label=B.Label?B.Label[0]:"";this.tooltip=B.Tooltip?B.Tooltip[0]:"";this.description=B.Description?B.Description[0]:"";this.imageUrl=B.ImageUrl?B.ImageUrl[0]:"";this.items=[];if(B.Item instanceof Array){for(var A=0;A<B.Item.length;A++){this.items.push(new Fusion.Lib.ApplicationDefinition.Item(B.Item[A]))}}},create:function(B,C){for(var A=0;A<this.items.length;A++){this.items[A].create(B,C)}}});Fusion.Lib.ApplicationDefinition.SearchDefinition=OpenLayers.Class({id:null,name:null,category:null,parameters:null,join:null,rule:null,initialize:function(C){this.id=C["@id"];this.name=C["@name"];if(C.Join instanceof Array){this.join=new Fusion.Lib.ApplicationDefinition.SearchJoin(C.Join[0])}this.parameters=[];if(C.Parameter instanceof Array){for(var B=0;B<C.Parameter.length;B++){this.parameters.push(C.Parameter[B]["@name"])}}this.reports=[];if(C.Report instanceof Array){for(var B=0;B<C.Report.length;B++){var A=C.Report[B].Label[0];var D=C.Report[B].Link[0];this.reports.push({label:A,link:D})}}var E;if(C.SearchAnd instanceof Array){this.rule=new Fusion.Lib.ApplicationDefinition.SearchRule("AND");E=C.SearchAnd[0]}else{if(C.SearchOr instanceof Array){this.rule=new Fusion.Lib.ApplicationDefinition.SearchRule("OR");E=C.SearchOr[0]}}if(E&&E.SearchCondition instanceof Array){for(var B=0;B<E.SearchCondition.length;B++){this.rule.add(new Fusion.Lib.ApplicationDefinition.SearchCondition(E.SearchCondition[B]))}}},getJoinUrl:function(A){if(this.join){return"&joinlayer="+this.join.layer+"&joinpk="+this.join.primaryKey+"&joinfk="+this.join.foreignKey}else{return""}},getFilterUrl:function(A){return"&filter="+encodeURIComponent(this.rule.toString(A))}});Fusion.Lib.ApplicationDefinition.SearchJoin=OpenLayers.Class({layer:null,primaryKey:null,foreignKey:null,initialize:function(A){this.layer=A.Layer?A.Layer[0]:"";this.primaryKey=A.PrimaryKey?A.PrimaryKey[0]:"";this.foreignKey=A.ForeignKey?A.ForeignKey[0]:""}});Fusion.Lib.ApplicationDefinition.SearchRule=OpenLayers.Class({type:null,conditions:null,initialize:function(A){this.type=A;this.conditions=[]},add:function(A){this.conditions.push(A)},remove:function(B){for(var A=0;A<this.conditions.length;A++){if(this.conditions[A]==B){this.conditions.splice(A,1);break}}},toString:function(C){var B=[];for(var A=0;A<this.conditions.length;A++){this.conditions[A].setParams(C);var D=this.conditions[A].toString();if(D!=""){B.push(D)}}return"("+B.join(") "+this.type+" (")+")"}});Fusion.Lib.ApplicationDefinition.SearchCondition=OpenLayers.Class({column:null,operator:null,parameter:null,quote:null,value:null,operators:{eq:"=",like:"like",lt:"<",lte:"<=",gt:">",gte:">=",neq:"<>"},includeIfEmpty:false,initialize:function(A){this.column=A.Column[0];this.operator=this.operators[A.Operator[0].toLowerCase()];this.parameter=A.Parameter[0];this.quote=A["@quote"]?A["@quote"]:"";this.wildcard=A["@wildcard"]?A["@wildcard"]:"both";this.caseSensitive=true;if(A["@caseSensitive"]&&A["@caseSensitive"]=="false"){this.caseSensitive=false}},setParams:function(A){if(A[this.parameter]){this.value=A[this.parameter]}else{this.value=""}},toString:function(){var E=this.value?this.value:"";if(E==""&&!this.includeIfEmpty){return""}var D="";if(!this.caseSensitive){E=E.toUpperCase();D="Upper"}var C="";var C="";var A="";if(this.operator=="like"){if(this.wildcard=="before"||this.wildcard=="both"){C="*"}if(this.wildcard=="after"||this.wildcard=="both"){A="*"}}var B=this.operator=="like"?"*":"";return D+"("+this.column+") "+this.operator+" "+this.quote+C+E+A+this.quote}});Fusion.Lib.MGBroker=OpenLayers.Class({mapGuideURL:"",mapAgentURL:"",method:null,initialize:function(){},dispatchRequest:function(C,D){var B=C.encode()+"&ts="+(new Date()).getTime();if(this.method){C.options.method=this.method}var A=new OpenLayers.Ajax.Request(this.mapAgentURL,OpenLayers.Util.extend({parameters:C.parameters,onComplete:D},C.options));A.originalRequest=C},setSiteURL:function(B,A,C){this.user=A;this.pass=C;if(B.indexOf("mapagent.fcgi")==-1){if(B.charAt(B.length-1)!="/"){B=B+"/"}this.mapGuideURL=B;B=B+"mapagent/mapagent.fcgi"}this.mapAgentURL=B},clearSiteURL:function(){this.user="";this.pass="";this.mapGuideURL="";this.mapAgentURL=""}});Fusion.Lib.MGRequest=OpenLayers.Class({options:null,parameters:null,initializeRequest:function(){this.options={method:"post"};this.parameters={version:"1.0.0",locale:Fusion.locale,clientagent:"Fusion Viewer"}},setParams:function(A){OpenLayers.Util.extend(this.parameters,(A||{}))},setOptions:function(A){OpenLayers.Util.extend(this.options,(A||{}))},encode:function(){var A=sep="";for(var B in this.parameters){if(this.parameters[B]){A=A+sep+B+"="+encodeURI(this.parameters[B])}sep="&"}return A}});Fusion.Lib.MGRequest.MGEnumerateResources=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(C,A,B){this.initializeRequest();this.setParams({operation:"ENUMERATERESOURCES",resourceid:(C||"Library://"),type:(A||""),depth:(typeof B=="undefined"?-1:B)})}});Fusion.Lib.MGRequest.MGGetResourceContent=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(A){this.initializeRequest();this.setParams({operation:"GETRESOURCECONTENT",resourceid:(A||"Library://")})}});Fusion.Lib.MGRequest.MGGetResourceHeader=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(A){this.initializeRequest();this.setParams({operation:"GETRESOURCEHEADER",resourceid:(A||"Library://")})}});Fusion.Lib.MGRequest.MGCreateSession=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(){this.initializeRequest();this.setParams({operation:"CREATESESSION"})}});Fusion.Lib.MGRequest.MGCopyResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B,C,A){this.initializeRequest();this.setParams({operation:"COPYRESOURCE",source:B,destination:C,overwrite:A})}});Fusion.Lib.MGRequest.MGDeleteResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(A){this.initializeRequest();this.setParams({operation:"DELETERESOURCE",resourceid:A})}});Fusion.Lib.MGRequest.MGMoveResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B,C,A){this.initializeRequest();this.setParams({operation:"MOVERESOURCE",source:B,destination:C,overwrite:A})}});Fusion.Lib.MGRequest.MGMoveResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B,A,C){this.initializeRequest();this.setParams({method:"post",operation:"SETRESOURCE",resourceid:B,content:A,header:C})}});Fusion.Lib.MGRequest.MGDescribeSchema=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B,A){this.initializeRequest();this.setParams({operation:"DESCRIBEFEATURESCHEMA",resourceid:B,schema:A})}});Fusion.Lib.MGRequest.MGGetSpatialContexts=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B,A){this.initializeRequest();this.setParams({operation:"GETSPATIALCONTEXTS",resourceid:B,activeonly:A?"1":"0"})}});Fusion.Lib.MGRequest.MGEnumerateResourceReferences=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(A){this.initializeRequest();this.setParams({operation:"ENUMERATERESOURCEREFERENCES",resourceid:A})}});Fusion.Lib.MGRequest.MGEnumerateResourceData=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(A){this.initializeRequest();this.setParams({operation:"ENUMERATERESOURCEDATA",resourceid:A})}});Fusion.Lib.MGRequest.MGGetVisibleMapExtent=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(D,I,H,G,J,L,N,M,B,F,K,C,E,A){this.initializeRequest();this.setParams({operation:"GETVISIBLEMAPEXTENT",session:D,mapname:I,setviewcenterx:H,setviewcentery:G,setviewscale:J,setdataextent:L,setdisplaydpi:N,setdisplaywidth:M,setdisplayheight:B,showlayers:F,hidelayers:K,showgroups:C,hidegroups:E,refreshlayers:A})}});Fusion.Lib.MGRequest.MGQueryMapFeatures=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(H,C,G,B,D,A,F,E){this.initializeRequest();this.setParams({operation:"QUERYMAPFEATURES",session:H,mapname:C,geometry:G,maxFeatures:B,persist:D,selectionVariant:A,layerNames:F,layerAttributeFilter:E})}});Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(C,B,A){this.initializeRequest();this.setParams({operation:"GETFEATURESETENVELOPE",session:C,mapname:B,featureSet:A})}});Fusion.Event.WIDGET_STATE_CHANGED=Fusion.Event.lastEventId++;Fusion.Widget=OpenLayers.Class(Fusion.Lib.EventMgr,{isExclusive:false,name:null,type:null,oMap:null,enabled:false,mapLoadedWatcher:null,paramRegister:null,groups:[],group:null,domObj:null,uiClass:null,initialize:function(A){this.type=A.type;this.name=A.name;this.widgetTag=A;this.registerEventID(Fusion.Event.WIDGET_STATE_CHANGED);if(!Fusion.Widget.uiInstances[this.type]){Fusion.Widget.uiInstances[this.type]=[]}var B=A.extension.Group?A.extension.Group[0]:"";if(B!=""){if(!this.groups[B]){this.groups[B]=[]}this.groups[B].push(this);this.group=B}this.setMap(A.getMapWidget());if(A.name){this.domObj=$(A.name)}this.paramRegister=[];this.initializeWidget(A)},initializeWidget:function(){},activate:function(){},deactivate:function(){},setUiObject:function(A){Fusion.Widget.uiInstances[this.type].push(this);if(this.widgetTag.tooltip){if(A.setTooltip){A.setTooltip(this.widgetTag.tooltip)}else{if(A.button&&A.button.setTooltip){A.button.setTooltip(this.widgetTag.tooltip)}}}if(this.isExclusive){this.getMap().buttonSet.add(A)}if(A.options.active){this.activate()}if(A.addEvents){if(Fusion.Widget.uiInstances[this.type][0].uiObj&&Fusion.Widget.uiInstances[this.type][0].uiObj.options.active&&Fusion.Widget.uiInstances[this.type][0].shouldActivateWith(this)){A.options.active=true;if(A.domA){A.domA.addClass("jx"+A.options.type+"Active")}}A.addEvents({click:(function(){this.activate()}).bind(this),up:(function(){var D=Fusion.Widget.uiInstances[this.type];for(var C=0;C<D.length;C++){var B=D[C];if(B.shouldActivateWith(this)&&B.uiObj){B.uiObj.options.active=false;if(B.uiObj.domA){B.uiObj.domA.removeClass("jx"+B.uiObj.options.type+"Active")}}}this.deactivate()}).bind(this),down:(function(){var D=Fusion.Widget.uiInstances[this.type];for(var C=0;C<D.length;C++){var B=D[C];if(B.shouldActivateWith(this)&&B.uiObj){B.uiObj.options.active=true;if(B.uiObj.domA){B.uiObj.domA.addClass("jx"+B.uiObj.options.type+"Active")}}}this.activate()}).bind(this)})}this.uiObj=A},shouldActivateWith:function(A){return true},setMap:function(A){if(this.mapLoadedWatcher){this.oMap.deregisterForEvent(Fusion.Event.MAP_LOADED,this.mapLoadedWatcher);this.mapLoadedWatcher=null}this.oMap=A;if(A){this.mapLoadedWatcher=OpenLayers.Function.bind(this._mapLoaded,this);A.registerForEvent(Fusion.Event.MAP_LOADED,this.mapLoadedWatcher)}if(A&&A.isLoaded()){this.enable()}else{this.disable()}},getMap:function(){return this.oMap},addControl:function(A){this.getMap().oMapOL.addControl(A)},_mapLoaded:function(){if(this.oMap&&this.oMap.isLoaded()){this.enable()}else{this.disable()}},setMutEx:function(A){this.isExclusive=A},isMutEx:function(){return this.isExclusive},getName:function(){return this.name},getLocation:function(){return this.widgetTag.location},isEnabled:function(){return this.enabled},enable:function(){this.enabled=true;this.triggerEvent(Fusion.Event.WIDGET_STATE_CHANGED,this)},disable:function(){this.enabled=false;this.triggerEvent(Fusion.Event.WIDGET_STATE_CHANGED,this)},setParameter:function(B,A){},registerParameter:function(A){this.paramRegister.push(A)}});Fusion.Widget.uiInstances={};Fusion.Tool.Search=OpenLayers.Class({lastSearch:null,lastResult:null,resultOffset:0,initialize:function(){},getProperties:function(){var A=null;if(this.lastResult&&this.lastResult.properties){A=this.lastResult.properties}return A},getNumberOfProperties:function(){var A=0;if(this.lastResult&&this.lastResult.properties){A=this.lastResult.properties.length}return A},getProperty:function(B){var A="";if(this.lastResult&&this.lastResult.properties){A=this.lastResult.properties[B]}return A},getNumberOfResults:function(){result=0;if(this.lastResult&&this.lastResult.values){result=this.lastResult.values.length}return result},getFirstResult:function(){this.resultOffset=0;return this.getResult(this.resultOffset)},getNextResult:function(){this.resultOffset++;return this.getResult(this.resultOffset)},getResult:function(A){result=null;if(this.lastResult&&this.lastResult.values){result=this.lastResult.values[A]}return result},zoomToResult:function(B){var B="&filter="+B;var A=this.getMap().arch+"/"+Fusion.getScriptLanguage()+"/Query."+Fusion.getScriptLanguage();var C={};C.parameters="session="+this.getMap().getSessionID()+"&mapname="+this.getMap().getMapName()+"&layers="+this.layerName+B;C.onComplete=OpenLayers.Function.bind(this.selectComplete,this);Fusion.ajaxRequest(A,C)},selectComplete:function(B){var A=new DomNode(B.responseXML);var C=A.getNodeText("Selection");if(C=="true"){this.getMap().newSelection();this.getMap().getSelection(OpenLayers.Function.bind(this.zoomToSelection,this))}},zoomToSelection:function(C){var D=C.getLowerLeftCoord();var E=C.getUpperRightCoord();var B=E.x-D.x;var A=E.y-D.y;D.x=D.x-B;E.x=E.x+B;D.y=D.y-A;E.y=E.y+A;this.getMap().setExtents(new OpenLayers.Bounds(D.x,D.y,E.x,E.y))}});Fusion.Event.MAP_EXTENTS_CHANGED=Fusion.Event.lastEventId++;Fusion.Event.MAP_BUSY_CHANGED=Fusion.Event.lastEventId++;Fusion.Event.MAP_GENERIC_EVENT=Fusion.Event.lastEventId++;Fusion.Event.MAP_RESIZED=Fusion.Event.lastEventId++;Fusion.Event.MAP_SELECTION_ON=Fusion.Event.lastEventId++;Fusion.Event.MAP_SELECTION_OFF=Fusion.Event.lastEventId++;Fusion.Event.MAP_ACTIVE_LAYER_CHANGED=Fusion.Event.lastEventId++;Fusion.Event.MAP_LOADED=Fusion.Event.lastEventId++;Fusion.Event.MAP_LOADING=Fusion.Event.lastEventId++;Fusion.Event.MAP_RELOADED=Fusion.Event.lastEventId++;Fusion.Event.MAP_SESSION_CREATED=Fusion.Event.lastEventId++;Fusion.Event.MAP_MAPTIP_REQ_FINISHED=Fusion.Event.lastEventId++;Fusion.Event.MAP_MAP_GROUP_LOADED=Fusion.Event.lastEventId++;Fusion.Constant.LAYER_POINT_TYPE=0;Fusion.Constant.LAYER_LINE_TYPE=1;Fusion.Constant.LAYER_POLYGON_TYPE=2;Fusion.Constant.LAYER_SOLID_TYPE=3;Fusion.Constant.LAYER_RASTER_TYPE=4;Fusion.Constant.LAYER_DWF_TYPE=5;Fusion.Widget.Map=OpenLayers.Class(Fusion.Lib.EventMgr,{_oDomObj:null,_sDomObj:"",_sMapname:"",_nWidth:-1,_nHeight:-1,_fMetersperunit:-1,_fScale:-1,_nDpi:96,_oCurrentExtents:null,maxExtent:new OpenLayers.Bounds(),_nWorkers:0,oContextMenu:null,bSupressContextMenu:false,aMaps:null,mapsLoaded:false,layerRoot:null,singleTile:true,fractionalZoom:true,maxScale:null,initialize:function(D,B,C){this.widgetTag=D;var A=D.name;this.aMaps=[];this.buttonSet=new Jx.ButtonSet();this.widgetSet=C;this._nCellSize=-1;this._sDomObj=A;this._oDomObj=$(this._sDomObj);this.layerRoot=new Fusion.Layers.Group({legendLabel:"mapRoot",uniqueId:"mapRoot",groupName:"mapRoot",visible:true});var F=this._oDomObj.retrieve("jxLayout");if(F){F.addEvent("sizeChange",OpenLayers.Function.bind(this.sizeChanged,this))}if(D.extension.FractionalZoom){this.fractionalZoom=D.extension.FractionalZoom[0]=="false"?false:true}var G=null;if(D.extension.Scales){G=D.extension.Scales[0].split(",");this.fractionalZoom=false}if(D.extension.MaxScale){this.maxScale=parseInt(D.extension.MaxExtent[0])}var H=null;if(D.extension.MaxExtent){H=OpenLayers.Bounds.fromString(D.extension.MaxExtent[0])}OpenLayers.DOTS_PER_INCH=this._nDpi;if(!this.oMapOL){var I={controls:[],fallThrough:true,scales:G,fractionalZoom:this.fractionalZoom};if(D.extension.ConstrainMapExtent){this.bRestrictExtent=D.extension.ConstrainMapExtent[0]=="true"?true:false}if(H){I.maxExtent=H;this.maxExtent=H}this.oMapOL=new OpenLayers.Map(this._sDomObj,I)}this.oMapOL.viewPortDiv.style.position="absolute";this.oMapOL.viewPortDiv.style.zIndex=0;this.handlers=[];var E=true;if(D.extension.DisableMouseWheel&&D.extension.DisableMouseWheel[0]=="true"){E=false}if(E){this.wheelHandler=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown});this.wheelHandler.map=this.oMapOL;this.wheelHandler.activate();this.handlers.push(this.wheelHandler)}$(A).widget=this;this.registerEventID(Fusion.Event.MAP_EXTENTS_CHANGED);this.registerEventID(Fusion.Event.MAP_BUSY_CHANGED);this.registerEventID(Fusion.Event.MAP_GENERIC_EVENT);this.registerEventID(Fusion.Event.MAP_RESIZED);this.registerEventID(Fusion.Event.MAP_ACTIVE_LAYER_CHANGED);this.registerEventID(Fusion.Event.MAP_LOADED);this.registerEventID(Fusion.Event.MAP_LOADING);this.registerEventID(Fusion.Event.MAP_RELOADED);this.registerEventID(Fusion.Event.MAP_SELECTION_ON);this.registerEventID(Fusion.Event.MAP_SELECTION_OFF);this.registerEventID(Fusion.Event.MAP_MAPTIP_REQ_FINISHED);this.registerEventID(Fusion.Event.MAP_MAP_GROUP_LOADED);this.registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.mapLoaded,this));this.oMapOL.events.register("moveend",this,this.mapExtentsChanged);this._oDomObj.onselectstart=function(){return false};this._oDomObj.oncontextmenu=function(){return false};OpenLayers.Event.observe(this._oDomObj,"contextmenu",OpenLayers.Function.bind(this.onContextMenu,this));this.aSelectionCallbacks=[];this.bFetchingSelection=false;this.loadMapGroup(B)},mapLoaded:function(){this.setViewOptions(this.getUnits())},setMenu:function(){if(this.widgetTag.extension.MenuContainer){var B=new Jx.Menu.Context();var A=this.widgetSet.getContainerByName(this.widgetTag.extension.MenuContainer[0]);if(A){A.createWidgets(this.widgetSet,B);this.setContextMenu(B)}}},loadMapGroup:function(C){this.mapsLoaded=false;this.clearSelection();this.mapGroup=C;for(var B=0;B<this.aMaps.length;B++){if(this.aMaps[B].oLayerOL){this.aMaps[B].oLayerOL.destroy()}}this.aMaps=[];this.layerRoot.clear();for(var B=0;B<C.maps.length;++B){var A=C.maps[B];if(Fusion.Layers[A.type]){this.aMaps[B]=new Fusion.Layers[A.type](this,A,true);this.layerRoot.addGroup(this.aMaps[B].layerRoot)}else{this.aMaps[B]=new Fusion.Layers.Generic(this,A,true);this.layerRoot.addLayer(this.aMaps[B].layerRoot);this.layerLoaded()}this.aMaps[B].registerForEvent(Fusion.Event.LAYER_LOADED,OpenLayers.Function.bind(this.layerLoaded,this))}this.triggerEvent(Fusion.Event.MAP_MAP_GROUP_LOADED)},layerLoaded:function(){for(var B=0;B<this.aMaps.length;++B){if(!this.aMaps[B].isMapLoaded()){return }}this.mapsLoaded=true;if(this.aMaps.length==1){this.oMapOL.setBaseLayer(this.aMaps[0].oLayerOL)}if(this.aMaps[0].bRestoreMapState&&this.aMaps[0].bRestoreMapState===true&&typeof (this.aMaps[0].oRestoredState.extents)!=="undefined"){var A=this.aMaps[0].oRestoredState.extents.split(",");A[0]=parseFloat(A[0]);A[1]=parseFloat(A[1]);A[2]=parseFloat(A[2]);A[3]=parseFloat(A[3]);this.setExtents(new OpenLayers.Bounds(A[0],A[1],A[2],A[3]))}else{var C=this.setInitialExtents();this.setExtents(C)}this.triggerEvent(Fusion.Event.MAP_LOADED)},wheelChange:function(A,B){if(this.wheelTimer){clearTimeout(this.wheelTimer)}else{this.cumulativeDelta=0}this.cumulativeDelta+=(B<0)?-1:1;this.wheelTimer=setTimeout(OpenLayers.Function.bind(function(){this.doWheelChange(A,B)},this),200)},doWheelChange:function(I,D){this.wheelTimer=null;if(this.cumulativeDelta==0){return }var J=this.oMapOL.getSize();var G=J.w/2-I.xy.x;var F=I.xy.y-J.h/2;var E=this.cumulativeDelta>0?1/(this.cumulativeDelta+1):Math.abs(this.cumulativeDelta)+1;var H=this.oMapOL.baseLayer.getResolution()*E;var A=this.oMapOL.getLonLatFromPixel(I.xy);var C=new OpenLayers.LonLat(A.lon+G*H,A.lat+F*H);var B=new OpenLayers.Bounds(C.lon-J.w*H/2,C.lat-J.h*H/2,C.lon+J.w*H/2,C.lat+J.h*H/2);this.setExtents(B)},wheelUp:function(A){this.wheelChange(A,1)},wheelDown:function(A){this.wheelChange(A,-1)},getDomObj:function(){return this._oDomObj},getMapName:function(){return this.aMaps[0].getMapName()},getMapTitle:function(){return this.aMaps[0]._sMapTitle},getSessionID:function(){return this.aMaps[0].getSessionID()},getDomId:function(){return this._sDomObj},setMapOptions:function(A){this.oMapOL.setOptions(A)},addMap:function(A){if(A.mapTag.layerOptions.maxExtent){this.projection=A.projection;this.units=A.units;this.maxExtent.extend(A.mapTag.layerOptions.maxExtent);this.oMapOL.setOptions({maxExtent:this.maxExtent,units:A.units,projection:this.projection})}if(this.bRestrictExtent!=null){if(this.bRestrictExtent){this.oMapOL.restrictedExtent=A.mapTag.layerOptions.maxExtent}else{this.oMapOL.restrictedExtent=false}}this.oMapOL.addLayer(A.oLayerOL);A.registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.mapLoadHandler,this));A.registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.selectionHandler,this));A.registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.selectionHandler,this))},getAllMaps:function(){return this.aMaps},reloadMap:function(){for(var A=0;A<this.aMaps.length;++A){var B=this.aMaps[A];window.setTimeout(OpenLayers.Function.bind(B.reloadMap,B),1)}},loadScaleRanges:function(C){for(var A=0;A<this.aMaps.length;++A){var B=this.aMaps[A];OpenLayers.Function.bind(B.loadScaleRanges(C),B)}},query:function(A){this.lastQueryOptions=A;for(var B=0;B<this.aMaps.length;B++){if(this.aMaps[B].query(A)){}}},mapLoadHandler:function(){++this.mapLoadCounter;if(this.mapLoadCounter==this.aMaps.length){this._oInitialExtents=null;this.fullExtents();this.triggerEvent(Fusion.Event.MAP_LOADED)}},selectionHandler:function(){if(this.hasSelection()){this.triggerEvent(Fusion.Event.MAP_SELECTION_ON)}else{this.triggerEvent(Fusion.Event.MAP_SELECTION_OFF)}},hasSelection:function(){for(var A=0;A<this.aMaps.length;A++){if(this.aMaps[A].hasSelection()){return true}}return false},clearSelection:function(){this.oSelection=null;this.lastQueryOptions=null;for(var A=0;A<this.aMaps.length;A++){this.aMaps[A].clearSelection()}},getSelection:function(D,C,B){var C=(arguments[1])?arguments[1]:"";var B=(arguments[2])?arguments[2]:"";this.aSelectionCallbacks.push(D);if(this.bFetchingSelection){return }this.bFetchingSelection=true;this.oSelection={};this.nSelectionMaps=0;for(var A=0;A<this.aMaps.length;A++){if(this.aMaps[A].layerType=="Google"||this.aMaps[A].layerType=="Yahoo"||this.aMaps[A].layerType=="VirtualEarth"){continue}this.nSelectionMaps++;this.aMaps[A].getSelection(OpenLayers.Function.bind(this.accumulateSelection,this,this.aMaps[A]),C,B)}},setSelection:function(C,B){for(var A=0;A<this.aMaps.length;A++){this.aMaps[A].setSelection(C,B)}},accumulateSelection:function(C,B){this.oSelection[C._sMapname]=B;if(!--this.nSelectionMaps){this.bFetchingSelection=false;for(var A=0;A<this.aSelectionCallbacks.length;A++){this.aSelectionCallbacks[A](this.oSelection)}this.aSelectionCallbacks=[]}},setActiveLayer:function(A){this.oActiveLayer=A;if(A){this.oActiveMap=A.map}this.triggerEvent(Fusion.Event.MAP_ACTIVE_LAYER_CHANGED,A)},getActiveLayer:function(){return this.oActiveLayer},_addWorker:function(){this._nWorkers+=1;this.triggerEvent(Fusion.Event.MAP_BUSY_CHANGED,this);this._oDomObj.style.cursor="wait"},_removeWorker:function(){if(this._nWorkers>0){this._nWorkers-=1}this.setCursor(this.cursor);this.triggerEvent(Fusion.Event.MAP_BUSY_CHANGED,this)},mapExtentsChanged:function(){this._oCurrentExtents=this.oMapOL.getExtent();this.triggerEvent(Fusion.Event.MAP_EXTENTS_CHANGED)},isBusy:function(){return this._nWorkers>0},sizeChanged:function(){this.resize()},resize:function(){if(!this.mapsLoaded){return }this.oMapOL.updateSize();var A=$(this.getDomObj()).getContentBoxSize();this._nWidth=A.width;this._nHeight=A.height;if(this._oCurrentExtents){this.setExtents(this._oCurrentExtents)}this.triggerEvent(Fusion.Event.MAP_RESIZED,this)},redraw:function(){for(var A=0;A<this.aMaps.length;A++){if(this.aMaps[A].oLayerOL.params){this.aMaps[A].oLayerOL.params.ts=(new Date()).getTime()}}this.oMapOL.setCenter(this.oMapOL.getCenter(),this.oMapOL.getZoom(),false,true)},setBackgroundColor:function(A){this._oDomObj.style.backgroundColor=A},setExtents:function(B){if(!B){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,OpenLayers.i18n("nullExtents")))}if(B instanceof Array&&B.length==4){B=new OpenLayers.Bounds(B[0],B[1],B[2],B[3])}for(var A=0;A<this.aMaps.length;A++){if(this.aMaps[A].oLayerOL.params&&this.aMaps[A].noCache){this.aMaps[A].oLayerOL.params.ts=(new Date()).getTime()}}this.oMapOL.zoomToExtent(B,true);this._oCurrentExtents=this.oMapOL.getExtent()},setInitialExtents:function(){var B;var C=Fusion.getQueryParam("extent");if(C){B=new OpenLayers.Bounds.fromArray(C.split(","))}else{if(this.mapGroup.initialView){var A=this.mapGroup.getInitialView();if(A.x){B=this.getExtentFromPoint(A.x,A.y,A.scale)}else{if(A.minX){B=new OpenLayers.Bounds(A.minX,A.minY,A.maxX,A.maxY)}}if(!B.intersectsBounds(this.maxExtent)){Fusion.reportError("AppDef initial view is outside map maxExtent, resetting initialView to maxExtent");B=this.maxExtent}}else{B=this.getMapGroupExtent();if(!B){B=this.getMapGroupExtent(true)}}}this.initialExtents=B;return B},getMapGroupExtent:function(B){var C;for(var A=0;A<this.aMaps.length;++A){if(!B&&this.aMaps[A].arch=="Generic"){continue}C=this.aMaps[A].getMaxExtent()}return C},fullExtents:function(){var A=this.maxExtent;this.setExtents(A)},isMapLoaded:function(){return(this._oCurrentExtents)?true:false},zoom:function(F,E,C){if(C==1||C==0){this.oMapOL.panTo(new OpenLayers.LonLat(F,E))}else{var J=this.oMapOL.getExtent();if(this.fractionalZoom){var K=J.right-J.left;var I=J.top-J.bottom;var H,D,G,B;if(C>0){H=F-(K/2/C);D=F+(K/2/C);G=E-(I/2/C);B=E+(I/2/C)}else{if(C<0){H=F-((K/2)*Math.abs(C));D=F+((K/2)*Math.abs(C));G=E-((I/2)*Math.abs(C));B=E+((I/2)*Math.abs(C))}}this.setExtents(new OpenLayers.Bounds(H,G,D,B))}else{var A=this.oMapOL.getZoom();if(C>1){this.oMapOL.zoomTo(A+1)}else{if(C<1){this.oMapOL.zoomTo(A-1)}}}}},zoomToScale:function(B){var A=this.getCurrentCenter();var C=this.getExtentFromPoint(A.x,A.y,B);this.setExtents(C)},queryRect:function(D,C,B,A){},queryPoint:function(B,A){},pixToGeo:function(C,A){var B=this.oMapOL.getLonLatFromPixel(new OpenLayers.Pixel(C,A));if(B!=null){return{x:B.lon,y:B.lat}}return null},geoToPix:function(C,B){if(!(this._oCurrentExtents)){return null}var A=this.oMapOL.getPixelFromLonLat(new OpenLayers.LonLat(C,B));return{x:Math.floor(A.x),y:Math.floor(A.y)}},pixToGeoMeasure:function(A){var B=this.oMapOL.getResolution();return(A*B)},setProjection:function(A){if(!Proj4js.defs[A]){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"Projection definition not found for:"+A))}this.oMapOL.projection=A},setMetersPerUnit:function(A){if(this._fMetersperunit<0){Fusion.initUnits(A);this._fMetersperunit=A}else{if(A!=this._fMetersperunit){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"meters per unit value already set"))}}},getMetersPerUnit:function(){return this._fMetersperunit},setViewOptions:function(A){this.setWidgetParam("Units",A)},setWidgetParam:function(G,F){for(var C=0;C<Fusion.applicationDefinition.widgetSets.length;++C){var D=Fusion.applicationDefinition.widgetSets[C];for(var B=0;B<D.widgetInstances.length;++B){var E=D.widgetInstances[B];for(var A=0;A<E.paramRegister.length;++A){if(E.paramRegister[A]==G){E.setParameter(G,F)}}}}},geoToPixMeasure:function(A){return parseInt(A/this.oMapOL.getResolution())},getCurrentCenter:function(){var A=this.getCurrentExtents().getCenterLonLat();return{x:A.lon,y:A.lat}},getCurrentExtents:function(){return this.oMapOL.getExtent()},getExtentFromPoint:function(F,E,A){if(!A){A=this.getScale()}var D=OpenLayers.Util.getResolutionFromScale(A,this.oMapOL.baseLayer.units);var C=this.getSize();var G=C.w*D;var B=C.h*D;return new OpenLayers.Bounds(F-G/2,E-B/2,F+G/2,E+B/2)},getScale:function(){return this.oMapOL.getScale()},getResolution:function(){return this.oMapOL.getResolution()},getUnits:function(){return this.oMapOL.baseLayer.units},getSize:function(){return this.oMapOL.getSize()},getEventPosition:function(A){return this.oMapOL.events.getMousePosition(A)},setCursor:function(B){this.cursor=B;if(this.isBusy()){return }if(B&&B.length&&typeof B=="object"){for(var A=0;A<B.length;A++){this._oDomObj.style.cursor=B[A];if(this._oDomObj.style.cursor==B[A]){break}}}else{if(typeof B=="string"){this._oDomObj.style.cursor=B}else{this._oDomObj.style.cursor="auto"}}},observeEvent:function(B,A){OpenLayers.Event.observe(this._oDomObj,B,A,false)},stopObserveEvent:function(B,A){OpenLayers.Event.stopObserving(this._oDomObj,B,A,false)},activateWidget:function(A){},deactivateWidget:function(A){},isLoaded:function(){return(this.oMapOL.getExtent()!=null)},getLinkParams:function(){var B={extent:this.getCurrentExtents().toBBOX()};if(this.lastQueryOptions){if(this.lastQueryOptions.filter){B.filter=this.lastQueryOptions.filter}if(this.lastQueryOptions.geometry){B.spatialfilter=this.lastQueryOptions.geometry}if(this.lastQueryOptions.queryHiddenLayers){B.queryHiddenLayers=this.lastQueryOptions.queryHiddenLayers}if(this.lastQueryOptions.maxFeatures){B.maxfeatures=this.lastQueryOptions.maxFeatures}if(this.lastQueryOptions.layers){B.selectlayer=this.lastQueryOptions.layers}if(this.lastQueryOptions.selectionType){B.variant=this.lastQueryOptions.selectionType}}for(var A=0;A<this.aMaps.length;++A){B=OpenLayers.Util.extend(B,this.aMaps[A].getLinkParams())}return OpenLayers.Util.getParameterString(B)},getMapTip:function(A){this.aMaps[0].getMapTip(A)},supressContextMenu:function(A){this.bSupressContextMenu=A},setContextMenu:function(A){this.oContextMenu=A},onContextMenu:function(A){if(this.oContextMenu&&!this.bSupressContextMenu&&this.isLoaded()){this.oContextMenu.show(new Event(A));this.contextMenuPosition=this.getEventPosition(A);OpenLayers.Event.stop(A)}},executeFromContextMenu:function(A){A.activate(this.contextMenuPosition.x,this.contextMenuPosition.y)}});Fusion.SelectionObject=OpenLayers.Class({aLayers:null,initialize:function(B){this.aLayers=[];this.nTotalElements=0;this.nLayers=0;if(B.layers&&B.layers.length>0){this.fMinX=B.extents.minx;this.fMinY=B.extents.miny;this.fMaxX=B.extents.maxx;this.fMaxY=B.extents.maxy;this.nLayers=B.layers.length;for(var A=0;A<B.layers.length;A++){this.aLayers[A]=new Fusion.SelectionObject.Layer(B,B.layers[A])}}},getNumElements:function(){return this.nTotalElements},getLowerLeftCoord:function(){return{x:this.fMinX,y:this.fMinY}},getUpperRightCoord:function(){return{x:this.fMaxX,y:this.fMaxY}},getNumLayers:function(){return this.nLayers},getLayerByName:function(B){var A=null;for(var C=0;C<this.nLayers;C++){if(this.aLayers[C].getName()==B){A=this.aLayers[C];break}}return A},getLayer:function(A){if(A>=0&&A<this.nLayers){return this.aLayers[A]}else{return null}}});Fusion.SelectionObject.Layer=OpenLayers.Class({name:null,nElements:null,aElements:null,nProperties:null,aPropertiesName:null,aPropertiesTypes:null,type:null,area:null,distance:null,bbox:null,center:null,initialize:function(D,I){this.name=I;this.nElements=D[I].numelements;this.aElements=[];this.nProperties=D[I].propertyvalues.length;this.aPropertiesName=[];this.aPropertiesName=D[I].propertyvalues;this.aPropertiesTypes=[];this.aPropertiesTypes=D[I].propertytypes;this.area=0;this.distance=0;for(var F=0;F<D[I].values.length;F++){this.aElements[F]=[];for(var E=0;E<D[I].values[F].length;E++){this.aElements[F][E]=D[I].values[F][E]}}for(var F=0;F<D[I].metadata.length;F++){var H=D[I].metadata[F];var G=H[0];var J=H[1];var A=H[2];var B=H[3];var C=H[4];this.area+=parseFloat(B);this.distance+=parseFloat(C)}},getName:function(){return this.name},getNumElements:function(){return this.nElements},getNumProperties:function(){return this.nProperties},getPropertyNames:function(){return this.aPropertiesName},getPropertyTypes:function(){return this.aPropertiesTypes},getElementValue:function(B,A){if(B>=0&&B<this.nElements&&A>=0&&A<this.nProperties){return this.aElements[B][A]}else{return null}}});Fusion.Event.MAP_LAYER_TOGGLED=Fusion.Event.lastEventId++;Fusion.Event.MAP_LAYER_ORDER_CHANGED=Fusion.Event.lastEventId++;Fusion.Event.LAYER_LOADED=Fusion.Event.lastEventId++;Fusion.Event.LAYER_LOADING=Fusion.Event.lastEventId++;Fusion.Layers=OpenLayers.Class(Fusion.Lib.EventMgr,{bSingleTile:null,bIsBaseLayer:false,bDisplayInLegend:true,bExpandInLegend:true,bMapLoaded:false,bIsMapWidgetLayer:true,bLayersReversed:false,sMapResourceId:null,sImageType:"png",clientAgent:"Fusion Viewer",noCache:false,_sMapTitle:null,_sMapname:null,initialize:function(D,B,A){this.registerEventID(Fusion.Event.MAP_SELECTION_ON);this.registerEventID(Fusion.Event.MAP_SELECTION_OFF);this.registerEventID(Fusion.Event.MAP_LOADED);this.registerEventID(Fusion.Event.LAYER_LOADED);this.registerEventID(Fusion.Event.LAYER_LOADING);this.registerEventID(Fusion.Event.MAP_LAYER_ORDER_CHANGED);this.registerEventID(Fusion.Event.LAYER_PROPERTY_CHANGED);this.mapWidget=D;this.oSelection=null;if(A!=null){this.bIsMapWidgetLayer=A}this.mapTag=B;if(!this.mapTag.layerOptions){this.mapTag.layerOptions={}}this.ratio=this.mapTag.layerOptions.MapRatio?this.extension.MapRatio[0]:1;this.bSingleTile=B.singleTile;this.bIsBaseLayer=B.isBaseLayer;this.sMapResourceId=B.resourceId?B.resourceId:"";this.mapInfo=B.mapInfo;this.layerType=B.type;if(B.extension.ProjectionCode){this.projCode=B.extension.ProjectionCode[0]}if(B.extension.ProjectionDef){var C=B.extension.ProjectionDef[0];this.projCode="APP-DEF-PROJ";Proj4js.defs[this.projCode]=C}},loadScaleRanges:function(A){A()},getMapName:function(){return this._sMapname},getMapTitle:function(){return this._sMapTitle},isMapLoaded:function(){return this.bMapLoaded},getMaxExtent:function(){var A=null;if(this.oLayerOL){A=this.oLayerOL.maxExtent}return A},hasSelection:function(){return this.bSelectionOn},getSelectedFeatureCount:function(){var A=0;return A},getSelectedLayers:function(){var A=[];return A},getSelectableLayers:function(){var A=[];return A},setSelection:function(B,A){},getSelection:function(C,B,A){},clearSelection:function(){},query:function(A){},processLayerEvents:function(E,B){if(this.mapInfo&&this.mapInfo.mapEvents.layerEvents[E.layerName]){var G=this.mapInfo.mapEvents.layerEvents[E.layerName];var D=B?G.onEnable:G.onDisable;for(var C=0;C<D.length;C++){var H=D[C];if(H.type=="layer"){var A=this.layerRoot.findLayer(H.name);if(A){if(H.enable){A.show(true)}else{A.hide(true)}}}else{if(H.type=="group"){var F=this.layerRoot.findGroupByAttribute("groupName",H.name);if(F){if(H.enable){F.show(true)}else{F.hide(true)}}}}}}},processGroupEvents:function(F,B){if(this.mapInfo&&this.mapInfo.mapEvents.groupEvents[F.groupName]){var H=this.mapInfo.mapEvents.groupEvents[F.groupName];var D=B?H.onEnable:H.onDisable;for(var C=0;C<D.length;C++){var G=D[C];if(G.type=="layer"){var A=this.layerRoot.findLayer(G.name);if(A){if(G.enable){A.show(true)}else{A.hide(true)}}}else{if(G.type=="group"){var E=this.layerRoot.findGroupByAttribute("groupName",G.name);if(E){if(G.enable){E.show(true)}else{E.hide(true)}}}}}}},refreshLayer:function(A){this.drawMap()},setParameter:function(B,A){if(B=="SelectionType"){this.selectionType=A}},loadStart:function(){if(this.bIsMapWidgetLayer){this.mapWidget._addWorker()}},loadEnd:function(){if(this.bIsMapWidgetLayer){this.mapWidget._removeWorker()}},getGroupInfoUrl:function(C){if(this.mapInfo){var A=this.mapInfo.links.groups;for(var B=0;B<A.length;B++){if(A[B].name==C){return A[B].url}}}return null},getLayerInfoUrl:function(A){if(this.mapInfo){var C=this.mapInfo.links.layers;for(var B=0;B<C.length;B++){if(C[B].name==A){return C[B].url}}}return null},getMapTip:function(A){}});Fusion.Event.GROUP_PROPERTY_CHANGED=Fusion.Event.lastEventId++;Fusion.Layers.Group=OpenLayers.Class(Fusion.Lib.EventMgr,{name:null,groups:null,layers:null,oMap:null,initialize:function(B,A){this.uniqueId=B.uniqueId;this.name=B.groupName;this.groups=[];this.layers=[];this.oMap=A;this.groupName=B.groupName;this.legendLabel=B.legendLabel;this.parentUniqueId=B.parentUniqueId;this.groupType=B.groupType;this.displayInLegend=B.displayInLegend;this.expandInLegend=B.expandInLegend;this.visible=B.visible;this.initiallyVisible=B.visible;this.actuallyVisible=B.actuallyVisible;this.isBaseMapGroup=B.isBaseMapGroup;this.registerEventID(Fusion.Event.GROUP_PROPERTY_CHANGED)},show:function(A){if(this.visible){return }this.oMap.showGroup(this,A?true:false);this.visible=true;if(this.legend&&this.legend.checkBox){this.legend.checkBox.checked=true}},hide:function(A){if(!this.visible){return }this.oMap.hideGroup(this,A?true:false);this.visible=false;if(this.legend&&this.legend.checkBox){this.legend.checkBox.checked=false}},isVisible:function(){return this.visible},clear:function(){for(var A=0;A<this.groups.length;A++){this.groups[A].clear()}for(var A=0;A<this.layers.length;A++){this.layers[A].clear()}this.groups=[];this.layers=[]},set:function(B,A){this[B]=A;this.triggerEvent(Fusion.Event.GROUP_PROPERTY_CHANGED,this)},addGroup:function(B,A){B.parentGroup=this;if(A){this.groups.unshift(B)}else{this.groups.push(B)}},addLayer:function(B,A){B.parentGroup=this;if(A){this.layers.unshift(B)}else{this.layers.push(B)}},findGroup:function(A){return this.findGroupByAttribute("name",A)},findGroupByAttribute:function(B,C){if(this[B]==C){return this}for(var A=0;A<this.groups.length;A++){var D=this.groups[A].findGroupByAttribute(B,C);if(D){return D}}return null},findLayer:function(A){return this.findLayerByAttribute("name",A)},findLayerByAttribute:function(C,D){for(var B=0;B<this.layers.length;B++){if(this.layers[B][C]==D){return this.layers[B]}}for(var B=0;B<this.groups.length;B++){var A=this.groups[B].findLayerByAttribute(C,D);if(A){return A}}return null}});Fusion.Event.LAYER_PROPERTY_CHANGED=Fusion.Event.lastEventId++;Fusion.Layers.Layer=OpenLayers.Class(Fusion.Lib.EventMgr,{name:null,scaleRanges:null,oMap:null,initialize:function(D,A){this.oMap=A;this.layerName=D.layerName;this.uniqueId=D.uniqueId;this.resourceId=D.resourceId;this.selectedFeatureCount=0;this.layerTypes=[].concat(D.layerTypes);this.legendLabel=D.legendLabel;this.displayInLegend=D.displayInLegend;this.expandInLegend=D.expandInLegend;this.actuallyVisible=D.actuallyVisible;this.statusDefault=D.statusdefault;this.editable=D.editable;this.visible=D.visible;this.initiallyVisible=D.visible;this.selectable=D.selectable;this.isBaseMapLayer=D.isBaseMapLayer;this.layerType=null;if(this.supportsType(Fusion.Constant.LAYER_RASTER_TYPE)){this.layerType=Fusion.Constant.LAYER_RASTER_TYPE}else{if(this.supportsType(Fusion.Constant.LAYER_DWF_TYPE)){this.layerType=Fusion.Constant.LAYER_DWF_TYPE}}this.parentGroup=D.parentGroup;this.minScale=D.minScale;this.maxScale=D.maxScale;if(this.maxScale=="infinity"){this.maxScale=1000000000000}this.scaleRanges=[];if(D.scaleRanges){for(var B=0;B<D.scaleRanges.length;B++){var C=new Fusion.Layers.ScaleRange(D.scaleRanges[B],this.layerType);this.scaleRanges.push(C)}}},supportsType:function(B){for(var A=0;A<this.layerTypes.length;A++){if(this.layerTypes[A]==B){return true}}return false},getScaleRange:function(A){for(var B=0;B<this.scaleRanges.length;B++){if(this.scaleRanges[B].contains(A)){return this.scaleRanges[B]}}return null},show:function(A){if(this.visible){return }this.set("visible",true);this.oMap.showLayer(this,A?true:false);if(this.legend&&this.legend.checkBox){this.legend.checkBox.checked=true}},hide:function(A){if(!this.visible){return }this.set("visible",false);this.oMap.hideLayer(this,A?true:false);if(this.legend&&this.legend.checkBox){this.legend.checkBox.checked=false}},isVisible:function(){return this.visible},clear:function(){},set:function(B,A){this[B]=A;this.oMap.triggerEvent(Fusion.Event.LAYER_PROPERTY_CHANGED,this)}});Fusion.Layers.ScaleRange=OpenLayers.Class({styles:null,initialize:function(F,B,E){this.minScale=F.minScale;this.maxScale=F.maxScale;if(this.maxScale=="infinity"||this.maxScale=="auto"){this.maxScale=Infinity}this.styles=[];if(!F.styles){var D=new Fusion.Layers.StyleItem({legendLabel:"DWF"},B,E);this.styles.push(D);return }var C=F.styles.length>1?false:B;for(var A=0;A<F.styles.length;A++){var D=new Fusion.Layers.StyleItem(F.styles[A],C,E);this.styles.push(D)}},contains:function(A){var B=Math.round(A);return B>=this.minScale&&B<=this.maxScale}});Fusion.Layers.StyleItem=OpenLayers.Class({clientAgent:"Fusion Viewer",initialize:function(C,A,B){this.iconOpt=B;this.iconX=C.icon_x||0;this.iconY=C.icon_y||0;this.legendLabel=C.legendLabel;this.filter=C.filter;this.geometryType=C.geometryType;if(this.geometryType==""){this.geometryType=-1}this.categoryIndex=C.categoryIndex;if(this.categoryindex==""){this.categoryindex=-1}this.index=C.index;this.staticIcon=A}});Fusion.Strings.en={scriptFailed:"failed to load script: ${script}",configParseError:"Error parsing fusion configuration file, initialization aborted",configLoadError:"Error loading fusion configuration file, initialization aborted.Make sure that you have copied config_dist.json to config.json and have configured the settings for your system",ajaxError:"Exception occurred in AJAX callback.\nMessage: ${exception}\nLocation: ${filename} (${line})\nResponse: ${response}",importFailed:"failed to import stylesheet: ${url}",serverNotAvailable:"<h2>Server not available. Try to reload the application. If this problem persists, please contact the administrator</h2>",invalidXMLDocument:"xml2json: invalid XML document: ${msg} : ${url}",registerEventError:"Error registering eventID, invalid (empty) eventID.",appDefLoadFailed:"failed to load: ${script}",appDefParseError:"failed to parse ApplicationDefinition",widgetSetParseError:"failed to parse the WidgetSet",fusionError:"Fusion Error: ${type}\n${message}",nullExtents:"Map.setExtents called with null extents",mapLoadError:"Failed to load requested map:\n${error}",setLayersError:"setLayers failure: ${error}",printTitle:"Printable Page ",noSelection:"No Selection",selectionInfo:"${features} feature(s) selected on ${layers} layer(s)",attribute:"Attribute",value:"Value",taskHome:"return to the task pane home",prevTask:"go to previous task executed",nextTask:"go to next task executed",taskList:"Task List",taskPane:"Task Pane",imperial:"Imperial",metric:"Metric",deg:"Degrees",refresh:"Refresh",expandAll:"Expand All",expand:"Expand",collapseAll:"Collapse All",collapse:"Collapse",defaultMapTitle:"Map",legendTitle:"Legend",selectionPanelTitle:"Selection",searchPaneTitle:"Search",searchButton:"find",ovmapTitle:"Overview Map",ovmapTitleShort:"Overview",taskPaneTitle:"Tasks",segment:"Segment ${seg}",calculating:"calculating ...",panWest:"Pan West",panEast:"Pan East",panSouth:"Pan South",panNorth:"Pan North",zoomOut:"Zoom Out",zoomIn:"Zoom In",printCancel:"Cancel",printGenerate:"Generate",zoomRect:"Zoom Rectangle",maptipLinkText:"Click for more information",end:""};Fusion.Strings.es={scriptFailed:"Fallo al cargar script: ${script}",configParseError:"Error de parseo en el fichero de configuraci&oacute;n, inicializaci&oacute;n abortada",configLoadError:"Error de carga del fichero de configuraci&oacute;n, inicializaci&oacute;n abortada.Aseg&uacute;rate de copiar el fichero config_dist.json a config.json y configurarlo para tu sistema",ajaxError:"Escepci&oacute;n ocurrida en la llamada de retorno de AJAX.\n${exception}\nLocation: ${file} (${line}))",importFailed:"Fallo al importar la hoja de estilo: ${url}",registerEventError:"Error registrando eventID(vac&iacute;o).",appDefLoadFailed:"Fallo al cargar: ${script}",appDefParseError:"Fallo al parsear ApplicationDefinition",widgetSetParseError:"Fallo al parsear the WidgetSet",fusionError:"Error de Fusion: ${type}\n${message}",nullExtents:"Map.setExtents llamada con extensi&oacute;n nula",mapLoadError:"Fallo al cargar el mapa requerido:\n${error}",setLayersError:"Error de setLayers: ${error}",printTitle:"P&aacute;gina de impresi&oacute;n ",noSelection:"Sin selecci&oacute;n",selectionInfo:"${features} elementos seleccionados en capa(s) ${layers}",attribute:"Atributo",value:"Valor",taskHome:"Volver al panel de tareas inicial",prevTask:"Volver a la tarea anterior",nextTask:"Ir a la siguiente tarea",taskList:"Lista de tareas",taskPane:"Panel de tareas",imperial:"Imperial",metric:"M&eacute;trico",deg:"Grados",refresh:"Actualizar",expandAll:"Expandir todo",expand:"Expandir",collapseAll:"Colapsar todo",collapse:"Colapsar",defaultMapTitle:"Mapa",legendTitle:"Leyenda",selectionPanelTitle:"Selecci&oacute;n",searchPaneTitle:"Buscar",searchButton:"buscar",ovmapTitle:"Mapa General",ovmapTitleShort:"Descripci&oacute;n general",taskPaneTitle:"Tareas",segment:"Segmento ${seg}",calculating:"Calculando ...",panWest:"Oeste",panEast:"Este",panSouth:"Sur",panNorth:"Norte",zoomOut:"Click para reducir",zoomIn:"Click para ampliar",printCancel:"Cancelar",printGenerate:"Imprimir",end:"Fin"};OpenLayers.Lang.en={unhandledRequest:"Unhandled request return ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Base Layer",sameProjection:"The overview map only works when it is in the same projection as the main map",readNotImplemented:"Read not implemented.",writeNotImplemented:"Write not implemented.",noFID:"Can't update a feature for which there is no FID.",errorLoadingGML:"Error in loading GML file ${url}",browserNotSupported:"Your browser does not support vector rendering. Currently supported renderers are:\n${renderers}",componentShouldBe:"addFeatures : component should be an ${geomType}",getFeatureError:"getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.",minZoomLevelError:"The minZoomLevel property is only intended for use with the FixedZoomLevels-descendent layers. That this wfs layer checks for minZoomLevel is a relic of thepast. We cannot, however, remove it without possibly breaking OL based applications that may depend on it. Therefore we are deprecating it -- the minZoomLevel check below will be removed at 3.0. Please instead use min/max resolution setting as described here: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: SUCCESS ${response}",commitFailed:"WFS Transaction: FAILED ${response}",googleWarning:"The Google Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the Google Maps library script was either not included, or does not contain the correct API key for your site.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>click here</a>",getLayerWarning:"The ${layerType} Layer was unable to load correctly.<br><br>To get rid of this message, select a new BaseLayer in the layer switcher in the upper-right corner.<br><br>Most likely, this is because the ${layerLib} library script was not correctly included.<br><br>Developers: For help getting this working correctly, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>click here</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"You tried to add the layer: ${layerName} to the map, but it has already been added",reprojectDeprecated:"You are using the 'reproject' option on the ${layerName} layer. This option is deprecated: its use was designed to support displaying data over commercial basemaps, but that functionality should now be achieved by using Spherical Mercator support. More information is available from http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"This method has been deprecated and will be removed in 3.0. Please use ${newMethod} instead.",boundsAddError:"You must pass both x and y values to the add function.",lonlatAddError:"You must pass both lon and lat values to the add function.",pixelAddError:"You must pass both x and y values to the add function.",unsupportedGeometryType:"Unsupported geometry type: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: element with id ${elemId} may be misplaced.",end:"",filterEvaluateNotImplemented:"evaluate is not implemented for this filter type."};OpenLayers.Lang.es={unhandledRequest:"Respuesta a petición no gestionada ${statusText}",permalink:"Enlace permanente",overlays:"Capas superpuestas",baseLayer:"Capa Base",sameProjection:"El mini mapa sólo funciona si está en la misma proyección que el mapa principal",readNotImplemented:"Lectura no implementada.",writeNotImplemented:"Escritura no implementada.",noFID:"No se puede actualizar un elemento para el que no existe FID.",errorLoadingGML:"Error cargando el fichero GML ${url}",browserNotSupported:"Su navegador no soporta renderización vectorial. Los renderizadores soportados actualmente son:\n${renderers}",componentShouldBe:"addFeatures : el componente debe ser del tipo ${geomType}",getFeatureError:"getFeatureFromEvent llamado en una capa sin renderizador. Esto normalmente quiere decir que se ha destruido una capa, pero no el manejador asociado a ella.",minZoomLevelError:"La propiedad minZoomLevel debe sólo utilizarse con las capas que tienen FixedZoomLevels. El hecho de que una capa wfs compruebe minZoomLevel is una reliquia del pasado. Sin embargo, no podemos eliminarla sin discontinuar probablemente las aplicaciones OL que puedan depender de ello. Así pues estamos haciéndolo obsoleto --la comprobación minZoomLevel se eliminará en la versión 3.0. Utilice el ajuste de resolution min/max en su lugar, tal como se describe aquí: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"Transacción WFS: ÉXITO ${response}",commitFailed:"Transacción WFS: FALLÓ ${response}",googleWarning:"La capa Google no pudo ser cargada correctamente.<br><br>Para evitar este mensaje, seleccione una nueva Capa Base en el selector de capas en la esquina superior derecha.<br><br>Probablemente, esto se debe a que el script de la biblioteca de Google Maps no fue correctamente incluido en su página, o no contiene la clave del API correcta para su sitio.<br><br>Desarrolladores: Para ayudar a hacer funcionar esto correctamente, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>haga clic aquí</a>",getLayerWarning:"La capa ${layerType} no pudo ser cargada correctamente.<br><br>Para evitar este mensaje, seleccione una nueva Capa Base en el selector de capas en la esquina superior derecha.<br><br>Probablemente, esto se debe a que el script de la biblioteca ${layerLib} no fue correctamente incluido en su página.<br><br>Desarrolladores: Para ayudar a hacer funcionar esto correctamente, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>haga clic aquí</a>",scale:"Escala = 1 : ${scaleDenom}",layerAlreadyAdded:"Intentó añadir la capa: ${layerName} al mapa, pero ya había sido añadida previamente",reprojectDeprecated:"Está usando la opción 'reproject' en la capa ${layerName}. Esta opción está obsoleta: su uso fue diseñado para soportar la visualización de datos sobre mapas base comerciales, pero esa funcionalidad debería conseguirse ahora mediante el soporte de la proyección Spherical Mercator. Más información disponible en http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Este método está obsoleto y se eliminará en la versión 3.0. Por favor utilice el método ${newMethod} en su lugar.",boundsAddError:"Debe proporcionar los valores x e y a la función add.",lonlatAddError:"Debe proporcionar los valores lon y lat a la función add.",pixelAddError:"Debe proporcionar los valores x e y a la función add.",unsupportedGeometryType:"Tipo de geometría no soportada: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition falló: el elemento con id ${elemId} puede haberse colocado de manera errónea.",filterEvaluateNotImplemented:"evaluate no está implementado para este tipo de filtro.",end:""};Fusion.configuration={general:{scriptLanguage:"php",temporaryDirectory:"/ms4w/tmp"},mapguide:{webTierUrl:"",useAsyncOverlay:true,tileCacheUrl:"http://localhost:8008/sheboygan"},mapserver:{cgi:"/cgi-bin/mapserv",imagePath:"/ms4w/tmp/ms_tmp",imageUrl:"http://localhost/ms_tmp",legendIconCacheDir:"/ms4w/tmp/ms_tmp",mapFileRoot:"/ms4w/apps/",mapRestoreState:"/opt/fgs/apps/savedSession/",mapRestoreStateSession:"/opt/fgs/tmp/"}};Fusion.Widget.ActivityIndicator=OpenLayers.Class(Fusion.Widget,{element:null,initializeWidget:function(B){this.element=this.domObj;var A=B.extension;if(A.ElementId){var C=$(A.ElementId[0]);if(C&&C!=this.domObj){this.domObj.appendChild(C);this.element=C}}this.element.style.visibility="hidden";this.getMap().registerForEvent(Fusion.Event.MAP_BUSY_CHANGED,OpenLayers.Function.bind(this.busyChanged,this))},busyChanged:function(){this.element.style.visibility=this.getMap().isBusy()?"visible":"hidden"}});Fusion.Widget.BasemapSwitcher=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Menu,options:{},baseMaps:{},defaultBasemap:null,menuItems:{},initializeWidget:function(A){this.getMap().registerForEvent(Fusion.Event.MAP_MAP_GROUP_LOADED,OpenLayers.Function.bind(this.setDefaultBasemap,this))},refreshSettings:function(){this.baseMaps={};this.defaultBasemap=null;this.menuItems={};this.options={G_NORMAL_MAP:null,G_SATELLITE_MAP:null,G_HYBRID_MAP:null,YAHOO_MAP_REG:null,YAHOO_MAP_SAT:null,YAHOO_MAP_HYB:null,Road:null,Aerial:null,Hybrid:null,None:null}},generateOptions:function(){this.refreshSettings();var D=this.getMap().aMaps;for(var B=0,A=D.length;B<A;B++){var C=D[B];switch(C.layerType){case"MapGuide":this.options.None="None";this.baseMaps.None=C;break;case"Google":if(!C.mapTag.extension.Options||!C.mapTag.extension.Options[0].type){this.options.G_NORMAL_MAP="Google Street";this.baseMaps.G_NORMAL_MAP=C;if(!this.defaultBasemap){this.defaultBasemap="G_NORMAL_MAP"}}else{switch(C.mapTag.extension.Options[0].type[0]){case"G_NORMAL_MAP":if(C.mapTag.extension.Options[0].name){this.options.G_NORMAL_MAP=C.mapTag.extension.Options[0].name[0]}else{this.options.G_NORMAL_MAP="Google Street"}this.baseMaps.G_NORMAL_MAP=C;break;case"G_SATELLITE_MAP":if(C.mapTag.extension.Options[0].name){this.options.G_SATELLITE_MAP=C.mapTag.extension.Options[0].name[0]}else{this.options.G_SATELLITE_MAP="Google Satellite"}this.baseMaps.G_SATELLITE_MAP=C;break;case"G_HYBRID_MAP":if(C.mapTag.extension.Options[0].name){this.options.G_HYBRID_MAP=C.mapTag.extension.Options[0].name[0]}else{this.options.G_HYBRID_MAP="Google Hybrid"}this.baseMaps.G_HYBRID_MAP=C;break;default:break}if(!this.defaultBasemap){this.defaultBasemap=C.mapTag.extension.Options[0].type[0]}}break;case"Yahoo":if(!C.mapTag.extension.Options||!C.mapTag.extension.Options[0].type){this.options.YAHOO_MAP_REG="Yahoo Street";this.baseMaps.YAHOO_MAP_REG=C;if(!this.defaultBasemap){this.defaultBasemap="YAHOO_MAP_REG"}}else{switch(C.mapTag.extension.Options[0].type[0]){case"YAHOO_MAP_REG":if(C.mapTag.extension.Options[0].name){this.options.YAHOO_MAP_REG=C.mapTag.extension.Options[0].name[0]}else{this.options.YAHOO_MAP_REG="Yahoo Street"}this.baseMaps.YAHOO_MAP_REG=C;break;case"YAHOO_MAP_SAT":if(C.mapTag.extension.Options[0].name){this.options.YAHOO_MAP_SAT=C.mapTag.extension.Options[0].name[0]}else{this.options.YAHOO_MAP_SAT="Yahoo Satellite"}this.baseMaps.YAHOO_MAP_SAT=C;break;case"YAHOO_MAP_HYB":if(C.mapTag.extension.Options[0].name){this.options.YAHOO_MAP_HYB=C.mapTag.extension.Options[0].name[0]}else{this.options.YAHOO_MAP_HYB="Yahoo Hybrid"}this.baseMaps.YAHOO_MAP_HYB=C;break;default:break}if(!this.defaultBasemap){this.defaultBasemap=C.mapTag.extension.Options[0].type[0]}}break;case"VirtualEarth":if(!C.mapTag.extension.Options||!C.mapTag.extension.Options[0].type){this.options.Road="Bing Street";this.baseMaps.Road=C;if(!this.defaultBasemap){this.defaultBasemap="Road"}}else{switch(C.mapTag.extension.Options[0].type[0]){case"Road":if(C.mapTag.extension.Options[0].name){this.options.Road=C.mapTag.extension.Options[0].name[0]}else{this.options.Road="Bing Street"}this.baseMaps.Road=C;break;case"Aerial":if(C.mapTag.extension.Options[0].name){this.options.Aerial=C.mapTag.extension.Options[0].name[0]}else{this.options.Aerial="Bing Satellite"}this.baseMaps.Aerial=C;break;case"Hybrid":if(C.mapTag.extension.Options[0].name){this.options.Hybrid=C.mapTag.extension.Options[0].name[0]}else{this.options.Hybrid="Bing Hybrid"}this.baseMaps.Hybrid=C;break;default:break}if(!this.defaultBasemap){this.defaultBasemap=C.mapTag.extension.Options[0].type[0]}}break;default:break}}if(!this.defaultBasemap){this.defaultBasemap="None"}},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);this.setDefaultBasemap()},setBasemap:function(A){if("None"!=A&&this.getMap().oMapOL.baseLayer.CLASS_NAME=="OpenLayers.Layer.MapGuide"){var B=this.baseMaps.None.oLayerOL.visibility;this.getMap().oMapOL.setBaseLayer(this.baseMaps[A].oLayerOL,false);this.baseMaps.None.oLayerOL.visibility=B;this.baseMaps.None.oLayerOL.redraw()}else{this.getMap().oMapOL.setBaseLayer(this.baseMaps[A].oLayerOL,false)}},setDefaultBasemap:function(){this.generateOptions();this.uiObj.initialize();var C=new Jx.ButtonSet();for(var A in this.options){if(this.options[A]){var B=new Jx.Menu.Item({label:OpenLayers.i18n(this.options[A]),toggle:true,onDown:OpenLayers.Function.bind(this.setBasemap,this,A)});C.add(B);this.uiObj.add(B);this.menuItems[A]=B}}this.menuItems[this.defaultBasemap].setActive(true);this.setBasemap(this.defaultBasemap)}});Fusion.Widget.Buffer=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,isExclusive:true,layerName:null,layerNameInput:null,bufferDistance:null,bufferDistanceInput:null,bufferUnits:null,bufferUnitsInput:null,borderColor:null,borderColorInput:null,fillColor:null,fillColorInput:null,initializeWidget:function(B){var A=B.extension;this.layerName=A.LayerName?A.LayerName[0]:"";this.layerNameInput=A.LayerNameInput?A.LayerNameInput[0]:null;this.bufferDistance=A.BufferDistance?parseFloat(A.BufferDistance[0]):"";this.bufferDistanceInput=A.BufferDistanceInput?A.BufferDistanceInput[0]:null;this.bufferUnits=Fusion.unitFromName(A.BufferUnits?A.BufferUnits[0]:"meters");this.bufferUnitsInput=A.BufferUnitsInput?A.BufferUnitsInput[0]:null;this.borderColor=A.BorderColor?A.BorderColor[0]:"00000000";this.borderColorInput=A.BorderColorInput?A.BorderColorInput[0]:null;this.fillColor=A.FillColor?A.FillColor[0]:"00000000";this.fillColorInput=A.FillColorInput?A.FillColorInput[0]:null;if(this.layerNameInput){this.layerNameInput=$(this.layerNameInput);this.setValue(this.layerNameInput,this.layerName)}if(this.bufferDistanceInput){this.bufferDistanceInput=$(this.bufferDistanceInput);this.setValue(this.bufferDistanceInput,this.bufferDistance)}if(this.bufferUnitsInput){this.bufferUnitsInput=$(this.bufferUnitsInput);this.setValue(this.bufferUnitsInput,this.bufferUnits)}if(this.borderColorInput){this.borderColorInput=$(this.borderColorInput);this.setValue(this.borderColorInput,this.borderColor)}if(this.fillColorInput){this.fillColorInput=$(this.fillColorInput);this.setValue(this.fillColorInput,this.fillColor)}this.enable=Fusion.Widget.Buffer.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.disable,this))},setValue:function(A,C){if(A.tagName.toLowerCase()=="input"){switch(A.type){case"radio":case"checkbox":for(var B=0;B<A.length;B++){if(A[B].value==C){A[B].checked=true}}break;case"file":break;case"button":case"hidden":case"image":case"password":case"reset":case"submit":case"text":A.value=C;break;default:}}if(A.tagName.toLowerCase()=="textarea"){A.value=C}if(A.tagName.toLowerCase()=="select"){for(var B=0;B<A.options.length;B++){if(A.options[B].value==C){A.options[B].selected=true;break}}}},getValue:function(A){if(A.tagName.toLowerCase()=="input"){switch(A.type){case"radio":case"checkbox":return A.value;break;case"file":case"button":case"hidden":case"image":case"password":case"reset":case"submit":case"text":return A.value;break;default:}}if(A.tagName.toLowerCase()=="textarea"){return A.value}if(A.tagName.toLowerCase()=="select"){return A.options[A.selectedIndex].value}},enable:function(){if(this.oMap&&this.oMap.hasSelection()){Fusion.Widget.prototype.enable.apply(this,[])}else{this.disable()}},execute:function(){if(this.layerNameInput){this.layerName=this.getValue(this.layerNameInput)}var G="&layer="+this.layerName;var I;if(this.bufferDistanceInput){I=this.getValue(this.bufferDistanceInput)}else{I=this.bufferDistance}var C;if(this.bufferUnitsInput){C=this.getValue(this.bufferUnitsInput)}else{C=this.bufferUnits}var A="&distance="+Fusion.toMeter(Fusion.unitFromName(C),I);var E="&bordercolor=";if(this.borderColorInput){E+=this.getValue(this.borderColorInput)}else{E+=this.borderColor}var B="&fillcolor=";if(this.fillColorInput){B+=this.getValue(this.fillColorInput)}else{B+=this.fillColor}var D=this.getMap();var H=D.getAllMaps();var J=H[0].arch+"/"+Fusion.getScriptLanguage()+"/Buffer."+Fusion.getScriptLanguage();var F={};F.parameters="locale="+Fusion.locale+"&merge=1&session="+H[0].getSessionID()+"&mapname="+H[0].getMapName()+G+A+E+B;F.onComplete=OpenLayers.Function.bind(this.bufferCreated,this);Fusion.ajaxRequest(J,F)},bufferCreated:function(){var B=this.getMap().getAllMaps();var A=B[0].getLayerByName(this.layerName);if(A){A.noCache=true}B[0].reloadMap();B[0].drawMap()}});Fusion.Widget.BufferPanel=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,resizable=no,status=no",isExclusive:true,initializeWidget:function(E){var D=E.extension;this.sTarget=D.Target?D.Target[0]:"BufferPanelWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/BufferPanel/BufferPanel.php";this.bSelectionOnly=(D.DisableIfSelectionEmpty&&(D.DisableIfSelectionEmpty[0]=="true"||D.DisableIfSelectionEmpty[0]=="1"))?true:false;this.additionalParameters=[];if(D.AdditionalParameter){for(var C=0;C<D.AdditionalParameter.length;C++){var F=D.AdditionalParameter[C];var B=F.Key[0];var A=F.Value[0];this.additionalParameters.push(B+"="+encodeURIComponent(A))}}this.enable=Fusion.Widget.BufferPanel.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.enable,this));this.disable()},enable:function(){var A=this.getMap();if(this.bSelectionOnly||!A){if(A&&A.hasSelection()){if(this.action){this.action.setEnabled(true)}else{Fusion.Widget.prototype.enable.apply(this,[])}}else{if(this.action){this.action.setEnabled(false)}else{this.disable()}}}else{if(this.action){this.action.setEnabled(true)}else{Fusion.Widget.prototype.enable.apply(this,[])}}},activate:function(){var C=this.sBaseUrl;var E=this.getMap();var B=E.getAllMaps();var D=Fusion.getWidgetById(this.sTarget);var A=$(this.sTarget);var F=[];F.push("locale="+Fusion.locale);F.push("session="+B[0].getSessionID());F.push("mapname="+B[0].getMapName());if(D||A){F.push("popup=false")}else{F.push("popup=true")}F.push("us=0");F=F.concat(this.additionalParameters);if(C.indexOf("?")<0){C+="?"}else{if(C.slice(-1)!="&"){C+="&"}}C+=F.join("&");if(D){D.setContent(C)}else{if(A){A.src=C}else{window.open(C,this.sTarget,this.sWinFeatures)}}}});Fusion.Widget.CenterSelection=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,initializeWidget:function(A){Fusion.Widget.prototype.initialize.apply(this,[A,false]);Fusion.Widget.prototype.initialize.apply(this,[]);this.enable=Fusion.Widget.CenterSelection.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.disable,this))},activate:function(){this.getMap().getSelection(OpenLayers.Function.bind(this.centerSelection,this))},centerSelection:function(N){var B=this.getMap();var M=B.getCurrentExtents();var J=M[2]-M[0];var I=M[3]-M[1];var L=N[B.getMapName()].getLowerLeftCoord();var E=N[B.getMapName()].getUpperRightCoord();var G=E.x-L.x;var A=E.y-L.y;if(G<J&&A<I){var D=(E.x+L.x)/2;var C=(E.y+L.y)/2;B.zoom(D,C,1)}else{var F=0.1;var P=L.x-G*F;var O=L.y-A*F;var K=E.x+G*F;var H=E.y+A*F;B.setExtents(new OpenLayers.Bounds(P,O,K,H))}},enable:function(){if(this.oMap&&this.oMap.hasSelection()){Fusion.Widget.prototype.enable.apply(this,[])}else{this.disable()}}});Fusion.Widget.ClearSelection=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,initializeWidget:function(A){this.enable=Fusion.Widget.ClearSelection.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.disable,this))},activate:function(){this.getMap().clearSelection()},enable:function(){if(this.oMap&&this.oMap.hasSelection()){Fusion.Widget.prototype.enable.apply(this,[])}else{this.disable()}}});Fusion.Widget.EditableScale=OpenLayers.Class(Fusion.Widget,{precision:4,initializeWidget:function(B){var A=B.extension;this.domPrefix=document.createElement("span");this.domPrefix.className="inputEditableScalePrefix";this.domPrefix.innerHTML="1: ";this.domScale=document.createElement("input");this.domScale.className="inputEditableScale";OpenLayers.Event.observe(this.domScale,"keypress",OpenLayers.Function.bindAsEventListener(this.keyPressHandler,this));this.precision=A.Precision?parseInt(A.Precision[0]):this.precision;this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.scaleChanged,this));Fusion.addWidgetStyleSheet(B.location+"/EditableScale/EditableScale.css");if(this.domObj){this.domObj.appendChild(this.domPrefix);this.domObj.appendChild(this.domScale)}},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);if(this.uiObj.domObj){this.uiObj.domObj.appendChild(this.domPrefix);this.uiObj.domObj.appendChild(this.domScale)}else{this.uiObj.appendChild(this.domPrefix);this.uiObj.appendChild(this.domScale)}},scaleChanged:function(){this.domScale.value=this.scaleToString(this.getMap().oMapOL.getScale())},scaleToString:function(A){A=Math.abs(parseFloat(A));return""+Math.round(A*Math.pow(10,this.precision))/Math.pow(10,this.precision)},keyPressHandler:function(A){if(A.keyCode==OpenLayers.Event.KEY_RETURN){this.zoomToScale()}},zoomToScale:function(A){var B=parseFloat(this.domScale.value);if(B){this.getMap().zoomToScale(B)}}});Fusion.Event.HISTORY_CHANGED=Fusion.Event.lastEventId++;Fusion.Widget.ExtentHistory=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,events:[],aHistory:[],sDirection:null,EPS:1e-8,initializeWidget:function(C){var B=C.extension;var A=B.Direction?B.Direction[0].toLowerCase():"previous";if(A!="previous"&&A!="next"){this.sDirection="previous"}else{this.sDirection=A}if(!this.aHistory.history){this.aHistory.history=[];this.aHistory.index=-1;this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.extentsChanged,this));this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.reset,this))}this.enable=Fusion.Widget.ExtentHistory.prototype.historyChanged;this.disable=Fusion.Widget.ExtentHistory.prototype.historyChanged;this.registerEventID(Fusion.Event.HISTORY_CHANGED);this.registerForEvent(Fusion.Event.HISTORY_CHANGED,OpenLayers.Function.bind(this.historyChanged,this));this.disable()},reset:function(){if(this.getMap().isMapLoaded()){this.aHistory.history=[this.getMap().getCurrentExtents()];this.aHistory.index=0}else{this.aHistory.history=[];this.aHistory.index=-1}this.historyChanged()},extentsChanged:function(){var A=this.getMap().getCurrentExtents();if(this.aHistory.history.length==0){this.aHistory.history.push(A);this.aHistory.index=0}else{var B=this.aHistory.history[this.aHistory.index];if(this.boundsEqual(A,B)){return }if(this.aHistory.index!=(this.aHistory.history.length-1)){this.aHistory.history=this.aHistory.history.slice(0,this.aHistory.index+1)}this.aHistory.history.push(A);this.aHistory.index=this.aHistory.history.length-1}this.triggerEvent(Fusion.Event.HISTORY_CHANGED)},historyChanged:function(){if(this.sDirection=="previous"){if(this.aHistory.index>0){Fusion.Widget.prototype.enable.apply(this,[])}else{Fusion.Widget.prototype.disable.apply(this,[])}}else{if(this.aHistory.index<(this.aHistory.history.length-1)){Fusion.Widget.prototype.enable.apply(this,[])}else{Fusion.Widget.prototype.disable.apply(this,[])}}},activate:function(){if(this.sDirection=="previous"){if(this.aHistory.index>0){this.aHistory.index--;this.getMap().setExtents(this.aHistory.history[this.aHistory.index]);this.triggerEvent(Fusion.Event.HISTORY_CHANGED)}}else{if(this.aHistory.index<(this.aHistory.history.length-1)){this.aHistory.index++;this.getMap().setExtents(this.aHistory.history[this.aHistory.index]);this.triggerEvent(Fusion.Event.HISTORY_CHANGED)}}},boundsEqual:function(B,A){var C=false;var D=100;if(A.top==0){B.top+=D;A.top+=D}if(A.bottom==0){B.bottom+=D;A.bottom+=D}if(A.left==0){B.left+=D;A.left+=D}if(A.right==0){B.right+=D;A.right+=D}C=(Math.abs((B.top-A.top)/A.top)<this.EPS&&Math.abs((B.bottom-A.bottom)/A.bottom)<this.EPS&&Math.abs((B.left-A.left)/A.left)<this.EPS&&Math.abs((B.right-A.right)/A.right)<this.EPS);return C}});Fusion.Widget.FeatureInfo=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,sFeatures:"menubar=no,location=no,resizable=no,status=no",initializeWidget:function(B){var A=B.extension;this.sTarget=A.Target?A.Target[0]:"FeatureInfoWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/FeatureInfo/featureinfomain.php"},activate:function(){var C=this.sBaseUrl;var E=this.getMap();var B=E.getAllMaps();var D=Fusion.getWidgetById(this.sTarget);var A=$(this.sTarget);var F=[];F.push("LOCALE="+Fusion.locale);F.push("SESSION="+B[0].getSessionID());F.push("MAPNAME="+B[0].getMapName());if(D||A){F.push("POPUP=false")}else{F.push("POPUP=true")}if(C.indexOf("?")<0){C+="?"}else{if(C.slice(-1)!="&"){C+="&"}}C+=F.join("&");if(D){D.setContent(C)}else{if(A){A.src=C}else{window.open(C,this.sTarget,this.sWinFeatures)}}}});Fusion.Widget.Help=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,resizable=no,status=no",target:"HelpWindow",baseUrl:null,defaultUrl:"widgets/Help/Help.html",initializeWidget:function(B){var A=B.extension;this.target=A.Target?A.Target[0]:"HelpWindow";this.baseUrl=A.Url?A.Url[0]:this.defaultUrl;if(this.baseUrl==this.defaultUrl){this.baseUrl=Fusion.getFusionURL()+this.baseUrl}if(!B.Disabled||B.Disabled[0].toLowerCase()!="true"){this.enable()}},activate:function(){var B=this.baseUrl;var D=this.getMap();var E=[];E.push("LOCALE="+Fusion.locale);E.push("SESSION="+D.getSessionID());E.push("MAPNAME="+D.getMapName());if(B.indexOf("?")<0){B+="?"}else{if(B.slice(-1)!="&"){B+="&"}}B+=E.join("&");var C=Fusion.getWidgetById(this.target);if(C){C.setContent(B)}else{var A=$(this.target);if(A){A.src=B}else{window.open(B,this.target,this.sWinFeatures)}}}});Fusion.Widget.InitialMapView=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,viewType:"initial",initializeWidget:function(B){var A=B.extension;if(A.ViewType&&(A.ViewType[0].toLowerCase()=="full")){this.viewType="full"}},activate:function(){if(this.viewType=="full"){this.getMap().fullExtents()}else{var A=this.getMap();A.setExtents(A.initialExtents)}}});Fusion.Widget.InvokeScript=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,script:null,initializeWidget:function(B){var A=B.extension;this.script=A.Script?A.Script[0]:""},activate:function(){eval(this.script)}});Fusion.Widget.InvokeURL=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,resizable=no,status=no",initializeWidget:function(E){var D=E.extension;this.sTarget=D.Target?D.Target[0]:"InvokeUrlWindow";this.sBaseUrl=D.Url[0];this.bSelectionOnly=(D.DisableIfSelectionEmpty&&(D.DisableIfSelectionEmpty[0]=="true"||D.DisableIfSelectionEmpty[0]=="1"))?true:false;this.additionalParameters=[];if(D.AdditionalParameter){for(var C=0;C<D.AdditionalParameter.length;C++){var F=D.AdditionalParameter[C];var B=F.Key[0];var A=F.Value[0];this.additionalParameters.push(B+"="+encodeURIComponent(A))}}this.enable=Fusion.Widget.InvokeURL.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.enable,this));this.disable()},enable:function(){var A=this.getMap();if(this.bSelectionOnly||!A){if(A&&A.hasSelection()){if(this.action){this.action.setEnabled(true)}else{Fusion.Widget.prototype.enable.apply(this,[])}}else{if(this.action){this.action.setEnabled(false)}else{this.disable()}}}else{if(this.action){this.action.setEnabled(true)}else{Fusion.Widget.prototype.enable.apply(this,[])}}},activate:function(){var B=this.sBaseUrl;var D=this.getMap();var E=[];E.push("LOCALE="+Fusion.locale);E.push("SESSION="+D.getSessionID());E.push("MAPNAME="+D.getMapName());E=E.concat(this.additionalParameters);if(B.indexOf("?")<0){B+="?"}else{if(B.slice(-1)!="&"){B+="&"}}B+=E.join("&");var C=Fusion.getWidgetById(this.sTarget);if(C){C.setContent(B)}else{var A=$(this.sTarget);if(A){A.src=B}else{window.open(B,this.sTarget,this.sFeatures)}}}});Fusion.Widget.LayerManager=OpenLayers.Class(Fusion.Widget,{currentNode:null,bIsDrawn:false,map:null,initializeWidget:function(B){var A=B.extension;this.delIconSrc=A.DeleteIcon?A.DeleteIcon[0]:"images/icons/select-delete.png";Fusion.addWidgetStyleSheet(B.location+"LayerManager/LayerManager.css");this.cursorNormal=["url('images/grab.cur'),move","grab","-moz-grab","move"];this.cursorDrag=["url('images/grabbing.cur'),move","grabbing","-moz-grabbing","move"];this.map=this.getMap();this.map.registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.mapLoaded,this));this.map.registerForEvent(Fusion.Event.MAP_RELOADED,OpenLayers.Function.bind(this.mapReLoaded,this));this.map.aMaps[0].registerForEvent(Fusion.Event.LAYER_PROPERTY_CHANGED,OpenLayers.Function.bind(this.layerChanged,this))},mapLoaded:function(){this.draw()},layerChanged:function(){this.updateSessionMapFile()},mapReLoaded:function(){this.draw()},clear:function(A){while(A.childNodes.length>0){this.clear(A.childNodes[0]);A.destroy(A.childNodes[0])}},draw:function(C){if(this.mapList){this.clear(this.mapList);this.mapList.destroy();this.mapList=null}this.mapList=document.createElement("ul");this.mapList.className="jxLman";this.domObj.appendChild(this.mapList);var F=this.getMap();for(var B=0;B<F.aMaps.length;++B){var E=document.createElement("li");E.className="jxLmanMap";E.id="mapBlock_"+B;var D=document.createElement("a");D.innerHTML=F.aMaps[B]._sMapTitle;D.className="jxLmanHandle";E.appendChild(D);this.mapList.appendChild(E);this.processMapBlock(E,F.aMaps[B])}if(F.aMaps.length>1){var A=[];A.onUpdate=OpenLayers.Function.bind(this.updateMapBlock,this,F);A.handle="jxLmanHandle";A.scroll=this.domObj.id;Sortable.create(this.mapList.id,A)}},processMapBlock:function(H,G){var A=document.createElement("ul");A.className="jxLmanSet";A.id="fusionLayerManager_"+G.getMapName();H.appendChild(A);G.layerPrefix="layer_";var F=G.aLayers;for(var C=0;C<F.length;++C){var D=document.createElement("li");D.className="jxLmanLayer";D.id=G.layerPrefix+C;A.appendChild(D);this.createItemHtml(D,F[C]);D.layer=F[C]}var B={constrain:true,clone:false,revert:true,onComplete:OpenLayers.Function.bind(this.updateLayer,$(A.id),G)};var E=new Sortables(A.id,B)},createItemHtml:function(D,B){var E=document.createElement("img");E.src=this.delIconSrc;OpenLayers.Event.observe(E,"click",OpenLayers.Function.bind(this.deleteLayer,this,B));E.style.visibility="hidden";D.appendChild(E);var C=document.createElement("input");C.type="checkbox";OpenLayers.Event.observe(C,"click",OpenLayers.Function.bind(this.visChanged,this,B));D.appendChild(C);if(B.visible){C.checked=true}else{C.checked=false}var A=document.createElement("a");A.innerHTML=B.legendLabel;OpenLayers.Event.observe(A,"mouseover",OpenLayers.Function.bind(this.setGrabCursor,this));OpenLayers.Event.observe(A,"mousedown",OpenLayers.Function.bind(this.setDragCursor,this));OpenLayers.Event.observe(A,"mouseout",OpenLayers.Function.bind(this.setNormalCursor,this));D.appendChild(A);OpenLayers.Event.observe(D,"mouseover",OpenLayers.Function.bind(this.setHandleVis,this,E));OpenLayers.Event.observe(D,"mouseout",OpenLayers.Function.bind(this.setHandleHide,this,E))},setHandleVis:function(A){A.style.visibility="visible"},setHandleHide:function(A){A.style.visibility="hidden"},setGrabCursor:function(A){this.setCursor(this.cursorDrag,A.currentTarget.parentNode)},setDragCursor:function(A){this.setCursor(this.cursorDrag,A.currentTarget.parentNode)},setNormalCursor:function(A){this.setCursor("auto",A.currentTarget.parentNode)},setCursor:function(C,A){this.cursor=C;if(C&&C.length&&typeof C=="object"){for(var B=0;B<C.length;B++){A.style.cursor=C[B];if(A.style.cursor==C[B]){break}}}else{if(typeof C=="string"){A.style.cursor=C}else{A.style.cursor="auto"}}},updateLayer:function(G,D){var C=[];var F=[];var H=this.childNodes.length;for(var B=0;B<H;++B){F[B]=this.childNodes[B].id.split("_");var A=parseInt(F[B].pop());C.push(A);this.childNodes[B].id=""}for(var B=0;B<this.childNodes.length;++B){var E=this.childNodes[B];F[B].push(B);E.id=F[B].join("_");E.childNodes[1].checked=E.layer.isVisible()}G.reorderLayers(C)},updateMapBlock:function(B,A){},deleteLayer:function(C,D){var A=(new Event(D)).target.parentNode;var B=A.parentNode;$(A).dispose();this.updateLayer(C.oMap,B)},visChanged:function(C,B){var D=(new Event(B)).target;var A=D.parentNode.layer;if(D.checked){A.show()}else{A.hide()}},updateSessionMapFile:function(){var B=this.getMap();var H=B.getAllMaps();var K=H[0];var F=H[0].getSessionID();var J=K.aLayers;var D=[];var I=[];for(var G=0;G<J.length;G++){D.push(J[G].layerName);if(J[G].visible==true){I.push(J[G].layerName)}}var E="&session="+F+"&mapname="+this.getMap().getMapName()+"&visLayers="+I+"&layers="+D;var L={parameters:E};var C=this.getMap().aMaps[0];var A="layers/"+C.arch+"/"+Fusion.getScriptLanguage()+"/updateSessionMapFile."+Fusion.getScriptLanguage();Fusion.ajaxRequest(A,L)}});Fusion.Widget.Legend=OpenLayers.Class(Fusion.Widget,{defaultLayerDWFIcon:"images/icons/legend-DWF.png",defaultLayerRasterIcon:"images/icons/legend-raster.png",defaultLayerThemeIcon:"images/icons/legend-theme.png",defaultDisabledLayerIcon:"images/icons/legend-layer.png",defaultRootFolderIcon:"images/icons/legend-map.png",defaultLayerInfoIcon:"images/icons/tree_layer_info.png",defaultGroupInfoIcon:"images/icons/tree_group_info.png",initializeWidget:function(widgetTag){Fusion.addWidgetStyleSheet(widgetTag.location+"Legend/Legend.css");var json=widgetTag.extension;if(json.LegendRenderer){var renderer=eval(json.LegendRenderer[0]);if(renderer&&renderer.prototype.CLASS_NAME&&renderer.prototype.CLASS_NAME=="Fusion.Widget.Legend.LegendRenderer"){this.renderer=new renderer(this,widgetTag)}else{if(typeof renderer=="function"){var renderFunction=renderer;this.renderer=new Fusion.Widget.Legend.LegendRenderer(this);this.renderer.mapLoaded=renderFunction;this.renderer.mapReloaded=renderFunction;this.renderer.mapLoading=false}else{this.renderer=new Fusion.Widget.Legend.LegendRendererDefault(this,widgetTag)}}}else{this.renderer=new Fusion.Widget.Legend.LegendRendererDefault(this,widgetTag)}if(this.renderer.mapReloaded){this.getMap().registerForEvent(Fusion.Event.MAP_RELOADED,OpenLayers.Function.bind(this.renderer.mapReloaded,this.renderer))}if(this.renderer.mapLoading){this.getMap().registerForEvent(Fusion.Event.MAP_LOADING,OpenLayers.Function.bind(this.renderer.mapLoading,this.renderer))}if(this.renderer.mapLoaded){this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.renderer.mapLoaded,this.renderer))}}});Fusion.Widget.Legend.LegendRenderer=OpenLayers.Class({oLegend:null,layerRoot:null,initialize:function(A){this.oLegend=A;this.layerRoot=this.getMap().layerRoot},renderLegend:function(){},mapLoading:function(){},mapLoaded:function(){},mapReloaded:function(){},getMap:function(){return this.oLegend.getMap()},CLASS_NAME:"Fusion.Widget.Legend.LegendRenderer"});Fusion.Widget.Legend.LegendRendererDefault=OpenLayers.Class(Fusion.Widget.Legend.LegendRenderer,{showRootFolder:false,currentNode:null,bIsDrawn:false,targetFolder:null,bIncludeVisToggle:true,initialize:function(C,D){Fusion.Widget.Legend.LegendRenderer.prototype.initialize.apply(this,[C]);var B=D.extension;this.imgLayerDWFIcon=B.LayerDWFIcon?B.LayerDWFIcon[0]:this.oLegend.defaultLayerDWFIcon;this.imgLayerRasterIcon=B.LayerRasterIcon?B.LayerRasterIcon[0]:this.oLegend.defaultLayerRasterIcon;this.imgLayerThemeIcon=B.LayerThemeIcon?B.LayerThemeIcon[0]:this.oLegend.defaultLayerThemeIcon;this.imgDisabledLayerIcon=B.DisabledLayerIcon?B.DisabledLayerIcon[0]:this.oLegend.defaultDisabledLayerIcon;this.imgLayerInfoIcon=B.LayerInfoIcon?B.LayerInfoIcon[0]:this.oLegend.defaultLayerInfoIcon;this.imgGroupInfoIcon=B.GroupInfoIcon?B.GroupInfoIcon[0]:this.oLegend.defaultGroupInfoIcon;this.selectedLayer=null;this.oTree=new Jx.Tree({parent:this.oLegend.domObj});this.hideInvisibleLayers=(B.HideInvisibleLayers&&B.HideInvisibleLayers[0])=="true"?true:false;this.showRootFolder=(B.ShowRootFolder&&B.ShowRootFolder[0]=="true")?true:false;this.showMapFolder=(B.ShowMapFolder&&B.ShowMapFolder[0]=="false")?false:true;if(!this.showRootFolder){this.oRoot=this.oTree}else{var A={label:OpenLayers.i18n("defaultMapTitle"),open:true,draw:this.renderFolderCheckbox,contextMenu:this.getContextMenu(),"class":"fusionLegendFolder"};this.oRoot=new Jx.TreeFolder(A);this.oTree.append(this.oRoot);this.oRoot.options.contextMenu.add(new Jx.Menu.Item({label:OpenLayers.i18n("collapse"),onClick:OpenLayers.Function.bind(this.collapseBranch,this,this.oRoot)}),new Jx.Menu.Item({label:OpenLayers.i18n("expand"),onClick:OpenLayers.Function.bind(this.expandBranch,this,this.oRoot)}))}this.extentsChangedWatcher=this.update.bind(this)},getContextMenu:function(){return new Jx.Menu.Context(this.name).add(new Jx.Menu.Item({label:OpenLayers.i18n("refresh"),onClick:OpenLayers.Function.bind(this.update,this)}),new Jx.Menu.Item({label:OpenLayers.i18n("collapseAll"),onClick:OpenLayers.Function.bind(this.collapseAll,this)}),new Jx.Menu.Item({label:OpenLayers.i18n("expandAll"),onClick:OpenLayers.Function.bind(this.expandAll,this)}))},expandAll:function(C){for(var A=0;A<this.oTree.nodes.length;A++){var B=this.oTree.nodes[A];if(B instanceof Jx.TreeFolder){this.recurseTree("expand",B)}}if(this.showRootFolder){this.oRoot.expand()}},collapseAll:function(C){for(var A=0;A<this.oTree.nodes.length;A++){var B=this.oTree.nodes[A];if(B instanceof Jx.TreeFolder){this.recurseTree("collapse",B)}}if(this.showRootFolder){this.oRoot.collapse()}},collapseBranch:function(A){A.collapse()},expandBranch:function(A){A.expand()},recurseTree:function(D,C){for(var A=0;A<C.nodes.length;A++){var B=C.nodes[A];if(B instanceof Jx.TreeFolder){this.recurseTree(D,B);B[D]()}}},scaleRangesLoaded:function(){this.layerRoot=this.getMap().layerRoot;this.renderLegend()},mapLoading:function(){this.getMap().deregisterForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,this.extentsChangedWatcher);this.clear()},mapLoaded:function(){this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,this.extentsChangedWatcher);this.getMap().loadScaleRanges(OpenLayers.Function.bind(this.scaleRangesLoaded,this))},mapReloaded:function(){this.getMap().loadScaleRanges(OpenLayers.Function.bind(this.scaleRangesLoaded,this))},invalidate:function(){this.draw()},renderLegend:function(B){this.bIsDrawn=false;this.clear();if(this.showRootFolder){this.oRoot.itemLabelobj.innerHTML=this.getMap().getMapTitle()}if(this.showMapFolder){this.renderGroup(this.layerRoot)}else{if(this.layerRoot.groups.length>0){for(var A=0;A<this.layerRoot.groups.length;A++){this.renderGroup(this.layerRoot.groups[A])}}else{for(var A=0;A<group.layers.length;A++){this.processMapLayer(group.layers[A],this.oRoot)}}}this.bIsDrawn=true;this.update()},renderGroup:function(B){if(!B.legend){B.legend={};B.legend.treeItem=this.oRoot}for(var A=0;A<B.groups.length;A++){this.processMapGroup(B.groups[A],this.oRoot)}for(var A=0;A<B.layers.length;A++){this.processMapLayer(B.layers[A],this.oRoot)}},processMapGroup:function(G,F){if(G.displayInLegend){G.legend={};var E={label:G.legendLabel,open:G.expandInLegend,draw:this.renderFolderCheckbox,contextMenu:this.getContextMenu(),"class":"fusionLegendFolder"};G.legend.treeItem=new Jx.TreeFolder(E);G.legend.treeItem.domObj.store("data",G);G.legend.treeItem.options.contextMenu.add(new Jx.Menu.Item({label:OpenLayers.i18n("collapse"),onClick:OpenLayers.Function.bind(this.collapseBranch,this,G.legend.treeItem)}),new Jx.Menu.Item({label:OpenLayers.i18n("expand"),onClick:OpenLayers.Function.bind(this.expandBranch,this,G.legend.treeItem)}));F.append(G.legend.treeItem);if(G.legend.treeItem.checkBox){G.legend.treeItem.checkBox.checked=G.visible?true:false;OpenLayers.Event.observe(G.legend.treeItem.checkBox,"click",OpenLayers.Function.bind(this.stateChanged,this,G))}var D=G.oMap.getGroupInfoUrl(G.groupName);if(D){var A=document.createElement("a");A.href=D;if(D.indexOf("javascript:")<0){A.target="_blank"}var B=document.createElement("img");Jx.addToImgQueue({element:B,src:this.imgGroupInfoIcon});B.border=0;A.appendChild(B);G.legend.treeItem.domObj.insertBefore(A,G.legend.treeItem.domObj.childNodes[4])}if(this.oSelectionListener){G.legend.treeItem.addEvent("click",OpenLayers.Function.bind(this.selectionChanged,this))}for(var C=0;C<G.groups.length;C++){this.processMapGroup(G.groups[C],G.legend.treeItem)}for(var C=0;C<G.layers.length;C++){this.processMapLayer(G.layers[C],G.legend.treeItem)}}},processMapLayer:function(A,B){A.legend={};A.legend.parentItem=B;A.legend.currentRange=null;A.oMap.registerForEvent(Fusion.Event.LAYER_PROPERTY_CHANGED,OpenLayers.Function.bind(this.layerPropertyChanged,this))},layerPropertyChanged:function(B,A){if(A.legend.treeItem.checkBox){A.legend.treeItem.checkBox.checked=A.isVisible()}},update:function(){if(this.bIsDrawn){window.setTimeout(OpenLayers.Function.bind(this._update,this),1)}},_update:function(){var C=this.getMap();var B=C.getScale();for(var A=0;A<C.layerRoot.groups.length;A++){this.updateGroupLayers(C.layerRoot.groups[A],B)}for(var A=0;A<C.layerRoot.layers.length;A++){this.updateLayer(C.layerRoot.layers[A],B)}},clear:function(){while(this.oRoot.nodes.length>0){this.oRoot.remove(this.oRoot.nodes[0])}},selectionChanged:function(B){if(this.currentNode){$(this.currentNode.domObj.childNodes[1]).removeClass("jxTreeItemSelected")}this.currentNode=B;$(this.currentNode.domObj.childNodes[1]).addClass("jxTreeItemSelected");var A=B.domObj.retrieve("data");if(A instanceof Fusion.Layers.Group){this.getMap().setActiveLayer(null)}else{this.getMap().setActiveLayer(A)}},updateGroupLayers:function(C,A){for(var B=0;B<C.groups.length;B++){this.updateGroupLayers(C.groups[B],A)}for(var B=0;B<C.layers.length;B++){this.updateLayer(C.layers[B],A)}},updateLayer:function(E,C){var H=E.isBaseMapLayer?false:this.bIncludeVisToggle;if(!E.displayInLegend||!E.legend){return }var B=E.getScaleRange(C);if(B==E.legend.currentRange&&E.legend.treeItem){return }E.legend.currentRange=B;if(B!=null){if(B.styles.length>1){if(!E.legend.treeItem){E.legend.treeItem=this.createFolderItem(E,H);if(E.legend.treeItem.checkBox){OpenLayers.Event.observe(E.legend.treeItem.checkBox,"click",OpenLayers.Function.bind(this.stateChanged,this,E))}E.parentGroup.legend.treeItem.append(E.legend.treeItem)}else{if(E.legend.treeItem instanceof Jx.TreeItem){this.clearTreeItem(E);E.legend.treeItem=this.createFolderItem(E,H);if(E.legend.treeItem.checkBox){OpenLayers.Event.observe(E.legend.treeItem.checkBox,"click",OpenLayers.Function.bind(this.stateChanged,this,E))}E.parentGroup.legend.treeItem.append(E.legend.treeItem)}else{while(E.legend.treeItem.nodes.length>0){E.legend.treeItem.remove(E.legend.treeItem.nodes[0])}}}for(var D=0;D<B.styles.length;D++){var G=this.createTreeItem(E,B.styles[D],C,false);E.legend.treeItem.append(G)}}else{var F=B.styles[0];if(F&&!F.legendLabel){F.legendLabel=E.legendLabel}if(!E.legend.treeItem){E.legend.treeItem=this.createTreeItem(E,F,C,H);if(H){OpenLayers.Event.observe(E.legend.treeItem.checkBox,"click",OpenLayers.Function.bind(this.stateChanged,this,E))}E.parentGroup.legend.treeItem.append(E.legend.treeItem)}else{if(E.legend.treeItem instanceof Jx.TreeFolder){this.clearTreeItem(E);E.legend.treeItem=this.createTreeItem(E,F,C,H);if(H){OpenLayers.Event.observe(E.legend.treeItem.checkBox,"click",OpenLayers.Function.bind(this.stateChanged,this,E))}E.parentGroup.legend.treeItem.append(E.legend.treeItem)}else{if(B.styles.length>0){E.legend.treeItem.domImg.style.backgroundImage="url("+E.oMap.getLegendImageURL(C,E,B.styles[0])+")";E.legend.treeItem.domImg.style.backgroundPosition="0px 0px";$(E.legend.treeItem.domObj).removeClass("jxDisabled")}else{$(E.legend.treeItem.domObj).addClass("jxDisabled")}}}}if(H){E.legend.treeItem.checkBox.checked=E.visible?true:false;if(E.layerTypes[0]==4||B.styles.length>0){E.legend.treeItem.checkBox.disabled=false}else{E.legend.treeItem.checkBox.disabled=true}}}else{if(this.hideInvisibleLayers){if(E.legend.treeItem){E.parentGroup.legend.treeItem.remove(E.legend.treeItem);E.legend.treeItem=null}}else{var A=this.createTreeItem(E,{legendLabel:E.legendLabel},null,H);if(H){OpenLayers.Event.observe(A.checkBox,"click",OpenLayers.Function.bind(this.stateChanged,this,E))}if(E.legend.treeItem){if(H){E.legend.treeItem.checkBox.disabled=true}E.parentGroup.legend.treeItem.replace(A,E.legend.treeItem);E.legend.treeItem.finalize()}else{E.parentGroup.legend.treeItem.append(A)}E.legend.treeItem=A}}if(E.legend.treeItem){E.legend.treeItem.domObj.store("data",E)}},createFolderItem:function(E,D){var C={label:E.legendLabel==""?"&nbsp;":E.legendLabel,isOpen:E.expandInLegend,draw:D?this.renderFolderCheckbox:this.renderFolder,"class":"fusionLegendItemCheckbox",contextMenu:this.getContextMenu(),image:this.imgLayerThemeIcon};var F=new Jx.TreeFolder(C);F.options.contextMenu.add(new Jx.Menu.Item({label:OpenLayers.i18n("collapse"),onClick:OpenLayers.Function.bind(this.collapseBranch,this,F)}),new Jx.Menu.Item({label:OpenLayers.i18n("expand"),onClick:OpenLayers.Function.bind(this.expandBranch,this,F)}));var G=E.oMap.getLayerInfoUrl(E.layerName);if(G){var A=document.createElement("a");A.href=G;if(G.indexOf("javascript:")<0){A.target="_blank"}var B=document.createElement("img");Jx.addToImgQueue({element:B,src:this.imgLayerInfoIcon});B.border=0;A.appendChild(B);F.domObj.insertBefore(A,F.domObj.childNodes[4])}F.addEvent("click",OpenLayers.Function.bind(this.selectionChanged,this));return F},createTreeItem:function(E,A,C,I){var B={};B.statusIsDefault=E.statusDefault;if(I){B.label=E.legendLabel==""?"&nbsp;":E.legendLabel;B.draw=this.renderItemCheckBox}else{B.label=A.legendLabel==""?"&nbsp;":A.legendLabel;B.draw=this.renderItem}if(!A){B.image=this.imgDisabledLayerIcon;B.enabled=false}else{var F=this.imgDisabledLayerIcon;if(E.layerTypes[0]==4){if(A.staticIcon==Fusion.Constant.LAYER_DWF_TYPE){F=this.imgLayerDWFIcon}else{F=this.imgLayerRasterIcon}}if(A.iconOpt&&A.iconOpt.url){B.image=A.iconOpt.url}else{B.image=E.oMap.getLegendImageURL(C,E,A,F)}}B.contextMenu=this.getContextMenu();var J=new Jx.TreeItem(B);if(A&&A.iconX>=0&&A.iconY>=0){J.domImg;J.domImg.style.backgroundImage="url("+B.image+")";J.domImg.src=Jx.aPixel.src;J.domImg.style.backgroundPosition=(-1*A.iconX)+"px "+(-1*A.iconY)+"px";if(A.iconOpt.width){J.domImg.style.width=A.iconOpt.width+"px"}if(A.iconOpt.height){J.domImg.style.height=A.iconOpt.height+"px"}}if(I){var G=E.oMap.getLayerInfoUrl(E.layerName);if(G){var H=document.createElement("a");H.href=G;if(G.indexOf("javascript:")<0){H.target="_blank"}var D=document.createElement("img");Jx.addToImgQueue({element:D,src:this.imgLayerInfoIcon});D.border=0;H.appendChild(D);J.domObj.insertBefore(H,J.domObj.childNodes[4])}}J.addEvent("click",OpenLayers.Function.bind(this.selectionChanged,this));return J},clearTreeItem:function(A){if(A.legend.treeItem&&A.legend.treeItem.owner){A.legend.treeItem.domObj.store("data",null);A.legend.treeItem.owner.remove(A.legend.treeItem);A.legend.treeItem.finalize();A.legend.treeItem=null}},stateChanged:function(B,A){if(B.legend&&B.legend.treeItem.checkBox){if(B.legend.treeItem.checkBox.checked){B.show()}else{B.hide()}}OpenLayers.Event.stop(A,true)},renderFolder:function(){var B=new Element("a",{"class":this.options["class"],href:"javascript:void(0)",events:{click:this.selected.bindWithEvent(this),dblclick:this.selected.bindWithEvent(this),contextmenu:this.options.contextMenu.show.bindWithEvent(this.options.contextMenu)}});this.domImg=document.createElement("img");this.domImg.className="jxTreeIcon "+(this.options.imageClass?this.options.imageClass:"");this.domImg.src=Jx.aPixel.src;if(this.options.image){this.domImg.style.backgroundImage="url("+this.options.image+")"}var A=new Element("span",{"class":"fusionLegendLabel",html:this.options.label});B.appendChild(this.domImg);B.appendChild(A);this.itemLabelobj=B;return B},renderFolderCheckbox:function(){var B=new Element("a",{"class":this.options["class"],href:"javascript:void(0)",events:{click:this.selected.bindWithEvent(this),dblclick:this.selected.bindWithEvent(this),contextmenu:this.options.contextMenu.show.bindWithEvent(this.options.contextMenu)}});this.checkBox=document.createElement("input");this.checkBox.type="checkbox";this.domImg=document.createElement("img");this.domImg.className="jxTreeIcon "+(this.options.imageClass?this.options.imageClass:"");this.domImg.src=Jx.aPixel.src;if(this.options.image){this.domImg.style.backgroundImage="url("+this.options.image+")"}var A=new Element("span",{"class":"fusionLegendLabel",html:this.options.label});B.appendChild(this.checkBox);B.appendChild(this.domImg);B.appendChild(A);this.itemLabelobj=B;return B},renderItem:function(){var B=new Element("a",{"class":"fusionLegendItem",href:"javascript:void(0)",events:{click:this.selected.bindWithEvent(this),dblclick:this.selected.bindWithEvent(this),contextmenu:this.options.contextMenu.show.bindWithEvent(this.options.contextMenu)}});this.domImg=document.createElement("img");this.domImg.className="jxTreeIcon "+(this.options.imageClass?this.options.imageClass:"");this.domImg.src=Jx.aPixel.src;if(this.options.image){this.domImg.style.backgroundImage="url("+this.options.image+")"}var A=new Element("span",{"class":"fusionLegendLabel",html:this.options.label});B.appendChild(this.domImg);B.appendChild(A);this.itemLabelobj=B;return B},renderItemCheckBox:function(){var B=new Element("a",{"class":"fusionLegendItemCheckbox",href:"javascript:void(0);",events:{click:this.selected.bindWithEvent(this),dblclick:this.selected.bindWithEvent(this),contextmenu:this.options.contextMenu.show.bindWithEvent(this.options.contextMenu)}});this.checkBox=document.createElement("input");this.checkBox.type="checkbox";if(this.options.statusIsDefault){this.checkBox.checked=true;this.checkBox.disabled=true;this.checkBox.readOnly=true}this.domImg=document.createElement("img");this.domImg.className="jxTreeIcon "+(this.options.imageClass?this.options.imageClass:"");this.domImg.src=Jx.aPixel.src;if(this.options.image){this.domImg.style.backgroundImage="url("+this.options.image+")"}var A=new Element("span",{"class":"fusionLegendLabel",html:this.options.label});B.appendChild(this.checkBox);B.appendChild(this.domImg);B.appendChild(A);this.itemLabelobj=B;return B}});Fusion.Widget.LinkToView=OpenLayers.Class(Fusion.Widget,{initializeWidget:function(B){var A=B.extension;this.baseUrl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?";var C="";for(var D in Fusion.queryParams){if(typeof Fusion.queryParams[D]=="string"){if(D=="extent"||D=="filter"||D=="spatialfilter"||D=="variant"||D=="theme"||D=="selectlayer"||D=="showlayers"||D=="hidelayers"||D=="showgroups"||D=="hidegroups"){continue}this.baseUrl+=C+D+"="+Fusion.queryParams[D];C="&"}}this.anchorLabel=A.Label?A.Label[0]:(this.domObj?(this.domObj.innerHTML?this.domObj.innerHTML:"Link to View"):"Link to View");Fusion.addWidgetStyleSheet(B.location+"LinkToView/LinkToView.css");this.anchor=document.createElement("a");this.anchor.className="anchorLinkToView";this.anchor.href=this.baseUrl;this.anchor.innerHTML=this.anchorLabel;this.anchor.title=A.Tooltip?A.Tooltip[0]:"Right-click to copy or bookmark link to current view";if(this.domObj){this.domObj.innerHTML="";this.domObj.appendChild(this.anchor)}this.getMap().oMapOL.events.register("addlayer",this,this.setListener);this.enable()},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);if(this.uiObj.domObj){this.uiObj.domObj.appendChild(this.anchor)}else{this.uiObj.appendChild(this.anchor)}},setListener:function(A){var B=A.layer;B.events.register("loadend",this,this.updateLink)},updateLink:function(){var A=(this.baseUrl.indexOf("?")==this.baseUrl.length-1)?"":"&";var B=this.getMap().getLinkParams();this.anchor.href=this.baseUrl+A+B}});Fusion.Widget.MapMenu=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Menu,domObj:null,mapGroupData:null,rootFolder:"",menus:null,initializeWidget:function(A){this.enable()},setUiObject:function(F){Fusion.Widget.prototype.setUiObject.apply(this,[F]);var H=this.widgetTag.extension;var G=Fusion.applicationDefinition.mapGroups;this.mapGroupData={};for(var E in G){if(G[E].mapId){var B=G[E];if(H.Folder){this.mapGroupData[B.maps[0].resourceId]=B}else{var D=B;var A=new Jx.Menu.Item({label:B.mapId,onClick:OpenLayers.Function.bind(this.switchMap,this,D)});this.uiObj.add(A)}}}this.arch=this.getMap().getAllMaps()[0].arch;if(this.arch=="MapGuide"&&H.Folder){this.rootFolder=H.Folder?H.Folder[0]:"Library://";var I="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/MapMenu."+Fusion.getScriptLanguage();var C={parameters:{folder:this.rootFolder},onComplete:OpenLayers.Function.bind(this.processMapMenu,this)};Fusion.ajaxRequest(I,C)}},processMapMenu:function(r){if(r.status==200){var o;eval("o="+r.responseText);this.menus={};for(var i=0;i<o.maps.length;i++){var map=o.maps[i];var path=map.path.replace(this.rootFolder,"");if(path.lastIndexOf("/")>-1){path=path.slice(0,path.lastIndexOf("/"));this.createFolders(path)}else{path=""}var data=null;if(this.mapGroupData[map.path]){data=this.mapGroupData[map.path]}else{data={maps:[{resourceId:map.path,singleTile:true,type:this.arch,extension:{ResourceId:[map.path]}}]};data.getInitialView=function(){return this.initialView}}var menuItem=new Jx.Menu.Item({label:map.name,onClick:OpenLayers.Function.bind(this.switchMap,this,data)});if(path==""){this.uiObj.add(menuItem)}else{this.menus[path].add(menuItem)}}}},createFolders:function(F){var C=F.split("/");var D="";var B="";for(var A=0;A<C.length;A++){if(!this.menus[D+B+C[A]]){var E=new Jx.Menu.SubMenu({label:C[A]});if(D==""){this.uiObj.add(E)}else{this.menus[D].add(E)}this.menus[D+B+C[A]]=E}D=D+B+C[A];B="/"}},switchMap:function(A){var B=this.getMap().getCurrentExtents();A.initialView={minX:B.left,minY:B.bottom,maxX:B.right,maxY:B.top};this.getMap().loadMapGroup(A)}});Fusion.Widget.Maptip=OpenLayers.Class(Fusion.Widget,{oCurrentPosition:new OpenLayers.Pixel(0,0),oMapTipPosition:null,nTimer:null,delay:null,aLayers:null,bOverTip:false,sWinFeatures:"menubar=no,location=no,resizable=no,status=no,scrollbars=yes",offset:new OpenLayers.Pixel(2,20),szTip:"",szHref:"",szLabel:"",aTextFields:null,mapTipFired:false,bStartMapTips:false,initializeWidget:function(D){var B=D.widgetSet.getWidgetByName(this.name).extension;this.sTarget=B.Target?B.Target[0]:"MaptipWindow";if(B.WinFeatures){this.sWinFeatures=B.WinFeatures[0]}this.delay=B.Delay?parseInt(B.Delay[0]):350;this.nTolerance=B.Tolerance?parseInt(B.Tolerance[0]):2;this.aCustomURL=[];this.aTextFields=[];this.aLayers=[];this.aLabels=[];if(B.Maptip){for(var A=0;A<B.Maptip.length;A++){this.aLayers.push(B.Maptip[A].Layer);this.aTextFields.push(B.Maptip[A].TextField);this.aLabels.push(B.Maptip[A].Label);this.aCustomURL.push(B.Maptip[A].CustomURL)}}Fusion.addWidgetStyleSheet(D.location+"Maptip/Maptip.css");if(this.domObj){this.domObj.parentNode.removeChild(this.domObj)}else{this.domObj=document.createElement("div")}this.domObj.className="maptipContainer";this.domObj.style.display="none";this.domObj.style.top="0px";this.domObj.style.left="0px";this.iframe=document.createElement("iframe");this.iframe.className="maptipShim";this.iframe.scrolling="no";this.iframe.frameborder=0;OpenLayers.Event.observe(this.domObj,"mouseover",OpenLayers.Function.bind(this.mouseOverTip,this));OpenLayers.Event.observe(this.domObj,"mouseout",OpenLayers.Function.bind(this.mouseOutTip,this));var C=this.getMap().getDomObj();document.getElementsByTagName("BODY")[0].appendChild(this.domObj);this.getMap().observeEvent("mousemove",OpenLayers.Function.bind(this.mouseMove,this));this.getMap().observeEvent("mousedown",OpenLayers.Function.bind(this.mouseDown,this));this.getMap().observeEvent("mouseup",OpenLayers.Function.bind(this.mouseUp,this));this.getMap().observeEvent("mouseout",OpenLayers.Function.bind(this.mouseOut,this));this.eventListener=false;this.getMap().registerForEvent(Fusion.Event.MAP_MAPTIP_REQ_FINISHED,OpenLayers.Function.bind(this._display,this));this.getMap().registerForEvent(Fusion.Event.MAP_BUSY_CHANGED,this.busyChanged.bind(this));this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,this.startMapTips.bind(this))},mouseOut:function(A){if(this.nTimer){window.clearTimeout(this.nTimer);if(!this.nHideTimer){this.nHideTimer=window.setTimeout(OpenLayers.Function.bind(this.hideMaptip,this),250)}}},startMapTips:function(){this.bStartMapTips=true},mouseMove:function(C){if(this.bStartMapTips==true){if(!this.eventListener){this.eventListener=true}if(this.bOverTip||this.mouseIsDown){return }var B=this.getMap();this.mapSize=B.getSize();this.mapOffset=B._oDomObj.offsets;var A=B.getEventPosition(C);if(A.x==this.oCurrentPosition.x&&A.y==this.oCurrentPosition.y){return }this.oCurrentPosition=A;this.oMapTipPosition=A;if(typeof (this.nTimer)=="number"){window.clearTimeout(this.nTimer);this.nTimer=null}this.nTimer=window.setTimeout(OpenLayers.Function.bind(this.showMaptip,this),this.delay)}},mouseDown:function(){this.mouseIsDown=true;this._hide()},mouseUp:function(){this.mouseIsDown=false},showMaptip:function(){this.getMap().getMapTip(this);this.mapTipFired=true},_display:function(F,N){if(typeof (N)=="undefined"||N.t==""){return }if(this.domObj.style.visibility!="visible"||N.t!=this.szTip){this.domObj.innerHTML=null;var B=document.createElement("div");B.className="maptipContent";this.domObj.appendChild(B);var I=true;this.bIsVisible=true;var K=N.t;var L=N.h;var J=N.l;this.szTip=K;this.szHref=L;this.label=J;if(typeof (K)=="object"){for(var G=0;G<K.length;G++){var O=K[G];var H=L[G];var C=J[G];var D=this.addMapTipDomObj(H,O);var M=document.createElement("DIV");M.className="mapTipContentDIV";if(C!=""){M.innerHTML=C+" : ";B.appendChild(M);M.appendChild(D);I=false}else{B.appendChild(M);B.appendChild(D);I=false}}}else{if(K){var M=document.createElement("DIV");M.innerHTML=K.replace(/\\n/g,"<br>");B.appendChild(M);I=false}if(L){var M=document.createElement("DIV");L=L.replace(/\\n/g,"<br>");if(L.indexOf("href=")>0){M.innerHTML=L}else{var E=document.createElement("A");var A=OpenLayers.Function.bind(this.openLink,this,L);E.onclick=OpenLayers.Function.bindAsEventListener(A,this);E.target="_blank";E.href="javascript:void(0)";E.innerHTML=OpenLayers.i18n("maptipLinkText");M.appendChild(E)}B.appendChild(M);I=false}}if(!I){var P=$(this.domObj).getBorderBoxSize();this.oMapTipPosition=this.oMapTipPosition.add(this.mapOffset[0],this.mapOffset[1]);if(this.oCurrentPosition.x<this.mapSize.w/2){this.domObj.style.left=(this.oMapTipPosition.x+this.offset.x)+"px"}else{this.domObj.style.left=(this.oMapTipPosition.x-(P.width+this.offset.x))+"px"}if(this.oCurrentPosition.y<this.mapSize.h/2){this.domObj.style.top=(this.oMapTipPosition.y+this.offset.y)+"px"}else{this.domObj.style.top=(this.oMapTipPosition.y-(P.height+this.offset.y))+"px"}this.domObj.style.visibility="hidden";this.domObj.style.display="block";if(!window.opera){B.appendChild(this.iframe);var P=$(this.domObj).getContentBoxSize();this.iframe.style.width=P.width+"px";this.iframe.style.height=P.height+"px"}this.domObj.style.visibility="visible"}else{this.hideMaptip()}}this.mapTipFired=false},addMapTipDomObj:function(E,F){if(E=="undefined"||E==typeof ("undefined")||E==""){var A=document.createElement("SPAN");A.className="mapTipData";A.innerHTML=F;return A}else{var B,D;var A=document.createElement("SPAN");A.className="mapTipData";if(E.indexOf("href=")>0){A.innerHTML=E;B=linkDiv.firstChild;D=B.href}else{B=document.createElement("a");B.className="mapTipLink";B.innerHTML=F;D=E;A.appendChild(B)}B.href="javascript:void(0)";var C=OpenLayers.Function.bind(this.openLink,this,D);B.onclick=OpenLayers.Function.bindAsEventListener(C,this);return A}},hideMaptip:function(){this.bIsVisible=false;this.hideTimer=window.setTimeout(OpenLayers.Function.bind(this._hide,this),10)},_hide:function(){this.hideTimer=null;this.domObj.style.display="none";this.domObj.style.visibility=""},mouseOverTip:function(){window.clearTimeout(this.nHideTimer);this.nHideTimer=null;this.bOverTip=true},mouseOutTip:function(){this.nHideTimer=window.setTimeout(OpenLayers.Function.bind(this.hideMaptip,this),250);this.bOverTip=false},busyChanged:function(){if(this.getMap().isBusy()){this.bIsVisible=false;this.hideMaptip()}},openLink:function(C,A){var D=Fusion.getWidgetById(this.sTarget);if(D){D.setContent(C)}else{var B=$(this.sTarget);if(B){B.src=C}else{window.open(C,this.sTarget,this.sWinFeatures)}}OpenLayers.Event.stop(A,true);return false}});Fusion.Widget.Navigator=OpenLayers.Class(Fusion.Widget,{bInternalChange:false,zoomInFactor:4,zoomOutFactor:2,panAmount:50,initializeWidget:function(E){this.activeControls=[];var C=document.createElement("map");C.name="Navigator_ImageMap";C.id="Navigator_ImageMap";var M=document.createElement("area");M.shape="poly";M.alt=OpenLayers.i18n("panEast");M.title=OpenLayers.i18n("panEast");M.coords="27,176, 27,177, 40,190, 44,182, 44,159";var N=OpenLayers.Function.bind(this.pan,this,this.panAmount/100,0);OpenLayers.Event.observe(M,"mousedown",OpenLayers.Function.bindAsEventListener(N,this));C.appendChild(M);var M=document.createElement("area");M.shape="poly";M.alt=OpenLayers.i18n("panWest");M.title=OpenLayers.i18n("panWest");M.coords="24,177, 24,176, 7,159, 7,182, 11,190";var A=OpenLayers.Function.bind(this.pan,this,-this.panAmount/100,0);OpenLayers.Event.observe(M,"mousedown",OpenLayers.Function.bindAsEventListener(A,this));C.appendChild(M);var M=document.createElement("area");M.shape="poly";M.alt=OpenLayers.i18n("panSouth");M.title=OpenLayers.i18n("panSouth");M.coords="25,178, 12,191, 21,197, 30,197, 39,191, 26,178";var L=OpenLayers.Function.bind(this.pan,this,0,-this.panAmount/100);OpenLayers.Event.observe(M,"mousedown",OpenLayers.Function.bindAsEventListener(L,this));C.appendChild(M);var M=document.createElement("area");M.shape="poly";M.alt=OpenLayers.i18n("panNorth");M.title=OpenLayers.i18n("panNorth");M.coords="26,175, 43,158, 8,158, 25,175";var G=OpenLayers.Function.bind(this.pan,this,0,this.panAmount/100);OpenLayers.Event.observe(M,"mousedown",OpenLayers.Function.bindAsEventListener(G,this));C.appendChild(M);var M=document.createElement("area");M.shape="circle";M.alt=OpenLayers.i18n("zoomOut");M.title=OpenLayers.i18n("zoomOut");M.coords="25,142,8";var I=OpenLayers.Function.bind(this.zoom,this,1/this.zoomOutFactor);OpenLayers.Event.observe(M,"mousedown",OpenLayers.Function.bindAsEventListener(I,this));C.appendChild(M);var M=document.createElement("area");M.shape="circle";M.alt=OpenLayers.i18n("zoomIn");M.title=OpenLayers.i18n("zoomIn");M.coords="25,34,8";var D=OpenLayers.Function.bind(this.zoom,this,this.zoomInFactor);OpenLayers.Event.observe(M,"mousedown",OpenLayers.Function.bindAsEventListener(D,this));C.appendChild(M);this.domObj.appendChild(C);var H=document.createElement("img");H.src=Fusion.getFusionURL()+E.location+"Navigator/sliderscale.png";H.className="png24";H.width=51;H.height=201;H.style.position="absolute";H.style.left="0px";H.style.top="0px";H.useMap="#Navigator_ImageMap";this.domObj.appendChild(H);var F=document.createElement("div");F.style.position="absolute";F.style.top="6px";F.style.left="6px";F.style.width="39px";F.style.height="16px";this.domObj.appendChild(F);var J=document.createElement("div");J.style.position="absolute";J.style.top="44px";J.style.left="0px";J.style.width="51px";J.style.height="85px";this.domObj.appendChild(J);var B=document.createElement("img");B.src=Fusion.getFusionURL()+E.location+"Navigator/slider.png";B.className="png24";B.width=29;B.height=12;B.style.position="absolute";B.style.left="11px";B.style.top="49px";J.appendChild(B);this.activityIndicator=document.createElement("img");this.activityIndicator.src=Fusion.getFusionURL()+E.location+"Navigator/spinner.gif";this.activityIndicator.width=18;this.activityIndicator.height=6;this.activityIndicator.style.position="absolute";this.activityIndicator.style.top="3px";this.activityIndicator.style.right="4px";F.appendChild(this.activityIndicator);this.domObj.style.position="absolute";this.domObj.style.zIndex=1000;this.domObj.style.width="51px";this.domObj.style.height="204px";this.domObj.style.cursor="pointer";this.domObj.addEvents({mouseenter:OpenLayers.Function.bind(this.mouseEnter,this),mouseleave:OpenLayers.Function.bind(this.mouseLeave,this)});var K=OpenLayers.Function.bind(this.checkPosition,this);new Drag(this.domObj,{handle:F,onComplete:K,preventDefault:true});this.slider=new Slider(J,B,{mode:"vertical",steps:81,snap:true,onComplete:OpenLayers.Function.bind(this.scaleChanged,this)});this.LN9=Math.log(9);this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.updateSlider,this));this.getMap().registerForEvent(Fusion.Event.MAP_RESIZED,K);this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.updateSlider,this));this.getMap().registerForEvent(Fusion.Event.MAP_BUSY_CHANGED,OpenLayers.Function.bind(this.busyChanged,this))},scaleChanged:function(E){var G=this.getMap();var F=null;if(G.oActiveWidget){F=G.oActiveWidget;G.deactivateWidget(G.oActiveWidget)}if(!this.bInternalChange){var C=this.getMap().oMapOL;var A=C.baseLayer;if(A.singleTile){var H=Math.pow(9,E/9);var B=OpenLayers.Util.getResolutionFromScale(H,A.units);B+=A.minResolution;this.bInternalChange=true;C.zoomTo(C.getZoomForResolution(B));this.bInternalChange=false}else{var D=C.baseLayer.resolutions.length-E-1;this.bInternalChange=true;C.zoomTo(D);this.bInternalChange=false}}if(F){G.activateWidget(F)}return false},checkPosition:function(){var D=this.domObj;var C=$(D.parentNode).getContentBoxSize();var B,A;B=parseInt(D.style.left);A=parseInt(D.style.top);if(B+D.getWidth()>C.width){B=C.width-D.getWidth();D.style.left=B+"px"}if(A+D.getHeight()>C.height){A=C.height-D.getHeight();D.style.top=A+"px"}if(B<0){D.style.left="0px"}if(A<0){D.style.top="0px"}},updateSlider:function(){var C=this.getMap().oMapOL;baseLayer=C.baseLayer;if(baseLayer.singleTile){this.slider.steps=81;var B=C.getResolution()-baseLayer.minResolution;var D=OpenLayers.Util.getScaleFromResolution(B,baseLayer.units);var A=9*Math.log(D)/this.LN9;this.bInternalChange=true;this.slider.set(A);this.bInternalChange=false}else{this.slider.steps=C.baseLayer.resolutions.length-1;var A=C.baseLayer.resolutions.length-1-C.getZoom();this.bInternalChange=true;this.slider.set(A);this.bInternalChange=false}},pan:function(B,G,F){var E=this.getMap();var A=E.getCurrentCenter();var D=E.oMapOL.getResolution();var C=E.oMapOL.getSize();E.zoom(A.x+(B*C.w*D),A.y+(G*C.h*D),1);OpenLayers.Event.stop(F);return false},zoom:function(B,D){var C=this.getMap();var A=C.getCurrentCenter();C.zoom(A.x,A.y,B);OpenLayers.Event.stop(D);return false},mouseEnter:function(){var A=this.getMap();var D=A.oMapOL;for(var B=0;B<D.controls.length;++B){var E=D.controls[B];if(E.active){E.deactivate();this.activeControls.push(E)}}for(var B=0;B<A.handlers.length;++B){var C=A.handlers[B];if(C.active){if(C.CLASS_NAME=="OpenLayers.Handler.Box"&&C.zoomBox!=undefined){C.removeBox()}C.deactivate();this.activeControls.push(C)}}},mouseLeave:function(){var A=this.getMap().oMapOL;while(this.activeControls.length>0){var B=this.activeControls.pop();B.activate()}},busyChanged:function(){this.activityIndicator.style.visibility=this.getMap().isBusy()?"visible":"hidden"}});Fusion.Widget.OverviewMap=OpenLayers.Class(Fusion.Widget,{oSize:null,nMinRatio:4,nMaxRatio:32,bDisplayed:false,initializeWidget:function(F){var D=F.extension;if(D.MinRatio){this.nMinRatio=D.MinRatio[0]}if(D.MaxRatio){this.nMaxRatio=D.MaxRatio[0]}var B=null;if(D.MapId){this.sMapGroupId=D.MapId;var E=Fusion.applicationDefinition.getMapGroup(this.sMapGroupId);B=E.maps[0]}else{var A=this.getMap();B=A.mapGroup.maps[0]}if(Fusion.Layers[B.type]){this.mapObject=new Fusion.Layers[B.type](this.getMap(),B,false)}else{this.mapObject=new Fusion.Layers.Generic(this,B,false)}this.mapObject.registerForEvent(Fusion.Event.LAYER_LOADED,OpenLayers.Function.bind(this.loadOverview,this));if(this.domObj){this.domObj.style.overflow="hidden";var C=this.domObj.retrieve("jxLayout");if(!C){C=new Jx.Layout(this.domObj)}C.addEvent("sizeChange",OpenLayers.Function.bind(this.sizeChanged,this))}this.oMapOptions={}},mapWidgetLoaded:function(){var A=this.getMap();if(this.sMapGroupId&&(A.projection==this.mapObject.projection)){this.loadOverview([this.mapObject.oLayerOL])}else{var B=this.oMap._oCurrentExtents;this.loadOverview([this.getMap().oMapOL.baseLayer.clone()])}},keymapLoaded:function(){this.mapObject.oLayerOL.isBaseLayer=true},loadOverview:function(){if(this.control){this.control.destroy()}var A=$(this.domObj).getContentBoxSize();this.oSize=new OpenLayers.Size(A.width,A.height);this.mapObject.oLayerOL.isBaseLayer=true;if(this.mapObject.oLayerOL.singleTile){this.oMapOptions.numZoomLevels=3}this.mapObject.oLayerOL.ratio=1;var B={div:this.domObj,size:this.oSize,minRatio:this.nMinRatio,maxRatio:this.nMaxRatio,mapOptions:this.oMapOptions,layers:[this.mapObject.oLayerOL]};this.control=new OpenLayers.Control.OverviewMap(B);if(A.width==0||A.height==0){return }else{this.getMap().oMapOL.addControl(this.control);this.bDisplayed=true}},sizeChanged:function(){var A=$(this.domObj).getContentBoxSize();this.oSize=new OpenLayers.Size(A.width,A.height);if(A.width==0||A.height==0){return }if(!this.bDisplayed&&this.control){this.getMap().oMapOL.addControl(this.control);this.bDisplayed=true}if(this.control){this.control.size=new OpenLayers.Size(A.width,A.height);this.control.mapDiv.style.width=this.oSize.w+"px";this.control.mapDiv.style.height=this.oSize.h+"px";this.control.ovmap.updateSize();this.control.update()}}});Fusion.Widget.Pan=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,initializeWidget:function(A){this.control=new OpenLayers.Control.DragPan();this.getMap().oMapOL.addControl(this.control);this.control.handler.keyMask=0;this.cursorNormal=["url('images/grab.cur'),move","grab","-moz-grab","move"];this.cursorDrag=["url('images/grabbing.cur'),move","grabbing","-moz-grabbing","move"]},activate:function(){this.control.activate();this.getMap().setCursor(this.cursorNormal)},deactivate:function(){this.control.deactivate();this.getMap().setCursor("auto")}});Fusion.Widget.PanOnClick=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,fPercent:null,nDeltaX:null,nDeltaY:null,initializeWidget:function(C){var A=C.extension;var B=A.Percentage?A.Percentage[0]:75;this.fPercent=parseFloat(B)/100;var D=A.Direction?A.Direction[0]:"";switch(D){case"north":this.nDeltaX=0;this.nDeltaY=1;break;case"south":this.nDeltaX=0;this.nDeltaY=-1;break;case"east":this.nDeltaX=1;this.nDeltaY=0;break;case"west":this.nDeltaX=-1;this.nDeltaY=0;break;default:this.nDeltaX=0;this.nDeltaY=0}},activate:function(){var D=this.getMap().getCurrentExtents();var A=this.getMap().getCurrentCenter();var C,B;C=A.x+this.nDeltaX*(D[2]-D[0])*this.fPercent;B=A.y+this.nDeltaY*(D[3]-D[1])*this.fPercent;this.getMap().zoom(C,B,1)}});Fusion.Widget.PanQuery=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,selectionType:"INTERSECTS",nTolerance:3,bActiveOnly:false,initializeWidget:function(C){this.control=new OpenLayers.Control.DragPan();this.getMap().oMapOL.addControl(this.control);this.control.handler.up=OpenLayers.Function.bind(this.mouseUp,this);var A=C.extension;this.nTolerance=A.Tolerance?Math.abs(parseInt(A.Tolerance)):3;this.bComputeMetadata=(A.ComputeMetadata&&(A.ComputeMetadata[0]=="true"||A.ComputeMetadata[0]=="1"))?true:false;var B=A.QueryActiveLayer?A.QueryActiveLayer[0]:"false";this.bActiveOnly=(B=="true"||B=="1")?true:false;this.cursorNormal=["auto"];this.cursorDrag=["url('images/grabbing.cur'),move","grabbing","-moz-grabbing","move"]},mouseUp:function(D){var J=this.control.handler;var A={x:Event.pointerX(D),y:Event.pointerY(D)};var M=J.start.x-J.last.x;var K=J.start.y-J.last.y;if(Math.abs(M)<this.nTolerance&&Math.abs(K)<this.nTolerance){var G=this.getMap().pixToGeo(J.last.x,J.last.y);var L={};var B=this.getMap().pixToGeoMeasure(this.nTolerance);var I=G.x-B;var H=G.y-B;var F=G.x+B;var E=G.y+B;L.geometry="POLYGON(("+I+" "+H+", "+F+" "+H+", "+F+" "+E+", "+I+" "+E+", "+I+" "+H+"))";L.selectionType="INTERSECTS";L.computed=this.bComputeMetadata;if(this.bActiveOnly){var C=this.getMap().getActiveLayer();if(C){L.layers=C.layerName}else{return }}if(D.shiftKey){L.extendSelection=true}this.getMap().query(L)}Event.stop(D)},activate:function(){this.control.activate();this.getMap().setCursor(this.cursorNormal)},deactivate:function(){this.control.deactivate();this.getMap().setCursor("auto")},setParameter:function(B,A){if(B=="Tolerance"&&A>0){this.nTolerance=A}if(B=="SelectionType"){this.selectionType=A}}});Fusion.Widget.Query=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,sFeatures:"menubar=no,location=no,resizable=no,status=no",initializeWidget:function(B){var A=B.extension;this.sTarget=A.Target?A.Target[0]:"QueryWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/Query/querymain.php"},activate:function(){var C=this.sBaseUrl;var E=this.getMap();var B=E.getAllMaps();var D=Fusion.getWidgetById(this.sTarget);var A=$(this.sTarget);var F=[];F.push("LOCALE="+Fusion.locale);F.push("SESSION="+B[0].getSessionID());F.push("MAPNAME="+B[0].getMapName());if(D||A){F.push("POPUP=false")}else{F.push("POPUP=true")}if(C.indexOf("?")<0){C+="?"}else{if(C.slice(-1)!="&"){C+="&"}}C+=F.join("&");if(D){D.setContent(C)}else{if(A){A.src=C}else{window.open(C,this.sTarget,this.sWinFeatures)}}}});Fusion.Widget.RefreshMap=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,activate:function(){this.getMap().redraw()}});Fusion.Widget.SMAabout=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,_nWidth:500,_nHeight:400,_sAboutUrl:null,_sDefaultUrl:"widgets/SMAabout/enAbout.html",initializeWidget:function(B){var A=B.extension;this._sDefaultUrl="widgets/SMAabout/"+Fusion.locale+"About.html";this._sAboutUrl=(A.AboutURL)?A.AboutURL[0]:this._sDefaultUrl;if(this._sAboutUrl==this._sDefaultUrl){this._sAboutUrl=Fusion.getFusionURL()+this._sAboutUrl}this.enable()},activate:function(){var A="menubar=no,location=no,resizable=no,status=no";A+=",width="+this._nWidth;A+=",height="+this._nHeight;window.open(this._sAboutUrl,"AboutPopup",A)}});Fusion.Widget.SMAaboutGreen=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,_nWidth:500,_nHeight:400,_sAboutUrl:null,_sDefaultUrl:"widgets/SMAabout/enAbout.html",initializeWidget:function(B){var A=B.extension;this._sDefaultUrl="widgets/SMAabout/"+Fusion.locale+"GreenAbout.html";this._sAboutUrl=(A.AboutURL)?A.AboutURL[0]:this._sDefaultUrl;if(this._sAboutUrl==this._sDefaultUrl){this._sAboutUrl=Fusion.getFusionURL()+this._sAboutUrl}this.enable()},activate:function(){var A="menubar=no,location=no,resizable=no,status=no";A+=",width="+this._nWidth;A+=",height="+this._nHeight;window.open(this._sAboutUrl,"AboutPopup",A)}});Fusion.Widget.SMAcursorPosition=OpenLayers.Class(Fusion.Widget,{defaultTemplate:"x: {x}, y: {y}",domSpan:null,units:Fusion.UNKNOWN,initializeWidget:function(B){var A=B.extension;this.template=A.Template?A.Template[0]:this.defaultTemplate;this.precision=A.Precision?parseInt(A.Precision[0]):-1;this.units=A.Units?Fusion.unitFromName(A.Units[0]):Fusion.UNKOWN;this.domSpan=document.createElement("span");this.domSpan.className="spanCursorPosition";this.domSpan.innerHTML=this.emptyText;this.emptyText=A.EmptyText?A.EmptyText[0]:(this.domObj?this.domObj.innerHTML:"");if(this.domObj){this.domObj.innerHTML="";this.domObj.appendChild(this.domSpan)}this.enable=Fusion.Widget.SMAcursorPosition.prototype.enable;this.disable=Fusion.Widget.SMAcursorPosition.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.setUnits,this));this.registerParameter("Units")},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);if(this.uiObj.domObj){this.uiObj.domObj.appendChild(this.domSpan)}else{this.uiObj.appendChild(this.domSpan)}},enable:function(){this.mouseMoveWatcher=OpenLayers.Function.bind(this.mouseMove,this);this.mouseOutWatcher=OpenLayers.Function.bind(this.mouseOut,this);this.getMap().observeEvent("mousemove",this.mouseMoveWatcher);this.getMap().observeEvent("mouseout",this.mouseOutWatcher)},disable:function(){this.getMap().stopObserveEvent("mousemove",this.mouseMoveWatcher);this.getMap().stopObserveEvent("mouseout",this.mouseOutWatcher)},mouseOut:function(A){this.domSpan.innerHTML=this.emptyText},mouseMove:function(F){var E=this.getMap();var D=E.getEventPosition(F);if(this.units!=Fusion.PIXELS){D=E.pixToGeo(D.x,D.y);if(D){if(this.units!=Fusion.UNKNOWN){var B=E.getMetersPerUnit();D.x=Fusion.fromMeter(this.units,D.x*B);D.y=Fusion.fromMeter(this.units,D.y*B)}if(this.precision>=0){var C=Math.pow(10,this.precision);D.x=Math.round(D.x*C)/C;D.y=Math.round(D.y*C)/C}}}if(D){var A=Fusion.unitAbbr(this.units);this.domSpan.innerHTML=this.template.replace("{x}",D.x).replace("{y}",D.y).replace("{units}",A).replace("{units}",A)}},setUnits:function(){if(this.units==Fusion.UNKNOWN){this.setParameter("Units",this.getMap().getUnits())}},setParameter:function(B,A){if(B=="Units"){this.units=10}}});Fusion.Constant.MEASURE_TYPE_DISTANCE=1;Fusion.Constant.MEASURE_TYPE_AREA=2;Fusion.Event.MEASURE_SEGMENT_UPDATE=Fusion.Event.lastEventId++;Fusion.Event.MEASURE_CLEAR=Fusion.Event.lastEventId++;Fusion.Event.MEASURE_COMPLETE=Fusion.Event.lastEventId++;Fusion.Widget.SMAmeasure=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,distances:null,distanceMarkers:null,areaMarker:null,units:Fusion.UNKNOWN,measureType:null,distPrecision:4,areaPrecision:4,distanceNormalStyle:null,fillStyle:null,areaStyle:null,segmentLabels:true,initializeWidget:function(D){this.asCursor=["crosshair"];var K=D.extension;this.units=(K.Units&&(K.Units[0]!=""))?Fusion.unitFromName(K.Units[0]):this.units;this.distPrecision=K.DistancePrecision?parseInt(K.DistancePrecision[0]):4;this.areaPrecision=K.AreaPrecision?parseInt(K.AreaPrecision[0]):4;if(K.SegmentLabels){this.segmentLabels=(K.SegmentLabels[0].toLowerCase=="true"&&K.SegmentLabels[0])?true:false}this.sTarget=K.Target?K.Target[0]:"";this.sBaseUrl=Fusion.getFusionURL()+"widgets/SMAmeasure/Measure.php";this.measureType=0;if(K.Type){switch(K.Type[0].toLowerCase()){case"distance":this.measureType|=Fusion.Constant.MEASURE_TYPE_DISTANCE;break;case"area":this.measureType|=Fusion.Constant.MEASURE_TYPE_AREA;break;case"both":this.measureType|=Fusion.Constant.MEASURE_TYPE_DISTANCE;this.measureType|=Fusion.Constant.MEASURE_TYPE_AREA;break;default:break}}var I=K.FillStyle?K.FillStyle[0]:"rgba(0,0,255, 0.3)";var C=K.LineStyleWidth?K.LineStyleWidth[0]:2;var F=K.LineStyleColor?K.LineStyleColor[0]:"rgba(0,0,255,0.3)";this.distanceMarkers=[];this.distances=[];this.registerEventID(Fusion.Event.MEASURE_SEGMENT_UPDATE);this.registerEventID(Fusion.Event.MEASURE_CLEAR);this.registerEventID(Fusion.Event.MEASURE_COMPLETE);var B=this.getMap();this.keyHandler=OpenLayers.Function.bind(this.onKeyPress,this);Fusion.addWidgetStyleSheet(D.location+"SMAmeasure/Measure.css");B.registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.setUnits,this,this.units));this.registerParameter("Units");this.sketchSymbolizers={Point:{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},Line:{strokeWidth:2,strokeOpacity:1,strokeColor:"#D52D00"},Polygon:{strokeWidth:2,strokeOpacity:1,strokeColor:"#D52D00",fillColor:"white",fillOpacity:0.4}};var A=new OpenLayers.Style();A.addRules([new OpenLayers.Rule({symbolizer:this.sketchSymbolizers})]);var G=new OpenLayers.StyleMap({"default":A});this.map=B.oMapOL;var E={style:"default",layerOptions:{styleMap:G}};var J=OpenLayers.Handler.Path;if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){J=OpenLayers.Handler.Polygon}var H={persist:true,handlerOptions:E,callbacks:{modify:OpenLayers.Function.bind(this.measurePartial,this),cancel:OpenLayers.Function.bind(this.resetMeasure,this)}};this.control=new OpenLayers.Control.Measure(J,H);this.getMap().oMapOL.addControl(this.control);this.control.events.on({measure:this.measure,scope:this})},shouldActivateWith:function(A){return(A instanceof Fusion.Widget.SMAmeasure&&A.SMAmeasureType==this.measureType)},measure:function(F){this.hasMeasure=true;var E=F.geometry;if(this.measureType&Fusion.Constant.MEASURE_TYPE_DISTANCE){var C=E.getVertices();while(this.distanceMarkers.length>C.length-1){this.distanceMarkers.pop().destroy()}var G=v0=C[0];for(var D=1;D<C.length;D++){v1=C[D];if(this.distanceMarkers[D-1]){var A=this.distanceMarkers[D-1];A.label=""}else{A=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,D+": ")}var B=new OpenLayers.Geometry.LineString();B.addPoint(v0.clone());B.addPoint(v1.clone());this.updateMarker(A,B);v0=v1}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){B=new OpenLayers.Geometry.LineString();B.addPoint(G);B.addPoint(v0);this.lastMarker.label=D+": ";this.updateMarker(this.lastMarker,B)}}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){this.updateArea(E)}this.triggerEvent(Fusion.Event.MEASURE_COMPLETE)},measurePartial:function(A,C){if(this.hasMeasure){this.resetMeasure();this.hasMeasure=false}var B=C.geometry;if(this.measureType&Fusion.Constant.MEASURE_TYPE_DISTANCE){this.updateDistances(B)}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){this.updateArea(B)}this.triggerEvent(Fusion.Event.MEASURE_SEGMENT_UPDATE)},updateDistances:function(C){var B=C.getVertices();var D=B.length-1;if(D>0){var E=new OpenLayers.Geometry.LineString();E.addPoint(B[D-1].clone());E.addPoint(B[D].clone());var A;if(this.distanceMarkers.length<D){A=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,D+": ");this.distanceMarkers.push(A)}else{A=this.distanceMarkers[D-1]}this.updateMarker(A,E);if(D>1&&C.CLASS_NAME.indexOf("LineString")==-1){E=new OpenLayers.Geometry.LineString();E.addPoint(B[0].clone());E.addPoint(B[D].clone());if(!this.lastMarker){this.lastMarker=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,"")}this.lastMarker.label="";this.updateMarker(this.lastMarker,E)}}},updateArea:function(A){if(!this.areaMarker){this.areaMarker=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,"",true)}this.updateMarker(this.areaMarker,A)},delayUpdate:function(A,B){this.delayUpdateTimer=null;this.updateMarker(A,B)},updateMarker:function(E,G){if(!E){return }var C,H,I;var J=G.getVertices();var B=this.getMap();var D=B.oMapOL.baseLayer.projection;if(G.CLASS_NAME.indexOf("LineString")!=-1){H=this.getMap().geoToPix(J[0].x,J[0].y);I=this.getMap().geoToPix(J[1].x,J[1].y);at={x:(H.x+I.x)/2,y:(H.y+I.y)/2};C=G.getGeodesicLength(D);measureUnits=Fusion.METERS;if(measureUnits!=this.units){C=Fusion.convert(measureUnits,this.units,C)}}else{var A=G.getCentroid();at=this.getMap().geoToPix(A.x,A.y);C=G.getGeodesicArea(D);measureUnits=Fusion.METERS;if(measureUnits!=this.units){var F=Fusion.convert(measureUnits,this.units,1);C=C*F*F}}if(C>1){E.setQuantity(C);this.positionMarker(E,at)}},positionMarker:function(C,A){var F=this.getMap().getDomObj();if(!C.domObj.parentNode||C.domObj.parentNode!=F){F.appendChild(C.domObj)}var E=C.getSize();var D=A.y-E.height/2;var B=A.x-E.width/2;if(!isNaN(D)&&!isNaN(B)){C.domObj.style.top=D+"px";C.domObj.style.left=B+"px";if(this.segmentLabels===true){C.domObj.style.display="block"}}else{if(this.segmentLabels===true){C.domObj.style.display="none"}}},onKeyPress:function(B){var A=(B.charCode)?B.charCode:((B.keyCode)?B.keyCode:B.which);if(A==OpenLayers.Event.KEY_ESC){this.control.cancel()}},initVars:function(){this.cumulativeDistance=0;this.lastDistance=0;this.cumulativeArea=0;this.lastArea=0;this.aAreaFirstPoint=null},activate:function(){this.control.activate();this.resetMeasure();OpenLayers.Event.observe(document,"keypress",this.keyHandler);this.loadDisplayPanel()},loadDisplayPanel:function(){if(this.sTarget){var A=this.sBaseUrl;var E="locale="+Fusion.locale;if(A.indexOf("?")<0){A+="?"}else{if(A.slice(-1)!="&"){A+="&"}}A+=E+"&type="+this.measureType;var D=Fusion.getWidgetById(this.sTarget);var C=window;if(D){D.setContent(A);C=D.iframe.contentWindow}else{C=window.open(A,this.sTarget,this.sWinFeatures)}this.registerForEvent(Fusion.Event.MEASURE_CLEAR,OpenLayers.Function.bind(this.clearDisplay,this,C));this.registerForEvent(Fusion.Event.MEASURE_SEGMENT_UPDATE,OpenLayers.Function.bind(this.updateDisplay,this,C));this.registerForEvent(Fusion.Event.MEASURE_COMPLETE,OpenLayers.Function.bind(this.updateDisplay,this,C))}else{this.totalDistanceMarker=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,"Total:");var B=this.getMap().getDomObj();if(!this.totalDistanceMarker.domObj.parentNode||this.totalDistanceMarker.domObj.parentNode!=B){B.appendChild(this.totalDistanceMarker.domObj)}this.totalDistanceMarker.domObj.addClass("divMeasureTotal");this.totalDistanceMarker.domObj.style.display="none";this.registerForEvent(Fusion.Event.MEASURE_CLEAR,OpenLayers.Function.bind(this.clearTotalDistance,this));this.registerForEvent(Fusion.Event.MEASURE_SEGMENT_UPDATE,OpenLayers.Function.bind(this.updateTotalDistance,this));this.registerForEvent(Fusion.Event.MEASURE_COMPLETE,OpenLayers.Function.bind(this.updateTotalDistance,this))}},deactivate:function(){OpenLayers.Event.stopObserving(document,"keypress",this.keyHandler);this.control.deactivate();this.control.cancel()},resetMeasure:function(){this.initVars();for(var A=0;A<this.distanceMarkers.length;A++){this.distanceMarkers[A].destroy()}this.distanceMarkers=[];if(this.areaMarker){this.areaMarker.destroy();this.areaMarker=null}if(this.lastMarker){this.lastMarker.destroy();this.lastMarker=null}this.triggerEvent(Fusion.Event.MEASURE_CLEAR,this)},remoteMeasureSegment:function(C,G,H,F){var A=this.getMap();var D=A.getAllMaps();var J="layers/"+D[0].arch+"/"+Fusion.getScriptLanguage()+"/Measure."+Fusion.getScriptLanguage();var E=A.pixToGeo(G.x,G.y);var B=A.pixToGeo(H.x,H.y);var I={parameters:{session:D[0].getSessionID(),locale:Fusion.locale,mapname:A.getMapName(),x1:E.x,y1:E.y,x2:B.x,y2:B.y},onComplete:OpenLayers.Function.bind(this.remoteMeasureCompleted,this,G,H,C)};Fusion.ajaxRequest(J,I)},remoteMeasureCompleted:function(from,to,marker,r){if(r.status==200){var o;eval("o="+r.responseText);if(o.distance){mapUnits=Fusion.METERS;if(mapUnits!=this.units){o.distance=Fusion.convert(mapUnits,this.units,o.distance)}marker.setQuantity(o.distance);this.positionMarker(marker,from,to);this.triggerEvent(Fusion.Event.MEASURE_SEGMENT_UPDATE)}}},updateDisplay:function(F){var K=F.document;this.clearDisplay(F);var G=Fusion.unitAbbr(this.units);var J;var E=this.distPrecision;var H=function(M,P){if(P<1){return }var N=K.createElement("tr");var O=K.createElement("td");O.innerHTML=OpenLayers.i18n("segment",{seg:M});N.appendChild(O);O=K.createElement("td");if(E==0){J=Math.floor(P)}else{J=P.toPrecision(E)}O.innerHTML=J+" "+G;N.appendChild(O);D.appendChild(N)};if(this.measureType&Fusion.Constant.MEASURE_TYPE_DISTANCE){var D=K.getElementById("segmentTBody");var I=0;if(D){for(var C=0;C<this.distanceMarkers.length;C++){var A=this.distanceMarkers[C].getQuantity();I+=A;H(C+1,A)}if(this.lastMarker){I+=this.lastMarker.getQuantity();H(C+1,this.lastMarker.getQuantity())}var L=K.getElementById("totalDistance");if(this.distPrecision==0){J=Math.floor(I)}else{J=I.toPrecision(this.distPrecision)}L.innerHTML=J+" "+G}}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){var B=K.getElementById("totalArea");J=this.areaMarker.getQuantity();if(this.areaPrecision==0){J=Math.floor(J)}else{J=J.toPrecision(this.areaPrecision)}B.innerHTML=J+" "+G+"<sup>2</sup>"}},updateTotalDistance:function(){if(this.distanceMarkers.length>1){var A=0;var B=Fusion.unitAbbr(this.units);for(var C=0;C<this.distanceMarkers.length;C++){var D=this.distanceMarkers[C].getQuantity();A+=D}this.totalDistanceMarker.domObj.style.display="block";this.totalDistanceMarker.setQuantity(A)}},clearDisplay:function(C){var B=C.document;var A=B.getElementById("segmentTBody");if(A){while(A.firstChild){A.firstChild.marker=null;A.removeChild(A.firstChild)}var D=B.getElementById("totalDistance");D.innerHTML=""}},clearTotalDistance:function(){this.totalDistanceMarker.domObj.style.display="none"},setUnits:function(A){A=(A==Fusion.UNKNOWN)?Fusion.unitFromName(this.getMap().getUnits()):A;this.setParameter("Units",Fusion.unitName(A))},setParameter:function(C,B){if(C=="Units"){this.units=Fusion.unitFromName(B);for(var A=0;A<this.distanceMarkers.length;A++){this.distanceMarkers[A].setUnits(this.units)}if(this.totalDistanceMarker){this.totalDistanceMarker.setUnits(this.units)}}}});Fusion.Widget.SMAmeasure.Marker=OpenLayers.Class({calculatingImg:null,quantity:0,isArea:false,initialize:function(B,A,C,D){this.precision=A;this.label=C?C:"";this.isArea=D||false;this.domObj=new Element("DIV",{});this.domObj.className="divMeasureMarker";this.calculatingImg=document.createElement("img");this.calculatingImg.src=Fusion.getFusionURL()+"widgets/SMAmeasure/MeasurePending.gif";this.calculatingImg.width=19;this.calculatingImg.height=4;this.setUnits(B);this.setCalculating()},destroy:function(){if(this.domObj.parentNode){this.domObj.parentNode.removeChild(this.domObj);this.domObj.style.display="none"}},setUnits:function(A){this.unit=A;this.unitAbbr=Fusion.unitAbbr(A)},getQuantity:function(){return this.quantity},getQuantityLabel:function(){var B;if(this.precision==0){B=Math.floor(this.quantity)}else{B=this.quantity.toPrecision(this.precision)}var A="";if(this.isArea){A="<sup>2<sup>"}return this.label+" "+B+" "+this.unitAbbr+A},setQuantity:function(A){if(this.calculatingImg.parentNode){this.calculatingImg.parentNode.removeChild(this.calculatingImg)}this.quantity=A;this.domObj.innerHTML=this.getQuantityLabel()},setCalculating:function(){if(!this.calculatingImg.parentNode){this.domObj.innerHTML="";this.domObj.appendChild(this.calculatingImg)}},getSize:function(){var A=$(this.domObj).getBorderBoxSize();var B={width:19,height:4};if(A.width<B.width){A.width+=B.width}if(A.height<B.height){A.height+=B.height}return A}});Fusion.Widget.SMAprint=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,initializeWidget:function(D){var C=D.extension;var F=C.ShowPrintUI?C.ShowPrintUI[0]:"false";this.showPrintUI=(F.toLowerCase()=="true"||F=="1");var E=C.ShowTitle?C.ShowTitle[0]:"false";this.showTitle=(E.toLowerCase()=="true"||E=="1");this.pageTitle=C.PageTitle?C.PageTitle[0]:"";this.resultsLayer=C.ResultsLayer?C.ResultsLayer[0]:null;var B=C.ShowLegend?C.ShowLegend[0]:"false";this.showLegend=(B.toLowerCase()=="true"||B=="1");var A=C.ShowNorthArrow?C.ShowNorthArrow[0]:"false";this.showNorthArrow=(A.toLowerCase()=="true"||A=="1");this.imageBaseUrl=C.ImageBaseUrl?C.ImageBaseUrl[0]:null;this.dialogContentURL=Fusion.getFusionURL()+D.location+"SMAprint/Print.html";this.printablePageURL=Fusion.getFusionURL()+D.location+"SMAprint/printablepage.php";Fusion.addWidgetStyleSheet(D.location+"SMAprint/Print.css")},activate:function(){if(this.showPrintUI){this.openPrintUI()}else{this.openPrintable()}},openPrintUI:function(){if(!this.dialog){var A=new Jx.Toolbar({position:"bottom",id:"printToolbar"});var C={label:OpenLayers.i18n("printTitle"),id:"printablePage",contentURL:this.dialogContentURL,onContentLoaded:OpenLayers.Function.bind(this.contentLoaded,this),width:350,height:200,resize:true,toolbars:[A]};var B=new Jx.Dialog(C);A.add(new Jx.Button({label:OpenLayers.i18n("printGenerate"),onClick:OpenLayers.Function.bind(this.generate,this)}),new Jx.Button({label:OpenLayers.i18n("printCancel"),onClick:function(){B.close()}}));this.dialog=B}this.dialog.show()},setParameter:function(B,A){switch(B){case"Print_ShowTitle":this.showTitle=A;break;case"Print_Title":this.pageTitle=A;break;case"Print_ShowLegend":this.showLegend=A;break;case"Print_ShowNorthArrow":this.showNorthArrow=A;break}},contentLoaded:function(A){A.content.getElementById("dialogPrintShowtitle").checked=this.showTitle;A.content.getElementById("dialogPrintTitle").value=this.pageTitle;A.content.getElementById("dialogPrintTitle").disabled=!this.showTitle;A.content.getElementById("dialogPrintShowlegend").checked=this.showLegend;A.content.getElementById("dialogPrintShowNorthArrow").checked=this.showNorthArrow;OpenLayers.Event.observe(A.content.getElementById("dialogPrintShowtitle"),"click",OpenLayers.Function.bind(this.controlTitle,this))},controlTitle:function(){this.dialog.content.getElementById("dialogPrintTitle").disabled=!this.dialog.content.getElementById("dialogPrintShowtitle").checked},generate:function(){this.showTitle=this.dialog.content.getElementById("dialogPrintShowtitle").checked;this.pageTitle=this.dialog.content.getElementById("dialogPrintTitle").value;this.showLegend=false;this.showNorthArrow=false;this.openPrintable()},openPrintable:function(){var A=this.getMap();var B=this.printablePageURL+"?";var D=A.getCurrentExtents();var F=(D.left+D.right)/2;var E=(D.top+D.bottom)/2;var C=A._nDpi;var H=A.getScale();var G=A.getAllMaps();B=B+"MAPNAME="+A.getMapName();B=B+"&SESSION="+G[0].getSessionID();B=B+"&CENTERX="+F;B=B+"&CENTERY="+E;B=B+"&DPI="+C;B=B+"&SCALE="+H;B=B+"&ISTITLE="+(this.showTitle!=""?"1":"0");B=B+"&ISLEGEND="+(this.showLegend?"1":"0");B=B+"&ISARROW="+(this.showNorthArrow?"1":"0");if(this.pageTitle!=""){B=B+"&TITLE="+this.pageTitle}window.open(B,"printablepage","")}});Fusion.Widget.SMAsearch=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,status=no,scrollbars=yes",initializeWidget:function(B){var A=B.extension;this.sTarget=A.Target?A.Target[0]:"SearchWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/SMAsearch/SearchPrompt.php";this.prompt=A.Prompt?A.Prompt[0]:"";this.layer=A.Layer?A.Layer[0]:"";this.filter=A.Filter?A.Filter[0]:"";this.limit=A.MatchLimit?A.MatchLimit[0]:100;this.resultColumns=A.ResultColumns?A.ResultColumns[0].Column:[];this.title=A.Title?A.Title[0]:B.label;this.searchButton=OpenLayers.i18n("searchButton")},activate:function(){var B=this.sBaseUrl;var A=this.getMap();var C=A.getAllMaps();var D=Fusion.getWidgetById(this.sTarget);var I=$(this.sTarget);var E=[];E.push("locale="+Fusion.locale);E.push("session="+C[0].getSessionID());E.push("mapname="+C[0].getMapName());if(D||I){E.push("popup=false")}else{E.push("popup=true")}E.push("title="+this.title);E.push("prompt="+this.prompt);E.push("target="+this.sTarget);E.push("filter="+this.filter);E.push("layer="+this.layer);E.push("limit="+this.limit);E.push("searchButton="+this.searchButton);var G=[];var H=[];for(var F=0;F<this.resultColumns.length;++F){G.push(this.resultColumns[F].Name);H.push(this.resultColumns[F].Property)}E.push("properties="+H.join(","));E.push("propNames="+G.join(","));if(B.indexOf("?")<0){B+="?"}else{if(B.slice(-1)!="&"){B+="&"}}B+=E.join("&");if(D){D.setContent(B)}else{if(I){I.src=B}else{window.open(B,this.sTarget,this.sFeatures)}}}});Fusion.Widget.SMAsearchPane=OpenLayers.Class(Fusion.Widget,{aExecutedTasks:null,nCurrentTask:0,nTasks:0,initializeWidget:function(H){this.aExecutedTasks=[];var B=Fusion.getFusionURL();var F=B+H.location+"SMAsearchPane/SMAsearchPane.png";var D="SMAsearchPane_home";var J=B+H.location+"SMAsearchPane/SMAsearchPane.png";var A="SMAsearchPane_back";var L=B+H.location+"SMAsearchPane/SMAsearchPane.png";var G="SMAsearchPane_forward";var K=B+H.location+"SMAsearchPane/SMAsearchPane.png";var E="SMAsearchPane_tasks";var C=H.location+"SMAsearchPane/SMAsearchPane.php";var M=H.extension;if(M.InitialTask){C=taskURL=M.InitialTask[0]}else{C=B+C}F=M.HomeIcon?M.SMAHomeIcon[0]:F;D=M.HomeClass?M.HomeClass[0]:D;J=M.PreviousIcon?M.PreviousIcon[0]:J;A=M.PreviousClass?M.PreviousClass[0]:A;L=M.NextIcon?M.NextIcon[0]:L;G=M.NextClass?M.NextClass[0]:G;K=M.TaskIcon?M.TaskIcon[0]:K;E=M.TaskClass?M.TaskClass[0]:E;if(M.MenuContainer){this.menuName=M.MenuContainer[0]}this.toolbar=new Jx.Toolbar();this.homeButton=new Jx.Button({image:F,imageClass:D,tooltip:OpenLayers.i18n("taskHome"),onClick:OpenLayers.Function.bind(this.goHome,this)});this.prevButton=new Jx.Button({image:J,imageClass:A,tooltip:OpenLayers.i18n("prevTask"),onClick:OpenLayers.Function.bind(this.gotoPrevTask,this)});this.nextButton=new Jx.Button({image:L,imageClass:G,tooltip:OpenLayers.i18n("nextTask"),onClick:OpenLayers.Function.bind(this.gotoNextTask,this)});this.toolbar.add(this.homeButton,this.prevButton,this.nextButton);this.taskMenu=new Jx.Menu({image:K,imageClass:E,label:OpenLayers.i18n("taskList"),right:0});$(this.taskMenu.domObj).addClass("taskMenu");$(this.taskMenu.button.domObj).addClass("jxButtonContentLeft");this.toolbar.add(this.taskMenu);var I=this.name+"_IFRAME";this.iframe=document.createElement("iframe");new Jx.Layout(this.iframe);this.iframe.setAttribute("name",I);this.iframe.setAttribute("id",I);this.iframe.setAttribute("frameborder",0);this.iframe.style.border="0px solid #fff";this.oTaskPane=new Jx.Panel({toolbars:[this.toolbar],hideTitle:true,content:this.iframe});$(this.domObj).addClass("SMAsearchPanePanel");Fusion.addWidgetStyleSheet(H.location+"SMAsearchPane/SMAsearchPane.css");this.domObj.appendChild(this.oTaskPane.domObj);this.oTaskPane.domObj.resize();Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED,OpenLayers.Function.bind(this.setTaskMenu,this));this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.setContent,this,C))},updateButtons:function(){this.prevButton.setEnabled(this.nCurrentTask>0);this.nextButton.setEnabled(this.nCurrentTask<this.aExecutedTasks.length-1)},gotoPrevTask:function(){this.nCurrentTask=this.nCurrentTask>0?--this.nCurrentTask:0;this.iframe.src=this.aExecutedTasks[this.nCurrentTask];this.updateButtons()},gotoNextTask:function(){this.nCurrentTask=this.nCurrentTask<this.aExecutedTasks.length-1?++this.nCurrentTask:this.aExecutedTasks.length-1;this.iframe.src=this.aExecutedTasks[this.nCurrentTask];this.updateButtons()},goHome:function(){this.nCurrentTask=0;this.iframe.src=this.aExecutedTasks[this.nCurrentTask];this.updateButtons()},setContent:function(A){if(A.indexOf("SMAsearchPane.php")!=-1){A=A+"?locale="+Fusion.locale}this.aExecutedTasks.push(A);++this.nCurrentTask;this.iframe.src=A;this.iframe.taskPaneId=this.widgetTag.name;this.updateButtons()},setTaskMenu:function(){if(this.menuName){var A=this.getMap().widgetSet.getContainerByName(this.menuName);if(A){A.createWidgets(this.getMap().widgetSet,this.taskMenu)}}}});Fusion.Widget.SMAoverviewMap=OpenLayers.Class(Fusion.Widget,{oSize:null,nMinRatio:4,nMaxRatio:32,bDisplayed:false,initializeWidget:function(F){var D=F.extension;if(D.MinRatio){this.nMinRatio=D.MinRatio[0]}if(D.MaxRatio){this.nMaxRatio=D.MaxRatio[0]}var B=null;if(D.MapId){this.sMapGroupId=D.MapId;var E=Fusion.applicationDefinition.getMapGroup(this.sMapGroupId);B=E.maps[1]}else{var A=this.getMap();B=A.mapGroup.maps[1]}if(Fusion.Layers[B.type]){this.mapObject=new Fusion.Layers[B.type](this.getMap(),B,false)}else{this.mapObject=new Fusion.Layers.Generic(this,B,false)}this.mapObject.registerForEvent(Fusion.Event.LAYER_LOADED,OpenLayers.Function.bind(this.loadOverview,this));if(this.domObj){this.domObj.style.overflow="hidden";var C=this.domObj.retrieve("jxLayout");if(!C){C=new Jx.Layout(this.domObj)}C.addEvent("sizeChange",OpenLayers.Function.bind(this.sizeChanged,this))}this.oMapOptions={}},mapWidgetLoaded:function(){var A=this.getMap();if(this.sMapGroupId&&(A.projection==this.mapObject.projection)){this.loadOverview([this.mapObject.oLayerOL])}else{var B=this.oMap._oCurrentExtents;this.loadOverview([this.getMap().oMapOL.baseLayer.clone()])}},keymapLoaded:function(){this.mapObject.oLayerOL.isBaseLayer=true},loadOverview:function(){if(this.control){this.control.destroy()}var A=$(this.domObj).getContentBoxSize();this.oSize=new OpenLayers.Size(A.width,A.height);this.mapObject.oLayerOL.isBaseLayer=true;if(this.mapObject.oLayerOL.singleTile){this.oMapOptions.numZoomLevels=3}this.mapObject.oLayerOL.ratio=1;var B={div:this.domObj,size:this.oSize,minRatio:this.nMinRatio,maxRatio:this.nMaxRatio,mapOptions:this.oMapOptions,layers:[this.mapObject.oLayerOL]};this.control=new OpenLayers.Control.OverviewMap(B);if(A.width==0||A.height==0){return }else{this.getMap().oMapOL.addControl(this.control);this.bDisplayed=true}},sizeChanged:function(){var A=$(this.domObj).getContentBoxSize();this.oSize=new OpenLayers.Size(A.width,A.height);if(A.width==0||A.height==0){return }if(!this.bDisplayed&&this.control){this.getMap().oMapOL.addControl(this.control);this.bDisplayed=true}if(this.control){this.control.size=new OpenLayers.Size(A.width,A.height);this.control.mapDiv.style.width=this.oSize.w+"px";this.control.mapDiv.style.height=this.oSize.h+"px";this.control.ovmap.updateSize();this.control.update()}}});Fusion.Widget.SMAsearchMap1=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,status=no,scrollbars=yes",initializeWidget:function(B){var A=B.extension;this.sTarget=A.Target?A.Target[0]:"SearchWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/SMAsearchMap1/SearchPrompt.php";this.prompt=A.Prompt?A.Prompt[0]:"";this.layer=A.Layer?A.Layer[0]:"";this.filter=A.Filter?A.Filter[0]:"";this.limit=A.MatchLimit?A.MatchLimit[0]:100;this.resultColumns=A.ResultColumns?A.ResultColumns[0].Column:[];this.title=A.Title?A.Title[0]:B.label},activate:function(){var B=this.sBaseUrl;var A=this.getMap();var C=A.getAllMaps();var D=Fusion.getWidgetById(this.sTarget);var I=$(this.sTarget);var E=[];E.push("locale="+Fusion.locale);E.push("session="+C[1].getSessionID());E.push("mapname="+C[1].getMapName());if(D||I){E.push("popup=false")}else{E.push("popup=true")}E.push("title="+this.title);E.push("prompt="+this.prompt);E.push("target="+this.sTarget);E.push("filter="+this.filter);E.push("layer="+this.layer);E.push("limit="+this.limit);var G=[];var H=[];for(var F=0;F<this.resultColumns.length;++F){G.push(this.resultColumns[F].Name);H.push(this.resultColumns[F].Property)}E.push("properties="+H.join(","));E.push("propNames="+G.join(","));if(B.indexOf("?")<0){B+="?"}else{if(B.slice(-1)!="&"){B+="&"}}B+=E.join("&");if(D){D.setContent(B)}else{if(I){I.src=B}else{window.open(B,this.sTarget,this.sFeatures)}}}});Fusion.Widget.SMAselectionPanel=OpenLayers.Class(Fusion.Widget,{previousIcon:"images/icon_back.gif",nextIcon:"images/icon_forward.gif",initializeWidget:function(widgetTag){var json=widgetTag.extension;if(json.PreviousImageUrl){this.previousIcon=json.PreviousImageUrl}if(json.NextImageUrl){this.nextIcon=json.NextImageUrl}this.iResultsPerPage=json.ResultsPerPage?json.ResultsPerPage[0]:0;this.iResultsPerPage=parseInt(this.iResultsPerPage);if(isNaN(this.iResultsPerPage)||(this.iResultsPerPage<0)){this.iResultsPerPage=0}if(json.SelectionRenderer){var renderer=eval(json.SelectionRenderer[0]);if(renderer&&renderer.prototype.CLASS_NAME&&renderer.prototype.CLASS_NAME=="Fusion.Widget.SMAselectionPanel.SelectionRenderer"){this.renderer=new renderer(this)}else{if(typeof renderer=="function"){var renderFunction=renderer;this.renderer=new Fusion.Widget.SMAselectionPanel.SelectionRenderer(this);this.renderer.updateSelection=function(){this.getMap().getSelection(OpenLayers.Function.bind(renderFunction))};this.renderer.clearSelection=false}else{this.renderer=new Fusion.Widget.SMAselectionPanel.SelectionRendererDefault(this)}}}else{this.renderer=new Fusion.Widget.SMAselectionPanel.SelectionRendererDefault(this)}this.iResultsPerPage=null;if(this.renderer.updateSelection){this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.renderer.updateSelection,this.renderer))}if(this.renderer.clearSelection){this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.renderer.clearSelection,this.renderer))}}});Fusion.Widget.SMAselectionPanel.SelectionRenderer=OpenLayers.Class({oSelection:null,aiCurrentIndex:null,iResultsPerPage:0,initialize:function(A){this.oSMAselectionPanel=A;this.iResultsPerPage=A.iResultsPerPage;this.aiCurrentIndex=new Array()},updatePageIndexes:function(){var B=this.oSelection.getNumLayers();for(var A=0;A<B;A++){this.aiCurrentIndex[this.oSelection.getLayer(A).getName()]=0}},getNextPage:function(A){if(A&&(this.iResultsPerPage!=0)){var C=A.getName();if(this.aiCurrentIndex[C]>=A.getNumElements()){this.aiCurrentIndex[C]=this.aiCurrentIndex[C]-this.iResultsPerPage}var B=A.getNumElements();var F=this.aiCurrentIndex[C];var D=F+this.iResultsPerPage;if(D>=B){D=B}if(F<0){F=0}this.aiCurrentIndex[C]=D;var E=(D-F);if(E!=this.iResultsPerPage){this.aiCurrentIndex[C]=this.aiCurrentIndex[C]+(this.iResultsPerPage-E)}return this.getPage(A,F,D)}return this.getPage(A)},getPreviousPage:function(A){var C=A.getName();if(A&&(this.aiCurrentIndex[C]!=0)&&(this.iResultsPerPage!=0)){var B=A.getNumElements();var E=this.aiCurrentIndex[C]-(this.iResultsPerPage*2);var D=this.aiCurrentIndex[C]-this.iResultsPerPage;if(E<0){E=0;D=(B<this.iResultsPerPage)?B:this.iResultsPerPage}this.aiCurrentIndex[C]=D;return this.getPage(A,E,D)}return this.getPage(A)},getMap:function(){return this.oSMAselectionPanel.getMap()},getPage:function(A,G,F){var E=false;if(A){E=new Array();G=G?G:0;F=F?F:A.getNumElements();var H=A.getPropertyNames();var C=0;for(var D=G;D<F;D++,C++){E[C]=new Array();for(var B=0;B<H.length;B++){E[C][B]=A.getElementValue(D,B)}}}return E},updateSelection:function(){},clearSelection:function(){},CLASS_NAME:"Fusion.Widget.SMAselectionPanel.SelectionRenderer"});Fusion.Widget.SMAselectionPanel.SelectionRendererDefault=OpenLayers.Class(Fusion.Widget.SMAselectionPanel.SelectionRenderer,{initialize:function(A){Fusion.Widget.SMAselectionPanel.SelectionRenderer.prototype.initialize.apply(this,[A]);var B=document.createElement("div");this.toolbar=document.createElement("div");this.toolbar.className="SMAselectionPanelToolbar";this.layerList=document.createElement("select");this.layerList.className="layerSelector";this.toolbar.appendChild(this.layerList);OpenLayers.Event.observe(this.layerList,"change",OpenLayers.Function.bind(this.renderSelectionFeatures,this));this.featureList=document.createElement("select");this.featureList.className="featureSelector";this.toolbar.appendChild(this.featureList);OpenLayers.Event.observe(this.featureList,"change",OpenLayers.Function.bind(this.renderFeature,this));this.featureDiv=document.createElement("div");this.featureDiv.className="SMAselectionPanelContent";this.clearSelection();B.appendChild(this.toolbar);B.appendChild(this.featureDiv);Fusion.addWidgetStyleSheet(this.oSMAselectionPanel.getLocation()+"SMAselectionPanel/SMAselectionPanel.css");this.oSMAselectionPanel.domObj.appendChild(B)},updateSelection:function(){this.getMap().getSelection(OpenLayers.Function.bind(this.renderSelectionLayers,this))},clearSelection:function(){this.layerList.options.length=0;this.featureList.options.length=0;this.oSelection=null;this.featureDiv.className="SMAselectionPanelContent noSelection";this.featureDiv.innerHTML=OpenLayers.i18n("noSelection")},renderSelectionLayers:function(E){this.oSelection=null;for(var I in E){this.oSelection=E[I];break}if(!this.oSelection){return }this.featureDiv.className="SMAselectionPanelContent";while(this.layerList.length>0){this.layerList.remove(this.layerList.options[0])}var C=this.oSelection.getNumLayers();for(var G=0;G<C;G++){var D=this.oSelection.getLayer(G);var B=this.getMap().aMaps[0].aLayers;var H=D.getName();for(var F=0;F<B.length;++F){if(B[F].layerName==H){H=B[F].legendLabel;break}}var A=new Option(H,G);this.layerList.options[G]=A}this.layerList.selectedIndex=0;this.renderSelectionFeatures()},renderSelectionFeatures:function(){var B=this.layerList.selectedIndex;var E=this.oSelection.getLayer(B);while(this.featureList.length>0){this.featureList.remove(this.featureList.options[0])}var A=E.getNumElements();for(var D=0;D<A;D++){var C=new Option(D+1,D);this.featureList.options[D]=C}this.featureList.selectedIndex=0;this.renderFeature()},renderFeature:function(){var C=this.layerList.selectedIndex;var E=this.featureList.selectedIndex;var G=this.oSelection.getLayer(C);var D=G.getNumProperties();var F=G.getPropertyNames();this.featureDiv.className="selectionDiv";if(D>1){var B=G.getElementValue(E,0);B=B.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');var A=G.getElementValue(E,1);A=A.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');this.featureDiv.innerHTML=B+"<br>"+A}else{if(D>0){var A=G.getElementValue(E,0);A=A.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');this.featureDiv.innerHTML=A}else{this.featureDiv.innerHTML=""}}}});Fusion.Widget.SMAselectionPanel.SelectionRendererHorizontal=OpenLayers.Class(Fusion.Widget.SMAselectionPanel.SelectionRenderer,{initialize:function(A){Fusion.Widget.SMAselectionPanel.SelectionRenderer.prototype.initialize.apply(this,[A]);var B=document.createElement("div");this.featureDiv=document.createElement("div");this.featureDiv.innerHTML="No Selection";this.featureDiv.className="SMAselectionPanelContent noSelection";B.appendChild(this.featureDiv);if(this.iResultsPerPage!=0){this.previousButton=document.createElement("img");this.previousButton.src=this.oSMAselectionPanel.previousIcon;this.previousButton.style.position="absolute";this.previousButton.style.left="0px";this.previousButton.style.padding="3px";OpenLayers.Event.observe(this.previousButton,"click",OpenLayers.Function.bind(this.renderLayers,this,"prev"));this.nextButton=document.createElement("img");this.nextButton.src=this.oSMAselectionPanel.nextIcon;this.nextButton.style.position="absolute";this.nextButton.style.right="0px";this.nextButton.style.padding="3px";OpenLayers.Event.observe(this.nextButton,"click",OpenLayers.Function.bind(this.renderLayers,this,"next"));B.appendChild(this.previousButton);B.appendChild(this.nextButton)}Fusion.addWidgetStyleSheet(this.oSMAselectionPanel.getLocation()+"SMAselectionPanel/SMAselectionPanel.css");this.oSMAselectionPanel.domObj.appendChild(B)},updateSelection:function(){this.getMap().getSelection(OpenLayers.Function.bind(this.renderSelection,this))},clearSelection:function(){this.oSelection=null;this.featureDiv.className="SMAselectionPanelContent noSelection";this.featureDiv.innerHTML=OpenLayers.i18n("noSelection")},renderSelection:function(B){this.oSelection=null;for(var A in B){this.oSelection=B[A];break}this.updatePageIndexes();this.renderLayers("next")},renderLayers:function(A){if(!this.oSelection){return }$(this.featureDiv).removeClass("noSelection");this.featureDiv.innerHTML="";var D=this.oSelection.getNumLayers();for(var I=0;I<D;I++){var N=document.createElement("table");N.style.borderLeft="1px solid #CCCCCC";N.style.marginBottom="10px";var F=this.oSelection.getLayer(I);var E=F.getPropertyNames();var C=this.getMap().aMaps[0].aLayers;var J=F.getName();for(var G=0;G<C.length;++G){if(C[G].layerName==J){J=C[G].legendLabel;break}}var L=document.createElement("thead");var M=document.createElement("tr");var B=document.createElement("th");B.innerHTML=J;B.colSpan=E.length;B.style.textAlign="center";M.appendChild(B);L.appendChild(M);M=document.createElement("tr");for(var G=0;G<E.length;G++){B=document.createElement("th");B.innerHTML=E[G];B.style.textAlign="center";M.appendChild(B)}L.appendChild(M);N.appendChild(L);var H=document.createElement("tbody");var K=(A=="next")?this.getNextPage(F):this.getPreviousPage(F);this.renderFeatures(K,H);N.appendChild(H);this.featureDiv.appendChild(N)}},renderFeatures:function(D,E){if(!D){return }for(var B=0;B<D.length;B++){var C=document.createElement("tr");if(B%2){C.className="oddRow"}for(var A=0;A<D[B].length;A++){var F=document.createElement("td");F.innerHTML=D[B][A];C.appendChild(F)}E.appendChild(C)}}});Fusion.Widget.SMAtaskPane=OpenLayers.Class(Fusion.Widget,{aExecutedTasks:null,nCurrentTask:-1,nTasks:0,initializeWidget:function(H){this.aExecutedTasks=[];var B=Fusion.getFusionURL();var F=B+H.location+"SMAtaskPane/taskpane.png";var D="SMAtaskPane_home";var J=B+H.location+"SMAtaskPane/taskpane.png";var A="SMAtaskPane_back";var L=B+H.location+"SMAtaskPane/taskpane.png";var G="SMAtaskPane_forward";var K=B+H.location+"SMAtaskPane/taskpane.png";var E="SMAtaskPane_tasks";var C=H.location+"SMAtaskPane/TaskPane.php";var M=H.extension;if(M.InitialTask){C=taskURL=M.InitialTask[0]}else{C=B+C}F=M.HomeIcon?M.HomeIcon[0]:F;D=M.HomeClass?M.HomeClass[0]:D;J=M.PreviousIcon?M.PreviousIcon[0]:J;A=M.PreviousClass?M.PreviousClass[0]:A;L=M.NextIcon?M.NextIcon[0]:L;G=M.NextClass?M.NextClass[0]:G;K=M.TaskIcon?M.TaskIcon[0]:K;E=M.TaskClass?M.TaskClass[0]:E;if(M.MenuContainer){this.menuName=M.MenuContainer[0]}this.toolbar=new Jx.Toolbar();this.homeButton=new Jx.Button({image:F,imageClass:D,tooltip:OpenLayers.i18n("taskHome"),onClick:OpenLayers.Function.bind(this.goHome,this)});this.prevButton=new Jx.Button({image:J,imageClass:A,tooltip:OpenLayers.i18n("prevTask"),onClick:OpenLayers.Function.bind(this.gotoPrevTask,this)});this.nextButton=new Jx.Button({image:L,imageClass:G,tooltip:OpenLayers.i18n("nextTask"),onClick:OpenLayers.Function.bind(this.gotoNextTask,this)});this.toolbar.add(this.homeButton,this.prevButton,this.nextButton);this.taskMenu=new Jx.Menu({image:K,imageClass:E,label:OpenLayers.i18n("taskList"),right:0});$(this.taskMenu.domObj).addClass("taskMenu");$(this.taskMenu.button.domObj).addClass("jxButtonContentLeft");this.toolbar.add(this.taskMenu);var I=this.name+"_IFRAME";this.iframe=document.createElement("iframe");new Jx.Layout(this.iframe);this.iframe.setAttribute("name",I);this.iframe.setAttribute("id",I);this.iframe.setAttribute("frameborder",0);this.iframe.style.border="0px solid #fff";this.oTaskPane=new Jx.Panel({toolbars:[this.toolbar],hideTitle:true,content:this.iframe});$(this.domObj).addClass("SMAtaskPanePanel");Fusion.addWidgetStyleSheet(H.location+"SMAtaskPane/TaskPane.css");this.domObj.appendChild(this.oTaskPane.domObj);this.oTaskPane.domObj.resize();Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED,OpenLayers.Function.bind(this.setTaskMenu,this));this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.setInitialContent,this,C))},updateButtons:function(){this.prevButton.setEnabled(this.nCurrentTask>0);this.nextButton.setEnabled(this.nCurrentTask<this.aExecutedTasks.length-1)},gotoPrevTask:function(){this.nCurrentTask=this.nCurrentTask>0?--this.nCurrentTask:0;var A=this.aExecutedTasks[this.nCurrentTask];this.loadFrame(A)},gotoNextTask:function(){this.nCurrentTask=this.nCurrentTask<this.aExecutedTasks.length-1?++this.nCurrentTask:this.aExecutedTasks.length-1;var A=this.aExecutedTasks[this.nCurrentTask];this.loadFrame(A)},goHome:function(){this.nCurrentTask=0;var A=this.aExecutedTasks[this.nCurrentTask];this.loadFrame(A)},setInitialContent:function(A){this.aExecutedTasks=[];this.nCurrentTask=0;this.setContent(A)},setContent:function(B){if(this.nCurrentTask<this.aExecutedTasks.length-1){}var C=B.split("?");var E=OpenLayers.Util.getParameters(B);var A=this.getMap().getAllMaps();if(!E.LOCALE&&!E.locale){E.locale=Fusion.locale}if(!E.SESSION&&!E.session){E.session=A[0].getSessionID()}if(!E.MAPNAME&&!E.mapname){E.mapname=A[0].getMapName()}var D=C[0]+"?"+OpenLayers.Util.getParameterString(E);this.aExecutedTasks.push(D);++this.nCurrentTask;this.loadFrame(D)},loadFrame:function(A){this.iframe.src=A;this.iframe.taskPaneId=this.widgetTag.name;this.updateButtons()},setTaskMenu:function(){if(this.menuName){var A=this.getMap().widgetSet.getContainerByName(this.menuName);if(A){A.createWidgets(this.getMap().widgetSet,this.taskMenu)}}}});Fusion.Widget.SMAviewOptions=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Menu,displayUnits:false,options:{imperial:"Feet",metric:"Meters"},menuItems:null,initializeWidget:function(B){var A=B.extension;this.displayUnits=A.DisplayUnits?A.DisplayUnits[0]:false;this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.setMapUnits,this));this.menuItems={}},setUiObject:function(D){Fusion.Widget.prototype.setUiObject.apply(this,[D]);var C=new Jx.ButtonSet();for(var A in this.options){var B=new Jx.Menu.Item({label:OpenLayers.i18n(A),toggle:true,onDown:OpenLayers.Function.bind(this.setViewOptions,this,this.options[A])});C.add(B);this.uiObj.add(B);this.menuItems[A]=B}},setViewOptions:function(A){this.getMap().setViewOptions(A)},setMapUnits:function(){var A=this.displayUnits?this.displayUnits:this.getMap().getUnits();this.setViewOptions(A);var B=Fusion.unitSystem(Fusion.unitFromName(A));if(this.menuItems[B]){this.menuItems[B].setActive(true)}}});Fusion.Widget.SMAviewSize=OpenLayers.Class(Fusion.Widget,{defaultTemplate:"x: {x}, y: {y}",domSpan:null,emptyText:"",units:Fusion.UNKNOWN,initializeWidget:function(B){var A=B.extension;this.template=A.Template?A.Template[0]:this.defaultTemplate;this.precision=A.Precision?parseInt(A.Precision[0]):-1;this.units=A.Units?Fusion.unitFromName(A.Units[0]):Fusion.UNKOWN;this.domSpan=document.createElement("span");this.domSpan.className="spanViewSize";this.domSpan.innerHTML=this.emptyText;if(this.domObj){this.emptyText=this.domObj.innerHTML;this.domObj.innerHTML="";this.domObj.appendChild(this.domSpan)}this.getMap().registerForEvent(Fusion.Event.MAP_RESIZED,OpenLayers.Function.bind(this.updateViewSize,this));this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.setUnits,this));this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.updateViewSize,this));this.registerParameter("Units")},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);if(this.uiObj.domObj){this.uiObj.domObj.appendChild(this.domSpan)}else{this.uiObj.appendChild(this.domSpan)}},updateViewSize:function(G){var F=this.getMap();var E=F.getSize();if(this.units!=Fusion.PIXELS){if(this.units==2){this.units=4}var H=F.pixToGeoMeasure(E.w);var C=F.pixToGeoMeasure(E.h);if(this.units!=Fusion.UNKNOWN){var B=F.getMetersPerUnit();H=Fusion.fromMeter(this.units,H*B);C=Fusion.fromMeter(this.units,C*B)}if(this.precision>=0){var D=Math.pow(10,this.precision);H=Math.round(H*D)/D;C=Math.round(C*D)/D}}var A=Fusion.unitAbbr(this.units);this.domSpan.innerHTML=this.template.replace("{w}",H).replace("{h}",C).replace("{units}",A).replace("{units}",A)},setUnits:function(){if(this.units==Fusion.UNKNOWN){this.setParameter("Units",this.getMap().getUnits())}this.updateViewSize()},setParameter:function(B,A){if(B=="Units"){this.units=Fusion.unitFromName(A);this.updateViewSize()}}});if(typeof (ScaleBarTool)=="undefined"){Fusion.require("widgets/scalebar/scalebartool.js")}Fusion.Widget.Scalebar=OpenLayers.Class(Fusion.Widget,{style:"thin",displaySystem:"metric",minWidth:100,maxWidth:200,divisions:2,subdivisions:2,showMinorMeasures:true,abbreviateLabel:true,singleLine:false,initializeWidget:function(C){var B=C.extension;this.style=B.Style?B.Style[0].toLowerCase():this.style;if(this.style!="fancy"&&this.style!="fat"&&this.style!="thin"&&this.style!="thinner"){this.style="thin"}this.displaySystem=B.DisplaySystem?B.DisplaySystem[0]:this.displaySystem;this.minWidth=B.MinWidth?B.MinWidth[0]:this.minWidth;this.maxWidth=B.MaxWidth?B.MaxWidth[0]:this.maxWidth;this.divisions=B.Divisions?B.Divisions[0]:this.divisions;this.subdivisions=B.SubDivisions?B.SubDivisions[0]:this.subdivisions;this.showMinorMeasures=(B.ShowMinorMeasures&&B.ShowMinorMeasures[0])=="false"?false:true;this.abbreviateLabel=(B.AbbreviateLabel&&B.AbbreviateLabel[0])=="true"?true:false;this.singleLine=(B.SingleLine&&B.SingleLine[0])=="true"?true:false;if(document.styleSheets){if(document.styleSheets[0]){var A=Fusion.getFusionURL()+"widgets/scalebar/scalebar-"+this.style+".css";if(document.styleSheets[0].addImport){document.styleSheets[0].addImport(A)}else{document.styleSheets[0].insertRule("@import url("+A+");",0)}}}this.oScaleBar=new ScaleBarTool(1);this.oScaleBar.displaySystem=this.displaySystem;this.oScaleBar.minWidth=this.minWidth;this.oScaleBar.maxWidth=this.maxWidth;this.oScaleBar.divisions=this.divisions;this.oScaleBar.subdivisions=this.subdivisions;this.oScaleBar.showMinorMeasures=this.showMinorMeasures;this.oScaleBar.abbreviateLabel=this.abbreviateLabel;this.oScaleBar.singleLine=this.singleLine;window.setTimeout(OpenLayers.Function.bind(this.oScaleBar,C.name),1);this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.extentsChangedCB,this));this.getMap().registerForEvent(Fusion.Event.MAP_LOADED,OpenLayers.Function.bind(this.extentsChangedCB,this))},extentsChangedCB:function(){this.oScaleBar.update(this.getMap().getScale())}});Fusion.Widget.ScalebarDual=OpenLayers.Class(Fusion.Widget,{initializeWidget:function(H){var E=H.extension;var G=E.MaxWidth?parseInt(E.MaxWidth[0]):300;var F=E.TopInUnits?E.TopInUnits[0]:"ft";var A=E.TopOutUnits?E.TopOutUnits[0]:"mi";var C=E.BottomInUnits?E.BottomInUnits[0]:"m";var D=E.BottomOutUnits?E.BottomOutUnits[0]:"km";var B={maxWidth:G,topInUnits:F,topOutUnits:A,bottomInUnits:C,bottomOutUnits:D};this.addControl(new OpenLayers.Control.ScaleLine(B))}});Fusion.Widget.Select=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,selectionType:"INTERSECTS",nTolerance:3,bActiveOnly:false,maxFeatures:0,pointClickSingleSelect:true,initializeWidget:function(C){this.asCursor=["auto"];this.enable=Fusion.Widget.Select.prototype.enable;var B=C.extension;this.selectionType=B.SelectionType?B.SelectionType[0]:"INTERSECTS";if(B.Tolerance&&(parseInt(B.Tolerance[0])>0)){this.nTolerance=parseInt(B.Tolerance[0])}if(B.MaxFeatures){this.maxFeatures=parseInt(B.MaxFeatures[0])}if(B.PointClickSingleSelect){this.pointClickSingleSelect=(B.PointClickSingleSelect[0]!="false")}this.bActiveOnly=(B.QueryActiveLayer&&(B.QueryActiveLayer[0]=="true"||B.QueryActiveLayer[0]=="1"))?true:false;this.bComputeMetadata=(B.ComputeMetadata&&(B.ComputeMetadata[0]=="true"||B.ComputeMetadata[0]=="1"))?true:false;if(this.bActiveOnly){this.getMap().registerForEvent(Fusion.Event.MAP_ACTIVE_LAYER_CHANGED,OpenLayers.Function.bind(this.enable,this))}var A=this.getMap();this.map=A.oMapOL;this.handler=new OpenLayers.Handler.Box(this,{done:this.execute});A.handlers.push(this.handler)},shouldActivateWith:function(A){return(A instanceof Fusion.Widget.Select&&A.bActiveOnly==this.bActiveOnly)},enable:function(){if(this.bActiveOnly){var A=this.getMap().getActiveLayer();if(A&&A.selectable){Fusion.Widget.prototype.enable.apply(this,[])}else{this.disable()}}else{Fusion.Widget.prototype.enable.apply(this,[])}},activate:function(){this.handler.activate();this.getMap().setCursor(this.asCursor);this.getMap().supressContextMenu(true)},deactivate:function(){this.handler.deactivate();this.getMap().setCursor("auto");this.getMap().supressContextMenu(false)},execute:function(H,K){if(this.keyModifiers&OpenLayers.Handler.MOD_CTRL){}var E,B;var A=H.left;var M=H.bottom;var G=this.maxFeatures;if(H instanceof OpenLayers.Bounds){E=H.right;B=H.top}else{E=A=H.x;B=M=H.y;if(this.pointClickSingleSelect){G=1}}var F=this.getMap().pixToGeo(A,M);var L=this.getMap().pixToGeo(E,B);var D=Math.abs(A-E);var J=Math.abs(M-B);var N={};if(D<=this.nTolerance&&J<=this.nTolerance){var C=this.getMap().pixToGeoMeasure(this.nTolerance);F.x=F.x-C;F.y=F.y-C;L.x=L.x+C;L.y=L.y+C}N.geometry="POLYGON(("+F.x+" "+F.y+", "+L.x+" "+F.y+", "+L.x+" "+L.y+", "+F.x+" "+L.y+", "+F.x+" "+F.y+"))";N.selectionType=this.selectionType;N.maxFeatures=G;N.computed=this.bComputeMetadata;if(this.bActiveOnly){var I=this.getMap().getActiveLayer();if(I){N.layers=I.layerName}else{return }}if(this.handler.dragHandler.evt.shiftKey){N.extendSelection=true}this.getMap().query(N)},extend:function(A){this.execute(A,true)},setModifiers:function(A){this.keyModifiers=(A.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(A.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(A.altKey?OpenLayers.Handler.MOD_ALT:0)},clearModifiers:function(A){this.keyModifiers=0},setParameter:function(B,A){if(B=="Tolerance"&&A>0){this.nTolerance=A}if(B=="SelectionType"){this.selectionType=A}}});Fusion.Widget.SelectPolygon=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,selectionType:"INTERSECTS",nTolerance:3,initializeWidget:function(C){this.asCursor=["auto"];var B=C.extension;this.selectionType=B.SelectionType?B.SelectionType[0]:"INTERSECTS";if(B.Tolerance&&(parseInt(B.Tolerance[0])>0)){nTolerance=parseInt(B.Tolerance[0])}this.bComputeMetadata=(B.ComputeMetadata&&(B.ComputeMetadata[0]=="true"||B.ComputeMetadata[0]=="1"))?true:false;var A=this.getMap();this.map=A.oMapOL;this.handlerOptions={};this.handler=new OpenLayers.Handler.Polygon(this,{done:this.execute},this.handlerOptions);A.handlers.push(this.handler)},activate:function(){this.handler.activate();this.getMap().setCursor(this.asCursor);this.getMap().supressContextMenu(true)},deactivate:function(){this.handler.deactivate();this.getMap().setCursor("auto");this.getMap().supressContextMenu(false)},execute:function(C){var A={};A.geometry=C.toString();A.selectionType=this.selectionType;A.computed=this.bComputeMetadata;if(this.handler.evt.ctrlKey){A.extendSelection=true}if(this.bActiveOnly){var B=this.getMap().getActiveLayer();if(B){A.layers=B.layerName}else{return }}this.getMap().query(A)},setParameter:function(B,A){if(B=="Tolerance"&&A>0){this.nTolerance=A}if(B=="SelectionType"){this.selectionType=A}}});Fusion.Event.RADIUS_WIDGET_ACTIVATED=Fusion.Event.lastEventId++;Fusion.Widget.SelectRadius=OpenLayers.Class(Fusion.Widget,{isExclusive:true,uiClass:Jx.Button,selectionType:"INTERSECTS",nTolerance:3,defaultRadius:20,initializeWidget:function(E){this.asCursor=["auto"];var C=E.extension;this.selectionType=C.SelectionType?C.SelectionType[0]:"INTERSECTS";if(C.Tolerance&&(parseInt(C.Tolerance[0])>0)){nTolerance=parseInt(C.Tolerance[0])}this.defaultRadius=C.DefaultRadius?parseInt(C.DefaultRadius[0]):this.defaultRadius;this.bComputeMetadata=(C.ComputeMetadata&&(C.ComputeMetadata[0]=="true"||C.ComputeMetadata[0]=="1"))?true:false;var A=C.RadiusTooltipContainer?C.RadiusTooltipContainer[0]:"";if(A!=""){this.radiusTip=$(A)}if(this.radiusTip){this.radiusTipType=C.RadiusTooltipType?C.RadiusTooltipType[0].toLowerCase():"dynamic";if(this.radiusTipType=="dynamic"){var D=this.getMap().getDomObj();D.appendChild(this.radiusTip);this.radiusTip.style.position="absolute";this.radiusTip.style.display="none";this.radiusTip.style.top="0px";this.radiusTip.style.left="0px";this.radiusTip.style.zIndex=101}}this.registerEventID(Fusion.Event.RADIUS_WIDGET_ACTIVATED);var B=this.getMap();this.map=B.oMapOL;this.handlerOptions={sides:40};this.handler=new OpenLayers.Handler.RegularPolygon(this,{interval:100,done:this.execute,down:this.mouseDown,move:this.mouseMove,up:this.mouseUp},this.handlerOptions);B.handlers.push(this.handler)},setRadius:function(A){this.defaultRadius=A},getRadius:function(){if(this.handler.active){return this.handler.radius}else{return this.defaultRadius}},activate:function(){var A=this.getMap().pixToGeoMeasure(this.defaultRadius);this.handler.setOptions({radius:A});this.handler.activate();this.getMap().setCursor(this.asCursor);this.units=this.getMap().getAllMaps()[0].units;this.getMap().supressContextMenu(true);this.triggerEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED,true)},deactivate:function(){this.handler.deactivate();this.getMap().setCursor("auto");this.getMap().supressContextMenu(false);this.triggerEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED,false)},mouseDown:function(E){var C=this.handler.evt;if(OpenLayers.Event.isLeftClick(C)){this.handler.fixedRadius=false;var F=this.getMap().getEventPosition(C);var B=this.getMap().pixToGeo(F.x,F.y);var A=this.getMap().pixToGeoMeasure(this.handler.radius);if(this.radiusTip&&this.radiusTipType=="dynamic"){this.radiusTip.style.display="block";var D=$(this.radiusTip).getBorderBoxSize();this.radiusTip.style.top=(F.y-D.height*2)+"px";this.radiusTip.style.left=F.x+"px";if(this.units=="m"||this.units=="ft"){A=Math.round(A*100)/100}this.radiusTip.innerHTML=A+this.units}}},mouseMove:function(E){var C=this.handler.evt;if(OpenLayers.Event.isLeftClick(C)){var G=this.getMap();var F=G.getEventPosition(C);var B=G.pixToGeo(F.x,F.y);var A=this.getMap().pixToGeoMeasure(this.handler.radius);if(this.radiusTip&&this.radiusTipType=="dynamic"){this.radiusTip.style.display="block";var D=$(this.radiusTip).getBorderBoxSize();this.radiusTip.style.top=(F.y-D.height*2)+"px";this.radiusTip.style.left=F.x+"px";if(this.units=="m"||this.units=="ft"){A=Math.round(A*100)/100}this.radiusTip.innerHTML=A+this.units}}},mouseUp:function(A){if(this.radiusTip&&this.radiusTipType=="dynamic"){this.radiusTip.style.display="none";this.radiusTip.innerHTML=""}if(this.handler.start==this.handler.last){this.handler.clear();this.execute(A)}},execute:function(C){var A={};A.geometry=C.toString();A.selectionType=this.selectionType;A.computed=this.bComputeMetadata;if(this.bActiveOnly){var B=this.getMap().getActiveLayer();if(B){A.layers=B.layerName}else{return }}if(this.handler.evt.shiftKey){A.extendSelection=true}this.getMap().query(A)},setParameter:function(B,A){if(B=="Tolerance"&&A>0){this.nTolerance=A}if(B=="SelectionType"){this.selectionType=A}}});Fusion.Widget.SelectRadiusValue=OpenLayers.Class(Fusion.Widget,{radiusWidgetName:null,label:"",className:"",domLabel:null,initializeWidget:function(B){var A=B.extension;this.radiusWidgetName=A.RadiusName?A.RadiusName[0]:null;this.label=A.Label?A.Label[0]:"";this.className=A.ClassName?A.ClassName[0]:"";Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED,OpenLayers.Function.bind(this.mapLoaded,this));this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.mapExtentsChanged,this))},draw:function(){var A=this.getMap().getAllMaps()[0].units;this.domLabel=document.createElement("span");this.domLabel.className=this.className;this.domLabel.innerHTML=this.label+"("+A+")";this.input=document.createElement("input");this.input.type="text";this.domLabel.appendChild(this.input);this.domObj.appendChild(this.domLabel);OpenLayers.Event.observe(this.input,"blur",OpenLayers.Function.bind(this.onBlur,this))},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);if(this.uiObj.domObj){this.domObj=this.uiObj.domObj}else{this.domObj=this.uiObj}},mapLoaded:function(){this.draw();this.input.disabled=true;var B=Fusion.getWidgetsByType("SelectRadius");for(var A=0;A<B.length;A++){if(B[A].widgetTag.name==this.radiusWidgetName){this.widget=B[A];this.widget.registerForEvent(Fusion.Event.RADIUS_WIDGET_ACTIVATED,this.dependantEnable.bind(this));break}}this.updateFromWidgetValue()},dependantEnable:function(A,B){if(this.widget){if(B){this.input.disabled=false}else{this.input.disabled=true}}},mapExtentsChanged:function(){this.updateWidgetValue()},onBlur:function(){this.updateWidgetValue()},updateWidgetValue:function(){if(this.widget){var A=this.input.getValue();this.widget.setRadius(A)}},updateFromWidgetValue:function(){if(this.widget){this.input.value=this.widget.getRadius()}}});Fusion.Widget.SelectWithin=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,resizable=no,status=no",initializeWidget:function(E){var D=E.extension;this.sTarget=D.Target?D.Target[0]:"SelectWithinWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/SelectWithin/SelectWithinPanel.php";this.bSelectionOnly=(D.DisableIfSelectionEmpty&&(D.DisableIfSelectionEmpty[0]=="true"||D.DisableIfSelectionEmpty[0]=="1"))?true:false;this.additionalParameters=[];if(D.AdditionalParameter){for(var C=0;C<D.AdditionalParameter.length;C++){var F=D.AdditionalParameter[C];var B=F.Key[0];var A=F.Value[0];this.additionalParameters.push(B+"="+encodeURIComponent(A))}}this.enable=Fusion.Widget.SelectWithin.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.enable,this));this.disable()},enable:function(){var A=this.getMap();if(this.bSelectionOnly||!A){if(A&&A.hasSelection()){if(this.action){this.action.setEnabled(true)}else{Fusion.Widget.prototype.enable.apply(this,[])}}else{if(this.action){this.action.setEnabled(false)}else{this.disable()}}}else{if(this.action){this.action.setEnabled(true)}else{Fusion.Widget.prototype.enable.apply(this,[])}}},activate:function(){var C=this.sBaseUrl;var E=this.getMap();var B=E.getAllMaps();var D=Fusion.getWidgetById(this.sTarget);var A=$(this.sTarget);var F=[];F.push("locale="+Fusion.locale);F.push("session="+B[0].getSessionID());F.push("mapname="+B[0].getMapName());if(D||A){F.push("popup=false")}else{F.push("popup=true")}F=F.concat(this.additionalParameters);if(C.indexOf("?")<0){C+="?"}else{if(C.slice(-1)!="&"){C+="&"}}C+=F.join("&");if(D){D.setContent(C)}else{if(A){A.src=C}else{window.open(C,this.sTarget,this.sWinFeatures)}}}});Fusion.Widget.SelectionInfo=OpenLayers.Class(Fusion.Widget,{defaultTemplate:"selectionInfo",domSpan:null,initializeWidget:function(B){var A=B.extension;this.emptyText=A.EmptyText?A.EmptyText[0]:this.domObj.innerHTML;this.template=A.Template?A.Template[0]:null;this.domSpan=document.createElement("span");this.domSpan.className="spanSelectionInfo";this.domSpan.innerHTML=OpenLayers.i18n(this.emptyText);this.emptyText=A.EmptyText?A.EmptyText[0]:(this.domObj?this.domObj.innerHTML:null);if(this.domObj){this.domObj.innerHTML="";this.domObj.appendChild(this.domSpan)}this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.update,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.update,this))},setUiObject:function(A){Fusion.Widget.prototype.setUiObject.apply(this,[A]);if(this.uiObj.domObj){this.uiObj.domObj.appendChild(this.domSpan)}else{this.uiObj.appendChild(this.domSpan)}},update:function(){var C=this.getMap();var B=C.getAllMaps();var G=0;var F=0;for(var A=0;A<B.length;++A){var E=B[A];if(E.hasSelection()){var D=E.getSelectedLayers();G+=D.length;F+=E.getSelectedFeatureCount()}}if(F>0){if(this.template){this.domSpan.innerHTML=this.template.replace("{0}",F).replace("{1}",G)}else{this.domSpan.innerHTML=OpenLayers.i18n(this.defaultTemplate,{features:F,layers:G})}}else{this.domSpan.innerHTML=OpenLayers.i18n(this.emptyText)}}});Fusion.Widget.Zoom=OpenLayers.Class(Fusion.Widget,{isExclusive:true,tolerance:5,factor:2,zoomIn:true,uiClass:Jx.Button,initializeWidget:function(C){this.asCursor=["url('images/zoomin.cur'),auto","-moz-zoom-in","auto"];this.zoomInCursor=["url('images/zoomin.cur'),auto","-moz-zoom-in","auto"];this.zoomOutCursor=["url('images/zoomout.cur'),auto","-moz-zoom-out","auto"];var B=C.extension;this.tolerance=B.Tolerance?B.Tolerance[0]:this.tolerance;this.factor=B.Factor?B.Factor[0]:this.factor;this.zoomIn=(B.Direction&&B.Direction[0]=="out")?false:true;this.keypressWatcher=OpenLayers.Function.bind(this.keypressHandler,this);var A=this.getMap();this.map=A.oMapOL;this.handler=new OpenLayers.Handler.Box(this,{done:this.execute},{keyMask:0});this.shiftHandler=new OpenLayers.Handler.Box(this,{done:this.altZoom},{keyMask:OpenLayers.Handler.MOD_SHIFT});A.handlers.push(this.handler);A.handlers.push(this.shiftHandler)},shouldActivateWith:function(A){return(A instanceof Fusion.Widget.Zoom&&A.zoomIn==this.zoomIn&&A.factor==this.factor&&A.tolerance==this.tolerance)},activate:function(){this.handler.activate();this.shiftHandler.activate();if(this.zoomIn){this.getMap().setCursor(this.zoomInCursor)}else{this.getMap().setCursor(this.zoomOutCursor)}OpenLayers.Event.observe(document,"keypress",this.keypressWatcher)},deactivate:function(){this.handler.deactivate();this.shiftHandler.deactivate();this.getMap().setCursor("auto");OpenLayers.Event.stopObserving(document,"keypress",this.keypressWatcher)},execute:function(H,M){var F=this.zoomIn;if(M){F=!F}if(H instanceof OpenLayers.Bounds){var I=this.map.getLonLatFromPixel(new OpenLayers.Pixel(H.left,H.bottom));var K=this.map.getLonLatFromPixel(new OpenLayers.Pixel(H.right,H.top));var B=new OpenLayers.Bounds(I.lon,I.lat,K.lon,K.lat);if(F){this.getMap().setExtents(B)}else{var G=B.getWidth();var C=B.getHeight();var L=this.getMap().getCurrentExtents();var D=L.getWidth();var E=L.getHeight();var J=Math.min(G/D,C/E);var A=B.getCenterLonLat();this.getMap().zoom(A.lon,A.lat,J)}}else{var A=this.map.getLonLatFromPixel(H);var J;if(!F&&this.factor>1){J=1/this.factor}else{J=this.factor}this.getMap().zoom(A.lon,A.lat,J)}},altZoom:function(A){this.execute(A,true)},setParameter:function(B,A){if(B=="Factor"&&A>0){this.factor=A}},keypressHandler:function(B){var A=(B.charCode)?B.charCode:B.keyCode;if(A==Event.KEY_ESC){this.handler.deactivate();this.handler.activate()}}});Fusion.Widget.ZoomOnClick=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,factor:4,initializeWidget:function(B){var A=B.extension;this.factor=parseFloat(A.Factor?A.Factor[0]:this.factor)},activate:function(){var A=this.getMap().getCurrentCenter();this.getMap().zoom(A.x,A.y,this.factor)},setParameter:function(B,A){if(B=="Factor"&&A>0){this.factor=A}}});Fusion.Widget.ZoomToSelection=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,initializeWidget:function(B){var A=B.extension;this.maxDimension=A.MaximumZoomDimension?A.MaximumZoomDimension[0]:-1;this.zoomFactor=A.ZoomFactor?A.ZoomFactor[0]:2;this.enable=Fusion.Widget.ZoomToSelection.prototype.enable;this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.enable,this));this.getMap().registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.disable,this))},activate:function(){this.getMap().getSelection(OpenLayers.Function.bind(this.zoomToSelection,this))},zoomToSelection:function(A){var D=this.oMap.aMaps[0];var C=A[D.getMapName()].getLowerLeftCoord();var F=A[D.getMapName()].getUpperRightCoord();var B=this.zoomFactor*Math.max(Math.abs(F.x-C.x),Math.abs(F.y-C.y))/2;var G=(F.x+C.x)/2;var E=(F.y+C.y)/2;C.x=G-B;F.x=G+B;C.y=E-B;F.y=E+B;this.getMap().setExtents(new OpenLayers.Bounds(C.x,C.y,F.x,F.y))},enable:function(){if(this.oMap&&this.oMap.hasSelection()){Fusion.Widget.prototype.enable.apply(this,[])}else{this.disable()}}});function ScaleBarTool(B){this.scaleDenominator=(B==null)?1:B;this.displaySystem="metric";this.minWidth=100;this.maxWidth=200;this.divisions=2;this.subdivisions=2;this.showMinorMeasures=false;this.abbreviateLabel=false;this.singleLine=false;this.resolution=72;this.align="center";this.container=document.createElement("div");this.container.className="sbWrapper";this.labelContainer=document.createElement("div");this.labelContainer.className="sbUnitsContainer";this.labelContainer.style.position="absolute";this.graphicsContainer=document.createElement("div");this.graphicsContainer.style.position="absolute";this.graphicsContainer.className="sbGraphicsContainer";this.numbersContainer=document.createElement("div");this.numbersContainer.style.position="absolute";this.numbersContainer.className="sbNumbersContainer";var A=document.createElement("div");A.className="sbMarkerMajor";this.graphicsContainer.appendChild(A);var C=document.createElement("div");C.className="sbMarkerMinor";this.graphicsContainer.appendChild(C);var D=document.createElement("div");D.className="sbBar";this.graphicsContainer.appendChild(D);var E=document.createElement("div");E.className="sbBarAlt";this.graphicsContainer.appendChild(E)}ScaleBarTool.prototype.update=function(T){if(T!=null){this.scaleDenominator=T}function l(u,AG,w){var w=(w==null)?10:w;var z=Number.POSITIVE_INFINITY;var AA=Number.POSITIVE_INFINITY;var AI=u;var v=3;for(var AB=0;AB<3;++AB){var t=Math.pow(2,(-1*AB));var AE=Math.floor(Math.log(AG/t)/Math.LN10);for(var AH=AE;AH>(AE-w+1);--AH){var AD=Math.max(AB-AH,0);var AJ=t*Math.pow(10,AH);if((AJ*Math.floor(AG/AJ))>=u){if(u%AJ==0){var AF=u/AJ}else{var AF=Math.floor(u/AJ)+1}var s=AF+(2*AB);var AC=(AH<0)?(Math.abs(AH)+1):AH;if((s<z)||((s==z)&&(AC<AA))){z=s;AA=AC;AI=(AJ*AF).toFixed(AD);v=AD}}}}this.value=AI;this.score=z;this.tieBreaker=AA;this.numDec=v}l.prototype.toString=function(){return this.value.toString()};l.prototype.valueOf=function(){return this.value};function c(s,z){var AB=0;if(document.styleSheets){for(var u=document.styleSheets.length-1;u>=0;--u){var v=document.styleSheets[u];if(!v.disabled){var t;if(typeof (v.cssRules)=="undefined"){if(typeof (v.rules)=="undefined"){return 0}else{t=v.rules}}else{t=v.cssRules}for(var AA=0;AA<t.length;++AA){var w=t[AA];if(w.selectorText&&(w.selectorText.toLowerCase()==s.toLowerCase())){if(w.style[z]!=""){AB=parseInt(w.style[z])}}}}}}return AB?AB:0}function m(w,v){v=(v)?v:0;var u=""+Math.round(w);var t=/(-?[0-9]+)([0-9]{3})/;while(t.test(u)){u=u.replace(t,"$1,$2")}if(v>0){var s=Math.floor(Math.pow(10,v)*(w-Math.round(w)));if(s==0){return u}else{return u+"."+s}}else{return u}}this.container.title="scale 1:"+m(this.scaleDenominator);var L=new Object();L.english={units:["miles","feet","inches"],abbr:["mi","ft","in"],inches:[63360,12,1]};L.metric={units:["kilometers","meters","centimeters"],abbr:["km","m","cm"],inches:[39370.07874,39.370079,0.393701]};var p=new Array();for(var q=0;q<L[this.displaySystem].units.length;++q){p[q]=new Object();var I=this.resolution*L[this.displaySystem].inches[q]/this.scaleDenominator;var E=(this.minWidth/I)/(this.divisions*this.subdivisions);var N=(this.maxWidth/I)/(this.divisions*this.subdivisions);for(var D=0;D<(this.divisions*this.subdivisions);++D){var Q=E*(D+1);var f=N*(D+1);var C=new l(Q,f);p[q][D]={value:(C.value/(D+1)),score:0,tieBreaker:0,numDec:0,displayed:0};for(var M=0;M<(this.divisions*this.subdivisions);++M){displayedValuePosition=C.value*(M+1)/(D+1);niceNumber2=new l(displayedValuePosition,displayedValuePosition);var j=((M+1)%this.subdivisions==0);var r=((M+1)==(this.divisions*this.subdivisions));if((this.singleLine&&r)||(!this.singleLine&&(j||this.showMinorMeasures))){p[q][D].score+=niceNumber2.score;p[q][D].tieBreaker+=niceNumber2.tieBreaker;p[q][D].numDec=Math.max(p[q][D].numDec,niceNumber2.numDec);p[q][D].displayed+=1}else{p[q][D].score+=niceNumber2.score/this.subdivisions;p[q][D].tieBreaker+=niceNumber2.tieBreaker/this.subdivisions}}var G=(q+1)*p[q][D].tieBreaker/p[q][D].displayed;p[q][D].score*=G}}var V=null;var H=null;var A=null;var R=null;var Y=Number.POSITIVE_INFINITY;var W=Number.POSITIVE_INFINITY;var X=0;for(var q=0;q<p.length;++q){for(D in p[q]){if((p[q][D].score<Y)||((p[q][D].score==Y)&&(p[q][D].tieBreaker<W))){Y=p[q][D].score;W=p[q][D].tieBreaker;V=p[q][D].value;X=p[q][D].numDec;H=L[this.displaySystem].units[q];A=L[this.displaySystem].abbr[q];I=this.resolution*L[this.displaySystem].inches[q]/this.scaleDenominator;R=I*V}}}var K=(c(".sbMarkerMajor","borderLeftWidth")+c(".sbMarkerMajor","width")+c(".sbMarkerMajor","borderRightWidth"))/2;var F=(c(".sbMarkerMinor","borderLeftWidth")+c(".sbMarkerMinor","width")+c(".sbMarkerMinor","borderRightWidth"))/2;var a=(c(".sbBar","borderLeftWidth")+c(".sbBar","borderRightWidth"))/2;var n=(c(".sbBarAlt","borderLeftWidth")+c(".sbBarAlt","borderRightWidth"))/2;if(!document.styleSheets){K=0.5;F=0.5}while(this.labelContainer.hasChildNodes()){this.labelContainer.removeChild(this.labelContainer.firstChild)}while(this.graphicsContainer.hasChildNodes()){this.graphicsContainer.removeChild(this.graphicsContainer.firstChild)}while(this.numbersContainer.hasChildNodes()){this.numbersContainer.removeChild(this.numbersContainer.firstChild)}var b,d,S,U;var B={left:0,center:(-1*this.divisions*this.subdivisions*R/2),right:(-1*this.divisions*this.subdivisions*R)};var P=0+B[this.align];var e=0;for(var Z=0;Z<this.divisions;++Z){P=Z*this.subdivisions*R;P+=B[this.align];e=(Z==0)?0:((Z*this.subdivisions)*V).toFixed(X);b=document.createElement("div");b.className="sbMarkerMajor";b.style.position="absolute";b.style.overflow="hidden";b.style.left=Math.round(P-K)+"px";b.appendChild(document.createTextNode(" "));this.graphicsContainer.appendChild(b);if(!this.singleLine){S=document.createElement("div");S.className="sbNumbersBox";S.style.position="absolute";S.style.overflow="hidden";S.style.textAlign="center";if(this.showMinorMeasures){S.style.width=Math.round(R*2)+"px";S.style.left=Math.round(P-R)+"px"}else{S.style.width=Math.round(this.subdivisions*R*2)+"px";S.style.left=Math.round(P-(this.subdivisions*R))+"px"}S.appendChild(document.createTextNode(e));this.numbersContainer.appendChild(S)}for(var J=0;J<this.subdivisions;++J){d=document.createElement("div");d.style.position="absolute";d.style.overflow="hidden";d.style.width=Math.round(R)+"px";if((J%2)==0){d.className="sbBar";d.style.left=Math.round(P-a)+"px"}else{d.className="sbBarAlt";d.style.left=Math.round(P-n)+"px"}d.appendChild(document.createTextNode(" "));this.graphicsContainer.appendChild(d);if(J<(this.subdivisions-1)){P=((Z*this.subdivisions)+(J+1))*R;P+=B[this.align];e=(Z*this.subdivisions+J+1)*V;b=document.createElement("div");b.className="sbMarkerMinor";b.style.position="absolute";b.style.overflow="hidden";b.style.left=Math.round(P-F)+"px";b.appendChild(document.createTextNode(" "));this.graphicsContainer.appendChild(b);if(this.showMinorMeasures&&!this.singleLine){S=document.createElement("div");S.className="sbNumbersBox";S.style.position="absolute";S.style.overflow="hidden";S.style.textAlign="center";S.style.width=Math.round(R*2)+"px";S.style.left=Math.round(P-R)+"px";S.appendChild(document.createTextNode(e));this.numbersContainer.appendChild(S)}}}}P=(this.divisions*this.subdivisions)*R;P+=B[this.align];e=((this.divisions*this.subdivisions)*V).toFixed(X);b=document.createElement("div");b.className="sbMarkerMajor";b.style.position="absolute";b.style.overflow="hidden";b.style.left=Math.round(P-K)+"px";b.appendChild(document.createTextNode(" "));this.graphicsContainer.appendChild(b);if(!this.singleLine){S=document.createElement("div");S.className="sbNumbersBox";S.style.position="absolute";S.style.overflow="hidden";S.style.textAlign="center";if(this.showMinorMeasures){S.style.width=Math.round(R*2)+"px";S.style.left=Math.round(P-R)+"px"}else{S.style.width=Math.round(this.subdivisions*R*2)+"px";S.style.left=Math.round(P-(this.subdivisions*R))+"px"}S.appendChild(document.createTextNode(e));this.numbersContainer.appendChild(S)}var h=document.createElement("div");h.style.position="absolute";var g;if(this.singleLine){g=e;h.className="sbLabelBoxSingleLine";h.style.top="-0.6em";h.style.left=(P+10)+"px"}else{g="";h.className="sbLabelBox";h.style.textAlign="center";h.style.width=Math.round(this.divisions*this.subdivisions*R)+"px";h.style.left=Math.round(B[this.align])+"px";h.style.overflow="hidden"}if(this.abbreviateLabel){g+=" "+A}else{g+=" "+H}h.appendChild(document.createTextNode(g));this.labelContainer.appendChild(h);if(!document.styleSheets){var O=document.createElement("style");O.type="text/css";var k=".sbBar {top: 0px; background: #666666; height: 1px; border: 0;}";k+=".sbBarAlt {top: 0px; background: #666666; height: 1px; border: 0;}";k+=".sbMarkerMajor {height: 7px; width: 1px; background: #666666; border: 0;}";k+=".sbMarkerMinor {height: 5px; width: 1px; background: #666666; border: 0;}";k+=".sbLabelBox {top: -16px;}";k+=".sbNumbersBox {top: 7px;}";O.appendChild(document.createTextNode(k));document.getElementsByTagName("head").item(0).appendChild(O)}this.container.appendChild(this.graphicsContainer);this.container.appendChild(this.labelContainer);this.container.appendChild(this.numbersContainer)};ScaleBarTool.prototype.place=function(A){if(A==null){document.body.appendChild(this.container)}else{var B=document.getElementById(A);if(B!=null){B.appendChild(this.container)}}this.update()};Fusion.Layers.Generic=OpenLayers.Class(Fusion.Layers,{arch:"Generic",sActiveLayer:null,selectionType:"INTERSECTS",bSelectionOn:false,oSelection:null,initialize:function(D,B,A){Fusion.Layers.prototype.initialize.apply(this,arguments);this._sMapname=B.layerOptions.name?B.layerOptions.name:"generic layer";this.minScale=B.layerOptions.minScale?B.layerOptions.minScale:1;this.maxScale=B.layerOptions.maxScale?B.layerOptions.maxScale:"auto";var C=new Fusion.Layers.ScaleRange({minScale:this.minScale,maxScale:this.maxScale},Fusion.Constant.LAYER_RASTER_TYPE);rootOpts={layerName:this._sMapname,resourceId:this.sMapResourceId,selectable:false,editable:false,layerTypes:[Fusion.Constant.LAYER_RASTER_TYPE],minScale:this.minScale,maxScale:this.maxScale,scaleRanges:[C],parentGroup:D.layerRoot,displayInLegend:this.bDisplayInLegend,expandInLegend:this.bExpandInLegend,legendLabel:this._sMapname,uniqueId:"layerRoot",visible:true,actuallyVisible:true};this.layerRoot=new Fusion.Layers.Layer(rootOpts,this);if(A){this.loadMap(this.sMapResourceId)}},loadMap:function(A){this.bMapLoaded=false;this.triggerEvent(Fusion.Event.LAYER_LOADING);if(this.bIsMapWidgetLayer){this.mapWidget._addWorker()}if(this.oLayerOL){this.oLayerOL.events.unregister("loadstart",this,this.loadStart);this.oLayerOL.events.unregister("loadend",this,this.loadEnd);this.oLayerOL.events.unregister("loadcancel",this,this.loadEnd);this.oLayerOL.destroy();this.oLayerOL=null}switch(this.layerType){case"Google":switch(this.mapTag.layerOptions.type){case"G_PHYSICAL_MAP":this.mapTag.layerOptions.type=G_PHYSICAL_MAP;break;case"G_HYBRID_MAP":this.mapTag.layerOptions.type=G_HYBRID_MAP;break;case"G_SATELLITE_MAP":this.mapTag.layerOptions.type=G_SATELLITE_MAP;break;case"G_NORMAL_MAP":this.mapTag.layerOptions.type=G_NORMAL_MAP;default:if(this.mapTag.layerOptions.type==G_PHYSICAL_MAP){this.mapTag.layerOptions.type=G_PHYSICAL_MAP}else{if(this.mapTag.layerOptions.type==G_HYBRID_MAP){this.mapTag.layerOptions.type=G_HYBRID_MAP}else{if(this.mapTag.layerOptions.type==G_SATELLITE_MAP){this.mapTag.layerOptions.type=G_SATELLITE_MAP}else{this.mapTag.layerOptions.type=G_NORMAL_MAP}}}break}break;case"VirtualEarth":this.mapTag.layerOptions.animationEnabled=false;switch(this.mapTag.layerOptions.type){case"Aerial":case"a":this.mapTag.layerOptions.type=VEMapStyle.Aerial;break;case"Shaded":case"s":this.mapTag.layerOptions.type=VEMapStyle.Shaded;break;case"Hybrid":case"h":this.mapTag.layerOptions.type=VEMapStyle.Hybrid;break;default:this.mapTag.layerOptions.type=VEMapStyle.Road;break}break;case"Yahoo":switch(this.mapTag.layerOptions.type){case"YAHOO_MAP_SAT":case"YAHOO_SAT":this.mapTag.layerOptions.type=YAHOO_MAP_SAT;break;case"YAHOO_MAP_HYB":case"YAHOO_HYB":this.mapTag.layerOptions.type=YAHOO_MAP_HYB;break;case"YAHOO_MAP_REG":case"YAHOO_REG":default:this.mapTag.layerOptions.type=YAHOO_MAP_REG;break}break;default:this.oLayerOL=new OpenLayers.Layer[this.layerType](this.getMapName(),this.sMapResourceId,this.mapTag.layerParams,this.mapTag.layerOptions);break}if(!this.oLayerOL){if(!this.mapTag.layerOptions.maxExtent){this.mapTag.layerOptions.maxExtent=new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892)}if(typeof this.mapTag.layerOptions.sphericalMercator=="undefined"){this.mapTag.layerOptions.sphericalMercator=true}if(typeof this.mapTag.layerOptions.numZoomLevels=="undefined"){this.mapTag.layerOptions.numZoomLevels=20}this.oLayerOL=new OpenLayers.Layer[this.layerType](this.getMapName(),this.mapTag.layerOptions);this.mapWidget.fractionalZoom=false;this.mapWidget.oMapOL.setOptions({fractionalZoom:false})}this.oLayerOL.events.register("loadstart",this,this.loadStart);this.oLayerOL.events.register("loadend",this,this.loadEnd);this.oLayerOL.events.register("loadcancel",this,this.loadEnd);if(this.bIsMapWidgetLayer){this.mapWidget.addMap(this);this.mapWidget._removeWorker()}window.setTimeout(OpenLayers.Function.bind(this.asyncTrigger,this),1)},asyncTrigger:function(){this.bMapLoaded=true;this.triggerEvent(Fusion.Event.LAYER_LOADED)},reloadMap:function(){this.loadMap(this.sResourceId);this.mapWidget.triggerEvent(Fusion.Event.MAP_RELOADED);this.drawMap()},drawMap:function(){if(!this.bMapLoaded){return }this.oLayerOL.mergeNewParams(params)},showLayer:function(A,B){this.processLayerEvents(A,true);if(!B){this.oLayerOL.setVisibility(true)}},hideLayer:function(A,B){this.processLayerEvents(A,false);if(!B){this.oLayerOL.setVisibility(false)}},showGroup:function(B,A){this.processGroupEvents(B,true)},hideGroup:function(B,A){this.processGroupEvents(B,false)},refreshLayer:function(A){this.drawMap()},getLegendImageURL:function(A,B,C,D){return D},getSessionID:function(){return""}});Fusion.Layers.MapGuide=OpenLayers.Class(Fusion.Layers,{arch:"MapGuide",session:[null],aShowLayers:null,aHideLayers:null,aShowGroups:null,aHideGroups:null,aRefreshLayers:null,sActiveLayer:null,selectionType:"INTERSECTS",bSelectionOn:false,oSelection:null,selectionAsOverlay:true,useAsyncOverlay:false,defaultFormat:"PNG",initialize:function(E,C,B){Fusion.Layers.prototype.initialize.apply(this,arguments);var F=Fusion.getQueryParam("theme");if(F!=""){this.sMapResourceId=F;Fusion.queryParams.theme=null}this.registerEventID(Fusion.Event.MAP_SESSION_CREATED);this.mapInfo=C.mapInfo;this.imageFormat=C.extension.ImageFormat?C.extension.ImageFormat[0]:this.defaultFormat;this.selectionType=C.extension.SelectionType?C.extension.SelectionType[0]:"INTERSECTS";this.selectionColor=C.extension.SelectionColor?C.extension.SelectionColor[0]:"";this.selectionFormat=C.extension.SelectionFormat?C.extension.SelectionFormat[0]:"PNG";if(C.extension.SelectionAsOverlay&&C.extension.SelectionAsOverlay[0]=="false"){this.selectionAsOverlay=false}if(!this.bIsMapWidgetLayer){this.selectionAsOverlay=false}if(this.bIsMapWidgetLayer){var D=true;if(C.extension.DisableCtrlClick&&C.extension.DisableCtrlClick[0]=="true"){D=false}if(D){this.map=this.mapWidget.oMapOL;this.handler=new OpenLayers.Handler.Click(this,{click:OpenLayers.Function.bind(this.mouseUpCRTLClick,this)},{keyMask:OpenLayers.Handler.MOD_CTRL});this.handler.activate();this.nTolerance=2}}rootOpts={displayInLegend:this.bDisplayInLegend,expandInLegend:this.bExpandInLegend,legendLabel:this._sMapname,uniqueId:"layerRoot",groupName:"layerRoot",visible:true,actuallyVisible:true};this.layerRoot=new Fusion.Layers.Group(rootOpts,this);this.keepAliveInterval=parseInt(C.extension.KeepAliveInterval?C.extension.KeepAliveInterval[0]:300);this.noCache=true;var A=Fusion.sessionId;if(A){this.session[0]=A;this.mapSessionCreated()}else{this.createSession()}},createSession:function(){if(!this.session[0]){this.session[0]=this;var A=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+A+"/CreateSession."+A;var B={onSuccess:OpenLayers.Function.bind(this.createSessionCB,this)};Fusion.ajaxRequest(C,B)}if(this.session[0] instanceof Fusion.Layers.MapGuide){this.session[0].registerForEvent(Fusion.Event.MAP_SESSION_CREATED,OpenLayers.Function.bind(this.mapSessionCreated,this))}else{this.mapSessionCreated()}},createSessionCB:function(xhr){if(xhr.status==200){var o;eval("o="+xhr.responseText);this.session[0]=o.sessionId;var acceptLang=o.acceptLanguage.split(",");for(var i=0;i<acceptLang.length;++i){var locale=acceptLang[i].split(";");break}this.triggerEvent(Fusion.Event.MAP_SESSION_CREATED)}},mapSessionCreated:function(){if(this.sMapResourceId!=""){var A={};if(this.bIsMapWidgetLayer){var C=Fusion.getQueryParam("showlayers");Fusion.queryParams.showlayers=null;var B=Fusion.getQueryParam("hidelayers");Fusion.queryParams.hidelayers=null;var E=Fusion.getQueryParam("showgroups");Fusion.queryParams.showgroups=null;var D=Fusion.getQueryParam("hidegroups");Fusion.queryParams.hidegroups=null;var A={showlayers:C==""?[]:C.split(","),hidelayers:B==""?[]:B.split(","),showgroups:E==""?[]:E.split(","),hidegroups:D==""?[]:D.split(",")}}this.loadMap(this.sMapResourceId,A)}window.setInterval(OpenLayers.Function.bind(this.pingServer,this),this.keepAliveInterval*1000)},sessionReady:function(){return(typeof this.session[0]=="string")},getSessionID:function(){return this.session[0]},loadMap:function(F,C){this.bMapLoaded=false;if(!this.sessionReady()){this.sMapResourceId=F;return }this.triggerEvent(Fusion.Event.LAYER_LOADING);this.mapWidget._addWorker();this._fScale=-1;this._nDpi=96;C=C||{};this.aShowLayers=C.showlayers||[];this.aHideLayers=C.hidelayers||[];this.aShowGroups=C.showgroups||[];this.aHideGroups=C.hidegroups||[];this.aRefreshLayers=C.refreshlayers||[];this.aLayers=[];this.oSelection=null;this.aSelectionCallbacks=[];this._bSelectionIsLoading=false;var A=Fusion.getScriptLanguage();var B="layers/"+this.arch+"/"+A+"/LoadMap."+A;var D=this.getSessionID();var E={mapid:F,session:D};var C={onSuccess:OpenLayers.Function.bind(this.mapLoaded,this),parameters:E};Fusion.ajaxRequest(B,C)},mapLoaded:function(r){if(r.status==200){var o;eval("o="+r.responseText);this._sResourceId=o.mapId;this._sMapname=o.mapName;this._sMapTitle=o.mapTitle;this.mapWidget.setMetersPerUnit(o.metersPerUnit);this.mapWidget.setBackgroundColor(o.backgroundColor);var version=o.siteVersion;var bits=version.split(".");this.siteVersion=new Array(parseInt(bits[0]),parseInt(bits[1]),parseInt(bits[2]),parseInt(bits[3]));this.mapTag.layerOptions.maxExtent=OpenLayers.Bounds.fromArray(o.extent);this.layerRoot.clear();this.layerRoot.legendLabel=this._sMapTitle;this.layerRoot.displayInLegend=true;this.layerRoot.expandInLegend=true;this.parseMapLayersAndGroups(o);this.minScale=10000000000;this.maxScale=0;for(var i=0;i<this.aLayers.length;i++){this.minScale=Math.min(this.minScale,this.aLayers[i].minScale);this.maxScale=Math.max(this.maxScale,this.aLayers[i].maxScale)}if(this.minScale<=0){this.minScale=1}for(var i=0;i<this.aShowLayers.length;i++){var layer=this.layerRoot.findLayerByAttribute("layerName",this.aShowLayers[i]);if(layer){this.aShowLayers[i]=layer.uniqueId}else{this.aShowLayers[i]=""}}for(var i=0;i<this.aHideLayers.length;i++){var layer=this.layerRoot.findLayerByAttribute("layerName",this.aHideLayers[i]);if(layer){this.aHideLayers[i]=layer.uniqueId}else{this.aHideLayers[i]=""}}for(var i=0;i<this.aShowGroups.length;i++){var group=this.layerRoot.findGroupByAttribute("groupName",this.aShowGroups[i]);if(group){this.aShowGroups[i]=group.uniqueId}else{this.aShowGroups[i]=""}}for(var i=0;i<this.aHideGroups.length;i++){var group=this.layerRoot.findGroupByAttribute("groupName",this.aHideGroups[i]);if(group){this.aHideGroups[i]=group.uniqueId}else{this.aHideGroups[i]=""}}if(!this.bSingleTile){if(o.groups.length>0){this.bSingleTile=false;this.noCache=false;this.groupName=o.groups[0].groupName;this.mapWidget.registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.mapExtentsChanged,this))}else{this.bSingleTile=true}}this.units=Fusion.getClosestUnits(o.metersPerUnit);if(this.projCode){this.mapWidget.setProjection(this.projCode)}if(o.FiniteDisplayScales&&o.FiniteDisplayScales.length>0){this.scales=o.FiniteDisplayScales;this.mapWidget.fractionalZoom=false;this.mapWidget.oMapOL.fractionalZoom=false}if(this.oLayerOL){this.oLayerOL.events.unregister("loadstart",this,this.loadStart);this.oLayerOL.events.unregister("loadend",this,this.loadEnd);this.oLayerOL.events.unregister("loadcancel",this,this.loadEnd);this.oLayerOL.destroy()}this.oLayerOL=this.createOLLayer(this._sMapname,this.bSingleTile,2,false);this.oLayerOL.events.register("loadstart",this,this.loadStart);this.oLayerOL.events.register("loadend",this,this.loadEnd);this.oLayerOL.events.register("loadcancel",this,this.loadEnd);if(this.oLayerOL2){this.oLayerOL2.destroy()}this.bMapLoaded=true;if(this.bIsMapWidgetLayer){this.mapWidget.addMap(this);if(!this.bSingleTile&&o.hasDynamicLayers){this.oLayerOL2=this.createOLLayer(this._sMapname+"_DynamicOverlay",true,2,true);this.mapWidget.oMapOL.addLayer(this.oLayerOL2);this.oLayerOL2.setVisibility(true)}}}this.mapWidget._removeWorker();this.triggerEvent(Fusion.Event.LAYER_LOADED)},reloadMap:function(){this.mapWidget._addWorker();this.aShowLayers=[];this.aHideLayers=[];this.aShowGroups=[];this.aHideGroups=[];this.aRefreshLayers=[];this.layerRoot.clear();this.oldLayers=$A(this.aLayers);this.aLayers=[];var A=Fusion.getScriptLanguage();var B="layers/"+this.arch+"/"+A+"/LoadMap."+A;var D=this.getSessionID();var E={mapname:this._sMapname,session:D};var C={onSuccess:OpenLayers.Function.bind(this.mapReloaded,this),onException:OpenLayers.Function.bind(this.reloadFailed,this),parameters:E};Fusion.ajaxRequest(B,C)},reloadFailed:function(A){Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("mapLoadError",{error:A.transport.responseText})));this.mapWidget._removeWorker()},loadScaleRanges:function(F){var A=Fusion.getScriptLanguage();var B="layers/"+this.arch+"/"+A+"/LoadScaleRanges."+A;var D=this.getSessionID();var E={mapname:this._sMapname,session:D};var C={onSuccess:OpenLayers.Function.bind(this.scaleRangesLoaded,this,F),parameters:E};Fusion.ajaxRequest(B,C)},scaleRangesLoaded:function(userFunc,r){if(r.status==200){var o;eval("o="+r.responseText);if(o.layers&&o.layers.length>0){var iconOpt={url:o.icons_url||null,width:o.icons_width||16,height:o.icons_height||16};for(var i=0;i<o.layers.length;i++){var oLayer=this.getLayerById(o.layers[i].uniqueId);if(oLayer){oLayer.scaleRanges=[];for(var j=0;j<o.layers[i].scaleRanges.length;j++){var scaleRange=new Fusion.Layers.ScaleRange(o.layers[i].scaleRanges[j],oLayer.layerType,iconOpt);oLayer.scaleRanges.push(scaleRange)}}}}userFunc()}},mapReloaded:function(r){if(r.status==200){var o;eval("o="+r.responseText);this.parseMapLayersAndGroups(o);for(var i=0;i<this.aLayers.length;++i){var newLayer=this.aLayers[i];for(var j=0;j<this.oldLayers.length;++j){if(this.oldLayers[j].uniqueId==newLayer.uniqueId){newLayer.selectedFeatureCount=this.oldLayers[j].selectedFeatureCount;newLayer.noCache=this.oldLayers[j].noCache;break}}}this.oldLayers=null;this.mapWidget.triggerEvent(Fusion.Event.MAP_RELOADED);this.drawMap()}this.mapWidget._removeWorker()},reorderLayers:function(D){var A=Fusion.getScriptLanguage();var B="layers/"+this.arch+"/"+A+"/SetLayers."+A;var E={mapname:this._sMapname,session:this.getSessionID(),layerindex:D.join()};var C={onSuccess:OpenLayers.Function.bind(this.mapLayersReset,this,D),parameters:E};Fusion.ajaxRequest(B,C)},mapLayersReset:function(aLayerIndex,r){if(r.status==200){var o;eval("o="+r.responseText);if(o.success){var layerCopy=$A(this.aLayers);this.aLayers=[];this.aVisibleLayers=[];for(var i=0;i<aLayerIndex.length;++i){this.aLayers.push(layerCopy[aLayerIndex[i]]);if(this.aLayers[i].visible){this.aVisibleLayers.push(this.aLayers[i].layerName)}}this.drawMap();this.triggerEvent(Fusion.Event.MAP_LAYER_ORDER_CHANGED)}else{alert(OpenLayers.i18n("setLayersError",{error:o.layerindex}))}}},parseMapLayersAndGroups:function(E){for(var B=0;B<E.groups.length;B++){var D=new Fusion.Layers.Group(E.groups[B],this);var C;if(D.parentUniqueId!=""){C=this.layerRoot.findGroupByAttribute("uniqueId",D.parentUniqueId)}else{C=this.layerRoot}C.addGroup(D,this.bLayersReversed)}for(var B=0;B<E.layers.length;B++){var A=new Fusion.Layers.Layer(E.layers[B],this);var C;if(A.parentGroup!=""){C=this.layerRoot.findGroupByAttribute("uniqueId",A.parentGroup)}else{C=this.layerRoot}C.addLayer(A,this.bLayersReversed);this.aLayers.push(A)}},drawMap:function(){if(!this.bMapLoaded){return }var A={ts:(new Date()).getTime(),showLayers:this.aShowLayers.length>0?this.aShowLayers.toString():null,hideLayers:this.aHideLayers.length>0?this.aHideLayers.toString():null,showGroups:this.aShowGroups.length>0?this.aShowGroups.toString():null,hideGroups:this.aHideGroups.length>0?this.aHideGroups.toString():null,refreshLayers:this.aRefreshLayers.length>0?this.aRefreshLayers.toString():null};this.aShowLayers=[];this.aHideLayers=[];this.aShowGroups=[];this.aHideGroups=[];this.aRefreshLayers=[];if(this.oLayerOL2){this.oLayerOL2.mergeNewParams(A)}else{this.oLayerOL.mergeNewParams(A)}},drawSelection:function(){if(this.queryLayer){this.queryLayer.redraw(true)}else{this.drawMap()}},createOLLayer:function(C,G,E,F){this.useAsyncOverlay=Fusion.getConfigurationItem("mapguide","useAsyncOverlay");if(!this.useAsyncOverlay){this.selectionAsOverlay=false}var D={units:this.units,maxResolution:"auto",useOverlay:this.selectionAsOverlay,useAsyncOverlay:this.useAsyncOverlay,ratio:this.ratio};if((E&1)==0&&!/WebKit/.test(navigator.userAgent)){}if(this.scales&&this.scales.length>0){D.scales=this.scales}if(this.maxScale!=Infinity){D.minScale=this.maxScale}else{if(this.mapWidget.minScale){D.minScale=this.mapWidget.maxScale}}if(!this.mapWidget.oMapOL.scales&&!this.scales){D.maxScale=this.minScale}D.singleTile=G;OpenLayers.Util.extend(D,this.mapTag.layerOptions);var H={};if(G){H={session:this.getSessionID(),mapname:this._sMapname,format:this.imageFormat,behavior:E,clientagent:this.clientAgent};H.showLayers=this.aShowLayers.length>0?this.aShowLayers.toString():null;H.hideLayers=this.aHideLayers.length>0?this.aHideLayers.toString():null;H.showGroups=this.aShowGroups.length>0?this.aShowGroups.toString():null;H.hideGroups=this.aHideGroups.length>0?this.aHideGroups.toString():null;H.refreshLayers=this.aRefreshLayers.length>0?this.aRefreshLayers.toString():null;if(E==5){H.selectioncolor=this.selectionColor;H.format=this.selectionFormat}if(F){D.isBaseLayer=false}}else{H={mapdefinition:this._sResourceId,basemaplayergroupname:this.groupName,session:this.getSessionID(),clientagent:this.clientAgent}}if(H.format&&H.format.toLowerCase().indexOf("png")>=0){D.alpha=true}var B;if(!G&&D.useHttpTile){B=Fusion.getConfigurationItem("mapguide","tileCacheUrl")}else{B=Fusion.getConfigurationItem("mapguide","mapAgentUrl")}var A=new OpenLayers.Layer.MapGuide(C,B,H,D);return A},getLayerByName:function(B){var A=null;for(var C=0;C<this.aLayers.length;C++){if(this.aLayers[C].layerName==B){A=this.aLayers[C];break}}return A},getLayerById:function(C){var A=null;for(var B=0;B<this.aLayers.length;B++){if(this.aLayers[B].uniqueId==C){A=this.aLayers[B];break}}return A},getSelectionCB:function(userFunc,r){if(r.status==200){var o;eval("o="+r.responseText);var oSelection=new Fusion.SelectionObject(o);userFunc(oSelection)}},newSelection:function(){if(this.oSelection){this.oSelection=null}this.bSelectionOn=true;this.triggerEvent(Fusion.Event.MAP_SELECTION_ON)},getSelectedFeatureCount:function(){var B=0;for(var A=0;A<this.aLayers.length;++A){B+=this.aLayers[A].selectedFeatureCount}return B},getSelectedLayers:function(){var B=[];for(var A=0;A<this.aLayers.length;++A){if(this.aLayers[A].selectedFeatureCount>0){B.push(this.aLayers[A])}}return B},getSelectableLayers:function(){var B=[];for(var A=0;A<this.aLayers.length;++A){if(this.aLayers[A].selectable){B.push(this.aLayers[A])}}return B},setSelection:function(B,A){if(B!=""&&B!=null){this.updateSelection(B,A,false)}else{this.clearSelection()}},updateSelection:function(C,B,A){this.updateMapSelection(C,B);this.getSelectedFeatureProperties(C)},getSelectedFeatureProperties:function(E){this.mapWidget._addWorker();var A=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+A+"/GetSelectionProperties."+A;var D={mapname:this.getMapName(),session:this.getSessionID(),selection:E,seq:Math.random()};var B={onSuccess:OpenLayers.Function.bind(this.processSelectedFeatureProperties,this),parameters:D};Fusion.ajaxRequest(C,B)},updateMapSelection:function(F,E){this.mapWidget._addWorker();var A=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+A+"/SaveSelection."+A;var D={mapname:this.getMapName(),session:this.getSessionID(),selection:F,seq:Math.random(),getextents:E?"true":"false"};var B={onSuccess:OpenLayers.Function.bind(this.renderSelection,this,E),parameters:D};Fusion.ajaxRequest(C,B)},getSelection:function(E,D,C){if(E){var B="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/Selection."+Fusion.getScriptLanguage();var A={parameters:{session:this.getSessionID(),mapname:this._sMapname,layers:D,startcount:C},onSuccess:OpenLayers.Function.bind(this.getSelectionCB,this,E)};Fusion.ajaxRequest(B,A)}},selectionCleared:function(){for(var A=0;A<this.aLayers.length;++A){this.aLayers[A].selectedFeatureCount=0}this.bSelectionOn=false;if(this.queryLayer){this.queryLayer.setVisibility(false)}this.triggerEvent(Fusion.Event.MAP_SELECTION_OFF);this.drawMap();this.oSelection=null},clearSelection:function(){if(this.hasSelection()){var B="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/ClearSelection."+Fusion.getScriptLanguage();var A={parameters:{session:this.getSessionID(),mapname:this._sMapname},onSuccess:OpenLayers.Function.bind(this.selectionCleared,this)};Fusion.ajaxRequest(B,A)}if(this.previousSelection!=null){this.previousSelection.clear()}},removeQueryLayer:function(){if(this.queryLayer){this.queryLayer.destroy();this.queryLayer=null}},processQueryResults:function(B,A){this.renderSelection(B,A);this.processSelectedFeatureProperties(A)},processSelectedFeatureProperties:function(r){this.mapWidget._removeWorker();if(r.responseText){var oNode;eval("oNode="+r.responseText);if(oNode.hasSelection){this.newSelection()}else{this.clearSelection();return }}},renderSelection:function(zoomTo,r){this.mapWidget._removeWorker();if(r.responseText){var oNode;eval("oNode="+r.responseText);if(oNode.hasSelection){if(this.selectionAsOverlay){if(!this.queryLayer){this.queryLayer=this.createOLLayer("query layer",true,5,true);this.mapWidget.oMapOL.addLayer(this.queryLayer);this.mapWidget.registerForEvent(Fusion.Event.MAP_LOADING,OpenLayers.Function.bind(this.removeQueryLayer,this))}else{this.queryLayer.setVisibility(true)}}for(var j=0;j<this.aLayers.length;++j){this.aLayers[j].selectedFeatureCount=0}for(var i=0;i<oNode.layers.length;++i){var layerName=oNode.layers[i];for(var j=0;j<this.aLayers.length;++j){if(layerName==this.aLayers[j].layerName){this.aLayers[j].selectedFeatureCount=oNode[layerName].featureCount}}}if(zoomTo){var ext=oNode.extents;var extents=new OpenLayers.Bounds(ext.minx,ext.miny,ext.maxx,ext.maxy);this.mapWidget.setExtents(extents)}this.drawSelection()}else{this.clearSelection();return }}},query:function(C){this.mapWidget._addWorker();for(var B=0;B<this.aLayers.length;++B){this.aLayers[B].selectedFeatureCount=0}var E=1;var F=3;var A=C.maxFeatures;if(A==null||A==0){A=-1}var D=new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),this._sMapname,C.geometry,A,E,C.selectionType||this.selectionType,C.layers,F);var G=(C.extendSelection==true)?OpenLayers.Function.bind(this.processAndMergeFeatureInfo,this):OpenLayers.Function.bind(this.processFeatureInfo,this);Fusion.oBroker.dispatchRequest(D,OpenLayers.Function.bind(Fusion.xml2json,this,G))},showLayer:function(A,B){this.processLayerEvents(A,true);this.aShowLayers.push(A.uniqueId);if(!B){this.drawMap()}},hideLayer:function(A,B){this.processLayerEvents(A,false);this.aHideLayers.push(A.uniqueId);if(!B){this.drawMap()}},showGroup:function(B,A){this.processGroupEvents(B,true);if(B.groupName=="layerRoot"){this.oLayerOL.setVisibility(true);this.oLayerOL2.setVisibility(true)}else{if(B.isBaseMapGroup){this.oLayerOL.setVisibility(true)}else{this.aShowGroups.push(B.uniqueId);if(!A){this.drawMap()}}}},hideGroup:function(B,A){this.processGroupEvents(B,false);if(B.groupName=="layerRoot"){this.oLayerOL.setVisibility(false);this.oLayerOL2.setVisibility(false)}else{if(B.isBaseMapGroup){this.oLayerOL.setVisibility(false)}else{this.aHideGroups.push(B.uniqueId);if(!A){this.drawMap()}}}},refreshLayer:function(A){this.aRefreshLayers.push(A.uniqueId);this.drawMap()},mouseUpCRTLClick:function(K){if(K.ctrlKey){var D=this.mapWidget.pixToGeo(K.xy.x-this.nTolerance,K.xy.y-this.nTolerance);var I=this.mapWidget.pixToGeo(K.xy.x+this.nTolerance,K.xy.y+this.nTolerance);if(!D){return }var F="POLYGON(("+D.x+" "+D.y+", "+D.x+" "+I.y+", "+I.x+" "+I.y+", "+I.x+" "+D.y+", "+D.x+" "+D.y+"))";var B=1;var G=0;var J="INTERSECTS";var H="";var C=3;var M="";for(var E=0;E<this.aLayers.length;++E){H+=M+this.aLayers[E].layerName;M=","}var A=new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.mapWidget.getSessionID(),this._sMapname,F,B,G,J,H,C);var L=OpenLayers.Function.bind(this.crtlClickDisplay,this);Fusion.oBroker.dispatchRequest(A,OpenLayers.Function.bind(Fusion.xml2json,this,L))}},crtlClickDisplay:function(xhr){if(xhr.status==200){var o;eval("o="+xhr.responseText);var h=o.FeatureInformation["Hyperlink"];if(h){window.open(h[0],"")}}},mapExtentsChanged:function(){if(!this.singleTile){var A=this.mapWidget.oMapOL.getCenter();var C=this.mapWidget.oMapOL.getSize();var B=new Fusion.Lib.MGRequest.MGGetVisibleMapExtent(this.mapWidget.getSessionID(),this._sMapname,A.lon,A.lat,this.mapWidget.oMapOL.getScale(),null,this._nDpi,C.w,C.h);Fusion.oBroker.dispatchRequest(B)}},pingServer:function(){var A="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/Common."+Fusion.getScriptLanguage();var B={};B.parameters={session:this.getSessionID()};Fusion.ajaxRequest(A,B)},getLinkParams:function(){var E={};E.theme=this.sMapResourceId;var D=[];var C=[];for(var B=0;B<this.aLayers.length;++B){var A=this.aLayers[B];if(A.visible&&!A.initiallyVisible){D.push(A.layerName)}if(!A.visible&&A.initiallyVisible){C.push(A.layerName)}}E.showlayers=D.join(",");E.hidelayers=C.join(",");var H=[];var F=[];for(var B=0;B<this.layerRoot.groups.length;++B){var G=this.layerRoot.groups[B];if(G.visible&&!G.initiallyVisible){H.push(G.groupName)}if(!G.visible&&G.initiallyVisible){F.push(G.groupName)}}E.showgroups=H.join(",");E.hidegroups=F.join(",");return E},getMapTip:function(B){var H=Fusion.oBroker;var L=B.oCurrentPosition.x;var J=B.oCurrentPosition.y;var E=this.mapWidget.pixToGeo(L-B.nTolerance,J-B.nTolerance);var K=this.mapWidget.pixToGeo(L+B.nTolerance,J+B.nTolerance);if(!E){return }var F="POLYGON(("+E.x+" "+E.y+", "+E.x+" "+K.y+", "+K.x+" "+K.y+", "+K.x+" "+E.y+", "+E.x+" "+E.y+"))";var C=1;var G=0;var M="INTERSECTS";var D=5;var I=B.aLayers.toString();var A=new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),this._sMapname,F,C,G,M,I,D);H.dispatchRequest(A,OpenLayers.Function.bind(Fusion.xml2json,this,OpenLayers.Function.bind(this.parseMapTip,this)))},parseMapTip:function(xhr){var o;eval("tooltip="+xhr.responseText);this.oMaptip={t:"",h:""};var t=tooltip.FeatureInformation["Tooltip"];if(t){this.oMaptip.t=t[0].replace(/\\n/g,"<br>")}var h=tooltip.FeatureInformation["Hyperlink"];if(h){this.oMaptip.h=h[0]}this.mapWidget.triggerEvent(Fusion.Event.MAP_MAPTIP_REQ_FINISHED,this.oMaptip)},getLegendImageURL:function(B,C,D,E){if(C.layerTypes[0]==4){return E}else{var A=Fusion.getConfigurationItem("mapguide","mapAgentUrl");A+="?OPERATION=GETLEGENDIMAGE&SESSION="+C.oMap.getSessionID();A+="&VERSION=1.0.0&SCALE="+B;A+="&LAYERDEFINITION="+encodeURIComponent(C.resourceId);A+="&THEMECATEGORY="+D.categoryIndex;A+="&TYPE="+D.geometryType;A+="&CLIENTAGENT="+encodeURIComponent(this.clientAgent);if(this.noCache){A+="&TS="+(new Date()).getTime()}return A}},processAndMergeFeatureInfo:function(A){this.processSelectedFeatureInfo(A,true)},processFeatureInfo:function(A){this.processSelectedFeatureInfo(A,false)},processSelectedFeatureInfo:function(r,mergeSelection){eval("o="+r.responseText);var newSelection=new Fusion.SimpleSelectionObject(o);if(mergeSelection==true){newSelection.merge(this.previousSelection)}this.previousSelection=newSelection;var selText=newSelection.getSelectionXml();this.setSelection(selText,false);this.mapWidget._removeWorker()}});Fusion.SimpleSelectionObject=OpenLayers.Class({aLayers:null,nLayers:0,initialize:function(F){this.aLayers=[];this.nLayers=0;try{var D=F.FeatureInformation.FeatureSet[0].Layer;if(D!=null){for(var E=0;E<D.length;E++){var C=o.FeatureInformation["FeatureSet"][0]["Layer"][E]["@id"][0];var J=o.FeatureInformation["FeatureSet"][0]["Layer"][E]["Class"][0];var I=o.FeatureInformation["FeatureSet"][0]["Layer"][E]["Class"][0]["@id"][0];var G=new Fusion.SimpleSelectionObject.Layer(C,I);this.addLayer(G);var A=J.ID;for(var B=0;B<A.length;B++){G.addFeature(A[B])}}}}catch(H){}},addLayer:function(A){this.aLayers[this.nLayers]=A;this.nLayers++},getNumLayers:function(){return this.nLayers},getLayerByName:function(B){var A=null;for(var C=0;C<this.nLayers;C++){if(this.aLayers[C].getName()==B){A=this.aLayers[C];break}}return A},getLayer:function(A){if(A>=0&&A<this.nLayers){return this.aLayers[A]}else{return null}},getSelectionXml:function(){var D="";if(this.nLayers>0){D='<?xml version="1.0" encoding="UTF-8"?>\n<FeatureSet>\n';for(var C=0;C<this.nLayers;C++){var B=this.aLayers[C];D+='<Layer id="'+B.getName()+'">\n';D+='<Class id="'+B.getClassName()+'">\n';for(var A=0;A<B.getNumFeatures();A++){var E=B.featIds[A];D+="<ID>"+E+"</ID>\n"}D+="</Class>\n</Layer>\n"}D+="</FeatureSet>\n"}return D},merge:function(B){if(B!=null&&B.nLayers>0){for(var H=0;H<B.nLayers;H++){var A=B.aLayers[H];var D=this.getLayerByName(A.getName());if(D!=null){for(var E=0;E<A.getNumFeatures();E++){var G=D.featIds.find(A.featIds[E]);if(G==null){D.addFeature(A.featIds[E])}else{D.removeFeatures(G)}}if(D.featIds.length==0){this.clear()}}else{var F=new Fusion.SimpleSelectionObject.Layer(A.getName(),A.getClassName());for(var C=0;C<A.getNumFeatures();C++){F.addFeature(A.featIds[C])}this.addLayer(F)}}}},clear:function(){this.aLayers=[];this.nLayers=0}});Fusion.SimpleSelectionObject.Layer=OpenLayers.Class({name:"",className:"",featIds:null,nFeatures:0,initialize:function(A,B){this.name=A;this.className=B;this.nFeatures=0;this.featIds=[]},addFeature:function(A){this.featIds[this.nFeatures]=A;this.nFeatures++},getName:function(){return this.name},getClassName:function(){return this.className},getNumFeatures:function(){return this.nFeatures},removeFeatures:function(A){var B=A.length;for(var C=0;C<B;C++){this.featIds.remove(A[C]);this.nFeatures--}}});Array.prototype.find=function(A){var B=null;for(i=0;i<this.length;i++){if(typeof (A)=="function"){if(A.test(this[i])){if(!B){B=[]}B.push(i)}}else{if(this[i]===A){if(!B){B=[]}B.push(i)}}}return B};Array.prototype.remove=function(A){this.splice(A,1)};