var Fusion={singleFile:true};var Jx={};Object.inheritFrom=function(B,E,C){var D;if(typeof E=="function"){D=E.prototype}else{D=E}for(property in D){if(typeof B[property]=="undefined"){B[property]=D[property]}}if(D.initialize){D.initialize.apply(B,C)}};(function(){var singleFile=(typeof Fusion=="object"&&Fusion.singleFile);window.Fusion={Tool:{},Widget:{},Event:{lastEventId:1},Lib:{},Layers:{},Constant:{},applicationDefinition:null,sRedirectScript:"",bForceRedirect:false,sScriptLang:"php",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();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"}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=[];var loadingScriptsTemp=[];for(var i=0;i<this.aLoadingScripts.length;i++){loadingScriptsTemp[i]=this.aLoadingScripts[i]}for(var i=0;i<loadingScriptsTemp.length;i++){document.getElementsByTagName("head")[0].appendChild(loadingScriptsTemp[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(){if(this.aLoadingScripts.length==0){window.clearInterval(this.checkLoadInterval);return }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;OpenLayers.INCHES_PER_UNIT.Degree=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;var idx=s.indexOf("locale=");if(idx>0){var temp=s.substring(idx+7);var idx2=temp.indexOf("&");locale=temp.substring(0,idx2<0?temp.length:idx2)}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","lib/MapMessage.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)){var passedSessionId=Fusion.getQueryParam("Session");if(passedSessionId==null||passedSessionId==""){createSessionId()}else{Fusion.sessionId=passedSessionId}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];var osmElement=appDefXML.getElementsByTagName("OpenStreetMapScript")[0];addElement(googleElement);addElement(yahooElement);addElement(veElement);addElement(osmElement)}}})();Proj4js={defaultDatum:"WGS84",transform:function(E,C,B){if(!E.readyToUse){this.reportError("Proj4js initialization for:"+E.srsCode+" not yet complete");return B}if(!C.readyToUse){this.reportError("Proj4js initialization for:"+C.srsCode+" not yet complete");return B}if((E.srsProjNumber=="900913"&&C.datumCode!="WGS84")||(C.srsProjNumber=="900913"&&E.datumCode!="WGS84")){var D=Proj4js.WGS84;this.transform(E,D,B);E=D}if(E.projName=="longlat"){B.x*=Proj4js.common.D2R;B.y*=Proj4js.common.D2R}else{if(E.to_meter){B.x*=E.to_meter;B.y*=E.to_meter}E.inverse(B)}if(E.from_greenwich){B.x+=E.from_greenwich}B=this.datum_transform(E.datum,C.datum,B);if(C.from_greenwich){B.x-=C.from_greenwich}if(C.projName=="longlat"){B.x*=Proj4js.common.R2D;B.y*=Proj4js.common.R2D}else{C.forward(B);if(C.to_meter){B.x/=C.to_meter;B.y/=C.to_meter}}return B},datum_transform:function(D,C,B){if(D.compare_datums(C)){return B}if(D.datum_type==Proj4js.common.PJD_NODATUM||C.datum_type==Proj4js.common.PJD_NODATUM){return B}if(D.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}if(C.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}if(D.es!=C.es||D.a!=C.a||D.datum_type==Proj4js.common.PJD_3PARAM||D.datum_type==Proj4js.common.PJD_7PARAM||C.datum_type==Proj4js.common.PJD_3PARAM||C.datum_type==Proj4js.common.PJD_7PARAM){D.geodetic_to_geocentric(B);if(D.datum_type==Proj4js.common.PJD_3PARAM||D.datum_type==Proj4js.common.PJD_7PARAM){D.geocentric_to_wgs84(B)}if(C.datum_type==Proj4js.common.PJD_3PARAM||C.datum_type==Proj4js.common.PJD_7PARAM){C.geocentric_from_wgs84(B)}C.geocentric_to_geodetic(B)}if(C.datum_type==Proj4js.common.PJD_GRIDSHIFT){alert("ERROR: Grid shift transformations are not implemented yet.")}return B},reportError:function(B){},extend:function(B,E){B=B||{};if(E){for(var D in E){var C=E[D];if(C!==undefined){B[D]=C}}}return B},Class:function(){var C=function(){this.initialize.apply(this,arguments)};var B={};var E;for(var D=0;D<arguments.length;++D){if(typeof arguments[D]=="function"){E=arguments[D].prototype}else{E=arguments[D]}Proj4js.extend(B,E)}C.prototype=B;return C},bind:function(D,C){var B=Array.prototype.slice.apply(arguments,[2]);return function(){var E=B.concat(Array.prototype.slice.apply(arguments,[0]));return D.apply(C,E)}},scriptName:"proj4js-compressed.js",defsLookupService:"http://spatialreference.org/ref",libPath:null,getScriptLocation:function(){if(this.libPath){return this.libPath}var F=this.scriptName;var E=F.length;var B=document.getElementsByTagName("script");for(var D=0;D<B.length;D++){var G=B[D].getAttribute("src");if(G){var C=G.lastIndexOf(F);if((C>-1)&&(C+E==G.length)){this.libPath=G.slice(0,-E);break}}}return this.libPath||""},loadScript:function(E,F,D,B){var C=document.createElement("script");C.defer=false;C.type="text/javascript";C.id=E;C.src=E;C.onload=F;C.onerror=D;C.loadCheck=B;if(/MSIE/.test(navigator.userAgent)){C.onreadystatechange=this.checkReadyState}document.getElementsByTagName("head")[0].appendChild(C)},checkReadyState:function(){if(this.readyState=="loaded"){if(!this.loadCheck()){this.onerror()}else{this.onload()}}}};Proj4js.Proj=Proj4js.Class({readyToUse:false,title:null,projName:null,units:null,datum:null,x0:0,y0:0,localCS:false,initialize:function(D){this.srsCodeInput=D;if((D.indexOf("GEOGCS")>=0)||(D.indexOf("GEOCCS")>=0)||(D.indexOf("PROJCS")>=0)||(D.indexOf("LOCAL_CS")>=0)){this.parseWKT(D);this.deriveConstants();this.loadProjCode(this.projName);return }if(D.indexOf("urn:")==0){var B=D.split(":");if((B[1]=="ogc"||B[1]=="x-ogc")&&(B[2]=="def")&&(B[3]=="crs")){D=B[4]+":"+B[B.length-1]}}else{if(D.indexOf("http://")==0){var C=D.split("#");if(C[0].match(/epsg.org/)){D="EPSG:"+C[1]}else{if(C[0].match(/RIG.xml/)){D="IGNF:"+C[1]}}}}this.srsCode=D.toUpperCase();if(this.srsCode.indexOf("EPSG")==0){this.srsCode=this.srsCode;this.srsAuth="epsg";this.srsProjNumber=this.srsCode.substring(5)}else{if(this.srsCode.indexOf("IGNF")==0){this.srsCode=this.srsCode;this.srsAuth="IGNF";this.srsProjNumber=this.srsCode.substring(5)}else{if(this.srsCode.indexOf("CRS")==0){this.srsCode=this.srsCode;this.srsAuth="CRS";this.srsProjNumber=this.srsCode.substring(4)}else{this.srsAuth="";this.srsProjNumber=this.srsCode}}}this.loadProjDefinition()},loadProjDefinition:function(){if(Proj4js.defs[this.srsCode]){this.defsLoaded();return }var B=Proj4js.getScriptLocation()+"defs/"+this.srsAuth.toUpperCase()+this.srsProjNumber+".js";Proj4js.loadScript(B,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.loadFromService,this),Proj4js.bind(this.checkDefsLoaded,this))},loadFromService:function(){var B=Proj4js.defsLookupService+"/"+this.srsAuth+"/"+this.srsProjNumber+"/proj4js/";Proj4js.loadScript(B,Proj4js.bind(this.defsLoaded,this),Proj4js.bind(this.defsFailed,this),Proj4js.bind(this.checkDefsLoaded,this))},defsLoaded:function(){this.parseDefs();this.loadProjCode(this.projName)},checkDefsLoaded:function(){if(Proj4js.defs[this.srsCode]){return true}else{return false}},defsFailed:function(){Proj4js.reportError("failed to load projection definition for: "+this.srsCode);Proj4js.defs[this.srsCode]=Proj4js.defs.WGS84;this.defsLoaded()},loadProjCode:function(C){if(Proj4js.Proj[C]){this.initTransforms();return }var B=Proj4js.getScriptLocation()+"projCode/"+C+".js";Proj4js.loadScript(B,Proj4js.bind(this.loadProjCodeSuccess,this,C),Proj4js.bind(this.loadProjCodeFailure,this,C),Proj4js.bind(this.checkCodeLoaded,this,C))},loadProjCodeSuccess:function(B){if(Proj4js.Proj[B].dependsOn){this.loadProjCode(Proj4js.Proj[B].dependsOn)}else{this.initTransforms()}},loadProjCodeFailure:function(B){Proj4js.reportError("failed to find projection file for: "+B)},checkCodeLoaded:function(B){if(Proj4js.Proj[B]){return true}else{return false}},initTransforms:function(){Proj4js.extend(this,Proj4js.Proj[this.projName]);this.init();this.readyToUse=true},wktRE:/^(\w+)\[(.*)\]$/,parseWKT:function(J){var I=J.match(this.wktRE);if(!I){return }var L=I[1];var K=I[2];var H=K.split(",");var N=H.shift();N=N.replace(/^\"/,"");N=N.replace(/\"$/,"");var M=new Array();var C=0;var G="";for(var F=0;F<H.length;++F){var D=H[F];for(var E=0;E<D.length;++E){if(D.charAt(E)=="["){++C}if(D.charAt(E)=="]"){--C}}G+=D;if(C===0){M.push(G);G=""}else{G+=","}}switch(L){case"LOCAL_CS":this.projName="identity";this.localCS=true;this.srsCode=N;break;case"GEOGCS":this.projName="longlat";this.geocsCode=N;if(!this.srsCode){this.srsCode=N}break;case"PROJCS":this.srsCode=N;break;case"GEOCCS":break;case"PROJECTION":this.projName=Proj4js.wktProjections[N];break;case"DATUM":this.datumName=N;break;case"LOCAL_DATUM":this.datumCode="none";break;case"SPHEROID":this.ellps=N;this.a=parseFloat(M.shift());this.rf=parseFloat(M.shift());break;case"PRIMEM":this.from_greenwich=parseFloat(M.shift());break;case"UNIT":this.units=N;this.unitsPerMeter=parseFloat(M.shift());break;case"PARAMETER":var B=N.toLowerCase();var O=parseFloat(M.shift());switch(B){case"false_easting":this.x0=O;break;case"false_northing":this.y0=O;break;case"scale_factor":this.k0=O;break;case"central_meridian":this.long0=O*Proj4js.common.D2R;break;case"latitude_of_origin":this.lat0=O*Proj4js.common.D2R;break;case"more_here":break;default:break}break;case"TOWGS84":this.datum_params=M;break;case"MORE_HERE":break;default:break}for(var F=0;F<M.length;++F){this.parseWKT(M[F])}},parseDefs:function(){this.defData=Proj4js.defs[this.srsCode];var E,C;if(!this.defData){return }var B=this.defData.split("+");for(var F=0;F<B.length;F++){var D=B[F].split("=");E=D[0].toLowerCase();C=D[1];switch(E.replace(/\s/gi,"")){case"":break;case"title":this.title=C;break;case"proj":this.projName=C.replace(/\s/gi,"");break;case"units":this.units=C.replace(/\s/gi,"");break;case"datum":this.datumCode=C.replace(/\s/gi,"");break;case"nadgrids":this.nagrids=C.replace(/\s/gi,"");break;case"ellps":this.ellps=C.replace(/\s/gi,"");break;case"a":this.a=parseFloat(C);break;case"b":this.b=parseFloat(C);break;case"rf":this.rf=parseFloat(C);break;case"lat_0":this.lat0=C*Proj4js.common.D2R;break;case"lat_1":this.lat1=C*Proj4js.common.D2R;break;case"lat_2":this.lat2=C*Proj4js.common.D2R;break;case"lat_ts":this.lat_ts=C*Proj4js.common.D2R;break;case"lon_0":this.long0=C*Proj4js.common.D2R;break;case"alpha":this.alpha=parseFloat(C)*Proj4js.common.D2R;break;case"lonc":this.longc=C*Proj4js.common.D2R;break;case"x_0":this.x0=parseFloat(C);break;case"y_0":this.y0=parseFloat(C);break;case"k_0":this.k0=parseFloat(C);break;case"k":this.k0=parseFloat(C);break;case"r_a":this.R_A=true;break;case"zone":this.zone=parseInt(C);break;case"south":this.utmSouth=true;break;case"towgs84":this.datum_params=C.split(",");break;case"to_meter":this.to_meter=parseFloat(C);break;case"from_greenwich":this.from_greenwich=C*Proj4js.common.D2R;break;case"pm":C=C.replace(/\s/gi,"");this.from_greenwich=Proj4js.PrimeMeridian[C]?Proj4js.PrimeMeridian[C]:parseFloat(C);this.from_greenwich*=Proj4js.common.D2R;break;case"no_defs":break;default:}}this.deriveConstants()},deriveConstants:function(){if(this.nagrids=="@null"){this.datumCode="none"}if(this.datumCode&&this.datumCode!="none"){var B=Proj4js.Datum[this.datumCode];if(B){this.datum_params=B.towgs84?B.towgs84.split(","):null;this.ellps=B.ellipse;this.datumName=B.datumName?B.datumName:this.datumCode}}if(!this.a){var C=Proj4js.Ellipsoid[this.ellps]?Proj4js.Ellipsoid[this.ellps]:Proj4js.Ellipsoid.WGS84;Proj4js.extend(this,C)}if(this.rf&&!this.b){this.b=(1-1/this.rf)*this.a}if(Math.abs(this.a-this.b)<Proj4js.common.EPSLN){this.sphere=true;this.b=this.a}this.a2=this.a*this.a;this.b2=this.b*this.b;this.es=(this.a2-this.b2)/this.a2;this.e=Math.sqrt(this.es);if(this.R_A){this.a*=1-this.es*(Proj4js.common.SIXTH+this.es*(Proj4js.common.RA4+this.es*Proj4js.common.RA6));this.a2=this.a*this.a;this.b2=this.b*this.b;this.es=0}this.ep2=(this.a2-this.b2)/this.b2;if(!this.k0){this.k0=1}this.datum=new Proj4js.datum(this)}});Proj4js.Proj.longlat={init:function(){},forward:function(B){return B},inverse:function(B){return B}};Proj4js.Proj.identity=Proj4js.Proj.longlat;Proj4js.defs={WGS84:"+title=long/lat:WGS84 +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees","EPSG:4326":"+title=long/lat:WGS84 +proj=longlat +a=6378137.0 +b=6356752.31424518 +ellps=WGS84 +datum=WGS84 +units=degrees","EPSG:4269":"+title=long/lat:NAD83 +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees","EPSG:3785":"+title= Google Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"};Proj4js.defs.GOOGLE=Proj4js.defs["EPSG:3785"];Proj4js.defs["EPSG:900913"]=Proj4js.defs["EPSG:3785"];Proj4js.defs["EPSG:102113"]=Proj4js.defs["EPSG:3785"];Proj4js.common={PI:3.141592653589793,HALF_PI:1.5707963267948966,TWO_PI:6.283185307179586,FORTPI:0.7853981633974483,R2D:57.29577951308232,D2R:0.017453292519943295,SEC_TO_RAD:0.00000484813681109536,EPSLN:1e-10,MAX_ITER:20,COS_67P5:0.3826834323650898,AD_C:1.0026,PJD_UNKNOWN:0,PJD_3PARAM:1,PJD_7PARAM:2,PJD_GRIDSHIFT:3,PJD_WGS84:4,PJD_NODATUM:5,SRS_WGS84_SEMIMAJOR:6378137,SIXTH:0.16666666666666666,RA4:0.04722222222222222,RA6:0.022156084656084655,RV4:0.06944444444444445,RV6:0.04243827160493827,msfnz:function(D,C,E){var B=D*C;return E/(Math.sqrt(1-B*B))},tsfnz:function(F,E,D){var B=F*D;var C=0.5*F;B=Math.pow(((1-B)/(1+B)),C);return(Math.tan(0.5*(this.HALF_PI-E))/B)},phi2z:function(H,G){var F=0.5*H;var B,C;var E=this.HALF_PI-2*Math.atan(G);for(var D=0;D<=15;D++){B=H*Math.sin(E);C=this.HALF_PI-2*Math.atan(G*(Math.pow(((1-B)/(1+B)),F)))-E;E+=C;if(Math.abs(C)<=1e-10){return E}}alert("phi2z has NoConvergence");return(-9999)},qsfnz:function(D,C){var B;if(D>1e-7){B=D*C;return((1-D*D)*(C/(1-B*B)-(0.5/D)*Math.log((1-B)/(1+B))))}else{return(2*C)}},asinz:function(B){if(Math.abs(B)>1){B=(B>1)?1:-1}return Math.asin(B)},e0fn:function(B){return(1-0.25*B*(1+B/16*(3+1.25*B)))},e1fn:function(B){return(0.375*B*(1+0.25*B*(1+0.46875*B)))},e2fn:function(B){return(0.05859375*B*B*(1+0.75*B))},e3fn:function(B){return(B*B*B*(35/3072))},mlfn:function(F,E,D,C,B){return(F*B-E*Math.sin(2*B)+D*Math.sin(4*B)-C*Math.sin(6*B))},srat:function(B,C){return(Math.pow((1-B)/(1+B),C))},sign:function(B){if(B<0){return(-1)}else{return(1)}},adjust_lon:function(B){B=(Math.abs(B)<this.PI)?B:(B-(this.sign(B)*this.TWO_PI));return B},adjust_lat:function(B){B=(Math.abs(B)<this.HALF_PI)?B:(B-(this.sign(B)*this.PI));return B},latiso:function(E,D,C){if(Math.abs(D)>this.HALF_PI){return +Number.NaN}if(D==this.HALF_PI){return Number.POSITIVE_INFINITY}if(D==-1*this.HALF_PI){return -1*Number.POSITIVE_INFINITY}var B=E*C;return Math.log(Math.tan((this.HALF_PI+D)/2))+E*Math.log((1-B)/(1+B))/2},fL:function(C,B){return 2*Math.atan(C*Math.exp(B))-this.HALF_PI},invlatiso:function(F,D){var C=this.fL(1,D);var E=0;var B=0;do{E=C;B=F*Math.sin(E);C=this.fL(Math.exp(F*Math.log((1+B)/(1-B))/2),D)}while(Math.abs(C-E)>1e-12);return C},sinh:function(B){var C=Math.exp(B);C=(C-1/C)/2;return C},cosh:function(B){var C=Math.exp(B);C=(C+1/C)/2;return C},tanh:function(B){var C=Math.exp(B);C=(C-1/C)/(C+1/C);return C},asinh:function(B){var C=(B>=0?1:-1);return C*(Math.log(Math.abs(B)+Math.sqrt(B*B+1)))},acosh:function(B){return 2*Math.log(Math.sqrt((B+1)/2)+Math.sqrt((B-1)/2))},atanh:function(B){return Math.log((B-1)/(B+1))/2},gN:function(B,E,D){var C=E*D;return B/Math.sqrt(1-C*C)}};Proj4js.datum=Proj4js.Class({initialize:function(C){this.datum_type=Proj4js.common.PJD_WGS84;if(C.datumCode&&C.datumCode=="none"){this.datum_type=Proj4js.common.PJD_NODATUM}if(C&&C.datum_params){for(var B=0;B<C.datum_params.length;B++){C.datum_params[B]=parseFloat(C.datum_params[B])}if(C.datum_params[0]!=0||C.datum_params[1]!=0||C.datum_params[2]!=0){this.datum_type=Proj4js.common.PJD_3PARAM}if(C.datum_params.length>3){if(C.datum_params[3]!=0||C.datum_params[4]!=0||C.datum_params[5]!=0||C.datum_params[6]!=0){this.datum_type=Proj4js.common.PJD_7PARAM;C.datum_params[3]*=Proj4js.common.SEC_TO_RAD;C.datum_params[4]*=Proj4js.common.SEC_TO_RAD;C.datum_params[5]*=Proj4js.common.SEC_TO_RAD;C.datum_params[6]=(C.datum_params[6]/1000000)+1}}}if(C){this.a=C.a;this.b=C.b;this.es=C.es;this.ep2=C.ep2;this.datum_params=C.datum_params}},compare_datums:function(B){if(this.datum_type!=B.datum_type){return false}else{if(this.a!=B.a||Math.abs(this.es-B.es)>5e-11){return false}else{if(this.datum_type==Proj4js.common.PJD_3PARAM){return(this.datum_params[0]==B.datum_params[0]&&this.datum_params[1]==B.datum_params[1]&&this.datum_params[2]==B.datum_params[2])}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){return(this.datum_params[0]==B.datum_params[0]&&this.datum_params[1]==B.datum_params[1]&&this.datum_params[2]==B.datum_params[2]&&this.datum_params[3]==B.datum_params[3]&&this.datum_params[4]==B.datum_params[4]&&this.datum_params[5]==B.datum_params[5]&&this.datum_params[6]==B.datum_params[6])}else{if(this.datum_type==Proj4js.common.PJD_GRIDSHIFT){return strcmp(pj_param(this.params,"snadgrids").s,pj_param(B.params,"snadgrids").s)==0}else{return true}}}}}},geodetic_to_geocentric:function(D){var M=D.x;var I=D.y;var E=D.z?D.z:0;var F;var C;var B;var K=0;var L;var J;var H;var G;if(I<-Proj4js.common.HALF_PI&&I>-1.001*Proj4js.common.HALF_PI){I=-Proj4js.common.HALF_PI}else{if(I>Proj4js.common.HALF_PI&&I<1.001*Proj4js.common.HALF_PI){I=Proj4js.common.HALF_PI}else{if((I<-Proj4js.common.HALF_PI)||(I>Proj4js.common.HALF_PI)){Proj4js.reportError("geocent:lat out of range:"+I);return null}}}if(M>Proj4js.common.PI){M-=(2*Proj4js.common.PI)}J=Math.sin(I);G=Math.cos(I);H=J*J;L=this.a/(Math.sqrt(1-this.es*H));F=(L+E)*G*Math.cos(M);C=(L+E)*G*Math.sin(M);B=((L*(1-this.es))+E)*J;D.x=F;D.y=C;D.z=B;return K},geocentric_to_geodetic:function(U){var d=1e-12;var V=(d*d);var G=30;var M;var I;var B;var O;var C;var N;var L;var b;var a;var K;var S;var R;var F;var W;var H=U.x;var E=U.y;var D=U.z?U.z:0;var J;var T;var Q;F=false;M=Math.sqrt(H*H+E*E);I=Math.sqrt(H*H+E*E+D*D);if(M/this.a<d){F=true;J=0;if(I/this.a<d){T=Proj4js.common.HALF_PI;Q=-this.b;return }}else{J=Math.atan2(E,H)}B=D/I;O=M/I;C=1/Math.sqrt(1-this.es*(2-this.es)*O*O);b=O*(1-this.es)*C;a=B*C;W=0;do{W++;L=this.a/Math.sqrt(1-this.es*a*a);Q=M*b+D*a-L*(1-this.es*a*a);N=this.es*L/(L+Q);C=1/Math.sqrt(1-N*(2-N)*O*O);K=O*(1-N)*C;S=B*C;R=S*b-K*a;b=K;a=S}while(R*R>V&&W<G);T=Math.atan(S/Math.abs(K));U.x=J;U.y=T;U.z=Q;return U},geocentric_to_geodetic_noniter:function(S){var E=S.x;var D=S.y;var B=S.z?S.z:0;var H;var R;var M;var F;var O;var Q;var N;var K;var I;var J;var V;var G;var U;var T;var P;var L;var C;E=parseFloat(E);D=parseFloat(D);B=parseFloat(B);C=false;if(E!=0){H=Math.atan2(D,E)}else{if(D>0){H=Proj4js.common.HALF_PI}else{if(D<0){H=-Proj4js.common.HALF_PI}else{C=true;H=0;if(B>0){R=Proj4js.common.HALF_PI}else{if(B<0){R=-Proj4js.common.HALF_PI}else{R=Proj4js.common.HALF_PI;M=-this.b;return }}}}}O=E*E+D*D;F=Math.sqrt(O);Q=B*Proj4js.common.AD_C;K=Math.sqrt(Q*Q+O);J=Q/K;G=F/K;V=J*J*J;N=B+this.b*this.ep2*V;L=F-this.a*this.es*G*G*G;I=Math.sqrt(N*N+L*L);U=N/I;T=L/I;P=this.a/Math.sqrt(1-this.es*U*U);if(T>=Proj4js.common.COS_67P5){M=F/T-P}else{if(T<=-Proj4js.common.COS_67P5){M=F/-T-P}else{M=B/U+P*(this.es-1)}}if(C==false){R=Math.atan(U/T)}S.x=H;S.y=R;S.z=M;return S},geocentric_to_wgs84:function(C){if(this.datum_type==Proj4js.common.PJD_3PARAM){C.x+=this.datum_params[0];C.y+=this.datum_params[1];C.z+=this.datum_params[2]}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){var G=this.datum_params[0];var E=this.datum_params[1];var J=this.datum_params[2];var F=this.datum_params[3];var K=this.datum_params[4];var I=this.datum_params[5];var H=this.datum_params[6];var D=H*(C.x-I*C.y+K*C.z)+G;var B=H*(I*C.x+C.y-F*C.z)+E;var L=H*(-K*C.x+F*C.y+C.z)+J;C.x=D;C.y=B;C.z=L}}},geocentric_from_wgs84:function(D){if(this.datum_type==Proj4js.common.PJD_3PARAM){D.x-=this.datum_params[0];D.y-=this.datum_params[1];D.z-=this.datum_params[2]}else{if(this.datum_type==Proj4js.common.PJD_7PARAM){var H=this.datum_params[0];var E=this.datum_params[1];var K=this.datum_params[2];var G=this.datum_params[3];var L=this.datum_params[4];var J=this.datum_params[5];var I=this.datum_params[6];var F=(D.x-H)/I;var C=(D.y-E)/I;var B=(D.z-K)/I;D.x=F+J*C-L*B;D.y=-J*F+C+G*B;D.z=L*F-G*C+B}}}});Proj4js.Point=Proj4js.Class({initialize:function(B,E,D){if(typeof B=="object"){this.x=B[0];this.y=B[1];this.z=B[2]||0}else{if(typeof B=="string"){var C=B.split(",");this.x=parseFloat(C[0]);this.y=parseFloat(C[1]);this.z=parseFloat(C[2])||0}else{this.x=B;this.y=E;this.z=D||0}}},clone:function(){return new Proj4js.Point(this.x,this.y,this.z)},toString:function(){return("x="+this.x+",y="+this.y)},toShortString:function(){return(this.x+", "+this.y)}});Proj4js.PrimeMeridian={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667};Proj4js.Ellipsoid={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},"APL4.":{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS72:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};Proj4js.Datum={WGS84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},GGRS87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},NAD83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},NAD27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},OSGB36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"}};Proj4js.WGS84=new Proj4js.Proj("WGS84");Proj4js.Datum.OSB36=Proj4js.Datum.OSGB36;Proj4js.wktProjections={"Lambert Tangential Conformal Conic Projection":"lcc",Mercator:"merc",Transverse_Mercator:"tmerc","Transverse Mercator":"tmerc","Lambert Azimuthal Equal Area":"laea","Universal Transverse Mercator System":"utm"};Proj4js.Proj.aea={init:function(){if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("aeaInitEqualLatitudes");return }this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e3=Math.sqrt(this.es);this.sin_po=Math.sin(this.lat1);this.cos_po=Math.cos(this.lat1);this.t1=this.sin_po;this.con=this.sin_po;this.ms1=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po);this.qs1=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.sin_po=Math.sin(this.lat2);this.cos_po=Math.cos(this.lat2);this.t2=this.sin_po;this.ms2=Proj4js.common.msfnz(this.e3,this.sin_po,this.cos_po);this.qs2=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);this.sin_po=Math.sin(this.lat0);this.cos_po=Math.cos(this.lat0);this.t3=this.sin_po;this.qs0=Proj4js.common.qsfnz(this.e3,this.sin_po,this.cos_po);if(Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN){this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1)}else{this.ns0=this.con}this.c=this.ms1*this.ms1+this.ns0*this.qs1;this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0},forward:function(F){var G=F.x;var E=F.y;this.sin_phi=Math.sin(E);this.cos_phi=Math.cos(E);var C=Proj4js.common.qsfnz(this.e3,this.sin_phi,this.cos_phi);var I=this.a*Math.sqrt(this.c-this.ns0*C)/this.ns0;var D=this.ns0*Proj4js.common.adjust_lon(G-this.long0);var B=I*Math.sin(D)+this.x0;var H=this.rh-I*Math.cos(D)+this.y0;F.x=B;F.y=H;return F},inverse:function(F){var H,B,C,D,G,E;F.x-=this.x0;F.y=this.rh-F.y+this.y0;if(this.ns0>=0){H=Math.sqrt(F.x*F.x+F.y*F.y);C=1}else{H=-Math.sqrt(F.x*F.x+F.y*F.y);C=-1}D=0;if(H!=0){D=Math.atan2(C*F.x,C*F.y)}C=H*this.ns0/this.a;B=(this.c-C*C)/this.ns0;if(this.e3>=1e-10){C=1-0.5*(1-this.es)*Math.log((1-this.e3)/(1+this.e3))/this.e3;if(Math.abs(Math.abs(C)-Math.abs(B))>1e-10){E=this.phi1z(this.e3,B)}else{if(B>=0){E=0.5*PI}else{E=-0.5*PI}}}else{E=this.phi1z(e3,B)}G=Proj4js.common.adjust_lon(D/this.ns0+this.long0);F.x=G;F.y=E;return F},phi1z:function(I,B){var C,D,E;var H=Proj4js.common.asinz(0.5*B);if(I<Proj4js.common.EPSLN){return H}var G=I*I;for(var F=1;F<=25;F++){sinphi=Math.sin(H);cosphi=Math.cos(H);C=I*sinphi;D=1-C*C;E=0.5*D*D/cosphi*(B/(1-G)-sinphi/D+0.5/I*Math.log((1-C)/(1+C)));H=H+E;if(Math.abs(E)<=1e-7){return H}}Proj4js.reportError("aea:phi1z:Convergence error");return null}};Proj4js.Proj.sterea={dependsOn:"gauss",init:function(){Proj4js.Proj.gauss.init.apply(this);if(!this.rc){Proj4js.reportError("sterea:init:E_ERROR_0");return }this.sinc0=Math.sin(this.phic0);this.cosc0=Math.cos(this.phic0);this.R2=2*this.rc;if(!this.title){this.title="Oblique Stereographic Alternative"}},forward:function(B){B.x=Proj4js.common.adjust_lon(B.x-this.long0);Proj4js.Proj.gauss.forward.apply(this,[B]);sinc=Math.sin(B.y);cosc=Math.cos(B.y);cosl=Math.cos(B.x);k=this.k0*this.R2/(1+this.sinc0*sinc+this.cosc0*cosc*cosl);B.x=k*cosc*Math.sin(B.x);B.y=k*(this.cosc0*sinc-this.sinc0*cosc*cosl);B.x=this.a*B.x+this.x0;B.y=this.a*B.y+this.y0;return B},inverse:function(C){var D,B;C.x=(C.x-this.x0)/this.a;C.y=(C.y-this.y0)/this.a;C.x/=this.k0;C.y/=this.k0;if((rho=Math.sqrt(C.x*C.x+C.y*C.y))){c=2*Math.atan2(rho,this.R2);sinc=Math.sin(c);cosc=Math.cos(c);B=Math.asin(cosc*this.sinc0+C.y*sinc*this.cosc0/rho);D=Math.atan2(C.x*sinc,rho*this.cosc0*cosc-C.y*this.sinc0*sinc)}else{B=this.phic0;D=0}C.x=D;C.y=B;Proj4js.Proj.gauss.inverse.apply(this,[C]);C.x=Proj4js.common.adjust_lon(C.x+this.long0);return C}};function phi4z(C,H,G,F,E,T,S,R,D){var I,Q,O,P,M,L,K,J,B,N;D=T;for(N=1;N<=15;N++){I=Math.sin(D);tanphi=Math.tan(D);R=tanphi*Math.sqrt(1-C*I*I);Q=Math.sin(2*D);P=H*D-G*Q+F*Math.sin(4*D)-E*Math.sin(6*D);M=H-2*G*Math.cos(2*D)+4*F*Math.cos(4*D)-6*E*Math.cos(6*D);L=2*P+R*(P*P+S)-2*T*(R*P+1);K=C*Q*(P*P+S-2*T*P)/(2*R);J=2*(T-P)*(R*M-2/Q)-2*M;B=L/(K+J);D+=B;if(Math.abs(B)<=1e-10){return(D)}}Proj4js.reportError("phi4z: No convergence");return null}function e4fn(B){var C,D;C=1+B;D=1-B;return(Math.sqrt((Math.pow(C,C))*(Math.pow(D,D))))}Proj4js.Proj.poly={init:function(){var B;if(this.lat0=0){this.lat0=90}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(E){var B,G;var I;var K;var F,H;var D;var M,L;var C=E.x;var J=E.y;F=Proj4js.common.adjust_lon(C-this.long0);if(Math.abs(J)<=1e-7){M=this.x0+this.a*F;L=this.y0-this.a*this.ml0}else{B=Math.sin(J);G=Math.cos(J);H=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,J);D=Proj4js.common.msfnz(this.e,B,G);F=B;M=this.x0+this.a*D*Math.sin(F)/B;L=this.y0+this.a*(H-this.ml0+D*(1-Math.cos(F))/B)}E.x=M;E.y=L;return E},inverse:function(C){var K,G;var F;var L;var I;var D,E;var J;var B,H;C.x-=this.x0;C.y-=this.y0;F=this.ml0+C.y/this.a;J=0;if(Math.abs(F)<=1e-7){B=C.x/this.a+this.long0;H=0}else{L=F*F+(C.x/this.a)*(C.x/this.a);J=phi4z(this.es,this.e0,this.e1,this.e2,this.e3,this.al,L,I,H);if(J!=1){return(J)}B=Proj4js.common.adjust_lon((Proj4js.common.asinz(C.x*I/this.a)/Math.sin(H))+this.long0)}C.x=B;C.y=H;return C}};Proj4js.Proj.equi={init:function(){if(!this.x0){this.x0=0}if(!this.y0){this.y0=0}if(!this.lat0){this.lat0=0}if(!this.long0){this.long0=0}},forward:function(E){var F=E.x;var D=E.y;var C=Proj4js.common.adjust_lon(F-this.long0);var B=this.x0+this.a*C*Math.cos(this.lat0);var G=this.y0+this.a*D;this.t1=B;this.t2=Math.cos(this.lat0);E.x=B;E.y=G;return E},inverse:function(C){C.x-=this.x0;C.y-=this.y0;var B=C.y/this.a;if(Math.abs(B)>Proj4js.common.HALF_PI){Proj4js.reportError("equi:Inv:DataError")}var D=Proj4js.common.adjust_lon(this.long0+C.x/(this.a*Math.cos(this.lat0)));C.x=D;C.y=B}};Proj4js.Proj.merc={init:function(){if(this.lat_ts){if(this.sphere){this.k0=Math.cos(this.lat_ts)}else{this.k0=Proj4js.common.msfnz(this.es,Math.sin(this.lat_ts),Math.cos(this.lat_ts))}}},forward:function(F){var G=F.x;var E=F.y;if(E*Proj4js.common.R2D>90&&E*Proj4js.common.R2D<-90&&G*Proj4js.common.R2D>180&&G*Proj4js.common.R2D<-180){Proj4js.reportError("merc:forward: llInputOutOfRange: "+G+" : "+E);return null}var B,H;if(Math.abs(Math.abs(E)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN){Proj4js.reportError("merc:forward: ll2mAtPoles");return null}else{if(this.sphere){B=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(G-this.long0);H=this.y0+this.a*this.k0*Math.log(Math.tan(Proj4js.common.FORTPI+0.5*E))}else{var D=Math.sin(E);var C=Proj4js.common.tsfnz(this.e,E,D);B=this.x0+this.a*this.k0*Proj4js.common.adjust_lon(G-this.long0);H=this.y0-this.a*this.k0*Math.log(C)}F.x=B;F.y=H;return F}},inverse:function(E){var B=E.x-this.x0;var G=E.y-this.y0;var F,D;if(this.sphere){D=Proj4js.common.HALF_PI-2*Math.atan(Math.exp(-G/this.a*this.k0))}else{var C=Math.exp(-G/(this.a*this.k0));D=Proj4js.common.phi2z(this.e,C);if(D==-9999){Proj4js.reportError("merc:inverse: lat = -9999");return null}}F=Proj4js.common.adjust_lon(this.long0+B/(this.a*this.k0));E.x=F;E.y=D;return E}};Proj4js.Proj.utm={dependsOn:"tmerc",init:function(){if(!this.zone){Proj4js.reportError("utm:init: zone must be specified for UTM");return }this.lat0=0;this.long0=((6*Math.abs(this.zone))-183)*Proj4js.common.D2R;this.x0=500000;this.y0=this.utmSouth?10000000:0;this.k0=0.9996;Proj4js.Proj.tmerc.init.apply(this);this.forward=Proj4js.Proj.tmerc.forward;this.inverse=Proj4js.Proj.tmerc.inverse}};Proj4js.Proj.eqdc={init:function(){if(!this.mode){this.mode=0}this.temp=this.b/this.a;this.es=1-Math.pow(this.temp,2);this.e=Math.sqrt(this.es);this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.sinphi=Math.sin(this.lat1);this.cosphi=Math.cos(this.lat1);this.ms1=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml1=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat1);if(this.mode!=0){if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("eqdc:Init:EqualLatitudes")}this.sinphi=Math.sin(this.lat2);this.cosphi=Math.cos(this.lat2);this.ms2=Proj4js.common.msfnz(this.e,this.sinphi,this.cosphi);this.ml2=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat2);if(Math.abs(this.lat1-this.lat2)>=Proj4js.common.EPSLN){this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)}else{this.ns=this.sinphi}}else{this.ns=this.sinphi}this.g=this.ml1+this.ms1/this.ns;this.ml0=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0);this.rh=this.a*(this.g-this.ml0)},forward:function(E){var F=E.x;var D=E.y;var I=Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,D);var H=this.a*(this.g-I);var C=this.ns*Proj4js.common.adjust_lon(F-this.long0);var B=this.x0+H*Math.sin(C);var G=this.y0+this.rh-H*Math.cos(C);E.x=B;E.y=G;return E},inverse:function(E){E.x-=this.x0;E.y=this.rh-E.y+this.y0;var B,H;if(this.ns>=0){var H=Math.sqrt(E.x*E.x+E.y*E.y);var B=1}else{H=-Math.sqrt(E.x*E.x+E.y*E.y);B=-1}var C=0;if(H!=0){C=Math.atan2(B*E.x,B*E.y)}var G=this.g-H/this.a;var D=this.phi3z(G,this.e0,this.e1,this.e2,this.e3);var F=Proj4js.common.adjust_lon(this.long0+C/this.ns);E.x=F;E.y=D;return E},phi3z:function(I,H,G,F,E){var D;var B;D=I;for(var C=0;C<15;C++){B=(I+G*Math.sin(2*D)-F*Math.sin(4*D)+E*Math.sin(6*D))/H-D;D+=B;if(Math.abs(B)<=1e-10){return D}}Proj4js.reportError("PHI3Z-CONV:Latitude failed to converge after 15 iterations");return null}};Proj4js.Proj.tmerc={init:function(){this.e0=Proj4js.common.e0fn(this.es);this.e1=Proj4js.common.e1fn(this.es);this.e2=Proj4js.common.e2fn(this.es);this.e3=Proj4js.common.e3fn(this.es);this.ml0=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(C){var B=C.x;var L=C.y;var F=Proj4js.common.adjust_lon(B-this.long0);var D;var Q,O;var P=Math.sin(L);var J=Math.cos(L);if(this.sphere){var N=J*Math.sin(F);if((Math.abs(Math.abs(N)-1))<1e-10){Proj4js.reportError("tmerc:forward: Point projects into infinity");return(93)}else{Q=0.5*this.a*this.k0*Math.log((1+N)/(1-N));D=Math.acos(J*Math.cos(F)/Math.sqrt(1-N*N));if(L<0){D=-D}O=this.a*this.k0*(D-this.lat0)}}else{var I=J*F;var H=Math.pow(I,2);var K=this.ep2*Math.pow(J,2);var M=Math.tan(L);var R=Math.pow(M,2);D=1-this.es*Math.pow(P,2);var E=this.a/Math.sqrt(D);var G=this.a*Proj4js.common.mlfn(this.e0,this.e1,this.e2,this.e3,L);Q=this.k0*E*I*(1+H/6*(1-R+K+H/20*(5-18*R+Math.pow(R,2)+72*K-58*this.ep2)))+this.x0;O=this.k0*(G-this.ml0+E*M*(H*(0.5+H/24*(5-R+9*K+4*Math.pow(K,2)+H/30*(61-58*R+Math.pow(R,2)+600*K-330*this.ep2)))))+this.y0}C.x=Q;C.y=O;return C},inverse:function(P){var F,D;var Z;var R;var I=6;var H,E;if(this.sphere){var U=Math.exp(P.x/(this.a*this.k0));var T=0.5*(U-1/U);var W=this.lat0+P.y/(this.a*this.k0);var S=Math.cos(W);F=Math.sqrt((1-S*S)/(1+T*T));H=Proj4js.common.asinz(F);if(W<0){H=-H}if((T==0)&&(S==0)){E=this.long0}else{E=Proj4js.common.adjust_lon(Math.atan2(T,S)+this.long0)}}else{var K=P.x-this.x0;var J=P.y-this.y0;F=(this.ml0+J/this.k0)/this.a;D=F;for(R=0;true;R++){Z=((F+this.e1*Math.sin(2*D)-this.e2*Math.sin(4*D)+this.e3*Math.sin(6*D))/this.e0)-D;D+=Z;if(Math.abs(Z)<=Proj4js.common.EPSLN){break}if(R>=I){Proj4js.reportError("tmerc:inverse: Latitude failed to converge");return(95)}}if(Math.abs(D)<Proj4js.common.HALF_PI){var C=Math.sin(D);var a=Math.cos(D);var L=Math.tan(D);var Y=this.ep2*Math.pow(a,2);var G=Math.pow(Y,2);var M=Math.pow(L,2);var B=Math.pow(M,2);F=1-this.es*Math.pow(C,2);var Q=this.a/Math.sqrt(F);var N=Q*(1-this.es)/F;var V=K/(Q*this.k0);var O=Math.pow(V,2);H=D-(Q*L*O/N)*(0.5-O/24*(5+3*M+10*Y-4*G-9*this.ep2-O/30*(61+90*M+298*Y+45*B-252*this.ep2-3*G)));E=Proj4js.common.adjust_lon(this.long0+(V*(1-O/6*(1+2*M+Y-O/20*(5-2*Y+28*M-3*G+8*this.ep2+24*B)))/a))}else{H=Proj4js.common.HALF_PI*Proj4js.common.sign(J);E=this.long0}}P.x=E;P.y=H;return P}};Proj4js.defs.GOOGLE="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs";Proj4js.defs["EPSG:900913"]=Proj4js.defs.GOOGLE;Proj4js.Proj.gstmerc={init:function(){var B=this.b/this.a;this.e=Math.sqrt(1-B*B);this.lc=this.long0;this.rs=Math.sqrt(1+this.e*this.e*Math.pow(Math.cos(this.lat0),4)/(1-this.e*this.e));var D=Math.sin(this.lat0);var C=Math.asin(D/this.rs);var E=Math.sin(C);this.cp=Proj4js.common.latiso(0,C,E)-this.rs*Proj4js.common.latiso(this.e,this.lat0,D);this.n2=this.k0*this.a*Math.sqrt(1-this.e*this.e)/(1-this.e*this.e*D*D);this.xs=this.x0;this.ys=this.y0-this.n2*C;if(!this.title){this.title="Gauss Schreiber transverse mercator"}},forward:function(F){var H=F.x;var E=F.y;var B=this.rs*(H-this.lc);var C=this.cp+(this.rs*Proj4js.common.latiso(this.e,E,Math.sin(E)));var G=Math.asin(Math.sin(B)/Proj4js.common.cosh(C));var D=Proj4js.common.latiso(0,G,Math.sin(G));F.x=this.xs+(this.n2*D);F.y=this.ys+(this.n2*Math.atan(Proj4js.common.sinh(C)/Math.cos(B)));return F},inverse:function(E){var C=E.x;var G=E.y;var B=Math.atan(Proj4js.common.sinh((C-this.xs)/this.n2)/Math.cos((G-this.ys)/this.n2));var F=Math.asin(Math.sin((G-this.ys)/this.n2)/Proj4js.common.cosh((C-this.xs)/this.n2));var D=Proj4js.common.latiso(0,F,Math.sin(F));E.x=this.lc+B/this.rs;E.y=Proj4js.common.invlatiso(this.e,(D-this.cp)/this.rs);return E}};Proj4js.Proj.ortho={init:function(B){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0)},forward:function(D){var B,E;var L;var K;var F;var G;var C=D.x;var H=D.y;L=Proj4js.common.adjust_lon(C-this.long0);B=Math.sin(H);E=Math.cos(H);K=Math.cos(L);G=this.sin_p14*B+this.cos_p14*E*K;F=1;if((G>0)||(Math.abs(G)<=Proj4js.common.EPSLN)){var J=this.a*F*E*Math.sin(L);var I=this.y0+this.a*F*(this.cos_p14*B-this.sin_p14*E*K)}else{Proj4js.reportError("orthoFwdPointError")}D.x=J;D.y=I;return D},inverse:function(C){var H;var G;var E,J;var I;var D;var B,F;C.x-=this.x0;C.y-=this.y0;H=Math.sqrt(C.x*C.x+C.y*C.y);if(H>this.a+1e-7){Proj4js.reportError("orthoInvDataError")}G=Proj4js.common.asinz(H/this.a);E=Math.sin(G);J=Math.cos(G);B=this.long0;if(Math.abs(H)<=Proj4js.common.EPSLN){F=this.lat0}F=Proj4js.common.asinz(J*this.sin_p14+(C.y*E*this.cos_p14)/H);D=Math.abs(this.lat0)-Proj4js.common.HALF_PI;if(Math.abs(D)<=Proj4js.common.EPSLN){if(this.lat0>=0){B=Proj4js.common.adjust_lon(this.long0+Math.atan2(C.x,-C.y))}else{B=Proj4js.common.adjust_lon(this.long0-Math.atan2(-C.x,C.y))}}D=J-this.sin_p14*Math.sin(F);C.x=B;C.y=F;return C}};Proj4js.Proj.somerc={init:function(){var C=this.lat0;this.lambda0=this.long0;var B=Math.sin(C);var E=this.a;var D=this.rf;var F=1/D;var H=2*F-Math.pow(F,2);var G=this.e=Math.sqrt(H);this.R=this.k0*E*Math.sqrt(1-H)/(1-H*Math.pow(B,2));this.alpha=Math.sqrt(1+H/(1-H)*Math.pow(Math.cos(C),4));this.b0=Math.asin(B/this.alpha);this.K=Math.log(Math.tan(Math.PI/4+this.b0/2))-this.alpha*Math.log(Math.tan(Math.PI/4+C/2))+this.alpha*G/2*Math.log((1+G*B)/(1-G*B))},forward:function(F){var J=Math.log(Math.tan(Math.PI/4-F.y/2));var G=this.e/2*Math.log((1+this.e*Math.sin(F.y))/(1-this.e*Math.sin(F.y)));var D=-this.alpha*(J+G)+this.K;var B=2*(Math.atan(Math.exp(D))-Math.PI/4);var C=this.alpha*(F.x-this.lambda0);var H=Math.atan(Math.sin(C)/(Math.sin(this.b0)*Math.tan(B)+Math.cos(this.b0)*Math.cos(C)));var E=Math.asin(Math.cos(this.b0)*Math.sin(B)-Math.sin(this.b0)*Math.cos(B)*Math.cos(C));F.y=this.R/2*Math.log((1+Math.sin(E))/(1-Math.sin(E)))+this.y0;F.x=this.R*H+this.x0;return F},inverse:function(D){var C=D.x-this.x0;var E=D.y-this.y0;var M=C/this.R;var F=2*(Math.atan(Math.exp(E/this.R))-Math.PI/4);var K=Math.asin(Math.cos(this.b0)*Math.sin(F)+Math.sin(this.b0)*Math.cos(F)*Math.cos(M));var L=Math.atan(Math.sin(M)/(Math.cos(this.b0)*Math.cos(M)-Math.sin(this.b0)*Math.tan(F)));var J=this.lambda0+L/this.alpha;var H=0;var N=K;var B=-1000;var G=0;while(Math.abs(N-B)>1e-7){if(++G>20){Proj4js.reportError("omercFwdInfinity");return }H=1/this.alpha*(Math.log(Math.tan(Math.PI/4+K/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(N))/2));B=N;N=2*Math.atan(Math.exp(H))-Math.PI/2}D.x=J;D.y=N;return D}};Proj4js.Proj.stere={ssfn_:function(B,D,C){D*=C;return(Math.tan(0.5*(Proj4js.common.HALF_PI+B))*Math.pow((1-D)/(1+D),0.5*C))},TOL:1e-8,NITER:8,CONV:1e-10,S_POLE:0,N_POLE:1,OBLIQ:2,EQUIT:3,init:function(){this.phits=this.lat_ts?this.lat_ts:Proj4js.common.HALF_PI;var B=Math.abs(this.lat0);if((Math.abs(B)-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else{this.mode=B>Proj4js.common.EPSLN?this.OBLIQ:this.EQUIT}this.phits=Math.abs(this.phits);if(this.es){var C;switch(this.mode){case this.N_POLE:case this.S_POLE:if(Math.abs(this.phits-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN){this.akm1=2*this.k0/Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e))}else{B=Math.sin(this.phits);this.akm1=Math.cos(this.phits)/Proj4js.common.tsfnz(this.e,this.phits,B);B*=this.e;this.akm1/=Math.sqrt(1-B*B)}break;case this.EQUIT:this.akm1=2*this.k0;break;case this.OBLIQ:B=Math.sin(this.lat0);C=2*Math.atan(this.ssfn_(this.lat0,B,this.e))-Proj4js.common.HALF_PI;B*=this.e;this.akm1=2*this.k0*Math.cos(this.lat0)/Math.sqrt(1-B*B);this.sinX1=Math.sin(C);this.cosX1=Math.cos(C);break}}else{switch(this.mode){case this.OBLIQ:this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0);case this.EQUIT:this.akm1=2*this.k0;break;case this.S_POLE:case this.N_POLE:this.akm1=Math.abs(this.phits-Proj4js.common.HALF_PI)>=Proj4js.common.EPSLN?Math.cos(this.phits)/Math.tan(Proj4js.common.FORTPI-0.5*this.phits):2*this.k0;break}}},forward:function(D){var C=D.x;C=Proj4js.common.adjust_lon(C-this.long0);var G=D.y;var J,H;if(this.sphere){var B,E,I,F;B=Math.sin(G);E=Math.cos(G);I=Math.cos(C);F=Math.sin(C);switch(this.mode){case this.EQUIT:H=1+E*I;if(H<=Proj4js.common.EPSLN){F_ERROR}H=this.akm1/H;J=H*E*F;H*=B;break;case this.OBLIQ:H=1+this.sinph0*B+this.cosph0*E*I;if(H<=Proj4js.common.EPSLN){F_ERROR}H=this.akm1/H;J=H*E*F;H*=this.cosph0*B-this.sinph0*E*I;break;case this.N_POLE:I=-I;G=-G;case this.S_POLE:if(Math.abs(G-Proj4js.common.HALF_PI)<this.TOL){F_ERROR}H=this.akm1*Math.tan(Proj4js.common.FORTPI+0.5*G);J=F*H;H*=I;break}}else{I=Math.cos(C);F=Math.sin(C);B=Math.sin(G);if(this.mode==this.OBLIQ||this.mode==this.EQUIT){X=2*Math.atan(this.ssfn_(G,B,this.e));sinX=Math.sin(X-Proj4js.common.HALF_PI);cosX=Math.cos(X)}switch(this.mode){case this.OBLIQ:A=this.akm1/(this.cosX1*(1+this.sinX1*sinX+this.cosX1*cosX*I));H=A*(this.cosX1*sinX-this.sinX1*cosX*I);J=A*cosX;break;case this.EQUIT:A=2*this.akm1/(1+cosX*I);H=A*sinX;J=A*cosX;break;case this.S_POLE:G=-G;I=-I;B=-B;case this.N_POLE:J=this.akm1*Proj4js.common.tsfnz(this.e,G,B);H=-J*I;break}J=J*F}D.x=J*this.a+this.x0;D.y=H*this.a+this.y0;return D},inverse:function(D){var P=(D.x-this.x0)/this.a;var M=(D.y-this.y0)/this.a;var C,L;var H,B,O=0,E=0,N,G=0,J=0;var I;if(this.sphere){var K,Q,F,R;Q=Math.sqrt(P*P+M*M);K=2*Math.atan(Q/this.akm1);F=Math.sin(K);R=Math.cos(K);C=0;switch(this.mode){case this.EQUIT:if(Math.abs(Q)<=Proj4js.common.EPSLN){L=0}else{L=Math.asin(M*F/Q)}if(R!=0||P!=0){C=Math.atan2(P*F,R*Q)}break;case this.OBLIQ:if(Math.abs(Q)<=Proj4js.common.EPSLN){L=this.phi0}else{L=Math.asin(R*sinph0+M*F*cosph0/Q)}K=R-sinph0*Math.sin(L);if(K!=0||P!=0){C=Math.atan2(P*F*cosph0,K*Q)}break;case this.N_POLE:M=-M;case this.S_POLE:if(Math.abs(Q)<=Proj4js.common.EPSLN){L=this.phi0}else{L=Math.asin(this.mode==this.S_POLE?-R:R)}C=(P==0&&M==0)?0:Math.atan2(P,M);break}D.x=Proj4js.common.adjust_lon(C+this.long0);D.y=L}else{N=Math.sqrt(P*P+M*M);switch(this.mode){case this.OBLIQ:case this.EQUIT:O=2*Math.atan2(N*this.cosX1,this.akm1);H=Math.cos(O);B=Math.sin(O);if(N==0){E=Math.asin(H*this.sinX1)}else{E=Math.asin(H*this.sinX1+(M*B*this.cosX1/N))}O=Math.tan(0.5*(Proj4js.common.HALF_PI+E));P*=B;M=N*this.cosX1*H-M*this.sinX1*B;J=Proj4js.common.HALF_PI;G=0.5*this.e;break;case this.N_POLE:M=-M;case this.S_POLE:O=-N/this.akm1;E=Proj4js.common.HALF_PI-2*Math.atan(O);J=-Proj4js.common.HALF_PI;G=-0.5*this.e;break}for(I=this.NITER;I--;E=L){B=this.e*Math.sin(E);L=2*Math.atan(O*Math.pow((1+B)/(1-B),G))-J;if(Math.abs(E-L)<this.CONV){if(this.mode==this.S_POLE){L=-L}C=(P==0&&M==0)?0:Math.atan2(P,M);D.x=Proj4js.common.adjust_lon(C+this.long0);D.y=L;return D}}}}};Proj4js.Proj.nzmg={iterations:1,init:function(){this.A=new Array();this.A[1]=+0.6399175073;this.A[2]=-0.1358797613;this.A[3]=+0.063294409;this.A[4]=-0.02526853;this.A[5]=+0.0117879;this.A[6]=-0.0055161;this.A[7]=+0.0026906;this.A[8]=-0.001333;this.A[9]=+0.00067;this.A[10]=-0.00034;this.B_re=new Array();this.B_im=new Array();this.B_re[1]=+0.7557853228;this.B_im[1]=0;this.B_re[2]=+0.249204646;this.B_im[2]=+0.003371507;this.B_re[3]=-0.001541739;this.B_im[3]=+0.04105856;this.B_re[4]=-0.10162907;this.B_im[4]=+0.01727609;this.B_re[5]=-0.26623489;this.B_im[5]=-0.36249218;this.B_re[6]=-0.6870983;this.B_im[6]=-1.1651967;this.C_re=new Array();this.C_im=new Array();this.C_re[1]=+1.3231270439;this.C_im[1]=0;this.C_re[2]=-0.577245789;this.C_im[2]=-0.007809598;this.C_re[3]=+0.508307513;this.C_im[3]=-0.112208952;this.C_re[4]=-0.15094762;this.C_im[4]=+0.18200602;this.C_re[5]=+1.01418179;this.C_im[5]=+1.64497696;this.C_re[6]=+1.9660549;this.C_im[6]=+2.5127645;this.D=new Array();this.D[1]=+1.5627014243;this.D[2]=+0.5185406398;this.D[3]=-0.03333098;this.D[4]=-0.1052906;this.D[5]=-0.0368594;this.D[6]=+0.007317;this.D[7]=+0.0122;this.D[8]=+0.00394;this.D[9]=-0.0013},forward:function(D){var C=D.x;var O=D.y;var R=O-this.lat0;var J=C-this.long0;var E=R/Proj4js.common.SEC_TO_RAD*0.00001;var B=J;var L=1;var I=0;for(n=1;n<=10;n++){L=L*E;I=I+this.A[n]*L}var K=I;var G=B;var M=1;var H=0;var Q;var F;var P=0;var N=0;for(n=1;n<=6;n++){Q=M*K-H*G;F=H*K+M*G;M=Q;H=F;P=P+this.B_re[n]*M-this.B_im[n]*H;N=N+this.B_im[n]*M+this.B_re[n]*H}x=(N*this.a)+this.x0;y=(P*this.a)+this.y0;D.x=x;D.y=y;return D},inverse:function(S){var P=S.x;var O=S.y;var W=P-this.x0;var V=O-this.y0;var N=V/this.a;var F=W/this.a;var J=1;var e=0;var G;var a;var K=0;var B=0;for(n=1;n<=6;n++){G=J*N-e*F;a=e*N+J*F;J=G;e=a;K=K+this.C_re[n]*J-this.C_im[n]*e;B=B+this.C_im[n]*J+this.C_re[n]*e}for(i=0;i<this.iterations;i++){var Q=K;var I=B;var U;var R;var D=N;var Z=F;for(n=2;n<=6;n++){U=Q*K-I*B;R=I*K+Q*B;Q=U;I=R;D=D+(n-1)*(this.B_re[n]*Q-this.B_im[n]*I);Z=Z+(n-1)*(this.B_im[n]*Q+this.B_re[n]*I)}Q=1;I=0;var C=this.B_re[1];var Y=this.B_im[1];for(n=2;n<=6;n++){U=Q*K-I*B;R=I*K+Q*B;Q=U;I=R;C=C+n*(this.B_re[n]*Q-this.B_im[n]*I);Y=Y+n*(this.B_im[n]*Q+this.B_re[n]*I)}var E=C*C+Y*Y;K=(D*C+Z*Y)/E;B=(Z*C-D*Y)/E}var T=K;var M=B;var b=1;var d=0;for(n=1;n<=9;n++){b=b*T;d=d+this.D[n]*b}var L=this.lat0+(d*Proj4js.common.SEC_TO_RAD*100000);var H=this.long0+M;S.x=H;S.y=L;return S}};Proj4js.Proj.mill={init:function(){},forward:function(E){var F=E.x;var D=E.y;var C=Proj4js.common.adjust_lon(F-this.long0);var B=this.x0+this.a*C;var G=this.y0+this.a*Math.log(Math.tan((Proj4js.common.PI/4)+(D/2.5)))*1.25;E.x=B;E.y=G;return E},inverse:function(C){C.x-=this.x0;C.y-=this.y0;var D=Proj4js.common.adjust_lon(this.long0+C.x/this.a);var B=2.5*(Math.atan(Math.exp(0.8*C.y/this.a))-Proj4js.common.PI/4);C.x=D;C.y=B;return C}};Proj4js.Proj.gnom={init:function(B){this.sin_p14=Math.sin(this.lat0);this.cos_p14=Math.cos(this.lat0);this.infinity_dist=1000*this.a;this.rc=1},forward:function(D){var B,E;var J;var I;var F;var G;var C=D.x;var H=D.y;J=Proj4js.common.adjust_lon(C-this.long0);B=Math.sin(H);E=Math.cos(H);I=Math.cos(J);G=this.sin_p14*B+this.cos_p14*E*I;F=1;if((G>0)||(Math.abs(G)<=Proj4js.common.EPSLN)){x=this.x0+this.a*F*E*Math.sin(J)/G;y=this.y0+this.a*F*(this.cos_p14*B-this.sin_p14*E*I)/G}else{Proj4js.reportError("orthoFwdPointError");x=this.x0+this.infinity_dist*E*Math.sin(J);y=this.y0+this.infinity_dist*(this.cos_p14*B-this.sin_p14*E*I)}D.x=x;D.y=y;return D},inverse:function(F){var B;var H;var C,D;var I;var G,E;F.x=(F.x-this.x0)/this.a;F.y=(F.y-this.y0)/this.a;F.x/=this.k0;F.y/=this.k0;if((B=Math.sqrt(F.x*F.x+F.y*F.y))){I=Math.atan2(B,this.rc);C=Math.sin(I);D=Math.cos(I);E=Proj4js.common.asinz(D*this.sin_p14+(F.y*C*this.cos_p14)/B);G=Math.atan2(F.x*C,B*this.cos_p14*D-F.y*this.sin_p14*C);G=Proj4js.common.adjust_lon(this.long0+G)}else{E=this.phic0;G=0}F.x=G;F.y=E;return F}};Proj4js.Proj.sinu={init:function(){this.R=6370997},forward:function(E){var B,G,C;var F=E.x;var D=E.y;C=Proj4js.common.adjust_lon(F-this.long0);B=this.R*C*Math.cos(D)+this.x0;G=this.R*D+this.y0;E.x=B;E.y=G;return E},inverse:function(D){var C,B,E;D.x-=this.x0;D.y-=this.y0;C=D.y/this.R;if(Math.abs(C)>Proj4js.common.HALF_PI){Proj4js.reportError("sinu:Inv:DataError")}B=Math.abs(C)-Proj4js.common.HALF_PI;if(Math.abs(B)>Proj4js.common.EPSLN){B=this.long0+D.x/(this.R*Math.cos(C));E=Proj4js.common.adjust_lon(B)}else{E=this.long0}D.x=E;D.y=C;return D}};Proj4js.Proj.vandg={init:function(){this.R=6370997},forward:function(D){var B=D.x;var M=D.y;var Q=Proj4js.common.adjust_lon(B-this.long0);var P,N;if(Math.abs(M)<=Proj4js.common.EPSLN){P=this.x0+this.R*Q;N=this.y0}var F=Proj4js.common.asinz(2*Math.abs(M/Proj4js.common.PI));if((Math.abs(Q)<=Proj4js.common.EPSLN)||(Math.abs(Math.abs(M)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN)){P=this.x0;if(M>=0){N=this.y0+Proj4js.common.PI*this.R*Math.tan(0.5*F)}else{N=this.y0+Proj4js.common.PI*this.R*-Math.tan(0.5*F)}}var K=0.5*Math.abs((Proj4js.common.PI/Q)-(Q/Proj4js.common.PI));var E=K*K;var L=Math.sin(F);var J=Math.cos(F);var I=J/(L+J-1);var H=I*I;var G=I*(2/L-1);var O=G*G;var C=Proj4js.common.PI*this.R*(K*(I-O)+Math.sqrt(E*(I-O)*(I-O)-(O+E)*(H-O)))/(O+E);if(Q<0){C=-C}P=this.x0+C;C=Math.abs(C/(Proj4js.common.PI*this.R));if(M>=0){N=this.y0+Proj4js.common.PI*this.R*Math.sqrt(1-C*C-2*K*C)}else{N=this.y0-Proj4js.common.PI*this.R*Math.sqrt(1-C*C-2*K*C)}D.x=P;D.y=N;return D},inverse:function(E){var P;var B,L,O,I,H,G;var J,F;var D;var N;var C;var M;var K;E.x-=this.x0;E.y-=this.y0;C=Proj4js.common.PI*this.R;B=E.x/C;L=E.y/C;O=B*B+L*L;I=-Math.abs(L)*(1+O);H=I-2*L*L+B*B;G=-2*I+1+2*L*L+O*O;K=L*L/G+(2*H*H*H/G/G/G-9*I*H/G/G)/27;D=(I-H*H/3/G)/G;N=2*Math.sqrt(-D/3);C=((3*K)/D)/N;if(Math.abs(C)>1){if(C>=0){C=1}else{C=-1}}M=Math.acos(C)/3;if(E.y>=0){lat=(-N*Math.cos(M+Proj4js.common.PI/3)-H/3/G)*Proj4js.common.PI}else{lat=-(-N*Math.cos(M+Proj4js.common.PI/3)-H/3/G)*Proj4js.common.PI}if(Math.abs(B)<Proj4js.common.EPSLN){lon=this.long0}lon=Proj4js.common.adjust_lon(this.long0+Proj4js.common.PI*(O-1+Math.sqrt(1+2*(B*B-L*L)+O*O))/2/B);E.x=lon;E.y=lat;return E}};Proj4js.Proj.cea={init:function(){},forward:function(D){var E=D.x;var C=D.y;dlon=Proj4js.common.adjust_lon(E-this.long0);var B=this.x0+this.a*dlon*Math.cos(this.lat_ts);var F=this.y0+this.a*Math.sin(C)/Math.cos(this.lat_ts);D.x=B;D.y=F;return D},inverse:function(C){C.x-=this.x0;C.y-=this.y0;var D=Proj4js.common.adjust_lon(this.long0+(C.x/this.a)/Math.cos(this.lat_ts));var B=Math.asin((C.y/this.a)*Math.cos(this.lat_ts));C.x=D;C.y=B;return C}};Proj4js.Proj.eqc={init:function(){if(!this.x0){this.x0=0}if(!this.y0){this.y0=0}if(!this.lat0){this.lat0=0}if(!this.long0){this.long0=0}if(!this.lat_ts){this.lat_ts=0}if(!this.title){this.title="Equidistant Cylindrical (Plate Carre)"}this.rc=Math.cos(this.lat_ts)},forward:function(E){var F=E.x;var D=E.y;var C=Proj4js.common.adjust_lon(F-this.long0);var B=Proj4js.common.adjust_lat(D-this.lat0);E.x=this.x0+(this.a*C*this.rc);E.y=this.y0+(this.a*B);return E},inverse:function(C){var B=C.x;var D=C.y;C.x=Proj4js.common.adjust_lon(this.long0+((B-this.x0)/(this.a*this.rc)));C.y=Proj4js.common.adjust_lat(this.lat0+((D-this.y0)/(this.a)));return C}};Proj4js.Proj.cass={init:function(){if(!this.sphere){this.en=this.pj_enfn(this.es);this.m0=this.pj_mlfn(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en)}},C1:0.16666666666666666,C2:0.008333333333333333,C3:0.041666666666666664,C4:0.3333333333333333,C5:0.06666666666666667,forward:function(E){var B,F;var C=E.x;var D=E.y;C=Proj4js.common.adjust_lon(C-this.long0);if(this.sphere){B=Math.asin(Math.cos(D)*Math.sin(C));F=Math.atan2(Math.tan(D),Math.cos(C))-this.phi0}else{this.n=Math.sin(D);this.c=Math.cos(D);F=this.pj_mlfn(D,this.n,this.c,this.en);this.n=1/Math.sqrt(1-this.es*this.n*this.n);this.tn=Math.tan(D);this.t=this.tn*this.tn;this.a1=C*this.c;this.c*=this.es*this.c/(1-this.es);this.a2=this.a1*this.a1;B=this.n*this.a1*(1-this.a2*this.t*(this.C1-(8-this.t+8*this.c)*this.a2*this.C2));F-=this.m0-this.n*this.tn*this.a2*(0.5+(5-this.t+6*this.c)*this.a2*this.C3)}E.x=this.a*B+this.x0;E.y=this.a*F+this.y0;return E},inverse:function(C){C.x-=this.x0;C.y-=this.y0;var B=C.x/this.a;var D=C.y/this.a;if(this.sphere){this.dd=D+this.lat0;phi=Math.asin(Math.sin(this.dd)*Math.cos(B));lam=Math.atan2(Math.tan(B),Math.cos(this.dd))}else{ph1=this.pj_inv_mlfn(this.m0+D,this.es,this.en);this.tn=Math.tan(ph1);this.t=this.tn*this.tn;this.n=Math.sin(ph1);this.r=1/(1-this.es*this.n*this.n);this.n=Math.sqrt(this.r);this.r*=(1-this.es)*this.n;this.dd=B/this.n;this.d2=this.dd*this.dd;phi=ph1-(this.n*this.tn/this.r)*this.d2*(0.5-(1+3*this.t)*this.d2*this.C3);lam=this.dd*(1+this.t*this.d2*(-this.C4+(1+3*this.t)*this.d2*this.C5))/Math.cos(ph1)}C.x=Proj4js.common.adjust_lon(this.long0+lam);C.y=phi;return C},pj_enfn:function(C){en=new Array();en[0]=this.C00-C*(this.C02+C*(this.C04+C*(this.C06+C*this.C08)));en[1]=C*(this.C22-C*(this.C04+C*(this.C06+C*this.C08)));var B=C*C;en[2]=B*(this.C44-C*(this.C46+C*this.C48));B*=C;en[3]=B*(this.C66-C*this.C68);en[4]=B*C*this.C88;return en},pj_mlfn:function(E,B,D,C){D*=B;B*=B;return(C[0]*E-D*(C[1]+B*(C[2]+B*(C[3]+B*C[4]))))},pj_inv_mlfn:function(B,D,C){k=1/(1-D);phi=B;for(i=Proj4js.common.MAX_ITER;i;--i){s=Math.sin(phi);t=1-D*s*s;t=(this.pj_mlfn(phi,s,Math.cos(phi),C)-B)*(t*Math.sqrt(t))*k;phi-=t;if(Math.abs(t)<Proj4js.common.EPSLN){return phi}}Proj4js.reportError("cass:pj_inv_mlfn: Convergence error");return phi},C00:1,C02:0.25,C04:0.046875,C06:0.01953125,C08:0.01068115234375,C22:0.75,C44:0.46875,C46:0.013020833333333334,C48:0.007120768229166667,C66:0.3645833333333333,C68:0.005696614583333333,C88:0.3076171875};Proj4js.Proj.gauss={init:function(){sphi=Math.sin(this.lat0);cphi=Math.cos(this.lat0);cphi*=cphi;this.rc=Math.sqrt(1-this.es)/(1-this.es*sphi*sphi);this.C=Math.sqrt(1+this.es*cphi*cphi/(1-this.es));this.phic0=Math.asin(sphi/this.C);this.ratexp=0.5*this.C*this.e;this.K=Math.tan(0.5*this.phic0+Proj4js.common.FORTPI)/(Math.pow(Math.tan(0.5*this.lat0+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*sphi,this.ratexp))},forward:function(C){var D=C.x;var B=C.y;C.y=2*Math.atan(this.K*Math.pow(Math.tan(0.5*B+Proj4js.common.FORTPI),this.C)*Proj4js.common.srat(this.e*Math.sin(B),this.ratexp))-Proj4js.common.HALF_PI;C.x=this.C*D;return C},inverse:function(E){var D=1e-14;var F=E.x/this.C;var C=E.y;num=Math.pow(Math.tan(0.5*C+Proj4js.common.FORTPI)/this.K,1/this.C);for(var B=Proj4js.common.MAX_ITER;B>0;--B){C=2*Math.atan(num*Proj4js.common.srat(this.e*Math.sin(E.y),-0.5*this.e))-Proj4js.common.HALF_PI;if(Math.abs(C-E.y)<D){break}E.y=C}if(!B){Proj4js.reportError("gauss:inverse:convergence failed");return null}E.x=F;E.y=C;return E}};Proj4js.Proj.omerc={init:function(){if(!this.mode){this.mode=0}if(!this.lon1){this.lon1=0;this.mode=1}if(!this.lon2){this.lon2=0}if(!this.lat2){this.lat2=0}var B=this.b/this.a;var D=1-Math.pow(B,2);var C=Math.sqrt(D);this.sin_p20=Math.sin(this.lat0);this.cos_p20=Math.cos(this.lat0);this.con=1-this.es*this.sin_p20*this.sin_p20;this.com=Math.sqrt(1-D);this.bl=Math.sqrt(1+this.es*Math.pow(this.cos_p20,4)/(1-D));this.al=this.a*this.bl*this.k0*this.com/this.con;if(Math.abs(this.lat0)<Proj4js.common.EPSLN){this.ts=1;this.d=1;this.el=1}else{this.ts=Proj4js.common.tsfnz(this.e,this.lat0,this.sin_p20);this.con=Math.sqrt(this.con);this.d=this.bl*this.com/(this.cos_p20*this.con);if((this.d*this.d-1)>0){if(this.lat0>=0){this.f=this.d+Math.sqrt(this.d*this.d-1)}else{this.f=this.d-Math.sqrt(this.d*this.d-1)}}else{this.f=this.d}this.el=this.f*Math.pow(this.ts,this.bl)}if(this.mode!=0){this.g=0.5*(this.f-1/this.f);this.gama=Proj4js.common.asinz(Math.sin(this.alpha)/this.d);this.longc=this.longc-Proj4js.common.asinz(this.g*Math.tan(this.gama))/this.bl;this.con=Math.abs(this.lat0);if((this.con>Proj4js.common.EPSLN)&&(Math.abs(this.con-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN)){this.singam=Math.sin(this.gama);this.cosgam=Math.cos(this.gama);this.sinaz=Math.sin(this.alpha);this.cosaz=Math.cos(this.alpha);if(this.lat0>=0){this.u=(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}else{this.u=-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}}else{Proj4js.reportError("omerc:Init:DataError")}}else{this.sinphi=Math.sin(this.at1);this.ts1=Proj4js.common.tsfnz(this.e,this.lat1,this.sinphi);this.sinphi=Math.sin(this.lat2);this.ts2=Proj4js.common.tsfnz(this.e,this.lat2,this.sinphi);this.h=Math.pow(this.ts1,this.bl);this.l=Math.pow(this.ts2,this.bl);this.f=this.el/this.h;this.g=0.5*(this.f-1/this.f);this.j=(this.el*this.el-this.l*this.h)/(this.el*this.el+this.l*this.h);this.p=(this.l-this.h)/(this.l+this.h);this.dlon=this.lon1-this.lon2;if(this.dlon<-Proj4js.common.PI){this.lon2=this.lon2-2*Proj4js.common.PI}if(this.dlon>Proj4js.common.PI){this.lon2=this.lon2+2*Proj4js.common.PI}this.dlon=this.lon1-this.lon2;this.longc=0.5*(this.lon1+this.lon2)-Math.atan(this.j*Math.tan(0.5*this.bl*this.dlon)/this.p)/this.bl;this.dlon=Proj4js.common.adjust_lon(this.lon1-this.longc);this.gama=Math.atan(Math.sin(this.bl*this.dlon)/this.g);this.alpha=Proj4js.common.asinz(this.d*Math.sin(this.gama));if(Math.abs(this.lat1-this.lat2)<=Proj4js.common.EPSLN){Proj4js.reportError("omercInitDataError")}else{this.con=Math.abs(this.lat1)}if((this.con<=Proj4js.common.EPSLN)||(Math.abs(this.con-HALF_PI)<=Proj4js.common.EPSLN)){Proj4js.reportError("omercInitDataError")}else{if(Math.abs(Math.abs(this.lat0)-Proj4js.common.HALF_PI)<=Proj4js.common.EPSLN){Proj4js.reportError("omercInitDataError")}}this.singam=Math.sin(this.gam);this.cosgam=Math.cos(this.gam);this.sinaz=Math.sin(this.alpha);this.cosaz=Math.cos(this.alpha);if(this.lat0>=0){this.u=(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}else{this.u=-(this.al/this.bl)*Math.atan(Math.sqrt(this.d*this.d-1)/this.cosaz)}}},forward:function(Q){var I;var D,Y;var W;var V,M,C;var F,R,T;var P,J,U;var N,S;var O;var B;var G;var E=Q.x;var H=Q.y;D=Math.sin(H);B=Proj4js.common.adjust_lon(E-this.longc);U=Math.sin(this.bl*B);if(Math.abs(Math.abs(H)-Proj4js.common.HALF_PI)>Proj4js.common.EPSLN){G=Proj4js.common.tsfnz(this.e,H,D);P=this.el/(Math.pow(G,this.bl));O=0.5*(P-1/P);M=0.5*(P+1/P);N=(O*this.singam-U*this.cosgam)/M;F=Math.cos(this.bl*B);if(Math.abs(F)<1e-7){J=this.al*this.bl*B}else{J=this.al*Math.atan((O*this.cosgam+U*this.singam)/F)/this.bl;if(F<0){J=J+Proj4js.common.PI*this.al/this.bl}}}else{if(H>=0){N=this.singam}else{N=-this.singam}J=this.al*H/this.bl}if(Math.abs(Math.abs(N)-1)<=Proj4js.common.EPSLN){Proj4js.reportError("omercFwdInfinity")}S=0.5*this.al*Math.log((1-N)/(1+N))/this.bl;J=J-this.u;var L=this.x0+S*this.cosaz+J*this.sinaz;var K=this.y0+J*this.cosaz-S*this.sinaz;Q.x=L;Q.y=K;return Q},inverse:function(N){var Y;var H;var E;var D,W;var V;var T,K,C;var F,O,R;var P,I,M,L,G;var S,J,U;var B;var Q;N.x-=this.x0;N.y-=this.y0;Q=0;P=N.x*this.cosaz-N.y*this.sinaz;I=N.y*this.cosaz+N.x*this.sinaz;I=I+this.u;M=Math.exp(-this.bl*P/this.al);L=0.5*(M-1/M);K=0.5*(M+1/M);S=Math.sin(this.bl*I/this.al);J=(S*this.cosgam+L*this.singam)/K;if(Math.abs(Math.abs(J)-1)<=Proj4js.common.EPSLN){lon=this.longc;if(J>=0){lat=Proj4js.common.HALF_PI}else{lat=-Proj4js.common.HALF_PI}}else{F=1/this.bl;G=Math.pow((this.el/Math.sqrt((1+J)/(1-J))),F);lat=Proj4js.common.phi2z(this.e,G);H=this.longc-Math.atan2((L*this.cosgam-S*this.singam),F)/this.bl;lon=Proj4js.common.adjust_lon(H)}N.x=lon;N.y=lat;return N}};Proj4js.Proj.lcc={init:function(){if(!this.lat2){this.lat2=this.lat0}if(!this.k0){this.k0=1}if(Math.abs(this.lat1+this.lat2)<Proj4js.common.EPSLN){Proj4js.reportError("lcc:init: Equal Latitudes");return }var K=this.b/this.a;this.e=Math.sqrt(1-K*K);var H=Math.sin(this.lat1);var F=Math.cos(this.lat1);var J=Proj4js.common.msfnz(this.e,H,F);var C=Proj4js.common.tsfnz(this.e,this.lat1,H);var G=Math.sin(this.lat2);var E=Math.cos(this.lat2);var I=Proj4js.common.msfnz(this.e,G,E);var B=Proj4js.common.tsfnz(this.e,this.lat2,G);var D=Proj4js.common.tsfnz(this.e,this.lat0,Math.sin(this.lat0));if(Math.abs(this.lat1-this.lat2)>Proj4js.common.EPSLN){this.ns=Math.log(J/I)/Math.log(C/B)}else{this.ns=H}this.f0=J/(this.ns*Math.pow(C,this.ns));this.rh=this.a*this.f0*Math.pow(D,this.ns);if(!this.title){this.title="Lambert Conformal Conic"}},forward:function(F){var G=F.x;var E=F.y;if(E<=90&&E>=-90&&G<=180&&G>=-180){}else{Proj4js.reportError("lcc:forward: llInputOutOfRange: "+G+" : "+E);return null}var B=Math.abs(Math.abs(E)-Proj4js.common.HALF_PI);var D,H;if(B>Proj4js.common.EPSLN){D=Proj4js.common.tsfnz(this.e,E,Math.sin(E));H=this.a*this.f0*Math.pow(D,this.ns)}else{B=E*this.ns;if(B<=0){Proj4js.reportError("lcc:forward: No Projection");return null}H=0}var C=this.ns*Proj4js.common.adjust_lon(G-this.long0);F.x=this.k0*(H*Math.sin(C))+this.x0;F.y=this.k0*(this.rh-H*Math.cos(C))+this.y0;return F},inverse:function(C){var F,D,G;var H,B;var J=(C.x-this.x0)/this.k0;var I=(this.rh-(C.y-this.y0)/this.k0);if(this.ns>0){F=Math.sqrt(J*J+I*I);D=1}else{F=-Math.sqrt(J*J+I*I);D=-1}var E=0;if(F!=0){E=Math.atan2((D*J),(D*I))}if((F!=0)||(this.ns>0)){D=1/this.ns;G=Math.pow((F/(this.a*this.f0)),D);H=Proj4js.common.phi2z(this.e,G);if(H==-9999){return null}}else{H=-Proj4js.common.HALF_PI}B=Proj4js.common.adjust_lon(E/this.ns+this.long0);C.x=B;C.y=H;return C}};Proj4js.Proj.laea={S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4,init:function(){var B=Math.abs(this.lat0);if(Math.abs(B-Proj4js.common.HALF_PI)<Proj4js.common.EPSLN){this.mode=this.lat0<0?this.S_POLE:this.N_POLE}else{if(Math.abs(B)<Proj4js.common.EPSLN){this.mode=this.EQUIT}else{this.mode=this.OBLIQ}}if(this.es>0){var C;this.qp=Proj4js.common.qsfnz(this.e,1);this.mmf=0.5/(1-this.es);this.apa=this.authset(this.es);switch(this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(0.5*this.qp);this.dd=1/this.rq;this.xmf=1;this.ymf=0.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(0.5*this.qp);C=Math.sin(this.lat0);this.sinb1=Proj4js.common.qsfnz(this.e,C)/this.qp;this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1);this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*C*C)*this.rq*this.cosb1);this.ymf=(this.xmf=this.rq)/this.dd;this.xmf*=this.dd;break}}else{if(this.mode==this.OBLIQ){this.sinph0=Math.sin(this.lat0);this.cosph0=Math.cos(this.lat0)}}},forward:function(E){var M,K;var N=E.x;var I=E.y;N=Proj4js.common.adjust_lon(N-this.long0);if(this.sphere){var L,G,C;C=Math.sin(I);G=Math.cos(I);L=Math.cos(N);switch(this.mode){case this.OBLIQ:case this.EQUIT:K=(this.mode==this.EQUIT)?1+G*L:1+this.sinph0*C+this.cosph0*G*L;if(K<=Proj4js.common.EPSLN){Proj4js.reportError("laea:fwd:y less than eps");return null}K=Math.sqrt(2/K);M=K*G*Math.sin(N);K*=(this.mode==this.EQUIT)?C:this.cosph0*C-this.sinph0*G*L;break;case this.N_POLE:L=-L;case this.S_POLE:if(Math.abs(I+this.phi0)<Proj4js.common.EPSLN){Proj4js.reportError("laea:fwd:phi < eps");return null}K=Proj4js.common.FORTPI-I*0.5;K=2*((this.mode==this.S_POLE)?Math.cos(K):Math.sin(K));M=K*Math.sin(N);K*=L;break}}else{var L,H,C,D,F=0,B=0,J=0;L=Math.cos(N);H=Math.sin(N);C=Math.sin(I);D=Proj4js.common.qsfnz(this.e,C);if(this.mode==this.OBLIQ||this.mode==this.EQUIT){F=D/this.qp;B=Math.sqrt(1-F*F)}switch(this.mode){case this.OBLIQ:J=1+this.sinb1*F+this.cosb1*B*L;break;case this.EQUIT:J=1+B*L;break;case this.N_POLE:J=Proj4js.common.HALF_PI+I;D=this.qp-D;break;case this.S_POLE:J=I-Proj4js.common.HALF_PI;D=this.qp+D;break}if(Math.abs(J)<Proj4js.common.EPSLN){Proj4js.reportError("laea:fwd:b < eps");return null}switch(this.mode){case this.OBLIQ:case this.EQUIT:J=Math.sqrt(2/J);if(this.mode==this.OBLIQ){K=this.ymf*J*(this.cosb1*F-this.sinb1*B*L)}else{K=(J=Math.sqrt(2/(1+B*L)))*F*this.ymf}M=this.xmf*J*B*H;break;case this.N_POLE:case this.S_POLE:if(D>=0){M=(J=Math.sqrt(D))*H;K=L*((this.mode==this.S_POLE)?J:-J)}else{M=K=0}break}}E.x=this.a*M+this.x0;E.y=this.a*K+this.y0;return E},inverse:function(C){C.x-=this.x0;C.y-=this.y0;var I=C.x/this.a;var G=C.y/this.a;if(this.sphere){var M=0,K,D=0;K=Math.sqrt(I*I+G*G);var F=K*0.5;if(F>1){Proj4js.reportError("laea:Inv:DataError");return null}F=2*Math.asin(F);if(this.mode==this.OBLIQ||this.mode==this.EQUIT){D=Math.sin(F);M=Math.cos(F)}switch(this.mode){case this.EQUIT:F=(Math.abs(K)<=Proj4js.common.EPSLN)?0:Math.asin(G*D/K);I*=D;G=M*K;break;case this.OBLIQ:F=(Math.abs(K)<=Proj4js.common.EPSLN)?this.phi0:Math.asin(M*sinph0+G*D*cosph0/K);I*=D*cosph0;G=(M-Math.sin(F)*sinph0)*K;break;case this.N_POLE:G=-G;F=Proj4js.common.HALF_PI-F;break;case this.S_POLE:F-=Proj4js.common.HALF_PI;break}lam=(G==0&&(this.mode==this.EQUIT||this.mode==this.OBLIQ))?0:Math.atan2(I,G)}else{var J,E,B,H,L=0;switch(this.mode){case this.EQUIT:case this.OBLIQ:I/=this.dd;G*=this.dd;H=Math.sqrt(I*I+G*G);if(H<Proj4js.common.EPSLN){C.x=0;C.y=this.phi0;return C}E=2*Math.asin(0.5*H/this.rq);J=Math.cos(E);I*=(E=Math.sin(E));if(this.mode==this.OBLIQ){L=J*this.sinb1+G*E*this.cosb1/H;B=this.qp*L;G=H*this.cosb1*J-G*this.sinb1*E}else{L=G*E/H;B=this.qp*L;G=H*J}break;case this.N_POLE:G=-G;case this.S_POLE:B=(I*I+G*G);if(!B){C.x=0;C.y=this.phi0;return C}L=1-B/this.qp;if(this.mode==this.S_POLE){L=-L}break}lam=Math.atan2(I,G);F=this.authlat(Math.asin(L),this.apa)}C.x=Proj4js.common.adjust_lon(this.long0+lam);C.y=F;return C},P00:0.3333333333333333,P01:0.17222222222222222,P02:0.10257936507936508,P10:0.06388888888888888,P11:0.0664021164021164,P20:0.016415012942191543,authset:function(C){var B;var D=new Array();D[0]=C*this.P00;B=C*C;D[0]+=B*this.P01;D[1]=B*this.P10;B*=C;D[0]+=B*this.P02;D[1]+=B*this.P11;D[2]=B*this.P20;return D},authlat:function(C,D){var B=C+C;return(C+D[0]*Math.sin(B)+D[1]*Math.sin(B+B)+D[2]*Math.sin(B+B+B))}};Proj4js.Proj.aeqd={init:function(){this.sin_p12=Math.sin(this.lat0);this.cos_p12=Math.cos(this.lat0)},forward:function(D){var C=D.x;var I=D.y;var F;var B=Math.sin(D.y);var E=Math.cos(D.y);var K=Proj4js.common.adjust_lon(C-this.long0);var J=Math.cos(K);var G=this.sin_p12*B+this.cos_p12*E*J;if(Math.abs(Math.abs(G)-1)<Proj4js.common.EPSLN){F=1;if(G<0){Proj4js.reportError("aeqd:Fwd:PointError");return }}else{var H=Math.acos(G);F=H/Math.sin(H)}D.x=this.x0+this.a*F*E*Math.sin(K);D.y=this.y0+this.a*F*(this.cos_p12*B-this.sin_p12*E*J);return D},inverse:function(C){C.x-=this.x0;C.y-=this.y0;var H=Math.sqrt(C.x*C.x+C.y*C.y);if(H>(2*Proj4js.common.HALF_PI*this.a)){Proj4js.reportError("aeqdInvDataError");return }var F=H/this.a;var E=Math.sin(F);var J=Math.cos(F);var B=this.long0;var G;if(Math.abs(H)<=Proj4js.common.EPSLN){G=this.lat0}else{G=Proj4js.common.asinz(J*this.sin_p12+(C.y*E*this.cos_p12)/H);var D=Math.abs(this.lat0)-Proj4js.common.HALF_PI;if(Math.abs(D)<=Proj4js.common.EPSLN){if(lat0>=0){B=Proj4js.common.adjust_lon(this.long0+Math.atan2(C.x,-C.y))}else{B=Proj4js.common.adjust_lon(this.long0-Math.atan2(-C.x,C.y))}}else{D=J-this.sin_p12*Math.sin(G);if((Math.abs(D)<Proj4js.common.EPSLN)&&(Math.abs(C.x)<Proj4js.common.EPSLN)){}else{var I=Math.atan2((C.x*E*this.cos_p12),(D*H));B=Proj4js.common.adjust_lon(this.long0+Math.atan2((C.x*E*this.cos_p12),(D*H)))}}}C.x=B;C.y=G;return C}};Proj4js.Proj.moll={init:function(){},forward:function(D){var B=D.x;var I=D.y;var G=Proj4js.common.adjust_lon(B-this.long0);var F=I;var E=Proj4js.common.PI*Math.sin(I);for(var H=0;true;H++){var C=-(F+Math.sin(F)-E)/(1+Math.cos(F));F+=C;if(Math.abs(C)<Proj4js.common.EPSLN){break}if(H>=50){Proj4js.reportError("moll:Fwd:IterationError")}}F/=2;if(Proj4js.common.PI/2-Math.abs(I)<Proj4js.common.EPSLN){G=0}var K=0.900316316158*this.a*G*Math.cos(F)+this.x0;var J=1.4142135623731*this.a*Math.sin(F)+this.y0;D.x=K;D.y=J;return D},inverse:function(E){var C;var B;E.x-=this.x0;var B=E.y/(1.4142135623731*this.a);if(Math.abs(B)>0.999999999999){B=0.999999999999}var C=Math.asin(B);var F=Proj4js.common.adjust_lon(this.long0+(E.x/(0.900316316158*this.a*Math.cos(C))));if(F<(-Proj4js.common.PI)){F=-Proj4js.common.PI}if(F>Proj4js.common.PI){F=Proj4js.common.PI}B=(2*C+Math.sin(2*C))/Proj4js.common.PI;if(Math.abs(B)>1){B=1}var D=Math.asin(B);E.x=F;E.y=D;return E}};var OpenLayers={VERSION_NUMBER:"$Revision: 2342 $",singleFile:true,_getScriptLocation:(function(){var G=new RegExp("(^|(.*?\\/))(OpenLayers.js)(\\?|$)"),F=document.getElementsByTagName("script"),H,C,D="";for(var E=0,B=F.length;E<B;E++){H=F[E].getAttribute("src");if(H){var C=H.match(G);if(C){D=C[1];break}}}return(function(){return D})})()};OpenLayers.Class=function(){var B=arguments.length;var G=arguments[0];var E=arguments[B-1];var H=typeof E.initialize=="function"?E.initialize:function(){G.apply(this,arguments)};if(B>1){var D=[H,G].concat(Array.prototype.slice.call(arguments).slice(1,B-1),E);OpenLayers.inherit.apply(null,D)}else{H.prototype=E}return H};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(D){var E=function(){D.call(this)};var B=[E].concat(Array.prototype.slice.call(arguments));OpenLayers.inherit.apply(null,B);return E.prototype};OpenLayers.inherit=function(I,G){var E=function(){};E.prototype=G.prototype;I.prototype=new E;var D,B,H;for(D=2,B=arguments.length;D<B;D++){H=arguments[D];if(typeof H==="function"){H=H.prototype}OpenLayers.Util.extend(I.prototype,H)}};OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.extend=function(B,F){B=B||{};if(F){for(var E in F){var D=F[E];if(D!==undefined){B[E]=D}}var C=typeof window.Event=="function"&&F instanceof window.Event;if(!C&&F.hasOwnProperty&&F.hasOwnProperty("toString")){B.toString=F.toString}}return B};OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(B){alert(B)},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 C=document.getElementsByTagName("script");for(var D=0,B=C.length;D<B;++D){if(C[D].src.indexOf("firebug.js")!=-1){if(console){OpenLayers.Util.extend(OpenLayers.Console,console);break}}}})();OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(C){var E;if(!C){C=(OpenLayers.BROWSER_NAME=="msie")?navigator.userLanguage:navigator.language}var D=C.split("-");D[0]=D[0].toLowerCase();if(typeof OpenLayers.Lang[D[0]]=="object"){E=D[0]}if(D[1]){var B=D[0]+"-"+D[1].toUpperCase();if(typeof OpenLayers.Lang[B]=="object"){E=B}}if(!E){OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+D.join("-")+" dictionary, falling back to default language");E=OpenLayers.Lang.defaultCode}OpenLayers.Lang.code=E},translate:function(C,B){var E=OpenLayers.Lang[OpenLayers.Lang.getCode()];var D=E&&E[C];if(!D){D=C}if(B){D=OpenLayers.String.format(D,B)}return D}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.String={startsWith:function(C,B){return(C.indexOf(B)==0)},contains:function(C,B){return(C.indexOf(B)!=-1)},trim:function(B){return B.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(G){var E=G.split("-");var C=E[0];for(var D=1,B=E.length;D<B;D++){var F=E[D];C+=F.charAt(0).toUpperCase()+F.substring(1)}return C},format:function(E,D,B){if(!D){D=window}var C=function(J,F){var I;var H=F.split(/\.+/);for(var G=0;G<H.length;G++){if(G==0){I=D}I=I[H[G]]}if(typeof I=="function"){I=B?I.apply(null,B):I()}if(typeof I=="undefined"){return"undefined"}else{return I}};return E.replace(OpenLayers.String.tokenRegEx,C)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(B){return OpenLayers.String.numberRegEx.test(B)},numericIf:function(B){return OpenLayers.String.isNumeric(B)?parseFloat(B):B}};if(!String.prototype.startsWith){String.prototype.startsWith=function(B){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,B)}}if(!String.prototype.contains){String.prototype.contains=function(B){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,B)}}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(B,D){var C=0;if(D>0){C=parseFloat(B.toPrecision(D))}return C},format:function(D,B,H,J){B=(typeof B!="undefined")?B:0;H=(typeof H!="undefined")?H:OpenLayers.Number.thousandsSeparator;J=(typeof J!="undefined")?J:OpenLayers.Number.decimalSeparator;if(B!=null){D=parseFloat(D.toFixed(B))}var C=D.toString().split(".");if(C.length==1&&B==null){B=0}var E=C[0];if(H){var F=/(-?[0-9]+)([0-9]{3})/;while(F.test(E)){E=E.replace(F,"$1"+H+"$2")}}var G;if(B==0){G=E}else{var I=C.length>1?C[1]:"0";if(B!=null){I=I+new Array(B-I.length+1).join("0")}G=E+J+I}return G}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(B){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,B)}}OpenLayers.Function={bind:function(D,C){var B=Array.prototype.slice.apply(arguments,[2]);return function(){var E=B.concat(Array.prototype.slice.apply(arguments,[0]));return D.apply(C,E)}},bindAsEventListener:function(C,B){return function(D){return C.call(B,D||window.event)}},False:function(){return false},True:function(){return true}};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(B){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,B)}}OpenLayers.Array={filter:function(H,G,C){var E=[];if(Array.prototype.filter){E=H.filter(G,C)}else{var B=H.length;if(typeof G!="function"){throw new TypeError()}for(var D=0;D<B;D++){if(D in H){var F=H[D];if(G.call(C,F,D,H)){E.push(F)}}}}return E}};OpenLayers.Date={toISOString:(function(){if("toISOString" in Date.prototype){return function(C){return C.toISOString()}}else{function B(D,C){var E=D+"";while(E.length<C){E="0"+E}return E}return function(C){var D;if(isNaN(C.getTime())){D="Invalid Date"}else{D=C.getUTCFullYear()+"-"+B(C.getUTCMonth()+1,2)+"-"+B(C.getUTCDate(),2)+"T"+B(C.getUTCHours(),2)+":"+B(C.getUTCMinutes(),2)+":"+B(C.getUTCSeconds(),2)+"."+B(C.getUTCMilliseconds(),3)+"Z"}return D}}})(),parse:function(K){var C;var Q=Date.parse(K);if(!isNaN(Q)){C=new Date(Q)}else{var I=K.match(/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))?$/);if(I&&(I[1]||I[7])){var L=parseInt(I[1],10)||0;var J=(parseInt(I[2],10)-1)||0;var N=parseInt(I[3],10)||1;C=new Date(Date.UTC(L,J,N));var M=I[7];if(M){var O=parseInt(I[4],10);var E=parseInt(I[5],10);var B=parseFloat(I[6]);var P=B|0;var D=Math.round(1000*(B-P));C.setUTCHours(O,E,P,D);if(M!=="Z"){var H=parseInt(M,10);var G=parseInt(I[8],10)||0;var F=-1000*(60*(H*60)+G*60);C=new Date(C.getTime()+F)}}}else{C=new Date("invalid")}}return C}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(E,B,C,D){if(E!=null){this.left=OpenLayers.Util.toFloat(E)}if(B!=null){this.bottom=OpenLayers.Util.toFloat(B)}if(C!=null){this.right=OpenLayers.Util.toFloat(C)}if(D!=null){this.top=OpenLayers.Util.toFloat(D)}},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(C){var B=false;if(C!=null){B=((this.left==C.left)&&(this.right==C.right)&&(this.top==C.top)&&(this.bottom==C.bottom))}return B},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(B){if(B===true){return[this.bottom,this.left,this.top,this.right]}else{return[this.left,this.bottom,this.right,this.top]}},toBBOX:function(C,F){if(C==null){C=6}var H=Math.pow(10,C);var G=Math.round(this.left*H)/H;var E=Math.round(this.bottom*H)/H;var D=Math.round(this.right*H)/H;var B=Math.round(this.top*H)/H;if(F===true){return E+","+G+","+B+","+D}else{return G+","+E+","+D+","+B}},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,D){if(D==null){D=this.getCenterLonLat()}var B,I;if(D.CLASS_NAME=="OpenLayers.LonLat"){B=D.lon;I=D.lat}else{B=D.x;I=D.y}var H=(this.left-B)*F+B;var C=(this.bottom-I)*F+I;var E=(this.right-B)*F+B;var G=(this.top-I)*F+I;return new OpenLayers.Bounds(H,C,E,G)},add:function(B,D){if((B==null)||(D==null)){var C=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(C);return null}return new OpenLayers.Bounds(this.left+B,this.bottom+D,this.right+B,this.top+D)},extend:function(B){var C=null;if(B){switch(B.CLASS_NAME){case"OpenLayers.LonLat":C=new OpenLayers.Bounds(B.lon,B.lat,B.lon,B.lat);break;case"OpenLayers.Geometry.Point":C=new OpenLayers.Bounds(B.x,B.y,B.x,B.y);break;case"OpenLayers.Bounds":C=B;break}if(C){this.centerLonLat=null;if((this.left==null)||(C.left<this.left)){this.left=C.left}if((this.bottom==null)||(C.bottom<this.bottom)){this.bottom=C.bottom}if((this.right==null)||(C.right>this.right)){this.right=C.right}if((this.top==null)||(C.top>this.top)){this.top=C.top}}}},containsLonLat:function(C,B){return this.contains(C.lon,C.lat,B)},containsPixel:function(C,B){return this.contains(C.x,C.y,B)},contains:function(C,E,B){if(B==null){B=true}if(C==null||E==null){return false}C=OpenLayers.Util.toFloat(C);E=OpenLayers.Util.toFloat(E);var D=false;if(B){D=((C>=this.left)&&(C<=this.right)&&(E>=this.bottom)&&(E<=this.top))}else{D=((C>this.left)&&(C<this.right)&&(E>this.bottom)&&(E<this.top))}return D},intersectsBounds:function(F,C){if(C==null){C=true}var E=false;var I=(this.left==F.right||this.right==F.left||this.top==F.bottom||this.bottom==F.top);if(C||!I){var H=(((F.bottom>=this.bottom)&&(F.bottom<=this.top))||((this.bottom>=F.bottom)&&(this.bottom<=F.top)));var G=(((F.top>=this.bottom)&&(F.top<=this.top))||((this.top>F.bottom)&&(this.top<F.top)));var D=(((F.left>=this.left)&&(F.left<=this.right))||((this.left>=F.left)&&(this.left<=F.right)));var B=(((F.right>=this.left)&&(F.right<=this.right))||((this.right>=F.left)&&(this.right<=F.right)));E=((H||G)&&(D||B))}return E},containsBounds:function(H,C,B){if(C==null){C=false}if(B==null){B=true}var D=this.contains(H.left,H.bottom,B);var E=this.contains(H.right,H.bottom,B);var G=this.contains(H.left,H.top,B);var F=this.contains(H.right,H.top,B);return(C)?(D||E||G||F):(D&&E&&G&&F)},determineQuadrant:function(D){var C="";var B=this.getCenterLonLat();C+=(D.lat<B.lat)?"b":"t";C+=(D.lon<B.lon)?"l":"r";return C},transform:function(E,C){this.centerLonLat=null;var F=OpenLayers.Projection.transform({x:this.left,y:this.bottom},E,C);var B=OpenLayers.Projection.transform({x:this.right,y:this.bottom},E,C);var D=OpenLayers.Projection.transform({x:this.left,y:this.top},E,C);var G=OpenLayers.Projection.transform({x:this.right,y:this.top},E,C);this.left=Math.min(F.x,D.x);this.bottom=Math.min(F.y,B.y);this.right=Math.max(B.x,G.x);this.top=Math.max(D.y,G.y);return this},wrapDateLine:function(B,D){D=D||{};var E=D.leftTolerance||0;var C=D.rightTolerance||0;var F=this.clone();if(B){while(F.left<B.left&&(F.right-C)<=B.left){F=F.add(B.getWidth(),0)}while((F.left+E)>=B.right&&F.right>B.right){F=F.add(-B.getWidth(),0)}}return F},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(D,C){var B=D.split(",");return OpenLayers.Bounds.fromArray(B,C)};OpenLayers.Bounds.fromArray=function(C,B){return B===true?new OpenLayers.Bounds(parseFloat(C[1]),parseFloat(C[0]),parseFloat(C[3]),parseFloat(C[2])):new OpenLayers.Bounds(parseFloat(C[0]),parseFloat(C[1]),parseFloat(C[2]),parseFloat(C[3]))};OpenLayers.Bounds.fromSize=function(B){return new OpenLayers.Bounds(0,B.h,B.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(B){var C="";C+=(B.charAt(0)=="t")?"b":"t";C+=(B.charAt(1)=="l")?"r":"l";return C};OpenLayers.Element={visible:function(B){return OpenLayers.Util.getElement(B).style.display!="none"},toggle:function(){for(var D=0,B=arguments.length;D<B;D++){var C=OpenLayers.Util.getElement(arguments[D]);var E=OpenLayers.Element.visible(C)?"hide":"show";OpenLayers.Element[E](C)}},hide:function(){for(var D=0,B=arguments.length;D<B;D++){var C=OpenLayers.Util.getElement(arguments[D]);if(C){C.style.display="none"}}},show:function(){for(var D=0,B=arguments.length;D<B;D++){var C=OpenLayers.Util.getElement(arguments[D]);if(C){C.style.display=""}}},remove:function(B){B=OpenLayers.Util.getElement(B);B.parentNode.removeChild(B)},getHeight:function(B){B=OpenLayers.Util.getElement(B);return B.offsetHeight},getDimensions:function(D){D=OpenLayers.Util.getElement(D);if(OpenLayers.Element.getStyle(D,"display")!="none"){return{width:D.offsetWidth,height:D.offsetHeight}}var C=D.style;var G=C.visibility;var E=C.position;var B=C.display;C.visibility="hidden";C.position="absolute";C.display="";var H=D.clientWidth;var F=D.clientHeight;C.display=B;C.position=E;C.visibility=G;return{width:H,height:F}},hasClass:function(C,B){var D=C.className;return(!!D&&new RegExp("(^|\\s)"+B+"(\\s|$)").test(D))},addClass:function(C,B){if(!OpenLayers.Element.hasClass(C,B)){C.className+=(C.className?" ":"")+B}return C},removeClass:function(C,B){var D=C.className;if(D){C.className=OpenLayers.String.trim(D.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," "))}return C},toggleClass:function(C,B){if(OpenLayers.Element.hasClass(C,B)){OpenLayers.Element.removeClass(C,B)}else{OpenLayers.Element.addClass(C,B)}return C},getStyle:function(D,E){D=OpenLayers.Util.getElement(D);var F=null;if(D&&D.style){F=D.style[OpenLayers.String.camelize(E)];if(!F){if(document.defaultView&&document.defaultView.getComputedStyle){var C=document.defaultView.getComputedStyle(D,null);F=C?C.getPropertyValue(E):null}else{if(D.currentStyle){F=D.currentStyle[OpenLayers.String.camelize(E)]}}}var B=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(B,E)!=-1)&&(OpenLayers.Element.getStyle(D,"position")=="static")){F="auto"}}return F=="auto"?null:F}};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(C,B){this.lon=OpenLayers.Util.toFloat(C);this.lat=OpenLayers.Util.toFloat(B)},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(D,B){if((D==null)||(B==null)){var C=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(C);return null}return new OpenLayers.LonLat(this.lon+OpenLayers.Util.toFloat(D),this.lat+OpenLayers.Util.toFloat(B))},equals:function(C){var B=false;if(C!=null){B=((this.lon==C.lon&&this.lat==C.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(C.lon)&&isNaN(C.lat)))}return B},transform:function(D,C){var B=OpenLayers.Projection.transform({x:this.lon,y:this.lat},D,C);this.lon=B.x;this.lat=B.y;return this},wrapDateLine:function(B){var C=this.clone();if(B){while(C.lon<B.left){C.lon+=B.getWidth()}while(C.lon>B.right){C.lon-=B.getWidth()}}return C},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(C){var B=C.split(",");return new OpenLayers.LonLat(B[0],B[1])};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(B,C){this.x=parseFloat(B);this.y=parseFloat(C)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(B){var C=false;if(B!=null){C=((this.x==B.x&&this.y==B.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(B.x)&&isNaN(B.y)))}return C},add:function(B,D){if((B==null)||(D==null)){var C=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(C);return null}return new OpenLayers.Pixel(this.x+B,this.y+D)},offset:function(B){var C=this.clone();if(B){C=this.add(B.x,B.y)}return C},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(B,C){this.w=parseFloat(B);this.h=parseFloat(C)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(C){var B=false;if(C!=null){B=((this.w==C.w&&this.h==C.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(C.w)&&isNaN(C.h)))}return B},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.getElement=function(){var E=[];for(var D=0,B=arguments.length;D<B;D++){var C=arguments[D];if(typeof C=="string"){C=document.getElementById(C)}if(arguments.length==1){return C}E.push(C)}return E};OpenLayers.Util.isElement=function(B){return !!(B&&B.nodeType===1)};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.removeItem=function(D,C){for(var B=D.length-1;B>=0;B--){if(D[B]==C){D.splice(B,1)}}return D};OpenLayers.Util.clearArray=function(B){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));B.length=0};OpenLayers.Util.indexOf=function(E,D){if(typeof E.indexOf=="function"){return E.indexOf(D)}else{for(var C=0,B=E.length;C<B;C++){if(E[C]==D){return C}}return -1}};OpenLayers.Util.modifyDOMElement=function(F,I,E,G,B,D,H,C){if(I){F.id=I}if(E){F.style.left=E.x+"px";F.style.top=E.y+"px"}if(G){F.style.width=G.w+"px";F.style.height=G.h+"px"}if(B){F.style.position=B}if(D){F.style.border=D}if(H){F.style.overflow=H}if(parseFloat(C)>=0&&parseFloat(C)<1){F.style.filter="alpha(opacity="+(C*100)+")";F.style.opacity=C}else{if(parseFloat(C)==1){F.style.filter="";F.style.opacity=""}}};OpenLayers.Util.createDiv=function(B,J,I,G,F,D,C,H){var E=document.createElement("div");if(G){E.style.backgroundImage="url("+G+")"}if(!B){B=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!F){F="absolute"}OpenLayers.Util.modifyDOMElement(E,B,J,I,F,D,C,H);return E};OpenLayers.Util.createImage=function(B,I,H,F,E,D,G,J){var C=document.createElement("img");if(!B){B=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!E){E="relative"}OpenLayers.Util.modifyDOMElement(C,B,I,H,E,D,null,G);if(J){C.style.display="none";OpenLayers.Event.observe(C,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,C));OpenLayers.Event.observe(C,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,C))}C.style.alt=B;C.galleryImg="no";if(F){C.src=F}return C};OpenLayers.Util.setOpacity=function(C,B){OpenLayers.Util.modifyDOMElement(C,null,null,null,null,null,null,B)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.display=""}OpenLayers.Element.removeClass(this,"olImageLoadError")};OpenLayers.IMAGE_RELOAD_ATTEMPTS=0;OpenLayers.Util.onImageLoadError=function(){this._attempts=(this._attempts)?(this._attempts+1):1;if(this._attempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS){var E=this.urls;if(E&&E instanceof Array&&E.length>1){var F=this.src.toString();var D,B;for(B=0;D=E[B];B++){if(F.indexOf(D)!=-1){break}}var G=Math.floor(E.length*Math.random());var C=E[G];B=0;while(C==D&&B++<4){G=Math.floor(E.length*Math.random());C=E[G]}this.src=F.replace(D,C)}else{this.src=this.src}}else{OpenLayers.Element.addClass(this,"olImageLoadError")}this.style.display=""};OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var E=navigator.appVersion.split("MSIE");var B=parseFloat(E[1]);var C=false;try{C=!!(document.body.filters)}catch(D){}OpenLayers.Util.alphaHackNeeded=(C&&(B>=5.5)&&(B<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(B,C,K,J,H,G,D,E,I){OpenLayers.Util.modifyDOMElement(B,C,K,J,G,null,null,I);var F=B.childNodes[0];if(H){F.src=H}OpenLayers.Util.modifyDOMElement(F,B.id+"_innerImage",null,J,"relative",D);if(OpenLayers.Util.alphaHack()){if(B.style.display!="none"){B.style.display="inline-block"}if(E==null){E="scale"}B.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+F.src+"', sizingMethod='"+E+"')";if(parseFloat(B.style.opacity)>=0&&parseFloat(B.style.opacity)<1){B.style.filter+=" alpha(opacity="+B.style.opacity*100+")"}F.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(C,K,J,H,G,D,E,I,L){var B=OpenLayers.Util.createDiv();var F=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);B.appendChild(F);if(L){F.style.display="none";OpenLayers.Event.observe(F,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,B));OpenLayers.Event.observe(F,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,B))}OpenLayers.Util.modifyAlphaImageDiv(B,C,K,J,H,G,D,E,I);return B};OpenLayers.Util.upperCaseObject=function(C){var B={};for(var D in C){B[D.toUpperCase()]=C[D]}return B};OpenLayers.Util.applyDefaults=function(E,D){E=E||{};var C=typeof window.Event=="function"&&D instanceof window.Event;for(var B in D){if(E[B]===undefined||(!C&&D.hasOwnProperty&&D.hasOwnProperty(B)&&!E.hasOwnProperty(B))){E[B]=D[B]}}if(!C&&D&&D.hasOwnProperty&&D.hasOwnProperty("toString")&&!E.hasOwnProperty("toString")){E.toString=D.toString}return E};OpenLayers.Util.getParameterString=function(D){var C=[];for(var I in D){var H=D[I];if((H!=null)&&(typeof H!="function")){var E;if(typeof H=="object"&&H.constructor==Array){var F=[];var J;for(var B=0,G=H.length;B<G;B++){J=H[B];F.push(encodeURIComponent((J===null||J===undefined)?"":J))}E=F.join(",")}else{E=encodeURIComponent(H)}C.push(encodeURIComponent(I)+"="+E)}}return C.join("&")};OpenLayers.Util.urlAppend=function(B,C){var E=B;if(C){var D=(B+" ").split(/[?&]/);E+=(D.pop()===" "?C:D.length?"&"+C:"?"+C)}return E};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var E=null;for(var D=0,B=arguments.length;D<B;D++){var C=arguments[D];try{E=C();break}catch(F){}}return E};OpenLayers.Util.getNodes=function(D,C){var B=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(D.documentElement.childNodes,C)},function(){return OpenLayers.Util._getNodes(D.childNodes,C)});return B};OpenLayers.Util._getNodes=function(D,F){var C=[];for(var E=0,B=D.length;E<B;E++){if(D[E].nodeName==F){C.push(D[E])}}return C};OpenLayers.Util.getTagText=function(D,E,C){var B=OpenLayers.Util.getNodes(D,E);if(B&&(B.length>0)){if(!C){C=0}if(B[C].childNodes.length>1){return B.childNodes[1].nodeValue}else{if(B[C].childNodes.length==1){return B[C].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(B){var C=null;OpenLayers.Util.Try(function(){C=B.text;if(!C){C=B.textContent}if(!C){C=B.firstChild.nodeValue}},function(){C=B.textContent});return C};OpenLayers.Util.mouseLeft=function(B,D){var C=(B.relatedTarget)?B.relatedTarget:B.toElement;while(C!=D&&C!=null){C=C.parentNode}return(C!=D)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(C,B){if(B==null){B=OpenLayers.Util.DEFAULT_PRECISION}if(typeof C!=="number"){C=parseFloat(C)}return B===0?C:parseFloat(C.toPrecision(B))};OpenLayers.Util.rad=function(B){return B*Math.PI/180};OpenLayers.Util.deg=function(B){return B*180/Math.PI};OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563};OpenLayers.Util.distVincenty=function(F,E){var J=OpenLayers.Util.VincentyConstants;var r=J.a,q=J.b,j=J.f;var N=OpenLayers.Util.rad(E.lon-F.lon);var p=Math.atan((1-j)*Math.tan(OpenLayers.Util.rad(F.lat)));var m=Math.atan((1-j)*Math.tan(OpenLayers.Util.rad(E.lat)));var M=Math.sin(p),H=Math.cos(p);var K=Math.sin(m),G=Math.cos(m);var R=N,O=2*Math.PI;var Q=20;while(Math.abs(R-O)>1e-12&&--Q>0){var Z=Math.sin(R),D=Math.cos(R);var u=Math.sqrt((G*Z)*(G*Z)+(H*K-M*G*D)*(H*K-M*G*D));if(u==0){return 0}var g=M*K+H*G*D;var Y=Math.atan2(u,g);var I=Math.asin(H*G*Z/u);var h=Math.cos(I)*Math.cos(I);var P=g-2*M*K/h;var U=j/16*h*(4+j*(4-3*h));O=R;R=N+(1-U)*j*Math.sin(I)*(Y+U*u*(P+U*g*(-1+2*P*P)))}if(Q==0){return NaN}var T=h*(r*r-q*q)/(q*q);var W=1+T/16384*(4096+T*(-768+T*(320-175*T)));var V=T/1024*(256+T*(-128+T*(74-47*T)));var e=V*u*(P+V/4*(g*(-1+2*P*P)-V/6*P*(-3+4*u*u)*(-3+4*P*P)));var S=q*W*(Y-e);var l=S.toFixed(3)/1000;return l};OpenLayers.Util.destinationVincenty=function(M,z,e){var P=OpenLayers.Util;var I=P.VincentyConstants;var AA=I.a,v=I.b,m=I.f;var r=M.lon;var G=M.lat;var R=e;var d=P.rad(z);var h=Math.sin(d);var H=Math.cos(d);var g=(1-m)*Math.tan(P.rad(G));var D=1/Math.sqrt((1+g*g)),J=g*D;var Q=Math.atan2(g,H);var Y=D*h;var l=1-Y*Y;var T=l*(AA*AA-v*v)/(v*v);var W=1+T/16384*(4096+T*(-768+T*(320-175*T)));var U=T/1024*(256+T*(-128+T*(74-47*T)));var V=R/(v*W),p=2*Math.PI;while(Math.abs(V-p)>1e-12){var N=Math.cos(2*Q+V);var AB=Math.sin(V);var j=Math.cos(V);var Z=U*AB*(N+U/4*(j*(-1+2*N*N)-U/6*N*(-3+4*AB*AB)*(-3+4*N*N)));p=V;V=R/(v*W)+Z}var q=J*AB-D*j*H;var E=Math.atan2(J*j+D*AB*H,(1-m)*Math.sqrt(Y*Y+q*q));var O=Math.atan2(AB*h,D*j-J*AB*H);var S=m/16*l*(4+m*(4-3*l));var K=O-(1-S)*m*Y*(V+S*AB*(N+S*j*(-1+2*N*N)));var F=Math.atan2(Y,-q);return new OpenLayers.LonLat(r+P.deg(K),P.deg(E))};OpenLayers.Util.getParameters=function(C){C=C||window.location.href;var B="";if(OpenLayers.String.contains(C,"?")){var D=C.indexOf("?")+1;var G=OpenLayers.String.contains(C,"#")?C.indexOf("#"):C.length;B=C.substring(D,G)}var M={};var E=B.split(/[&;]/);for(var I=0,J=E.length;I<J;++I){var H=E[I].split("=");if(H[0]){var L=H[0];try{L=decodeURIComponent(L)}catch(F){L=unescape(L)}var K=(H[1]||"").replace(/\+/g," ");try{K=decodeURIComponent(K)}catch(F){K=unescape(K)}K=K.split(",");if(K.length==1){K=K[0]}M[L]=K}}return M};OpenLayers.Util.getArgs=function(B){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(B)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(B){if(B==null){B="id_"}OpenLayers.Util.lastSeqID+=1;return B+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(C){var B=(C>1)?(1/C):C;return B};OpenLayers.Util.getResolutionFromScale=function(E,B){var C;if(E){if(B==null){B="degrees"}var D=OpenLayers.Util.normalizeScale(E);C=1/(D*OpenLayers.INCHES_PER_UNIT[B]*OpenLayers.DOTS_PER_INCH)}return C};OpenLayers.Util.getScaleFromResolution=function(C,B){if(B==null){B="degrees"}var D=C*OpenLayers.INCHES_PER_UNIT[B]*OpenLayers.DOTS_PER_INCH;return D};OpenLayers.Util.safeStopPropagation=function(B){OpenLayers.Event.stop(B,true)};OpenLayers.Util.pagePosition=function(E){var J=[0,0];var I=OpenLayers.Util.getViewportElement();if(!E||E==window||E==I){return J}var G=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&OpenLayers.Element.getStyle(E,"position")=="absolute"&&(E.style.top==""||E.style.left=="");var K=null;var H;if(E.getBoundingClientRect){H=E.getBoundingClientRect();var C=I.scrollTop;var D=I.scrollLeft;J[0]=H.left+D;J[1]=H.top+C}else{if(document.getBoxObjectFor&&!G){H=document.getBoxObjectFor(E);var B=document.getBoxObjectFor(I);J[0]=H.screenX-B.screenX;J[1]=H.screenY-B.screenY}else{J[0]=E.offsetLeft;J[1]=E.offsetTop;K=E.offsetParent;if(K!=E){while(K){J[0]+=K.offsetLeft;J[1]+=K.offsetTop;K=K.offsetParent}}var F=OpenLayers.BROWSER_NAME;if(F=="opera"||(F=="safari"&&OpenLayers.Element.getStyle(E,"position")=="absolute")){J[1]-=document.body.offsetTop}K=E.offsetParent;while(K&&K!=document.body){J[0]-=K.scrollLeft;if(F!="opera"||K.tagName!="TR"){J[1]-=K.scrollTop}K=K.offsetParent}}}return J};OpenLayers.Util.getViewportElement=function(){var B=arguments.callee.viewportElement;if(B==undefined){B=(OpenLayers.BROWSER_NAME=="msie"&&document.compatMode!="CSS1Compat")?document.body:document.documentElement;arguments.callee.viewportElement=B}return B};OpenLayers.Util.isEquivalentUrl=function(G,F,D){D=D||{};OpenLayers.Util.applyDefaults(D,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var C=OpenLayers.Util.createUrlObject(G,D);var B=OpenLayers.Util.createUrlObject(F,D);for(var E in C){if(E!=="args"){if(C[E]!=B[E]){return false}}}for(var E in C.args){if(C.args[E]!=B.args[E]){return false}delete B.args[E]}for(var E in B.args){return false}return true};OpenLayers.Util.createUrlObject=function(C,K){K=K||{};if(!(/^\w+:\/\//).test(C)){var G=window.location;var E=G.port?":"+G.port:"";var H=G.protocol+"//"+G.host.split(":").shift()+E;if(C.indexOf("/")===0){C=H+C}else{var F=G.pathname.split("/");F.pop();C=H+F.join("/")+"/"+C}}if(K.ignoreCase){C=C.toLowerCase()}var I=document.createElement("a");I.href=C;var D={};D.host=I.host.split(":").shift();D.protocol=I.protocol;if(K.ignorePort80){D.port=(I.port=="80"||I.port=="0")?"":I.port}else{D.port=(I.port==""||I.port=="0")?"80":I.port}D.hash=(K.ignoreHash||I.hash==="#")?"":I.hash;var B=I.search;if(!B){var J=C.indexOf("?");B=(J!=-1)?C.substr(J):""}D.args=OpenLayers.Util.getParameters(B);D.pathname=(I.pathname.charAt(0)=="/")?I.pathname:"/"+I.pathname;return D};OpenLayers.Util.removeTail=function(C){var D=null;var B=C.indexOf("?");var E=C.indexOf("#");if(B==-1){D=(E!=-1)?C.substr(0,E):C}else{D=(E!=-1)?C.substr(0,Math.min(B,E)):C.substr(0,B)}return D};OpenLayers.IS_GECKO=(function(){var B=navigator.userAgent.toLowerCase();return B.indexOf("webkit")==-1&&B.indexOf("gecko")!=-1})();OpenLayers.BROWSER_NAME=(function(){var B="";var C=navigator.userAgent.toLowerCase();if(C.indexOf("opera")!=-1){B="opera"}else{if(C.indexOf("msie")!=-1){B="msie"}else{if(C.indexOf("safari")!=-1){B="safari"}else{if(C.indexOf("mozilla")!=-1){if(C.indexOf("firefox")!=-1){B="firefox"}else{B="mozilla"}}}}}return B})();OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME};OpenLayers.Util.getRenderedDimensions=function(C,M,N){var J,F;var B=document.createElement("div");B.style.visibility="hidden";var L=(N&&N.containerElement)?N.containerElement:document.body;if(M){if(M.w){J=M.w;B.style.width=J+"px"}else{if(M.h){F=M.h;B.style.height=F+"px"}}}if(N&&N.displayClass){B.className=N.displayClass}var G=document.createElement("div");G.innerHTML=C;G.style.overflow="visible";if(G.childNodes){for(var E=0,D=G.childNodes.length;E<D;E++){if(!G.childNodes[E].style){continue}G.childNodes[E].style.overflow="visible"}}B.appendChild(G);L.appendChild(B);var K=false;var I=B.parentNode;while(I&&I.tagName.toLowerCase()!="body"){var H=OpenLayers.Element.getStyle(I,"position");if(H=="absolute"){K=true;break}else{if(H&&H!="static"){break}}I=I.parentNode}if(!K){B.style.position="absolute"}if(!J){J=parseInt(G.scrollWidth);B.style.width=J+"px"}if(!F){F=parseInt(G.scrollHeight)}B.removeChild(G);L.removeChild(B);return new OpenLayers.Size(J,F)};OpenLayers.Util.getScrollbarWidth=function(){var D=OpenLayers.Util._scrollbarWidth;if(D==null){var F=null;var E=null;var B=0;var C=0;F=document.createElement("div");F.style.position="absolute";F.style.top="-1000px";F.style.left="-1000px";F.style.width="100px";F.style.height="50px";F.style.overflow="hidden";E=document.createElement("div");E.style.width="100%";E.style.height="200px";F.appendChild(E);document.body.appendChild(F);B=E.offsetWidth;F.style.overflow="scroll";C=E.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(B-C);D=OpenLayers.Util._scrollbarWidth}return D};OpenLayers.Util.getFormattedLonLat=function(I,C,F){if(!F){F="dms"}var E=Math.abs(I);var J=Math.floor(E);var B=(E-J)/(1/60);var D=B;B=Math.floor(B);var H=(D-B)/(1/60);H=Math.round(H*10);H/=10;if(J<10){J="0"+J}var G=J+"\u00B0";if(F.indexOf("dm")>=0){if(B<10){B="0"+B}G+=B+"'";if(F.indexOf("dms")>=0){if(H<10){H="0"+H}G+=H+'"'}}if(C=="lon"){G+=I<0?OpenLayers.i18n("W"):OpenLayers.i18n("E")}else{G+=I<0?OpenLayers.i18n("S"):OpenLayers.i18n("N")}return G};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(B){return B.target||B.srcElement},isLeftClick:function(B){return(((B.which)&&(B.which==1))||((B.button)&&(B.button==1)))},isRightClick:function(B){return(((B.which)&&(B.which==3))||((B.button)&&(B.button==2)))},stop:function(C,B){if(!B){if(C.preventDefault){C.preventDefault()}else{C.returnValue=false}}if(C.stopPropagation){C.stopPropagation()}else{C.cancelBubble=true}},findElement:function(D,C){var B=OpenLayers.Event.element(D);while(B.parentNode&&(!B.tagName||(B.tagName.toUpperCase()!=C.toUpperCase()))){B=B.parentNode}return B},observe:function(C,E,D,B){var F=OpenLayers.Util.getElement(C);B=B||false;if(E=="keypress"&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||F.attachEvent)){E="keydown"}if(!this.observers){this.observers={}}if(!F._eventCacheID){var G="eventCacheID_";if(F.id){G=F.id+"_"+G}F._eventCacheID=OpenLayers.Util.createUniqueID(G)}var H=F._eventCacheID;if(!this.observers[H]){this.observers[H]=[]}this.observers[H].push({element:F,name:E,observer:D,useCapture:B});if(F.addEventListener){F.addEventListener(E,D,B)}else{if(F.attachEvent){F.attachEvent("on"+E,D)}}},stopObservingElement:function(B){var C=OpenLayers.Util.getElement(B);var D=C._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[D])},_removeElementObservers:function(F){if(F){for(var C=F.length-1;C>=0;C--){var D=F[C];var B=new Array(D.element,D.name,D.observer,D.useCapture);var E=OpenLayers.Event.stopObserving.apply(this,B)}}},stopObserving:function(I,B,H,C){C=C||false;var G=OpenLayers.Util.getElement(I);var E=G._eventCacheID;if(B=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||G.detachEvent){B="keydown"}}var K=false;var D=OpenLayers.Event.observers[E];if(D){var F=0;while(!K&&F<D.length){var J=D[F];if((J.name==B)&&(J.observer==H)&&(J.useCapture==C)){D.splice(F,1);if(D.length==0){delete OpenLayers.Event.observers[E]}K=true;break}F++}}if(K){if(G.removeEventListener){G.removeEventListener(B,H,C)}else{if(G&&G.detachEvent){G.detachEvent("on"+B,H)}}}return K},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var B in OpenLayers.Event.observers){var C=OpenLayers.Event.observers[B];OpenLayers.Event._removeElementObservers.apply(this,[C])}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(D,F,H,G,C){OpenLayers.Util.extend(this,C);this.object=D;this.fallThrough=G;this.listeners={};this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this);this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this);this.eventTypes=[];if(H!=null){for(var E=0,B=H.length;E<B;E++){this.addEventType(H[E])}}if(F!=null){this.attachToElement(F)}},destroy:function(){if(this.element){OpenLayers.Event.stopObservingElement(this.element);if(this.element.hasScrollEvent){OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener)}}this.element=null;this.listeners=null;this.object=null;this.eventTypes=null;this.fallThrough=null;this.eventHandler=null},addEventType:function(B){if(!this.listeners[B]){this.eventTypes.push(B);this.listeners[B]=[]}},attachToElement:function(E){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=E;for(var D=0,B=this.BROWSER_EVENTS.length;D<B;D++){var C=this.BROWSER_EVENTS[D];this.addEventType(C);OpenLayers.Event.observe(E,C,this.eventHandler)}OpenLayers.Event.observe(E,"dragstart",OpenLayers.Event.stop)},on:function(B){for(var C in B){if(C!="scope"){this.register(C,B.scope,B[C])}}},register:function(C,E,D){if((D!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,C)!=-1)){if(E==null){E=this.object}var B=this.listeners[C];B.push({obj:E,func:D})}},registerPriority:function(C,E,D){if(D!=null){if(E==null){E=this.object}var B=this.listeners[C];if(B!=null){B.unshift({obj:E,func:D})}}},un:function(B){for(var C in B){if(C!="scope"){this.unregister(C,B.scope,B[C])}}},unregister:function(E,G,F){if(G==null){G=this.object}var D=this.listeners[E];if(D!=null){for(var C=0,B=D.length;C<B;C++){if(D[C].obj==G&&D[C].func==F){D.splice(C,1);break}}}},remove:function(B){if(this.listeners[B]!=null){this.listeners[B]=[]}},triggerEvent:function(F,C){var E=this.listeners[F];if(!E||E.length==0){return undefined}if(C==null){C={}}C.object=this.object;C.element=this.element;if(!C.type){C.type=F}E=E.slice();var G;for(var D=0,B=E.length;D<B;D++){var H=E[D];G=H.func.apply(H.obj,[C]);if((G!=undefined)&&(G==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(C,true)}return G},handleBrowserEvent:function(B){var D=B.type,C=this.listeners[D];if(!C||C.length==0){return }if(this.includeXY){B.xy=this.getMousePosition(B)}this.triggerEvent(D,B)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(B){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){var C=OpenLayers.Util.getViewportElement();this.element.scrolls=[C.scrollLeft,C.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)}return new OpenLayers.Pixel((B.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(B.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(B){this.easing=(B)?B:OpenLayers.Easing.Expo.easeOut},start:function(D,C,E,B){this.playing=true;this.begin=D;this.finish=C;this.duration=E;this.callbacks=B.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 E={};for(var C in this.begin){var B=this.begin[C];var D=this.finish[C];if(B==null||D==null||isNaN(B)||isNaN(D)){OpenLayers.Console.error("invalid value for Tween")}var F=D-B;E[C]=this.easing.apply(this,[this.time,B,F,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,E)}if(this.time>this.duration){this.stop()}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(C,B,E,D){return E*C/D+B},easeOut:function(C,B,E,D){return E*C/D+B},easeInOut:function(C,B,E,D){return E*C/D+B},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(C,B,E,D){return(C==0)?B:E*Math.pow(2,10*(C/D-1))+B},easeOut:function(C,B,E,D){return(C==D)?B+E:E*(-Math.pow(2,-10*C/D)+1)+B},easeInOut:function(C,B,E,D){if(C==0){return B}if(C==D){return B+E}if((C/=D/2)<1){return E/2*Math.pow(2,10*(C-1))+B}return E/2*(-Math.pow(2,-10*--C)+2)+B},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(C,B,E,D){return E*(C/=D)*C+B},easeOut:function(C,B,E,D){return -E*(C/=D)*(C-2)+B},easeInOut:function(C,B,E,D){if((C/=D/2)<1){return E/2*C*C+B}return -E/2*((--C)*(C-2)-1)+B},CLASS_NAME:"OpenLayers.Easing.Quad"};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(I,E){if(arguments.length===1&&typeof I==="object"){E=I;I=E&&E.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";this.theme="/styles/mapguide.css";OpenLayers.Util.extend(this,E);this.layers=[];this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(I);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var H=this.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(H,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);H=this.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(H);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.viewPortDiv.appendChild(this.layerContainerDiv);this.events=new OpenLayers.Events(this,this.viewPortDiv,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var G=true;var D=document.getElementsByTagName("link");for(var F=0,B=D.length;F<B;++F){if(OpenLayers.Util.isEquivalentUrl(D.item(F).href,this.theme)){G=false;break}}if(G){var C=document.createElement("link");C.setAttribute("rel","stylesheet");C.setAttribute("type","text/css");C.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(C)}}if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var F=0,B=this.controls.length;F<B;F++){this.addControlToMap(this.controls[F])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);if(E&&E.layers){this.addLayers(E.layers);if(E.center){this.setCenter(E.center,E.zoom)}}},render:function(B){this.div=OpenLayers.Util.getElement(B);OpenLayers.Element.addClass(this.div,"olMap");this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}if(this.panTween){this.panTween.stop();this.panTween=null}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 B=this.controls.length-1;B>=0;--B){this.controls[B].destroy()}this.controls=null}if(this.layers!=null){for(var B=this.layers.length-1;B>=0;--B){this.layers[B].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(B){OpenLayers.Util.extend(this,B)},getTileSize:function(){return this.tileSize},getBy:function(F,D,B){var E=(typeof B.test=="function");var C=OpenLayers.Array.filter(this[F],function(G){return G[D]==B||(E&&B.test(G[D]))});return C},getLayersBy:function(C,B){return this.getBy("layers",C,B)},getLayersByName:function(B){return this.getLayersBy("name",B)},getLayersByClass:function(B){return this.getLayersBy("CLASS_NAME",B)},getControlsBy:function(C,B){return this.getBy("controls",C,B)},getControlsByClass:function(B){return this.getControlsBy("CLASS_NAME",B)},getLayer:function(F){var C=null;for(var E=0,B=this.layers.length;E<B;E++){var D=this.layers[E];if(D.id==F){C=D;break}}return C},setLayerZIndex:function(C,B){C.setZIndex(this.Z_INDEX_BASE[C.isBaseLayer?"BaseLayer":"Overlay"]+B*5)},resetLayersZIndex:function(){for(var D=0,B=this.layers.length;D<B;D++){var C=this.layers[D];this.setLayerZIndex(C,D)}},addLayer:function(D){for(var C=0,B=this.layers.length;C<B;C++){if(this.layers[C]==D){var E=OpenLayers.i18n("layerAlreadyAdded",{layerName:D.name});OpenLayers.Console.warn(E);return false}}if(this.allOverlays){D.isBaseLayer=false}if(this.events.triggerEvent("preaddlayer",{layer:D})===false){return }D.div.className="olLayerDiv";D.div.style.overflow="";this.setLayerZIndex(D,this.layers.length);if(D.isFixed){this.viewPortDiv.appendChild(D.div)}else{this.layerContainerDiv.appendChild(D.div)}this.layers.push(D);D.setMap(this);if(D.isBaseLayer||(this.allOverlays&&!this.baseLayer)){if(this.baseLayer==null){this.setBaseLayer(D)}else{D.setVisibility(false)}}else{D.redraw()}this.events.triggerEvent("addlayer",{layer:D});D.afterAdd()},addLayers:function(D){for(var C=0,B=D.length;C<B;C++){this.addLayer(D[C])}},removeLayer:function(D,F){if(F==null){F=true}if(D.isFixed){this.viewPortDiv.removeChild(D.div)}else{this.layerContainerDiv.removeChild(D.div)}OpenLayers.Util.removeItem(this.layers,D);D.removeMap(this);D.map=null;if(this.baseLayer==D){this.baseLayer=null;if(F){for(var C=0,B=this.layers.length;C<B;C++){var E=this.layers[C];if(E.isBaseLayer||this.allOverlays){this.setBaseLayer(E);break}}}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:D})},getNumLayers:function(){return this.layers.length},getLayerIndex:function(B){return OpenLayers.Util.indexOf(this.layers,B)},setLayerIndex:function(E,C){var F=this.getLayerIndex(E);if(C<0){C=0}else{if(C>this.layers.length){C=this.layers.length}}if(F!=C){this.layers.splice(F,1);this.layers.splice(C,0,E);for(var D=0,B=this.layers.length;D<B;D++){this.setLayerZIndex(this.layers[D],D)}this.events.triggerEvent("changelayer",{layer:E,property:"order"});if(this.allOverlays){if(C===0){this.setBaseLayer(E)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(C,D){var B=this.getLayerIndex(C)+D;this.setLayerIndex(C,B)},setBaseLayer:function(D){if(D!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,D)!=-1){var B=this.getCenter();var E=OpenLayers.Util.getResolutionFromScale(this.getScale(),D.units);if(this.baseLayer!=null&&!this.allOverlays){this.baseLayer.setVisibility(false)}this.baseLayer=D;this.viewRequestID++;if(!this.allOverlays||this.baseLayer.visibility){this.baseLayer.setVisibility(true)}if(B!=null){var C=this.getZoomForResolution(E||this.resolution,true);this.setCenter(B,C,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(C,B){this.controls.push(C);this.addControlToMap(C,B)},addControls:function(C,H){var F=(arguments.length===1)?[]:H;for(var E=0,B=C.length;E<B;E++){var G=C[E];var D=(F[E])?F[E]:null;this.addControl(G,D)}},addControlToMap:function(C,B){C.outsideViewport=(C.div!=null);if(this.displayProjection&&!C.displayProjection){C.displayProjection=this.displayProjection}C.setMap(this);var D=C.draw(B);if(D){if(!C.outsideViewport){D.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(D)}}if(C.autoActivate){C.activate()}},getControl:function(F){var C=null;for(var D=0,B=this.controls.length;D<B;D++){var E=this.controls[D];if(E.id==F){C=E;break}}return C},removeControl:function(B){if((B)&&(B==this.getControl(B.id))){if(B.div&&(B.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(B.div)}OpenLayers.Util.removeItem(this.controls,B)}},addPopup:function(B,E){if(E){for(var C=this.popups.length-1;C>=0;--C){this.removePopup(this.popups[C])}}B.map=this;this.popups.push(B);var D=B.draw();if(D){D.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(D)}},removePopup:function(B){OpenLayers.Util.removeItem(this.popups,B);if(B.div){try{this.layerContainerDiv.removeChild(B.div)}catch(C){}}B.map=null},getSize:function(){var B=null;if(this.size!=null){B=this.size.clone()}return B},updateSize:function(){var D=this.getCurrentSize();if(D&&!isNaN(D.h)&&!isNaN(D.w)){this.events.clearMouseCache();var G=this.getSize();if(G==null){this.size=G=D}if(!D.equals(G)){this.size=D;for(var E=0,C=this.layers.length;E<C;E++){this.layers[E].onMapResize()}var B=this.getCenter();if(this.baseLayer!=null&&B!=null){var F=this.getZoom();this.zoom=null;this.setCenter(B,F)}}}},getCurrentSize:function(){var B=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(B.w==0&&B.h==0||isNaN(B.w)&&isNaN(B.h)){B.w=this.div.offsetWidth;B.h=this.div.offsetHeight}if(B.w==0&&B.h==0||isNaN(B.w)&&isNaN(B.h)){B.w=parseInt(this.div.style.width);B.h=parseInt(this.div.style.height)}return B},calculateBounds:function(B,C){var F=null;if(B==null){B=this.getCenter()}if(C==null){C=this.getResolution()}if((B!=null)&&(C!=null)){var E=this.getSize();var G=E.w*C;var D=E.h*C;F=new OpenLayers.Bounds(B.lon-G/2,B.lat-D/2,B.lon+G/2,B.lat+D/2)}return F},getCenter:function(){var B=null;if(this.center){B=this.center.clone()}return B},getZoom:function(){return this.zoom},pan:function(E,D,F){F=OpenLayers.Util.applyDefaults(F,{animate:true,dragging:false});var G=this.getViewPortPxFromLonLat(this.getCenter());var C=G.add(E,D);if(!F.dragging||!C.equals(G)){var B=this.getLonLatFromViewPortPx(C);if(F.animate){this.panTo(B)}else{this.setCenter(B,null,F.dragging)}}},panTo:function(C){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(C)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var B=this.getCenter();if(C.lon==B.lon&&C.lat==B.lat){return }var E={lon:B.lon,lat:B.lat};var D={lon:C.lon,lat:C.lat};this.panTween.start(E,D,this.panDuration,{callbacks:{start:OpenLayers.Function.bind(function(F){this.events.triggerEvent("movestart")},this),eachStep:OpenLayers.Function.bind(function(F){F=new OpenLayers.LonLat(F.lon,F.lat);this.moveTo(F,this.zoom,{dragging:true,noEvent:true})},this),done:OpenLayers.Function.bind(function(F){F=new OpenLayers.LonLat(F.lon,F.lat);this.moveTo(F,this.zoom,{noEvent:true});this.events.triggerEvent("moveend")},this)}})}else{this.setCenter(C)}},setCenter:function(D,B,C,E){this.moveTo(D,B,{dragging:C,forceZoomChange:E,caller:"setCenter"})},moveTo:function(H,N,Q){if(!Q){Q={}}if(N!=null){N=parseFloat(N);if(!this.fractionalZoom){N=Math.round(N)}}var M=Q.dragging;var D=Q.forceZoomChange;var I=Q.noEvent;if(this.panTween&&Q.caller=="setCenter"){this.panTween.stop()}if(!this.center&&!this.isValidLonLat(H)){H=this.maxExtent.getCenterLonLat()}if(this.restrictedExtent!=null){if(H==null){H=this.getCenter()}if(N==null){N=this.getZoom()}var E=this.getResolutionForZoom(N);var O=this.calculateBounds(H,E);if(!this.restrictedExtent.containsBounds(O)){var P=this.restrictedExtent.getCenterLonLat();if(O.getWidth()>this.restrictedExtent.getWidth()){H=new OpenLayers.LonLat(P.lon,H.lat)}else{if(O.left<this.restrictedExtent.left){H=H.add(this.restrictedExtent.left-O.left,0)}else{if(O.right>this.restrictedExtent.right){H=H.add(this.restrictedExtent.right-O.right,0)}}}if(O.getHeight()>this.restrictedExtent.getHeight()){H=new OpenLayers.LonLat(H.lon,P.lat)}else{if(O.bottom<this.restrictedExtent.bottom){H=H.add(0,this.restrictedExtent.bottom-O.bottom)}else{if(O.top>this.restrictedExtent.top){H=H.add(0,this.restrictedExtent.top-O.top)}}}}}var C=D||((this.isValidZoomLevel(N))&&(N!=this.getZoom()));var F=(this.isValidLonLat(H))&&(!H.equals(this.center));if(C||F||!M){if(!this.dragging&&!I){this.events.triggerEvent("movestart")}if(F){if((!C)&&(this.center)){this.centerLayerContainer(H)}this.center=H.clone()}if((C)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(C){this.zoom=N;this.resolution=this.getResolutionForZoom(N);this.viewRequestID++}var B=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(B,C,M);if(M){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:C})}}B=this.baseLayer.getExtent();for(var G=0,K=this.layers.length;G<K;G++){var J=this.layers[G];if(J!==this.baseLayer&&!J.isBaseLayer){var L=J.calculateInRange();if(J.inRange!=L){J.inRange=L;if(!L){J.display(false)}this.events.triggerEvent("changelayer",{layer:J,property:"visibility"})}if(L&&J.visibility){J.moveTo(B,C,M);if(M){J.events.triggerEvent("move")}else{J.events.triggerEvent("moveend",{zoomChanged:C})}}}}if(C){for(var G=0,K=this.popups.length;G<K;G++){this.popups[G].updatePosition()}}this.events.triggerEvent("move");if(C){this.events.triggerEvent("zoomend")}}if(!M&&!I){this.events.triggerEvent("moveend")}this.dragging=!!M},centerLayerContainer:function(C){var B=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var D=this.getViewPortPxFromLonLat(C);if((B!=null)&&(D!=null)){this.layerContainerDiv.style.left=Math.round(B.x-D.x)+"px";this.layerContainerDiv.style.top=Math.round(B.y-D.y)+"px"}},isValidZoomLevel:function(B){return((B!=null)&&(B>=0)&&(B<this.getNumZoomLevels()))},isValidLonLat:function(D){var C=false;if(D!=null){var B=this.getMaxExtent();C=B.containsLonLat(D)}return C},getProjection:function(){var B=this.getProjectionObject();return B?B.getCode():null},getProjectionObject:function(){var B=null;if(this.baseLayer!=null){B=this.baseLayer.projection}return B},getMaxResolution:function(){var B=null;if(this.baseLayer!=null){B=this.baseLayer.maxResolution}return B},getMaxExtent:function(C){var B=null;if(C&&C.restricted&&this.restrictedExtent){B=this.restrictedExtent}else{if(this.baseLayer!=null){B=this.baseLayer.maxExtent}}return B},getNumZoomLevels:function(){var B=null;if(this.baseLayer!=null){B=this.baseLayer.numZoomLevels}return B},getExtent:function(){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getExtent()}return B},getResolution:function(){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getResolution()}else{if(this.allOverlays===true&&this.layers.length>0){B=this.layers[0].getResolution()}}return B},getUnits:function(){var B=null;if(this.baseLayer!=null){B=this.baseLayer.units}return B},getScale:function(){var D=null;if(this.baseLayer!=null){var C=this.getResolution();var B=this.baseLayer.units;D=OpenLayers.Util.getScaleFromResolution(C,B)}return D},getZoomForExtent:function(D,C){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getZoomForExtent(D,C)}return B},getResolutionForZoom:function(C){var B=null;if(this.baseLayer){B=this.baseLayer.getResolutionForZoom(C)}return B},getZoomForResolution:function(B,D){var C=null;if(this.baseLayer!=null){C=this.baseLayer.getZoomForResolution(B,D)}return C},zoomTo:function(B){if(this.isValidZoomLevel(B)){this.setCenter(null,B)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(E,D){var C=E.getCenterLonLat();if(this.baseLayer.wrapDateLine){var B=this.getMaxExtent();E=E.clone();while(E.right<E.left){E.right+=B.getWidth()}C=E.getCenterLonLat().wrapDateLine(B)}this.setCenter(C,this.getZoomForExtent(E,D))},zoomToMaxExtent:function(D){var C=(D)?D.restricted:true;var B=this.getMaxExtent({restricted:C});this.zoomToExtent(B)},zoomToScale:function(I,H){var E=OpenLayers.Util.getResolutionFromScale(I,this.baseLayer.units);var D=this.getSize();var G=D.w*E;var C=D.h*E;var B=this.getCenter();var F=new OpenLayers.Bounds(B.lon-G/2,B.lat-C/2,B.lon+G/2,B.lat+C/2);this.zoomToExtent(F,H)},getLonLatFromViewPortPx:function(B){var C=null;if(this.baseLayer!=null){C=this.baseLayer.getLonLatFromViewPortPx(B)}return C},getViewPortPxFromLonLat:function(C){var B=null;if(this.baseLayer!=null){B=this.baseLayer.getViewPortPxFromLonLat(C)}return B},getLonLatFromPixel:function(B){return this.getLonLatFromViewPortPx(B)},getPixelFromLonLat:function(C){var B=this.getViewPortPxFromLonLat(C);B.x=Math.round(B.x);B.y=Math.round(B.y);return B},getGeodesicPixelSize:function(H){var E=H?this.getLonLatFromPixel(H):(this.getCenter()||new OpenLayers.LonLat(0,0));var F=this.getResolution();var D=E.add(-F/2,0);var J=E.add(F/2,0);var C=E.add(0,-F/2);var G=E.add(0,F/2);var I=new OpenLayers.Projection("EPSG:4326");var B=this.getProjectionObject()||I;if(!B.equals(I)){D.transform(B,I);J.transform(B,I);C.transform(B,I);G.transform(B,I)}return new OpenLayers.Size(OpenLayers.Util.distVincenty(D,J),OpenLayers.Util.distVincenty(C,G))},getViewPortPxFromLayerPx:function(E){var D=null;if(E!=null){var C=parseInt(this.layerContainerDiv.style.left);var B=parseInt(this.layerContainerDiv.style.top);D=E.add(C,B)}return D},getLayerPxFromViewPortPx:function(D){var E=null;if(D!=null){var C=-parseInt(this.layerContainerDiv.style.left);var B=-parseInt(this.layerContainerDiv.style.top);E=D.add(C,B);if(isNaN(E.x)||isNaN(E.y)){E=null}}return E},getLonLatFromLayerPx:function(B){B=this.getViewPortPxFromLayerPx(B);return this.getLonLatFromViewPortPx(B)},getLayerPxFromLonLat:function(C){var B=this.getPixelFromLonLat(C);return this.getLayerPxFromViewPortPx(B)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(C,B){OpenLayers.Util.extend(this,B);this.projCode=C;if(window.Proj4js){this.proj=new Proj4js.Proj(C)}},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(B){var F=B,C=false;if(F){if(window.Proj4js&&this.proj.defData&&F.proj.defData){C=this.proj.defData.replace(this.titleRegEx,"")==F.proj.defData.replace(this.titleRegEx,"")}else{if(F.getCode){var D=this.getCode(),E=F.getCode();C=D==E||!!OpenLayers.Projection.transforms[D]&&OpenLayers.Projection.transforms[D][E]===OpenLayers.Projection.nullTransform}}}return C},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(D,C,B){if(!OpenLayers.Projection.transforms[D]){OpenLayers.Projection.transforms[D]={}}OpenLayers.Projection.transforms[D][C]=B};OpenLayers.Projection.transform=function(B,D,C){if(D.proj&&C.proj){B=Proj4js.transform(D.proj,C.proj,B)}else{if(D&&C&&OpenLayers.Projection.transforms[D.getCode()]&&OpenLayers.Projection.transforms[D.getCode()][C.getCode()]){OpenLayers.Projection.transforms[D.getCode()][C.getCode()](B)}}return B};OpenLayers.Projection.nullTransform=function(B){return B};OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],RESOLUTION_PROPERTIES:["scales","resolutions","maxScale","minScale","maxResolution","minResolution","numZoomLevels","maxZoomLevel"],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"],metadata:{},initialize:function(C,B){this.addOptions(B);this.name=C;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(B){if(B==null){B=true}if(this.map!=null){this.map.removeLayer(this,B)}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(B){if(B==null){B=new OpenLayers.Layer(this.name,this.getOptions())}OpenLayers.Util.applyDefaults(B,this);B.map=null;return B},getOptions:function(){var B={};for(var C in this.options){B[C]=this[C]}return B},setName:function(B){if(B!=this.name){this.name=B;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(D){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,D);OpenLayers.Util.extend(this,D);if(typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}if(this.projection&&this.projection.getUnits()){this.units=this.projection.getUnits()}if(this.map){var B=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]);for(var C in D){if(D.hasOwnProperty(C)&&OpenLayers.Util.indexOf(B,C)>=0){this.initResolutions();break}}}},onMapResize:function(){},redraw:function(){var C=false;if(this.map){this.inRange=this.calculateInRange();var D=this.getExtent();if(D&&this.inRange&&this.visibility){var B=true;this.moveTo(D,B,false);this.events.triggerEvent("moveend",{zoomChanged:B});C=true}}return C},moveTo:function(C,B,D){var E=this.visibility;if(!this.isBaseLayer){E=E&&this.inRange}this.display(E)},setMap:function(C){if(this.map==null){this.map=C;this.maxExtent=this.maxExtent||this.map.maxExtent;this.minExtent=this.minExtent||this.map.minExtent;this.projection=this.projection||this.map.projection;if(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 B=((this.visibility)&&(this.inRange));this.div.style.display=B?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(B){},getImageSize:function(B){return(this.imageSize||this.tileSize)},setTileSize:function(B){var C=(B)?B:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=C;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(C.w+(2*this.gutter),C.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(B){if(B!=this.visibility){this.visibility=B;this.display(B);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(B){if(B!=(this.div.style.display!="none")){this.div.style.display=(B&&this.calculateInRange())?"block":"none"}},calculateInRange:function(){var C=false;if(this.alwaysInRange){C=true}else{if(this.map){var B=this.map.getResolution();C=((B>=this.minResolution)&&(B<=this.maxResolution))}}return C},setIsBaseLayer:function(B){if(B!=this.isBaseLayer){this.isBaseLayer=B;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var F,B;var G={},E=true;for(F=0,B=this.RESOLUTION_PROPERTIES.length;F<B;F++){var I=this.RESOLUTION_PROPERTIES[F];G[I]=this.options[I];if(E&&this.options[I]){E=false}}if(this.alwaysInRange==null){this.alwaysInRange=E}if(G.resolutions==null){G.resolutions=this.resolutionsFromScales(G.scales)}if(G.resolutions==null){G.resolutions=this.calculateResolutions(G)}if(G.resolutions==null){for(F=0,B=this.RESOLUTION_PROPERTIES.length;F<B;F++){var I=this.RESOLUTION_PROPERTIES[F];G[I]=this.options[I]!=null?this.options[I]:this.map[I]}if(G.resolutions==null){G.resolutions=this.resolutionsFromScales(G.scales)}if(G.resolutions==null){G.resolutions=this.calculateResolutions(G)}}var D;if(this.options.maxResolution&&this.options.maxResolution!=="auto"){D=this.options.maxResolution}if(this.options.minScale){D=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units)}var C;if(this.options.minResolution&&this.options.minResolution!=="auto"){C=this.options.minResolution}if(this.options.maxScale){C=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units)}if(G.resolutions){G.resolutions.sort(function(K,J){return(J-K)});if(!D){D=G.resolutions[0]}if(!C){var H=G.resolutions.length-1;C=G.resolutions[H]}}this.resolutions=G.resolutions;if(this.resolutions){B=this.resolutions.length;this.scales=new Array(B);for(F=0;F<B;F++){this.scales[F]=OpenLayers.Util.getScaleFromResolution(this.resolutions[F],this.units)}this.numZoomLevels=B}this.minResolution=C;if(C){this.maxScale=OpenLayers.Util.getScaleFromResolution(C,this.units)}this.maxResolution=D;if(D){this.minScale=OpenLayers.Util.getScaleFromResolution(D,this.units)}},resolutionsFromScales:function(E){if(E==null){return }var C,D,B;B=E.length;C=new Array(B);for(D=0;D<B;D++){C[D]=OpenLayers.Util.getResolutionFromScale(E[D],this.units)}return C},calculateResolutions:function(K){var M=K.maxResolution;if(K.minScale!=null){M=OpenLayers.Util.getResolutionFromScale(K.minScale,this.units)}else{if(M=="auto"&&this.maxExtent!=null){var L=this.map.getSize();var J=this.maxExtent.getWidth()/L.w;var H=this.maxExtent.getHeight()/L.h;M=Math.max(J,H)}}var G=K.minResolution;if(K.maxScale!=null){G=OpenLayers.Util.getResolutionFromScale(K.maxScale,this.units)}else{if(K.minResolution=="auto"&&this.minExtent!=null){var L=this.map.getSize();var J=this.minExtent.getWidth()/L.w;var H=this.minExtent.getHeight()/L.h;G=Math.max(J,H)}}var B=K.maxZoomLevel;var C=K.numZoomLevels;if(typeof G==="number"&&typeof M==="number"&&C===undefined){var I=M/G;C=Math.floor(Math.log(I)/Math.log(2))+1}else{if(C===undefined&&B!=null){C=B+1}}if(typeof C!=="number"||C<=0||(typeof M!=="number"&&typeof G!=="number")){return }var E=new Array(C);var D=2;if(typeof G=="number"&&typeof M=="number"){D=Math.pow((M/G),(1/(C-1)))}var F;if(typeof M==="number"){for(F=0;F<C;F++){E[F]=M/Math.pow(D,F)}}else{for(F=0;F<C;F++){E[C-1-F]=G*Math.pow(D,F)}}return E},getResolution:function(){var B=this.map.getZoom();return this.getResolutionForZoom(B)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(C,D){var E=this.map.getSize();var B=Math.max(C.getWidth()/E.w,C.getHeight()/E.h);return this.getZoomForResolution(B,D)},getDataExtent:function(){},getResolutionForZoom:function(D){D=Math.max(0,Math.min(D,this.resolutions.length-1));var C;if(this.map.fractionalZoom){var B=Math.floor(D);var E=Math.ceil(D);C=this.resolutions[B]-((D-B)*(this.resolutions[B]-this.resolutions[E]))}else{C=this.resolutions[Math.round(D)]}return C},getZoomForResolution:function(F,B){var N;if(this.map.fractionalZoom){var K=0;var D=this.resolutions.length-1;var E=this.resolutions[K];var C=this.resolutions[D];var J;for(var G=0,H=this.resolutions.length;G<H;++G){J=this.resolutions[G];if(J>=F){E=J;K=G}if(J<=F){C=J;D=G;break}}var I=E-C;if(I>0){N=K+((E-F)/I)}else{N=K}}else{var L;var M=Number.POSITIVE_INFINITY;for(var G=0,H=this.resolutions.length;G<H;G++){if(B){L=Math.abs(this.resolutions[G]-F);if(L>M){break}M=L}else{if(this.resolutions[G]<F){break}}}N=Math.max(0,G-1)}return N},getLonLatFromViewPortPx:function(C){var F=null;if(C!=null){var E=this.map.getSize();var B=this.map.getCenter();if(B){var D=this.map.getResolution();var H=C.x-(E.w/2);var G=C.y-(E.h/2);F=new OpenLayers.LonLat(B.lon+H*D,B.lat-G*D);if(this.wrapDateLine){F=F.wrapDateLine(this.maxExtent)}}}return F},getViewPortPxFromLonLat:function(E){var C=null;if(E!=null){var B=this.map.getResolution();var D=this.map.getExtent();C=new OpenLayers.Pixel((1/B*(E.lon-D.left)),(1/B*(D.top-E.lat)))}return C},setOpacity:function(C){if(C!=this.opacity){this.opacity=C;for(var E=0,B=this.div.childNodes.length;E<B;++E){var D=this.div.childNodes[E].firstChild;OpenLayers.Util.modifyDOMElement(D,null,null,null,null,null,null,C)}if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(B){this.div.style.zIndex=B},adjustBounds:function(C){if(this.gutter){var B=this.gutter*this.map.getResolution();C=new OpenLayers.Bounds(C.left-B,C.bottom-B,C.right+B,C.top+B)}if(this.wrapDateLine){var D={rightTolerance:this.getResolution()};C=C.wrapDateLine(this.maxExtent,D)}return C},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var B=null;if(this.sphericalMercator){B=this.map.calculateBounds()}else{B=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return B},getLonLatFromViewPortPx:function(B){return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(B){return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];var B=156543.0339;for(var C=0;C<=this.MAX_ZOOM_LEVEL;++C){this.RESOLUTIONS[C]=B/Math.pow(2,C)}this.units="m";this.projection=this.projection||"EPSG:900913"},forwardMercator:function(D,C){var B=D*20037508.34/180;var E=Math.log(Math.tan((90+C)*Math.PI/360))/(Math.PI/180);E=E*20037508.34/180;return new OpenLayers.LonLat(B,E)},inverseMercator:function(B,E){var D=(B/20037508.34)*180;var C=(E/20037508.34)*180;C=180/Math.PI*(2*Math.atan(Math.exp(C*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(D,C)},projectForward:function(B){var C=OpenLayers.Layer.SphericalMercator.forwardMercator(B.x,B.y);B.x=C.lon;B.y=C.lat;return B},projectInverse:function(B){var C=OpenLayers.Layer.SphericalMercator.inverseMercator(B.x,B.y);B.x=C.lon;B.y=C.lat;return B}};(function(){var B=["EPSG:900913","EPSG:3857","EPSG:102113","EPSG:102100"];var J=OpenLayers.Projection.addTransform;var F=OpenLayers.Layer.SphericalMercator;var I=OpenLayers.Projection.nullTransform;var E,G,C,H,D;for(E=0,G=B.length;E<G;++E){C=B[E];J("EPSG:4326",C,F.projectForward);J(C,"EPSG:4326",F.projectInverse);for(D=E+1;D<G;++D){H=B[D];J(C,H,I);J(H,C,I)}}})();OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(C,B){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;this.pane=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(B){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.BROWSER_NAME=="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(B){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane)}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var H=this.map.getSize();var B=Math.min(H.w,300);var F=Math.min(H.h,200);var C=new OpenLayers.Size(B,F);var E=new OpenLayers.Pixel(H.w/2,H.h/2);var D=E.add(-C.w/2,-C.h/2);var G=OpenLayers.Util.createDiv(this.name+"_warning",D,C,null,null,null,"auto");G.style.padding="7px";G.style.backgroundColor="yellow";G.innerHTML=this.getWarningHTML();this.div.appendChild(G)},getWarningHTML:function(){return""},display:function(B){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(B){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(D,E,K){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var F=this.map.getCenter();var H=this.map.getZoom();if(F!=null){var G=this.getMapObjectCenter();var C=this.getOLLonLatFromMapObjectLonLat(G);var I=this.getMapObjectZoom();var N=this.getOLZoomFromMapObjectZoom(I);if(!(F.equals(C))||!(H==N)){if(K&&this.dragPanMapObject&&this.smoothDragPan){var J=this.map.getViewPortPxFromLonLat(C);var L=this.map.getViewPortPxFromLonLat(F);this.dragPanMapObject(L.x-J.x,J.y-L.y)}else{var B=this.getMapObjectLonLatFromOLLonLat(F);var M=this.getMapObjectZoomFromOLZoom(H);this.setMapObjectCenter(B,M,K)}}}}},getLonLatFromViewPortPx:function(B){var C=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var E=this.getMapObjectPixelFromOLPixel(B);var D=this.getMapObjectLonLatFromMapObjectPixel(E);C=this.getOLLonLatFromMapObjectLonLat(D)}return C},getViewPortPxFromLonLat:function(C){var B=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var E=this.getMapObjectLonLatFromOLLonLat(C);var D=this.getMapObjectPixelFromMapObjectLonLat(E);B=this.getOLPixelFromMapObjectPixel(D)}return B},getOLLonLatFromMapObjectLonLat:function(E){var B=null;if(E!=null){var D=this.getLongitudeFromMapObjectLonLat(E);var C=this.getLatitudeFromMapObjectLonLat(E);B=new OpenLayers.LonLat(D,C)}return B},getMapObjectLonLatFromOLLonLat:function(B){var C=null;if(B!=null){C=this.getMapObjectLonLatFromLonLat(B.lon,B.lat)}return C},getOLPixelFromMapObjectPixel:function(E){var C=null;if(E!=null){var B=this.getXFromMapObjectPixel(E);var D=this.getYFromMapObjectPixel(E);C=new OpenLayers.Pixel(B,D)}return C},getMapObjectPixelFromOLPixel:function(B){var C=null;if(B!=null){C=this.getMapObjectPixelFromXY(B.x,B.y)}return C},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var D=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var C=0,B=D.length;C<B;C++){var G=D[C];this[G]=(this.options[G]!=null)?this.options[G]:this.map[G]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var H;var F=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){H=this.maxZoomLevel-this.minZoomLevel+1}else{H=this.numZoomLevels}if(H!=null){this.numZoomLevels=Math.min(H,F)}else{this.numZoomLevels=F}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var E=0;this.resolutions=[];for(var C=this.minZoomLevel;C<=this.maxZoomLevel;C++){this.resolutions[E++]=this.RESOLUTIONS[C]}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 B=null;var D=this.map.getSize();var C=this.getExtent();if((D!=null)&&(C!=null)){B=Math.max(C.getWidth()/D.w,C.getHeight()/D.h)}return B}},getExtent:function(){var D=null;var C=this.map.getSize();var F=new OpenLayers.Pixel(0,0);var G=this.getLonLatFromViewPortPx(F);var B=new OpenLayers.Pixel(C.w,C.h);var E=this.getLonLatFromViewPortPx(B);if((G!=null)&&(E!=null)){D=new OpenLayers.Bounds(G.lon,E.lat,E.lon,G.lat)}return D},getZoomForResolution:function(B){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var C=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(C)}},getOLZoomFromMapObjectZoom:function(B){var C=null;if(B!=null){C=B-this.minZoomLevel}return C},getMapObjectZoomFromOLZoom:function(B){var C=null;if(B!=null){C=B+this.minZoomLevel}return C},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.VirtualEarth=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:19,RESOLUTIONS:[1.40625,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],type:null,wrapDateLine:true,sphericalMercator:false,animationEnabled:true,initialize:function(C,B){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 B=OpenLayers.Util.createDiv(this.name);var D=this.map.getSize();B.style.width=D.w+"px";B.style.height=D.h+"px";this.div.appendChild(B);try{this.mapObject=new VEMap(this.name)}catch(C){}if(this.mapObject!=null){try{this.mapObject.LoadMap(null,null,this.type,true);this.mapObject.AttachEvent("onmousedown",OpenLayers.Function.True)}catch(C){}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(B,C){this.mapObject.SetCenterAndZoom(B,C)},getMapObjectCenter:function(){return this.mapObject.GetCenter()},dragPanMapObject:function(C,B){this.mapObject.vemapcontrol.PanMap(C,-B)},getMapObjectZoom:function(){return this.mapObject.GetZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(B){return(typeof VEPixel!="undefined")?this.mapObject.PixelToLatLong(B):this.mapObject.PixelToLatLong(B.x,B.y)},getMapObjectPixelFromMapObjectLonLat:function(B){return this.mapObject.LatLongToPixel(B)},getLongitudeFromMapObjectLonLat:function(B){return this.sphericalMercator?this.forwardMercator(B.Longitude,B.Latitude).lon:B.Longitude},getLatitudeFromMapObjectLonLat:function(B){return this.sphericalMercator?this.forwardMercator(B.Longitude,B.Latitude).lat:B.Latitude},getMapObjectLonLatFromLonLat:function(E,C){var D;if(this.sphericalMercator){var B=this.inverseMercator(E,C);D=new VELatLong(B.lat,B.lon)}else{D=new VELatLong(C,E)}return D},getXFromMapObjectPixel:function(B){return B.x},getYFromMapObjectPixel:function(B){return B.y},getMapObjectPixelFromXY:function(B,C){return(typeof VEPixel!="undefined")?new VEPixel(B,C):new Msn.VE.Pixel(B,C)},CLASS_NAME:"OpenLayers.Layer.VirtualEarth"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:21,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,0.000001341104507446289,6.705522537231445e-7],type:null,wrapDateLine:true,sphericalMercator:false,version:null,initialize:function(D,C){C=C||{};if(!C.version){C.version=typeof GMap2==="function"?"2":"3"}var B=OpenLayers.Layer.Google["v"+C.version.replace(/\./g,"_")];if(B){OpenLayers.Util.applyDefaults(C,B)}else{throw"Unsupported Google Maps API version: "+C.version}OpenLayers.Util.applyDefaults(C,B.DEFAULTS);if(C.maxExtent){C.maxExtent=C.maxExtent.clone()}OpenLayers.Layer.EventPane.prototype.initialize.apply(this,[D,C]);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,[D,C]);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},setVisibility:function(C){var B=this.opacity==null?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments);this.setOpacity(B)},display:function(B){if(!this._dragging){this.setGMapVisibility(B)}OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(C,B,D){this._dragging=D;OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments);delete this._dragging},setOpacity:function(C){if(C!==this.opacity){if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}this.opacity=C}if(this.getVisibility()){var B=this.getMapContainer();OpenLayers.Util.modifyDOMElement(B,null,null,null,null,null,null,C)}},destroy:function(){if(this.map){this.setGMapVisibility(false);var B=OpenLayers.Layer.Google.cache[this.map.id];if(B&&B.count<=1){this.removeGMapElements()}}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var E=OpenLayers.Layer.Google.cache[this.map.id];if(E){var C=this.mapObject&&this.getMapContainer();if(C&&C.parentNode){C.parentNode.removeChild(C)}var D=E.termsOfUse;if(D&&D.parentNode){D.parentNode.removeChild(D)}var B=E.poweredBy;if(B&&B.parentNode){B.parentNode.removeChild(B)}}},removeMap:function(C){if(this.visibility&&this.mapObject){this.setGMapVisibility(false)}var B=OpenLayers.Layer.Google.cache[C.id];if(B){if(B.count<=1){this.removeGMapElements();delete OpenLayers.Layer.Google.cache[C.id]}else{--B.count}}delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(C){var D=null;if(C!=null){var B=C.getSouthWest();var E=C.getNorthEast();if(this.sphericalMercator){B=this.forwardMercator(B.lng(),B.lat());E=this.forwardMercator(E.lng(),E.lat())}else{B=new OpenLayers.LonLat(B.lng(),B.lat());E=new OpenLayers.LonLat(E.lng(),E.lat())}D=new OpenLayers.Bounds(B.lon,B.lat,E.lon,E.lat)}return D},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(B){return this.sphericalMercator?this.forwardMercator(B.lng(),B.lat()).lon:B.lng()},getLatitudeFromMapObjectLonLat:function(C){var B=this.sphericalMercator?this.forwardMercator(C.lng(),C.lat()).lat:C.lat();return B},getXFromMapObjectPixel:function(B){return B.x},getYFromMapObjectPixel:function(B){return B.y},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Google.cache={};OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){if(!this.type){this.type=G_NORMAL_MAP}var G,E,B;var D=OpenLayers.Layer.Google.cache[this.map.id];if(D){G=D.mapObject;E=D.termsOfUse;B=D.poweredBy;++D.count}else{var C=this.map.viewPortDiv;var H=document.createElement("div");H.id=this.map.id+"_GMap2Container";H.style.position="absolute";H.style.width="100%";H.style.height="100%";C.appendChild(H);try{G=new GMap2(H);E=H.lastChild;C.appendChild(E);E.style.zIndex="1100";E.style.right="";E.style.bottom="";E.className="olLayerGoogleCopyright";B=H.lastChild;C.appendChild(B);B.style.zIndex="1100";B.style.right="";B.style.bottom="";B.className="olLayerGooglePoweredBy gmnoprint"}catch(F){throw (F)}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:G,termsOfUse:E,poweredBy:B,count:1}}this.mapObject=G;this.termsOfUse=E;this.poweredBy=B;if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)===-1){this.mapObject.addMapType(this.type)}if(typeof G.getDragObject=="function"){this.dragObject=G.getDragObject()}else{this.dragPanMapObject=null}if(this.isBaseLayer===false){this.setGMapVisibility(this.div.style.display!=="none")}},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded()){this.mapObject.checkResize()}else{if(!this._resized){var B=this;var C=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(C);delete B._resized;B.mapObject.checkResize();B.moveTo(B.map.getCenter(),B.map.getZoom())})}this._resized=true}},setGMapVisibility:function(D){var C=OpenLayers.Layer.Google.cache[this.map.id];if(C){var B=this.mapObject.getContainer();if(D===true){this.mapObject.setMapType(this.type);B.style.display="";this.termsOfUse.style.left="";this.termsOfUse.style.display="";this.poweredBy.style.display="";C.displayed=this.id}else{if(C.displayed===this.id){delete C.displayed}if(!C.displayed){B.style.display="none";this.termsOfUse.style.display="none";this.termsOfUse.style.left="-9999px";this.poweredBy.style.display="none"}}}},getMapContainer:function(){return this.mapObject.getContainer()},getMapObjectBoundsFromOLBounds:function(D){var C=null;if(D!=null){var B=this.sphericalMercator?this.inverseMercator(D.bottom,D.left):new OpenLayers.LonLat(D.bottom,D.left);var E=this.sphericalMercator?this.inverseMercator(D.top,D.right):new OpenLayers.LonLat(D.top,D.right);C=new GLatLngBounds(new GLatLng(B.lat,B.lon),new GLatLng(E.lat,E.lon))}return C},setMapObjectCenter:function(B,C){this.mapObject.setCenter(B,C)},dragPanMapObject:function(C,B){this.dragObject.moveBy(new GSize(-C,B))},getMapObjectLonLatFromMapObjectPixel:function(B){return this.mapObject.fromContainerPixelToLatLng(B)},getMapObjectPixelFromMapObjectLonLat:function(B){return this.mapObject.fromLatLngToContainerPixel(B)},getMapObjectZoomFromMapObjectBounds:function(B){return this.mapObject.getBoundsZoomLevel(B)},getMapObjectLonLatFromLonLat:function(E,C){var D;if(this.sphericalMercator){var B=this.inverseMercator(E,C);D=new GLatLng(B.lat,B.lon)}else{D=new GLatLng(C,E)}return D},getMapObjectPixelFromXY:function(B,C){return new GPoint(B,C)}};OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(B){OpenLayers.Util.extend(this,B);this.options=B},destroy:function(){},read:function(B){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(B){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(B){if(window.ActiveXObject){this.xmldom=new ActiveXObject("Microsoft.XMLDOM")}OpenLayers.Format.prototype.initialize.apply(this,[B]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var C in this.namespaces){this.namespaceAlias[this.namespaces[C]]=C}},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this,arguments)},setNamespace:function(B,C){this.namespaces[B]=C;this.namespaceAlias[C]=B},read:function(D){var B=D.indexOf("<");if(B>0){D=D.substring(B)}var C=OpenLayers.Util.Try(OpenLayers.Function.bind((function(){var E;if(window.ActiveXObject&&!this.xmldom){E=new ActiveXObject("Microsoft.XMLDOM")}else{E=this.xmldom}E.loadXML(D);return E}),this),function(){return new DOMParser().parseFromString(D,"text/xml")},function(){var E=new XMLHttpRequest();E.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(D),false);if(E.overrideMimeType){E.overrideMimeType("text/xml")}E.send(null);return E.responseXML});if(this.keepData){this.data=C}return C},write:function(C){var D;if(this.xmldom){D=C.xml}else{var B=new XMLSerializer();if(C.nodeType==1){var E=document.implementation.createDocument("","",null);if(E.importNode){C=E.importNode(C,true)}E.appendChild(C);D=B.serializeToString(E)}else{D=B.serializeToString(C)}}return D},createElementNS:function(D,B){var C;if(this.xmldom){if(typeof D=="string"){C=this.xmldom.createNode(1,B,D)}else{C=this.xmldom.createNode(1,B,"")}}else{C=document.createElementNS(D,B)}return C},createTextNode:function(C){var B;if(typeof C!=="string"){C=String(C)}if(this.xmldom){B=this.xmldom.createTextNode(C)}else{B=document.createTextNode(C)}return B},getElementsByTagNameNS:function(F,E,D){var B=[];if(F.getElementsByTagNameNS){B=F.getElementsByTagNameNS(E,D)}else{var C=F.getElementsByTagName("*");var J,G;for(var H=0,I=C.length;H<I;++H){J=C[H];G=(J.prefix)?(J.prefix+":"+D):D;if((D=="*")||(G==J.nodeName)){if((E=="*")||(E==J.namespaceURI)){B.push(J)}}}}return B},getAttributeNodeNS:function(D,C,B){var J=null;if(D.getAttributeNodeNS){J=D.getAttributeNodeNS(C,B)}else{var F=D.attributes;var I,E;for(var G=0,H=F.length;G<H;++G){I=F[G];if(I.namespaceURI==C){E=(I.prefix)?(I.prefix+":"+B):B;if(E==I.nodeName){J=I;break}}}}return J},getAttributeNS:function(F,E,B){var C="";if(F.getAttributeNS){C=F.getAttributeNS(E,B)||""}else{var D=this.getAttributeNodeNS(F,E,B);if(D){C=D.nodeValue}}return C},getChildValue:function(B,D){var C=D||"";if(B){for(var E=B.firstChild;E;E=E.nextSibling){switch(E.nodeType){case 3:case 4:C+=E.nodeValue}}}return C},concatChildValues:function(C,E){var D="";var F=C.firstChild;var B;while(F){B=F.nodeValue;if(B){D+=B}F=F.nextSibling}if(D==""&&E!=undefined){D=E}return D},isSimpleContent:function(B){var D=true;for(var C=B.firstChild;C;C=C.nextSibling){if(C.nodeType===1){D=false;break}}return D},contentType:function(D){var F=false,C=false;var B=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(var E=D.firstChild;E;E=E.nextSibling){switch(E.nodeType){case 1:C=true;break;case 8:break;default:F=true}if(C&&F){break}}if(C&&F){B=OpenLayers.Format.XML.CONTENT_TYPE.MIXED}else{if(C){return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX}else{if(F){return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}}}return B},hasAttributeNS:function(D,C,B){var E=false;if(D.hasAttributeNS){E=D.hasAttributeNS(C,B)}else{E=!!this.getAttributeNodeNS(D,C,B)}return E},setAttributeNS:function(E,D,B,F){if(E.setAttributeNS){E.setAttributeNS(D,B,F)}else{if(this.xmldom){if(D){var C=E.ownerDocument.createNode(2,B,D);C.nodeValue=F;E.setAttributeNode(C)}else{E.setAttribute(B,F)}}else{throw"setAttributeNS not implemented"}}},createElementNSPlus:function(C,B){B=B||{};var E=B.uri||this.namespaces[B.prefix];if(!E){var G=C.indexOf(":");E=this.namespaces[C.substring(0,G)]}if(!E){E=this.namespaces[this.defaultPrefix]}var D=this.createElementNS(E,C);if(B.attributes){this.setAttributes(D,B.attributes)}var F=B.value;if(F!=null){D.appendChild(this.createTextNode(F))}return D},setAttributes:function(D,F){var E,C;for(var B in F){if(F[B]!=null&&F[B].toString){E=F[B].toString();C=this.namespaces[B.substring(0,B.indexOf(":"))]||null;this.setAttributeNS(D,C,B,E)}}},readNode:function(D,F){if(!F){F={}}var E=this.readers[D.namespaceURI?this.namespaceAlias[D.namespaceURI]:this.defaultPrefix];if(E){var C=D.localName||D.nodeName.split(":").pop();var B=E[C]||E["*"];if(B){B.apply(this,[D,F])}}return F},readChildNodes:function(E,F){if(!F){F={}}var D=E.childNodes;var G;for(var C=0,B=D.length;C<B;++C){G=D[C];if(G.nodeType==1){this.readNode(G,F)}}return F},writeNode:function(B,G,E){var F,D;var C=B.indexOf(":");if(C>0){F=B.substring(0,C);D=B.substring(C+1)}else{if(E){F=this.namespaceAlias[E.namespaceURI]}else{F=this.defaultPrefix}D=B}var H=this.writers[F][D].apply(this,[G]);if(E){E.appendChild(H)}return H},getChildEl:function(D,B,C){return D&&this.getThisOrNextEl(D.firstChild,B,C)},getNextEl:function(D,B,C){return D&&this.getThisOrNextEl(D.nextSibling,B,C)},getThisOrNextEl:function(E,B,D){outer:for(var C=E;C;C=C.nextSibling){switch(C.nodeType){case 1:if((!B||B===(C.localName||C.nodeName.split(":").pop()))&&(!D||D===C.namespaceURI)){break outer}C=null;break outer;case 3:if(/^\s*$/.test(C.nodeValue)){break}case 4:case 6:case 12:case 10:case 11:C=null;break outer}}return C||null},lookupNamespaceURI:function(F,G){var E=null;if(F){if(F.lookupNamespaceURI){E=F.lookupNamespaceURI(G)}else{outer:switch(F.nodeType){case 1:if(F.namespaceURI!==null&&F.prefix===G){E=F.namespaceURI;break outer}var C=F.attributes.length;if(C){var B;for(var D=0;D<C;++D){B=F.attributes[D];if(B.prefix==="xmlns"&&B.name==="xmlns:"+G){E=B.value||null;break outer}else{if(B.name==="xmlns"&&G===null){E=B.value||null;break outer}}}}E=this.lookupNamespaceURI(F.parentNode,G);break outer;case 2:E=this.lookupNamespaceURI(F.ownerElement,G);break outer;case 9:E=this.lookupNamespaceURI(F.documentElement,G);break outer;case 6:case 12:case 10:case 11:break outer;default:E=this.lookupNamespaceURI(F.parentNode,G);break outer}}}return E},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3};OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Format.WFST=function(C){C=OpenLayers.Util.applyDefaults(C,OpenLayers.Format.WFST.DEFAULTS);var B=OpenLayers.Format.WFST["v"+C.version.replace(/\./g,"_")];if(!B){throw"Unsupported WFST version: "+C.version}return new B(C)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:true,xy:true,stateName:null,initialize:function(B){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]="wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[B])},getSrsName:function(D,C){var B=C&&C.srsName;if(!B){if(D&&D.layer){B=D.layer.projection.getCode()}else{B=this.srsName}}return B},read:function(C,B){B=B||{};OpenLayers.Util.applyDefaults(B,{output:"features"});if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}if(C&&C.nodeType==9){C=C.documentElement}var D={};if(C){this.readNode(C,D)}if(D.features&&B.output==="features"){D=D.features}return D},readers:{wfs:{FeatureCollection:function(B,C){C.features=[];this.readChildNodes(B,C)}}},write:function(B){var C=this.writeNode("wfs:Transaction",B);var D=this.schemaLocationAttr();if(D){this.setAttributeNS(C,this.namespaces.xsi,"xsi:schemaLocation",D)}return OpenLayers.Format.XML.prototype.write.apply(this,[C])},writers:{wfs:{GetFeature:function(C){var E=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,outputFormat:C&&C.outputFormat,maxFeatures:C&&C.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(C)}});if(typeof this.featureType=="string"){this.writeNode("Query",C,E)}else{for(var D=0,B=this.featureType.length;D<B;D++){C.featureType=this.featureType[D];this.writeNode("Query",C,E)}}return E},Transaction:function(F){var G=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});if(F){var C,E;for(var D=0,B=F.length;D<B;++D){E=F[D];C=this.stateName[E.state];if(C){this.writeNode(C,E,G)}}}return G},Insert:function(B){var C=this.createElementNSPlus("wfs:Insert");this.srsName=this.getSrsName(B);this.writeNode("feature:_typeName",B,C);return C},Update:function(C){var D=this.createElementNSPlus("wfs:Update",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){D.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}if(this.geometryName!==null){this.srsName=this.getSrsName(C);this.writeNode("Property",{name:this.geometryName,value:C.geometry},D)}for(var B in C.attributes){if(C.attributes[B]!==undefined){this.writeNode("Property",{name:B,value:C.attributes[B]},D)}}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[C.fid]}),D);return D},Property:function(C){var B=this.createElementNSPlus("wfs:Property");this.writeNode("Name",C.name,B);if(C.value!==null){this.writeNode("Value",C.value,B)}return B},Name:function(B){return this.createElementNSPlus("wfs:Name",{value:B})},Value:function(D){var C;if(D instanceof OpenLayers.Geometry){C=this.createElementNSPlus("wfs:Value");var B=this.writeNode("feature:_geometry",D).firstChild;C.appendChild(B)}else{C=this.createElementNSPlus("wfs:Value",{value:D})}return C},Delete:function(B){var C=this.createElementNSPlus("wfs:Delete",{attributes:{typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});if(this.featureNS){C.setAttribute("xmlns:"+this.featurePrefix,this.featureNS)}this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[B.fid]}),C);return C}}},schemaLocationAttr:function(B){B=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},B);var G=OpenLayers.Util.extend({},this.schemaLocations);if(B.schema){G[B.featurePrefix]=B.schema}var F=[];var D;for(var C in G){D=this.namespaces[C];if(D){F.push(D+" "+G[C])}}var E=F.join(" ")||undefined;return E},setFilterProperty:function(D){if(D.filters){for(var C=0,B=D.filters.length;C<B;++C){this.setFilterProperty(D.filters[C])}}else{if(D instanceof OpenLayers.Filter.Spatial){D.property=this.geometryName}}},CLASS_NAME:"OpenLayers.Format.WFST.v1"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(B,C,E,D){this.url=B;this.size=(C)?C:new OpenLayers.Size(20,20);this.offset=E?E:new OpenLayers.Pixel(-(this.size.w/2),-(this.size.h/2));this.calculateOffset=D;var F=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(F)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url,this.size,this.offset,this.calculateOffset)},setSize:function(B){if(B!=null){this.size=B}this.draw()},setUrl:function(B){if(B!=null){this.url=B}this.draw()},draw:function(B){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(B);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(B){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,B)},moveTo:function(B){if(B!=null){this.px=B}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var C=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,C)}}},display:function(B){this.imageDiv.style.display=(B)?"":"none"},isDrawn:function(){var B=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return B},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(D,C){this.lonlat=D;var B=(C)?C:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=B}else{this.icon.url=B.url;this.icon.size=B.size;this.icon.offset=B.offset;this.icon.calculateOffset=B.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(B){return this.icon.draw(B)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(B){if((B!=null)&&(this.icon!=null)){this.icon.moveTo(B)}this.lonlat=this.map.getLonLatFromLayerPx(B)},isDrawn:function(){var B=(this.icon&&this.icon.isDrawn());return B},onScreen:function(){var C=false;if(this.map){var B=this.map.getExtent();C=B.containsLonLat(this.lonlat)}return C},inflate:function(C){if(this.icon){var B=new OpenLayers.Size(this.icon.size.w*C,this.icon.size.h*C);this.icon.setSize(B)}},setOpacity:function(B){this.icon.setOpacity(B)},setUrl:function(B){this.icon.setUrl(B)},display:function(B){this.icon.display(B)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var B=OpenLayers.Util.getImagesLocation()+"marker.png";var C=new OpenLayers.Size(21,25);var D=function(E){return new OpenLayers.Pixel(-(E.w/2),-E.h)};return new OpenLayers.Icon(B,C,null,D)};OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:false,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:false,fixPadding:function(){if(typeof this.padding=="number"){this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding)}},panMapIfOutOfView:false,keepInMap:false,closeOnMove:false,map:null,initialize:function(H,D,G,C,F,E){if(H==null){H=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}this.id=H;this.lonlat=D;this.contentSize=(G!=null)?G:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);if(C!=null){this.contentHTML=C}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 B=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(B,null,null,null,"relative",null,"hidden");var H=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(H,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(F){this.addCloseBox(E)}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(B){if(B==null){if((this.lonlat!=null)&&(this.map!=null)){B=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.BROWSER_NAME=="firefox"){this.map.events.register("movestart",this,function(){var C=document.defaultView.getComputedStyle(this.contentDiv,null);var D=C.getPropertyValue("overflow");if(D!="hidden"){this.contentDiv._oldOverflow=D;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var C=this.contentDiv._oldOverflow;if(C){this.contentDiv.style.overflow=C;this.contentDiv._oldOverflow=null}})}this.moveTo(B);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 B=this.map.getLayerPxFromLonLat(this.lonlat);if(B){this.moveTo(B)}}},moveTo:function(B){if((B!=null)&&(this.div!=null)){this.div.style.left=B.x+"px";this.div.style.top=B.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(D){this.size=D.clone();var C=this.getContentDivPadding();var B=C.left+C.right;var F=C.top+C.bottom;this.fixPadding();B+=this.padding.left+this.padding.right;F+=this.padding.top+this.padding.bottom;if(this.closeDiv){var E=parseInt(this.closeDiv.style.width);B+=E+C.right}this.size.w+=B;this.size.h+=F;if(OpenLayers.BROWSER_NAME=="msie"){this.contentSize.w+=C.left+C.right;this.contentSize.h+=C.bottom+C.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=D.w+"px";this.contentDiv.style.height=D.h+"px"}},updateSize:function(){var F="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var I=(this.map)?this.map.layerContainerDiv:document.body;var J=OpenLayers.Util.getRenderedDimensions(F,null,{displayClass:this.displayClass,containerElement:I});var H=this.getSafeContentSize(J);var G=null;if(H.equals(J)){G=J}else{var C=new OpenLayers.Size();C.w=(H.w<J.w)?H.w:null;C.h=(H.h<J.h)?H.h:null;if(C.w&&C.h){G=H}else{var E=OpenLayers.Util.getRenderedDimensions(F,C,{displayClass:this.contentDisplayClass,containerElement:I});var D=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((D!="hidden")&&(E.equals(H))){var B=OpenLayers.Util.getScrollbarWidth();if(C.w){E.h+=B}else{E.w+=B}}G=this.getSafeContentSize(E)}}this.setSize(G)},setBackgroundColor:function(B){if(B!=undefined){this.backgroundColor=B}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(B){if(B!=undefined){this.opacity=B}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(B){if(B!=undefined){this.border=B}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(B){if(B!=null){this.contentHTML=B}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var G=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var C=this.contentDiv.getElementsByTagName("img");for(var F=0,B=C.length;F<B;F++){var D=C[F];if(D.width==0||D.height==0){var E={popup:this,img:D};D._onImgLoad=OpenLayers.Function.bind(G,E);OpenLayers.Event.observe(D,"load",D._onImgLoad)}}},getSafeContentSize:function(L){var E=L.clone();var J=this.getContentDivPadding();var K=J.left+J.right;var H=J.top+J.bottom;this.fixPadding();K+=this.padding.left+this.padding.right;H+=this.padding.top+this.padding.bottom;if(this.closeDiv){var D=parseInt(this.closeDiv.style.width);K+=D+J.right}if(this.minSize){E.w=Math.max(E.w,(this.minSize.w-K));E.h=Math.max(E.h,(this.minSize.h-H))}if(this.maxSize){E.w=Math.min(E.w,(this.maxSize.w-K));E.h=Math.min(E.h,(this.maxSize.h-H))}if(this.map&&this.map.size){var G=0,F=0;if(this.keepInMap&&!this.panMapIfOutOfView){var I=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":G=I.x;F=this.map.size.h-I.y;break;case"tl":G=this.map.size.w-I.x;F=this.map.size.h-I.y;break;case"bl":G=this.map.size.w-I.x;F=I.y;break;case"br":G=I.x;F=I.y;break;default:G=I.x;F=this.map.size.h-I.y;break}}var B=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-H-F;var C=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-K-G;E.w=Math.min(E.w,C);E.h=Math.min(E.h,B)}return E},getContentDivPadding:function(){var B=this._contentDivPadding;if(!B){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}B=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=B;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return B},addCloseBox:function(D){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var C=this.getContentDivPadding();this.closeDiv.style.right=C.right+"px";this.closeDiv.style.top=C.top+"px";this.groupDiv.appendChild(this.closeDiv);var B=D||function(E){this.hide();OpenLayers.Event.stop(E)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(B,this))},panIntoView:function(){var F=this.map.getSize();var E=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top)));var D=E.clone();if(E.x<this.map.paddingForPopups.left){D.x=this.map.paddingForPopups.left}else{if((E.x+this.size.w)>(F.w-this.map.paddingForPopups.right)){D.x=F.w-this.map.paddingForPopups.right-this.size.w}}if(E.y<this.map.paddingForPopups.top){D.y=this.map.paddingForPopups.top}else{if((E.y+this.size.h)>(F.h-this.map.paddingForPopups.bottom)){D.y=F.h-this.map.paddingForPopups.bottom-this.size.h}}var C=E.x-D.x;var B=E.y-D.y;this.map.pan(C,B)},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(B){this.mousedown=true;OpenLayers.Event.stop(B,true)},onmousemove:function(B){if(this.mousedown){OpenLayers.Event.stop(B,true)}},onmouseup:function(B){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(B,true)}},onclick:function(B){OpenLayers.Event.stop(B,true)},onmouseout:function(B){this.mousedown=false},ondblclick:function(B){OpenLayers.Event.stop(B,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.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(I,E,H,D,C,G,F){var B=[I,E,H,D,G,F];OpenLayers.Popup.prototype.initialize.apply(this,B);this.anchor=(C!=null)?C:{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(D){var C=this.relativePosition;this.relativePosition=this.calculateRelativePosition(D);var E=this.calculateNewPx(D);var B=new Array(E);OpenLayers.Popup.prototype.moveTo.apply(this,B);if(this.relativePosition!=C){this.updateRelativePosition()}},setSize:function(C){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var B=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(B)}},calculateRelativePosition:function(C){var E=this.map.getLonLatFromLayerPx(C);var D=this.map.getExtent();var B=D.determineQuadrant(E);return OpenLayers.Bounds.oppositeQuadrant(B)},updateRelativePosition:function(){},calculateNewPx:function(C){var F=C.offset(this.anchor.offset);var B=this.size||this.contentSize;var E=(this.relativePosition.charAt(0)=="t");F.y+=(E)?-B.h:this.anchor.size.h;var D=(this.relativePosition.charAt(1)=="l");F.x+=(D)?-B.w:this.anchor.size.w;return F},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Rico=OpenLayers.Rico||{};OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(D,C,B){this.rgb={r:D,g:C,b:B}},setRed:function(B){this.rgb.r=B},setGreen:function(B){this.rgb.g=B},setBlue:function(B){this.rgb.b=B},setHue:function(C){var B=this.asHSB();B.h=C;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(B.h,B.s,B.b)},setSaturation:function(C){var B=this.asHSB();B.s=C;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(B.h,B.s,B.b)},setBrightness:function(B){var C=this.asHSB();C.b=B;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(C.h,C.s,C.b)},darken:function(C){var B=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(B.h,B.s,Math.max(B.b-C,0))},brighten:function(C){var B=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(B.h,B.s,Math.min(B.b+C,1))},blend:function(B){this.rgb.r=Math.floor((this.rgb.r+B.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+B.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+B.rgb.b)/2)},isBright:function(){var B=this.asHSB();return this.asHSB().b>0.5},isDark:function(){return !this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(E){if(E.length==4){var C=E;var E="#";for(var D=1;D<4;D++){E+=(C.charAt(D)+C.charAt(D))}}if(E.indexOf("#")==0){E=E.substring(1)}var G=E.substring(0,2);var F=E.substring(2,4);var B=E.substring(4,6);return new OpenLayers.Rico.Color(parseInt(G,16),parseInt(F,16),parseInt(B,16))};OpenLayers.Rico.Color.createColorFromBackground=function(E){var C=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(E),"backgroundColor","background-color");if(C=="transparent"&&E.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(E.parentNode)}if(C==null){return new OpenLayers.Rico.Color(255,255,255)}if(C.indexOf("rgb(")==0){var B=C.substring(4,C.length-1);var D=B.split(",");return new OpenLayers.Rico.Color(parseInt(D[0]),parseInt(D[1]),parseInt(D[2]))}else{if(C.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(C)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(H,F,J){var D=0;var E=0;var K=0;if(F==0){D=parseInt(J*255+0.5);E=D;K=D}else{var G=(H-Math.floor(H))*6;var I=G-Math.floor(G);var C=J*(1-F);var B=J*(1-F*I);var L=J*(1-(F*(1-I)));switch(parseInt(G)){case 0:D=(J*255+0.5);E=(L*255+0.5);K=(C*255+0.5);break;case 1:D=(B*255+0.5);E=(J*255+0.5);K=(C*255+0.5);break;case 2:D=(C*255+0.5);E=(J*255+0.5);K=(L*255+0.5);break;case 3:D=(C*255+0.5);E=(B*255+0.5);K=(J*255+0.5);break;case 4:D=(L*255+0.5);E=(C*255+0.5);K=(J*255+0.5);break;case 5:D=(J*255+0.5);E=(C*255+0.5);K=(B*255+0.5);break}}return{r:parseInt(D),g:parseInt(E),b:parseInt(K)}};OpenLayers.Rico.Color.RGBtoHSB=function(B,F,K){var G;var E;var J;var L=(B>F)?B:F;if(K>L){L=K}var H=(B<F)?B:F;if(K<H){H=K}J=L/255;if(L!=0){E=(L-H)/L}else{E=0}if(E==0){G=0}else{var C=(L-B)/(L-H);var I=(L-F)/(L-H);var D=(L-K)/(L-H);if(B==L){G=D-I}else{if(F==L){G=2+C-D}else{G=4+I-C}}G=G/6;if(G<0){G=G+1}}return{h:G,s:E,b:J}};OpenLayers.Rico=OpenLayers.Rico||{};OpenLayers.Rico.Corner={round:function(E,C){E=OpenLayers.Util.getElement(E);this._setOptions(C);var B=this.options.color;if(this.options.color=="fromElement"){B=this._background(E)}var D=this.options.bgColor;if(this.options.bgColor=="fromParent"){D=this._background(E.offsetParent)}this._roundCornersImpl(E,B,D)},changeColor:function(D,C){D.style.backgroundColor=C;var B=D.parentNode.getElementsByTagName("span");for(var E=0;E<B.length;E++){B[E].style.backgroundColor=C}},changeOpacity:function(D,G){var E=G;var B="alpha(opacity="+G*100+")";D.style.opacity=E;D.style.filter=B;var C=D.parentNode.getElementsByTagName("span");for(var F=0;F<C.length;F++){C[F].style.opacity=E;C[F].style.filter=B}},reRound:function(E,D){var C=E.parentNode.childNodes[0];var B=E.parentNode.childNodes[2];E.parentNode.removeChild(C);E.parentNode.removeChild(B);this.round(E.parentNode,D)},_roundCornersImpl:function(D,B,C){if(this.options.border){this._renderBorder(D,C)}if(this._isTopRounded()){this._roundTopCorners(D,B,C)}if(this._isBottomRounded()){this._roundBottomCorners(D,B,C)}},_renderBorder:function(E,F){var C="1px solid "+this._borderColor(F);var B="border-left: "+C;var G="border-right: "+C;var D="style='"+B+";"+G+"'";E.innerHTML="<div "+D+">"+E.innerHTML+"</div>"},_roundTopCorners:function(D,B,F){var E=this._createCorner(F);for(var C=0;C<this.options.numSlices;C++){E.appendChild(this._createCornerSlice(B,F,C,"top"))}D.style.paddingTop=0;D.insertBefore(E,D.firstChild)},_roundBottomCorners:function(D,B,F){var E=this._createCorner(F);for(var C=(this.options.numSlices-1);C>=0;C--){E.appendChild(this._createCornerSlice(B,F,C,"bottom"))}D.style.paddingBottom=0;D.appendChild(E)},_createCorner:function(C){var B=document.createElement("div");B.style.backgroundColor=(this._isTransparent()?"transparent":C);return B},_createCornerSlice:function(D,E,H,B){var F=document.createElement("span");var C=F.style;C.backgroundColor=D;C.display="block";C.height="1px";C.overflow="hidden";C.fontSize="1px";var G=this._borderColor(D,E);if(this.options.border&&H==0){C.borderTopStyle="solid";C.borderTopWidth="1px";C.borderLeftWidth="0px";C.borderRightWidth="0px";C.borderBottomWidth="0px";C.height="0px";C.borderColor=G}else{if(G){C.borderColor=G;C.borderStyle="solid";C.borderWidth="0px 1px"}}if(!this.options.compact&&(H==(this.options.numSlices-1))){C.height="2px"}this._setMargin(F,H,B);this._setBorder(F,H,B);return F},_setOptions:function(B){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,B||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(B,C){if(B=="transparent"){return C}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(C,B)}else{return""}}}},_setMargin:function(E,F,C){var D=this._marginSize(F);var B=C=="top"?this._whichSideTop():this._whichSideBottom();if(B=="left"){E.style.marginLeft=D+"px";E.style.marginRight="0px"}else{if(B=="right"){E.style.marginRight=D+"px";E.style.marginLeft="0px"}else{E.style.marginLeft=D+"px";E.style.marginRight=D+"px"}}},_setBorder:function(E,F,C){var D=this._borderSize(F);var B=C=="top"?this._whichSideTop():this._whichSideBottom();if(B=="left"){E.style.borderLeftWidth=D+"px";E.style.borderRightWidth="0px"}else{if(B=="right"){E.style.borderRightWidth=D+"px";E.style.borderLeftWidth="0px"}else{E.style.borderLeftWidth=D+"px";E.style.borderRightWidth=D+"px"}}if(this.options.border!=false){E.style.borderLeftWidth=D+"px";E.style.borderRightWidth=D+"px"}},_marginSize:function(F){if(this._isTransparent()){return 0}var E=[5,3,2,1];var B=[3,2,1,0];var D=[2,1];var C=[1,0];if(this.options.compact&&this.options.blend){return C[F]}else{if(this.options.compact){return D[F]}else{if(this.options.blend){return B[F]}else{return E[F]}}}},_borderSize:function(F){var E=[5,3,2,1];var C=[2,1,1,1];var B=[1,0];var D=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1}else{if(this.options.compact){return B[F]}else{if(this.options.blend){return C[F]}else{if(this.options.border){return D[F]}else{if(this._isTransparent()){return E[F]}}}}}return 0},_hasString:function(C){for(var B=1;B<arguments.length;B++){if(C.indexOf(arguments[B])>=0){return true}}return false},_blend:function(D,B){var C=OpenLayers.Rico.Color.createFromHex(D);C.blend(OpenLayers.Rico.Color.createFromHex(B));return C},_background:function(B){try{return OpenLayers.Rico.Color.createColorFromBackground(B).asHex()}catch(C){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(B){return B.childNodes.length==1&&B.childNodes[0].nodeType==3}};OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(H,D,G,C,B,F,E){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(B){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(B){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(B){if(B!=undefined){this.backgroundColor=B}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(B){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,B);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(B){this.border=0},setRicoCorners:function(){var B=this.getCornersToRound(this.relativePosition);var C={corners:B,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,C);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,C);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var B=["tl","tr","bl","br"];var C=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(B,C);return B.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(B,D,C){this.layer=B;this.lonlat=D;this.data=(C!=null)?C:{};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)}}if(this.layer!=null&&this.marker!=null){this.layer.removeMarker(this.marker)}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 C=false;if((this.layer!=null)&&(this.layer.map!=null)){var B=this.layer.map.getExtent();C=B.containsLonLat(this.lonlat)}return C},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(C){if(this.lonlat!=null){var D=this.id+"_popup";var B=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(D,this.lonlat,this.data.popupSize,this.data.popupContentHTML,B,C)}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.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"};OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,url:null,renderIntent:"default",initialize:function(D,B,C){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,B]);this.lonlat=null;this.geometry=D?D:null;this.state=null;this.attributes={};if(B){this.attributes=OpenLayers.Util.extend(this.attributes,B)}this.style=C?C: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(E){var D=false;if(this.layer&&this.layer.map){var B=this.layer.map.getExtent();if(E){var C=this.geometry.getBounds();D=B.intersectsBounds(C)}else{var F=B.toGeometry();D=F.intersects(this.geometry)}}return D},getVisibility:function(){return !(this.style&&this.style.display=="none"||!this.layer||this.layer&&this.layer.styleMap&&this.layer.styleMap.createSymbolizer(this,this.renderIntent).display=="none"||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(C,E,D){var B=false;if(this.geometry){B=this.geometry.atPoint(C,E,D)}return B},destroyPopup:function(){},move:function(B){if(!this.layer||!this.geometry.move){return undefined}var C;if(B.CLASS_NAME=="OpenLayers.LonLat"){C=this.layer.getViewPortPxFromLonLat(B)}else{C=B}var E=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var D=this.layer.map.getResolution();this.geometry.move(D*(C.x-E.x),D*(E.y-C.y));this.layer.drawFeature(this);return E},toState:function(B){if(B==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=B;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(B==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=B;break}}else{if(B==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=B;break}}else{if(B==OpenLayers.State.UNKNOWN){this.state=B}}}}},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.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(C,B){OpenLayers.Util.extend(this,B);this.rules=[];if(B&&B.rules){this.addRules(B.rules)}this.setDefaultStyle(C||OpenLayers.Feature.Vector.style["default"]);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var C=0,B=this.rules.length;C<B;C++){this.rules[C].destroy();this.rules[C]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(K){var B=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),K);var J=this.rules;var I,C;var D=[];var G=false;for(var E=0,F=J.length;E<F;E++){I=J[E];var H=I.evaluate(K);if(H){if(I instanceof OpenLayers.Rule&&I.elseFilter){D.push(I)}else{G=true;this.applySymbolizer(I,B,K)}}}if(G==false&&D.length>0){G=true;for(var E=0,F=D.length;E<F;E++){this.applySymbolizer(D[E],B,K)}}if(J.length>0&&G==false){B.display="none"}return B},applySymbolizer:function(G,E,C){var B=C.geometry?this.getSymbolizerPrefix(C.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var D=G.symbolizer[B]||G.symbolizer;if(this.defaultsPerSymbolizer===true){var F=this.defaultStyle;OpenLayers.Util.applyDefaults(D,{pointRadius:F.pointRadius});if(D.stroke===true||D.graphic===true){OpenLayers.Util.applyDefaults(D,{strokeWidth:F.strokeWidth,strokeColor:F.strokeColor,strokeOpacity:F.strokeOpacity,strokeDashstyle:F.strokeDashstyle,strokeLinecap:F.strokeLinecap})}if(D.fill===true||D.graphic===true){OpenLayers.Util.applyDefaults(D,{fillColor:F.fillColor,fillOpacity:F.fillOpacity})}if(D.graphic===true){OpenLayers.Util.applyDefaults(D,{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(E,D),C)},createLiterals:function(E,D){var C=OpenLayers.Util.extend({},D.attributes||D.data);OpenLayers.Util.extend(C,this.context);for(var B in this.propertyStyles){E[B]=OpenLayers.Style.createLiteral(E[B],C,D,B)}return E},findPropertyStyles:function(){var E={};var G=this.defaultStyle;this.addPropertyStyles(E,G);var I=this.rules;var F,H;for(var D=0,B=I.length;D<B;D++){F=I[D].symbolizer;for(var C in F){H=F[C];if(typeof H=="object"){this.addPropertyStyles(E,H)}else{this.addPropertyStyles(E,F);break}}}return E},addPropertyStyles:function(C,D){var E;for(var B in D){E=D[B];if(typeof E=="string"&&E.match(/\$\{\w+\}/)){C[B]=true}}return C},addRules:function(B){Array.prototype.push.apply(this.rules,B);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(B){this.defaultStyle=B;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(E){var D=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var C=0,B=D.length;C<B;C++){if(E.CLASS_NAME.indexOf(D[C])!=-1){return D[C]}}},clone:function(){var C=OpenLayers.Util.extend({},this);if(this.rules){C.rules=[];for(var D=0,B=this.rules.length;D<B;++D){C.rules.push(this.rules[D].clone())}}C.context=this.context&&OpenLayers.Util.extend({},this.context);var E=OpenLayers.Util.extend({},this.defaultStyle);return new OpenLayers.Style(E,C)},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(E,C,B,D){if(typeof E=="string"&&E.indexOf("${")!=-1){E=OpenLayers.String.format(E,C,[B,D]);E=(isNaN(E)||!E)?E:parseFloat(E)}return E};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"];OpenLayers.Filter=OpenLayers.Class({initialize:function(B){OpenLayers.Util.extend(this,B)},destroy:function(){},evaluate:function(B){return true},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(B){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[B])},evaluate:function(D){for(var C=0,B=this.fids.length;C<B;C++){var E=D.fid||D.id;if(E==this.fids[C]){return true}}return false},clone:function(){var B=new OpenLayers.Filter.FeatureId();OpenLayers.Util.extend(B,this);B.fids=this.fids.slice();return B},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(B){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[B])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(D){var C,B;switch(this.type){case OpenLayers.Filter.Logical.AND:for(C=0,B=this.filters.length;C<B;C++){if(this.filters[C].evaluate(D)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(C=0,B=this.filters.length;C<B;C++){if(this.filters[C].evaluate(D)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(D))}return undefined},clone:function(){var D=[];for(var C=0,B=this.filters.length;C<B;++C){D.push(this.filters[C].clone())}return new OpenLayers.Filter.Logical({type:this.type,filters:D})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:true,lowerBoundary:null,upperBoundary:null,initialize:function(B){OpenLayers.Filter.prototype.initialize.apply(this,[B])},evaluate:function(D){if(D instanceof OpenLayers.Feature.Vector){D=D.attributes}var B=false;var C=D[this.property];var F;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:F=this.value;if(!this.matchCase&&typeof C=="string"&&typeof F=="string"){B=(C.toUpperCase()==F.toUpperCase())}else{B=(C==F)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:F=this.value;if(!this.matchCase&&typeof C=="string"&&typeof F=="string"){B=(C.toUpperCase()!=F.toUpperCase())}else{B=(C!=F)}break;case OpenLayers.Filter.Comparison.LESS_THAN:B=C<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:B=C>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:B=C<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:B=C>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:B=(C>=this.lowerBoundary)&&(C<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var E=new RegExp(this.value,"gi");B=E.test(C);break}return B},value2regex:function(E,C,B){if(E=="."){var D="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(D);return null}E=E?E:"*";C=C?C:".";B=B?B:"!";this.value=this.value.replace(new RegExp("\\"+B+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+C,"g"),".");this.value=this.value.replace(new RegExp("\\"+E,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+E);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+C);return this.value},regex2value:function(){var B=this.value;B=B.replace(/!/g,"!!");B=B.replace(/(\\)?\\\./g,function(D,C){return C?D:"!."});B=B.replace(/(\\)?\\\*/g,function(D,C){return C?D:"!*"});B=B.replace(/\\\\/g,"\\");B=B.replace(/\.\*/g,"*");return B},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(),this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.0.0",version:null,parser:null,initialize:function(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B])},write:function(D,C){var B=(C&&C.version)||this.version||this.defaultVersion;if(!this.parser||this.parser.VERSION!=B){var E=OpenLayers.Format.Filter["v"+B.replace(/\./g,"_")];if(!E){throw"Can't find a Filter parser for version "+B}this.parser=new E(this.options)}return this.parser.write(D)},read:function(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var B=this.version;if(!B){B=this.defaultVersion}if(!this.parser||this.parser.VERSION!=B){var E=OpenLayers.Format.Filter["v"+B.replace(/\./g,"_")];if(!E){throw"Can't find a Filter parser for version "+B}this.parser=new E(this.options)}var C=this.parser.read(D);return C},CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B])},read:function(B){var C={};this.readers.ogc.Filter.apply(this,[B,C]);return C.filter},readers:{ogc:{Filter:function(C,B){var D={fids:[],filters:[]};this.readChildNodes(C,D);if(D.fids.length>0){B.filter=new OpenLayers.Filter.FeatureId({fids:D.fids})}else{if(D.filters.length>0){B.filter=D.filters[0]}}},FeatureId:function(B,C){var D=B.getAttribute("fid");if(D){C.fids.push(D)}},And:function(C,D){var B=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND});this.readChildNodes(C,B);D.filters.push(B)},Or:function(C,D){var B=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(C,B);D.filters.push(B)},Not:function(C,D){var B=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsLessThan:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsGreaterThan:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsLessThanOrEqualTo:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsGreaterThanOrEqualTo:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsBetween:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(C,B);D.filters.push(B)},Literal:function(B,C){C.value=OpenLayers.String.numericIf(this.getChildValue(B))},PropertyName:function(C,B){B.property=this.getChildValue(C)},LowerBoundary:function(C,B){B.lowerBoundary=OpenLayers.String.numericIf(this.readOgcExpression(C))},UpperBoundary:function(C,B){B.upperBoundary=OpenLayers.String.numericIf(this.readOgcExpression(C))},Intersects:function(B,C){this.readSpatial(B,C,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(B,C){this.readSpatial(B,C,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(B,C){this.readSpatial(B,C,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(B,C){this.readSpatial(B,C,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(B,C){C.distance=parseInt(this.getChildValue(B));C.distanceUnits=B.getAttribute("units")}}},readSpatial:function(D,E,C){var B=new OpenLayers.Filter.Spatial({type:C});this.readChildNodes(D,B);B.value=B.components[0];delete B.components;E.filters.push(B)},readOgcExpression:function(B){var D={};this.readChildNodes(B,D);var C=D.value;if(C===undefined){C=this.getChildValue(B)}return C},write:function(B){return this.writers.ogc.Filter.apply(this,[B])},writers:{ogc:{Filter:function(D){var E=this.createElementNSPlus("ogc:Filter");var C=D.CLASS_NAME.split(".").pop();if(C=="FeatureId"){for(var B=0;B<D.fids.length;++B){this.writeNode("FeatureId",D.fids[B],E)}}else{this.writeNode(this.getFilterType(D),D,E)}return E},FeatureId:function(B){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:B}})},And:function(D){var E=this.createElementNSPlus("ogc:And");var C;for(var B=0;B<D.filters.length;++B){C=D.filters[B];this.writeNode(this.getFilterType(C),C,E)}return E},Or:function(D){var E=this.createElementNSPlus("ogc:Or");var C;for(var B=0;B<D.filters.length;++B){C=D.filters[B];this.writeNode(this.getFilterType(C),C,E)}return E},Not:function(C){var D=this.createElementNSPlus("ogc:Not");var B=C.filters[0];this.writeNode(this.getFilterType(B),B,D);return D},PropertyIsLessThan:function(B){var C=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsGreaterThan:function(B){var C=this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsLessThanOrEqualTo:function(B){var C=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsGreaterThanOrEqualTo:function(B){var C=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsBetween:function(B){var C=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode("PropertyName",B,C);this.writeNode("LowerBoundary",B,C);this.writeNode("UpperBoundary",B,C);return C},PropertyName:function(B){return this.createElementNSPlus("ogc:PropertyName",{value:B.property})},Literal:function(B){return this.createElementNSPlus("ogc:Literal",{value:B})},LowerBoundary:function(B){var C=this.createElementNSPlus("ogc:LowerBoundary");this.writeNode("Literal",B.lowerBoundary,C);return C},UpperBoundary:function(B){var C=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode("Literal",B.upperBoundary,C);return C},INTERSECTS:function(B){return this.writeSpatial(B,"Intersects")},WITHIN:function(B){return this.writeSpatial(B,"Within")},CONTAINS:function(B){return this.writeSpatial(B,"Contains")},DWITHIN:function(B){var C=this.writeSpatial(B,"DWithin");this.writeNode("Distance",B,C);return C},Distance:function(B){return this.createElementNSPlus("ogc:Distance",{attributes:{units:B.distanceUnits},value:B.distance})}}},getFilterType:function(B){var C=this.filterMap[B.type];if(!C){throw"Filter writing not supported for rule type: "+B.type}return C},filterMap:{"&&":"And","||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(B){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,[B])},read:function(G){var F,E,I;var H=this.regExes.typeStr.exec(G);if(H){E=H[1].toLowerCase();I=H[2];if(this.parse[E]){F=this.parse[E].apply(this,[I])}if(this.internalProjection&&this.externalProjection){if(F&&F.CLASS_NAME=="OpenLayers.Feature.Vector"){F.geometry.transform(this.externalProjection,this.internalProjection)}else{if(F&&E!="geometrycollection"&&typeof F=="object"){for(var D=0,B=F.length;D<B;D++){var C=F[D];C.geometry.transform(this.externalProjection,this.internalProjection)}}}}}return F},write:function(B){var G,J,I,E,C;if(B.constructor==Array){G=B;C=true}else{G=[B];C=false}var D=[];if(C){D.push("GEOMETRYCOLLECTION(")}for(var F=0,H=G.length;F<H;++F){if(C&&F>0){D.push(",")}J=G[F].geometry;D.push(this.extractGeometry(J))}if(C){D.push(")")}return D.join("")},extractGeometry:function(E){var C=E.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[C]){return null}if(this.internalProjection&&this.externalProjection){E=E.clone();E.transform(this.internalProjection,this.externalProjection)}var B=C=="collection"?"GEOMETRYCOLLECTION":C.toUpperCase();var D=B+"("+this.extract[C].apply(this,[E])+")";return D},extract:{point:function(B){return B.x+" "+B.y},multipoint:function(D){var E=[];for(var C=0,B=D.components.length;C<B;++C){E.push("("+this.extract.point.apply(this,[D.components[C]])+")")}return E.join(",")},linestring:function(C){var E=[];for(var D=0,B=C.components.length;D<B;++D){E.push(this.extract.point.apply(this,[C.components[D]]))}return E.join(",")},multilinestring:function(D){var E=[];for(var C=0,B=D.components.length;C<B;++C){E.push("("+this.extract.linestring.apply(this,[D.components[C]])+")")}return E.join(",")},polygon:function(D){var E=[];for(var C=0,B=D.components.length;C<B;++C){E.push("("+this.extract.linestring.apply(this,[D.components[C]])+")")}return E.join(",")},multipolygon:function(E){var D=[];for(var C=0,B=E.components.length;C<B;++C){D.push("("+this.extract.polygon.apply(this,[E.components[C]])+")")}return D.join(",")},collection:function(D){var E=[];for(var C=0,B=D.components.length;C<B;++C){E.push(this.extractGeometry.apply(this,[D.components[C]]))}return E.join(",")}},parse:{point:function(C){var B=OpenLayers.String.trim(C).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(B[0],B[1]))},multipoint:function(G){var C;var E=OpenLayers.String.trim(G).split(this.regExes.parenComma);var F=[];for(var D=0,B=E.length;D<B;++D){C=E[D].replace(this.regExes.trimParens,"$1");F.push(this.parse.point.apply(this,[C]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(F))},linestring:function(F){var D=OpenLayers.String.trim(F).split(",");var E=[];for(var C=0,B=D.length;C<B;++C){E.push(this.parse.point.apply(this,[D[C]]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(E))},multilinestring:function(G){var D;var C=OpenLayers.String.trim(G).split(this.regExes.parenComma);var F=[];for(var E=0,B=C.length;E<B;++E){D=C[E].replace(this.regExes.trimParens,"$1");F.push(this.parse.linestring.apply(this,[D]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(F))},polygon:function(I){var D,C,G;var H=OpenLayers.String.trim(I).split(this.regExes.parenComma);var F=[];for(var E=0,B=H.length;E<B;++E){D=H[E].replace(this.regExes.trimParens,"$1");C=this.parse.linestring.apply(this,[D]).geometry;G=new OpenLayers.Geometry.LinearRing(C.components);F.push(G)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(F))},multipolygon:function(G){var E;var C=OpenLayers.String.trim(G).split(this.regExes.doubleParenComma);var F=[];for(var D=0,B=C.length;D<B;++D){E=C[D].replace(this.regExes.trimParens,"$1");F.push(this.parse.polygon.apply(this,[E]).geometry)}return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(F))},geometrycollection:function(F){F=F.replace(/,\s*([A-Za-z])/g,"|$1");var E=OpenLayers.String.trim(F).split("|");var D=[];for(var C=0,B=E.length;C<B;++C){D.push(OpenLayers.Format.WKT.prototype.read.apply(this,[E[C]]))}return D}},CLASS_NAME:"OpenLayers.Format.WKT"});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(B){if(B){this.bounds=B.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(C){var B=this.getBounds();if(!B){this.setBounds(C)}else{this.bounds.extend(C)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(C,B){},getVertices:function(B){},atPoint:function(F,I,G){var D=false;var E=this.getBounds();if((E!=null)&&(F!=null)){var C=(I!=null)?I:0;var B=(G!=null)?G:0;var H=new OpenLayers.Bounds(this.bounds.left-C,this.bounds.bottom-B,this.bounds.right+C,this.bounds.top+B);D=H.containsLonLat(F)}return D},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this))},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(G){var H=arguments.callee.format;if(!H){H=new OpenLayers.Format.WKT();arguments.callee.format=H}var E;var C=H.read(G);if(C instanceof OpenLayers.Feature.Vector){E=C.geometry}else{if(C instanceof Array){var B=C.length;var F=new Array(B);for(var D=0;D<B;++D){F[D]=C[D].geometry}E=new OpenLayers.Geometry.Collection(F)}}return E};OpenLayers.Geometry.segmentsIntersect=function(B,f,C){var P=C&&C.point;var U=C&&C.tolerance;var F=false;var W=B.x1-f.x1;var b=B.y1-f.y1;var M=B.x2-B.x1;var T=B.y2-B.y1;var Q=f.y2-f.y1;var J=f.x2-f.x1;var Z=(Q*M)-(J*T);var E=(J*b)-(Q*W);var D=(M*b)-(T*W);if(Z==0){if(E==0&&D==0){F=true}}else{var a=E/Z;var Y=D/Z;if(a>=0&&a<=1&&Y>=0&&Y<=1){if(!P){F=true}else{var H=B.x1+(a*M);var G=B.y1+(a*T);F=new OpenLayers.Geometry.Point(H,G)}}}if(U){var O;if(F){if(P){var L=[B,f];var V,H,G;outer:for(var S=0;S<2;++S){V=L[S];for(var R=1;R<3;++R){H=V["x"+R];G=V["y"+R];O=Math.sqrt(Math.pow(H-F.x,2)+Math.pow(G-F.y,2));if(O<U){F.x=H;F.y=G;break outer}}}}}else{var L=[B,f];var N,e,H,G,K,I;outer:for(var S=0;S<2;++S){N=L[S];e=L[(S+1)%2];for(var R=1;R<3;++R){K={x:N["x"+R],y:N["y"+R]};I=OpenLayers.Geometry.distanceToSegment(K,e);if(I.distance<U){if(P){F=new OpenLayers.Geometry.Point(K.x,K.y)}else{F=true}break outer}}}}}return F};OpenLayers.Geometry.distanceToSegment=function(L,E){var D=L.x;var K=L.y;var C=E.x1;var J=E.y1;var B=E.x2;var G=E.y2;var N=B-C;var M=G-J;var I=((N*(D-C))+(M*(K-J)))/(Math.pow(N,2)+Math.pow(M,2));var H,F;if(I<=0){H=C;F=J}else{if(I>=1){H=B;F=G}else{H=C+I*N;F=J+I*M}}return{distance:Math.sqrt(Math.pow(H-D,2)+Math.pow(F-K,2)),x:H,y:F}};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(B,C){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(B);this.y=parseFloat(C)},clone:function(B){if(B==null){B=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(B,this);return B},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(G,K){var E=!(K&&K.edge===false);var B=E&&K&&K.details;var C,F,I,D,H,J;if(G instanceof OpenLayers.Geometry.Point){F=this.x;I=this.y;D=G.x;H=G.y;C=Math.sqrt(Math.pow(F-D,2)+Math.pow(I-H,2));J=!B?C:{x0:F,y0:I,x1:D,y1:H,distance:C}}else{J=G.distanceTo(this,K);if(B){J={x0:J.x1,y0:J.y1,x1:J.x0,y1:J.y0,distance:J.distance}}}return J},equals:function(B){var C=false;if(B!=null){C=((this.x==B.x&&this.y==B.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(B.x)&&isNaN(B.y)))}return C},toShortString:function(){return(this.x+", "+this.y)},move:function(B,C){this.x=this.x+B;this.y=this.y+C;this.clearBounds()},rotate:function(E,C){E*=Math.PI/180;var B=this.distanceTo(C);var D=E+Math.atan2(this.y-C.y,this.x-C.x);this.x=C.x+(B*Math.cos(D));this.y=C.y+(B*Math.sin(D));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(D,B,C){C=(C==undefined)?1:C;this.x=B.x+(D*C*(this.x-B.x));this.y=B.y+(D*(this.y-B.y));this.clearBounds();return this},intersects:function(C){var B=false;if(C.CLASS_NAME=="OpenLayers.Geometry.Point"){B=this.equals(C)}else{B=C.intersects(this)}return B},transform:function(C,B){if((C&&B)){OpenLayers.Projection.transform(this,C,B);this.bounds=null}return this},getVertices:function(B){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(B){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(B!=null){this.addComponents(B)}},destroy:function(){this.components.length=0;this.components=null;OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},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 C=[];for(var D=0,B=this.components.length;D<B;D++){C.push(this.components[D].toShortString())}return C.join(",")},calculateBounds:function(){this.bounds=null;var E=new OpenLayers.Bounds();var D=this.components;if(D){for(var C=0,B=D.length;C<B;C++){E.extend(D[C].getBounds())}}if(E.left!=null&&E.bottom!=null&&E.right!=null&&E.top!=null){this.setBounds(E)}},addComponents:function(D){if(!(D instanceof Array)){D=[D]}for(var C=0,B=D.length;C<B;C++){this.addComponent(D[C])}},addComponent:function(C,B){var E=false;if(C){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,C.CLASS_NAME)>-1)){if(B!=null&&(B<this.components.length)){var F=this.components.slice(0,B);var D=this.components.slice(B,this.components.length);F.push(C);this.components=F.concat(D)}else{this.components.push(C)}C.parent=this;this.clearBounds();E=true}}return E},removeComponents:function(C){if(!(C instanceof Array)){C=[C]}for(var B=C.length-1;B>=0;--B){this.removeComponent(C[B])}},removeComponent:function(B){OpenLayers.Util.removeItem(this.components,B);this.clearBounds()},getLength:function(){var D=0;for(var C=0,B=this.components.length;C<B;C++){D+=this.components[C].getLength()}return D},getArea:function(){var D=0;for(var C=0,B=this.components.length;C<B;C++){D+=this.components[C].getArea()}return D},getGeodesicArea:function(C){var E=0;for(var D=0,B=this.components.length;D<B;D++){E+=this.components[D].getGeodesicArea(C)}return E},getCentroid:function(H){if(!H){return this.components.length&&this.components[0].getCentroid()}var L=this.components.length;if(!L){return false}var C=[];var D=[];var E=0;var I=Number.MAX_VALUE;var M;for(var K=0;K<L;++K){M=this.components[K];var F=M.getArea();var G=M.getCentroid(true);if(isNaN(F)||isNaN(G.x)||isNaN(G.y)){continue}C.push(F);E+=F;I=(F<I&&F>0)?F:I;D.push(G)}L=C.length;if(E===0){for(var K=0;K<L;++K){C[K]=1}E=C.length}else{for(var K=0;K<L;++K){C[K]/=I}E/=I}var J=0,B=0,G,F;for(var K=0;K<L;++K){G=D[K];F=C[K];J+=G.x*F;B+=G.y*F}return new OpenLayers.Geometry.Point(J/E,B/E)},getGeodesicLength:function(C){var E=0;for(var D=0,B=this.components.length;D<B;D++){E+=this.components[D].getGeodesicLength(C)}return E},move:function(C,E){for(var D=0,B=this.components.length;D<B;D++){this.components[D].move(C,E)}},rotate:function(E,C){for(var D=0,B=this.components.length;D<B;++D){this.components[D].rotate(E,C)}},resize:function(E,B,D){for(var C=0;C<this.components.length;++C){this.components[C].resize(E,B,D)}return this},distanceTo:function(I,J){var D=!(J&&J.edge===false);var B=D&&J&&J.details;var K,E,C;var F=Number.POSITIVE_INFINITY;for(var G=0,H=this.components.length;G<H;++G){K=this.components[G].distanceTo(I,J);C=B?K.distance:K;if(C<F){F=C;E=K;if(F==0){break}}}return E},equals:function(E){var C=true;if(!E||!E.CLASS_NAME||(this.CLASS_NAME!=E.CLASS_NAME)){C=false}else{if(!(E.components instanceof Array)||(E.components.length!=this.components.length)){C=false}else{for(var D=0,B=this.components.length;D<B;++D){if(!this.components[D].equals(E.components[D])){C=false;break}}}}return C},transform:function(F,D){if(F&&D){for(var E=0,B=this.components.length;E<B;E++){var C=this.components[E];C.transform(F,D)}this.bounds=null}return this},intersects:function(E){var C=false;for(var D=0,B=this.components.length;D<B;++D){C=E.intersects(this.components[D]);if(C){break}}return C},getVertices:function(C){var D=[];for(var E=0,B=this.components.length;E<B;++E){Array.prototype.push.apply(D,this.components[E].getVertices(C))}return D},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(B){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(B,C){this.addComponent(B,C)},removePoint:function(B){this.removeComponent(B)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(B){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var D=0;if(this.components&&(this.components.length>1)){for(var C=1,B=this.components.length;C<B;C++){D+=this.components[C-1].distanceTo(this.components[C])}}return D},getGeodesicLength:function(C){var F=this;if(C){var D=new OpenLayers.Projection("EPSG:4326");if(!D.equals(C)){F=this.clone().transform(C,D)}}var G=0;if(F.components&&(F.components.length>1)){var I,H;for(var E=1,B=F.components.length;E<B;E++){I=F.components[E-1];H=F.components[E];G+=OpenLayers.Util.distVincenty({lon:I.x,lat:I.y},{lon:H.x,lat:H.y})}}return G*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(B){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(B){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(L){var D=false;var K=L.CLASS_NAME;if(K=="OpenLayers.Geometry.LineString"||K=="OpenLayers.Geometry.LinearRing"||K=="OpenLayers.Geometry.Point"){var O=this.getSortedSegments();var M;if(K=="OpenLayers.Geometry.Point"){M=[{x1:L.x,y1:L.y,x2:L.x,y2:L.y}]}else{M=L.getSortedSegments()}var R,H,F,B,Q,P,E,C;outer:for(var I=0,J=O.length;I<J;++I){R=O[I];H=R.x1;F=R.x2;B=R.y1;Q=R.y2;inner:for(var G=0,N=M.length;G<N;++G){P=M[G];if(P.x1>F){break}if(P.x2<H){continue}E=P.y1;C=P.y2;if(Math.min(E,C)>Math.max(B,Q)){continue}if(Math.max(E,C)<Math.min(B,Q)){continue}if(OpenLayers.Geometry.segmentsIntersect(R,P)){D=true;break outer}}}}else{D=L.intersects(this)}return D},getSortedSegments:function(){var B=this.components.length-1;var C=new Array(B),F,E;for(var D=0;D<B;++D){F=this.components[D];E=this.components[D+1];if(F.x<E.x){C[D]={x1:F.x,y1:F.y,x2:E.x,y2:E.y}}else{C[D]={x1:E.x,y1:E.y,x2:F.x,y2:F.y}}}function G(I,H){return I.x1-H.x1}return C.sort(G)},splitWithSegment:function(R,C){var D=!(C&&C.edge===false);var O=C&&C.tolerance;var B=[];var T=this.getVertices();var N=[];var V=[];var I=false;var F,E,L;var J,Q,U;var G={point:true,tolerance:O};var H=null;for(var M=0,K=T.length-2;M<=K;++M){F=T[M];N.push(F.clone());E=T[M+1];U={x1:F.x,y1:F.y,x2:E.x,y2:E.y};L=OpenLayers.Geometry.segmentsIntersect(R,U,G);if(L instanceof OpenLayers.Geometry.Point){if((L.x===R.x1&&L.y===R.y1)||(L.x===R.x2&&L.y===R.y2)||L.equals(F)||L.equals(E)){Q=true}else{Q=false}if(Q||D){if(!L.equals(V[V.length-1])){V.push(L.clone())}if(M===0){if(L.equals(F)){continue}}if(L.equals(E)){continue}I=true;if(!L.equals(F)){N.push(L)}B.push(new OpenLayers.Geometry.LineString(N));N=[L.clone()]}}}if(I){N.push(E.clone());B.push(new OpenLayers.Geometry.LineString(N))}if(V.length>0){var P=R.x1<R.x2?1:-1;var S=R.y1<R.y2?1:-1;H={lines:B,points:V.sort(function(Y,W){return(P*Y.x-P*W.x)||(S*Y.y-S*W.y)})}}return H},split:function(V,C){var L=null;var E=C&&C.mutual;var J,F,K,D;if(V instanceof OpenLayers.Geometry.LineString){var U=this.getVertices();var H,G,T,I,B,N;var Q=[];K=[];for(var R=0,M=U.length-2;R<=M;++R){H=U[R];G=U[R+1];T={x1:H.x,y1:H.y,x2:G.x,y2:G.y};D=D||[V];if(E){Q.push(H.clone())}for(var P=0;P<D.length;++P){I=D[P].splitWithSegment(T,C);if(I){B=I.lines;if(B.length>0){B.unshift(P,1);Array.prototype.splice.apply(D,B);P+=B.length-2}if(E){for(var O=0,S=I.points.length;O<S;++O){N=I.points[O];if(!N.equals(H)){Q.push(N);K.push(new OpenLayers.Geometry.LineString(Q));if(N.equals(G)){Q=[]}else{Q=[N.clone()]}}}}}}}if(E&&K.length>0&&Q.length>0){Q.push(G.clone());K.push(new OpenLayers.Geometry.LineString(Q))}}else{L=V.splitWith(this,C)}if(D&&D.length>1){F=true}else{D=[]}if(K&&K.length>1){J=true}else{K=[]}if(F||J){if(E){L=[K,D]}else{L=D}}return L},splitWith:function(C,B){return C.split(this,B)},getVertices:function(B){var C;if(B===true){C=[this.components[0],this.components[this.components.length-1]]}else{if(B===false){C=this.components.slice(1,this.components.length-1)}else{C=this.components.slice()}}return C},distanceTo:function(I,H){var J=!(H&&H.edge===false);var Z=J&&H&&H.details;var P,F={};var S=Number.POSITIVE_INFINITY;if(I instanceof OpenLayers.Geometry.Point){var Q=this.getSortedSegments();var O=I.x;var N=I.y;var W;for(var U=0,V=Q.length;U<V;++U){W=Q[U];P=OpenLayers.Geometry.distanceToSegment(I,W);if(P.distance<S){S=P.distance;F=P;if(S===0){break}}else{if(W.x2>O&&((N>W.y1&&N<W.y2)||(N<W.y1&&N>W.y2))){break}}}if(Z){F={distance:F.distance,x0:F.x,y0:F.y,x1:O,y1:N}}else{F=F.distance}}else{if(I instanceof OpenLayers.Geometry.LineString){var E=this.getSortedSegments();var D=I.getSortedSegments();var C,B,M,Y,G;var L=D.length;var K={point:true};outer:for(var U=0,V=E.length;U<V;++U){C=E[U];Y=C.x1;G=C.y1;for(var T=0;T<L;++T){B=D[T];M=OpenLayers.Geometry.segmentsIntersect(C,B,K);if(M){S=0;F={distance:0,x0:M.x,y0:M.y,x1:M.x,y1:M.y};break outer}else{P=OpenLayers.Geometry.distanceToSegment({x:Y,y:G},B);if(P.distance<S){S=P.distance;F={distance:S,x0:Y,y0:G,x1:P.x,y1:P.y}}}}}if(!Z){F=F.distance}if(S!==0){if(C){P=I.distanceTo(new OpenLayers.Geometry.Point(C.x2,C.y2),H);var R=Z?P.distance:P;if(R<S){if(Z){F={distance:S,x0:P.x1,y0:P.y1,x1:P.x0,y1:P.y0}}else{F=R}}}}}else{F=I.distanceTo(this,H);if(Z){F={distance:F.distance,x0:F.x1,y0:F.y1,x1:F.x0,y1:F.y0}}}}return F},simplify:function(I){if(this&&this!==null){var K=this.getVertices();if(K.length<3){return this}var E=function(M,L){return(M-L)};var D=function(O,R,P,L){var Q=0;var N=0;for(var M=R,S;M<P;M++){S=C(O[R],O[P],O[M]);if(S>Q){Q=S;N=M}}if(Q>L&&N!=R){F.push(N);D(O,R,N,L);D(O,N,P,L)}};var C=function(P,O,M){var Q=Math.abs(0.5*(P.x*O.y+O.x*M.y+M.x*P.y-O.x*P.y-M.x*O.y-P.x*M.y));var N=Math.sqrt(Math.pow(P.x-O.x,2)+Math.pow(P.y-O.y,2));var L=Q/N*2;return L};var G=0;var J=K.length-1;var F=[];F.push(G);F.push(J);while(K[G].equals(K[J])){J--;F.push(J)}D(K,G,J,I);var B=[];F.sort(E);for(var H=0;H<F.length;H++){B.push(K[F[H]])}return new OpenLayers.Geometry.LineString(B)}else{return this}},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(B){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(L,Q){var H=null;var P=Q&&Q.mutual;var M,B,O,K,C;var F=[];var N=[L];for(var G=0,I=this.components.length;G<I;++G){B=this.components[G];K=false;for(var E=0;E<N.length;++E){M=B.split(N[E],Q);if(M){if(P){O=M[0];for(var D=0,J=O.length;D<J;++D){if(D===0&&F.length){F[F.length-1].addComponent(O[D])}else{F.push(new OpenLayers.Geometry.MultiLineString([O[D]]))}}K=true;M=M[1]}if(M.length){M.unshift(E,1);Array.prototype.splice.apply(N,M);break}}}if(!K){if(F.length){F[F.length-1].addComponent(B.clone())}else{F=[new OpenLayers.Geometry.MultiLineString(B.clone())]}}}if(F&&F.length>1){K=true}else{F=[]}if(N&&N.length>1){C=true}else{N=[]}if(K||C){if(P){H=[F,N]}else{H=N}}return H},splitWith:function(L,Q){var H=null;var P=Q&&Q.mutual;var M,D,O,K,B,F,N;if(L instanceof OpenLayers.Geometry.LineString){N=[];F=[L];for(var G=0,I=this.components.length;G<I;++G){B=false;D=this.components[G];for(var E=0;E<F.length;++E){M=F[E].split(D,Q);if(M){if(P){O=M[0];if(O.length){O.unshift(E,1);Array.prototype.splice.apply(F,O);E+=O.length-2}M=M[1];if(M.length===0){M=[D.clone()]}}for(var C=0,J=M.length;C<J;++C){if(C===0&&N.length){N[N.length-1].addComponent(M[C])}else{N.push(new OpenLayers.Geometry.MultiLineString([M[C]]))}}B=true}}if(!B){if(N.length){N[N.length-1].addComponent(D.clone())}else{N=[new OpenLayers.Geometry.MultiLineString([D.clone()])]}}}}else{H=L.split(this)}if(F&&F.length>1){K=true}else{F=[]}if(N&&N.length>1){B=true}else{N=[]}if(K||B){if(P){H=[F,N]}else{H=N}}return H},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(B){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(B,C){var D=false;var E=this.components.pop();if(C!=null||!B.equals(E)){D=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments)}var F=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[F]);return D},removeComponent:function(B){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var C=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[C])}},move:function(C,E){for(var D=0,B=this.components.length;D<B-1;D++){this.components[D].move(C,E)}},rotate:function(E,C){for(var D=0,B=this.components.length;D<B-1;++D){this.components[D].rotate(E,C)}},resize:function(F,C,E){for(var D=0,B=this.components.length;D<B-1;++D){this.components[D].resize(F,C,E)}return this},transform:function(F,D){if(F&&D){for(var E=0,B=this.components.length;E<B-1;E++){var C=this.components[E];C.transform(F,D)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var G=0;var F=0;for(var D=0;D<this.components.length-1;D++){var C=this.components[D];var I=this.components[D+1];G+=(C.x+I.x)*(C.x*I.y-I.x*C.y);F+=(C.y+I.y)*(C.x*I.y-I.x*C.y)}var E=-1*this.getArea();var B=G/(6*E);var H=F/(6*E);return new OpenLayers.Geometry.Point(B,H)}else{return null}},getArea:function(){var F=0;if(this.components&&(this.components.length>2)){var E=0;for(var D=0,C=this.components.length;D<C-1;D++){var B=this.components[D];var G=this.components[D+1];E+=(B.x+G.x)*(G.y-B.y)}F=-E/2}return F},getGeodesicArea:function(C){var E=this;if(C){var D=new OpenLayers.Projection("EPSG:4326");if(!D.equals(C)){E=this.clone().transform(C,D)}}var G=0;var B=E.components&&E.components.length;if(B>2){var I,H;for(var F=0;F<B-1;F++){I=E.components[F];H=E.components[F+1];G+=OpenLayers.Util.rad(H.x-I.x)*(2+Math.sin(OpenLayers.Util.rad(I.y))+Math.sin(OpenLayers.Util.rad(H.y)))}G=G*6378137*6378137/2}return G},containsPoint:function(M){var S=OpenLayers.Number.limitSigDigs;var L=14;var K=S(M.x,L);var J=S(M.y,L);function R(Y,U,W,T,V){return(((U-T)*Y)+((T*W)-(U*V)))/(W-V)}var B=this.components.length-1;var H,G,Q,E,O,C,F,D;var I=0;for(var N=0;N<B;++N){H=this.components[N];Q=S(H.x,L);E=S(H.y,L);G=this.components[N+1];O=S(G.x,L);C=S(G.y,L);if(E==C){if(J==E){if(Q<=O&&(K>=Q&&K<=O)||Q>=O&&(K<=Q&&K>=O)){I=-1;break}}continue}F=S(R(J,Q,E,O,C),L);if(F==K){if(E<C&&(J>=E&&J<=C)||E>C&&(J<=E&&J>=C)){I=-1;break}}if(F<=K){continue}if(Q!=O&&(F<Math.min(Q,O)||F>Math.max(Q,O))){continue}if(E<C&&(J>=E&&J<C)||E>C&&(J<E&&J>=C)){++I}}var P=(I==-1)?1:!!(I&1);return P},intersects:function(E){var C=false;if(E.CLASS_NAME=="OpenLayers.Geometry.Point"){C=this.containsPoint(E)}else{if(E.CLASS_NAME=="OpenLayers.Geometry.LineString"){C=E.intersects(this)}else{if(E.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){C=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[E])}else{for(var D=0,B=E.components.length;D<B;++D){C=E.components[D].intersects(this);if(C){break}}}}}return C},getVertices:function(B){return(B===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(B){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},getArea:function(){var D=0;if(this.components&&(this.components.length>0)){D+=Math.abs(this.components[0].getArea());for(var C=1,B=this.components.length;C<B;C++){D-=Math.abs(this.components[C].getArea())}}return D},getGeodesicArea:function(C){var E=0;if(this.components&&(this.components.length>0)){E+=Math.abs(this.components[0].getGeodesicArea(C));for(var D=1,B=this.components.length;D<B;D++){E-=Math.abs(this.components[D].getGeodesicArea(C))}}return E},containsPoint:function(B){var F=this.components.length;var D=false;if(F>0){D=this.components[0].containsPoint(B);if(D!==1){if(D&&F>1){var E;for(var C=1;C<F;++C){E=this.components[C].containsPoint(B);if(E){if(E===1){D=1}else{D=false}break}}}}}return D},intersects:function(F){var C=false;var E,B;if(F.CLASS_NAME=="OpenLayers.Geometry.Point"){C=this.containsPoint(F)}else{if(F.CLASS_NAME=="OpenLayers.Geometry.LineString"||F.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(E=0,B=this.components.length;E<B;++E){C=F.intersects(this.components[E]);if(C){break}}if(!C){for(E=0,B=F.components.length;E<B;++E){C=this.containsPoint(F.components[E]);if(C){break}}}}else{for(E=0,B=F.components.length;E<B;++E){C=this.intersects(F.components[E]);if(C){break}}}}if(!C&&F.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var D=this.components[0];for(E=0,B=D.components.length;E<B;++E){C=F.containsPoint(D.components[E]);if(C){break}}}return C},distanceTo:function(E,C){var D=!(C&&C.edge===false);var B;if(!D&&this.intersects(E)){B=0}else{B=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[E,C])}return B},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(J,G,C,L){var D=Math.PI*((1/C)-(1/2));if(L){D+=(L/180)*Math.PI}var B,I,H;var K=[];for(var F=0;F<C;++F){B=D+(F*2*Math.PI/C);I=J.x+(G*Math.cos(B));H=J.y+(G*Math.sin(B));K.push(new OpenLayers.Geometry.Point(I,H))}var E=new OpenLayers.Geometry.LinearRing(K);return new OpenLayers.Geometry.Polygon([E])};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(B){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:true,xy:true,initialize:function(B){this.regExes={trimSpace:(/^\s*|\s*$/g),removeSpace:(/\s*/g),splitSpace:(/\s+/),trimComma:(/\s*,\s*/g)};OpenLayers.Format.XML.prototype.initialize.apply(this,[B])},read:function(E){if(typeof E=="string"){E=OpenLayers.Format.XML.prototype.read.apply(this,[E])}var F=this.getElementsByTagNameNS(E.documentElement,this.gmlns,this.featureName);var D=[];for(var C=0;C<F.length;C++){var B=this.parseFeature(F[C]);if(B){D.push(B)}}return D},parseFeature:function(E){var F=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"];var P,I,Q,D;for(var L=0;L<F.length;++L){P=F[L];I=this.getElementsByTagNameNS(E,this.gmlns,P);if(I.length>0){D=this.parseGeometry[P.toLowerCase()];if(D){Q=D.apply(this,[I[0]]);if(this.internalProjection&&this.externalProjection){Q.transform(this.externalProjection,this.internalProjection)}}else{OpenLayers.Console.error(OpenLayers.i18n("unsupportedGeometryType",{geomType:P}))}break}}var C;var K=this.getElementsByTagNameNS(E,this.gmlns,"Box");for(L=0;L<K.length;++L){var O=K[L];var N=this.parseGeometry.box.apply(this,[O]);var M=O.parentNode;var H=M.localName||M.nodeName.split(":").pop();if(H==="boundedBy"){C=N}else{Q=N.toGeometry()}}var J;if(this.extractAttributes){J=this.parseAttributes(E)}var R=new OpenLayers.Feature.Vector(Q,J);R.bounds=C;R.gml={featureType:E.firstChild.nodeName.split(":")[1],featureNS:E.firstChild.namespaceURI,featureNSPrefix:E.firstChild.prefix};var B=E.firstChild;var G;while(B){if(B.nodeType==1){G=B.getAttribute("fid")||B.getAttribute("id");if(G){break}}B=B.nextSibling}R.fid=G;return R},parseGeometry:{point:function(E){var C,B;var F=[];var C=this.getElementsByTagNameNS(E,this.gmlns,"pos");if(C.length>0){B=C[0].firstChild.nodeValue;B=B.replace(this.regExes.trimSpace,"");F=B.split(this.regExes.splitSpace)}if(F.length==0){C=this.getElementsByTagNameNS(E,this.gmlns,"coordinates");if(C.length>0){B=C[0].firstChild.nodeValue;B=B.replace(this.regExes.removeSpace,"");F=B.split(",")}}if(F.length==0){C=this.getElementsByTagNameNS(E,this.gmlns,"coord");if(C.length>0){var G=this.getElementsByTagNameNS(C[0],this.gmlns,"X");var D=this.getElementsByTagNameNS(C[0],this.gmlns,"Y");if(G.length>0&&D.length>0){F=[G[0].firstChild.nodeValue,D[0].firstChild.nodeValue]}}}if(F.length==2){F[2]=null}if(this.xy){return new OpenLayers.Geometry.Point(F[0],F[1],F[2])}else{return new OpenLayers.Geometry.Point(F[1],F[0],F[2])}},multipoint:function(F){var C=this.getElementsByTagNameNS(F,this.gmlns,"Point");var E=[];if(C.length>0){var B;for(var D=0;D<C.length;++D){B=this.parseGeometry.point.apply(this,[C[D]]);if(B){E.push(B)}}}return new OpenLayers.Geometry.MultiPoint(E)},linestring:function(D,F){var E,C;var M=[];var N=[];E=this.getElementsByTagNameNS(D,this.gmlns,"posList");if(E.length>0){C=this.getChildValue(E[0]);C=C.replace(this.regExes.trimSpace,"");M=C.split(this.regExes.splitSpace);var I=parseInt(E[0].getAttribute("dimension"));var G,L,K,J;for(var H=0;H<M.length/I;++H){G=H*I;L=M[G];K=M[G+1];J=(I==2)?null:M[G+2];if(this.xy){N.push(new OpenLayers.Geometry.Point(L,K,J))}else{N.push(new OpenLayers.Geometry.Point(K,L,J))}}}if(M.length==0){E=this.getElementsByTagNameNS(D,this.gmlns,"coordinates");if(E.length>0){C=this.getChildValue(E[0]);C=C.replace(this.regExes.trimSpace,"");C=C.replace(this.regExes.trimComma,",");var B=C.split(this.regExes.splitSpace);for(var H=0;H<B.length;++H){M=B[H].split(",");if(M.length==2){M[2]=null}if(this.xy){N.push(new OpenLayers.Geometry.Point(M[0],M[1],M[2]))}else{N.push(new OpenLayers.Geometry.Point(M[1],M[0],M[2]))}}}}var O=null;if(N.length!=0){if(F){O=new OpenLayers.Geometry.LinearRing(N)}else{O=new OpenLayers.Geometry.LineString(N)}}return O},multilinestring:function(F){var C=this.getElementsByTagNameNS(F,this.gmlns,"LineString");var E=[];if(C.length>0){var B;for(var D=0;D<C.length;++D){B=this.parseGeometry.linestring.apply(this,[C[D]]);if(B){E.push(B)}}}return new OpenLayers.Geometry.MultiLineString(E)},polygon:function(F){var C=this.getElementsByTagNameNS(F,this.gmlns,"LinearRing");var E=[];if(C.length>0){var B;for(var D=0;D<C.length;++D){B=this.parseGeometry.linestring.apply(this,[C[D],true]);if(B){E.push(B)}}}return new OpenLayers.Geometry.Polygon(E)},multipolygon:function(F){var B=this.getElementsByTagNameNS(F,this.gmlns,"Polygon");var E=[];if(B.length>0){var D;for(var C=0;C<B.length;++C){D=this.parseGeometry.polygon.apply(this,[B[C]]);if(D){E.push(D)}}}return new OpenLayers.Geometry.MultiPolygon(E)},envelope:function(C){var F=[];var B;var G;var K=this.getElementsByTagNameNS(C,this.gmlns,"lowerCorner");if(K.length>0){var I=[];if(K.length>0){B=K[0].firstChild.nodeValue;B=B.replace(this.regExes.trimSpace,"");I=B.split(this.regExes.splitSpace)}if(I.length==2){I[2]=null}if(this.xy){var E=new OpenLayers.Geometry.Point(I[0],I[1],I[2])}else{var E=new OpenLayers.Geometry.Point(I[1],I[0],I[2])}}var H=this.getElementsByTagNameNS(C,this.gmlns,"upperCorner");if(H.length>0){var I=[];if(H.length>0){B=H[0].firstChild.nodeValue;B=B.replace(this.regExes.trimSpace,"");I=B.split(this.regExes.splitSpace)}if(I.length==2){I[2]=null}if(this.xy){var J=new OpenLayers.Geometry.Point(I[0],I[1],I[2])}else{var J=new OpenLayers.Geometry.Point(I[1],I[0],I[2])}}if(E&&J){F.push(new OpenLayers.Geometry.Point(E.x,E.y));F.push(new OpenLayers.Geometry.Point(J.x,E.y));F.push(new OpenLayers.Geometry.Point(J.x,J.y));F.push(new OpenLayers.Geometry.Point(E.x,J.y));F.push(new OpenLayers.Geometry.Point(E.x,E.y));var D=new OpenLayers.Geometry.LinearRing(F);G=new OpenLayers.Geometry.Polygon([D])}return G},box:function(F){var D=this.getElementsByTagNameNS(F,this.gmlns,"coordinates");var C;var G,B=null,E=null;if(D.length>0){C=D[0].firstChild.nodeValue;G=C.split(" ");if(G.length==2){B=G[0].split(",");E=G[1].split(",")}}if(B!==null&&E!==null){return new OpenLayers.Bounds(parseFloat(B[0]),parseFloat(B[1]),parseFloat(E[0]),parseFloat(E[1]))}}},parseAttributes:function(F){var G={};var B=F.firstChild;var E,H,D,K,J,C,I;while(B){if(B.nodeType==1){E=B.childNodes;for(H=0;H<E.length;++H){D=E[H];if(D.nodeType==1){K=D.childNodes;if(K.length==1){J=K[0];if(J.nodeType==3||J.nodeType==4){C=(D.prefix)?D.nodeName.split(":")[1]:D.nodeName;I=J.nodeValue.replace(this.regExes.trimSpace,"");G[C]=I}}else{G[D.nodeName.split(":").pop()]=null}}}break}B=B.nextSibling}return G},write:function(D){if(!(D instanceof Array)){D=[D]}var C=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName);for(var B=0;B<D.length;B++){C.appendChild(this.createFeatureXML(D[B]))}return OpenLayers.Format.XML.prototype.write.apply(this,[C])},createFeatureXML:function(K){var I=K.geometry;var F=this.buildGeometryNode(I);var J=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);J.appendChild(F);var B=this.createElementNS(this.gmlns,"gml:"+this.featureName);var L=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);var D=K.fid||K.id;L.setAttribute("fid",D);L.appendChild(J);for(var H in K.attributes){var G=this.createTextNode(K.attributes[H]);var E=H.substring(H.lastIndexOf(":")+1);var C=this.createElementNS(this.featureNS,this.featurePrefix+":"+E);C.appendChild(G);L.appendChild(C)}B.appendChild(L);return B},buildGeometryNode:function(E){if(this.externalProjection&&this.internalProjection){E=E.clone();E.transform(this.internalProjection,this.externalProjection)}var D=E.CLASS_NAME;var C=D.substring(D.lastIndexOf(".")+1);var B=this.buildGeometry[C.toLowerCase()];return B.apply(this,[E])},buildGeometry:{point:function(C){var B=this.createElementNS(this.gmlns,"gml:Point");B.appendChild(this.buildCoordinatesNode(C));return B},multipoint:function(G){var E=this.createElementNS(this.gmlns,"gml:MultiPoint");var D=G.components;var C,F;for(var B=0;B<D.length;B++){C=this.createElementNS(this.gmlns,"gml:pointMember");F=this.buildGeometry.point.apply(this,[D[B]]);C.appendChild(F);E.appendChild(C)}return E},linestring:function(C){var B=this.createElementNS(this.gmlns,"gml:LineString");B.appendChild(this.buildCoordinatesNode(C));return B},multilinestring:function(G){var E=this.createElementNS(this.gmlns,"gml:MultiLineString");var B=G.components;var D,F;for(var C=0;C<B.length;++C){D=this.createElementNS(this.gmlns,"gml:lineStringMember");F=this.buildGeometry.linestring.apply(this,[B[C]]);D.appendChild(F);E.appendChild(D)}return E},linearring:function(C){var B=this.createElementNS(this.gmlns,"gml:LinearRing");B.appendChild(this.buildCoordinatesNode(C));return B},polygon:function(H){var E=this.createElementNS(this.gmlns,"gml:Polygon");var G=H.components;var D,F,C;for(var B=0;B<G.length;++B){C=(B==0)?"outerBoundaryIs":"innerBoundaryIs";D=this.createElementNS(this.gmlns,"gml:"+C);F=this.buildGeometry.linearring.apply(this,[G[B]]);D.appendChild(F);E.appendChild(D)}return E},multipolygon:function(G){var E=this.createElementNS(this.gmlns,"gml:MultiPolygon");var B=G.components;var F,C;for(var D=0;D<B.length;++D){F=this.createElementNS(this.gmlns,"gml:polygonMember");C=this.buildGeometry.polygon.apply(this,[B[D]]);F.appendChild(C);E.appendChild(F)}return E},bounds:function(C){var B=this.createElementNS(this.gmlns,"gml:Box");B.appendChild(this.buildCoordinatesNode(C));return B}},buildCoordinatesNode:function(G){var B=this.createElementNS(this.gmlns,"gml:coordinates");B.setAttribute("decimal",".");B.setAttribute("cs",",");B.setAttribute("ts"," ");var F=[];if(G instanceof OpenLayers.Bounds){F.push(G.left+","+G.bottom);F.push(G.right+","+G.top)}else{var D=(G.components)?G.components:[G];for(var C=0;C<D.length;C++){F.push(D[C].x+","+D[C].y)}}var E=this.createTextNode(F.join(" "));B.appendChild(E);return B},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(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B]);this.setGeometryTypes();if(B&&B.featureNS){this.setNamespace("feature",B.featureNS)}this.singleFeatureType=!B||(typeof B.featureType==="string")},read:function(F){if(typeof F=="string"){F=OpenLayers.Format.XML.prototype.read.apply(this,[F])}if(F&&F.nodeType==9){F=F.documentElement}var D=[];this.readNode(F,{features:D});if(D.length==0){var E=this.getElementsByTagNameNS(F,this.namespaces.gml,"featureMember");if(E.length){for(var C=0,B=E.length;C<B;++C){this.readNode(E[C],{features:D})}}else{var E=this.getElementsByTagNameNS(F,this.namespaces.gml,"featureMembers");if(E.length){this.readNode(E[0],{features:D})}}}return D},readers:{gml:{featureMember:function(B,C){this.readChildNodes(B,C)},featureMembers:function(B,C){this.readChildNodes(B,C)},name:function(B,C){C.name=this.getChildValue(B)},boundedBy:function(C,D){var B={};this.readChildNodes(C,B);if(B.components&&B.components.length>0){D.bounds=B.components[0]}},Point:function(C,B){var D={points:[]};this.readChildNodes(C,D);if(!B.components){B.components=[]}B.components.push(D.points[0])},coordinates:function(F,H){var I=this.getChildValue(F).replace(this.regExes.trimSpace,"");I=I.replace(this.regExes.trimComma,",");var B=I.split(this.regExes.splitSpace);var G;var E=B.length;var D=new Array(E);for(var C=0;C<E;++C){G=B[C].split(",");if(this.xy){D[C]=new OpenLayers.Geometry.Point(G[0],G[1],G[2])}else{D[C]=new OpenLayers.Geometry.Point(G[1],G[0],G[2])}}H.points=D},coord:function(B,C){var D={};this.readChildNodes(B,D);if(!C.points){C.points=[]}C.points.push(new OpenLayers.Geometry.Point(D.x,D.y,D.z))},X:function(B,C){C.x=this.getChildValue(B)},Y:function(B,C){C.y=this.getChildValue(B)},Z:function(B,C){C.z=this.getChildValue(B)},MultiPoint:function(C,B){var D={components:[]};this.readChildNodes(C,D);B.components=[new OpenLayers.Geometry.MultiPoint(D.components)]},pointMember:function(B,C){this.readChildNodes(B,C)},LineString:function(C,B){var D={};this.readChildNodes(C,D);if(!B.components){B.components=[]}B.components.push(new OpenLayers.Geometry.LineString(D.points))},MultiLineString:function(C,B){var D={components:[]};this.readChildNodes(C,D);B.components=[new OpenLayers.Geometry.MultiLineString(D.components)]},lineStringMember:function(B,C){this.readChildNodes(B,C)},Polygon:function(C,B){var D={outer:null,inner:[]};this.readChildNodes(C,D);D.inner.unshift(D.outer);if(!B.components){B.components=[]}B.components.push(new OpenLayers.Geometry.Polygon(D.inner))},LinearRing:function(C,D){var B={};this.readChildNodes(C,B);D.components=[new OpenLayers.Geometry.LinearRing(B.points)]},MultiPolygon:function(C,B){var D={components:[]};this.readChildNodes(C,D);B.components=[new OpenLayers.Geometry.MultiPolygon(D.components)]},polygonMember:function(B,C){this.readChildNodes(B,C)},GeometryCollection:function(C,B){var D={components:[]};this.readChildNodes(C,D);B.components=[new OpenLayers.Geometry.Collection(D.components)]},geometryMember:function(B,C){this.readChildNodes(B,C)}},feature:{"*":function(D,E){var B;var C=D.localName||D.nodeName.split(":").pop();if(E.features){if(!this.singleFeatureType&&(OpenLayers.Util.indexOf(this.featureType,C)!==-1)){B="_typeName"}else{if(C===this.featureType){B="_typeName"}}}else{if(D.childNodes.length==0||(D.childNodes.length==1&&D.firstChild.nodeType==3)){if(this.extractAttributes){B="_attribute"}}else{B="_geometry"}}if(B){this.readers.feature[B].apply(this,[D,E])}},_typeName:function(D,E){var B={components:[],attributes:{}};this.readChildNodes(D,B);if(B.name){B.attributes.name=B.name}var C=new OpenLayers.Feature.Vector(B.components[0],B.attributes);if(!this.singleFeatureType){C.type=D.nodeName.split(":").pop();C.namespace=D.namespaceURI}var F=D.getAttribute("fid")||this.getAttributeNS(D,this.namespaces.gml,"id");if(F){C.fid=F}if(this.internalProjection&&this.externalProjection&&C.geometry){C.geometry.transform(this.externalProjection,this.internalProjection)}if(B.bounds){C.bounds=B.bounds}E.features.push(C)},_geometry:function(B,C){this.readChildNodes(B,C)},_attribute:function(C,E){var B=C.localName||C.nodeName.split(":").pop();var D=this.getChildValue(C);E.attributes[B]=D}},wfs:{FeatureCollection:function(B,C){this.readChildNodes(B,C)}}},write:function(D){var C;if(D instanceof Array){C="featureMembers"}else{C="featureMember"}var B=this.writeNode("gml:"+C,D);this.setAttributeNS(B,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{gml:{featureMember:function(B){var C=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",B,C);return C},MultiPoint:function(D){var C=this.createElementNSPlus("gml:MultiPoint");for(var B=0;B<D.components.length;++B){this.writeNode("pointMember",D.components[B],C)}return C},pointMember:function(C){var B=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",C,B);return B},MultiLineString:function(D){var C=this.createElementNSPlus("gml:MultiLineString");for(var B=0;B<D.components.length;++B){this.writeNode("lineStringMember",D.components[B],C)}return C},lineStringMember:function(C){var B=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",C,B);return B},MultiPolygon:function(D){var C=this.createElementNSPlus("gml:MultiPolygon");for(var B=0;B<D.components.length;++B){this.writeNode("polygonMember",D.components[B],C)}return C},polygonMember:function(C){var B=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",C,B);return B},GeometryCollection:function(E){var D=this.createElementNSPlus("gml:GeometryCollection");for(var C=0,B=E.components.length;C<B;++C){this.writeNode("geometryMember",E.components[C],D)}return D},geometryMember:function(C){var B=this.createElementNSPlus("gml:geometryMember");var D=this.writeNode("feature:_geometry",C);B.appendChild(D.firstChild);return B}},feature:{_typeName:function(C){var D=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:C.fid}});if(C.geometry){this.writeNode("feature:_geometry",C.geometry,D)}for(var B in C.attributes){var E=C.attributes[B];if(E!=null){this.writeNode("feature:_attribute",{name:B,value:E},D)}}return D},_geometry:function(D){if(this.externalProjection&&this.internalProjection){D=D.clone().transform(this.internalProjection,this.externalProjection)}var C=this.createElementNSPlus("feature:"+this.geometryName);var B=this.geometryTypes[D.CLASS_NAME];var E=this.writeNode("gml:"+B,D,C);if(this.srsName){E.setAttribute("srsName",this.srsName)}return C},_attribute:function(B){return this.createElementNSPlus("feature:"+B.name,{value:B.value})}},wfs:{FeatureCollection:function(D){var E=this.createElementNSPlus("wfs:FeatureCollection");for(var C=0,B=D.length;C<B;++C){this.writeNode("gml:featureMember",D[C],E)}return E}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:false,multiCurve:true,surface:false,multiSurface:true,initialize:function(B){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[B])},readers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(B,C){this.readChildNodes(B,C)},Curve:function(C,B){var D={points:[]};this.readChildNodes(C,D);if(!B.components){B.components=[]}B.components.push(new OpenLayers.Geometry.LineString(D.points))},segments:function(B,C){this.readChildNodes(B,C)},LineStringSegment:function(C,B){var D={};this.readChildNodes(C,D);if(D.points){Array.prototype.push.apply(B.points,D.points)}},pos:function(C,E){var F=this.getChildValue(C).replace(this.regExes.trimSpace,"");var D=F.split(this.regExes.splitSpace);var B;if(this.xy){B=new OpenLayers.Geometry.Point(D[0],D[1],D[2])}else{B=new OpenLayers.Geometry.Point(D[1],D[0],D[2])}E.points=[B]},posList:function(B,E){var I=this.getChildValue(B).replace(this.regExes.trimSpace,"");var L=I.split(this.regExes.splitSpace);var F=parseInt(B.getAttribute("dimension"))||2;var C,M,K,H;var J=L.length/F;var N=new Array(J);for(var D=0,G=L.length;D<G;D+=F){M=L[D];K=L[D+1];H=(F==2)?undefined:L[D+2];if(this.xy){N[D/F]=new OpenLayers.Geometry.Point(M,K,H)}else{N[D/F]=new OpenLayers.Geometry.Point(K,M,H)}}E.points=N},Surface:function(B,C){this.readChildNodes(B,C)},patches:function(B,C){this.readChildNodes(B,C)},PolygonPatch:function(B,C){this.readers.gml.Polygon.apply(this,[B,C])},exterior:function(C,B){var D={};this.readChildNodes(C,D);B.outer=D.components[0]},interior:function(C,B){var D={};this.readChildNodes(C,D);B.inner.push(D.components[0])},MultiCurve:function(C,B){var D={components:[]};this.readChildNodes(C,D);if(D.components.length>0){B.components=[new OpenLayers.Geometry.MultiLineString(D.components)]}},curveMember:function(B,C){this.readChildNodes(B,C)},MultiSurface:function(C,B){var D={components:[]};this.readChildNodes(C,D);if(D.components.length>0){B.components=[new OpenLayers.Geometry.MultiPolygon(D.components)]}},surfaceMember:function(B,C){this.readChildNodes(B,C)},surfaceMembers:function(B,C){this.readChildNodes(B,C)},pointMembers:function(B,C){this.readChildNodes(B,C)},lineStringMembers:function(B,C){this.readChildNodes(B,C)},polygonMembers:function(B,C){this.readChildNodes(B,C)},geometryMembers:function(B,C){this.readChildNodes(B,C)},Envelope:function(E,C){var F={points:new Array(2)};this.readChildNodes(E,F);if(!C.components){C.components=[]}var D=F.points[0];var B=F.points[1];C.components.push(new OpenLayers.Bounds(D.x,D.y,B.x,B.y))},lowerCorner:function(C,B){var D={};this.readers.gml.pos.apply(this,[C,D]);B.points[0]=D.points[0]},upperCorner:function(C,B){var D={};this.readers.gml.pos.apply(this,[C,D]);B.points[1]=D.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(D){var C;if(D instanceof Array){C="featureMembers"}else{C="featureMember"}var B=this.writeNode("gml:"+C,D);this.setAttributeNS(B,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(D){var E=this.createElementNSPlus("gml:featureMembers");for(var C=0,B=D.length;C<B;++C){this.writeNode("feature:_typeName",D[C],E)}return E},Point:function(C){var B=this.createElementNSPlus("gml:Point");this.writeNode("pos",C,B);return B},pos:function(B){var C=(this.xy)?(B.x+" "+B.y):(B.y+" "+B.x);return this.createElementNSPlus("gml:pos",{value:C})},LineString:function(C){var B=this.createElementNSPlus("gml:LineString");this.writeNode("posList",C.components,B);return B},Curve:function(C){var B=this.createElementNSPlus("gml:Curve");this.writeNode("segments",C,B);return B},segments:function(C){var B=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",C,B);return B},LineStringSegment:function(C){var B=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",C.components,B);return B},posList:function(E){var C=E.length;var F=new Array(C);var B;for(var D=0;D<C;++D){B=E[D];if(this.xy){F[D]=B.x+" "+B.y}else{F[D]=B.y+" "+B.x}}return this.createElementNSPlus("gml:posList",{value:F.join(" ")})},Surface:function(C){var B=this.createElementNSPlus("gml:Surface");this.writeNode("patches",C,B);return B},patches:function(C){var B=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",C,B);return B},PolygonPatch:function(E){var D=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",E.components[0],D);for(var C=1,B=E.components.length;C<B;++C){this.writeNode("interior",E.components[C],D)}return D},Polygon:function(E){var D=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",E.components[0],D);for(var C=1,B=E.components.length;C<B;++C){this.writeNode("interior",E.components[C],D)}return D},exterior:function(B){var C=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",B,C);return C},interior:function(B){var C=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",B,C);return C},LinearRing:function(B){var C=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",B.components,C);return C},MultiCurve:function(E){var D=this.createElementNSPlus("gml:MultiCurve");for(var C=0,B=E.components.length;C<B;++C){this.writeNode("curveMember",E.components[C],D)}return D},curveMember:function(C){var B=this.createElementNSPlus("gml:curveMember");if(this.curve){this.writeNode("Curve",C,B)}else{this.writeNode("LineString",C,B)}return B},MultiSurface:function(E){var D=this.createElementNSPlus("gml:MultiSurface");for(var C=0,B=E.components.length;C<B;++C){this.writeNode("surfaceMember",E.components[C],D)}return D},surfaceMember:function(B){var C=this.createElementNSPlus("gml:surfaceMember");if(this.surface){this.writeNode("Surface",B,C)}else{this.writeNode("Polygon",B,C)}return C},Envelope:function(C){var B=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",C,B);this.writeNode("upperCorner",C,B);if(this.srsName){B.setAttribute("srsName",this.srsName)}return B},lowerCorner:function(B){var C=(this.xy)?(B.left+" "+B.bottom):(B.bottom+" "+B.left);return this.createElementNSPlus("gml:lowerCorner",{value:C})},upperCorner:function(B){var C=(this.xy)?(B.right+" "+B.top):(B.top+" "+B.right);return this.createElementNSPlus("gml:upperCorner",{value:C})}},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"});OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(B){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[B])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(C,E){var D=C.getAttribute("matchCase");var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!(D==="false"||D==="0")});this.readChildNodes(C,B);E.filters.push(B)},PropertyIsNotEqualTo:function(C,E){var D=C.getAttribute("matchCase");var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!(D==="false"||D==="0")});this.readChildNodes(C,B);E.filters.push(B)},PropertyIsLike:function(E,F){var D=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(E,D);var G=E.getAttribute("wildCard");var C=E.getAttribute("singleChar");var B=E.getAttribute("escapeChar");D.value2regex(G,C,B);F.filters.push(D)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(B){var C=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:B.matchCase}});this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsNotEqualTo:function(B){var C=this.createElementNSPlus("ogc:PropertyIsNotEqualTo",{attributes:{matchCase:B.matchCase}});this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsLike:function(B){var C=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escapeChar:"!"}});this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.regex2value(),C);return C},BBOX:function(B){var D=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",B,D);var C=this.writeNode("gml:Envelope",B.value);if(B.projection){C.setAttribute("srsName",B.projection)}D.appendChild(C);return D}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature},writeSpatial:function(C,B){var D=this.createElementNSPlus("ogc:"+B);this.writeNode("PropertyName",C,D);var E;if(C.value instanceof OpenLayers.Geometry){E=this.writeNode("feature:_geometry",C.value).firstChild}else{E=this.writeNode("gml:Envelope",C.value)}if(C.projection){E.setAttribute("srsName",C.projection)}D.appendChild(E);return D},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:"1.1.0",schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"},initialize:function(B){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[B]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[B])},readers:{wfs:OpenLayers.Util.applyDefaults({FeatureCollection:function(B,C){C.numberOfFeatures=parseInt(B.getAttribute("numberOfFeatures"));OpenLayers.Format.WFST.v1.prototype.readers.wfs["FeatureCollection"].apply(this,arguments)},TransactionResponse:function(B,C){C.insertIds=[];C.success=false;this.readChildNodes(B,C)},TransactionSummary:function(B,C){C.success=true},InsertResults:function(B,C){this.readChildNodes(B,C)},Feature:function(C,B){var D={fids:[]};this.readChildNodes(C,D);B.insertIds.push(D.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({GetFeature:function(B){var C=OpenLayers.Format.WFST.v1.prototype.writers.wfs["GetFeature"].apply(this,arguments);B&&B.resultType&&this.setAttributes(C,{resultType:B.resultType});return C},Query:function(C){C=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},C);var E=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(C.featureNS?C.featurePrefix+":":"")+C.featureType,srsName:C.srsName}});if(C.featureNS){E.setAttribute("xmlns:"+C.featurePrefix,C.featureNS)}if(C.propertyNames){for(var D=0,B=C.propertyNames.length;D<B;D++){this.writeNode("wfs:PropertyName",{property:C.propertyNames[D]},E)}}if(C.filter){this.setFilterProperty(C.filter);this.writeNode("ogc:Filter",C.filter,E)}return E},PropertyName:function(B){return this.createElementNSPlus("wfs:PropertyName",{value:B.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(B){OpenLayers.Util.extend(this,B);this.options=B;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(B){this.layer=B},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.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:false,initialize:function(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B])},activate:function(){var B=OpenLayers.Strategy.prototype.activate.apply(this,arguments);if(B){this.cache=[];this.layer.events.on({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})}return B},deactivate:function(){this.cache=null;if(this.layer&&this.layer.events){this.layer.events.un({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this})}return OpenLayers.Strategy.prototype.deactivate.apply(this,arguments)},handleAdd:function(F){if(!this.caching&&this.filter){var E=F.features;F.features=[];var C;for(var B=0,D=E.length;B<D;++B){C=E[B];if(this.filter.evaluate(C)){F.features.push(C)}else{this.cache.push(C)}}}},handleRemove:function(B){if(!this.caching){this.cache=[]}},setFilter:function(B){this.filter=B;var D=this.cache;this.cache=[];this.handleAdd({features:this.layer.features});if(this.cache.length>0){this.caching=true;this.layer.removeFeatures(this.cache.slice(),{silent:true});this.caching=false}if(D.length>0){var C={features:D};this.handleAdd(C);this.caching=true;this.layer.addFeatures(C.features,{silent:true});this.caching=false}},CLASS_NAME:"OpenLayers.Strategy.Filter"});OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:"1.1.0",version:null,initialize:function(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B]);this.options=B},read:function(F){if(typeof F=="string"){F=OpenLayers.Format.XML.prototype.read.apply(this,[F])}var D=F.documentElement;var C=this.version;if(!C){C=D.getAttribute("version");if(!C){C=this.defaultVersion}}var E=OpenLayers.Format.WFSCapabilities["v"+C.replace(/\./g,"_")];if(!E){throw"Can't find a WFS capabilities parser for version "+C}var G=new E(this.options);var B=G.read(F);B.version=C;return B},CLASS_NAME:"OpenLayers.Format.WFSCapabilities"});OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.WFSCapabilities,{initialize:function(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B]);this.options=B},read:function(D){if(typeof D=="string"){D=OpenLayers.Format.XML.prototype.read.apply(this,[D])}var B={};var C=D.documentElement;this.runChildNodes(B,C);return B},runChildNodes:function(G,F){var D=F.childNodes;var C,E;for(var B=0;B<D.length;++B){C=D[B];if(C.nodeType==1){E=this["read_cap_"+C.nodeName];if(E){E.apply(this,[G,C])}}}},read_cap_FeatureTypeList:function(D,C){var B={featureTypes:[]};this.runChildNodes(B,C);D.featureTypeList=B},read_cap_FeatureType:function(B,E,C){var D={};this.runChildNodes(D,E);B.featureTypes.push(D)},read_cap_Name:function(E,C){var B=this.getChildValue(C);if(B){var D=B.split(":");E.name=D.pop();if(D.length>0){E.featureNS=this.lookupNamespaceURI(C,D[0])}}},read_cap_Title:function(C,B){var D=this.getChildValue(B);if(D){C.title=D}},read_cap_Abstract:function(D,C){var B=this.getChildValue(C);if(B){D["abstract"]=B}},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(B){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[B])},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{EVENT_TYPES:["start","success","fail"],events:null,auto:false,timer:null,initialize:function(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B]);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},activate:function(){var B=OpenLayers.Strategy.prototype.activate.call(this);if(B){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return B},deactivate:function(){var B=OpenLayers.Strategy.prototype.deactivate.call(this);if(B){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return B},triggerSave:function(C){var B=C.feature;if(B.state===OpenLayers.State.INSERT||B.state===OpenLayers.State.UPDATE||B.state===OpenLayers.State.DELETE){this.save([C.feature])}},save:function(E){if(!E){E=this.layer.features}this.events.triggerEvent("start",{features:E});var G=this.layer.projection;var D=this.layer.map.getProjectionObject();if(!D.equals(G)){var B=E.length;var F=new Array(B);var I,H;for(var C=0;C<B;++C){I=E[C];H=I.clone();H.fid=I.fid;H.state=I.state;if(I.url){H.url=I.url}H._original=I;H.geometry.transform(D,G);F[C]=H}E=F}this.layer.protocol.commit(E,{callback:this.onCommit,scope:this})},onCommit:function(E){var J={response:E};if(E.success()){var C=E.reqFeatures;var B,K;var D=[];var I=E.insertIds||[];var F=0;for(var G=0,H=C.length;G<H;++G){K=C[G];K=K._original||K;B=K.state;if(B){if(B==OpenLayers.State.DELETE){D.push(K)}else{if(B==OpenLayers.State.INSERT){K.fid=I[F];++F}}K.state=null}}if(D.length>0){this.layer.destroyFeatures(D)}this.events.triggerEvent("success",J)}else{this.events.triggerEvent("fail",J)}},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(E,C,B){OpenLayers.Util.extend(this,B);this.control=E;this.callbacks=C;var D=this.map||E.map;if(D){this.setMap(D)}this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(B){this.map=B},checkModifiers:function(B){if(this.keyMask==null){return true}var C=(B.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(B.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(B.altKey?OpenLayers.Handler.MOD_ALT:0);return(C==this.keyMask)},activate:function(){if(this.active){return false}var D=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var C=0,B=D.length;C<B;C++){if(this[D[C]]){this.register(D[C],this[D[C]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var D=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var C=0,B=D.length;C<B;C++){if(this[D[C]]){this.unregister(D[C],this[D[C]])}}this.active=false;return true},callback:function(C,B){if(C&&this.callbacks[C]){this.callbacks[C].apply(this.control,B)}},register:function(B,C){this.map.events.registerPriority(B,this,C);this.map.events.registerPriority(B,this,this.setEvent)},unregister:function(B,C){this.map.events.unregister(B,this,C);this.map.events.unregister(B,this,this.setEvent)},setEvent:function(B){this.evt=B;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.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(D,C,B){if(!(B&&B.layerOptions&&B.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 B=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:OpenLayers.Function.True},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,B);this.map.addLayer(this.layer);return true},createFeature:function(B){var C=this.map.getLonLatFromPixel(B);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(C.lon,C.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(C){var B=C?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(B,[this.geometryClone()]);if(C||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(B){OpenLayers.Event.stop(B);return false},dblclick:function(B){OpenLayers.Event.stop(B);return false},modifyFeature:function(B){var C=this.map.getLonLatFromPixel(B);this.point.geometry.x=C.lon;this.point.geometry.y=C.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 B=this.point&&this.point.geometry;if(B&&this.multi){B=new OpenLayers.Geometry.MultiPoint([B])}return B},geometryClone:function(){var B=this.getGeometry();return B&&B.clone()},mousedown:function(B){if(!this.checkModifiers(B)){return true}if(this.lastDown&&this.lastDown.equals(B.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(B.xy)}else{this.modifyFeature(B.xy)}this.lastDown=B.xy;return false},mousemove:function(B){if(this.drawing){this.modifyFeature(B.xy)}return true},mouseup:function(B){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(D,C,B){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(B){var C=this.control.map.getLonLatFromPixel(B);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(C.lon,C.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(B){this.layer.removeFeatures([this.point]);var C=this.control.map.getLonLatFromPixel(B);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(C.lon,C.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(B){return(this.freehandToggle&&B[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(B){var C=this.control.map.getLonLatFromPixel(B);this.point.geometry.x=C.lon;this.point.geometry.y=C.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 B=this.line&&this.line.geometry;if(B&&this.multi){B=new OpenLayers.Geometry.MultiLineString([B])}return B},mousedown:function(B){if(this.lastDown&&this.lastDown.equals(B.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(B.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(B.xy)){this.addPoint(B.xy)}}this.mouseDown=true;this.lastDown=B.xy;this.drawing=true;return false},mousemove:function(B){if(this.drawing){if(this.mouseDown&&this.freehandMode(B)){this.addPoint(B.xy)}else{this.modifyFeature(B.xy)}}return true},mouseup:function(B){this.mouseDown=false;if(this.drawing){if(this.freehandMode(B)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(B.xy)}this.lastUp=B.xy}return false}return true},finishGeometry:function(){var B=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[B]);this.removePoint();this.finalize()},dblclick:function(B){if(!this.freehandMode(B)){this.finishGeometry()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{holeModifier:null,drawingHole:false,polygon:null,initialize:function(D,C,B){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(B){var G=this.control.map.getLonLatFromPixel(B);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(G.lon,G.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));var D;if(this.holeModifier&&(this.evt[this.holeModifier])){var H=this.point.geometry;var F=this.control.layer.features;var E;for(var C=F.length-1;C>=0;--C){E=F[C].geometry;if((E instanceof OpenLayers.Geometry.Polygon||E instanceof OpenLayers.Geometry.MultiPolygon)&&E.intersects(H)){D=F[C];this.control.layer.removeFeatures([D],{silent:true});this.control.layer.events.registerPriority("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology);D.geometry.addComponent(this.line.geometry);this.polygon=D;this.drawingHole=true;break}}}if(!D){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})},enforceTopology:function(E){var B=E.vertex;var D=this.line.geometry.components;if(!this.polygon.geometry.intersects(B)){var C=D[D.length-3];B.x=C.x;B.y=C.y}},finalizeInteriorRing:function(){var D=this.line.geometry;var C=(D.getArea()!==0);if(C){var I=this.polygon.geometry.components;for(var E=I.length-2;E>=0;--E){if(D.intersects(I[E])){C=false;break}}if(C){var H;outer:for(var E=I.length-2;E>0;--E){var F=I[E].components;for(var B=0,G=F.length;B<G;++B){if(D.containsPoint(F[B])){C=false;break outer}}}}}if(C){if(this.polygon.state!==OpenLayers.State.INSERT){this.polygon.state=OpenLayers.State.UPDATE}}else{this.polygon.geometry.removeComponent(D)}this.restoreFeature();return false},cancel:function(){if(this.drawingHole){this.polygon.geometry.removeComponent(this.line.geometry);this.restoreFeature(true)}return OpenLayers.Handler.Path.prototype.cancel.apply(this,arguments)},restoreFeature:function(B){this.control.layer.events.unregister("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.unregister("sketchmodified",this,this.enforceTopology);this.layer.removeFeatures([this.polygon],{silent:true});this.control.layer.addFeatures([this.polygon],{silent:true});this.drawingHole=false;if(!B){this.control.layer.events.triggerEvent("sketchcomplete",{feature:this.polygon})}},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 B=this.polygon&&this.polygon.geometry;if(B&&this.multi){B=new OpenLayers.Geometry.MultiPolygon([B])}return B},dblclick:function(B){if(!this.freehandMode(B)){var C=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[C]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(B,C){this.container=OpenLayers.Util.getElement(B)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(B,C){this.extent=B.clone();if(C){this.resolution=null}},setSize:function(B){this.size=B.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(D,F){if(F==null){F=D.style}if(D.geometry){var G=D.geometry.getBounds();if(G){if(!G.intersectsBounds(this.extent)){F={display:"none"}}var I=this.drawGeometry(D.geometry,F,D.id);if(F.display!="none"&&F.label&&I!==false){var B=D.geometry.getCentroid();if(F.labelXOffset||F.labelYOffset){var E=isNaN(F.labelXOffset)?0:F.labelXOffset;var H=isNaN(F.labelYOffset)?0:F.labelYOffset;var C=this.getResolution();B.move(E*C,H*C)}this.drawText(D.id,F,B)}else{this.removeText(D.id)}return I}}},drawGeometry:function(D,B,C){},drawText:function(D,C,B){},removeText:function(B){},clear:function(){},getFeatureIdFromEvent:function(B){},eraseFeatures:function(E){if(!(E instanceof Array)){E=[E]}for(var D=0,B=E.length;D<B;++D){var C=E[D];this.eraseGeometry(C.geometry,C.id);this.removeText(C.id)}},eraseGeometry:function(C,B){},moveRoot:function(B){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(C){var B=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer);if(C.stroke===false){delete B.strokeWidth;delete B.strokeColor}if(C.fill===false){delete B.fillColor}OpenLayers.Util.extend(B,C);return B},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Renderer.defaultSymbolizer={fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1,pointRadius:0};OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,initialize:function(B){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={}},eraseGeometry:function(C,B){this.eraseFeatures(this.features[B][0])},supported:function(){var B=document.createElement("canvas");return !!B.getContext},setSize:function(B){this.size=B.clone();this.root.style.width=B.w+"px";this.root.style.height=B.h+"px";this.root.width=B.w;this.root.height=B.h;this.resolution=null},drawFeature:function(B,C){C=C||B.style;C=this.applyDefaultSymbolizer(C);this.features[B.id]=[B,C];this.redraw()},drawGeometry:function(E,D){var C=E.CLASS_NAME;if((C=="OpenLayers.Geometry.Collection")||(C=="OpenLayers.Geometry.MultiPoint")||(C=="OpenLayers.Geometry.MultiLineString")||(C=="OpenLayers.Geometry.MultiPolygon")){for(var B=0;B<E.components.length;B++){this.drawGeometry(E.components[B],D)}return }switch(E.CLASS_NAME){case"OpenLayers.Geometry.Point":this.drawPoint(E,D);break;case"OpenLayers.Geometry.LineString":this.drawLineString(E,D);break;case"OpenLayers.Geometry.LinearRing":this.drawLinearRing(E,D);break;case"OpenLayers.Geometry.Polygon":this.drawPolygon(E,D);break;default:break}},drawExternalGraphic:function(H,G){var C=new Image();if(G.graphicTitle){C.title=G.graphicTitle}var F=G.graphicWidth||G.graphicHeight;var B=G.graphicHeight||G.graphicWidth;F=F?F:G.pointRadius*2;B=B?B:G.pointRadius*2;var E=(G.graphicXOffset!=undefined)?G.graphicXOffset:-(0.5*F);var I=(G.graphicYOffset!=undefined)?G.graphicYOffset:-(0.5*B);var D={img:C,x:(H[0]+E),y:(H[1]+I),width:F,height:B,opacity:G.graphicOpacity||G.fillOpacity,canvas:this.canvas};C.onload=OpenLayers.Function.bind(function(){this.canvas.globalAlpha=this.opacity;this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},D);C.src=G.externalGraphic},setCanvasStyle:function(C,B){if(C=="fill"){this.canvas.globalAlpha=B.fillOpacity;this.canvas.fillStyle=B.fillColor}else{if(C=="stroke"){this.canvas.globalAlpha=B.strokeOpacity;this.canvas.strokeStyle=B.strokeColor;this.canvas.lineWidth=B.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},drawPoint:function(D,B){if(B.graphic!==false){var C=this.getLocalXY(D);if(B.externalGraphic){this.drawExternalGraphic(C,B)}else{if(B.fill!==false){this.setCanvasStyle("fill",B);this.canvas.beginPath();this.canvas.arc(C[0],C[1],B.pointRadius,0,Math.PI*2,true);this.canvas.fill()}if(B.stroke!==false){this.setCanvasStyle("stroke",B);this.canvas.beginPath();this.canvas.arc(C[0],C[1],B.pointRadius,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(E,C){if(C.stroke!==false){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")},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){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(D,C){this.drawLinearRing(D.components[0],C);for(var B=1;B<D.components.length;B++){this.drawLinearRing(D.components[B],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(C,E){E=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},E);var F=this.getLocalXY(C);this.setCanvasStyle("reset");this.canvas.fillStyle=E.fontColor;this.canvas.globalAlpha=E.fontOpacity||1;var G=E.fontWeight+" "+E.fontSize+" "+E.fontFamily;if(this.canvas.fillText){var D=OpenLayers.Renderer.Canvas.LABEL_ALIGN[E.labelAlign[0]]||"center";this.canvas.font=G;this.canvas.textAlign=D;this.canvas.fillText(E.label,F[0],F[1])}else{if(this.canvas.mozDrawText){this.canvas.mozTextStyle=G;var B=this.canvas.mozMeasureText(E.label);switch(E.labelAlign[0]){case"l":break;case"r":F[0]-=B;break;case"c":default:F[0]-=B/2}this.canvas.translate(F[0],F[1]);this.canvas.mozDrawText(E.label);this.canvas.translate(-1*F[0],-1*F[1])}}this.setCanvasStyle("reset")},getLocalXY:function(C){var D=this.getResolution();var E=this.extent;var B=(C.x/D+(-E.left/D));var F=((E.top/D)-C.y/D);return[B,F]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height);this.features={}},getFeatureIdFromEvent:function(B){var G=this.map.getLonLatFromPixel(B.xy);var C=this.getResolution();var F=new OpenLayers.Bounds(G.lon-C*5,G.lat-C*5,G.lon+C*5,G.lat+C*5);var D=F.toGeometry();for(var E in this.features){if(!this.features.hasOwnProperty(E)){continue}if(this.features[E][0].geometry.intersects(D)){return E}}return null},eraseFeatures:function(C){if(!(C instanceof Array)){C=[C]}for(var B=0;B<C.length;++B){delete this.features[C[B].id]}this.redraw()},redraw:function(){if(!this.locked){this.canvas.clearRect(0,0,this.root.width,this.root.height);var G=[];var D,E;for(var H in this.features){if(!this.features.hasOwnProperty(H)){continue}D=this.features[H][0];E=this.features[H][1];if(!D.geometry){continue}this.drawGeometry(D.geometry,E);if(E.label){G.push([D,E])}}var F;for(var C=0,B=G.length;C<B;++C){F=G[C];this.drawText(F[0].geometry.getCentroid(),F[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,interval:0,delta:0,cumulative:true,initialize:function(D,C,B){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(J){if(!this.map||!this.checkModifiers(J)){return }var G=false;var L=false;var F=false;var C=OpenLayers.Event.element(J);while((C!=null)&&!F&&!G){if(!G){try{if(C.currentStyle){D=C.currentStyle.overflow}else{var B=document.defaultView.getComputedStyle(C,null);var D=B.getPropertyValue("overflow")}G=(D&&(D=="auto")||(D=="scroll"))}catch(E){}}if(!L){for(var H=0,I=this.map.layers.length;H<I;H++){if(C==this.map.layers[H].div||C==this.map.layers[H].pane){L=true;break}}}F=(C==this.map.div);C=C.parentNode}if(!G&&F){if(L){var K=0;if(!J){J=window.event}if(J.wheelDelta){K=J.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){K=-K}}else{if(J.detail){K=-J.detail/3}}this.delta=this.delta+K;if(this.interval){window.clearTimeout(this._timeoutId);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(J)},this),this.interval)}else{this.wheelZoom(J)}}OpenLayers.Event.stop(J)}},wheelZoom:function(B){var C=this.delta;this.delta=0;if(C){if(this.mousePosition){B.xy=this.mousePosition}if(!B.xy){B.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(C<0){this.callback("down",[B,this.cumulative?C:-1])}else{this.callback("up",[B,this.cumulative?C:1])}}},mousemove:function(B){this.mousePosition=B.xy},activate:function(B){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var C=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",C);OpenLayers.Event.observe(window,"mousewheel",C);OpenLayers.Event.observe(document,"mousewheel",C);return true}else{return false}},deactivate:function(B){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var C=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",C);OpenLayers.Event.stopObserving(window,"mousewheel",C);OpenLayers.Event.stopObserving(document,"mousewheel",C);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(B){OpenLayers.Util.extend(this,B)},clone:function(){var Type=eval(this.CLASS_NAME);return new Type(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"});OpenLayers.Symbolizer.Raster=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(B){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Raster"});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(F,B,G,D,E,C){this.layer=F;this.position=B.clone();this.bounds=G.clone();this.url=D;this.size=E.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);OpenLayers.Util.extend(this,C)},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(B){if(B==null){B=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(B,this);return B},draw:function(){var B=this.layer.maxExtent;var C=(B&&this.bounds.intersectsBounds(B,false));this.shouldDraw=(C||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(C,B,D){if(D==null){D=true}this.bounds=C.clone();this.position=B.clone();if(D){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(B){var G=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(G);var E=this.layer.map.getLonLatFromLayerPx(B);var D=B.clone();D.x+=this.size.w;D.y+=this.size.h;var C=this.layer.map.getLonLatFromLayerPx(D);if(E.lon>C.lon){if(E.lon<0){E.lon=-180-(E.lon+180)}else{C.lon=180+C.lon+180}}var F=new OpenLayers.Bounds(E.lon,C.lat,C.lon,E.lat);return F},showTile:function(){if(this.shouldDraw){this.show()}},show:function(){},hide:function(){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,layerAlphaHack:null,isBackBuffer:false,lastRatio:1,isFirstDraw:true,backBufferTile:null,maxGetUrlLength:null,initialize:function(F,B,G,D,E,C){OpenLayers.Tile.prototype.initialize.apply(this,arguments);if(this.maxGetUrlLength!=null){OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame)}this.url=D;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){this.removeImgDiv()}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(B){if(B==null){B=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}B=OpenLayers.Tile.prototype.clone.apply(this,[B]);B.imgDiv=null;return B},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var B=OpenLayers.Tile.prototype.draw.apply(this,arguments);if((OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1)||this.layer.singleTile){if(B){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(B&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!B){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 B=this.layer.maxExtent;var C=(B&&this.bounds.intersectsBounds(B,false));if(C){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.getImageSize(this.bounds)||this.size;this.backBufferTile.imageOffset=this.layer.imageOffset;this.backBufferTile.resolution=this.layer.getResolution();this.backBufferTile.renderTile()}this.backBufferTile.hide()}},renderTile:function(){if(this.layer.async){this.initImgDiv();this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{this.url=this.layer.getURL(this.bounds);this.initImgDiv();this.positionImage()}return true},positionImage:function(){if(this.layer===null){return }OpenLayers.Util.modifyDOMElement(this.frame,null,this.position,this.size);var B=this.layer.getImageSize(this.bounds);if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,B,this.url)}else{OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,B);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(){if(this.imgDiv==null){var E=this.layer.imageOffset;var C=this.layer.getImageSize(this.bounds);if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,E,C,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,E,C,null,"relative",null,null,true)}if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);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 D=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(D,this))}else{OpenLayers.Event.observe(this.imgDiv,"load",OpenLayers.Function.bind(D,this))}var B=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){D.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(B,this))}this.imgDiv.viewRequestID=this.layer.map.viewRequestID},removeImgDiv:function(){OpenLayers.Event.stopObservingElement(this.imgDiv);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;var B=this.imgDiv.firstChild;if(B){OpenLayers.Event.stopObservingElement(B);this.imgDiv.removeChild(B);delete B}else{this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}},checkImgURL:function(){if(this.layer){var B=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(B,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return }var E=1;if(this.backBufferTile.resolution){E=this.backBufferTile.resolution/this.layer.getResolution()}if(E!=this.lastRatio){if(this.layer.transitionEffect=="resize"){var D=new OpenLayers.LonLat(this.backBufferTile.bounds.left,this.backBufferTile.bounds.top);var C=new OpenLayers.Size(this.backBufferTile.size.w*E,this.backBufferTile.size.h*E);var B=this.layer.map.getLayerPxFromLonLat(D);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,B,C);var F=this.backBufferTile.imageSize;F=new OpenLayers.Size(F.w*E,F.h*E);var G=this.backBufferTile.imageOffset;if(G){G=new OpenLayers.Pixel(G.x*E,G.y*E)}OpenLayers.Util.modifyDOMElement(this.backBufferTile.imgDiv,null,G,F);this.backBufferTile.show()}}else{if(this.layer.singleTile){this.backBufferTile.show()}else{this.backBufferTile.hide()}}this.lastRatio=E},show:function(){this.frame.style.display="";if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(OpenLayers.IS_GECKO===true){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.BROWSER_NAME=="safari"||OpenLayers.BROWSER_NAME=="opera");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(B){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[B])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(C,B){var D={};this.readChildNodes(C,D);B.outer=D.components[0]},innerBoundaryIs:function(C,B){var D={};this.readChildNodes(C,D);B.inner.push(D.components[0])},Box:function(E,C){var F={};this.readChildNodes(E,F);if(!C.components){C.components=[]}var D=F.points[0];var B=F.points[1];C.components.push(new OpenLayers.Bounds(D.x,D.y,B.x,B.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(D){var C;if(D instanceof Array){C="wfs:FeatureCollection"}else{C="gml:featureMember"}var B=this.writeNode(C,D);this.setAttributeNS(B,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[B])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(C){var B=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[C],B);return B},coordinates:function(E){var D=E.length;var F=new Array(D);var B;for(var C=0;C<D;++C){B=E[C];if(this.xy){F[C]=B.x+","+B.y}else{F[C]=B.y+","+B.x}if(B.z!=undefined){F[C]+=","+B.z}}return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:(D==1)?F[0]:F.join(" ")})},LineString:function(C){var B=this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",C.components,B);return B},Polygon:function(D){var C=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",D.components[0],C);for(var B=1;B<D.components.length;++B){this.writeNode("innerBoundaryIs",D.components[B],C)}return C},outerBoundaryIs:function(B){var C=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",B,C);return C},innerBoundaryIs:function(B){var C=this.createElementNSPlus("gml:innerBoundaryIs");this.writeNode("LinearRing",B,C);return C},LinearRing:function(B){var C=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",B.components,C);return C},Box:function(C){var B=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:C.left,y:C.bottom},{x:C.right,y:C.top}],B);if(this.srsName){B.setAttribute("srsName",this.srsName)}return B}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(B){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[B])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsNotEqualTo:function(C,D){var B=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(C,B);D.filters.push(B)},PropertyIsLike:function(E,F){var D=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(E,D);var G=E.getAttribute("wildCard");var C=E.getAttribute("singleChar");var B=E.getAttribute("escape");D.value2regex(G,C,B);F.filters.push(D)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(B){var C=this.createElementNSPlus("ogc:PropertyIsEqualTo");this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsNotEqualTo:function(B){var C=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.value,C);return C},PropertyIsLike:function(B){var C=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{wildCard:"*",singleChar:".",escape:"!"}});this.writeNode("PropertyName",B,C);this.writeNode("Literal",B.regex2value(),C);return C},BBOX:function(B){var D=this.createElementNSPlus("ogc:BBOX");this.writeNode("PropertyName",B,D);var C=this.writeNode("gml:Box",B.value,D);if(B.projection){C.setAttribute("srsName",B.projection)}return D}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature},writeSpatial:function(C,B){var D=this.createElementNSPlus("ogc:"+B);this.writeNode("PropertyName",C,D);var E;if(C.value instanceof OpenLayers.Geometry){E=this.writeNode("feature:_geometry",C.value).firstChild}else{E=this.writeNode("gml:Box",C.value)}if(C.projection){E.setAttribute("srsName",C.projection)}D.appendChild(E);return D},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",srsNameInQuery:false,schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(B){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[B]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[B])},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(B,C){C.insertIds=[];C.success=false;this.readChildNodes(B,C)},InsertResult:function(C,B){var D={fids:[]};this.readChildNodes(C,D);B.insertIds.push(D.fids[0])},TransactionResult:function(B,C){this.readChildNodes(B,C)},Status:function(B,C){this.readChildNodes(B,C)},SUCCESS:function(B,C){C.success=true}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc},writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(C){C=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName,srsNameInQuery:this.srsNameInQuery},C);var E=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(C.featureNS?C.featurePrefix+":":"")+C.featureType}});if(C.srsNameInQuery&&C.srsName){E.setAttribute("srsName",C.srsName)}if(C.featureNS){E.setAttribute("xmlns:"+C.featurePrefix,C.featureNS)}if(C.propertyNames){for(var D=0,B=C.propertyNames.length;D<B;D++){this.writeNode("ogc:PropertyName",{property:C.propertyNames[D]},E)}}if(C.filter){this.setFilterProperty(C.filter);this.writeNode("ogc:Filter",C.filter,E)}return E}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_0_0"});OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(B){this.compare=B?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(D){if(this.exists(D)){this.remove(D)}var G=D.id;this.determineZIndex(D);var E=-1;var F=this.order.length;var B;while(F-E>1){B=parseInt((E+F)/2);var C=this.compare(this,D,OpenLayers.Util.getElement(this.order[B]));if(C>0){E=B}else{F=B}}this.order.splice(F,0,G);this.indices[G]=this.getZIndex(D);return this.getNextElement(F)},remove:function(C){var E=C.id;var B=OpenLayers.Util.indexOf(this.order,E);if(B>=0){this.order.splice(B,1);delete this.indices[E];if(this.order.length>0){var D=this.order[this.order.length-1];this.maxZIndex=this.indices[D]}else{this.maxZIndex=0}}},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(B){return(this.indices[B.id]!=null)},getZIndex:function(B){return B._style.graphicZIndex},determineZIndex:function(B){var C=B._style.graphicZIndex;if(C==null){C=this.maxZIndex;B._style.graphicZIndex=C}else{if(C>this.maxZIndex){this.maxZIndex=C}}},getNextElement:function(C){var B=C+1;if(B<this.order.length){var D=OpenLayers.Util.getElement(this.order[B]);if(D==undefined){D=this.getNextElement(B)}return D}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(F,E,C){var B=F.getZIndex(E);var G=0;if(C){var D=F.getZIndex(C);G=B-D}return G},Z_ORDER_DRAWING_ORDER:function(D,C,B){var E=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(D,C,B);if(B&&E==0){E=1}return E},Z_ORDER_Y_ORDER:function(E,D,C){var F=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(E,D,C);if(C&&F===0){var B=C._boundsBottom-D._boundsBottom;F=(B===0)?1:B}return F}};OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",initialize:function(B,C){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(C&&(C.zIndexing||C.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(C.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var C;var B=this.vectorRoot;if(B){while(C=B.firstChild){B.removeChild(C)}}B=this.textRoot;if(B){while(C=B.firstChild){B.removeChild(C)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(C,B){},drawGeometry:function(J,B,E){var I=J.CLASS_NAME;var D=true;if((I=="OpenLayers.Geometry.Collection")||(I=="OpenLayers.Geometry.MultiPoint")||(I=="OpenLayers.Geometry.MultiLineString")||(I=="OpenLayers.Geometry.MultiPolygon")){for(var G=0,H=J.components.length;G<H;G++){D=this.drawGeometry(J.components[G],B,E)&&D}return D}D=false;var F=false;if(B.display!="none"){if(B.backgroundGraphic){this.redrawBackgroundNode(J.id,J,B,E)}else{F=true}D=this.redrawNode(J.id,J,B,E)}if(D==false){var C=document.getElementById(J.id);if(C){if(C._style.backgroundGraphic){F=true}C.parentNode.removeChild(C)}}if(F){var C=document.getElementById(J.id+this.BACKGROUND_ID_SUFFIX);if(C){C.parentNode.removeChild(C)}}return D},redrawNode:function(H,G,C,F){C=this.applyDefaultSymbolizer(C);var D=this.nodeFactory(H,this.getNodeType(G,C));D._featureId=F;D._boundsBottom=G.getBounds().bottom;D._geometryClass=G.CLASS_NAME;D._style=C;var B=this.drawGeometryNode(D,G,C);if(B===false){return false}D=B.node;if(this.indexer){var E=this.indexer.insert(D);if(E){this.vectorRoot.insertBefore(D,E)}else{this.vectorRoot.appendChild(D)}}else{if(D.parentNode!==this.vectorRoot){this.vectorRoot.appendChild(D)}}this.postDraw(D);return B.complete},redrawBackgroundNode:function(F,E,C,D){var B=OpenLayers.Util.extend({},C);B.externalGraphic=B.backgroundGraphic;B.graphicXOffset=B.backgroundXOffset;B.graphicYOffset=B.backgroundYOffset;B.graphicZIndex=B.backgroundGraphicZIndex;B.graphicWidth=B.backgroundWidth||B.graphicWidth;B.graphicHeight=B.backgroundHeight||B.graphicHeight;B.backgroundGraphic=null;B.backgroundXOffset=null;B.backgroundYOffset=null;B.backgroundGraphicZIndex=null;return this.redrawNode(F+this.BACKGROUND_ID_SUFFIX,E,B,null)},drawGeometryNode:function(D,F,C){C=C||D._style;var B={isFilled:C.fill===undefined?true:C.fill,isStroked:C.stroke===undefined?!!C.strokeWidth:C.stroke};var E;switch(F.CLASS_NAME){case"OpenLayers.Geometry.Point":if(C.graphic===false){B.isFilled=false;B.isStroked=false}E=this.drawPoint(D,F);break;case"OpenLayers.Geometry.LineString":B.isFilled=false;E=this.drawLineString(D,F);break;case"OpenLayers.Geometry.LinearRing":E=this.drawLinearRing(D,F);break;case"OpenLayers.Geometry.Polygon":E=this.drawPolygon(D,F);break;case"OpenLayers.Geometry.Surface":E=this.drawSurface(D,F);break;case"OpenLayers.Geometry.Rectangle":E=this.drawRectangle(D,F);break;default:break}D._options=B;if(E!=false){return{node:this.setStyle(D,C,B,F),complete:E}}else{return false}},postDraw:function(B){},drawPoint:function(B,C){},drawLineString:function(B,C){},drawLinearRing:function(B,C){},drawPolygon:function(B,C){},drawRectangle:function(B,C){},drawCircle:function(B,C){},drawSurface:function(B,C){},removeText:function(C){var B=document.getElementById(C+this.LABEL_ID_SUFFIX);if(B){this.textRoot.removeChild(B)}},getFeatureIdFromEvent:function(B){var E=B.target;var C=E&&E.correspondingUseElement;var D=C?C:(E||B.srcElement);var F=D._featureId;return F},eraseGeometry:function(H,G){if((H.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(H.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(H.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(H.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var E=0,B=H.components.length;E<B;E++){this.eraseGeometry(H.components[E],G)}}else{var D=OpenLayers.Util.getElement(H.id);if(D&&D.parentNode){if(D.geometry){D.geometry.destroy();D.geometry=null}D.parentNode.removeChild(D);if(this.indexer){this.indexer.remove(D)}if(D._style.backgroundGraphic){var C=H.id+this.BACKGROUND_ID_SUFFIX;var F=OpenLayers.Util.getElement(C);if(F&&F.parentNode){F.parentNode.removeChild(F)}}}}},nodeFactory:function(D,B){var C=OpenLayers.Util.getElement(D);if(C){if(!this.nodeTypeCompare(C,B)){C.parentNode.removeChild(C);C=this.nodeFactory(D,B)}}else{C=this.createNode(B,D)}return C},nodeTypeCompare:function(C,B){},createNode:function(B,C){},moveRoot:function(C){var B=this.root;if(C.root.parentNode==this.rendererRoot){B=C.root}B.parentNode.removeChild(B);C.rendererRoot.appendChild(B)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(B){return(B!="circle")&&!!B},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(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B])},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 B=OpenLayers.Strategy.prototype.deactivate.call(this);if(B){this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this})}return B},load:function(B){var C=this.layer;C.events.triggerEvent("loadstart");C.protocol.read(OpenLayers.Util.applyDefaults({callback:OpenLayers.Function.bind(this.merge,this,C.map.getProjectionObject()),filter:C.filter},B));C.events.un({visibilitychanged:this.load,scope:this})},merge:function(G,H){var E=this.layer;E.destroyFeatures();var F=H.features;if(F&&F.length>0){if(!G.equals(E.projection)){var D;for(var C=0,B=F.length;C<B;++C){D=F[C].geometry;if(D){D.transform(E.projection,G)}}}E.addFeatures(F)}E.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,defaultFilter:null,initialize:function(B){B=B||{};OpenLayers.Util.extend(this,B);this.options=B},mergeWithDefaultFilter:function(C){var B;if(C&&this.defaultFilter){B=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,C]})}else{B=C||this.defaultFilter||undefined}return B},destroy:function(){this.options=null;this.format=null},read:function(B){B=B||{};B.filter=this.mergeWithDefaultFilter(B.filter)},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(B){},createCallback:function(D,B,C){return OpenLayers.Function.bind(function(){D.apply(this,[B,C])},this)},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(B){OpenLayers.Util.extend(this,B)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Protocol.WFS=function(C){C=OpenLayers.Util.applyDefaults(C,OpenLayers.Protocol.WFS.DEFAULTS);var B=OpenLayers.Protocol.WFS["v"+C.version.replace(/\./g,"_")];if(!B){throw"Unsupported WFS version: "+C.version}return new B(C)};OpenLayers.Protocol.WFS.fromWMSLayer=function(E,D){var B,F;var H=E.params.LAYERS;var G=(H instanceof Array?H[0]:H).split(":");if(G.length>1){F=G[0]}B=G.pop();var C={url:E.url,featureType:B,featurePrefix:F,srsName:E.projection&&E.projection.getCode()||E.map&&E.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(D,C))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"};OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(C,B){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(C){if(C!=this.opacity){this.opacity=C;for(var D=0,B=this.markers.length;D<B;D++){this.markers[D].setOpacity(this.opacity)}}},moveTo:function(E,C,F){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(C||!this.drawn){for(var D=0,B=this.markers.length;D<B;D++){this.drawMarker(this.markers[D])}this.drawn=true}},addMarker:function(B){this.markers.push(B);if(this.opacity!=null){B.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){B.map=this.map;this.drawMarker(B)}},removeMarker:function(B){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,B);B.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(B){var C=this.map.getLayerPxFromLonLat(B.lonlat);if(C==null){B.display(false)}else{if(!B.isDrawn()){var D=B.draw(C);this.div.appendChild(D)}else{if(B.icon){B.icon.moveTo(C)}}}},getDataExtent:function(){var C=null;if(this.markers&&(this.markers.length>0)){var C=new OpenLayers.Bounds();for(var E=0,B=this.markers.length;E<B;E++){var D=this.markers[E];C.extend(D.lonlat)}}return C},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,readFormat:null,readOptions:null,initialize:function(C){OpenLayers.Protocol.prototype.initialize.apply(this,[C]);if(!C.format){this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName,srsName:this.srsName,schema:this.schema},this.formatOptions))}if(!this.featureNS&&this.featurePrefix){var B=this.format.readNode;this.format.readNode=function(D,E){if(!this.featureNS&&D.prefix==this.featurePrefix){this.featureNS=D.namespaceURI;this.setNamespace("feature",this.featureNS)}return B.apply(this,arguments)}}},destroy:function(){if(this.options&&!this.options.format){this.format.destroy()}this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(C){OpenLayers.Protocol.prototype.read.apply(this,arguments);C=OpenLayers.Util.extend({},C);OpenLayers.Util.applyDefaults(C,this.options||{});var B=new OpenLayers.Protocol.Response({requestType:"read"});var D=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",C)]);B.priv=OpenLayers.Request.POST({url:C.url,callback:this.createCallback(this.handleRead,B,C),params:C.params,headers:C.headers,data:D});return B},handleRead:function(B,C){C=OpenLayers.Util.extend({},C);OpenLayers.Util.applyDefaults(C,this.options);if(C.callback){var D=B.priv;if(D.status>=200&&D.status<300){if(C.readOptions&&C.readOptions.output=="object"){OpenLayers.Util.extend(B,this.parseResponse(D,C.readOptions))}else{B.features=this.parseResponse(D,C.readOptions)}B.code=OpenLayers.Protocol.Response.SUCCESS}else{B.code=OpenLayers.Protocol.Response.FAILURE}C.callback.call(C.scope,B)}},parseResponse:function(C,B){var D=C.responseXML;if(!D||!D.documentElement){D=C.responseText}if(!D||D.length<=0){return null}return(this.readFormat!==null)?this.readFormat.read(D):this.format.read(D,B)},commit:function(D,C){C=OpenLayers.Util.extend({},C);OpenLayers.Util.applyDefaults(C,this.options);var B=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:D});B.priv=OpenLayers.Request.POST({url:C.url,data:this.format.write(D,C),callback:this.createCallback(this.handleCommit,B,C)});return B},handleCommit:function(B,C){if(C.callback){var D=B.priv;var E=D.responseXML;if(!E||!E.documentElement){E=D.responseText}var F=this.format.read(E)||{};B.insertIds=F.insertIds||[];B.code=(F.success)?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;C.callback.call(C.scope,B)}},filterDelete:function(F,D){D=OpenLayers.Util.extend({},D);OpenLayers.Util.applyDefaults(D,this.options);var C=new OpenLayers.Protocol.Response({requestType:"commit"});var B=this.format.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version}});var E=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(D.featureNS?this.featurePrefix+":":"")+D.featureType}});if(D.featureNS){E.setAttribute("xmlns:"+this.featurePrefix,D.featureNS)}var H=this.format.writeNode("ogc:Filter",F);E.appendChild(H);B.appendChild(E);var G=OpenLayers.Format.XML.prototype.write.apply(this.format,[B]);return OpenLayers.Request.POST({url:this.url,callback:D.callback||function(){},data:G})},abort:function(B){if(B){B.priv.abort()}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(B){OpenLayers.Filter.prototype.initialize.apply(this,[B])},evaluate:function(D){var B=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(D.geometry){var C=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){C=this.value.toGeometry()}if(D.geometry.intersects(C)){B=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return B},clone:function(){var B=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(B)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:false,displayClass:"",title:"",autoActivate:false,active:null,handler:null,eventListeners:null,events:null,EVENT_TYPES:["activate","deactivate"],initialize:function(B){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,B);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 B in this.handlers){if(this.handlers.hasOwnProperty(B)&&typeof this.handlers[B].destroy=="function"){this.handlers[B].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(B){this.map=B;if(this.handler){this.handler.setMap(B)}},draw:function(B){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=OpenLayers.Function.False}if(this.title!=""){this.div.title=this.title}}if(B!=null){this.position=B.clone()}this.moveTo(this.position);return this.div},moveTo:function(B){if((B!=null)&&(this.div!=null)){this.div.style.left=B.x+"px";this.div.style.top=B.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.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},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(E){var I=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});E=OpenLayers.Util.applyDefaults(E,I);var H=new OpenLayers.Request.XMLHttpRequest();var B=E.url;if(E.params){var F=OpenLayers.Util.getParameterString(E.params);if(F.length>0){var K=(B.indexOf("?")>-1)?"&":"?";B+=K+F}}var L=!(B.indexOf("http")==0);var C=!L&&B.match(this.URL_SPLIT_REGEX);if(C){var M=window.location;L=C[1]==M.protocol&&C[3]==M.hostname;var G=C[4],D=M.port;if(G!=80&&G!=""||D!="80"&&D!=""){L=L&&G==D}}if(!L){if(E.proxy){if(typeof E.proxy=="function"){B=E.proxy(B)}else{B=E.proxy+encodeURIComponent(B)}}else{OpenLayers.Console.warn(OpenLayers.i18n("proxyNeeded"),{url:B})}}H.open(E.method,B,E.async,E.user,E.password);for(var J in E.headers){H.setRequestHeader(J,E.headers[J])}var O=this.events;var N=this;H.onreadystatechange=function(){if(H.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var P=O.triggerEvent("complete",{request:H,config:E,requestUrl:B});if(P!==false){N.runCallbacks({request:H,config:E,requestUrl:B})}}};if(E.async===false){H.send(E.data)}else{window.setTimeout(function(){if(H.readyState!==0){H.send(E.data)}},0)}return H},runCallbacks:function(E){var F=E.request;var D=E.config;var B=(D.scope)?OpenLayers.Function.bind(D.callback,D.scope):D.callback;var G;if(D.success){G=(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}B(F);if(!F.status||(F.status>=200&&F.status<300)){this.events.triggerEvent("success",E);if(G){G(F)}}if(F.status&&(F.status<200||F.status>=300)){this.events.triggerEvent("failure",E);if(C){C(F)}}},GET:function(B){B=OpenLayers.Util.extend(B,{method:"GET"});return OpenLayers.Request.issue(B)},POST:function(B){B=OpenLayers.Util.extend(B,{method:"POST"});B.headers=B.headers?B.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(B.headers))){B.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(B)},PUT:function(B){B=OpenLayers.Util.extend(B,{method:"PUT"});B.headers=B.headers?B.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(B.headers))){B.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(B)},DELETE:function(B){B=OpenLayers.Util.extend(B,{method:"DELETE"});return OpenLayers.Request.issue(B)},HEAD:function(B){B=OpenLayers.Util.extend(B,{method:"HEAD"});return OpenLayers.Request.issue(B)},OPTIONS:function(B){B=OpenLayers.Util.extend(B,{method:"OPTIONS"});return OpenLayers.Request.issue(B)}};(function(){var H=window.XMLHttpRequest;var B=!!window.controllers,K=window.document.all&&!window.opera,L=K&&window.navigator.userAgent.match(/MSIE 7.0/);function E(){this._object=H&&!L?new H:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function D(){return new E}D.prototype=E.prototype;if(B&&H.wrapped){D.wrapped=H.wrapped}D.UNSENT=0;D.OPENED=1;D.HEADERS_RECEIVED=2;D.LOADING=3;D.DONE=4;D.prototype.readyState=D.UNSENT;D.prototype.responseText="";D.prototype.responseXML=null;D.prototype.status=0;D.prototype.statusText="";D.prototype.priority="NORMAL";D.prototype.onreadystatechange=null;D.onreadystatechange=null;D.onopen=null;D.onsend=null;D.onabort=null;D.prototype.open=function(P,S,O,T,N){delete this._headers;if(arguments.length<3){O=true}this._async=O;var R=this,Q=this.readyState,M;if(K&&O){M=function(){if(Q!=D.DONE){F(R);R.abort()}};window.attachEvent("onunload",M)}if(D.onopen){D.onopen.apply(this,arguments)}if(arguments.length>4){this._object.open(P,S,O,T,N)}else{if(arguments.length>3){this._object.open(P,S,O,T)}else{this._object.open(P,S,O)}}this.readyState=D.OPENED;C(this);this._object.onreadystatechange=function(){if(B&&!O){return }R.readyState=R._object.readyState;I(R);if(R._aborted){R.readyState=D.UNSENT;return }if(R.readyState==D.DONE){delete R._data;F(R);if(K&&O){window.detachEvent("onunload",M)}}if(Q!=R.readyState){C(R)}Q=R.readyState}};function G(M){M._object.send(M._data);if(B&&!M._async){M.readyState=D.OPENED;I(M);while(M.readyState<D.DONE){M.readyState++;C(M);if(M._aborted){return }}}}D.prototype.send=function(M){if(D.onsend){D.onsend.apply(this,arguments)}if(!arguments.length){M=null}if(M&&M.nodeType){M=window.XMLSerializer?new window.XMLSerializer().serializeToString(M):M.xml;if(!oRequest._headers["Content-Type"]){oRequest._object.setRequestHeader("Content-Type","application/xml")}}this._data=M;G(this)};D.prototype.abort=function(){if(D.onabort){D.onabort.apply(this,arguments)}if(this.readyState>D.UNSENT){this._aborted=true}this._object.abort();F(this);this.readyState=D.UNSENT;delete this._data};D.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};D.prototype.getResponseHeader=function(M){return this._object.getResponseHeader(M)};D.prototype.setRequestHeader=function(M,N){if(!this._headers){this._headers={}}this._headers[M]=N;return this._object.setRequestHeader(M,N)};D.prototype.addEventListener=function(P,O,N){for(var M=0,Q;Q=this._listeners[M];M++){if(Q[0]==P&&Q[1]==O&&Q[2]==N){return }}this._listeners.push([P,O,N])};D.prototype.removeEventListener=function(P,O,N){for(var M=0,Q;Q=this._listeners[M];M++){if(Q[0]==P&&Q[1]==O&&Q[2]==N){break}}if(Q){this._listeners.splice(M,1)}};D.prototype.dispatchEvent=function(N){var O={type:N.type,target:this,currentTarget:this,eventPhase:2,bubbles:N.bubbles,cancelable:N.cancelable,timeStamp:N.timeStamp,stopPropagation:function(){},preventDefault:function(){},initEvent:function(){}};if(O.type=="readystatechange"&&this.onreadystatechange){(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[O])}for(var M=0,P;P=this._listeners[M];M++){if(P[0]==O.type&&!P[2]){(P[1].handleEvent||P[1]).apply(this,[O])}}};D.prototype.toString=function(){return"[object XMLHttpRequest]"};D.toString=function(){return"[XMLHttpRequest]"};function C(M){if(D.onreadystatechange){D.onreadystatechange.apply(M)}M.dispatchEvent({type:"readystatechange",bubbles:false,cancelable:false,timeStamp:new Date+0})}function J(O){var N=O.responseXML,M=O.responseText;if(K&&M&&N&&!N.documentElement&&O.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){N=new window.ActiveXObject("Microsoft.XMLDOM");N.async=false;N.validateOnParse=false;N.loadXML(M)}if(N){if((K&&N.parseError!=0)||!N.documentElement||(N.documentElement&&N.documentElement.tagName=="parsererror")){return null}}return N}function I(M){try{M.responseText=M._object.responseText}catch(N){}try{M.responseXML=J(M._object)}catch(N){}try{M.status=M._object.status}catch(N){}try{M.statusText=M._object.statusText}catch(N){}}function F(M){M._object.onreadystatechange=new window.Function}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(M,N){if(!N){N=[]}M.__func=this;M.__func(N[0],N[1],N[2],N[3],N[4]);delete M.__func}}OpenLayers.Request.XMLHttpRequest=D})();OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(B){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:B.statusText}))};OpenLayers.loadURL=function(E,H,C,F,D){if(typeof H=="string"){H=OpenLayers.Util.getParameters(H)}var G=(F)?F:OpenLayers.nullHandler;var B=(D)?D:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:E,params:H,success:G,failure:B,scope:C})};OpenLayers.parseXMLString=function(D){var B=D.indexOf("<");if(B>0){D=D.substring(B)}var C=OpenLayers.Util.Try(function(){var E=new ActiveXObject("Microsoft.XMLDOM");E.loadXML(D);return E},function(){return new DOMParser().parseFromString(D,"text/xml")},function(){var E=new XMLHttpRequest();E.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(D),false);if(E.overrideMimeType){E.overrideMimeType("text/xml")}E.send(null);return E.responseXML});return C};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(C){for(var B=0;B<this.responders.length;B++){if(C==this.responders[B]){return }}this.responders.push(C)},unregister:function(B){OpenLayers.Util.removeItem(this.reponders,B)},dispatch:function(G,D,F){var B;for(var C=0;C<this.responders.length;C++){B=this.responders[C];if(B[G]&&typeof B[G]=="function"){try{B[G].apply(B,[D,F])}catch(E){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(B){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,B||{});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(C,B){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[B]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(C,"http")){C=OpenLayers.ProxyHost+encodeURIComponent(C)}this.transport=OpenLayers.Ajax.getTransport();this.request(C)},request:function(C){this.url=C;this.method=this.options.method;var E=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){E._method=this.method;this.method="post"}this.parameters=E;if(E=OpenLayers.Util.getParameterString(E)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+E}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){E+="&_="}}}try{var B=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(B)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,B);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||E):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(D){this.dispatchException(D)}},onStateChange:function(){var B=this.transport.readyState;if(B>1&&!((B==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var F={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){F["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){F.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var D=this.options.requestHeaders;if(typeof D.push=="function"){for(var C=0,E=D.length;C<E;C+=2){F[D[C]]=D[C+1]}}else{for(var C in D){F[C]=D[C]}}}for(var B in F){this.transport.setRequestHeader(B,F[B])}},success:function(){var B=this.getStatus();return !B||(B>=200&&B<300)},getStatus:function(){try{return this.transport.status||0}catch(B){return 0}},respondToReadyState:function(B){var D=OpenLayers.Ajax.Request.Events[B];var C=new OpenLayers.Ajax.Response(this);if(D=="Complete"){try{this._complete=true;(this.options["on"+C.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(C)}catch(E){this.dispatchException(E)}var F=C.getHeader("Content-type")}try{(this.options["on"+D]||OpenLayers.Ajax.emptyFunction)(C);OpenLayers.Ajax.Responders.dispatch("on"+D,this,C)}catch(E){this.dispatchException(E)}if(D=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(B){try{return this.transport.getResponseHeader(B)}catch(C){return null}},dispatchException:function(D){var E=this.options.onException;if(E){E(this,D);OpenLayers.Ajax.Responders.dispatch("onException",this,D)}else{var F=false;var B=OpenLayers.Ajax.Responders.responders;for(var C=0;C<B.length;C++){if(B[C].onException){F=true;break}}if(F){OpenLayers.Ajax.Responders.dispatch("onException",this,D)}else{throw D}}}});OpenLayers.Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];OpenLayers.Ajax.Response=OpenLayers.Class({status:0,statusText:"",initialize:function(D){this.request=D;var E=this.transport=D.transport,B=this.readyState=E.readyState;if((B>2&&!(!!(window.attachEvent&&!window.opera)))||B==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=E.responseText==null?"":String(E.responseText)}if(B==4){var C=E.responseXML;this.responseXML=C===undefined?null:C}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(B){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(B){return this.transport.getResponseHeader(B)}});OpenLayers.Ajax.getElementsByTagNameNS=function(C,B,D,F){var E=null;if(C.getElementsByTagNameNS){E=C.getElementsByTagNameNS(B,F)}else{E=C.getElementsByTagName(D+":"+F)}return E};OpenLayers.Ajax.serializeXMLToString=function(B){var C=new XMLSerializer();var D=C.serializeToString(B);return D};OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:false,stopDown:true,dragging:false,last:null,start:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:false,documentEvents:null,initialize:function(E,D,B){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.documentDrag===true){var C=this;this._docMove=function(F){C.mousemove({xy:{x:F.clientX,y:F.clientY},element:document})};this._docUp=function(F){C.mouseup({xy:{x:F.clientX,y:F.clientY}})}}},down:function(B){},move:function(B){},up:function(B){},out:function(B){},mousedown:function(C){var B=true;this.dragging=false;if(this.checkModifiers(C)&&OpenLayers.Event.isLeftClick(C)){this.started=true;this.start=C.xy;this.last=C.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(C);this.callback("down",[C.xy]);OpenLayers.Event.stop(C);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:OpenLayers.Function.True}document.onselectstart=OpenLayers.Function.False;B=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return B},mousemove:function(B){if(this.started&&!this.timeoutId&&(B.xy.x!=this.last.x||B.xy.y!=this.last.y)){if(this.documentDrag===true&&this.documentEvents){if(B.element===document){this.adjustXY(B);this.setEvent(B)}else{this.removeDocumentEvents()}}if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(B);this.callback("move",[B.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=OpenLayers.Function.False}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(C){if(this.started){if(this.documentDrag===true&&this.documentEvents){this.adjustXY(C);this.removeDocumentEvents()}var B=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(C);this.callback("up",[C.xy]);if(B){this.callback("done",[C.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(C){if(this.started&&OpenLayers.Util.mouseLeft(C,this.map.viewPortDiv)){if(this.documentDrag===true){this.addDocumentEvents()}else{var B=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(C);this.callback("out",[]);if(B){this.callback("done",[C.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}}return true},click:function(B){return(this.start==this.last)},activate:function(){var B=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;B=true}return B},deactivate:function(){var B=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;B=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return B},adjustXY:function(B){var C=OpenLayers.Util.pagePosition(this.map.viewPortDiv);B.xy.x-=C[0];B.xy.y-=C[1]},addDocumentEvents:function(){OpenLayers.Element.addClass(document.body,"olDragDown");this.documentEvents=true;OpenLayers.Event.observe(document,"mousemove",this._docMove);OpenLayers.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents=false;OpenLayers.Event.stopObserving(document,"mousemove",this._docMove);OpenLayers.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(D,C,B){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.dragHandler=new OpenLayers.Handler.Drag(this,{down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox},{keyMask:this.keyMask})},destroy:function(){if(this.dragHandler){this.dragHandler.destroy();this.dragHandler=null}OpenLayers.Handler.prototype.destroy.apply(this,arguments)},setMap:function(B){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(B)}},startBox:function(B){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",new OpenLayers.Pixel(-9999,-9999));this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(G){var E=this.dragHandler.start.x;var C=this.dragHandler.start.y;var D=Math.abs(E-G.x);var B=Math.abs(C-G.y);this.zoomBox.style.width=Math.max(1,D)+"px";this.zoomBox.style.height=Math.max(1,B)+"px";this.zoomBox.style.left=G.x<E?G.x+"px":E+"px";this.zoomBox.style.top=G.y<C?G.y+"px":C+"px";var F=this.getBoxCharacteristics();if(F.newBoxModel){if(G.x>E){this.zoomBox.style.width=Math.max(1,D-F.xOffset)+"px"}if(G.y>C){this.zoomBox.style.height=Math.max(1,B-F.yOffset)+"px"}}},endBox:function(C){var B;if(Math.abs(this.dragHandler.start.x-C.x)>5||Math.abs(this.dragHandler.start.y-C.y)>5){var H=this.dragHandler.start;var G=Math.min(H.y,C.y);var D=Math.max(H.y,C.y);var F=Math.min(H.x,C.x);var E=Math.max(H.x,C.x);B=new OpenLayers.Bounds(F,D,E,G)}else{B=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[B])},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 B=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var D=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var C=OpenLayers.BROWSER_NAME=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:B,yOffset:D,newBoxModel:C}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});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(I){if(I instanceof OpenLayers.Bounds){var C;if(!this.out){var J=this.map.getLonLatFromPixel(new OpenLayers.Pixel(I.left,I.bottom));var N=this.map.getLonLatFromPixel(new OpenLayers.Pixel(I.right,I.top));C=new OpenLayers.Bounds(J.lon,J.lat,N.lon,N.lat)}else{var H=Math.abs(I.right-I.left);var K=Math.abs(I.top-I.bottom);var F=Math.min((this.map.size.h/K),(this.map.size.w/H));var O=this.map.getExtent();var B=this.map.getLonLatFromPixel(I.getCenterPixel());var D=B.lon-(O.getWidth()/2)*F;var G=B.lon+(O.getWidth()/2)*F;var M=B.lat-(O.getHeight()/2)*F;var E=B.lat+(O.getHeight()/2)*F;C=new OpenLayers.Bounds(D,M,G,E)}var L=this.map.getZoom();this.map.zoomToExtent(C);if(L==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(L+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(I),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(I),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:false,interval:25,documentDrag:false,draw:function(){this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone},{interval:this.interval,documentDrag:this.documentDrag})},panMap:function(B){this.panned=true;this.map.pan(this.handler.last.x-B.x,this.handler.last.y-B.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(B){if(this.panned){this.panMap(B);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});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(D,C,B){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(this.pixelTolerance!=null){this.mousedown=function(E){this.down=E.xy;return true}}},mousedown:null,mouseup:function(C){var B=true;if(this.checkModifiers(C)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(C)){B=this.rightclick(C)}return B},rightclick:function(C){if(this.passesTolerance(C)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[C]);return !this.stopDouble}else{var B=this["double"]?OpenLayers.Util.extend({},C):this.callback("rightclick",[C]);var D=OpenLayers.Function.bind(this.delayedRightCall,this,B);this.rightclickTimerId=window.setTimeout(D,this.delay)}}return !this.stopSingle},delayedRightCall:function(B){this.rightclickTimerId=null;if(B){this.callback("rightclick",[B])}return !this.stopSingle},dblclick:function(B){if(this.passesTolerance(B)){if(this["double"]){this.callback("dblclick",[B])}this.clearTimer()}return !this.stopDouble},click:function(C){if(this.passesTolerance(C)){if(this.timerId!=null){this.clearTimer()}else{var B=this.single?OpenLayers.Util.extend({},C):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,B),this.delay)}}return !this.stopSingle},passesTolerance:function(C){var D=true;if(this.pixelTolerance!=null&&this.down){var B=Math.sqrt(Math.pow(this.down.x-C.xy.x,2)+Math.pow(this.down.y-C.xy.y,2));if(B>this.pixelTolerance){D=false}}return D},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(B){this.timerId=null;if(B){this.callback("click",[B])}},deactivate:function(){var B=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;B=true}return B},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,documentDrag:false,zoomBox:null,zoomBoxEnabled:true,zoomWheelEnabled:true,mouseWheelOptions:null,handleRightClicks:false,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:true,initialize:function(B){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();if(this.zoomBoxEnabled){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=OpenLayers.Function.False}var B={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var C={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,B,C);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},this.mouseWheelOptions)},defaultDblClick:function(C){var B=this.map.getLonLatFromViewPortPx(C.xy);this.map.setCenter(B,this.map.zoom+1)},defaultDblRightClick:function(C){var B=this.map.getLonLatFromViewPortPx(C.xy);this.map.setCenter(B,this.map.zoom-1)},wheelChange:function(J,D){var I=this.map.getZoom();var G=this.map.getZoom()+Math.round(D);G=Math.max(G,0);G=Math.min(G,this.map.getNumZoomLevels());if(G===I){return }var K=this.map.getSize();var F=K.w/2-J.xy.x;var E=J.xy.y-K.h/2;var H=this.map.baseLayer.getResolutionForZoom(G);var B=this.map.getLonLatFromPixel(J.xy);var C=new OpenLayers.LonLat(B.lon+F*H,B.lat+E*H);this.map.setCenter(C,G)},wheelUp:function(B,C){this.wheelChange(B,C||1)},wheelDown:function(B,C){this.wheelChange(B,C||-1)},disableZoomBox:function(){this.zoomBoxEnabled=false;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=true;if(this.active){this.zoomBox.activate()}},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.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:false,initialize:function(E,D,F,C){var B=arguments;B=[E,C];OpenLayers.Layer.prototype.initialize.apply(this,B);this.url=D;this.params=OpenLayers.Util.extend({},F)},destroy:function(){this.url=null;this.params=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(B){if(B==null){B=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())}B=OpenLayers.Layer.prototype.clone.apply(this,[B]);return B},setUrl:function(B){this.url=B},mergeNewParams:function(C){this.params=OpenLayers.Util.extend(this.params,C);var B=this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"params"})}return B},redraw:function(B){if(B){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(F,E){var D=1;for(var C=0,B=F.length;C<B;C++){D*=F.charCodeAt(C)*this.URL_HASH_FACTOR;D-=Math.floor(D)}return E[Math.floor(D*E.length)]},getFullRequestString:function(H,E){var C=E||this.url;var G=OpenLayers.Util.extend({},this.params);G=OpenLayers.Util.extend(G,H);var F=OpenLayers.Util.getParameterString(G);if(C instanceof Array){C=this.selectUrl(F,C)}var B=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(C));for(var D in G){if(D.toUpperCase() in B){delete G[D]}}F=OpenLayers.Util.getParameterString(G);return OpenLayers.Util.urlAppend(C,F)},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,grid:null,singleTile:false,ratio:1.5,buffer:2,numLoadingTiles:0,initialize:function(D,C,E,B){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[]},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var G=0,C=this.grid.length;G<C;G++){var F=this.grid[G];for(var D=0,B=F.length;D<B;D++){var E=F[D];this.removeTileMonitoringHooks(E);E.destroy()}}this.grid=[]}},clone:function(B){if(B==null){B=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())}B=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[B]);if(this.tileSize!=null){B.tileSize=this.tileSize.clone()}B.grid=[];return B},moveTo:function(E,B,F){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);E=E||this.map.getExtent();if(E!=null){var D=!this.grid.length||B;var C=this.getTilesBounds();if(this.singleTile){if(D||(!F&&!C.containsBounds(E))){this.initSingleTile(E)}}else{if(D||!C.containsBounds(E,true)){this.initGriddedTiles(E)}else{this.moveGriddedTiles(E)}}}},setTileSize:function(B){if(this.singleTile){B=this.map.getSize();B.h=parseInt(B.h*this.ratio);B.w=parseInt(B.w*this.ratio)}OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[B])},getGridBounds:function(){var B="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(B);return this.getTilesBounds()},getTilesBounds:function(){var F=null;if(this.grid.length){var B=this.grid.length-1;var E=this.grid[B][0];var C=this.grid[0].length-1;var D=this.grid[0][C];F=new OpenLayers.Bounds(E.bounds.left,E.bounds.bottom,D.bounds.right,D.bounds.top)}return F},initSingleTile:function(G){var B=G.getCenterLonLat();var I=G.getWidth()*this.ratio;var C=G.getHeight()*this.ratio;var H=new OpenLayers.Bounds(B.lon-(I/2),B.lat-(C/2),B.lon+(I/2),B.lat+(C/2));var E=new OpenLayers.LonLat(H.left,H.top);var D=this.map.getLayerPxFromLonLat(E);if(!this.grid.length){this.grid[0]=[]}var F=this.grid[0][0];if(!F){F=this.addTile(H,D);this.addTileMonitoringHooks(F);F.draw();this.grid[0][0]=F}else{F.moveTo(H,D)}this.removeExcessTiles(1,1)},calculateGridLayout:function(B,O,F){var L=F*this.tileSize.w;var D=F*this.tileSize.h;var J=B.left-O.lon;var M=Math.floor(J/L)-this.buffer;var K=J/L-M;var G=-K*this.tileSize.w;var N=O.lon+M*L;var C=B.top-(O.lat+D);var I=Math.ceil(C/D)+this.buffer;var P=I-C/D;var E=-P*this.tileSize.h;var H=O.lat+I*D;return{tilelon:L,tilelat:D,tileoffsetlon:N,tileoffsetlat:H,tileoffsetx:G,tileoffsety:E}},getTileOrigin:function(){var C=this.tileOrigin;if(!C){var D=this.getMaxExtent();var B=({tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]})[this.tileOriginCorner];C=new OpenLayers.LonLat(D[B[0]],D[B[1]])}return C},initGriddedTiles:function(J){var H=this.map.getSize();var V=Math.ceil(H.h/this.tileSize.h)+Math.max(1,2*this.buffer);var Y=Math.ceil(H.w/this.tileSize.w)+Math.max(1,2*this.buffer);var a=this.getTileOrigin();var R=this.map.getResolution();var Q=this.calculateGridLayout(J,a,R);var G=Math.round(Q.tileoffsetx);var D=Math.round(Q.tileoffsety);var L=Q.tileoffsetlon;var O=Q.tileoffsetlat;var F=Q.tilelon;var K=Q.tilelat;this.origin=new OpenLayers.Pixel(G,D);var U=G;var W=L;var T=0;var B=parseInt(this.map.layerContainerDiv.style.left);var S=parseInt(this.map.layerContainerDiv.style.top);do{var I=this.grid[T++];if(!I){I=[];this.grid.push(I)}L=W;G=U;var E=0;do{var C=new OpenLayers.Bounds(L,O,L+F,O+K);var N=G;N-=B;var M=D;M-=S;var P=new OpenLayers.Pixel(N,M);var Z=I[E++];if(!Z){Z=this.addTile(C,P);this.addTileMonitoringHooks(Z);I.push(Z)}else{Z.moveTo(C,P,false)}L+=F;G+=this.tileSize.w}while((L<=J.right+F*this.buffer)||E<Y);O-=K;D+=this.tileSize.h}while((O>=J.bottom-K*this.buffer)||T<V);this.removeExcessTiles(T,E);this.spiralTileLoad()},getMaxExtent:function(){return this.maxExtent},spiralTileLoad:function(){var C=[];var I=["right","down","left","up"];var H=0;var B=-1;var K=OpenLayers.Util.indexOf(I,"right");var L=0;while(L<I.length){var J=H;var D=B;switch(I[K]){case"right":D++;break;case"down":J++;break;case"left":D--;break;case"up":J--;break}var G=null;if((J<this.grid.length)&&(J>=0)&&(D<this.grid[0].length)&&(D>=0)){G=this.grid[J][D]}if((G!=null)&&(!G.queued)){C.unshift(G);G.queued=true;L=0;H=J;B=D}else{K=(K+1)%4;L++}}for(var E=0,F=C.length;E<F;E++){var G=C[E];G.draw();G.queued=false}},addTile:function(C,B){},addTileMonitoringHooks:function(B){B.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};B.events.register("loadstart",this,B.onLoadStart);B.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};B.events.register("loadend",this,B.onLoadEnd);B.events.register("unload",this,B.onLoadEnd)},removeTileMonitoringHooks:function(B){B.unload();B.events.un({loadstart:B.onLoadStart,loadend:B.onLoadEnd,unload:B.onLoadEnd,scope:this})},moveGriddedTiles:function(D){var C=this.buffer||1;while(true){var B=this.grid[0][0].position;var E=this.map.getViewPortPxFromLayerPx(B);if(E.x>-this.tileSize.w*(C-1)){this.shiftColumn(true)}else{if(E.x<-this.tileSize.w*C){this.shiftColumn(false)}else{if(E.y>-this.tileSize.h*(C-1)){this.shiftRow(true)}else{if(E.y<-this.tileSize.h*C){this.shiftRow(false)}else{break}}}}}},shiftRow:function(N){var D=(N)?0:(this.grid.length-1);var C=this.grid;var G=C[D];var F=this.map.getResolution();var I=(N)?-this.tileSize.h:this.tileSize.h;var H=F*-I;var M=(N)?C.pop():C.shift();for(var J=0,L=G.length;J<L;J++){var E=G[J];var B=E.bounds.clone();var K=E.position.clone();B.bottom=B.bottom+H;B.top=B.top+H;K.y=K.y+I;M[J].moveTo(B,K)}if(N){C.unshift(M)}else{C.push(M)}},shiftColumn:function(M){var E=(M)?-this.tileSize.w:this.tileSize.w;var D=this.map.getResolution();var K=D*E;for(var F=0,H=this.grid.length;F<H;F++){var L=this.grid[F];var J=(M)?0:(L.length-1);var C=L[J];var B=C.bounds.clone();var G=C.position.clone();B.left=B.left+K;B.right=B.right+K;G.x=G.x+E;var I=M?this.grid[F].pop():this.grid[F].shift();I.moveTo(B,G);if(M){L.unshift(I)}else{L.push(I)}}},removeExcessTiles:function(F,D){while(this.grid.length>F){var G=this.grid.pop();for(var C=0,B=G.length;C<B;C++){var E=G[C];this.removeTileMonitoringHooks(E);E.destroy()}}while(this.grid[0].length>D){for(var C=0,B=this.grid.length;C<B;C++){var G=this.grid[C];var E=G.pop();this.removeTileMonitoringHooks(E);E.destroy()}}},onMapResize:function(){if(this.singleTile){this.clearGrid();this.setTileSize()}},getTileBounds:function(E){var D=this.maxExtent;var G=this.getResolution();var F=G*this.tileSize.w;var C=G*this.tileSize.h;var I=this.getLonLatFromViewPortPx(E);var B=D.left+(F*Math.floor((I.lon-D.left)/F));var H=D.bottom+(C*Math.floor((I.lat-D.bottom)/C));return new OpenLayers.Bounds(B,H,B+F,H+C)},CLASS_NAME:"OpenLayers.Layer.Grid"});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,yx:{"EPSG:4326":true},initialize:function(E,D,F,C){var B=[];F=OpenLayers.Util.upperCaseObject(F);if(parseFloat(F.VERSION)>=1.3&&!F.EXCEPTIONS){F.EXCEPTIONS="INIMAGE"}B.push(E,D,F,C);OpenLayers.Layer.Grid.prototype.initialize.apply(this,B);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(!this.noMagic&&this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((C==null)||(!C.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(B){if(B==null){B=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions())}B=OpenLayers.Layer.Grid.prototype.clone.apply(this,[B]);return B},reverseAxisOrder:function(){return(parseFloat(this.params.VERSION)>=1.3&&!!this.yx[this.map.getProjectionObject().getCode()])},getURL:function(D){D=this.adjustBounds(D);var E=this.getImageSize();var F={};var C=this.reverseAxisOrder();F.BBOX=this.encodeBBOX?D.toBBOX(null,C):D.toArray(C);F.WIDTH=E.w;F.HEIGHT=E.h;var B=this.getFullRequestString(F);return B},addTile:function(C,B){return new OpenLayers.Tile.Image(this,B,C,null,this.tileSize,this.tileOptions)},mergeNewParams:function(D){var C=OpenLayers.Util.upperCaseObject(D);var B=[C];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,B)},getFullRequestString:function(F,D){var C=this.map.getProjectionObject();var B=this.projection.equals(C)?this.projection.getCode():C.getCode();var E=(B=="none")?null:B;if(parseFloat(this.params.VERSION)>=1.3){this.params.CRS=E}else{this.params.SRS=E}return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(D,B){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(D instanceof OpenLayers.Style){this.styles["default"]=D;this.styles.select=D;this.styles.temporary=D;this.styles["delete"]=D}else{if(typeof D=="object"){for(var C in D){if(D[C] instanceof OpenLayers.Style){this.styles[C]=D[C]}else{if(typeof D[C]=="object"){this.styles[C]=new OpenLayers.Style(D[C])}else{this.styles["default"]=new OpenLayers.Style(D);this.styles.select=new OpenLayers.Style(D);this.styles.temporary=new OpenLayers.Style(D);this.styles["delete"]=new OpenLayers.Style(D);break}}}}}OpenLayers.Util.extend(this,B)},destroy:function(){for(var B in this.styles){this.styles[B].destroy()}this.styles=null},createSymbolizer:function(C,D){if(!C){C=new OpenLayers.Feature.Vector()}if(!this.styles[D]){D="default"}C.renderIntent=D;var B={};if(this.extendDefault&&D!="default"){B=this.styles["default"].createSymbolizer(C)}return OpenLayers.Util.extend(B,this.styles[D].createSymbolizer(C))},addUniqueValueRules:function(C,E,G,B){var F=[];for(var D in G){F.push(new OpenLayers.Rule({symbolizer:G[D],context:B,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:E,value:D})}))}this.styles[C].addRules(F)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","beforefeaturesremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","vertexremoved","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,features:null,filter: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(D,C){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 E=0,B=this.strategies.length;E<B;E++){this.strategies[E].setLayer(this)}}},destroy:function(){if(this.strategies){var D,C,B;for(C=0,B=this.strategies.length;C<B;C++){D=this.strategies[C];if(D.autoDestroy){D.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)},clone:function(F){if(F==null){F=new OpenLayers.Layer.Vector(this.name,this.getOptions())}F=OpenLayers.Layer.prototype.clone.apply(this,[F]);var D=this.features;var B=D.length;var E=new Array(B);for(var C=0;C<B;++C){E[C]=D[C].clone()}F.features=E;return F},refresh:function(B){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",B)}},assignRenderer:function(){for(var D=0,B=this.renderers.length;D<B;D++){var C=this.renderers[D];var E=(typeof C=="function")?C:OpenLayers.Renderer[C];if(E&&E.prototype.supported()){this.renderer=new E(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(B){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 D,C,B;for(C=0,B=this.strategies.length;C<B;C++){D=this.strategies[C];if(D.autoActivate){D.activate()}}}},removeMap:function(D){this.drawn=false;if(this.strategies){var E,C,B;for(C=0,B=this.strategies.length;C<B;C++){E=this.strategies[C];if(E.autoActivate){E.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(H,C,I){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var F=true;if(!I){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var G=this.map.getExtent();F=this.renderer.setExtent(G,C);this.renderer.root.style.visibility="visible";if(OpenLayers.IS_GECKO===true){this.div.scrollLeft=this.div.scrollLeft}if(!C&&F){for(var E in this.unrenderedFeatures){var D=this.unrenderedFeatures[E];this.drawFeature(D)}}}if(!this.drawn||C||!F){this.drawn=true;var D;for(var E=0,B=this.features.length;E<B;E++){this.renderer.locked=(E!==(B-1));D=this.features[E];this.drawFeature(D)}}},display:function(B){OpenLayers.Layer.prototype.display.apply(this,arguments);var C=this.div.style.display;if(C!=this.renderer.root.style.display){this.renderer.root.style.display=C}},addFeatures:function(C,K){if(!(C instanceof Array)){C=[C]}var I=!K||!K.silent;if(I){var B={features:C};var H=this.events.triggerEvent("beforefeaturesadded",B);if(H===false){return }C=B.features}var E=[];for(var D=0,G=C.length;D<G;D++){if(D!=(C.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var J=C[D];if(this.geometryType&&!(J.geometry instanceof this.geometryType)){var F=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw F}J.layer=this;if(!J.style&&this.style){J.style=OpenLayers.Util.extend({},this.style)}if(I){if(this.events.triggerEvent("beforefeatureadded",{feature:J})===false){continue}this.preFeatureInsert(J)}E.push(J);this.features.push(J);this.drawFeature(J);if(I){this.events.triggerEvent("featureadded",{feature:J});this.onFeatureInsert(J)}}if(I){this.events.triggerEvent("featuresadded",{features:E})}},removeFeatures:function(F,B){if(!F||F.length===0){return }if(F===this.features){return this.removeAllFeatures(B)}if(!(F instanceof Array)){F=[F]}if(F===this.selectedFeatures){F=F.slice()}var E=!B||!B.silent;if(E){this.events.triggerEvent("beforefeaturesremoved",{features:F})}for(var D=F.length-1;D>=0;D--){if(D!=0&&F[D-1].geometry){this.renderer.locked=true}else{this.renderer.locked=false}var C=F[D];delete this.unrenderedFeatures[C.id];if(E){this.events.triggerEvent("beforefeatureremoved",{feature:C})}this.features=OpenLayers.Util.removeItem(this.features,C);C.layer=null;if(C.geometry){this.renderer.eraseFeatures(C)}if(OpenLayers.Util.indexOf(this.selectedFeatures,C)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,C)}if(E){this.events.triggerEvent("featureremoved",{feature:C})}}if(E){this.events.triggerEvent("featuresremoved",{features:F})}},removeAllFeatures:function(B){var E=!B||!B.silent;var F=this.features;if(E){this.events.triggerEvent("beforefeaturesremoved",{features:F})}var D;for(var C=F.length-1;C>=0;C--){D=F[C];if(E){this.events.triggerEvent("beforefeatureremoved",{feature:D})}D.layer=null;if(E){this.events.triggerEvent("featureremoved",{feature:D})}}this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures=[];if(E){this.events.triggerEvent("featuresremoved",{features:F})}},destroyFeatures:function(E,B){var D=(E==undefined);if(D){E=this.features}if(E){this.removeFeatures(E,B);for(var C=E.length-1;C>=0;C--){E[C].destroy()}}},drawFeature:function(B,C){if(!this.drawn){return }if(typeof C!="object"){if(!C&&B.state===OpenLayers.State.DELETE){C="delete"}var D=C||B.renderIntent;C=B.style||this.style;if(!C){C=this.styleMap.createSymbolizer(B,D)}}if(!this.renderer.drawFeature(B,C)){this.unrenderedFeatures[B.id]=B}else{delete this.unrenderedFeatures[B.id]}},eraseFeatures:function(B){this.renderer.eraseFeatures(B)},getFeatureFromEvent:function(B){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var C=this.renderer.getFeatureIdFromEvent(B);return this.getFeatureById(C)},getFeatureBy:function(F,E){var D=null;for(var C=0,B=this.features.length;C<B;++C){if(this.features[C][F]==E){D=this.features[C];break}}return D},getFeatureById:function(B){return this.getFeatureBy("id",B)},getFeatureByFid:function(B){return this.getFeatureBy("fid",B)},getFeaturesByAttribute:function(E,F){var D,C,B=this.features.length,G=[];for(D=0;D<B;D++){C=this.features[D];if(C&&C.attributes){if(C.attributes[E]===F){G.push(C)}}}return G},onFeatureInsert:function(B){},preFeatureInsert:function(B){},getDataExtent:function(){var C=null;var E=this.features;if(E&&(E.length>0)){C=new OpenLayers.Bounds();var F=null;for(var D=0,B=E.length;D<B;D++){F=E[D].geometry;if(F){C.extend(F.getBounds())}}}return C},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,zoomOffset:0,serverResolutions:null,initialize:function(E,D,C){if(C&&C.sphericalMercator||this.sphericalMercator){C=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-128*156543.0339,-128*156543.0339,128*156543.0339,128*156543.0339),maxResolution:156543.0339,numZoomLevels:19,units:"m",projection:"EPSG:900913"},C)}D=D||this.url;E=E||this.name;var B=[E,D,{},C];OpenLayers.Layer.Grid.prototype.initialize.apply(this,B)},clone:function(B){if(B==null){B=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())}B=OpenLayers.Layer.Grid.prototype.clone.apply(this,[B]);return B},getURL:function(E){var B=this.getXYZ(E);var C=this.url;if(C instanceof Array){var D=""+B.x+B.y+B.z;C=this.selectUrl(D,C)}return OpenLayers.String.format(C,B)},getXYZ:function(D){var C=this.map.getResolution();var B=Math.round((D.left-this.maxExtent.left)/(C*this.tileSize.w));var F=Math.round((this.maxExtent.top-D.top)/(C*this.tileSize.h));var E=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,C):this.map.getZoom()+this.zoomOffset;return{x:B,y:F,z:E}},addTile:function(C,B){return new OpenLayers.Tile.Image(this,B,C,null,this.tileSize)},setMap:function(B){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",sphericalMercator:true,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",clone:function(B){if(B==null){B=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())}B=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[B]);return B},CLASS_NAME:"OpenLayers.Layer.OSM"});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,symbolMetrics:null,initialize:function(B){if(!this.supported()){return }OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.symbolMetrics={}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var B="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(B+"SVG","1.1")||document.implementation.hasFeature(B+"BasicStructure","1.1")))},inValidRange:function(B,F,C){var E=B+(C?0:this.translationParameters.x);var D=F+(C?0:this.translationParameters.y);return(E>=-this.MAX_PIXEL&&E<=this.MAX_PIXEL&&D>=-this.MAX_PIXEL&&D<=this.MAX_PIXEL)},setExtent:function(C,E){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var B=this.getResolution();var G=-C.left/B;var F=C.top/B;if(E){this.left=G;this.top=F;var D="0 0 "+this.size.w+" "+this.size.h;this.rendererRoot.setAttributeNS(null,"viewBox",D);this.translate(0,0);return true}else{var H=this.translate(G-this.left,F-this.top);if(!H){this.setExtent(C,true)}return H}},translate:function(B,D){if(!this.inValidRange(B,D,true)){return false}else{var C="";if(B||D){C="translate("+B+","+D+")"}this.root.setAttributeNS(null,"transform",C);this.translationParameters={x:B,y:D};return true}},setSize:function(B){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(D,C){var B=null;switch(D.CLASS_NAME){case"OpenLayers.Geometry.Point":if(C.externalGraphic){B="image"}else{if(this.isComplexSymbol(C.graphicName)){B="svg"}else{B="circle"}}break;case"OpenLayers.Geometry.Rectangle":B="rect";break;case"OpenLayers.Geometry.LineString":B="polyline";break;case"OpenLayers.Geometry.LinearRing":B="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":B="path";break;default:break}return B},setStyle:function(P,S,C){S=S||P._style;C=C||P._options;var K=parseFloat(P.getAttributeNS(null,"r"));var J=1;var E;if(P._geometryClass=="OpenLayers.Geometry.Point"&&K){P.style.visibility="";if(S.graphic===false){P.style.visibility="hidden"}else{if(S.externalGraphic){E=this.getPosition(P);if(S.graphicTitle){P.setAttributeNS(null,"title",S.graphicTitle)}if(S.graphicWidth&&S.graphicHeight){P.setAttributeNS(null,"preserveAspectRatio","none")}var O=S.graphicWidth||S.graphicHeight;var M=S.graphicHeight||S.graphicWidth;O=O?O:S.pointRadius*2;M=M?M:S.pointRadius*2;var T=(S.graphicXOffset!=undefined)?S.graphicXOffset:-(0.5*O);var G=(S.graphicYOffset!=undefined)?S.graphicYOffset:-(0.5*M);var B=S.graphicOpacity||S.fillOpacity;P.setAttributeNS(null,"x",(E.x+T).toFixed());P.setAttributeNS(null,"y",(E.y+G).toFixed());P.setAttributeNS(null,"width",O);P.setAttributeNS(null,"height",M);P.setAttributeNS(this.xlinkns,"href",S.externalGraphic);P.setAttributeNS(null,"style","opacity: "+B)}else{if(this.isComplexSymbol(S.graphicName)){var D=S.pointRadius*3;var L=D*2;var N=this.importSymbol(S.graphicName);E=this.getPosition(P);J=this.symbolMetrics[N][0]*3/L;var H=P.parentNode;var I=P.nextSibling;if(H){H.removeChild(P)}var F=document.getElementById(N);P.firstChild&&P.removeChild(P.firstChild);P.appendChild(F.firstChild.cloneNode(true));P.setAttributeNS(null,"viewBox",F.getAttributeNS(null,"viewBox"));P.setAttributeNS(null,"width",L);P.setAttributeNS(null,"height",L);P.setAttributeNS(null,"x",E.x-D);P.setAttributeNS(null,"y",E.y-D);if(I){H.insertBefore(P,I)}else{if(H){H.appendChild(P)}}}else{P.setAttributeNS(null,"r",S.pointRadius)}}}var R=S.rotation;if((R!==undefined||P._rotation!==undefined)&&E){P._rotation=R;R|=0;if(P.nodeName!=="svg"){P.setAttributeNS(null,"transform","rotate("+R+" "+E.x+" "+E.y+")")}else{var Q=this.symbolMetrics[N];P.firstChild.setAttributeNS(null,"transform","rotate("+R+" "+Q[1]+" "+Q[2]+")")}}}if(C.isFilled){P.setAttributeNS(null,"fill",S.fillColor);P.setAttributeNS(null,"fill-opacity",S.fillOpacity)}else{P.setAttributeNS(null,"fill","none")}if(C.isStroked){P.setAttributeNS(null,"stroke",S.strokeColor);P.setAttributeNS(null,"stroke-opacity",S.strokeOpacity);P.setAttributeNS(null,"stroke-width",S.strokeWidth*J);P.setAttributeNS(null,"stroke-linecap",S.strokeLinecap||"round");P.setAttributeNS(null,"stroke-linejoin","round");S.strokeDashstyle&&P.setAttributeNS(null,"stroke-dasharray",this.dashStyle(S,J))}else{P.setAttributeNS(null,"stroke","none")}if(S.pointerEvents){P.setAttributeNS(null,"pointer-events",S.pointerEvents)}if(S.cursor!=null){P.setAttributeNS(null,"cursor",S.cursor)}return P},dashStyle:function(D,C){var B=D.strokeWidth*C;var E=D.strokeDashstyle;switch(E){case"solid":return"none";case"dot":return[1,4*B].join();case"dash":return[4*B,4*B].join();case"dashdot":return[4*B,4*B,1,4*B].join();case"longdash":return[8*B,4*B].join();case"longdashdot":return[8*B,4*B,1,4*B].join();default:return OpenLayers.String.trim(E).replace(/\s+/g,",")}},createNode:function(B,D){var C=document.createElementNS(this.xmlns,B);if(D){C.setAttributeNS(null,"id",D)}return C},nodeTypeCompare:function(C,B){return(B==C.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(B){return this.nodeFactory(this.container.id+B,"g")},createDefs:function(){var B=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(B);return B},drawPoint:function(B,C){return this.drawCircle(B,C,1)},drawCircle:function(E,F,C){var D=this.getResolution();var B=(F.x/D+this.left);var G=(this.top-F.y/D);if(this.inValidRange(B,G)){E.setAttributeNS(null,"cx",B);E.setAttributeNS(null,"cy",G);E.setAttributeNS(null,"r",C);return E}else{return false}},drawLineString:function(C,D){var B=this.getComponentsString(D.components);if(B.path){C.setAttributeNS(null,"points",B.path);return(B.complete?C:null)}else{return false}},drawLinearRing:function(C,D){var B=this.getComponentsString(D.components);if(B.path){C.setAttributeNS(null,"points",B.path);return(B.complete?C:null)}else{return false}},drawPolygon:function(C,H){var G="";var I=true;var B=true;var D,J;for(var E=0,F=H.components.length;E<F;E++){G+=" M";D=this.getComponentsString(H.components[E].components," ");J=D.path;if(J){G+=" "+J;B=D.complete&&B}else{I=false}}G+=" z";if(I){C.setAttributeNS(null,"d",G);C.setAttributeNS(null,"fill-rule","evenodd");return B?C:null}else{return false}},drawRectangle:function(D,E){var C=this.getResolution();var B=(E.x/C+this.left);var F=(this.top-E.y/C);if(this.inValidRange(B,F)){D.setAttributeNS(null,"x",B);D.setAttributeNS(null,"y",F);D.setAttributeNS(null,"width",E.width/C);D.setAttributeNS(null,"height",E.height/C);return D}else{return false}},drawSurface:function(F,H){var G=null;var C=true;for(var E=0,B=H.components.length;E<B;E++){if((E%3)==0&&(E/3)==0){var D=this.getShortString(H.components[E]);if(!D){C=false}G="M "+D}else{if((E%3)==1){var D=this.getShortString(H.components[E]);if(!D){C=false}G+=" C "+D}else{var D=this.getShortString(H.components[E]);if(!D){C=false}G+=" "+D}}}G+=" Z";if(C){F.setAttributeNS(null,"d",G);return F}else{return false}},drawText:function(D,B,J){var C=this.getResolution();var I=(J.x/C+this.left);var F=(J.y/C-this.top);var H=this.nodeFactory(D+this.LABEL_ID_SUFFIX,"text");var G=this.nodeFactory(D+this.LABEL_ID_SUFFIX+"_tspan","tspan");H.setAttributeNS(null,"x",I);H.setAttributeNS(null,"y",-F);if(B.fontColor){H.setAttributeNS(null,"fill",B.fontColor)}if(B.fontOpacity){H.setAttributeNS(null,"opacity",B.fontOpacity)}if(B.fontFamily){H.setAttributeNS(null,"font-family",B.fontFamily)}if(B.fontSize){H.setAttributeNS(null,"font-size",B.fontSize)}if(B.fontWeight){H.setAttributeNS(null,"font-weight",B.fontWeight)}if(B.labelSelect===true){H.setAttributeNS(null,"pointer-events","visible");H._featureId=D;G._featureId=D;G._geometry=J;G._geometryClass=J.CLASS_NAME}else{H.setAttributeNS(null,"pointer-events","none")}var E=B.labelAlign||"cm";H.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[E[0]]||"middle");if(OpenLayers.IS_GECKO===true){H.setAttributeNS(null,"dominant-baseline",OpenLayers.Renderer.SVG.LABEL_ALIGN[E[1]]||"central")}else{G.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[E[1]]||"-35%")}G.textContent=B.label;if(!H.parentNode){H.appendChild(G);this.textRoot.appendChild(H)}},getComponentsString:function(E,D){var G=[];var B=true;var F=E.length;var J=[];var H,I;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]))}}B=false}}return{path:J.join(D||","),complete:B}},clipLine:function(F,I){if(I.equals(F)){return""}var G=this.getResolution();var C=this.MAX_PIXEL-this.translationParameters.x;var B=this.MAX_PIXEL-this.translationParameters.y;var E=I.x/G+this.left;var K=this.top-I.y/G;var D=F.x/G+this.left;var J=this.top-F.y/G;var H;if(D<-C||D>C){H=(J-K)/(D-E);D=D<0?-C:C;J=K+(D-E)*H}if(J<-B||J>B){H=(D-E)/(J-K);J=J<0?-B:B;D=E+(J-K)*H}return D+","+J},getShortString:function(C){var D=this.getResolution();var B=(C.x/D+this.left);var E=(this.top-C.y/D);if(this.inValidRange(B,E)){return B+","+E}else{return false}},getPosition:function(B){return({x:parseFloat(B.getAttributeNS(null,"cx")),y:parseFloat(B.getAttributeNS(null,"cy"))})},importSymbol:function(F){if(!this.defs){this.defs=this.createDefs()}var C=this.container.id+"-"+F;if(document.getElementById(C)!=null){return C}var E=OpenLayers.Renderer.symbol[F];if(!E){throw new Error(F+" is not a valid symbol name")}var H=this.nodeFactory(C,"symbol");var D=this.nodeFactory(null,"polygon");H.appendChild(D);var M=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var K=[];var J,I;for(var G=0;G<E.length;G=G+2){J=E[G];I=E[G+1];M.left=Math.min(M.left,J);M.bottom=Math.min(M.bottom,I);M.right=Math.max(M.right,J);M.top=Math.max(M.top,I);K.push(J,",",I)}D.setAttributeNS(null,"points",K.join(" "));var B=M.getWidth();var L=M.getHeight();var N=[M.left-B,M.bottom-L,B*3,L*3];H.setAttributeNS(null,"viewBox",N.join(" "));this.symbolMetrics[C]=[Math.max(B,L),M.getCenterLonLat().lon,M.getCenterLonLat().lat];this.defs.appendChild(H);return H.id},getFeatureIdFromEvent:function(B){var D=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);if(!D){var C=B.target;D=C.parentNode&&C!=this.rendererRoot&&C.parentNode._featureId}return D},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.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:false,initialize:function(B){OpenLayers.Control.prototype.initialize.apply(this,[B])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var B=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(C){var E=parseInt(Math.log(C)/Math.log(10));var B=Math.pow(10,E);var D=parseInt(C/B);var F;if(D>5){F=5}else{if(D>2){F=2}else{F=1}}return F*B},update:function(){var K=this.map.getResolution();if(!K){return }var P=this.map.getUnits();var F=OpenLayers.INCHES_PER_UNIT;var M=this.maxWidth*K*F[P];var O=1;if(this.geodesic===true){var C=(this.map.getGeodesicPixelSize().w||0.000001)*this.maxWidth;var G=M/F.km;O=C/G;M*=O}var B;var E;if(M>100000){B=this.topOutUnits;E=this.bottomOutUnits}else{B=this.topInUnits;E=this.bottomInUnits}var I=M/F[B];var L=M/F[E];var J=this.getBarLen(I);var H=this.getBarLen(L);I=J/F[P]*F[B];L=H/F[P]*F[E];var D=I/K/O;var N=L/K/O;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(N)+"px";this.eBottom.innerHTML=H+" "+E}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(D)+"px";this.eTop.innerHTML=J+" "+B}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(B){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(C){OpenLayers.Control.prototype.draw.apply(this,arguments);C=this.position;this.buttons=[];var D=new OpenLayers.Size(18,18);var B=new OpenLayers.Pixel(C.x+D.w/2,C.y);this._addButton("panup","north-mini.png",B,D);C.y=B.y+D.h;this._addButton("panleft","west-mini.png",C,D);this._addButton("panright","east-mini.png",C.add(D.w,0),D);this._addButton("pandown","south-mini.png",B.add(0,D.h*2),D);this._addButton("zoomin","zoom-plus-mini.png",B.add(0,D.h*3+5),D);this._addButton("zoomworld","zoom-world-mini.png",B.add(0,D.h*4+5),D);this._addButton("zoomout","zoom-minus-mini.png",B.add(0,D.h*5+5),D);return this.div},_addButton:function(B,E,J,H){var G=OpenLayers.Util.getImagesLocation()+E;var C=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+B,J,H,G,"absolute");this.div.appendChild(C);OpenLayers.Event.observe(C,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,C));OpenLayers.Event.observe(C,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,C));OpenLayers.Event.observe(C,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,C));C.action=B;C.map=this.map;if(!this.slideRatio){var D=this.slideFactor;var F=function(){return D}}else{var I=this.slideRatio;var F=function(K){return this.map.getSize()[K]*I}}C.getSlideFactor=F;this.buttons.push(C);return C},_removeButton:function(B){OpenLayers.Event.stopObservingElement(B);B.map=null;B.getSlideFactor=null;this.div.removeChild(B);OpenLayers.Util.removeItem(this.buttons,B)},removeButtons:function(){for(var B=this.buttons.length-1;B>=0;--B){this._removeButton(this.buttons[B])}},doubleClick:function(B){OpenLayers.Event.stop(B);return false},buttonDown:function(B){if(!OpenLayers.Event.isLeftClick(B)){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(B)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:false,initialize:function(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B])},activate:function(){var B=OpenLayers.Strategy.prototype.activate.call(this);if(B){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this})}return B},deactivate:function(){var B=OpenLayers.Strategy.prototype.deactivate.call(this);if(B){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})}return B},cacheFeatures:function(B){if(!this.paging){this.clearCache();this.features=B.features;this.pageNext(B)}},clearCache:function(){if(this.features){for(var B=0;B<this.features.length;++B){this.features[B].destroy()}}this.features=null;this.num=null},pageCount:function(){var B=this.features?this.features.length:0;return Math.ceil(B/this.length)},pageNum:function(){return this.num},pageLength:function(B){if(B&&B>0){this.length=B}return this.length},pageNext:function(B){var C=false;if(this.features){if(this.num===null){this.num=-1}var D=(this.num+1)*this.length;C=this.page(D,B)}return C},pagePrevious:function(){var B=false;if(this.features){if(this.num===null){this.num=this.pageCount()}var C=(this.num-1)*this.length;B=this.page(C)}return B},page:function(F,D){var E=false;if(this.features){if(F>=0&&F<this.features.length){var B=Math.floor(F/this.length);if(B!=this.num){this.paging=true;var C=this.features.slice(F,F+this.length);this.layer.removeFeatures(this.layer.features);this.num=B;if(D&&D.features){D.features=C}else{this.layer.addFeatures(C)}this.paging=false;E=true}}}return E},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,initialize:function(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B])},activate:function(){var B=OpenLayers.Strategy.prototype.activate.call(this);if(B){this.layer.events.on({moveend:this.update,scope:this});this.layer.events.on({refresh:this.update,scope:this})}return B},deactivate:function(){var B=OpenLayers.Strategy.prototype.deactivate.call(this);if(B){this.layer.events.un({moveend:this.update,scope:this});this.layer.events.un({refresh:this.update,scope:this})}return B},update:function(C){var B=this.getMapBounds();if((C&&C.force)||this.invalidBounds(B)){this.calculateBounds(B);this.resolution=this.layer.map.getResolution();this.triggerRead()}},getMapBounds:function(){var B=this.layer.map.getExtent();if(!this.layer.projection.equals(this.layer.map.getProjectionObject())){B=B.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return B},invalidBounds:function(B){if(!B){B=this.getMapBounds()}var D=!this.bounds||!this.bounds.containsBounds(B);if(!D&&this.resFactor){var C=this.resolution/this.layer.map.getResolution();D=(C>=this.resFactor||C<=(1/this.resFactor))}return D},calculateBounds:function(C){if(!C){C=this.getMapBounds()}var B=C.getCenterLonLat();var E=C.getWidth()*this.ratio;var D=C.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(B.lon-(E/2),B.lat-(D/2),B.lon+(E/2),B.lat+(D/2))},triggerRead:function(){if(this.response){this.layer.protocol.abort(this.response);this.layer.events.triggerEvent("loadend")}this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read({filter:this.createFilter(),callback:this.merge,scope:this})},createFilter:function(){var B=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){B=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,B]})}return B},merge:function(H){this.layer.destroyFeatures();var F=H.features;if(F&&F.length>0){var G=this.layer.projection;var E=this.layer.map.getProjectionObject();if(!E.equals(G)){var D;for(var C=0,B=F.length;C<B;++C){D=F[C].geometry;if(D){D.transform(G,E)}}}this.layer.addFeatures(F)}this.response=null;this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Layer.Google.v3={DEFAULTS:{maxExtent:new OpenLayers.Bounds(-128*156543.0339,-128*156543.0339,128*156543.0339,128*156543.0339),sphericalMercator:true,maxResolution:156543.0339,units:"m",projection:"EPSG:900913"},animationEnabled:true,loadMapObject:function(){if(!this.type){this.type=google.maps.MapTypeId.ROADMAP}var E;var D=OpenLayers.Layer.Google.cache[this.map.id];if(D){E=D.mapObject;++D.count}else{var C=this.map.viewPortDiv;var F=document.createElement("div");F.id=this.map.id+"_GMapContainer";F.style.position="absolute";F.style.width="100%";F.style.height="100%";C.appendChild(F);var B=this.map.getCenter();E=new google.maps.Map(F,{center:B?new google.maps.LatLng(B.lat,B.lon):new google.maps.LatLng(0,0),zoom:this.map.getZoom()||0,mapTypeId:this.type,disableDefaultUI:true,keyboardShortcuts:false,draggable:false,disableDoubleClickZoom:true,scrollwheel:false,streetViewControl:false});D={mapObject:E,count:1};OpenLayers.Layer.Google.cache[this.map.id]=D;this.repositionListener=google.maps.event.addListenerOnce(E,"center_changed",OpenLayers.Function.bind(this.repositionMapElements,this))}this.mapObject=E;this.setGMapVisibility(this.visibility)},repositionMapElements:function(){google.maps.event.trigger(this.mapObject,"resize");var F=this.mapObject.getDiv().firstChild;if(!F||F.childNodes.length<3){this.repositionTimer=window.setTimeout(OpenLayers.Function.bind(this.repositionMapElements,this),250);return false}var E=OpenLayers.Layer.Google.cache[this.map.id];var C=this.map.viewPortDiv;while(F.lastChild.style.display=="none"){C.appendChild(F.lastChild)}var D=F.lastChild;C.appendChild(D);D.style.zIndex="1100";D.style.bottom="";D.className="olLayerGoogleCopyright olLayerGoogleV3";D.style.display="";E.termsOfUse=D;var B=F.lastChild;C.appendChild(B);B.style.zIndex="1100";B.style.bottom="";B.className="olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint";B.style.display="";E.poweredBy=B;this.setGMapVisibility(this.visibility)},onMapResize:function(){if(this.visibility){google.maps.event.trigger(this.mapObject,"resize")}else{if(!this._resized){var B=this;google.maps.event.addListenerOnce(this.mapObject,"tilesloaded",function(){delete B._resized;google.maps.event.trigger(B.mapObject,"resize");B.moveTo(B.map.getCenter(),B.map.getZoom())})}this._resized=true}},setGMapVisibility:function(H){var C=OpenLayers.Layer.Google.cache[this.map.id];if(C){var F=this.type;var G=this.map.layers;var E;for(var D=G.length-1;D>=0;--D){E=G[D];if(E instanceof OpenLayers.Layer.Google&&E.visibility===true&&E.inRange===true){F=E.type;H=true;break}}var B=this.mapObject.getDiv();if(H===true){this.mapObject.setMapTypeId(F);B.style.left="";if(C.termsOfUse&&C.termsOfUse.style){C.termsOfUse.style.left="";C.termsOfUse.style.display="";C.poweredBy.style.display=""}C.displayed=this.id}else{delete C.displayed;B.style.left="-9999px";if(C.termsOfUse&&C.termsOfUse.style){C.termsOfUse.style.display="none";C.termsOfUse.style.left="-9999px";C.poweredBy.style.display="none"}}}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(D){var C=null;if(D!=null){var B=this.sphericalMercator?this.inverseMercator(D.bottom,D.left):new OpenLayers.LonLat(D.bottom,D.left);var E=this.sphericalMercator?this.inverseMercator(D.top,D.right):new OpenLayers.LonLat(D.top,D.right);C=new google.maps.LatLngBounds(new google.maps.LatLng(B.lat,B.lon),new google.maps.LatLng(E.lat,E.lon))}return C},getMapObjectLonLatFromMapObjectPixel:function(I){var C=this.map.getSize();var G=this.getLongitudeFromMapObjectLonLat(this.mapObject.center);var E=this.getLatitudeFromMapObjectLonLat(this.mapObject.center);var B=this.map.getResolution();var H=I.x-(C.w/2);var F=I.y-(C.h/2);var D=new OpenLayers.LonLat(G+H*B,E-F*B);if(this.wrapDateLine){D=D.wrapDateLine(this.maxExtent)}return this.getMapObjectLonLatFromLonLat(D.lon,D.lat)},getMapObjectPixelFromMapObjectLonLat:function(G){var F=this.getLongitudeFromMapObjectLonLat(G);var E=this.getLatitudeFromMapObjectLonLat(G);var C=this.map.getResolution();var D=this.map.getExtent();var B=new OpenLayers.Pixel((1/C*(F-D.left)),(1/C*(D.top-E)));return this.getMapObjectPixelFromXY(B.x,B.y)},setMapObjectCenter:function(B,D){if(this.animationEnabled===false&&D!=this.mapObject.zoom){var C=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject,"idle",function(){C.style.visibility=""});C.style.visibility="hidden"}this.mapObject.setOptions({center:B,zoom:D})},getMapObjectZoomFromMapObjectBounds:function(B){return this.mapObject.getBoundsZoomLevel(B)},getMapObjectLonLatFromLonLat:function(E,C){var D;if(this.sphericalMercator){var B=this.inverseMercator(E,C);D=new google.maps.LatLng(B.lat,B.lon)}else{D=new google.maps.LatLng(C,E)}return D},getMapObjectPixelFromXY:function(B,C){return new google.maps.Point(B,C)},destroy:function(){if(this.repositionListener){google.maps.event.removeListener(this.repositionListener)}if(this.repositionTimer){window.clearTimeout(this.repositionTimer)}OpenLayers.Layer.Google.prototype.destroy.apply(this,arguments)}};OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(C,D,B){this.bounds=C;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div,null);this.setBorder(D,B)},destroy:function(){this.bounds=null;this.div=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(B,C){if(!B){B="red"}if(!C){C=2}this.div.style.border=C+"px solid "+B},draw:function(B,C){OpenLayers.Util.modifyDOMElement(this.div,null,B,C);return this.div},onScreen:function(){var C=false;if(this.map){var B=this.map.getExtent();C=B.containsBounds(this.bounds,true,true)}return C},display:function(B){this.div.style.display=(B)?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});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),tileOriginCorner:"tl",initialize:function(D,C,E,B){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(B==null||B.isBaseLayer==null){this.isBaseLayer=((this.transparent!="true")&&(this.transparent!=true))}if(B&&B.useOverlay!=null){this.useOverlay=B.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(B){if(B==null){B=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions())}B=OpenLayers.Layer.Grid.prototype.clone.apply(this,[B]);return B},addTile:function(C,B){return new OpenLayers.Tile.Image(this,B,C,null,this.tileSize)},getURL:function(B){var E;var C=B.getCenterLonLat();var I=this.map.getSize();if(this.singleTile){var F={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:I.h*this.ratio,setdisplaywidth:I.w*this.ratio,setviewcenterx:C.lon,setviewcentery:C.lat,setviewscale:this.map.getScale()};if(this.useOverlay&&!this.useAsyncOverlay){var J={};J=OpenLayers.Util.extend(J,F);J.operation="GETVISIBLEMAPEXTENT";J.version="1.0.0";J.session=this.params.session;J.mapName=this.params.mapName;J.format="text/xml";E=this.getFullRequestString(J);OpenLayers.Request.GET({url:E,async:false})}E=this.getFullRequestString(F)}else{var H=this.map.getResolution();var G=Math.floor((B.left-this.maxExtent.left)/H);G=Math.round(G/this.tileSize.w);var D=Math.floor((this.maxExtent.top-B.top)/H);D=Math.round(D/this.tileSize.h);if(this.useHttpTile){E=this.getImageFilePath({tilecol:G,tilerow:D,scaleindex:this.resolutions.length-this.map.zoom-1})}else{E=this.getFullRequestString({tilecol:G,tilerow:D,scaleindex:this.resolutions.length-this.map.zoom-1})}}return E},getFullRequestString:function(G,F){var C=(F==null)?this.url:F;if(typeof C=="object"){C=C[Math.floor(Math.random()*C.length)]}var J=C;var H=OpenLayers.Util.extend({},this.params);H=OpenLayers.Util.extend(H,G);var E=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(C));for(var I in H){if(I.toUpperCase() in E){delete H[I]}}var B=OpenLayers.Util.getParameterString(H);B=B.replace(/,/g,"+");if(B!=""){var D=C.charAt(C.length-1);if((D=="&")||(D=="?")){J+=B}else{if(C.indexOf("?")==-1){J+="?"+B}else{J+="&"+B}}}return J},getImageFilePath:function(H,F){var D=(F==null)?this.url:F;if(typeof D=="object"){D=D[Math.floor(Math.random()*D.length)]}var C=D;var E="";var G="";if(H.tilerow<0){E="-"}if(H.tilerow==0){E+="0"}else{E+=Math.floor(Math.abs(H.tilerow/this.params.tileRowsPerFolder))*this.params.tileRowsPerFolder}if(H.tilecol<0){G="-"}if(H.tilecol==0){G+="0"}else{G+=Math.floor(Math.abs(H.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder}var B="/S"+Math.floor(H.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+E+"/C"+G+"/"+(H.tilerow%this.params.tileRowsPerFolder)+"_"+(H.tilecol%this.params.tileColumnsPerFolder)+"."+this.params.format;if(this.params.querystring){B+="?"+this.params.querystring}C+=B;return C},calculateGridLayout:function(B,P,F){var L=F*this.tileSize.w;var D=F*this.tileSize.h;var J=B.left-P.lon;var M=Math.floor(J/L)-this.buffer;var K=J/L-M;var G=-K*this.tileSize.w;var N=P.lon+M*L;var C=P.lat-B.top+D;var I=Math.floor(C/D)-this.buffer;var O=I-C/D;var E=O*this.tileSize.h;var H=P.lat-D*I;return{tilelon:L,tilelat:D,tileoffsetlon:N,tileoffsetlat:H,tileoffsetx:G,tileoffsety:E}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});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,immediate:false,initialize:function(C,B){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[B]);var D={done:this.measureComplete,point:this.measurePartial};if(this.immediate){D.modify=this.measureImmediate}this.callbacks=OpenLayers.Util.extend(D,this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new C(this,this.callbacks,this.handlerOptions)},deactivate:function(){this.cancelDelay();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.cancelDelay();this.handler.cancel()},setImmediate:function(B){this.immediate=B;if(this.immediate){this.callbacks.modify=this.measureImmediate}else{delete this.callbacks.modify}},updateHandler:function(C,B){var D=this.active;if(D){this.deactivate()}this.handler=new C(this,this.callbacks,B);if(D){this.activate()}},measureComplete:function(B){this.cancelDelay();this.measure(B,"measure")},measurePartial:function(B,C){this.cancelDelay();C=C.clone();if(this.handler.freehandMode(this.handler.evt)){this.measure(C,"measurepartial")}else{this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null;this.measure(C,"measurepartial")},this),this.partialDelay)}},measureImmediate:function(B,C){if(this.delayedTrigger===null&&!this.handler.freehandMode(this.handler.evt)){this.measure(C.geometry,"measurepartial")}},cancelDelay:function(){if(this.delayedTrigger!==null){window.clearTimeout(this.delayedTrigger);this.delayedTrigger=null}},measure:function(E,C){var D,B;if(E.CLASS_NAME.indexOf("LineString")>-1){D=this.getBestLength(E);B=1}else{D=this.getBestArea(E);B=2}this.events.triggerEvent(C,{measure:D[0],units:D[1],order:B,geometry:E})},getBestArea:function(G){var C=this.displaySystemUnits[this.displaySystem];var F,E;for(var D=0,B=C.length;D<B;++D){F=C[D];E=this.getArea(G,F);if(E>1){break}}return[E,F]},getArea:function(G,B){var C,D;if(this.geodesic){C=G.getGeodesicArea(this.map.getProjectionObject());D="m"}else{C=G.getArea();D=this.map.getUnits()}var F=OpenLayers.INCHES_PER_UNIT[B];if(F){var E=OpenLayers.INCHES_PER_UNIT[D];C*=Math.pow((E/F),2)}return C},getBestLength:function(G){var C=this.displaySystemUnits[this.displaySystem];var F,E;for(var D=0,B=C.length;D<B;++D){F=C[D];E=this.getLength(G,F);if(E>1){break}}return[E,F]},getLength:function(G,B){var C,D;if(this.geodesic){C=G.getGeodesicLength(this.map.getProjectionObject());D="m"}else{C=G.getLength();D=this.map.getUnits()}var F=OpenLayers.INCHES_PER_UNIT[B];if(F){var E=OpenLayers.INCHES_PER_UNIT[D];C*=(E/F)}return C},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],multi:false,featureAdded:function(){},handlerOptions:null,initialize:function(C,D,B){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[B]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(G,F){this.layer.events.triggerEvent("sketchmodified",{vertex:G,feature:F})},create:function(G,F){this.layer.events.triggerEvent("sketchstarted",{vertex:G,feature:F})}},this.callbacks);this.layer=C;this.handlerOptions=this.handlerOptions||{};if(!("multi" in this.handlerOptions)){this.handlerOptions.multi=this.multi}var E=this.layer.styleMap&&this.layer.styleMap.styles.temporary;if(E){this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":E})})}this.handler=new D(this,this.callbacks,this.handlerOptions)},drawFeature:function(D){var B=new OpenLayers.Feature.Vector(D);var C=this.layer.events.triggerEvent("sketchcomplete",{feature:B});if(C!==false){B.state=OpenLayers.State.INSERT;this.layer.addFeatures([B]);this.featureAdded(B);this.events.triggerEvent("featureadded",{feature:B})}},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(B){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Point"});OpenLayers.Symbolizer.Line=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(B){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Line"});OpenLayers.Symbolizer.Polygon=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(B){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Polygon"});OpenLayers.Symbolizer.Text=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(B){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Text"});OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(B){this.symbolizer={};OpenLayers.Util.extend(this,B);if(this.symbolizers){delete this.symbolizer}this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var B in this.symbolizer){this.symbolizer[B]=null}this.symbolizer=null;delete this.symbolizers},evaluate:function(D){var C=this.getContext(D);var B=true;if(this.minScaleDenominator||this.maxScaleDenominator){var E=D.layer.map.getScale()}if(this.minScaleDenominator){B=E>=OpenLayers.Style.createLiteral(this.minScaleDenominator,C)}if(B&&this.maxScaleDenominator){B=E<OpenLayers.Style.createLiteral(this.maxScaleDenominator,C)}if(B&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){B=this.filter.evaluate(D)}else{B=this.filter.evaluate(C)}}return B},getContext:function(C){var B=this.context;if(!B){B=C.attributes||C.data}if(typeof this.context=="function"){B=this.context(C)}return B},clone:function(){var C=OpenLayers.Util.extend({},this);if(this.symbolizers){var B=this.symbolizers.length;C.symbolizers=new Array(B);for(var E=0;E<B;++E){C.symbolizers[E]=this.symbolizers[E].clone()}}else{C.symbolizer={};var G,F;for(var D in this.symbolizer){G=this.symbolizer[D];F=typeof G;if(F==="object"){C.symbolizer[D]=OpenLayers.Util.extend({},G)}else{if(F==="string"){C.symbolizer[D]=G}}}}C.filter=this.filter&&this.filter.clone();C.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(C)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(D,C,B){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(B){if(this.passesTolerance(B.xy)){this.clearTimer();this.callback("move",[B]);this.px=B.xy;B=OpenLayers.Util.extend({},B);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,B),this.delay)}return !this.stopMove},mouseout:function(B){if(OpenLayers.Util.mouseLeft(B,this.map.div)){this.clearTimer();this.callback("move",[B])}return true},passesTolerance:function(C){var D=true;if(this.pixelTolerance&&this.px){var B=Math.sqrt(Math.pow(this.px.x-C.x,2)+Math.pow(this.px.y-C.y,2));if(B<this.pixelTolerance){D=false}}return D},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(B){this.callback("pause",[B])},deactivate:function(){var B=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();B=true}return B},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},initialize:function(B){OpenLayers.Format.XML.prototype.initialize.apply(this,[B])},readers:{xsd:{schema:function(E,J){var F=[];var C={};var G={complexTypes:F,customTypes:C};this.readChildNodes(E,G);var H=E.attributes;var L,B;for(var I=0,K=H.length;I<K;++I){L=H[I];B=L.name;if(B.indexOf("xmlns")==0){this.setNamespace(B.split(":")[1]||"",L.value)}else{J[B]=L.value}}J.featureTypes=F;J.targetPrefix=this.namespaceAlias[J.targetNamespace];var M,D;for(var I=0,K=F.length;I<K;++I){M=F[I];D=C[M.typeName];if(C[M.typeName]){M.typeName=D.name}}},complexType:function(C,D){var B={typeName:C.getAttribute("name")};this.readChildNodes(C,B);D.complexTypes.push(B)},complexContent:function(B,C){this.readChildNodes(B,C)},extension:function(B,C){this.readChildNodes(B,C)},sequence:function(B,C){var D={elements:[]};this.readChildNodes(B,D);C.properties=D.elements},element:function(B,D){if(D.elements){var E={};var C=B.attributes;var H;for(var F=0,G=C.length;F<G;++F){H=C[F];E[H.name]=H.value}var I=E.type;if(!I){I={};this.readChildNodes(B,I);E.restriction=I;E.type=I.base}var K=I.base||I;E.localType=K.split(":").pop();D.elements.push(E)}if(D.complexTypes){var I=B.getAttribute("type");var J=I.split(":").pop();D.customTypes[J]={name:B.getAttribute("name"),type:I}}},simpleType:function(B,C){this.readChildNodes(B,C)},restriction:function(B,C){C.base=B.getAttribute("base");this.readRestriction(B,C)}}},readRestriction:function(E,G){var D=E.childNodes;var I,H,F;for(var C=0,B=D.length;C<B;++C){I=D[C];if(I.nodeType==1){H=I.nodeName.split(":").pop();F=I.getAttribute("value");if(!G[H]){G[H]=F}else{if(typeof G[H]=="string"){G[H]=[G[H]]}G[H].push(F)}}}},read:function(C){if(typeof C=="string"){C=OpenLayers.Format.XML.prototype.read.apply(this,[C])}if(C&&C.nodeType==9){C=C.documentElement}var B={};this.readNode(C,B);return B},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:false,interval:0,timer:null,initialize:function(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B])},activate:function(){var B=OpenLayers.Strategy.prototype.activate.call(this);if(B){if(this.layer.visibility===true){this.start()}this.layer.events.on({visibilitychanged:this.reset,scope:this})}return B},deactivate:function(){var B=OpenLayers.Strategy.prototype.deactivate.call(this);if(B){this.stop()}return B},reset:function(){if(this.layer.visibility===true){this.start()}else{this.stop()}},start:function(){if(this.interval&&typeof this.interval==="number"&&this.interval>0){this.timer=window.setInterval(OpenLayers.Function.bind(this.refresh,this),this.interval)}},refresh:function(){if(this.layer&&this.layer.refresh&&typeof this.layer.refresh=="function"){this.layer.refresh({force:this.force})}},stop:function(){if(this.timer!==null){window.clearInterval(this.timer);this.timer=null}},CLASS_NAME:"OpenLayers.Strategy.Refresh"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{autoActivate:true,element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,emptyString:null,lastXy:null,displayProjection:null,initialize:function(B){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){this.map.events.register("mousemove",this,this.redraw);this.map.events.register("mouseout",this,this.reset);this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.map.events.unregister("mousemove",this,this.redraw);this.map.events.unregister("mouseout",this,this.reset);this.element.innerHTML="";return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}return this.div},redraw:function(B){var D;if(B==null){this.reset();return }else{if(this.lastXy==null||Math.abs(B.xy.x-this.lastXy.x)>this.granularity||Math.abs(B.xy.y-this.lastXy.y)>this.granularity){this.lastXy=B.xy;return }D=this.map.getLonLatFromPixel(B.xy);if(!D){return }if(this.displayProjection){D.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=B.xy}var C=this.formatOutput(D);if(C!=this.element.innerHTML){this.element.innerHTML=C}},reset:function(B){if(this.emptyString!=null){this.element.innerHTML=this.emptyString}},formatOutput:function(C){var D=parseInt(this.numDigits);var B=this.prefix+C.lon.toFixed(D)+this.separator+C.lat.toFixed(D)+this.suffix;return B},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,wildcarded:false,srsInBBOX:false,initialize:function(B){B=B||{};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)},read:function(B){OpenLayers.Protocol.prototype.read.apply(this,arguments);B=OpenLayers.Util.applyDefaults(B,this.options);B.params=OpenLayers.Util.applyDefaults(B.params,this.options.params);if(B.filter){B.params=this.filterToParams(B.filter,B.params)}var C=(B.readWithPOST!==undefined)?B.readWithPOST:this.readWithPOST;var D=new OpenLayers.Protocol.Response({requestType:"read"});if(C){D.priv=OpenLayers.Request.POST({url:B.url,callback:this.createCallback(this.handleRead,D,B),data:OpenLayers.Util.getParameterString(B.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{D.priv=OpenLayers.Request.GET({url:B.url,callback:this.createCallback(this.handleRead,D,B),params:B.params,headers:B.headers})}return D},handleRead:function(C,B){this.handleResponse(C,B)},filterToParams:function(E,H){H=H||{};var D=E.CLASS_NAME;var F=D.substring(D.lastIndexOf(".")+1);switch(F){case"Spatial":switch(E.type){case OpenLayers.Filter.Spatial.BBOX:H.bbox=E.value.toArray();if(this.srsInBBOX&&E.projection){H.bbox.push(E.projection.getCode())}break;case OpenLayers.Filter.Spatial.DWITHIN:H.tolerance=E.distance;case OpenLayers.Filter.Spatial.WITHIN:H.lon=E.value.x;H.lat=E.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+E.type)}break;case"Comparison":var I=OpenLayers.Protocol.HTTP.COMP_TYPE_TO_OP_STR[E.type];if(I!==undefined){var G=E.value;if(E.type==OpenLayers.Filter.Comparison.LIKE){G=this.regex2value(G);if(this.wildcarded){G="%"+G+"%"}}H[E.property+"__"+I]=G;H.queryable=H.queryable||[];H.queryable.push(E.property)}else{OpenLayers.Console.warn("Unknown comparison filter type "+E.type)}break;case"Logical":if(E.type===OpenLayers.Filter.Logical.AND){for(var C=0,B=E.filters.length;C<B;C++){H=this.filterToParams(E.filters[C],H)}}else{OpenLayers.Console.warn("Unsupported logical filter type "+E.type)}break;default:OpenLayers.Console.warn("Unknown filter type "+F)}return H},regex2value:function(B){B=B.replace(/%/g,"\\%");B=B.replace(/\\\\\.(\*)?/g,function(D,C){return C?D:"\\\\_"});B=B.replace(/\\\\\.\*/g,"\\\\%");B=B.replace(/(\\)?\.(\*)?/g,function(D,C,E){return C||E?D:"_"});B=B.replace(/(\\)?\.\*/g,function(D,C){return C?D:"%"});B=B.replace(/\\\./g,".");B=B.replace(/(\\)?\\\*/g,function(D,C){return C?D:"*"});return B},create:function(C,B){B=OpenLayers.Util.applyDefaults(B,this.options);var D=new OpenLayers.Protocol.Response({reqFeatures:C,requestType:"create"});D.priv=OpenLayers.Request.POST({url:B.url,callback:this.createCallback(this.handleCreate,D,B),headers:B.headers,data:this.format.write(C)});return D},handleCreate:function(C,B){this.handleResponse(C,B)},update:function(D,C){C=C||{};var B=C.url||D.url||this.options.url+"/"+D.fid;C=OpenLayers.Util.applyDefaults(C,this.options);var E=new OpenLayers.Protocol.Response({reqFeatures:D,requestType:"update"});E.priv=OpenLayers.Request.PUT({url:B,callback:this.createCallback(this.handleUpdate,E,C),headers:C.headers,data:this.format.write(D)});return E},handleUpdate:function(C,B){this.handleResponse(C,B)},"delete":function(D,C){C=C||{};var B=C.url||D.url||this.options.url+"/"+D.fid;C=OpenLayers.Util.applyDefaults(C,this.options);var E=new OpenLayers.Protocol.Response({reqFeatures:D,requestType:"delete"});E.priv=OpenLayers.Request.DELETE({url:B,callback:this.createCallback(this.handleDelete,E,C),headers:C.headers});return E},handleDelete:function(C,B){this.handleResponse(C,B)},handleResponse:function(D,B){var C=D.priv;if(B.callback){if(C.status>=200&&C.status<300){if(D.requestType!="delete"){D.features=this.parseFeatures(C)}D.code=OpenLayers.Protocol.Response.SUCCESS}else{D.code=OpenLayers.Protocol.Response.FAILURE}B.callback.call(B.scope,D)}},parseFeatures:function(B){var C=B.responseXML;if(!C||!C.documentElement){C=B.responseText}if(!C||C.length<=0){return null}return this.format.read(C)},commit:function(C,Q){Q=OpenLayers.Util.applyDefaults(Q,this.options);var E=[],M=0;var K={};K[OpenLayers.State.INSERT]=[];K[OpenLayers.State.UPDATE]=[];K[OpenLayers.State.DELETE]=[];var P,L,D=[];for(var F=0,J=C.length;F<J;++F){P=C[F];L=K[P.state];if(L){L.push(P);D.push(P)}}var H=(K[OpenLayers.State.INSERT].length>0?1:0)+K[OpenLayers.State.UPDATE].length+K[OpenLayers.State.DELETE].length;var O=true;var B=new OpenLayers.Protocol.Response({reqFeatures:D});function I(S){var R=S.features?S.features.length:0;var U=new Array(R);for(var T=0;T<R;++T){U[T]=S.features[T].fid}B.insertIds=U;N.apply(this,[S])}function N(R){this.callUserCallback(R,Q);O=O&&R.success();M++;if(M>=H){if(Q.callback){B.code=O?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;Q.callback.apply(Q.scope,[B])}}}var G=K[OpenLayers.State.INSERT];if(G.length>0){E.push(this.create(G,OpenLayers.Util.applyDefaults({callback:I,scope:this},Q.create)))}G=K[OpenLayers.State.UPDATE];for(var F=G.length-1;F>=0;--F){E.push(this.update(G[F],OpenLayers.Util.applyDefaults({callback:N,scope:this},Q.update)))}G=K[OpenLayers.State.DELETE];for(var F=G.length-1;F>=0;--F){E.push(this["delete"](G[F],OpenLayers.Util.applyDefaults({callback:N,scope:this},Q["delete"])))}return E},abort:function(B){if(B){B.priv.abort()}},callUserCallback:function(D,B){var C=B[D.requestType];if(C&&C.callback){C.callback.call(C.scope,D)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});(function(){var B=OpenLayers.Protocol.HTTP.COMP_TYPE_TO_OP_STR={};B[OpenLayers.Filter.Comparison.EQUAL_TO]="eq";B[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne";B[OpenLayers.Filter.Comparison.LESS_THAN]="lt";B[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte";B[OpenLayers.Filter.Comparison.GREATER_THAN]="gt";B[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte";B[OpenLayers.Filter.Comparison.LIKE]="ilike"})();OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:false,resolution:null,initialize:function(B){OpenLayers.Strategy.prototype.initialize.apply(this,[B])},activate:function(){var B=OpenLayers.Strategy.prototype.activate.call(this);if(B){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return B},deactivate:function(){var B=OpenLayers.Strategy.prototype.deactivate.call(this);if(B){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return B},cacheFeatures:function(C){var B=true;if(!this.clustering){this.clearCache();this.features=C.features;this.cluster();B=false}return B},clearCache:function(){this.features=null},cluster:function(B){if((!B||B.zoomChanged)&&this.features){var D=this.layer.map.getResolution();if(D!=this.resolution||!this.clustersExist()){this.resolution=D;var I=[];var L,C,J;for(var F=0;F<this.features.length;++F){L=this.features[F];if(L.geometry){C=false;for(var E=I.length-1;E>=0;--E){J=I[E];if(this.shouldCluster(J,L)){this.addToCluster(J,L);C=true;break}}if(!C){I.push(this.createCluster(this.features[F]))}}}this.layer.removeAllFeatures();if(I.length>0){if(this.threshold>1){var H=I.slice();I=[];var K;for(var F=0,G=H.length;F<G;++F){K=H[F];if(K.attributes.count<this.threshold){Array.prototype.push.apply(I,K.cluster)}else{I.push(K)}}}this.clustering=true;this.layer.addFeatures(I);this.clustering=false}this.clusters=I}}},clustersExist:function(){var C=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){C=true;for(var B=0;B<this.clusters.length;++B){if(this.clusters[B]!=this.layer.features[B]){C=false;break}}}return C},shouldCluster:function(B,C){var F=B.geometry.getBounds().getCenterLonLat();var D=C.geometry.getBounds().getCenterLonLat();var E=(Math.sqrt(Math.pow((F.lon-D.lon),2)+Math.pow((F.lat-D.lat),2))/this.resolution);return(E<=this.distance)},addToCluster:function(B,C){B.cluster.push(C);B.attributes.count+=1},createCluster:function(D){var C=D.geometry.getBounds().getCenterLonLat();var B=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(C.lon,C.lat),{count:1});B.cluster=[D];return B},CLASS_NAME:"OpenLayers.Strategy.Cluster"});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,maximized:false,initialize:function(B){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[B])},destroy:function(){if(!this.mapDiv){return }if(this.handlers.click){this.handlers.click.destroy()}if(this.handlers.drag){this.handlers.drag.destroy()}this.ovmap&&this.ovmap.viewPortDiv.removeChild(this.extentRectangle);this.extentRectangle=null;if(this.rectEvents){this.rectEvents.destroy();this.rectEvents=null}if(this.ovmap){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 E=this.map.baseLayer.clone();this.layers=[E]}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.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var F=OpenLayers.Util.getImagesLocation();var C=F+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),C,"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 C=F+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),C,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var G=["dblclick","mousedown"];for(var D=0,B=G.length;D<B;D++){OpenLayers.Event.observe(this.maximizeDiv,G[D],OpenLayers.Event.stop);OpenLayers.Event.observe(this.minimizeDiv,G[D],OpenLayers.Event.stop)}this.minimizeControl()}else{this.element.style.display=""}if(this.map.getExtent()){this.update()}this.map.events.register("moveend",this,this.update);if(this.maximized){this.maximizeControl()}return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(J){var E=this.handlers.drag.last.x-J.x;var C=this.handlers.drag.last.y-J.y;if(E!=0||C!=0){var H=this.rectPxBounds.top;var B=this.rectPxBounds.left;var F=Math.abs(this.rectPxBounds.getHeight());var D=this.rectPxBounds.getWidth();var G=Math.max(0,(H-C));G=Math.min(G,this.ovmap.size.h-this.hComp-F);var I=Math.max(0,(B-E));I=Math.min(I,this.ovmap.size.w-this.wComp-D);this.setRectPxBounds(new OpenLayers.Bounds(I,G+F,I+D,G))}},mapDivClick:function(J){var C=this.rectPxBounds.getCenterPixel();var F=J.xy.x-C.x;var E=J.xy.y-C.y;var H=this.rectPxBounds.top;var D=this.rectPxBounds.left;var K=Math.abs(this.rectPxBounds.getHeight());var B=this.rectPxBounds.getWidth();var G=Math.max(0,(H+E));G=Math.min(G,this.ovmap.size.h-K);var I=Math.max(0,(D+F));I=Math.min(I,this.ovmap.size.w-B);this.setRectPxBounds(new OpenLayers.Bounds(I,G+K,I+B,G));this.updateMapToRect()},maximizeControl:function(B){this.element.style.display="";this.showToggle(false);if(B!=null){OpenLayers.Event.stop(B)}},minimizeControl:function(B){this.element.style.display="none";this.showToggle(true);if(B!=null){OpenLayers.Event.stop(B)}},showToggle:function(B){this.maximizeDiv.style.display=B?"":"none";this.minimizeDiv.style.display=B?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var C=this.map.getExtent();var B=this.map.maxExtent;var D=new OpenLayers.Bounds(Math.max(C.left,B.left),Math.max(C.bottom,B.bottom),Math.min(C.right,B.right),Math.min(C.top,B.top));if(this.ovmap.getProjection()!=this.map.getProjection()){D=D.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}var E=this.ovmap.getResolution()/this.map.getResolution();return((E>this.minRatio)&&(E<=this.maxRatio)&&(this.ovmap.getExtent().containsBounds(D)))},updateOverview:function(){var D=this.map.getResolution();var C=this.ovmap.getResolution();var E=C/D;if(E>this.maxRatio){C=this.minRatio*D}else{if(E<=this.minRatio){C=this.maxRatio*D}}var B;if(this.ovmap.getProjection()!=this.map.getProjection()){B=this.map.center.clone();B.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{B=this.map.center}this.ovmap.setCenter(B,this.ovmap.getZoomForResolution(C*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var C=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,C);this.ovmap.viewPortDiv.appendChild(this.extentRectangle);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single: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(E){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(E){if(!this.handlers.drag.dragging){this.handlers.drag.deactivate()}});if(this.ovmap.getProjection()!=this.map.getProjection()){var D=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;var B=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=D&&B?OpenLayers.INCHES_PER_UNIT[D]/OpenLayers.INCHES_PER_UNIT[B]:1}},updateRectToMap:function(){var C;if(this.ovmap.getProjection()!=this.map.getProjection()){C=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{C=this.map.getExtent()}var B=this.getRectBoundsFromMapBounds(C);if(B){this.setRectPxBounds(B)}},updateMapToRect:function(){var B=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){B=B.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(B.getCenterLonLat())},setRectPxBounds:function(E){var H=Math.max(E.top,0);var F=Math.max(E.left,0);var C=Math.min(E.top+Math.abs(E.getHeight()),this.ovmap.size.h-this.hComp);var I=Math.min(E.left+E.getWidth(),this.ovmap.size.w-this.wComp);var D=Math.max(I-F,0);var J=Math.max(C-H,0);if(D<this.minRectSize||J<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var G=F+(D/2)-(this.minRectSize/2);var B=H+(J/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(B)+"px";this.extentRectangle.style.left=Math.round(G)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(H)+"px";this.extentRectangle.style.left=Math.round(F)+"px";this.extentRectangle.style.height=Math.round(J)+"px";this.extentRectangle.style.width=Math.round(D)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(F),Math.round(C),Math.round(I),Math.round(H))},getRectBoundsFromMapBounds:function(E){var B=new OpenLayers.LonLat(E.left,E.bottom);var G=new OpenLayers.LonLat(E.right,E.top);var D=this.getOverviewPxFromLonLat(B);var C=this.getOverviewPxFromLonLat(G);var F=null;if(D&&C){F=new OpenLayers.Bounds(D.x,D.y,C.x,C.y)}return F},getMapBoundsFromRectBounds:function(E){var D=new OpenLayers.Pixel(E.left,E.bottom);var C=new OpenLayers.Pixel(E.right,E.top);var B=this.getLonLatFromOverviewPx(D);var F=this.getLonLatFromOverviewPx(C);return new OpenLayers.Bounds(B.lon,B.lat,F.lon,F.lat)},getLonLatFromOverviewPx:function(G){var D=this.ovmap.size;var C=this.ovmap.getResolution();var B=this.ovmap.getExtent().getCenterLonLat();var F=G.x-(D.w/2);var E=G.y-(D.h/2);return new OpenLayers.LonLat(B.lon+F*C,B.lat-E*C)},getOverviewPxFromLonLat:function(E){var C=this.ovmap.getResolution();var D=this.ovmap.getExtent();var B=null;if(D){B=new OpenLayers.Pixel(Math.round(1/C*(E.lon-D.left)),Math.round(1/C*(D.top-E.lat)))}return B},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{initialize:function(B){OpenLayers.Format.WFSCapabilities.v1.prototype.initialize.apply(this,[B])},read_cap_Service:function(C,D){var B={};this.runChildNodes(B,D);C.service=B},read_cap_Fees:function(B,D){var C=this.getChildValue(D);if(C&&C.toLowerCase()!="none"){B.fees=C}},read_cap_AccessConstraints:function(B,C){var D=this.getChildValue(C);if(D&&D.toLowerCase()!="none"){B.accessConstraints=D}},read_cap_OnlineResource:function(B,D){var C=this.getChildValue(D);if(C&&C.toLowerCase()!="none"){B.onlineResource=C}},read_cap_Keywords:function(B,D){var C=this.getChildValue(D);if(C&&C.toLowerCase()!="none"){B.keywords=C.split(", ")}},read_cap_Capability:function(B,D){var C={};this.runChildNodes(C,D);B.capability=C},read_cap_Request:function(D,C){var B={};this.runChildNodes(B,C);D.request=B},read_cap_GetFeature:function(C,B){var D={href:{},formats:[]};this.runChildNodes(D,B);C.getfeature=D},read_cap_ResultFormat:function(F,E){var D=E.childNodes;var C;for(var B=0;B<D.length;B++){C=D[B];if(C.nodeType==1){F.formats.push(C.nodeName)}}},read_cap_DCPType:function(C,B){this.runChildNodes(C,B)},read_cap_HTTP:function(C,B){this.runChildNodes(C.href,B)},read_cap_Get:function(C,B){C.get=B.getAttribute("onlineResource")},read_cap_Post:function(C,B){C.post=B.getAttribute("onlineResource")},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"});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,wrapDateLine:true,sphericalMercator:false,initialize:function(C,B){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 B=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject=new YMap(this.div,this.type,B);this.mapObject.disableKeyControls();this.mapObject.disableDragMap();if(!this.mapObject.moveByXY||(typeof this.mapObject.moveByXY!="function")){this.dragPanMapObject=null}}catch(C){}},onMapResize:function(){try{var B=this.getMapObjectSizeFromOLSize(this.map.getSize());this.mapObject.resizeTo(B)}catch(C){}},setMap:function(B){OpenLayers.Layer.EventPane.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.fixYahooEventPane)},fixYahooEventPane:function(){var B=OpenLayers.Util.getElement("ygddfdiv");if(B!=null){if(B.parentNode!=null){B.parentNode.removeChild(B)}this.map.events.unregister("moveend",this,this.fixYahooEventPane)}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"Yahoo",layerLib:"Yahoo"})},getOLZoomFromMapObjectZoom:function(B){var C=null;if(B!=null){C=OpenLayers.Layer.FixedZoomLevels.prototype.getOLZoomFromMapObjectZoom.apply(this,[B]);C=18-C}return C},getMapObjectZoomFromOLZoom:function(B){var C=null;if(B!=null){C=OpenLayers.Layer.FixedZoomLevels.prototype.getMapObjectZoomFromOLZoom.apply(this,[B]);C=18-C}return C},setMapObjectCenter:function(B,C){this.mapObject.drawZoomAndCenter(B,C)},getMapObjectCenter:function(){return this.mapObject.getCenterLatLon()},dragPanMapObject:function(C,B){this.mapObject.moveByXY({x:-C,y:B})},getMapObjectZoom:function(){return this.mapObject.getZoomLevel()},getMapObjectLonLatFromMapObjectPixel:function(B){return this.mapObject.convertXYLatLon(B)},getMapObjectPixelFromMapObjectLonLat:function(B){return this.mapObject.convertLatLonXY(B)},getLongitudeFromMapObjectLonLat:function(B){return this.sphericalMercator?this.forwardMercator(B.Lon,B.Lat).lon:B.Lon},getLatitudeFromMapObjectLonLat:function(B){return this.sphericalMercator?this.forwardMercator(B.Lon,B.Lat).lat:B.Lat},getMapObjectLonLatFromLonLat:function(E,D){var B;if(this.sphericalMercator){var C=this.inverseMercator(E,D);B=new YGeoPoint(C.lat,C.lon)}else{B=new YGeoPoint(D,E)}return B},getXFromMapObjectPixel:function(B){return B.x},getYFromMapObjectPixel:function(B){return B.y},getMapObjectPixelFromXY:function(B,C){return new YCoordPoint(B,C)},getMapObjectSizeFromOLSize:function(B){return new YSize(B.w,B.h)},CLASS_NAME:"OpenLayers.Layer.Yahoo"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(E,D,F,C){var B=[];B.push(E,D,F,C);OpenLayers.Layer.Grid.prototype.initialize.apply(this,B);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(C==null||C.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(B){if(B==null){B=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())}B=OpenLayers.Layer.Grid.prototype.clone.apply(this,[B]);return B},addTile:function(C,B){return new OpenLayers.Tile.Image(this,B,C,null,this.tileSize)},getURL:function(D){D=this.adjustBounds(D);var C=[D.left,D.bottom,D.right,D.top];var E=this.getImageSize();var B=this.getFullRequestString({mapext:C,imgext:C,map_size:[E.w,E.h],imgx:E.w/2,imgy:E.h/2,imgxy:[E.w,E.h]});return B},getFullRequestString:function(G,F){var C=(F==null)?this.url:F;var H=OpenLayers.Util.extend({},this.params);H=OpenLayers.Util.extend(H,G);var B=OpenLayers.Util.getParameterString(H);if(C instanceof Array){C=this.selectUrl(B,C)}var E=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(C));for(var I in H){if(I.toUpperCase() in E){delete H[I]}}B=OpenLayers.Util.getParameterString(H);var J=C;B=B.replace(/,/g,"+");if(B!=""){var D=C.charAt(C.length-1);if((D=="&")||(D=="?")){J+=B}else{if(C.indexOf("?")==-1){J+="?"+B}else{J+="&"+B}}}return J},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(C){if(!this.supported()){return }if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var F=document.createStyleSheet();var D=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var E=0,B=D.length;E<B;E++){F.addRule("olv\\:"+D[E],"behavior: url(#default#VML); position: absolute; display: inline-block;")}}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){return !!(document.namespaces)},setExtent:function(J,B){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var D=this.getResolution();var C=(J.left/D)|0;var G=(J.top/D-this.size.h)|0;if(B||!this.offset){this.offset={x:C,y:G};C=0;G=0}else{C=C-this.offset.x;G=G-this.offset.y}var L=C+" "+G;this.root.coordorigin=L;var I=[this.root,this.vectorRoot,this.textRoot];var H;for(var E=0,F=I.length;E<F;++E){H=I[E];var K=this.size.w+" "+this.size.h;H.coordsize=K}this.root.style.flip="y";return true},setSize:function(G){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var E=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var D=this.size.w+"px";var H=this.size.h+"px";var C;for(var F=0,B=E.length;F<B;++F){C=E[F];C.style.width=D;C.style.height=H}},getNodeType:function(D,C){var B=null;switch(D.CLASS_NAME){case"OpenLayers.Geometry.Point":if(C.externalGraphic){B="olv:rect"}else{if(this.isComplexSymbol(C.graphicName)){B="olv:shape"}else{B="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":B="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":B="olv:shape";break;default:break}return B},setStyle:function(F,C,R,L){C=C||F._style;R=R||F._options;var D=C.fillColor;if(F._geometryClass==="OpenLayers.Geometry.Point"){if(C.externalGraphic){R.isFilled=true;if(C.graphicTitle){F.title=C.graphicTitle}var E=C.graphicWidth||C.graphicHeight;var M=C.graphicHeight||C.graphicWidth;E=E?E:C.pointRadius*2;M=M?M:C.pointRadius*2;var H=this.getResolution();var J=(C.graphicXOffset!=undefined)?C.graphicXOffset:-(0.5*E);var G=(C.graphicYOffset!=undefined)?C.graphicYOffset:-(0.5*M);F.style.left=(((L.x/H-this.offset.x)+J)|0)+"px";F.style.top=(((L.y/H-this.offset.y)-(G+M))|0)+"px";F.style.width=E+"px";F.style.height=M+"px";F.style.flip="y";D="none";R.isStroked=false}else{if(this.isComplexSymbol(C.graphicName)){var B=this.importSymbol(C.graphicName);F.path=B.path;F.coordorigin=B.left+","+B.bottom;var Q=B.size;F.coordsize=Q+","+Q;this.drawCircle(F,L,C.pointRadius);F.style.flip="y"}else{this.drawCircle(F,L,C.pointRadius)}}}if(R.isFilled){F.fillcolor=D}else{F.filled="false"}var K=F.getElementsByTagName("fill");var P=(K.length==0)?null:K[0];if(!R.isFilled){if(P){F.removeChild(P)}}else{if(!P){P=this.createNode("olv:fill",F.id+"_fill")}P.opacity=C.fillOpacity;if(F._geometryClass==="OpenLayers.Geometry.Point"&&C.externalGraphic){if(C.graphicOpacity){P.opacity=C.graphicOpacity}P.src=C.externalGraphic;P.type="frame";if(!(C.graphicWidth&&C.graphicHeight)){P.aspect="atmost"}}if(P.parentNode!=F){F.appendChild(P)}}var O=C.rotation;if((O!==undefined||F._rotation!==undefined)){F._rotation=O;if(C.externalGraphic){this.graphicRotate(F,J,G,C);P.opacity=0}else{if(F._geometryClass==="OpenLayers.Geometry.Point"){F.style.rotation=O||0}}}var I=F.getElementsByTagName("stroke");var N=(I.length==0)?null:I[0];if(!R.isStroked){F.stroked=false;if(N){N.on=false}}else{if(!N){N=this.createNode("olv:stroke",F.id+"_stroke");F.appendChild(N)}N.on=true;N.color=C.strokeColor;N.weight=C.strokeWidth+"px";N.opacity=C.strokeOpacity;N.endcap=C.strokeLinecap=="butt"?"flat":(C.strokeLinecap||"round");if(C.strokeDashstyle){N.dashstyle=this.dashStyle(C)}}if(C.cursor!="inherit"&&C.cursor!=null){F.style.cursor=C.cursor}return F},graphicRotate:function(O,S,F,R){var R=R||O._style;var P=R.rotation||0;var B,K;if(!(R.graphicWidth&&R.graphicHeight)){var T=new Image();T.onreadystatechange=OpenLayers.Function.bind(function(){if(T.readyState=="complete"||T.readyState=="interactive"){B=T.width/T.height;K=Math.max(R.pointRadius*2,R.graphicWidth||0,R.graphicHeight||0);S=S*B;R.graphicWidth=K*B;R.graphicHeight=K;this.graphicRotate(O,S,F,R)}},this);T.src=R.externalGraphic;return }else{K=Math.max(R.graphicWidth,R.graphicHeight);B=R.graphicWidth/R.graphicHeight}var N=Math.round(R.graphicWidth||K*B);var L=Math.round(R.graphicHeight||K);O.style.width=N+"px";O.style.height=L+"px";var M=document.getElementById(O.id+"_image");if(!M){M=this.createNode("olv:imagedata",O.id+"_image");O.appendChild(M)}M.style.width=N+"px";M.style.height=L+"px";M.src=R.externalGraphic;M.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var G=P*Math.PI/180;var I=Math.sin(G);var E=Math.cos(G);var H="progid:DXImageTransform.Microsoft.Matrix(M11="+E+",M12="+(-I)+",M21="+I+",M22="+E+",SizingMethod='auto expand')\n";var C=R.graphicOpacity||R.fillOpacity;if(C&&C!=1){H+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+C+")\n"}O.style.filter=H;var Q=new OpenLayers.Geometry.Point(-S,-F);var D=new OpenLayers.Bounds(0,0,N,L).toGeometry();D.rotate(R.rotation,Q);var J=D.getBounds();O.style.left=Math.round(parseInt(O.style.left)+J.left)+"px";O.style.top=Math.round(parseInt(O.style.top)-J.bottom)+"px"},postDraw:function(B){B.style.visibility="visible";var D=B._style.fillColor;var C=B._style.strokeColor;if(D=="none"&&B.fillcolor!=D){B.fillcolor=D}if(C=="none"&&B.strokecolor!=C){B.strokecolor=C}},setNodeDimension:function(C,F){var E=F.getBounds();if(E){var B=this.getResolution();var D=new OpenLayers.Bounds((E.left/B-this.offset.x)|0,(E.bottom/B-this.offset.y)|0,(E.right/B-this.offset.x)|0,(E.top/B-this.offset.y)|0);C.style.left=D.left+"px";C.style.top=D.top+"px";C.style.width=D.getWidth()+"px";C.style.height=D.getHeight()+"px";C.coordorigin=D.left+" "+D.top;C.coordsize=D.getWidth()+" "+D.getHeight()}},dashStyle:function(B){var D=B.strokeDashstyle;switch(D){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return D;default:var C=D.split(/[ ,]/);if(C.length==2){if(1*C[0]>=2*C[1]){return"longdash"}return(C[0]==1||C[1]==1)?"dot":"dash"}else{if(C.length==4){return(1*C[0]>=2*C[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(B,D){var C=document.createElement(B);if(D){C.id=D}C.unselectable="on";C.onselectstart=OpenLayers.Function.False;return C},nodeTypeCompare:function(D,C){var E=C;var B=E.indexOf(":");if(B!=-1){E=E.substr(B+1)}var F=D.nodeName;B=F.indexOf(":");if(B!=-1){F=F.substr(B+1)}return(E==F)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(B){return this.nodeFactory(this.container.id+B,"olv:group")},drawPoint:function(B,C){return this.drawCircle(B,C,1)},drawCircle:function(E,F,B){if(!isNaN(F.x)&&!isNaN(F.y)){var C=this.getResolution();E.style.left=(((F.x/C-this.offset.x)|0)-B)+"px";E.style.top=(((F.y/C-this.offset.y)|0)-B)+"px";var D=B*2;E.style.width=D+"px";E.style.height=D+"px";return E}return false},drawLineString:function(B,C){return this.drawLine(B,C,false)},drawLinearRing:function(B,C){return this.drawLine(B,C,true)},drawLine:function(C,K,H){this.setNodeDimension(C,K);var D=this.getResolution();var B=K.components.length;var F=new Array(B);var I,L,J;for(var G=0;G<B;G++){I=K.components[G];L=(I.x/D-this.offset.x)|0;J=(I.y/D-this.offset.y)|0;F[G]=" "+L+","+J+" l "}var E=(H)?" x e":" e";C.path="m"+F.join("")+E;return C},drawPolygon:function(D,L){this.setNodeDimension(D,L);var E=this.getResolution();var Q=[];var F,J,N,B,H,C,G,P,I,O,M,K;for(F=0,J=L.components.length;F<J;F++){Q.push("m");N=L.components[F].components;B=(F===0);H=null;C=null;for(G=0,P=N.length;G<P;G++){I=N[G];M=(I.x/E-this.offset.x)|0;K=(I.y/E-this.offset.y)|0;O=" "+M+","+K;Q.push(O);if(G==0){Q.push(" l")}if(!B){if(!H){H=O}else{if(H!=O){if(!C){C=O}else{if(C!=O){B=true}}}}}}Q.push(B?" x ":" ")}Q.push("e");D.path=Q.join("");return D},drawRectangle:function(C,D){var B=this.getResolution();C.style.left=((D.x/B-this.offset.x)|0)+"px";C.style.top=((D.y/B-this.offset.y)|0)+"px";C.style.width=((D.width/B)|0)+"px";C.style.height=((D.height/B)|0)+"px";return C},drawText:function(E,B,I){var H=this.nodeFactory(E+this.LABEL_ID_SUFFIX,"olv:rect");var G=this.nodeFactory(E+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox");var D=this.getResolution();H.style.left=((I.x/D-this.offset.x)|0)+"px";H.style.top=((I.y/D-this.offset.y)|0)+"px";H.style.flip="y";G.innerText=B.label;if(B.fontColor){G.style.color=B.fontColor}if(B.fontOpacity){G.style.filter="alpha(opacity="+(B.fontOpacity*100)+")"}if(B.fontFamily){G.style.fontFamily=B.fontFamily}if(B.fontSize){G.style.fontSize=B.fontSize}if(B.fontWeight){G.style.fontWeight=B.fontWeight}if(B.labelSelect===true){H._featureId=E;G._featureId=E;G._geometry=I;G._geometryClass=I.CLASS_NAME}G.style.whiteSpace="nowrap";G.inset="1px,0px,0px,0px";if(!H.parentNode){H.appendChild(G);this.textRoot.appendChild(H)}var F=B.labelAlign||"cm";if(F.length==1){F+="m"}var J=G.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[F.substr(0,1)]);var C=G.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[F.substr(1,1)]);H.style.left=parseInt(H.style.left)-J-1+"px";H.style.top=parseInt(H.style.top)+C+"px"},drawSurface:function(B,H){this.setNodeDimension(B,H);var C=this.getResolution();var J=[];var E,I,G;for(var D=0,F=H.components.length;D<F;D++){E=H.components[D];I=(E.x/C-this.offset.x)|0;G=(E.y/C-this.offset.y)|0;if((D%3)==0&&(D/3)==0){J.push("m")}else{if((D%3)==1){J.push(" c")}}J.push(" "+I+","+G)}J.push(" x e");B.path=J.join("");return B},moveRoot:function(C){var B=this.map.getLayer(C.container.id);if(B instanceof OpenLayers.Layer.Vector.RootContainer){B=this.map.getLayer(this.container.id)}B&&B.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);B&&B.redraw()},importSymbol:function(E){var C=this.container.id+"-"+E;var B=this.symbolCache[C];if(B){return B}var D=OpenLayers.Renderer.symbol[E];if(!D){throw new Error(E+" is not a valid symbol name")}var K=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var F=["m"];for(var G=0;G<D.length;G=G+2){var I=D[G];var H=D[G+1];K.left=Math.min(K.left,I);K.bottom=Math.min(K.bottom,H);K.right=Math.max(K.right,I);K.top=Math.max(K.top,H);F.push(I);F.push(H);if(G==0){F.push("l")}}F.push("x e");var L=F.join(" ");var J=(K.getWidth()-K.getHeight())/2;if(J>0){K.bottom=K.bottom-J;K.top=K.top+J}else{K.left=K.left+J;K.right=K.right-J}B={path:L,size:K.getWidth(),left:K.left,bottom:K.bottom};this.symbolCache[C]=B;return B},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.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_0_0"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",layerOptions:null,persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(D,C,B){if(!(B&&B.layerOptions&&B.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,[D,C,B]);this.options=(B)?B:{}},setOptions:function(B){OpenLayers.Util.extend(this.options,B);OpenLayers.Util.extend(this,B)},activate:function(){var B=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var C=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:OpenLayers.Function.True},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,C);this.map.addLayer(this.layer);B=true}return B},deactivate:function(){var B=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;B=true}return B},down:function(B){this.fixedRadius=!!(this.radius);var C=this.map.getLonLatFromPixel(B.xy);this.origin=new OpenLayers.Geometry.Point(C.lon,C.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(D){var G=this.map.getLonLatFromPixel(D.xy);var B=new OpenLayers.Geometry.Point(G.lon,G.lat);if(this.irregular){var H=Math.sqrt(2)*Math.abs(B.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,H)}else{if(this.fixedRadius){this.origin=B}else{this.calculateAngle(B,D);this.radius=Math.max(this.map.getResolution()/2,B.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var E=B.x-this.origin.x;var C=B.y-this.origin.y;var F;if(C==0){F=E/(this.radius*Math.sqrt(2))}else{F=E/C}this.feature.geometry.resize(1,this.origin,F);this.feature.geometry.move(E/2,C/2)}this.layer.drawFeature(this.feature,this.style)},up:function(B){this.finalize();if(this.start==this.last){this.callback("done",[B.xy])}},out:function(B){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 E,B;var C=this.feature.geometry.components[0];if(C.components.length!=(this.sides+1)){this.createGeometry();C=this.feature.geometry.components[0]}for(var D=0;D<this.sides;++D){B=C.components[D];E=this.angle+(D*2*Math.PI/this.sides);B.x=this.origin.x+(this.radius*Math.cos(E));B.y=this.origin.y+(this.radius*Math.sin(E));B.clearBounds()}},calculateAngle:function(B,C){var E=Math.atan2(B.y-this.origin.y,B.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!C[this.snapToggle])){var D=(Math.PI/180)*this.snapAngle;this.angle=Math.round(E/D)*D}else{this.angle=E}},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){if(this.layer){this.layer.renderer.clear();this.layer.destroyFeatures()}},callback:function(C,B){if(this.callbacks[C]){this.callbacks[C].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(C=="done"||C=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});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(E,C,D,B){OpenLayers.Handler.prototype.initialize.apply(this,[E,D,B]);this.layer=C},mousedown:function(B){this.down=B.xy;return this.handle(B)?!this.stopDown:true},mouseup:function(B){this.up=B.xy;return this.handle(B)?!this.stopUp:true},click:function(B){return this.handle(B)?!this.stopClick:true},mousemove:function(B){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(B);return true},dblclick:function(B){return !this.handle(B)},geometryTypeMatches:function(B){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,B.geometry.CLASS_NAME)>-1},handle:function(B){if(this.feature&&!this.feature.layer){this.feature=null}var D=B.type;var G=false;var F=!!(this.feature);var E=(D=="click"||D=="dblclick");this.feature=this.layer.getFeatureFromEvent(B);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var C=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(F&&C){if(this.lastFeature){this.triggerCallback(D,"out",[this.lastFeature])}this.triggerCallback(D,"in",[this.feature])}else{if(!F||E){this.triggerCallback(D,"in",[this.feature])}}this.lastFeature=this.feature;G=true}else{if(this.lastFeature&&(F&&C||E)){this.triggerCallback(D,"out",[this.lastFeature])}this.feature=null}}else{if(this.lastFeature&&(F||E)){this.triggerCallback(D,"out",[this.lastFeature])}}return G},triggerCallback:function(E,F,C){var D=this.EVENTMAP[E][F];if(D){if(E=="click"&&this.up&&this.down){var B=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(B<=this.clickTolerance){this.callback(D,C)}}else{this.callback(D,C)}}},activate:function(){var B=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});B=true}return B},deactivate:function(){var B=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});B=true}return B},handleMapEvents:function(B){if(!B.property||B.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var B=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(B)},moveLayerBack:function(){var B=this.layer.getZIndex()-1;if(B>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(B)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",initialize:function(B){OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this,arguments);if(this.outputFormat&&!this.readFormat){if(this.outputFormat.toLowerCase()=="gml2"){this.readFormat=new OpenLayers.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName})}else{if(this.outputFormat.toLowerCase()=="json"){this.readFormat=new OpenLayers.Format.GeoJSON()}}}},CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"});OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(B){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(F){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var D=0,B=this.map.controls.length;D<B;D++){var E=this.map.controls[D];if((E!=this)&&(E.CLASS_NAME=="OpenLayers.Control.ArgParser")){if(E.displayProjection!=this.displayProjection){this.displayProjection=E.displayProjection}break}}if(D==this.map.controls.length){var C=OpenLayers.Util.getParameters();if(C.layers){this.layers=C.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(C.lat&&C.lon){this.center=new OpenLayers.LonLat(parseFloat(C.lon),parseFloat(C.lat));if(C.zoom){this.zoom=parseInt(C.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var D=0,B=this.layers.length;D<B;D++){var C=this.map.layers[D];var E=this.layers.charAt(D);if(E=="B"){this.map.setBaseLayer(C)}else{if((E=="T")||(E=="F")){C.setVisibility(E=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});var MooTools={version:"1.2.2",build:"f0491d62fbb7e906789aa3733d6a67d43e5af7c9"};var Native=function(L){L=L||{};var B=L.name;var J=L.legacy;var C=L.protect;var D=L.implement;var I=L.generics;var G=L.initialize;var H=L.afterImplement||function(){};var E=G||J;I=I!==false;E.constructor=Native;E.$family={name:"native"};if(J&&G){E.prototype=J.prototype}E.prototype.constructor=E;if(B){var F=B.toLowerCase();E.prototype.$family={name:F};Native.typize(E,F)}var K=function(O,M,P,N){if(!C||N||!O.prototype[M]){O.prototype[M]=P}if(I){Native.genericize(O,M,C)}H.call(O,M,P);return O};E.alias=function(O,M,P){if(typeof O=="string"){if((O=this.prototype[O])){return K(this,M,O,P)}}for(var N in O){this.alias(N,O[N],M)}return this};E.implement=function(N,M,P){if(typeof N=="string"){return K(this,N,M,P)}for(var O in N){K(this,O,N[O],M)}return this};if(D){E.implement(D)}return E};Native.genericize=function(C,D,B){if((!B||!C[D])&&typeof C.prototype[D]=="function"){C[D]=function(){var E=Array.prototype.slice.call(arguments);return C.prototype[D].apply(E.shift(),E)}}};Native.implement=function(E,D){for(var C=0,B=E.length;C<B;C++){E[C].implement(D)}};Native.typize=function(B,C){if(!B.type){B.type=function(D){return($type(D)===C)}}};(function(){var B={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var H in B){new Native({name:H,initialize:B[H],protect:true})}var E={"boolean":Boolean,"native":Native,object:Object};for(var D in E){Native.typize(E[D],D)}var G={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 F in G){for(var C=G[F].length;C--;){Native.genericize(window[F],G[F][C],true)}}})();var Hash=new Native({name:"Hash",initialize:function(B){if($type(B)=="hash"){B=$unlink(B.getClean())}for(var C in B){this[C]=B[C]}return this}});Hash.implement({forEach:function(C,D){for(var B in this){if(this.hasOwnProperty(B)){C.call(D,this[B],B,this)}}},getClean:function(){var C={};for(var B in this){if(this.hasOwnProperty(B)){C[B]=this[B]}}return C},getLength:function(){var C=0;for(var B in this){if(this.hasOwnProperty(B)){C++}}return C}});Hash.alias("forEach","each");Array.implement({forEach:function(D,E){for(var C=0,B=this.length;C<B;C++){D.call(E,this[C],C,this)}}});Array.alias("forEach","each");function $A(C){if(C.item){var B=C.length,D=new Array(B);while(B--){D[B]=C[B]}return D}return Array.prototype.slice.call(C)}function $arguments(B){return function(){return arguments[B]}}function $chk(B){return !!(B||B===0)}function $clear(B){clearTimeout(B);clearInterval(B);return null}function $defined(B){return(B!=undefined)}function $each(D,C,E){var B=$type(D);((B=="arguments"||B=="collection"||B=="array")?Array:Hash).each(D,C,E)}function $empty(){}function $extend(D,B){for(var C in (B||{})){D[C]=B[C]}return D}function $H(B){return new Hash(B)}function $lambda(B){return(typeof B=="function")?B:function(){return B}}function $merge(){var B=Array.slice(arguments);B.unshift({});return $mixin.apply(null,B)}function $mixin(F){for(var E=1,B=arguments.length;E<B;E++){var C=arguments[E];if($type(C)!="object"){continue}for(var D in C){var H=C[D],G=F[D];F[D]=(G&&$type(H)=="object"&&$type(G)=="object")?$mixin(G,H):$unlink(H)}}return F}function $pick(){for(var C=0,B=arguments.length;C<B;C++){if(arguments[C]!=undefined){return arguments[C]}}return null}function $random(C,B){return Math.floor(Math.random()*(B-C+1)+C)}function $splat(C){var B=$type(C);return(B)?((B!="array"&&B!="arguments")?[C]:C):[]}var $time=Date.now||function(){return +new Date};function $try(){for(var C=0,B=arguments.length;C<B;C++){try{return arguments[C]()}catch(D){}}return null}function $type(B){if(B==undefined){return false}if(B.$family){return(B.$family.name=="number"&&!isFinite(B))?false:B.$family.name}if(B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace"}}else{if(typeof B.length=="number"){if(B.callee){return"arguments"}else{if(B.item){return"collection"}}}}return typeof B}function $unlink(D){var C;switch($type(D)){case"object":C={};for(var F in D){C[F]=$unlink(D[F])}break;case"hash":C=new Hash(D);break;case"array":C=[];for(var E=0,B=D.length;E<B;E++){C[E]=$unlink(D[E])}break;default:return D}return C}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 C in this.Engines){var B=this.Engines[C]();if(B){this.Engine={name:C,version:B};this.Engine[C]=this.Engine[C+B]=true;break}}return{name:C,version:B}};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 B=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(B[0]||0+"."+B[1],10)||0,build:parseInt(B[2],10)||0}})();function $exec(C){if(!C){return C}if(window.execScript){window.execScript(C)}else{var B=document.createElement("script");B.setAttribute("type","text/javascript");B[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=C;document.head.appendChild(B);document.head.removeChild(B)}return C}Native.UID=1;var $uid=(Browser.Engine.trident)?function(B){return(B.uid||(B.uid=[Native.UID++]))[0]}:function(B){return B.uid||(B.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(B){$uid(B);if(!B.Element){B.Element=$empty;if(Browser.Engine.webkit){B.document.createElement("iframe")}B.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}B.document.window=B;return $extend(B,Window.Prototype)},afterImplement:function(C,B){window[C]=Window.Prototype[C]=B}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(B){$uid(B);B.head=B.getElementsByTagName("head")[0];B.html=B.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){B.execCommand("BackgroundImageCache",false,true)})}if(Browser.Engine.trident){B.window.attachEvent("onunload",function(){B.window.detachEvent("onunload",arguments.callee);B.head=B.html=B.window=null})}return $extend(B,Document.Prototype)},afterImplement:function(C,B){document[C]=Document.Prototype[C]=B}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(D,E){for(var C=0,B=this.length;C<B;C++){if(!D.call(E,this[C],C,this)){return false}}return true},filter:function(E,F){var D=[];for(var C=0,B=this.length;C<B;C++){if(E.call(F,this[C],C,this)){D.push(this[C])}}return D},clean:function(){return this.filter($defined)},indexOf:function(D,E){var B=this.length;for(var C=(E<0)?Math.max(0,B+E):E||0;C<B;C++){if(this[C]===D){return C}}return -1},map:function(E,F){var D=[];for(var C=0,B=this.length;C<B;C++){D[C]=E.call(F,this[C],C,this)}return D},some:function(D,E){for(var C=0,B=this.length;C<B;C++){if(D.call(E,this[C],C,this)){return true}}return false},associate:function(D){var E={},C=Math.min(this.length,D.length);for(var B=0;B<C;B++){E[D[B]]=this[B]}return E},link:function(D){var B={};for(var F=0,C=this.length;F<C;F++){for(var E in D){if(D[E](this[F])){B[E]=this[F];delete D[E];break}}}return B},contains:function(B,C){return this.indexOf(B,C)!=-1},extend:function(D){for(var C=0,B=D.length;C<B;C++){this.push(D[C])}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(B){if(!this.contains(B)){this.push(B)}return this},combine:function(D){for(var C=0,B=D.length;C<B;C++){this.include(D[C])}return this},erase:function(C){for(var B=this.length;B--;B){if(this[B]===C){this.splice(B,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var E=[];for(var C=0,B=this.length;C<B;C++){var D=$type(this[C]);if(!D){continue}E=E.concat((D=="array"||D=="collection"||D=="arguments")?Array.flatten(this[C]):this[C])}return E},hexToRgb:function(C){if(this.length!=3){return null}var B=this.map(function(D){if(D.length==1){D+=D}return D.toInt(16)});return(C)?B:"rgb("+B+")"},rgbToHex:function(E){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!E){return"transparent"}var C=[];for(var B=0;B<3;B++){var D=(this[B]-0).toString(16);C.push((D.length==1)?"0"+D:D)}return(E)?C:"#"+C.join("")}});Function.implement({extend:function(B){for(var C in B){this[C]=B[C]}return this},create:function(C){var B=this;C=C||{};return function(E){var D=C.arguments;D=(D!=undefined)?$splat(D):Array.slice(arguments,(C.event)?1:0);if(C.event){D=[E||window.event].extend(D)}var F=function(){return B.apply(C.bind||null,D)};if(C.delay){return setTimeout(F,C.delay)}if(C.periodical){return setInterval(F,C.periodical)}if(C.attempt){return $try(F)}return F()}},run:function(B,C){return this.apply(C,$splat(B))},pass:function(B,C){return this.create({bind:C,arguments:B})},bind:function(C,B){return this.create({bind:C,arguments:B})},bindWithEvent:function(C,B){return this.create({bind:C,arguments:B,event:true})},attempt:function(B,C){return this.create({bind:C,arguments:B,attempt:true})()},delay:function(C,D,B){return this.create({bind:D,arguments:B,delay:C})()},periodical:function(D,C,B){return this.create({bind:C,arguments:B,periodical:D})()}});Number.implement({limit:function(C,B){return Math.min(B,Math.max(C,this))},round:function(B){B=Math.pow(10,B||0);return Math.round(this*B)/B},times:function(C,D){for(var B=0;B<this;B++){C.call(D,B,this)}},toFloat:function(){return parseFloat(this)},toInt:function(B){return parseInt(this,B||10)}});Number.alias("times","each");(function(C){var B={};C.each(function(D){if(!Number[D]){B[D]=function(){return Math[D].apply(null,[this].concat($A(arguments)))}}});Number.implement(B)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(B,C){return((typeof B=="string")?new RegExp(B,C):B).test(this)},contains:function(B,C){return(C)?(C+this+C).indexOf(C+B+C)>-1:this.indexOf(B)>-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(B){return B.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(B){return("-"+B.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(B){return B.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(B){return parseInt(this,B||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(C){var B=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(B)?B.slice(1).hexToRgb(C):null},rgbToHex:function(C){var B=this.match(/\d{1,3}/g);return(B)?B.rgbToHex(C):null},stripScripts:function(C){var B="";var D=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){B+=arguments[1]+"\n";return""});if(C===true){$exec(B)}else{if($type(C)=="function"){C(B,D)}}return D},substitute:function(B,C){return this.replace(C||(/\\?\{([^{}]+)\}/g),function(E,D){if(E.charAt(0)=="\\"){return E.slice(1)}return(B[D]!=undefined)?B[D]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(C){for(var B in this){if(this.hasOwnProperty(B)&&this[B]===C){return B}}return null},hasValue:function(B){return(Hash.keyOf(this,B)!==null)},extend:function(B){Hash.each(B,function(D,C){Hash.set(this,C,D)},this);return this},combine:function(B){Hash.each(B,function(D,C){Hash.include(this,C,D)},this);return this},erase:function(B){if(this.hasOwnProperty(B)){delete this[B]}return this},get:function(B){return(this.hasOwnProperty(B))?this[B]:null},set:function(B,C){if(!this[B]||this.hasOwnProperty(B)){this[B]=C}return this},empty:function(){Hash.each(this,function(C,B){delete this[B]},this);return this},include:function(B,C){if(this[B]==undefined){this[B]=C}return this},map:function(C,D){var B=new Hash;Hash.each(this,function(F,E){B.set(E,C.call(D,F,E,this))},this);return B},filter:function(C,D){var B=new Hash;Hash.each(this,function(F,E){if(C.call(D,F,E,this)){B.set(E,F)}},this);return B},every:function(C,D){for(var B in this){if(this.hasOwnProperty(B)&&!C.call(D,this[B],B)){return false}}return true},some:function(C,D){for(var B in this){if(this.hasOwnProperty(B)&&C.call(D,this[B],B)){return true}}return false},getKeys:function(){var B=[];Hash.each(this,function(D,C){B.push(C)});return B},getValues:function(){var B=[];Hash.each(this,function(C){B.push(C)});return B},toQueryString:function(B){var C=[];Hash.each(this,function(G,F){if(B){F=B+"["+F+"]"}var E;switch($type(G)){case"object":E=Hash.toQueryString(G,F);break;case"array":var D={};G.each(function(I,H){D[H]=I});E=Hash.toQueryString(D,F);break;default:E=F+"="+encodeURIComponent(G)}if(G!=undefined){C.push(E)}});return C.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(B,G){G=G||window;var L=G.document;B=B||G.event;if(B.$extended){return B}this.$extended=true;var K=B.type;var H=B.target||B.srcElement;while(H&&H.nodeType==3){H=H.parentNode}if(K.test(/key/)){var C=B.which||B.keyCode;var N=Event.Keys.keyOf(C);if(K=="keydown"){var E=C-111;if(E>0&&E<13){N="f"+E}}N=N||String.fromCharCode(C).toLowerCase()}else{if(K.match(/(click|mouse|menu)/i)){L=(!L.compatMode||L.compatMode=="CSS1Compat")?L.html:L.body;var J={x:B.pageX||B.clientX+L.scrollLeft,y:B.pageY||B.clientY+L.scrollTop};var D={x:(B.pageX)?B.pageX-G.pageXOffset:B.clientX,y:(B.pageY)?B.pageY-G.pageYOffset:B.clientY};if(K.match(/DOMMouseScroll|mousewheel/)){var I=(B.wheelDelta)?B.wheelDelta/120:-(B.detail||0)/3}var F=(B.which==3)||(B.button==2);var M=null;if(K.match(/over|out/)){switch(K){case"mouseover":M=B.relatedTarget||B.fromElement;break;case"mouseout":M=B.relatedTarget||B.toElement}if(!(function(){while(M&&M.nodeType==3){M=M.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){M=false}}}}return $extend(this,{event:B,type:K,page:J,client:D,rightClick:F,wheel:I,relatedTarget:M,target:H,code:C,key:N,shift:B.shiftKey,control:B.ctrlKey,alt:B.altKey,meta:B.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(C){if(C instanceof Function){C={initialize:C}}var B=function(){Object.reset(this);if(B._prototyping){return this}this._current=$empty;var D=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return D}.extend(this);B.implement(C);B.constructor=Class;B.prototype.constructor=B;return B}Function.prototype.protect=function(){this._protected=true;return this};Object.reset=function(B,D){if(D==null){for(var G in B){Object.reset(B,G)}return B}delete B[D];switch($type(B[D])){case"object":var E=function(){};E.prototype=B[D];var C=new E;B[D]=Object.reset(C);break;case"array":B[D]=$unlink(B[D]);break}return B};new Native({name:"Class",initialize:Class}).extend({instantiate:function(C){C._prototyping=true;var B=new C;delete C._prototyping;return B},wrap:function(B,C,D){if(D._origin){D=D._origin}return function(){if(D._protected&&this._current==null){throw new Error('The method "'+C+'" cannot be called.')}var F=this.caller,G=this._current;this.caller=G;this._current=arguments.callee;var E=D.apply(this,arguments);this._current=G;this.caller=F;return E}.extend({_owner:B,_origin:D,_name:C})}});Class.implement({implement:function(B,E){if($type(B)=="object"){for(var F in B){this.implement(F,B[F])}return this}var G=Class.Mutators[B];if(G){E=G.call(this,E);if(E==null){return this}}var D=this.prototype;switch($type(E)){case"function":if(E._hidden){return this}D[B]=Class.wrap(this,B,E);break;case"object":var C=D[B];if($type(C)=="object"){$mixin(C,E)}else{D[B]=$unlink(E)}break;case"array":D[B]=$unlink(E);break;default:D[B]=E}return this}});Class.Mutators={Extends:function(B){this.parent=B;this.prototype=Class.instantiate(B);this.implement("parent",function(){var C=this.caller._name,D=this.caller._owner.parent.prototype[C];if(!D){throw new Error('The method "'+C+'" has no parent.')}return D.apply(this,arguments)}.protect())},Implements:function(B){$splat(B).each(function(C){if(C instanceof Function){C=Class.instantiate(C)}this.implement(C)},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(D,C,B){D=Events.removeOn(D);if(C!=$empty){this.$events[D]=this.$events[D]||[];this.$events[D].include(C);if(B){C.internal=true}}return this},addEvents:function(B){for(var C in B){this.addEvent(C,B[C])}return this},fireEvent:function(D,C,B){D=Events.removeOn(D);if(!this.$events||!this.$events[D]){return this}this.$events[D].each(function(E){E.create({bind:this,delay:B,"arguments":C})()},this);return this},removeEvent:function(C,B){C=Events.removeOn(C);if(!this.$events[C]){return this}if(!B.internal){this.$events[C].erase(B)}return this},removeEvents:function(D){if($type(D)=="object"){for(var E in D){this.removeEvent(E,D[E])}return this}if(D){D=Events.removeOn(D)}for(var E in this.$events){if(D&&D!=E){continue}var C=this.$events[E];for(var B=C.length;B--;B){this.removeEvent(E,C[B])}}return this}});Events.removeOn=function(B){return B.replace(/^on([A-Z])/,function(C,D){return D.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var B in this.options){if($type(this.options[B])!="function"||!(/^on[A-Z]/).test(B)){continue}this.addEvent(B,this.options[B]);delete this.options[B]}return this}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(B,C){var D=Element.Constructors.get(B);if(D){return D(C)}if(typeof B=="string"){return document.newElement(B,C)}return $(B).set(C)},afterImplement:function(B,C){Element.Prototype[B]=C;if(Array[B]){return }Elements.implement(B,function(){var D=[],H=true;for(var F=0,E=this.length;F<E;F++){var G=this[F][B].apply(this[F],arguments);D.push(G);if(H){H=($type(G)=="element")}}return(H)?new Elements(D):D})}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var F=Array.link(arguments,{properties:Object.type,iframe:$defined});var D=F.properties||{};var C=$(F.iframe)||false;var E=D.onload||$empty;delete D.onload;D.id=D.name=$pick(D.id,D.name,C.id,C.name,"IFrame_"+$time());C=new Element(C||"iframe",D);var B=function(){var G=$try(function(){return C.contentWindow.location.host});if(G&&G==window.location.host){var H=new Window(C.contentWindow);new Document(C.contentWindow.document);$extend(H.Element.prototype,Element.Prototype)}E.call(C.contentWindow,C.contentWindow.document)};(window.frames[D.id])?B():C.addListener("load",B);return C}});var Elements=new Native({initialize:function(G,C){C=$extend({ddup:true,cash:true},C);G=G||[];if(C.ddup||C.cash){var H={},F=[];for(var D=0,B=G.length;D<B;D++){var E=$.element(G[D],!C.cash);if(C.ddup){if(H[E.uid]){continue}H[E.uid]=true}F.push(E)}G=F}return(C.cash)?$extend(G,this):G}});Elements.implement({filter:function(B,C){if(!B){return this}return new Elements(Array.filter(this,(typeof B=="string")?function(D){return D.match(B)}:B,C))}});Document.implement({newElement:function(B,C){var E;if(Browser.Engine.trident&&C){["name","type","checked"].each(function(G){if(!C[G]){return }B+=" "+G+'="'+C[G]+'"';if(G!="checked"){delete C[G]}});var D="<"+B+">";try{E=this.createElement(D)}catch(F){E=this.createElement(B)}}else{E=this.createElement(B)}return $.element(E).set(C)},newTextNode:function(B){return this.createTextNode(B)},getDocument:function(){return this},getWindow:function(){return this.window}});Window.implement({$:function(C,D){if(C&&C.$family&&C.uid){return C}var B=$type(C);return($[B])?$[B](C,D,this.document):null},$$:function(B){if(arguments.length==1&&typeof B=="string"){return this.document.getElements(B)}var G=[];var D=Array.flatten(arguments);for(var E=0,C=D.length;E<C;E++){var F=D[E];switch($type(F)){case"element":G.push(F);break;case"string":G.extend(this.document.getElements(F,true))}}return new Elements(G)},getDocument:function(){return this.document},getWindow:function(){return this}});$.string=function(D,C,B){D=B.getElementById(D);return(D)?$.element(D,C):null};$.element=function(B,E){$uid(B);if(!E&&!B.$family&&!(/^object|embed$/i).test(B.tagName)){var C=Element.Prototype;for(var D in C){B[D]=C[D]}}return B};$.object=function(C,D,B){if(C.toElement){return $.element(C.toElement(B),D)}return null};$.textnode=$.whitespace=$.window=$.document=$arguments(0);Native.implement([Element,Document],{getElement:function(B,C){return $(this.getElements(B,true)[0]||null,C)},getElements:function(B,E){B=B.split(",");var D=[];var C=(B.length>1);B.each(function(F){var G=this.getElementsByTagName(F.trim());(C)?D.extend(G):D=G},this);return new Elements(D,{ddup:C,cash:!E})}});(function(){var I={},G={};var J={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var D=function(M){return(G[M]||(G[M]={}))};var H=function(O,M){if(!O){return }var N=O.uid;if(Browser.Engine.trident){if(O.clearAttributes){var Q=M&&O.cloneNode(false);O.clearAttributes();if(Q){O.mergeAttributes(Q)}}else{if(O.removeEvents){O.removeEvents()}}if((/object/i).test(O.tagName)){for(var P in O){if(typeof O[P]=="function"){O[P]=$empty}}Element.dispose(O)}}if(!N){return }I[N]=G[N]=null};var E=function(){Hash.each(I,H);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(H)}if(window.CollectGarbage){CollectGarbage()}I={};G={}};var K=function(O,M,T,N,Q,S){var P=O[T||M];var R=[];while(P){if(P.nodeType==1&&(!N||Element.match(P,N))){if(!Q){return $(P,S)}R.push(P)}P=P[M]}return(Q)?new Elements(R,{ddup:false,cash:!S}):null};var F={html:"innerHTML","class":"className","for":"htmlFor",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var C=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var L=["value","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];C=C.associate(C);Hash.extend(F,C);Hash.extend(F,L.associate(L.map(String.toLowerCase)));var B={before:function(N,M){if(M.parentNode){M.parentNode.insertBefore(N,M)}},after:function(N,M){if(!M.parentNode){return }var O=M.nextSibling;(O)?M.parentNode.insertBefore(N,O):M.parentNode.appendChild(N)},bottom:function(N,M){M.appendChild(N)},top:function(N,M){var O=M.firstChild;(O)?M.insertBefore(N,O):M.appendChild(N)}};B.inside=B.bottom;Hash.each(B,function(M,N){N=N.capitalize();Element.implement("inject"+N,function(O){M(this,$(O,true));return this});Element.implement("grab"+N,function(O){M($(O,true),this);return this})});Element.implement({set:function(P,N){switch($type(P)){case"object":for(var O in P){this.set(O,P[O])}break;case"string":var M=Element.Properties.get(P);(M&&M.set)?M.set.apply(this,Array.slice(arguments,1)):this.setProperty(P,N)}return this},get:function(N){var M=Element.Properties.get(N);return(M&&M.get)?M.get.apply(this,Array.slice(arguments,1)):this.getProperty(N)},erase:function(N){var M=Element.Properties.get(N);(M&&M.erase)?M.erase.apply(this):this.removeProperty(N);return this},setProperty:function(N,O){var M=F[N];if(O==undefined){return this.removeProperty(N)}if(M&&C[N]){O=!!O}(M)?this[M]=O:this.setAttribute(N,""+O);return this},setProperties:function(M){for(var N in M){this.setProperty(N,M[N])}return this},getProperty:function(N){var M=F[N];var O=(M)?this[M]:this.getAttribute(N,2);return(C[N])?!!O:(M)?O:O||null},getProperties:function(){var M=$A(arguments);return M.map(this.getProperty,this).associate(M)},removeProperty:function(N){var M=F[N];(M)?this[M]=(M&&C[N])?false:"":this.removeAttribute(N);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},hasClass:function(M){return this.className.contains(M," ")},addClass:function(M){if(!this.hasClass(M)){this.className=(this.className+" "+M).clean()}return this},removeClass:function(M){this.className=this.className.replace(new RegExp("(^|\\s)"+M+"(?:\\s|$)"),"$1");return this},toggleClass:function(M){return this.hasClass(M)?this.removeClass(M):this.addClass(M)},adopt:function(){Array.flatten(arguments).each(function(M){M=$(M,true);if(M){this.appendChild(M)}},this);return this},appendText:function(N,M){return this.grab(this.getDocument().newTextNode(N),M)},grab:function(N,M){B[M||"bottom"]($(N,true),this);return this},inject:function(N,M){B[M||"bottom"](this,$(N,true));return this},replaces:function(M){M=$(M,true);M.parentNode.replaceChild(this,M);return this},wraps:function(N,M){N=$(N,true);return this.replaces(N).grab(N,M)},getPrevious:function(M,N){return K(this,"previousSibling",null,M,false,N)},getAllPrevious:function(M,N){return K(this,"previousSibling",null,M,true,N)},getNext:function(M,N){return K(this,"nextSibling",null,M,false,N)},getAllNext:function(M,N){return K(this,"nextSibling",null,M,true,N)},getFirst:function(M,N){return K(this,"nextSibling","firstChild",M,false,N)},getLast:function(M,N){return K(this,"previousSibling","lastChild",M,false,N)},getParent:function(M,N){return K(this,"parentNode",null,M,false,N)},getParents:function(M,N){return K(this,"parentNode",null,M,true,N)},getSiblings:function(M,N){return this.getParent().getChildren(M,N).erase(this)},getChildren:function(M,N){return K(this,"nextSibling","firstChild",M,true,N)},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(P,O){var N=this.ownerDocument.getElementById(P);if(!N){return null}for(var M=N.parentNode;M!=this;M=M.parentNode){if(!M){return null}}return $.element(N,O)},getSelected:function(){return new Elements($A(this.options).filter(function(M){return M.selected}))},getComputedStyle:function(N){if(this.currentStyle){return this.currentStyle[N.camelCase()]}var M=this.getDocument().defaultView.getComputedStyle(this,null);return(M)?M.getPropertyValue([N.hyphenate()]):null},toQueryString:function(){var M=[];this.getElements("input, select, textarea",true).each(function(N){if(!N.name||N.disabled){return }var O=(N.tagName.toLowerCase()=="select")?Element.getSelected(N).map(function(P){return P.value}):((N.type=="radio"||N.type=="checkbox")&&!N.checked)?null:N.value;$splat(O).each(function(P){if(typeof P!="undefined"){M.push(N.name+"="+encodeURIComponent(P))}})});return M.join("&")},clone:function(P,M){P=P!==false;var S=this.cloneNode(P);var O=function(W,V){if(!M){W.removeAttribute("id")}if(Browser.Engine.trident){W.clearAttributes();W.mergeAttributes(V);W.removeAttribute("uid");if(W.options){var Y=W.options,T=V.options;for(var U=Y.length;U--;){Y[U].selected=T[U].selected}}}var Z=J[V.tagName.toLowerCase()];if(Z&&V[Z]){W[Z]=V[Z]}};if(P){var Q=S.getElementsByTagName("*"),R=this.getElementsByTagName("*");for(var N=Q.length;N--;){O(Q[N],R[N])}}O(S,this);return $(S)},destroy:function(){Element.empty(this);Element.dispose(this);H(this,true);return null},empty:function(){$A(this.childNodes).each(function(M){Element.destroy(M)});return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},hasChild:function(M){M=$(M,true);if(!M){return false}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(M.tagName)).contains(M)}return(this.contains)?(this!=M&&this.contains(M)):!!(this.compareDocumentPosition(M)&16)},match:function(M){return(!M||(M==this)||(Element.get(this,"tag")==M))}});Native.implement([Element,Window,Document],{addListener:function(P,O){if(P=="unload"){var M=O,N=this;O=function(){N.removeListener("unload",O);M()}}else{I[this.uid]=this}if(this.addEventListener){this.addEventListener(P,O,false)}else{this.attachEvent("on"+P,O)}return this},removeListener:function(N,M){if(this.removeEventListener){this.removeEventListener(N,M,false)}else{this.detachEvent("on"+N,M)}return this},retrieve:function(N,M){var P=D(this.uid),O=P[N];if(M!=undefined&&O==undefined){O=P[N]=M}return $pick(O)},store:function(N,M){var O=D(this.uid);O[N]=M;return this},eliminate:function(M){var N=D(this.uid);delete N[M];return this}});window.addListener("unload",E)})();Element.Properties=new Hash;Element.Properties.style={set:function(B){this.style.cssText=B},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 D=document.createElement("div");var B={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};B.thead=B.tfoot=B.tbody;var C={set:function(){var F=Array.flatten(arguments).join("");var G=Browser.Engine.trident&&B[this.get("tag")];if(G){var H=D;H.innerHTML=G[1]+F+G[2];for(var E=G[0];E--;){H=H.firstChild}this.empty().adopt(H.childNodes)}else{this.innerHTML=F}}};C.erase=C.set;return C})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText}var B=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var C=B.innerText;B.destroy();return C}}}Element.Properties.events={set:function(B){this.addEvents(B)}};Native.implement([Element,Window,Document],{addEvent:function(F,H){var I=this.retrieve("events",{});I[F]=I[F]||{keys:[],values:[]};if(I[F].keys.contains(H)){return this}I[F].keys.push(H);var G=F,B=Element.Events.get(F),D=H,J=this;if(B){if(B.onAdd){B.onAdd.call(this,H)}if(B.condition){D=function(K){if(B.condition.call(this,K)){return H.call(this,K)}return true}}G=B.base||G}var E=function(){return H.call(J)};var C=Element.NativeEvents[G];if(C){if(C==2){E=function(K){K=new Event(K,J.getWindow());if(D.call(J,K)===false){K.stop()}}}this.addListener(G,E)}I[F].values.push(E);return this},removeEvent:function(D,C){var B=this.retrieve("events");if(!B||!B[D]){return this}var G=B[D].keys.indexOf(C);if(G==-1){return this}B[D].keys.splice(G,1);var F=B[D].values.splice(G,1)[0];var E=Element.Events.get(D);if(E){if(E.onRemove){E.onRemove.call(this,C)}D=E.base||D}return(Element.NativeEvents[D])?this.removeListener(D,F):this},addEvents:function(B){for(var C in B){this.addEvent(C,B[C])}return this},removeEvents:function(B){if($type(B)=="object"){for(var D in B){this.removeEvent(D,B[D])}return this}var C=this.retrieve("events");if(!C){return this}if(!B){for(var D in C){this.removeEvents(D)}this.eliminate("events")}else{if(C[B]){while(C[B].keys[0]){this.removeEvent(B,C[B].keys[0])}C[B]=null}}return this},fireEvent:function(E,C,B){var D=this.retrieve("events");if(!D||!D[E]){return this}D[E].keys.each(function(F){F.create({bind:this,delay:B,"arguments":C})()},this);return this},cloneEvents:function(E,B){E=$(E);var D=E.retrieve("events");if(!D){return this}if(!B){for(var C in D){this.cloneEvents(E,C)}}else{if(D[B]){D[B].keys.each(function(F){this.addEvent(B,F)},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 B=function(C){var D=C.relatedTarget;if(D==undefined){return true}if(D===false){return false}return($type(this)!="document"&&D!=this&&D.prefix!="xul"&&!this.hasChild(D))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:B},mouseleave:{base:"mouseout",condition:B},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(B){this.setStyles(B)}};Element.Properties.opacity={set:function(B,C){if(!C){if(B==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=(B==1)?"":"alpha(opacity="+B*100+")"}this.style.opacity=B;this.store("opacity",B)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(B){return this.set("opacity",B,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(C,B){switch(C){case"opacity":return this.set("opacity",parseFloat(B));case"float":C=(Browser.Engine.trident)?"styleFloat":"cssFloat"}C=C.camelCase();if($type(B)!="string"){var D=(Element.Styles.get(C)||"@").split(" ");B=$splat(B).map(function(F,E){if(!D[E]){return""}return($type(F)=="number")?D[E].replace("@",Math.round(F)):F}).join(" ")}else{if(B==String(Number(B))){B=Math.round(B)}}this.style[C]=B;return this},getStyle:function(H){switch(H){case"opacity":return this.get("opacity");case"float":H=(Browser.Engine.trident)?"styleFloat":"cssFloat"}H=H.camelCase();var B=this.style[H];if(!$chk(B)){B=[];for(var G in Element.ShortStyles){if(H!=G){continue}for(var F in Element.ShortStyles[G]){B.push(this.getStyle(F))}return B.join(" ")}B=this.getComputedStyle(H)}if(B){B=String(B);var D=B.match(/rgba?\([\d\s,]+\)/);if(D){B=B.replace(D[0],D[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(B,10)))){if(H.test(/^(height|width)$/)){var C=(H=="width")?["left","right"]:["top","bottom"],E=0;C.each(function(I){E+=this.getStyle("border-"+I+"-width").toInt()+this.getStyle("padding-"+I).toInt()},this);return this["offset"+H.capitalize()]-E+"px"}if((Browser.Engine.presto)&&String(B).test("px")){return B}if(H.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return B},setStyles:function(C){for(var B in C){this.setStyle(B,C[B])}return this},getStyles:function(){var B={};Array.each(arguments,function(C){B[C]=this.getStyle(C)},this);return B}});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(H){var G=Element.ShortStyles;var C=Element.Styles;["margin","padding"].each(function(I){var J=I+H;G[I][J]=C[J]="@px"});var F="border"+H;G.border[F]=C[F]="@px @ rgb(@, @, @)";var E=F+"Width",B=F+"Style",D=F+"Color";G[F]={};G.borderWidth[E]=G[F][E]=C[E]="@px";G.borderStyle[B]=G[F][B]=C[B]="@";G.borderColor[D]=G[F][D]=C[D]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(I,J){if(C(this)){this.getWindow().scrollTo(I,J)}else{this.scrollLeft=I;this.scrollTop=J}return this},getSize:function(){if(C(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(C(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(C(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var J=this,I={x:0,y:0};while(J&&!C(J)){I.x+=J.scrollLeft;I.y+=J.scrollTop;J=J.parentNode}return I},getOffsetParent:function(){var I=this;if(C(I)){return null}if(!Browser.Engine.trident){return I.offsetParent}while((I=I.parentNode)&&!C(I)){if(E(I,"position")!="static"){return I}}return null},getOffsets:function(){if(Browser.Engine.trident){var M=this.getBoundingClientRect(),K=this.getDocument().documentElement;var N=E(this,"position")=="fixed";return{x:M.left+((N)?0:K.scrollLeft)-K.clientLeft,y:M.top+((N)?0:K.scrollTop)-K.clientTop}}var J=this,I={x:0,y:0};if(C(this)){return I}while(J&&!C(J)){I.x+=J.offsetLeft;I.y+=J.offsetTop;if(Browser.Engine.gecko){if(!G(J)){I.x+=D(J);I.y+=H(J)}var L=J.parentNode;if(L&&E(L,"overflow")!="visible"){I.x+=D(L);I.y+=H(L)}}else{if(J!=this&&Browser.Engine.webkit){I.x+=D(J);I.y+=H(J)}}J=J.offsetParent}if(Browser.Engine.gecko&&!G(this)){I.x-=D(this);I.y-=H(this)}return I},getPosition:function(L){if(C(this)){return{x:0,y:0}}var M=this.getOffsets(),J=this.getScrolls();var I={x:M.x-J.x,y:M.y-J.y};var K=(L&&(L=$(L)))?L.getPosition():{x:0,y:0};return{x:I.x-K.x,y:I.y-K.y}},getCoordinates:function(K){if(C(this)){return this.getWindow().getCoordinates()}var I=this.getPosition(K),J=this.getSize();var L={left:I.x,top:I.y,width:J.x,height:J.y};L.right=L.left+L.width;L.bottom=L.top+L.height;return L},computePosition:function(I){return{left:I.x-F(this,"margin-left"),top:I.y-F(this,"margin-top")}},position:function(I){return this.setStyles(this.computePosition(I))}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var J=this.getWindow();return{x:J.innerWidth,y:J.innerHeight}}var I=B(this);return{x:I.clientWidth,y:I.clientHeight}},getScroll:function(){var J=this.getWindow(),I=B(this);return{x:J.pageXOffset||I.scrollLeft,y:J.pageYOffset||I.scrollTop}},getScrollSize:function(){var J=B(this),I=this.getSize();return{x:Math.max(J.scrollWidth,I.x),y:Math.max(J.scrollHeight,I.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var I=this.getSize();return{top:0,left:0,bottom:I.y,right:I.x,height:I.y,width:I.x}}});var E=Element.getComputedStyle;function F(I,J){return E(I,J).toInt()||0}function G(I){return E(I,"-moz-box-sizing")=="border-box"}function H(I){return F(I,"border-top-width")}function D(I){return F(I,"border-left-width")}function C(I){return(/^(?:body|html)$/i).test(I.tagName)}function B(I){var J=I.getDocument();return(!J.compatMode||J.compatMode=="CSS1Compat")?J.html:J.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(I,H){I=I.split(",");var D,F={};for(var E=0,C=I.length;E<C;E++){var B=I[E],G=Selectors.Utils.search(this,B,F);if(E!=0&&G.item){G=$A(G)}D=(E==0)?G:(D.item)?$A(D).concat(G):D.concat(G)}return new Elements(D,{ddup:(I.length>1),cash:!H})}});Element.implement({match:function(C){if(!C||(C==this)){return true}var E=Selectors.Utils.parseTagAndID(C);var B=E[0],F=E[1];if(!Selectors.Filters.byID(this,F)||!Selectors.Filters.byTag(this,B)){return false}var D=Selectors.Utils.parseSelector(C);return(D)?Selectors.Utils.filter(this,D,{}):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(C,D){if(!D){return true}var B=$uid(C);if(!D[B]){return D[B]=true}return false},parseNthArgument:function(G){if(Selectors.Cache.nth[G]){return Selectors.Cache.nth[G]}var D=G.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!D){return false}var F=parseInt(D[1],10);var C=(F||F===0)?F:1;var E=D[2]||false;var B=parseInt(D[3],10)||0;if(C!=0){B--;while(B<1){B+=C}while(B>=C){B-=C}}else{C=B;E="index"}switch(E){case"n":D={a:C,b:B,special:"n"};break;case"odd":D={a:2,b:0,special:"n"};break;case"even":D={a:2,b:1,special:"n"};break;case"first":D={a:0,special:"index"};break;case"last":D={special:"last-child"};break;case"only":D={special:"only-child"};break;default:D={a:(C-1),special:"index"}}return Selectors.Cache.nth[G]=D},parseSelector:function(F){if(Selectors.Cache.parsed[F]){return Selectors.Cache.parsed[F]}var E,I={classes:[],pseudos:[],attributes:[]};while((E=Selectors.RegExps.combined.exec(F))){var J=E[1],H=E[2],G=E[3],C=E[5],D=E[6],K=E[7];if(J){I.classes.push(J)}else{if(D){var B=Selectors.Pseudo.get(D);if(B){I.pseudos.push({parser:B,argument:K})}else{I.attributes.push({name:D,operator:"=",value:K})}}else{if(H){I.attributes.push({name:H,operator:G,value:C})}}}}if(!I.classes.length){delete I.classes}if(!I.attributes.length){delete I.attributes}if(!I.pseudos.length){delete I.pseudos}if(!I.classes&&!I.attributes&&!I.pseudos){I=null}return Selectors.Cache.parsed[F]=I},parseTagAndID:function(C){var B=C.match(Selectors.RegExps.tag);var D=C.match(Selectors.RegExps.id);return[(B)?B[1]:"*",(D)?D[1]:false]},filter:function(G,D,F){var E;if(D.classes){for(E=D.classes.length;E--;E){var H=D.classes[E];if(!Selectors.Filters.byClass(G,H)){return false}}}if(D.attributes){for(E=D.attributes.length;E--;E){var C=D.attributes[E];if(!Selectors.Filters.byAttribute(G,C.name,C.operator,C.value)){return false}}}if(D.pseudos){for(E=D.pseudos.length;E--;E){var B=D.pseudos[E];if(!Selectors.Filters.byPseudo(G,B.parser,B.argument,F)){return false}}}return true},getByTagAndID:function(C,B,E){if(E){var D=(C.getElementById)?C.getElementById(E,true):Element.getElementById(C,E,true);return(D&&Selectors.Filters.byTag(D,B))?[D]:[]}else{return C.getElementsByTagName(B)}},search:function(J,I,O){var C=[];var D=I.trim().replace(Selectors.RegExps.splitter,function(a,Z,Y){C.push(Z);return":)"+Y}).split(":)");var K,F,V;for(var U=0,Q=D.length;U<Q;U++){var T=D[U];if(U==0&&Selectors.RegExps.quick.test(T)){K=J.getElementsByTagName(T);continue}var B=C[U-1];var L=Selectors.Utils.parseTagAndID(T);var W=L[0],M=L[1];if(U==0){K=Selectors.Utils.getByTagAndID(J,W,M)}else{var E={},H=[];for(var S=0,R=K.length;S<R;S++){H=Selectors.Getters[B](H,K[S],W,M,E)}K=H}var G=Selectors.Utils.parseSelector(T);if(G){F=[];for(var P=0,N=K.length;P<N;P++){V=K[P];if(Selectors.Utils.filter(V,G,O)){F.push(V)}}K=F}}return K}};Selectors.Getters={" ":function(I,H,J,B,F){var E=Selectors.Utils.getByTagAndID(H,J,B);for(var D=0,C=E.length;D<C;D++){var G=E[D];if(Selectors.Utils.chk(G,F)){I.push(G)}}return I},">":function(I,H,J,B,G){var D=Selectors.Utils.getByTagAndID(H,J,B);for(var F=0,E=D.length;F<E;F++){var C=D[F];if(C.parentNode==H&&Selectors.Utils.chk(C,G)){I.push(C)}}return I},"+":function(D,C,B,F,E){while((C=C.nextSibling)){if(C.nodeType==1){if(Selectors.Utils.chk(C,E)&&Selectors.Filters.byTag(C,B)&&Selectors.Filters.byID(C,F)){D.push(C)}break}}return D},"~":function(D,C,B,F,E){while((C=C.nextSibling)){if(C.nodeType==1){if(!Selectors.Utils.chk(C,E)){break}if(Selectors.Filters.byTag(C,B)&&Selectors.Filters.byID(C,F)){D.push(C)}}}return D}};Selectors.Filters={byTag:function(C,B){return(B=="*"||(C.tagName&&C.tagName.toLowerCase()==B))},byID:function(B,C){return(!C||(B.id&&B.id==C))},byClass:function(C,B){return(C.className&&C.className.contains(B," "))},byPseudo:function(B,E,D,C){return E.call(B,D,C)},byAttribute:function(D,E,C,F){var B=Element.prototype.getProperty.call(D,E);if(!B){return(C=="!=")}if(!C||F==undefined){return true}switch(C){case"=":return(B==F);case"*=":return(B.contains(F));case"^=":return(B.substr(0,F.length)==F);case"$=":return(B.substr(B.length-F.length)==F);case"!=":return(B!=F);case"~=":return B.contains(F," ");case"|=":return B.contains(F,"-")}return false}};Selectors.Pseudo=new Hash({checked:function(){return this.checked},empty:function(){return !(this.innerText||this.textContent||"").length},not:function(B){return !Element.match(this,B)},contains:function(B){return(this.innerText||this.textContent||"").contains(B)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var B=this;while((B=B.nextSibling)){if(B.nodeType==1){return false}}return true},"only-child":function(){var C=this;while((C=C.previousSibling)){if(C.nodeType==1){return false}}var B=this;while((B=B.nextSibling)){if(B.nodeType==1){return false}}return true},"nth-child":function(H,F){H=(H==undefined)?"n":H;var D=Selectors.Utils.parseNthArgument(H);if(D.special!="n"){return Selectors.Pseudo[D.special].call(this,D.a,F)}var G=0;F.positions=F.positions||{};var E=$uid(this);if(!F.positions[E]){var C=this;while((C=C.previousSibling)){if(C.nodeType!=1){continue}G++;var B=F.positions[$uid(C)];if(B!=undefined){G=B+G;break}}F.positions[E]=G}return(F.positions[E]%D.a==D.b)},index:function(B){var C=this,D=0;while((C=C.previousSibling)){if(C.nodeType==1&&++D>B){return false}}return(D==B)},even:function(C,B){return Selectors.Pseudo["nth-child"].call(this,"2n+1",B)},odd:function(C,B){return Selectors.Pseudo["nth-child"].call(this,"2n",B)},selected:function(){return this.selected}});Element.Events.domready={onAdd:function(B){if(Browser.loaded){B.call(this)}}};(function(){var C=function(){if(Browser.loaded){return }Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};if(Browser.Engine.trident){var B=document.createElement("div");(function(){($try(function(){B.doScroll("left");return $(B).inject(document.body).set("html","temp").dispose()}))?C():arguments.callee.delay(50)})()}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?C():arguments.callee.delay(50)})()}else{window.addEvent("load",C);document.addEvent("DOMContentLoaded",C)}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(B){return JSON.$specialChars[B]||"\\u00"+Math.floor(B.charCodeAt()/16).toString(16)+(B.charCodeAt()%16).toString(16)},encode:function(C){switch($type(C)){case"string":return'"'+C.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(C.map(JSON.encode).filter($defined))+"]";case"object":case"hash":var B=[];Hash.each(C,function(F,E){var D=JSON.encode(F);if(D){B.push(JSON.encode(E)+":"+D)}});return"{"+B+"}";case"number":case"boolean":return String(C);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(C,B){this.key=C;this.setOptions(B)},write:function(C){C=encodeURIComponent(C);if(this.options.domain){C+="; domain="+this.options.domain}if(this.options.path){C+="; path="+this.options.path}if(this.options.duration){var B=new Date();B.setTime(B.getTime()+this.options.duration*24*60*60*1000);C+="; expires="+B.toGMTString()}if(this.options.secure){C+="; secure"}this.options.document.cookie=this.key+"="+C;return this},read:function(){var B=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(B)?decodeURIComponent(B[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(C,D,B){return new Cookie(C,B).write(D)};Cookie.read=function(B){return new Cookie(B).read()};Cookie.dispose=function(C,B){return new Cookie(C,B).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(M,N){this.instance="Swiff_"+$time();this.setOptions(N);N=this.options;var C=this.id=N.id||this.instance;var B=$(N.container);Swiff.CallBacks[this.instance]={};var F=N.params,H=N.vars,G=N.callBacks;var I=$extend({height:N.height,width:N.width},N.properties);var L=this;for(var E in G){Swiff.CallBacks[this.instance][E]=(function(O){return function(){return O.apply(L.object,arguments)}})(G[E]);H[E]="Swiff.CallBacks."+this.instance+"."+E}F.flashVars=Hash.toQueryString(H);if(Browser.Engine.trident){I.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";F.movie=M}else{I.type="application/x-shockwave-flash";I.data=M}var K='<object id="'+C+'"';for(var J in I){K+=" "+J+'="'+I[J]+'"'}K+=">";for(var D in F){if(F[D]){K+='<param name="'+D+'" value="'+F[D]+'" />'}}K+="</object>";this.object=((B)?B.empty():new Element("div")).set("html",K).firstChild},replaces:function(B){B=$(B,true);B.parentNode.replaceChild(this.toElement(),B);return this},inject:function(B){$(B,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(B){this.subject=this.subject||this;this.setOptions(B);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var C=this.options.wait;if(C===false){this.options.link="cancel"}},getTransition:function(){return function(B){return -(Math.cos(Math.PI*B)-1)/2}},step:function(){var B=$time();if(B<this.time+this.options.duration){var C=this.transition((B-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,C))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(B){return B},compute:function(D,C,B){return Fx.compute(D,C,B)},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(C,B){if(!this.check(C,B)){return this}this.from=C;this.to=B;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(D,C,B){return(C-D)*B+D};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(E,F,C){C=$splat(C);var D=C[1];if(!$chk(D)){C[1]=C[0];C[0]=E.getStyle(F)}var B=C.map(this.parse);return{from:B[0],to:B[1]}},parse:function(B){B=$lambda(B)();B=(typeof B=="string")?B.split(" "):$splat(B);return B.map(function(D){D=String(D);var C=false;Fx.CSS.Parsers.each(function(G,F){if(C){return }var E=G.parse(D);if($chk(E)){C={value:E,parser:G}}});C=C||{value:D,parser:Fx.CSS.Parsers.String};return C})},compute:function(E,D,C){var B=[];(Math.min(E.length,D.length)).times(function(F){B.push({value:E[F].parser.compute(E[F].value,D[F].value,C),parser:E[F].parser})});B.$family={name:"fx:css:value"};return B},serve:function(D,C){if($type(D)!="fx:css:value"){D=this.parse(D)}var B=[];D.each(function(E){B=B.concat(E.parser.serve(E.value,C))});return B},render:function(B,E,D,C){B.setStyle(E,this.serve(D,C))},search:function(B){if(Fx.CSS.Cache[B]){return Fx.CSS.Cache[B]}var C={};Array.each(document.styleSheets,function(F,E){var D=F.href;if(D&&D.contains("://")&&!D.contains(document.domain)){return }var G=F.rules||F.cssRules;Array.each(G,function(J,H){if(!J.style){return }var I=(J.selectorText)?J.selectorText.replace(/^\w+/,function(K){return K.toLowerCase()}):null;if(!I||!I.test("^"+B+"$")){return }Element.Styles.each(function(L,K){if(!J.style[K]||Element.ShortStyles[K]){return }L=String(J.style[K]);C[K]=(L.test(/^rgb/))?L.rgbToHex():L})})});return Fx.CSS.Cache[B]=C}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(B){if(B.match(/^#[0-9a-f]{3,6}$/i)){return B.hexToRgb(true)}return((B=B.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[B[1],B[2],B[3]]:false},compute:function(D,C,B){return D.map(function(F,E){return Math.round(Fx.compute(D[E],C[E],B))})},serve:function(B){return B.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(C,B){return(B)?C+B:C}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(C,B){this.element=this.subject=$(C);this.parent(B)},set:function(C,B){if(arguments.length==1){B=C;C=this.property||this.options.property}this.render(this.element,C,B,this.options.unit);return this},start:function(D,F,E){if(!this.check(D,F,E)){return this}var C=Array.flatten(arguments);this.property=this.options.property||C.shift();var B=this.prepare(this.element,this.property,C);return this.parent(B.from,B.to)}});Element.Properties.tween={set:function(B){var C=this.retrieve("tween");if(C){C.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},B))},get:function(B){if(B||!this.retrieve("tween")){if(B||!this.retrieve("tween:options")){this.set("tween",B)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(B,D,C){this.get("tween").start(arguments);return this},fade:function(D){var F=this.get("tween"),E="opacity",B;D=$pick(D,"toggle");switch(D){case"in":F.start(E,1);break;case"out":F.start(E,0);break;case"show":F.set(E,1);break;case"hide":F.set(E,0);break;case"toggle":var C=this.retrieve("fade:flag",this.get("opacity")==1);F.start(E,(C)?0:1);this.store("fade:flag",!C);B=true;break;default:F.start(E,arguments)}if(!B){this.eliminate("fade:flag")}return this},highlight:function(D,B){if(!B){B=this.retrieve("highlight:original",this.getStyle("background-color"));B=(B=="transparent")?"#fff":B}var C=this.get("tween");C.start("background-color",D||"#ffff88",B).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));C.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(C,B){this.element=this.subject=$(C);this.parent(B)},set:function(B){if(typeof B=="string"){B=this.search(B)}for(var C in B){this.render(this.element,C,B[C],this.options.unit)}return this},compute:function(F,E,D){var B={};for(var C in F){B[C]=this.parent(F[C],E[C],D)}return B},start:function(C){if(!this.check(C)){return this}if(typeof C=="string"){C=this.search(C)}var F={},E={};for(var D in C){var B=this.prepare(this.element,D,C[D]);F[D]=B.from;E[D]=B.to}return this.parent(F,E)}});Element.Properties.morph={set:function(B){var C=this.retrieve("morph");if(C){C.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},B))},get:function(B){if(B||!this.retrieve("morph")){if(B||!this.retrieve("morph:options")){this.set("morph",B)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(B){this.get("morph").start(B);return this}});Fx.implement({getTransition:function(){var B=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof B=="string"){var C=B.split(":");B=Fx.Transitions;B=B[C[0]]||B[C[0].capitalize()];if(C[1]){B=B["ease"+C[1].capitalize()+(C[2]?C[2].capitalize():"")]}}return B}});Fx.Transition=function(C,B){B=$splat(B);return $extend(C,{easeIn:function(D){return C(D,B)},easeOut:function(D){return 1-C(1-D,B)},easeInOut:function(D){return(D<=0.5)?C(2*D,B)/2:(2-C(2*(1-D),B))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(B){for(var C in B){Fx.Transitions[C]=new Fx.Transition(B[C])}};Fx.Transitions.extend({Pow:function(C,B){return Math.pow(C,B[0]||6)},Expo:function(B){return Math.pow(2,8*(B-1))},Circ:function(B){return 1-Math.sin(Math.acos(B))},Sine:function(B){return 1-Math.sin((1-B)*Math.PI/2)},Back:function(C,B){B=B[0]||1.618;return Math.pow(C,2)*((B+1)*C-B)},Bounce:function(E){var D;for(var C=0,B=1;1;C+=B,B/=2){if(E>=(7-4*C)/11){D=B*B-Math.pow((11-6*C-11*E)/4,2);break}}return D},Elastic:function(C,B){return Math.pow(2,10*--C)*Math.cos(20*C*Math.PI*(B[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(C,B){Fx.Transitions[C]=new Fx.Transition(function(D){return Math.pow(D,[B+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(B){this.xhr=new Browser.Request();this.setOptions(B);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(B){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(B)}return B.stripScripts(this.options.evalScripts)},success:function(C,B){this.onSuccess(this.processScripts(C),B)},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(B,C){this.headers.set(B,C);return this},getHeader:function(B){return $try(function(){return this.xhr.getResponseHeader(B)}.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(K){if(!this.check(K)){return this}this.running=true;var I=$type(K);if(I=="string"||I=="element"){K={data:K}}var E=this.options;K=$extend({data:E.data,url:E.url,method:E.method},K);var G=K.data,C=K.url,B=K.method;switch($type(G)){case"element":G=$(G).toQueryString();break;case"object":case"hash":G=Hash.toQueryString(G)}if(this.options.format){var J="format="+this.options.format;G=(G)?J+"&"+G:J}if(this.options.emulation&&["put","delete"].contains(B)){var H="_method="+B;G=(G)?H+"&"+G:H;B="post"}if(this.options.urlEncoded&&B=="post"){var D=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+D)}if(this.options.noCache){var F="noCache="+new Date().getTime();G=(G)?F+"&"+G:F}if(G&&B=="get"){C=C+(C.contains("?")?"&":"?")+G;G=null}this.xhr.open(B.toUpperCase(),C,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(M,L){try{this.xhr.setRequestHeader(L,M)}catch(N){this.fireEvent("exception",[L,M])}},this);this.fireEvent("request");this.xhr.send(G);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 B={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(C){B[C]=function(){var D=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(D,{method:C.toLowerCase()}))}});Request.implement(B)})();Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(D){var C=D.match(/<body[^>]*>([\s\S]*?)<\/body>/i);D=(C)?C[1]:D;var B=new Element("div");return $try(function(){var E="<root>"+D+"</root>",H;if(Browser.Engine.trident){H=new ActiveXObject("Microsoft.XMLDOM");H.async=false;H.loadXML(E)}else{H=new DOMParser().parseFromString(E,"text/xml")}E=H.getElementsByTagName("root")[0];if(!E){return }for(var G=0,F=E.childNodes.length;G<F;G++){var I=Element.clone(E.childNodes[G],true,true);if(I){B.grab(I)}}return B})||B.set("html",D)},success:function(E){var D=this.options,C=this.response;C.html=E.stripScripts(function(F){C.javascript=F});var B=this.processHTML(C.html);C.tree=B.childNodes;C.elements=B.getElements("*");if(D.filter){C.tree=C.elements.filter(D.filter)}if(D.update){$(D.update).empty().set("html",C.html)}else{if(D.append){$(D.append).adopt(B.getChildren())}}if(D.evalScripts){$exec(C.javascript)}this.onSuccess(C.tree,C.elements,C.html,C.javascript)}});Element.Properties.send={set:function(B){var C=this.retrieve("send");if(C){C.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},B))},get:function(B){if(B||!this.retrieve("send")){if(B||!this.retrieve("send:options")){this.set("send",B)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.Properties.load={set:function(B){var C=this.retrieve("load");if(C){C.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},B))},get:function(B){if(B||!this.retrieve("load")){if(B||!this.retrieve("load:options")){this.set("load",B)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({send:function(B){var C=this.get("send");C.send({data:this,url:B||C.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(B){this.parent(B);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(B){this.response.json=JSON.decode(B,this.options.secure);this.onSuccess(this.response.json,B)}});MooTools.More={version:"1.2.2.1"};(function(){var B={language:"en-US",languages:{"en-US":{}},cascades:["en-US"]};var C;MooTools.lang=new Events();$extend(MooTools.lang,{setLanguage:function(D){if(!B.languages[D]){return this}B.language=D;this.load();this.fireEvent("langChange",D);return this},load:function(){var D=this.cascade(this.getCurrentLanguage());C={};$each(D,function(F,E){C[E]=this.lambda(F)},this)},getCurrentLanguage:function(){return B.language},addLanguage:function(D){B.languages[D]=B.languages[D]||{};return this},cascade:function(F){var D=(B.languages[F]||{}).cascades||[];D.combine(B.cascades);D.erase(F).push(F);var E=D.map(function(G){return B.languages[G]},this);return $merge.apply(this,E)},lambda:function(D){(D||{}).get=function(F,E){return $lambda(D[F]).apply(this,$splat(E))};return D},get:function(F,E,D){if(C&&C[F]){return(E?C[F].get(E,D):C[F])}},set:function(E,F,D){this.addLanguage(E);langData=B.languages[E];if(!langData[F]){langData[F]={}}$extend(langData[F],D);if(E==this.getCurrentLanguage()){this.load();this.fireEvent("langChange",E)}return this},list:function(){return Hash.getKeys(B.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(C,B){$each(B,function(F,E){var D=C.prototype[E];if(D&&(D=D._origin)&&typeof F=="function"){C.implement(E,function(){var G=this.previous;this.previous=D;var H=F.apply(this,arguments);this.previous=G;return H})}else{C.implement(E,F)}});return C};Class.Mutators.Binds=function(B){return B};Class.Mutators.initialize=function(B){return function(){$splat(this.Binds).each(function(C){var D=this[C];if(D){this[C]=D.bind(this)}},this);return B.apply(this,arguments)}};Class.Occlude=new Class({occlude:function(D,C){C=$(C||this.element);var B=C.retrieve(D||this.property);if(B&&!$defined(this.occluded)){this.occluded=B}else{this.occluded=false;C.store(D||this.property,this)}return this.occluded}});(function(){var C={wait:function(D){return this.chain(function(){this.callChain.delay($pick(D,500),this)}.bind(this))}};Chain.implement(C);if(window.Fx){Fx.implement(C);["Css","Tween","Elements"].each(function(D){if(Fx[D]){Fx[D].implement(C)}})}try{Element.implement({chains:function(D){$splat($pick(D,["tween","morph","reveal"])).each(function(E){E=this.get(E);if(!E){return }E.setOptions({link:"chain"})},this);return this},pauseFx:function(E,D){this.chains(D).get($pick(D,"tween")).wait(E);return this}})}catch(B){}})();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 B=0,C=this.length;if(C){do{B+=this[--C]}while(C)}return B},unique:function(){return[].combine(this)}});(function(){new Native({name:"Date",initialize:Date,protect:true});["now","parse","UTC"].each(function(E){Native.genericize(Date,E,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(E){Date.Methods[E.toLowerCase()]=E});$each({ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"},function(F,E){Date.Methods[E]=F});var D=function(F,E){return"0".repeat(E-F.toString().length)+F};Date.implement({set:function(H,F){switch($type(H)){case"object":for(var G in H){this.set(G,H[G])}break;case"string":H=H.toLowerCase();var E=Date.Methods;if(E[H]){this["set"+E[H]](F)}}return this},get:function(F){F=F.toLowerCase();var E=Date.Methods;if(E[F]){return this["get"+E[F]]()}return null},clone:function(){return new Date(this.get("time"))},increment:function(E,F){return this.multiply(E,F)},decrement:function(E,F){return this.multiply(E,F,false)},multiply:function(F,K,E){F=F||"day";K=$pick(K,1);E=$pick(E,true);var L=E?1:-1;var I=this.format("%m").toInt()-1;var G=this.format("%Y").toInt();var H=this.get("time");var J=0;switch(F){case"year":K.times(function(M){if(Date.isLeapYear(G+M)&&I>1&&L>0){M++}if(Date.isLeapYear(G+M)&&I<=1&&L<0){M--}J+=Date.units.year(G+M)});break;case"month":K.times(function(O){if(L<0){O++}var N=I+(O*L);var M=M;if(N<0){M--;N=12+N}if(N>11||N<0){M+=(N/12).toInt()*L;N=N%12}J+=Date.units.month(N,M)});break;case"day":return this.set("date",this.get("date")+(L*K));default:J=Date.units[F]()*K;break}this.set("time",H+(J*L));return this},isLeapYear:function(){return Date.isLeapYear(this.get("year"))},clearTime:function(){["hr","min","sec","ms"].each(function(E){this.set(E,0)},this);return this},diff:function(H,F){F=F||"day";if($type(H)=="string"){H=Date.parse(H)}switch(F){case"year":return H.format("%Y").toInt()-this.format("%Y").toInt();break;case"month":var E=(H.format("%Y").toInt()-this.format("%Y").toInt())*12;return E+H.format("%m").toInt()-this.format("%m").toInt();break;default:var G=H.get("time")-this.get("time");if(G<0&&Date.units[F]()>(-1*(G))){return 0}else{if(G>=0&&G<Date.units[F]()){return 0}}return((H.get("time")-this.get("time"))/Date.units[F]()).round()}return null},getWeek:function(){var E=(new Date(this.get("year"),0,1)).get("date");return Math.round((this.get("dayofyear")+(E>3?E-4:E+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 E=this.get("timezoneOffset");return((E>0)?"-":" + ")+D(Math.floor(Math.abs(E)/60),2)+D(E%60,2)},parse:function(E){this.set("time",Date.parse(E));return this},isValid:function(E){return !!(E||this).valueOf()},format:function(E){if(!this.isValid()){return"invalid date"}E=E||"%x %X";E=({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"})[E.toLowerCase()]||E;var F=this;return E.replace(/\%([aAbBcdHIjmMpSUWwxXyYTZ\%])/g,function(G,H){switch(H){case"a":return Date.getMsg("days")[F.get("day")].substr(0,3);case"A":return Date.getMsg("days")[F.get("day")];case"b":return Date.getMsg("months")[F.get("month")].substr(0,3);case"B":return Date.getMsg("months")[F.get("month")];case"c":return F.toString();case"d":return D(F.get("date"),2);case"H":return D(F.get("hr"),2);case"I":return((F.get("hr")%12)||12);case"j":return D(F.get("dayofyear"),3);case"m":return D((F.get("mo")+1),2);case"M":return D(F.get("min"),2);case"p":return Date.getMsg(F.get("hr")<12?"AM":"PM");case"S":return D(F.get("seconds"),2);case"U":return D(F.get("week"),2);case"W":throw new Error("%W is not supported yet");case"w":return F.get("day");case"x":return F.format(Date.getMsg("shortDate"));case"X":return F.format(Date.getMsg("shortTime"));case"y":return F.get("year").toString().substr(2);case"Y":return F.get("year");case"T":return F.get("GMTOffset");case"Z":return F.get("Timezone");case"%":return"%"}return H})},setAMPM:function(E){E=E.toUpperCase();if(this.format("%H").toInt()>11&&E=="AM"){return this.decrement("hour",12)}else{if(this.format("%H").toInt()<12&&E=="PM"){return this.increment("hour",12)}}return this}});Date.alias("diff","compare");Date.alias("format","strftime");var C=Date.parse;var B=function(F,E){if(Date.isLeapYear(E.toInt())&&F===1){return 29}return[31,28,31,30,31,30,31,31,30,31,30,31][F]};$extend(Date,{getMsg:function(F,E){return MooTools.lang.get("Date",F,E)},units:{ms:$lambda(1),second:$lambda(1000),minute:$lambda(60000),hour:$lambda(3600000),day:$lambda(86400000),week:$lambda(608400000),month:function(G,E){var F=new Date();return B($pick(G,F.format("%m").toInt()),$pick(E,F.format("%Y").toInt()))*86400000},year:function(E){E=E||new Date().format("%Y").toInt();return Date.isLeapYear(E.toInt())?31622400000:31536000000}},isLeapYear:function(E){return new Date(E,1,29).getDate()==29},fixY2K:function(F){if(!isNaN(F)){var E=new Date(F);if(E.get("year")<2000&&F.toString().indexOf(E.get("year"))<0){E.increment("year",100)}return E}else{return F}},parse:function(G){var F=$type(G);if(F=="number"){return new Date(G)}if(F!="string"){return G}if(!G.length){return null}var E;Date.parsePatterns.each(function(J,H){if(E){return }var I=J.re.exec(G);if(I){E=J.handler(I)}});return E||new Date(C(G))},parseDay:function(E,H){var G=-1;switch($type(E)){case"number":G=Date.getMsg("days")[E-1]||false;if(!G){throw new Error("Invalid day index value must be between 1 and 7")}break;case"string":var F=Date.getMsg("days").filter(function(I){return this.test(I)},new RegExp("^"+E,"i"));if(!F.length){throw new Error("Invalid day string")}if(F.length>1){throw new Error("Ambiguous day")}G=F[0]}return(H)?Date.getMsg("days").indexOf(G):G},parseMonth:function(H,G){var F=-1;switch($type(H)){case"object":F=Date.getMsg("months")[H.get("mo")];break;case"number":F=Date.getMsg("months")[H-1]||false;if(!F){throw new Error("Invalid month index value must be between 1 and 12:"+index)}break;case"string":var E=Date.getMsg("months").filter(function(I){return this.test(I)},new RegExp("^"+H,"i"));if(!E.length){throw new Error("Invalid month string")}if(E.length>1){throw new Error("Ambiguous month")}F=E[0]}return(G)?Date.getMsg("months").indexOf(F):F},parseUTC:function(F){var E=new Date(F);var G=Date.UTC(E.get("year"),E.get("mo"),E.get("date"),E.get("hr"),E.get("min"),E.get("sec"));return new Date(G)},orderIndex:function(E){return Date.getMsg("dateOrder").indexOf(E)+1},parsePatterns:[{re:/^(\d{4})[\.\-\/](\d{1,2})[\.\-\/](\d{1,2})$/,handler:function(E){return new Date(E[1],E[2]-1,E[3])}},{re:/^(\d{4})[\.\-\/](\d{1,2})[\.\-\/](\d{1,2})\s(\d{1,2}):(\d{1,2})(?:\:(\d{1,2}))?(\w{2})?$/,handler:function(E){var F=new Date(E[1],E[2]-1,E[3]);F.set("hr",E[4]);F.set("min",E[5]);F.set("sec",E[6]||0);if(E[7]){F.set("ampm",E[7])}return F}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})$/,handler:function(E){var F=new Date(E[Date.orderIndex("year")],E[Date.orderIndex("month")]-1,E[Date.orderIndex("date")]);return Date.fixY2K(F)}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})\s(\d{1,2})[:\.](\d{1,2})(?:[\:\.](\d{1,2}))?(\w{2})?$/,handler:function(E){var F=new Date(E[Date.orderIndex("year")],E[Date.orderIndex("month")]-1,E[Date.orderIndex("date")]);F.set("hr",E[4]);F.set("min",E[5]);F.set("sec",E[6]||0);if(E[7]){F.set("ampm",E[7])}return Date.fixY2K(F)}}]})})();["LastDayOfMonth","Ordinal"].each(function(B){Date.Methods[B.toLowerCase()]=B});Date.implement({timeDiffInWords:function(B){return Date.distanceOfTimeInWords(this,B||new Date)},getOrdinal:function(B){return Date.getMsg("ordinal",B||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 B=this.clone();B.setMonth(B.getMonth()+1,0);return B.getDate()}});Date.alias("timeDiffInWords","timeAgoInWords");$extend(Date,{distanceOfTimeInWords:function(C,B){return this.getTimePhrase(((B.getTime()-C.getTime())/1000).toInt(),C,B)},getTimePhrase:function(E,D,B){var C=function(){var F;if(E>=0){F="Ago"}else{E=E*-1;F="Until"}if(E<60){return Date.getMsg("lessThanMinute"+F,E)}else{if(E<120){return Date.getMsg("minute"+F,E)}else{if(E<(45*60)){E=(E/60).round();return Date.getMsg("minutes"+F,E)}else{if(E<(90*60)){return Date.getMsg("hour"+F,E)}else{if(E<(24*60*60)){E=(E/3600).round();return Date.getMsg("hours"+F,E)}else{if(E<(48*60*60)){return Date.getMsg("day"+F,E)}else{E=(E/86400).round();return Date.getMsg("days"+F,E)}}}}}}};return C().substitute({delta:E})}});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(B){var D=0;var C=new Date(B[1],0,1);if(B[3]){C.set("date",B[3])}if(B[2]){C.set("mo",B[2]-1)}if(B[4]){C.set("hr",B[4])}if(B[5]){C.set("min",B[5])}if(B[6]){C.set("sec",B[6])}if(B[7]){C.set("ms",("0."+B[7]).toInt()*1000)}if(B[9]){D=(B[9].toInt()*60)+B[10].toInt();D*=((B[8]=="-")?1:-1)}C.setTime((C*1)+(D*60*1000).toInt());return C}},{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(B){var C=new Date();C.set("date",B[1].toInt());return C}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,handler:function(B){var C=new Date();C.set("mo",Date.parseMonth(B[2],true),B[1].toInt());return C}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i,handler:function(B){var C=new Date();C.set("mo",Date.parseMonth(B[2],true),B[1].toInt());C.setYear(B[3]);return C}},{re:/^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,handler:function(B){var C=new Date();C.set("mo",Date.parseMonth(B[1],true),B[2].toInt());C.setYear(B[3]);return C}},{re:/^next (\w+)$/i,handler:function(E){var F=new Date();var C=F.getDay();var D=Date.parseDay(E[1],true);var B=D-C;if(D<=C){B+=7}F.set("date",F.getDate()+B);return F}},{re:/^\d+\s[a-zA-z]..\s\d.\:\d.$/,handler:function(C){var D=new Date();C=C[0].split(" ");D.set("date",C[0]);var B;Date.getMsg("months").each(function(F,E){if(new RegExp("^"+C[1]).test(F)){B=E}});D.set("mo",B);D.set("hr",C[2].split(":")[0]);D.set("min",C[2].split(":")[1]);D.set("ms",0);return D}},{re:/^last (\w+)$/i,handler:function(B){return Date.parse("next "+B[0]).decrement("day",7)}}]);Hash.implement({getFromPath:function(B){var C=this.getClean();B.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(D){if(!C){return null}var E=arguments[2]||arguments[1]||arguments[0];C=(E in C)?C[E]:null;return D});return C},cleanValues:function(B){B=B||$defined;this.each(function(D,C){if(!B(D)){this.erase(C)}},this);return this},run:function(){var B=arguments;this.each(function(D,C){if($type(D)=="function"){D.run(B)}})}});(function(){var C=["Ãƒâ‚¬","ÃƒÂ ","Ãƒï¿½","ÃƒÂ¡","Ãƒâ€š","ÃƒÂ¢","ÃƒÆ’","ÃƒÂ£","Ãƒâ€ž","ÃƒÂ¤","Ãƒâ€¦","ÃƒÂ¥","Ã„â€š","Ã„Æ’","Ã„â€ž","Ã„â€¦","Ã„â€ ","Ã„â€¡","Ã„Å’","Ã„ï¿½","Ãƒâ€¡","ÃƒÂ§","Ã„Å½","Ã„ï¿½","Ã„ï¿½","Ã„â€˜","ÃƒË†","ÃƒÂ¨","Ãƒâ€°","ÃƒÂ©","ÃƒÅ ","ÃƒÂª","Ãƒâ€¹","ÃƒÂ«","Ã„Å¡","Ã„â€º","Ã„Ëœ","Ã„â„¢","Ã„Å¾","Ã„Å¸","ÃƒÅ’","ÃƒÂ¬","Ãƒï¿½","ÃƒÂ","ÃƒÅ½","ÃƒÂ®","Ãƒï¿½","ÃƒÂ¯","Ã„Â¹","Ã„Âº","Ã„Â½","Ã„Â¾","Ã…ï¿½","Ã…â€š","Ãƒâ€˜","ÃƒÂ±","Ã…â€¡","Ã…Ë†","Ã…Æ’","Ã…â€ž","Ãƒâ€™","ÃƒÂ²","Ãƒâ€œ","ÃƒÂ³","Ãƒâ€�","ÃƒÂ´","Ãƒâ€¢","ÃƒÂµ","Ãƒâ€“","ÃƒÂ¶","ÃƒËœ","ÃƒÂ¸","Ã…â€˜","Ã…Ëœ","Ã…â„¢","Ã…â€�","Ã…â€¢","Ã…Â ","Ã…Â¡","Ã…Å¾","Ã…Å¸","Ã…Å¡","Ã…â€º","Ã…Â¤","Ã…Â¥","Ã…Â¤","Ã…Â¥","Ã…Â¢","Ã…Â£","Ãƒâ„¢","ÃƒÂ¹","ÃƒÅ¡","ÃƒÂº","Ãƒâ€º","ÃƒÂ»","ÃƒÅ“","ÃƒÂ¼","Ã…Â®","Ã…Â¯","Ã…Â¸","ÃƒÂ¿","ÃƒÂ½","Ãƒï¿½","Ã…Â½","Ã…Â¾","Ã…Â¹","Ã…Âº","Ã…Â»","Ã…Â¼","ÃƒÅ¾","ÃƒÂ¾","Ãƒï¿½","ÃƒÂ°","ÃƒÅ¸","Ã…â€™","Ã…â€œ","Ãƒâ€ ","ÃƒÂ¦","Ã‚Âµ"];var B=["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 D={"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"};String.implement({standardize:function(){var E=this;C.each(function(G,F){E=E.replace(new RegExp(G,"g"),B[F])});return E},repeat:function(E){return new Array(E+1).join(this)},pad:function(F,H,E){if(this.length>=F){return this}H=H||" ";var G=H.repeat(F-this.length).substr(0,F-this.length);if(!E||E=="right"){return this+G}if(E=="left"){return G+this}return G.substr(0,(G.length/2).floor())+this+G.substr(0,(G.length/2).ceil())},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},tidy:function(){var E=this.toString();$each(D,function(G,F){E=E.replace(new RegExp(F,"g"),G)});return E}})})();String.implement({parseQueryString:function(){var C=this.split(/[&;]/),B={};if(C.length){C.each(function(H){var D=H.indexOf("="),E=D<0?[""]:H.substr(0,D).match(/[^\]\[]+/g),F=decodeURIComponent(H.substr(D+1)),G=B;E.each(function(J,I){var K=G[J];if(I<E.length-1){G=G[J]=K||{}}else{if($type(K)=="array"){K.push(F)}else{G[J]=$defined(K)?[K,F]:F}}})})}return B},cleanQueryString:function(B){return this.split("&").filter(function(F){var C=F.indexOf("="),D=C<0?"":F.substr(0,C),E=F.substr(C+1);return B?B.run([D,E]):$chk(E)}).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(C,B){this.setOptions(B);var D=this.options.base||URI.base;C=C||D;if(C&&C.parsed){this.parsed=$unlink(C.parsed)}else{this.set("value",C.href||C.toString(),D?new URI(D):false)}},parse:function(D,C){var B=D.match(this.regex);if(!B){return false}B.shift();return this.merge(B.associate(this.parts),C)},merge:function(C,B){if(!C.scheme&&!B.scheme){return false}if(B){this.parts.every(function(D){if(C[D]){return false}C[D]=B[D]||"";return true})}C.port=C.port||this.schemes[C.scheme.toLowerCase()];C.directory=C.directory?this.parseDirectory(C.directory,B?B.directory:""):"/";return C},parseDirectory:function(C,D){C=(C.substr(0,1)=="/"?"":(D||"/"))+C;if(!C.test(URI.regs.directoryDot)){return C}var B=[];C.replace(URI.regs.endSlash,"").split("/").each(function(E){if(E==".."&&B.length>0){B.pop()}else{if(E!="."){B.push(E)}}});return B.join("/")+"/"},combine:function(B){return B.value||B.scheme+"://"+(B.user?B.user+(B.password?":"+B.password:"")+"@":"")+(B.host||"")+(B.port&&B.port!=this.schemes[B.scheme]?":"+B.port:"")+(B.directory||"/")+(B.file||"")+(B.query?"?"+B.query:"")+(B.fragment?"#"+B.fragment:"")},set:function(C,E,D){if(C=="value"){var B=E.match(URI.regs.scheme);if(B){B=B[1]}if(B&&!$defined(this.schemes[B.toLowerCase()])){this.parsed={scheme:B,value:E}}else{this.parsed=this.parse(E,(D||this).parsed)||(B?{scheme:B,value:E}:{value:E})}}else{this.parsed[C]=E}return this},get:function(B,C){switch(B){case"value":return this.combine(this.parsed,C?C.parsed:false);case"data":return this.getData()}return this.parsed[B]||undefined},go:function(){document.location.href=this.toString()},toURI:function(){return this},getData:function(D,C){var B=this.get(C||"query");if(!$chk(B)){return D?null:{}}var E=B.parseQueryString();return D?E[D]:E},setData:function(B,D,C){if($type(arguments[0])=="string"){B=this.getData();B[arguments[0]]=arguments[1]}else{if(D){B=$merge(this.getData(),B)}}return this.set(C||"query",Hash.toQueryString(B))},clearData:function(B){return this.set(B||"query","")}});["toString","valueOf"].each(function(B){URI.prototype[B]=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(B){return new URI(this,B)}});URI=Class.refactor(URI,{combine:function(G,F){if(!F||G.scheme!=F.scheme||G.host!=F.host||G.port!=F.port){return this.previous.apply(this,arguments)}var B=G.file+(G.query?"?"+G.query:"")+(G.fragment?"#"+G.fragment:"");if(!F.directory){return(G.directory||(G.file?"":"./"))+B}var E=F.directory.split("/"),D=G.directory.split("/"),H="",I;var C=0;for(I=0;I<E.length&&I<D.length&&E[I]==D[I];I++){}for(C=0;C<E.length-I-1;C++){H+="../"}for(C=I;C<D.length-1;C++){H+=D[C]+"/"}return(H||(G.file?"":"./"))+B},toAbsolute:function(B){B=new URI(B);if(B){B.set("directory","").set("file","")}return this.toRelative(B)},toRelative:function(B){return this.get("value",new URI(B))}});Element.implement({tidy:function(){this.set("value",this.get("value").tidy())},getTextInRange:function(C,B){return this.get("value").substring(C,B)},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 F={start:0,end:0};var B=this.getDocument().selection.createRange();if(!B||B.parentElement()!=this){return F}var D=B.duplicate();if(this.type=="text"){F.start=0-D.moveStart("character",-100000);F.end=F.start+B.text.length}else{var C=this.get("value");var E=C.length-C.match(/[\n\r]*$/)[0].length;D.moveToElementText(this);D.setEndPoint("StartToEnd",B);F.end=E-D.text.length;D.setEndPoint("StartToStart",B);F.start=E-D.text.length}return F},getSelectionStart:function(){return this.getSelectedRange().start},getSelectionEnd:function(){return this.getSelectedRange().end},setCaretPosition:function(B){if(B=="end"){B=this.get("value").length}this.selectRange(B,B);return this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(F,B){if(this.createTextRange){var D=this.get("value");var E=D.substr(F,B-F).replace(/\r/g,"").length;F=D.substr(0,F).replace(/\r/g,"").length;var C=this.createTextRange();C.collapse(true);C.moveEnd("character",F+E);C.moveStart("character",F);C.select()}else{this.focus();this.setSelectionRange(F,B)}return this},insertAtCursor:function(C,B){var E=this.getSelectedRange();var D=this.get("value");this.set("value",D.substring(0,E.start)+C+D.substring(E.end,D.length));if($pick(B,true)){this.selectRange(E.start,E.start+C.length)}else{this.setCaretPosition(E.start+C.length)}return this},insertAroundCursor:function(C,B){C=$extend({before:"",defaultMiddle:"",after:""},C);var D=this.getSelectedText()||C.defaultMiddle;var H=this.getSelectedRange();var G=this.get("value");if(H.start==H.end){this.set("value",G.substring(0,H.start)+C.before+D+C.after+G.substring(H.end,G.length));this.selectRange(H.start+C.before.length,H.end+C.before.length+D.length)}else{var E=G.substring(H.start,H.end);this.set("value",G.substring(0,H.start)+C.before+E+C.after+G.substring(H.end,G.length));var F=H.start+C.before.length;if($pick(B,true)){this.selectRange(F,F+E.length)}else{this.setCaretPosition(F+G.length)}}return this}});Element.implement({measure:function(F){var H=function(I){return !!(!I||I.offsetHeight||I.offsetWidth)};if(H(this)){return F.apply(this)}var E=this.getParent(),C=[],G=[];while(!H(E)&&E!=document.body){C.push(E.expose());E=E.getParent()}var D=this.expose();var B=F.apply(this);D();C.each(function(I){I()});return B},expose:function(){if(this.getStyle("display")!="none"){return $empty}var B=this.getStyles("display","position","visibility");return this.setStyles({display:"block",position:"absolute",visibility:"hidden"}).setStyles.pass(B,this)},getDimensions:function(B){B=$merge({computeSize:false},B);var E={};var D=function(G,F){return(F.computeSize)?G.getComputedSize(F):G.getSize()};if(this.getStyle("display")=="none"){E=this.measure(function(){return D(this,B)})}else{try{E=D(this,B)}catch(C){}}return $chk(E.x)?$extend(E,{width:E.x,height:E.y}):$extend(E,{x:E.width,y:E.height})},getComputedSize:function(B){B=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},B);var D={width:0,height:0};switch(B.mode){case"vertical":delete D.width;delete B.plains.width;break;case"horizontal":delete D.height;delete B.plains.height;break}var C=[];$each(B.plains,function(H,G){H.each(function(I){B.styles.each(function(J){C.push((J=="border")?J+"-"+I+"-width":J+"-"+I)})})});var F={};C.each(function(G){F[G]=this.getComputedStyle(G)},this);var E=[];$each(B.plains,function(H,G){var I=G.capitalize();D["total"+I]=0;D["computed"+I]=0;H.each(function(J){D["computed"+J.capitalize()]=0;C.each(function(L,K){if(L.test(J)){F[L]=F[L].toInt()||0;D["total"+I]=D["total"+I]+F[L];D["computed"+J.capitalize()]=D["computed"+J.capitalize()]+F[L]}if(L.test(J)&&G!=L&&(L.test("border")||L.test("padding"))&&!E.contains(L)){E.push(L);D["computed"+I]=D["computed"+I]-F[L]}})})});["Width","Height"].each(function(H){var G=H.toLowerCase();if(!$chk(D[G])){return }D[G]=D[G]+this["offset"+H]+D["computed"+H];D["total"+H]=D[G]+D["total"+H];delete D["computed"+H]},this);return $extend(F,D)}});(function(){var B=false;window.addEvent("domready",function(){var C=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);B=(C.offsetTop===0);C.dispose()});Element.implement({pin:function(D){if(this.getStyle("display")=="none"){return null}var E;if(D!==false){E=this.getPosition();if(!this.retrieve("pinned")){var G={top:E.y-window.getScroll().y,left:E.x-window.getScroll().x};if(B){this.setStyle("position","fixed").setStyles(G)}else{this.store("pinnedByJS",true);this.setStyles({position:"absolute",top:E.y,left:E.x});this.store("scrollFixer",(function(){if(this.retrieve("pinned")){this.setStyles({top:G.top.toInt()+window.getScroll().y,left:G.left.toInt()+window.getScroll().x})}}).bind(this));window.addEvent("scroll",this.retrieve("scrollFixer"))}this.store("pinned",true)}}else{var F;if(!Browser.Engine.trident){if(this.getParent().getComputedStyle("position")!="static"){F=this.getParent()}else{F=this.getParent().getOffsetParent()}}E=this.getPosition(F);this.store("pinned",false);var C;if(B&&!this.retrieve("pinnedByJS")){C={top:E.y+window.getScroll().y,left:E.x+window.getScroll().x}}else{this.store("pinnedByJS",false);window.removeEvent("scroll",this.retrieve("scrollFixer"));C={top:E.y,left:E.x}}this.setStyles($merge(C,{position:"absolute"}))}return this.addClass("isPinned")},unpin:function(){return this.pin(false).removeClass("isPinned")},togglepin:function(){this.pin(!this.retrieve("pinned"))}})})();(function(){var B=Element.prototype.position;Element.implement({position:function(S){if(S&&($defined(S.x)||$defined(S.y))){return B?B.apply(this,arguments):this}$each(S||{},function(U,T){if(!$defined(U)){delete S[T]}});S=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,allowNegative:false},S);var C={x:0,y:0};var I=false;var D=this.measure(function(){return $(this.getOffsetParent())});if(D&&D!=this.getDocument().body){C=D.measure(function(){return this.getPosition()});I=true;S.offset.x=S.offset.x-C.x;S.offset.y=S.offset.y-C.y}var R=function(T){if($type(T)!="string"){return T}T=T.toLowerCase();var U={};if(T.test("left")){U.x="left"}else{if(T.test("right")){U.x="right"}else{U.x="center"}}if(T.test("upper")||T.test("top")){U.y="top"}else{if(T.test("bottom")){U.y="bottom"}else{U.y="center"}}return U};S.edge=R(S.edge);S.position=R(S.position);if(!S.edge){if(S.position.x=="center"&&S.position.y=="center"){S.edge={x:"center",y:"center"}}else{S.edge={x:"left",y:"top"}}}this.setStyle("position","absolute");var Q=$(S.relativeTo)||document.body;var J=Q==document.body?window.getScroll():Q.getPosition();var P=J.y;var H=J.x;if(Browser.Engine.trident){var M=Q.getScrolls();P+=M.y;H+=M.x}var K=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});if(S.ignoreMargins){S.offset.x=S.offset.x-K["margin-left"];S.offset.y=S.offset.y-K["margin-top"]}var O={};var E=S.offset.y;var F=S.offset.x;var L=window.getSize();switch(S.position.x){case"left":O.x=H+F;break;case"right":O.x=H+F+Q.offsetWidth;break;default:O.x=H+((Q==document.body?L.x:Q.offsetWidth)/2)+F;break}switch(S.position.y){case"top":O.y=P+E;break;case"bottom":O.y=P+E+Q.offsetHeight;break;default:O.y=P+((Q==document.body?L.y:Q.offsetHeight)/2)+E;break}if(S.edge){var N={};switch(S.edge.x){case"left":N.x=0;break;case"right":N.x=-K.x-K.computedRight-K.computedLeft;break;default:N.x=-(K.x/2);break}switch(S.edge.y){case"top":N.y=0;break;case"bottom":N.y=-K.y-K.computedTop-K.computedBottom;break;default:N.y=-(K.y/2);break}O.x=O.x+N.x;O.y=O.y+N.y}O={left:((O.x>=0||I||S.allowNegative)?O.x:0).toInt(),top:((O.y>=0||I||S.allowNegative)?O.y:0).toInt()};if(Q.getStyle("position")=="fixed"||S.relFixedPosition){var G=window.getScroll();O.top=O.top.toInt()+G.y;O.left=O.left.toInt()+G.x}if(S.returnPos){return O}else{this.setStyles(O)}return this}})})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isDisplayed()?"hide":"show"]()},hide:function(){var C;try{if("none"!=this.getStyle("display")){C=this.getStyle("display")}}catch(B){}return this.store("originalDisplay",C||"block").setStyle("display","none")},show:function(B){return this.setStyle("display",B||this.retrieve("originalDisplay")||"block")},swapClass:function(B,C){return this.removeClass(B).addClass(C)}});var InputValidator=new Class({Implements:[Options],options:{errorMsg:"Validation failed.",test:function(B){return true}},initialize:function(C,B){this.setOptions(B);this.className=C},test:function(C,B){if($(C)){return this.options.test($(C),B||this.getProps(C))}else{return false}},getError:function(D,B){var C=this.options.errorMsg;if($type(C)=="function"){C=C($(D),B||this.getProps(D))}return C},getProps:function(B){if(!$(B)){return{}}return B.get("validatorProps")}});Element.Properties.validatorProps={set:function(B){return this.eliminate("validatorProps").store("validatorProps",B)},get:function(B){if(B){this.set(B)}if(this.retrieve("validatorProps")){return this.retrieve("validatorProps")}if(this.getProperty("validatorProps")){try{this.store("validatorProps",JSON.decode(this.getProperty("validatorProps")))}catch(D){return{}}}else{var C=this.get("class").split(" ").filter(function(E){return E.test(":")});if(!C.length){this.store("validatorProps",{})}else{B={};C.each(function(E){var F=E.split(":");if(F[1]){try{B[F[0]]=JSON.decode(F[1])}catch(G){}}});this.store("validatorProps",B)}}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(C,B){this.setOptions(B);this.element=$(C);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(B){B.each(function(C){C.addEvent("blur",this.validateField.pass([C,false],this));if(this.options.evaluateFieldsOnChange){C.addEvent("change",this.validateField.pass([C,true],this))}},this)},onSubmit:function(B){if(!this.validate(B)&&B){B.preventDefault()}else{this.reset()}},reset:function(){this.getFields().each(this.resetField,this);return this},validate:function(C){var B=this.getFields().map(function(D){return this.validateField(D,true)},this).every(function(D){return D});this.fireEvent("formValidate",[B,this.element,C]);if(this.options.stopOnFailure&&!B&&C){C.preventDefault()}return B},validateField:function(J,B){if(this.paused){return true}J=$(J);var E=!J.hasClass("validation-failed");var G,I;if(this.options.serial&&!B){G=this.element.getElement(".validation-failed");I=this.element.getElement(".warning")}if(J&&(!G||B||J.hasClass("validation-failed")||(G&&!this.options.serial))){var D=J.className.split(" ").some(function(K){return this.getValidator(K)},this);var H=[];J.className.split(" ").each(function(K){if(K&&!this.test(K,J)){H.include(K)}},this);E=H.length===0;if(D&&!J.hasClass("warnOnly")){if(E){J.addClass("validation-passed").removeClass("validation-failed");this.fireEvent("elementPass",J)}else{J.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("elementFail",[J,H])}}if(!I){var F=J.className.split(" ").some(function(K){if(K.test("^warn-")||J.hasClass("warnOnly")){return this.getValidator(K.replace(/^warn-/,""))}else{return null}},this);J.removeClass("warning");var C=J.className.split(" ").map(function(K){if(K.test("^warn-")||J.hasClass("warnOnly")){return this.test(K.replace(/^warn-/,""),J,true)}else{return null}},this)}}return E},test:function(C,E,F){var B=this.getValidator(C);E=$(E);if(E.hasClass("ignoreValidation")){return true}F=$pick(F,false);if(E.hasClass("warnOnly")){F=true}var D=B?B.test(E):true;if(B&&this.isVisible(E)){this.fireEvent("elementValidate",[D,E,C,F])}if(F){return true}return D},isVisible:function(B){if(!this.options.ignoreHidden){return true}while(B!=document.body){if($(B).getStyle("display")=="none"){return false}B=B.getParent()}return true},resetField:function(B){B=$(B);if(B){B.className.split(" ").each(function(C){if(C.test("^warn-")){C=C.replace(/^warn-/,"")}B.removeClass("validation-failed");B.removeClass("warning");B.removeClass("validation-passed")},this)}return this},stop:function(){this.paused=true;return this},start:function(){this.paused=false;return this},ignoreField:function(B,C){B=$(B);if(B){this.enforceField(B);if(C){B.addClass("warnOnly")}else{B.addClass("ignoreValidation")}}return this},enforceField:function(B){B=$(B);if(B){B.removeClass("warnOnly").removeClass("ignoreValidation")}return this}});FormValidator.getMsg=function(B){return MooTools.lang.get("FormValidator",B)};FormValidator.adders={validators:{},add:function(C,B){this.validators[C]=new InputValidator(C,B);if(!this.initialize){this.implement({validators:this.validators})}},addAllThese:function(B){$A(B).each(function(C){this.add(C[0],C[1])},this)},getValidator:function(B){return this.validators[B.split(":")[0]]}};$extend(FormValidator,FormValidator.adders);FormValidator.implement(FormValidator.adders);FormValidator.add("IsEmpty",{errorMsg:false,test:function(B){if(B.type=="select-one"||B.type=="select"){return !(B.selectedIndex>=0&&B.options[B.selectedIndex].value!="")}else{return((B.get("value")==null)||(B.get("value").length==0))}}});FormValidator.addAllThese([["required",{errorMsg:function(){return FormValidator.getMsg("required")},test:function(B){return !FormValidator.getValidator("IsEmpty").test(B)}}],["minLength",{errorMsg:function(B,C){if($type(C.minLength)){return FormValidator.getMsg("minLength").substitute({minLength:C.minLength,length:B.get("value").length})}else{return""}},test:function(B,C){if($type(C.minLength)){return(B.get("value").length>=$pick(C.minLength,0))}else{return true}}}],["maxLength",{errorMsg:function(B,C){if($type(C.maxLength)){return FormValidator.getMsg("maxLength").substitute({maxLength:C.maxLength,length:B.get("value").length})}else{return""}},test:function(B,C){return(B.get("value").length<=$pick(C.maxLength,10000))}}],["validate-integer",{errorMsg:FormValidator.getMsg.pass("integer"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^-?[1-9]\d*$/).test(B.get("value"))}}],["validate-numeric",{errorMsg:FormValidator.getMsg.pass("numeric"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/).test(B.get("value"))}}],["validate-digits",{errorMsg:FormValidator.getMsg.pass("digits"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^[\d() .:\-\+#]+$/.test(B.get("value")))}}],["validate-alpha",{errorMsg:FormValidator.getMsg.pass("alpha"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^[a-zA-Z]+$/).test(B.get("value"))}}],["validate-alphanum",{errorMsg:FormValidator.getMsg.pass("alphanum"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||!(/\W/).test(B.get("value"))}}],["validate-date",{errorMsg:function(B,C){if(Date.parse){var D=C.dateFormat||"%x";return FormValidator.getMsg("dateSuchAs").substitute({date:new Date().format(D)})}else{return FormValidator.getMsg("dateInFormatMDY")}},test:function(B,C){if(FormValidator.getValidator("IsEmpty").test(B)){return true}var G;if(Date.parse){var F=C.dateFormat||"%x";G=Date.parse(B.get("value"));var E=G.format(F);if(E!="invalid date"){B.set("value",E)}return !isNaN(G)}else{var D=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!D.test(B.get("value"))){return false}G=new Date(B.get("value").replace(D,"$1/$2/$3"));return(parseInt(RegExp.$1,10)==(1+G.getMonth()))&&(parseInt(RegExp.$2,10)==G.getDate())&&(parseInt(RegExp.$3,10)==G.getFullYear())}}}],["validate-email",{errorMsg:FormValidator.getMsg.pass("email"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i).test(B.get("value"))}}],["validate-url",{errorMsg:FormValidator.getMsg.pass("url"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i).test(B.get("value"))}}],["validate-currency-dollar",{errorMsg:FormValidator.getMsg.pass("currencyDollar"),test:function(B){return FormValidator.getValidator("IsEmpty").test(B)||(/^\$?\-?([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(B.get("value"))}}],["validate-one-required",{errorMsg:FormValidator.getMsg.pass("oneRequired"),test:function(B,C){var D=$(C["validate-one-required"])||B.parentNode;return D.getElements("input").some(function(E){if(["checkbox","radio"].contains(E.get("type"))){return E.get("checked")}return E.get("value")})}}]]);Element.Properties.validator={set:function(B){var C=this.retrieve("validator");if(C){C.setOptions(B)}return this.store("validator:options")},get:function(B){if(B||!this.retrieve("validator")){if(B||!this.retrieve("validator:options")){this.set("validator",B)}this.store("validator",new FormValidator(this,this.retrieve("validator:options")))}return this.retrieve("validator")}};Element.implement({validate:function(B){this.set("validator",B);return this.get("validator",B).validate()}});FormValidator.Inline=new Class({Extends:FormValidator,options:{scrollToErrorsOnSubmit:true,scrollFxOptions:{offset:{y:-20}}},initialize:function(C,B){this.parent(C,B);this.addEvent("onElementValidate",function(H,G,F,I){var E=this.getValidator(F);if(!H&&E.getError(G)){if(I){G.addClass("warning")}var D=this.makeAdvice(F,G,E.getError(G),I);this.insertAdvice(D,G);this.showAdvice(F,G)}else{this.hideAdvice(F,G)}})},makeAdvice:function(E,G,D,H){var F=(H)?this.warningPrefix:this.errorPrefix;F+=(this.options.useTitles)?G.title||D:D;var B=(H)?"warning-advice":"validation-advice";var C=this.getAdvice(E,G);if(C){C=C.clone(true).set("html",F).replaces(C)}else{C=new Element("div",{html:F,styles:{display:"none"},id:"advice-"+E+"-"+this.getFieldId(G)}).addClass(B)}G.store("advice-"+E,C);return C},getFieldId:function(B){return B.id?B.id:B.id="input_"+B.name},showAdvice:function(C,D){var B=this.getAdvice(C,D);if(B&&!D.retrieve(this.getPropName(C))&&(B.getStyle("display")=="none"||B.getStyle("visiblity")=="hidden"||B.getStyle("opacity")==0)){D.store(this.getPropName(C),true);if(B.reveal){B.reveal()}else{B.setStyle("display","block")}}},hideAdvice:function(C,D){var B=this.getAdvice(C,D);if(B&&D.retrieve(this.getPropName(C))){D.store(this.getPropName(C),false);if(B.dissolve){B.dissolve()}else{B.setStyle("display","none")}}},getPropName:function(B){return"advice"+B},resetField:function(B){B=$(B);if(!B){return this}this.parent(B);B.className.split(" ").each(function(C){this.hideAdvice(C,B)},this);return this},getAllAdviceMessages:function(E,D){var C=[];if(E.hasClass("ignoreValidation")&&!D){return C}var B=E.className.split(" ").some(function(H){var F=H.test("^warn-")||E.hasClass("warnOnly");if(F){H=H.replace(/^warn-/,"")}var G=this.getValidator(H);if(!G){return }C.push({message:G.getError(E),warnOnly:F,passed:G.test(),validator:G})},this);return C},getAdvice:function(B,C){return C.retrieve("advice-"+B)},insertAdvice:function(B,D){var C=D.get("validatorProps");if(!C.msgPos||!$(C.msgPos)){if(D.type.toLowerCase()=="radio"){D.getParent().adopt(B)}else{B.inject($(D),"after")}}else{$(C.msgPos).grab(B)}},validate:function(I,H){var B=this.parent(I,H);if(this.options.scrollToErrorsOnSubmit&&!B){var D=$(this).getElement(".validation-failed");var F=$(this).getParent();var C=function(J){return J.getScrollSize().y!=J.getSize().y};var E;while(F!=document.body&&!C(F)){F=F.getParent()}var G=F.retrieve("fvScroller");if(!G&&window.Fx&&Fx.Scroll){G=new Fx.Scroll(F,{transition:"quad:out",offset:{y:-20}});F.store("fvScroller",G)}if(D){if(G){G.toElement(D)}else{F.scrollTo(F.getScroll().x,D.getPosition(F).y-20)}}}}});FormValidator.addAllThese([["validate-enforce-oncheck",{test:function(B,C){if(B.checked){var D=B.getParent("form").retrieve("validator");if(!D){return true}(C.toEnforce||$(C.enforceChildrenOf).getElements("input, select, textarea")).map(function(E){D.enforceField(E)})}return true}}],["validate-ignore-oncheck",{test:function(B,C){if(B.checked){var D=B.getParent("form").retrieve("validator");if(!D){return true}(C.toIgnore||$(C.ignoreChildrenOf).getElements("input, select, textarea")).each(function(E){D.ignoreField(E);D.resetField(E)})}return true}}],["validate-nospace",{errorMsg:function(){return FormValidator.getMsg("noSpace")},test:function(B,C){return !B.get("value").test(/\s/)}}],["validate-toggle-oncheck",{test:function(C,D){var E=C.getParent("form").retrieve("validator");if(!E){return true}var B=D.toToggle||$(D.toToggleChildrenOf).getElements("input, select, textarea");if(!C.checked){B.each(function(F){E.ignoreField(F);E.resetField(F)})}else{B.each(function(F){E.enforceField(F)})}return true}}],["validate-reqchk-bynode",{errorMsg:function(){return FormValidator.getMsg("reqChkByNode")},test:function(B,C){return($(C.nodeId).getElements(C.selector||"input[type=checkbox], input[type=radio]")).some(function(D){return D.checked})}}],["validate-required-check",{errorMsg:function(B,C){return C.useTitle?B.get("title"):FormValidator.getMsg("requiredChk")},test:function(B,C){return !!B.checked}}],["validate-reqchk-byname",{errorMsg:function(B,C){return FormValidator.getMsg("reqChkByName").substitute({label:C.label||B.get("type")})},test:function(C,E){var D=E.groupName||C.get("name");var B=$$(document.getElementsByName(D)).some(function(H,G){return H.checked});var F=C.getParent("form").retrieve("validator");if(B&&F){F.resetField(C)}return B}}],["validate-match",{errorMsg:function(B,C){return FormValidator.getMsg("match").substitute({matchName:C.matchName||$(C.matchInput).get("name")})},test:function(C,D){var E=C.get("value");var B=$(D.matchInput)&&$(D.matchInput).get("value");return E&&B?E==B:true}}],["validate-after-date",{errorMsg:function(B,C){return FormValidator.getMsg("afterDate").substitute({label:C.afterLabel||(C.afterElement?FormValidator.getMsg("startDate"):FormValidator.getMsg("currentDate"))})},test:function(C,D){var E=$(D.afterElement)?Date.parse($(D.afterElement).get("value")):new Date();var B=Date.parse(C.get("value"));return B&&E?B>=E:true}}],["validate-before-date",{errorMsg:function(B,C){return FormValidator.getMsg("beforeDate").substitute({label:C.beforeLabel||(C.beforeElement?FormValidator.getMsg("endDate"):FormValidator.getMsg("currentDate"))})},test:function(C,D){var E=Date.parse(C.get("value"));var B=$(D.beforeElement)?Date.parse($(D.beforeElement).get("value")):new Date();return B&&E?B>=E:true}}],["validate-custom-required",{errorMsg:function(){return FormValidator.getMsg("required")},test:function(B,C){return B.get("value")!=C.emptyValue}}],["validate-same-month",{errorMsg:function(B,C){var D=$(C.sameMonthAs)&&$(C.sameMonthAs).get("value");var E=B.get("value");if(E!=""){return FormValidator.getMsg(D?"sameMonth":"startMonth")}},test:function(B,C){var E=Date.parse(B.get("value"));var D=Date.parse($(C.sameMonthAs)&&$(C.sameMonthAs).get("value"));return E&&D?E.format("%B")==D.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(C,B){this.element=$(C);if(this.occlude()){return this.occluded}this.setOptions(B);this.attach(this.element);OverText.instances.push(this);if(this.options.poll){this.poll()}return this},toElement:function(){return this.element},attach:function(){var B=this.options.textOverride||this.element.get("alt")||this.element.get("title");if(!B){return }this.text=new Element("div",{"class":"overTxtDiv",styles:{lineHeight:"normal",position:"absolute"},html:B,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(B){if(this.poller&&!B){return this}var C=function(){if(!this.pollingPaused){this.assert()}}.bind(this);if(B){$clear(this.poller)}else{this.poller=C.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(B){}}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 B=this.element.get("value");return !B},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(B){}return this}});OverText.instances=[];OverText.update=function(){return OverText.instances.map(function(B){if(B.element&&B.text){return B.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(C,B){this.elements=this.subject=$$(C);this.parent(B)},compute:function(H,I,J){var D={};for(var E in H){var B=H[E],F=I[E],G=D[E]={};for(var C in B){G[C]=this.parent(B[C],F[C],J)}}return D},set:function(C){for(var D in C){var B=C[D];for(var E in B){this.render(this.elements[D],E,B[E],this.options.unit)}}return this},start:function(D){if(!this.check(D)){return this}var I={},J={};for(var E in D){var G=D[E],B=I[E]={},H=J[E]={};for(var C in G){var F=this.prepare(this.elements[E],C,G[C]);B[C]=F.from;H[C]=F.to}}return this.parent(I,J)}});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 D=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(D.elements,D.options);this.togglers=$$(D.togglers);this.container=$(D.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 C=0,B=this.togglers.length;C<B;C++){this.addSection(this.togglers[C],this.elements[C])}this.elements.each(function(F,E){if(this.options.show===E){this.fireEvent("active",[this.togglers[E],F])}else{for(var G in this.effects){F.setStyle(G,0)}}},this);if($chk(this.options.display)){this.display(this.options.display,this.options.initialDisplayFx)}},addSection:function(E,C){E=$(E);C=$(C);var F=this.togglers.contains(E);this.togglers.include(E);this.elements.include(C);var B=this.togglers.indexOf(E);E.addEvent(this.options.trigger,this.display.bind(this,B));if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight}C.setStyle("overflow","hidden");if(!F){for(var D in this.effects){C.setStyle(D,0)}}return this},display:function(B,C){C=$pick(C,true);B=($type(B)=="element")?this.elements.indexOf(B):B;if((this.timer&&this.options.wait)||(B===this.previous&&!this.options.alwaysHide)){return this}this.previous=B;var D={};this.elements.each(function(G,F){D[F]={};var E=(F!=B)||(this.options.alwaysHide&&(G.offsetHeight>0));this.fireEvent(E?"background":"active",[this.togglers[F],G]);for(var H in this.effects){D[F][H]=E?0:G[this.effects[H]]}},this);return C?this.start(D):this.set(D)}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(B){return this.parent(this.element.position($merge(this.options,B,{returnPos:true})))}});Element.Properties.move={set:function(B){var C=this.retrieve("move");if(C){C.cancel()}return this.eliminate("move").store("move:options",$extend({link:"cancel"},B))},get:function(B){if(B||!this.retrieve("move")){if(B||!this.retrieve("move:options")){this.set("move",B)}this.store("move",new Fx.Move(this,this.retrieve("move:options")))}return this.retrieve("move")}};Element.implement({move:function(B){this.get("move").start(B);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 E=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var G=(this.element.style.height===""||this.element.style.height=="auto");this.element.setStyle("display","block");if(this.options.transitionOpacity){E.opacity=1}var C={};$each(E,function(I,H){C[H]=[I,0]},this);var F=this.element.getStyle("overflow");this.element.setStyle("overflow","hidden");var B=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false;$each(E,function(I,H){E[H]=I},this);this.element.setStyles($merge({display:"none",overflow:F},E));if(G){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""}if(["width","both"].contains(this.options.mode)){this.element.style.width=""}}if(B){B.setStyle("visibility","visible")}}this.fireEvent("hide",this.element);this.callChain()}.bind(this));if(B){B.setStyle("visibility","hidden")}this.start(C)}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(D){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 G,E;this.element.measure(function(){G=(this.element.style.height===""||this.element.style.height=="auto");E=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode})}.bind(this));$each(E,function(I,H){E[H]=I});if($chk(this.options.heightOverride)){E.height=this.options.heightOverride.toInt()}if($chk(this.options.widthOverride)){E.width=this.options.widthOverride.toInt()}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);E.opacity=1}var C={height:0,display:this.options.display};$each(E,function(I,H){C[H]=0});var F=this.element.getStyle("overflow");this.element.setStyles($merge(C,{overflow:"hidden"}));var B=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;if(B){B.setStyle("visibility","hidden")}this.start(E);this.$chain.unshift(function(){this.element.setStyle("overflow",F);if(!this.options.heightOverride&&G){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(B){B.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(D){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(B){var C=this.retrieve("reveal");if(C){C.cancel()}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},B))},get:function(B){if(B||!this.retrieve("reveal")){if(B||!this.retrieve("reveal:options")){this.set("reveal",B)}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(B){this.get("reveal",B).reveal();return this},dissolve:function(B){this.get("reveal",B).dissolve();return this},nix:function(){var B=Array.link(arguments,{destroy:Boolean.type,options:Object.type});this.get("reveal",B.options).dissolve().chain(function(){this[B.destroy?"destroy":"dispose"]()}.bind(this));return this},wink:function(){var C=Array.link(arguments,{duration:Number.type,options:Object.type});var B=this.get("reveal",C.options);B.reveal().chain(function(){(function(){B.dissolve()}).delay(C.duration||2000)})}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(C,B){this.element=this.subject=$(C);this.parent(B);var E=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=$(this.element.getDocument().body)}var D=this.element;if(this.options.wheelStops){this.addEvent("start",function(){D.addEvent("mousewheel",E)},true);this.addEvent("complete",function(){D.removeEvent("mousewheel",E)},true)}},set:function(){var B=Array.flatten(arguments);this.element.scrollTo(B[0],B[1])},compute:function(D,C,B){return[0,1].map(function(E){return Fx.compute(D[E],C[E],B)})},start:function(D,I){if(!this.check(D,I)){return this}var F=this.element.getSize(),G=this.element.getScrollSize();var C=this.element.getScroll(),E={x:D,y:I};for(var H in E){var B=G[H]-F[H];if($chk(E[H])){E[H]=($type(E[H])=="number")?E[H].limit(0,B):B}else{E[H]=C[H]}E[H]+=this.options.offset[H]}return this.parent([C.x,C.y],[E.x,E.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(C){var B=$(C).getPosition(this.element);return this.start(B.x,B.y)}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(C,B){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=$(C);this.parent(B);var D=this.element.retrieve("wrapper");this.wrapper=D||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(B){this.element.setStyle(this.margin,B[0]);this.wrapper.setStyle(this.layout,B[1]);return this},compute:function(D,C,B){return[0,1].map(function(E){return Fx.compute(D[E],C[E],B)})},start:function(C,F){if(!this.check(C,F)){return this}this[F||this.options.mode]();var E=this.element.getStyle(this.margin).toInt();var D=this.wrapper.getStyle(this.layout).toInt();var B=[[E,D],[0,this.offset]];var H=[[E,D],[-this.offset,0]];var G;switch(C){case"in":G=B;break;case"out":G=H;break;case"toggle":G=(D==0)?B:H}return this.parent(G[0],G[1])},slideIn:function(B){return this.start("in",B)},slideOut:function(B){return this.start("out",B)},hide:function(B){this[B||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(B){this[B||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(B){return this.start("toggle",B)}});Element.Properties.slide={set:function(C){var B=this.retrieve("slide");if(B){B.cancel()}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},C))},get:function(B){if(B||!this.retrieve("slide")){if(B||!this.retrieve("slide:options")){this.set("slide",B)}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")))}return this.retrieve("slide")}};Element.implement({slide:function(E,F){E=E||"toggle";var C=this.get("slide"),B;switch(E){case"hide":C.hide(F);break;case"show":C.show(F);break;case"toggle":var D=this.retrieve("slide:flag",C.open);C[D?"slideOut":"slideIn"](F);this.store("slide:flag",!D);B=true;break;default:C.start(E,F)}if(!B){this.eliminate("slide:flag")}return this}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(C,D){D=D||document;this.doc=D.getDocument();var E=D.getWindow();this.parent(this.doc,C);this.links=this.options.links?$$(this.options.links):$$(this.doc.links);var B=E.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(G){if(G.href.indexOf(B)!=0){return }var F=G.href.substr(B.length);if(F){this.useLink(G,F)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){E.location.hash=this.anchor},true)}},useLink:function(D,B){var C;D.addEvent("click",function(E){if(C!==false&&!C){C=$(B)||this.doc.getElement("a[name="+B+"]")}if(C){E.preventDefault();this.anchor=B;this.toElement(C);D.blur()}}.bind(this))}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(C,B){this.parent(C,B);this.elements.each(function(D){if(D.getStyle("position")=="static"){D.setStyle("position","relative")}});this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(C,B){return B})},sort:function(F){if($type(F)!="array"){return false}var J=0;var B=0;var I={};var E=this.options.mode=="vertical";var G=this.elements.map(function(N,K){var M=N.getComputedSize({styles:["border","padding","margin"]});var O;if(E){O={top:J,margin:M["margin-top"],height:M.totalHeight};J+=O.height-M["margin-top"]}else{O={left:B,margin:M["margin-left"],width:M.totalWidth};B+=O.width}var L=E?"top":"left";I[K]={};var P=N.getStyle(L).toInt();I[K][L]=P||0;return O},this);this.set(I);F=F.map(function(K){return K.toInt()});if(F.length!=this.elements.length){this.currentOrder.each(function(K){if(!F.contains(K)){F.push(K)}});if(F.length>this.elements.length){F.splice(this.elements.length-1,F.length-this.elements.length)}}J=0;B=0;var C=0;var D={};F.each(function(M,K){var L={};if(E){L.top=J-G[M].top-C;J+=G[M].height}else{L.left=B-G[M].left;B+=G[M].width}C=C+G[M].margin;D[M]=L},this);var H={};$A(F).sort().each(function(K){H[K]=D[K]});this.start(H);this.currentOrder=F;return this},rearrangeDOM:function(B){B=B||this.currentOrder;var C=this.elements[0].getParent();var D=[];this.elements.setStyle("opacity",0);B.each(function(E){D.push(this.elements[E].inject(C).setStyles({top:0,left:0}))},this);this.elements.setStyle("opacity",1);this.elements=$$(D);this.setDefaultOrder();return this},getDefaultOrder:function(){return this.elements.map(function(C,B){return B})},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(B){return this.sort(B.map(function(C){return this.elements.indexOf(C)},this))},swap:function(D,C){if($type(D)=="element"){D=this.elements.indexOf(D)}if($type(C)=="element"){C=this.elements.indexOf(C)}var B=$A(this.currentOrder);B[this.currentOrder.indexOf(D)]=C;B[this.currentOrder.indexOf(C)]=D;this.sort(B)}});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 C=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(C.element);this.document=this.element.getDocument();this.setOptions(C.options||{});var B=$type(this.options.handle);this.handles=((B=="array"||B=="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(D){if(this.options.preventDefault){D.preventDefault()}this.mouse.start=D.page;this.fireEvent("beforeStart",this.element);var B=this.options.limit;this.limit={x:[],y:[]};for(var E in this.options.modifiers){if(!this.options.modifiers[E]){continue}if(this.options.style){this.value.now[E]=this.element.getStyle(this.options.modifiers[E]).toInt()}else{this.value.now[E]=this.element[this.options.modifiers[E]]}if(this.options.invert){this.value.now[E]*=-1}this.mouse.pos[E]=D.page[E]-this.value.now[E];if(B&&B[E]){for(var C=2;C--;C){if($chk(B[E][C])){this.limit[E][C]=$lambda(B[E][C])()}}}}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(B){if(this.options.preventDefault){B.preventDefault()}var C=Math.round(Math.sqrt(Math.pow(B.page.x-this.mouse.start.x,2)+Math.pow(B.page.y-this.mouse.start.y,2)));if(C>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,B]).fireEvent("snap",this.element)}},drag:function(B){if(this.options.preventDefault){B.preventDefault()}this.mouse.now=B.page;for(var C in this.options.modifiers){if(!this.options.modifiers[C]){continue}this.value.now[C]=this.mouse.now[C]-this.mouse.pos[C];if(this.options.invert){this.value.now[C]*=-1}if(this.options.limit&&this.limit[C]){if($chk(this.limit[C][1])&&(this.value.now[C]>this.limit[C][1])){this.value.now[C]=this.limit[C][1]}else{if($chk(this.limit[C][0])&&(this.value.now[C]<this.limit[C][0])){this.value.now[C]=this.limit[C][0]}}}if(this.options.grid[C]){this.value.now[C]-=((this.value.now[C]-this.limit[C][0])%this.options.grid[C])}if(this.options.style){this.element.setStyle(this.options.modifiers[C],this.value.now[C]+this.options.unit)}else{this.element[this.options.modifiers[C]]=this.value.now[C]}}this.fireEvent("drag",[this.element,B])},cancel:function(B){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(B){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(B){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(B){this.fireEvent("complete",[this.element,B])}}});Element.implement({makeResizable:function(B){var C=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},B));this.store("resizer",C);return C.addEvent("drag",function(){this.fireEvent("resize",C)}.bind(this))}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(D,C){this.parent(D,C);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body)}var B=this.element.getStyle("position");if(B=="static"){B="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",B);this.addEvent("start",this.checkDroppables,true);this.overed=null},start:function(G){if(this.container){var C=this.container.getCoordinates(this.element.getOffsetParent()),D={},F={};["top","right","bottom","left"].each(function(H){D[H]=this.container.getStyle("border-"+H).toInt();F[H]=this.element.getStyle("margin-"+H).toInt()},this);var E=this.element.offsetWidth+F.left+F.right;var B=this.element.offsetHeight+F.top+F.bottom;if(this.options.includeMargins){$each(F,function(I,H){F[H]=0})}if(this.container==this.element.getOffsetParent()){this.options.limit={x:[0-F.left,C.right-D.left-D.right-E+F.right],y:[0-F.top,C.bottom-D.top-D.bottom-B+F.bottom]}}else{this.options.limit={x:[C.left+D.left-F.left,C.right-D.right-E+F.right],y:[C.top+D.top-F.top,C.bottom-D.bottom-B+F.bottom]}}}if(this.options.precalculate){this.positions=this.droppables.map(function(H){return H.getCoordinates()})}this.parent(G)},checkAgainst:function(D,C){D=(this.positions)?this.positions[C]:D.getCoordinates();var B=this.mouse.now;return(B.x>D.left&&B.x<D.right&&B.y<D.bottom&&B.y>D.top)},checkDroppables:function(){var B=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=B){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(B){this.fireEvent("enter",[this.element,B])}this.overed=B}},drag:function(B){this.parent(B);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables()}},stop:function(B){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,B]);this.overed=null;return this.parent(B)}});Element.implement({makeDraggable:function(B){var C=new Drag.Move(this,B);this.store("dragger",C);return C}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(B){if(this.options.snap){B=this.toPosition(this.step)}this.knob.setStyle(this.property,B)},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(G,B,F){this.setOptions(F);this.element=$(G);this.knob=$(B);this.previousChange=this.previousEnd=this.step=-1;var H,C={},E={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";H="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";H="offsetWidth"}this.half=this.knob[H]/2;this.full=this.element[H]-this.knob[H]+(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);E[this.axis]=this.property;C[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 D={snap:0,limit:C,modifiers:E,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){D.grid=Math.ceil(this.stepWidth);D.limit[this.axis][1]=this.full}this.drag=new Drag(this.knob,D);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(B){if(!((this.range>0)^(B<this.min))){B=this.min}if(!((this.range>0)^(B>this.max))){B=this.max}this.step=Math.round(B);this.checkStep();this.fireEvent("tick",this.toPosition(this.step));this.end();return this},clickedElement:function(D){if(this.isDragging||D.target==this.knob){return }var C=this.range<0?-1:1;var B=D.page[this.axis]-this.element.getPosition()[this.axis]-this.half;B=B.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+C*this.toStep(B));this.checkStep();this.fireEvent("tick",B);this.end()},scrolledElement:function(B){var C=(this.options.mode=="horizontal")?(B.wheel<0):(B.wheel>0);this.set(C?this.step-this.stepSize:this.step+this.stepSize);B.stop()},draggedKnob:function(){var C=this.range<0?-1:1;var B=this.drag.value.now[this.axis];B=B.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+C*this.toStep(B));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(B){var C=(B+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(C-=C%this.stepSize):C},toPosition:function(B){return(this.full*Math.abs(this.min-B))/(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(B,C){this.setOptions(C);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(B)||B));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(B){this.elements.push(B);var C=B.retrieve("sortables:start",this.start.bindWithEvent(this,B));(this.options.handle?B.getElement(this.options.handle)||B:B).addEvent("mousedown",C)},this);return this},addLists:function(){Array.flatten(arguments).each(function(B){this.lists.push(B);this.addItems(B.getChildren())},this);return this},removeItems:function(){return $$(Array.flatten(arguments).map(function(B){this.elements.erase(B);var C=B.retrieve("sortables:start");(this.options.handle?B.getElement(this.options.handle)||B:B).removeEvent("mousedown",C);return B},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(B){this.lists.erase(B);this.removeItems(B.getChildren());return B},this))},getClone:function(C,B){if(!this.options.clone){return new Element("div").inject(document.body)}if($type(this.options.clone)=="function"){return this.options.clone.call(this,C,B,this.list)}return B.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:B.getStyle("width")}).inject(this.list).position(B.getPosition(B.getOffsetParent()))},getDroppables:function(){var B=this.list.getChildren();if(!this.options.constrain){B=this.lists.concat(B).erase(this.list)}return B.erase(this.clone).erase(this.element)},insert:function(D,C){var B="inside";if(this.lists.contains(C)){this.list=C;this.drag.droppables=this.getDroppables()}else{B=this.element.getAllPrevious().contains(C)?"before":"after"}this.element.inject(C,B);this.fireEvent("sort",[this.element,this.clone])},start:function(C,B){if(!this.idle){return }this.idle=false;this.element=B;this.opacity=B.get("opacity");this.list=B.getParent();this.clone=this.getClone(C,B);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){C.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(C)},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var B=this.element.getStyles("width","height");var C=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:C.top,left:C.left,width:B.width,height:B.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 D=Array.link(arguments,{modifier:Function.type,index:$defined});var C=this.lists.map(function(E){return E.getChildren().map(D.modifier||function(F){return F.get("id")},this)},this);var B=D.index;if(this.lists.length==1){B=0}return $chk(B)&&B>=0&&B<this.lists.length?C[B]:C}});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(B){this.setOptions(B);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(D){if(!$chk(arguments[1])&&!this.check(D)){return this}var F=$type(D),B=this.options,C=$chk(arguments[1])?arguments[1]:this.requests++;if(F=="string"||F=="element"){D={data:D}}D=$extend({data:B.data,url:B.url},D);if(!$chk(this.triesRemaining[C])){this.triesRemaining[C]=this.options.retries}var E=this.triesRemaining[C];(function(){var G=this.getScript(D);this.log("JSONP retrieving script with url: "+G.get("src"));this.fireEvent("request",G);this.running=true;(function(){if(E){this.triesRemaining[C]=E-1;if(G){G.destroy();this.request(D,C);this.fireEvent("retry",this.triesRemaining[C])}}else{if(G&&this.options.timeout){G.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(D){var C=Request.JSONP.counter,E;Request.JSONP.counter++;switch($type(D.data)){case"element":E=$(D.data).toQueryString();break;case"object":case"hash":E=Hash.toQueryString(D.data)}var F=D.url+(D.url.test("\\?")?"&":"?")+(D.callbackKey||this.options.callbackKey)+"=Request.JSONP.request_map.request_"+C+(E?"&"+E:"");if(F.length>2083){this.log("JSONP "+F+" will fail in Internet Explorer, which enforces a 2083 bytes length limit on URIs")}var B=new Element("script",{type:"text/javascript",src:F});Request.JSONP.request_map["request_"+C]=function(G){this.success(G,B)}.bind(this);return B.inject(this.options.injectScript)},success:function(C,B){if(B){B.destroy()}this.running=false;this.log("JSONP successfully retrieved: ",C);this.fireEvent("complete",[C]).fireEvent("success",[C]).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(B){this.setOptions(B);this.requests=new Hash;this.addRequests(this.options.requests);this.queue=[];this.reqBinders={}},addRequest:function(B,C){this.requests.set(B,C);this.attach(B,C);return this},addRequests:function(B){$each(B,this.addRequest,this);return this},getName:function(B){return this.requests.keyOf(B)},attach:function(B,C){if(C._groupSend){return this}["request","complete","cancel","success","failure","exception"].each(function(D){if(!this.reqBinders[B]){this.reqBinders[B]={}}this.reqBinders[B][D]=function(){this["on"+D.capitalize()].apply(this,[B,C].extend(arguments))}.bind(this);C.addEvent(D,this.reqBinders[B][D])},this);C._groupSend=C.send;C.send=function(D){this.send(B,D);return C}.bind(this);return this},removeRequest:function(C){var B=$type(C)=="object"?this.getName(C):C;if(!B&&$type(B)!="string"){return this}C=this.requests.get(B);if(!C){return this}["request","complete","cancel","success","failure","exception"].each(function(D){C.removeEvent(D,this.reqBinders[B][D])},this);C.send=C._groupSend;delete C._groupSend;return this},getRunning:function(){return this.requests.filter(function(B){return B.running})},isRunning:function(){return !!this.getRunning().getKeys().length},send:function(C,B){var D=function(){this.requests.get(C)._groupSend(B);this.queue.erase(D)}.bind(this);D.name=C;if(this.getRunning().getKeys().length>=this.options.concurrent||(this.error&&this.options.stopOnFailure)){this.queue.push(D)}else{D()}return this},hasNext:function(B){return(!B)?!!this.queue.length:!!this.queue.filter(function(C){return C.name==B}).length},resume:function(){this.error=false;(this.options.concurrent-this.getRunning().getKeys().length).times(this.runNext,this);return this},runNext:function(B){if(!this.queue.length){return this}if(!B){this.queue[0]()}else{var C;this.queue.each(function(D){if(!C&&D.name==B){C=true;D()}})}return this},runAll:function(){this.queue.each(function(B){B()});return this},clear:function(B){if(!B){this.queue.empty()}else{this.queue=this.queue.map(function(C){if(C.name!=B){return C}else{return false}}).filter(function(C){return C})}return this},cancel:function(B){this.requests.get(B).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(C){var B=(function(){if(!this.running){this.send({data:C})}});this.timer=B.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(D){$clear(this.timer);if(D){this.lastDelay=this.options.delay}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit)}this.timer=B.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(G,E){E=$extend({onload:$empty,document:document,check:$lambda(true)},E);var C=new Element("script",{src:G,type:"text/javascript"});var F=E.onload.bind(C),B=E.check,H=E.document;delete E.onload;delete E.check;delete E.document;C.addEvents({load:F,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){F()}}}).set(E);if(Browser.Engine.webkit419){var D=(function(){if(!$try(B)){return }$clear(D);F()}).periodical(50)}return C.inject(H.head)},css:function(C,B){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:C},B)).inject(document.head)},image:function(D,C){C=$merge({onload:$empty,onabort:$empty,onerror:$empty},C);var E=new Image();var B=$(E)||new Element("img");["load","abort","error"].each(function(F){var G="on"+F;var H=C[G];delete C[G];E[G]=function(){if(!E){return }if(!B.parentNode){B.width=E.width;B.height=E.height}E=E.onload=E.onabort=E.onerror=null;H.delay(1,B,B);B.fireEvent(F,B,1)}});E.src=B.src=D;if(E&&E.complete){E.onload.delay(1)}return B.set(C)},images:function(E,D){D=$merge({onComplete:$empty,onProgress:$empty},D);E=$splat(E);var B=[];var C=0;return new Elements(E.map(function(F){return Asset.image(F,{onload:function(){D.onProgress.call(this,C,E.indexOf(F));C++;if(C==E.length){D.onComplete()}}})}))}};var Color=new Native({initialize:function(C,D){if(arguments.length>=3){D="rgb";C=Array.slice(arguments,0,3)}else{if(typeof C=="string"){if(C.match(/rgb/)){C=C.rgbToHex().hexToRgb(true)}else{if(C.match(/hsb/)){C=C.hsbToRgb()}else{C=C.hexToRgb(true)}}}}D=D||"rgb";switch(D){case"hsb":var B=C;C=C.hsbToRgb();C.hsb=B;break;case"hex":C=C.hexToRgb(true);break}C.rgb=C.slice(0,3);C.hsb=C.hsb||C.rgbToHsb();C.hex=C.rgbToHex();return $extend(C,this)}});Color.implement({mix:function(){var B=Array.slice(arguments);var D=($type(B.getLast())=="number")?B.pop():50;var C=this.slice();B.each(function(E){E=new Color(E);for(var F=0;F<3;F++){C[F]=Math.round((C[F]/100*(100-D))+(E[F]/100*D))}});return new Color(C,"rgb")},invert:function(){return new Color(this.map(function(B){return 255-B}))},setHue:function(B){return new Color([B,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(B){return new Color([this.hsb[0],B,this.hsb[2]],"hsb")},setBrightness:function(B){return new Color([this.hsb[0],this.hsb[1],B],"hsb")}});var $RGB=function(D,C,B){return new Color([D,C,B],"rgb")};var $HSB=function(D,C,B){return new Color([D,C,B],"hsb")};var $HEX=function(B){return new Color(B,"hex")};Array.implement({rgbToHsb:function(){var C=this[0],D=this[1],K=this[2];var H,G,I;var J=Math.max(C,D,K),F=Math.min(C,D,K);var L=J-F;I=J/255;G=(J!=0)?L/J:0;if(G==0){H=0}else{var E=(J-C)/L;var B=(J-D)/L;var M=(J-K)/L;if(C==J){H=M-B}else{if(D==J){H=2+E-M}else{H=4+B-E}}H/=6;if(H<0){H++}}return[Math.round(H*360),Math.round(G*100),Math.round(I*100)]},hsbToRgb:function(){var D=Math.round(this[2]/100*255);if(this[1]==0){return[D,D,D]}else{var B=this[0]%360;var F=B%60;var G=Math.round((this[2]*(100-this[1]))/10000*255);var E=Math.round((this[2]*(6000-this[1]*F))/600000*255);var C=Math.round((this[2]*(6000-this[1]*(60-F)))/600000*255);switch(Math.floor(B/60)){case 0:return[D,C,G];case 1:return[E,D,G];case 2:return[G,D,C];case 3:return[G,E,D];case 4:return[C,G,D];case 5:return[D,G,E]}}return false}});String.implement({rgbToHsb:function(){var B=this.match(/\d{1,3}/g);return(B)?B.rgbToHsb():null},hsbToRgb:function(){var B=this.match(/\d{1,3}/g);return(B)?B.hsbToRgb():null}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={}},addEvent:function(C,B){this.checker[C]=this.checker[C]||{};this.events[C]=this.events[C]||[];if(this.events[C].contains(B)){return false}else{this.events[C].push(B)}this.instances.each(function(D,E){D.addEvent(C,this.check.bind(this,[C,D,E]))},this);return this},check:function(D,B,C){this.checker[D][C]=true;var E=this.instances.every(function(G,F){return this.checker[D][F]||false},this);if(!E){return }this.checker[D]={};this.events[D].each(function(F){F.call(this,this.instances,B)},this)}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(C,B){this.parent(C,B);this.load()},save:function(){var B=JSON.encode(this.hash);if(!B||B.length>4096){return false}if(B=="{}"){this.dispose()}else{this.write(B)}return true},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this}});Hash.each(Hash.prototype,function(C,B){if(typeof C=="function"){Hash.Cookie.implement(B,function(){var D=C.apply(this.hash,arguments);if(this.options.autoSave){this.save()}return D})}});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(C,B){this.element=$(C);if(this.occlude()){return this.occluded}this.setOptions(B);this.makeShim();return this},makeShim:function(){if(this.options.browsers){var D=this.element.getStyle("zIndex").toInt();if(!D){var C=this.element.getStyle("position");if(C=="static"||!C){this.element.setStyle("position","relative")}this.element.setStyle("zIndex",D||1)}D=($chk(this.options.zIndex)&&D>this.options.zIndex)?this.options.zIndex:D-1;if(D<0){D=1}this.shim=new Element("iframe",{src:(window.location.protocol=="https")?"://0":"javascript:void(0)",scrolling:"no",frameborder:0,styles:{zIndex:D,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this);var B=(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",B)}else{B()}}else{this.position=this.hide=this.show=this.dispose=$lambda(this)}},position:function(){if(!IframeShim.ready){return this}var B=this.element.measure(function(){return this.getSize()});if($type(this.options.margin)){B.x=B.x-(this.options.margin*2);B.y=B.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:B.x,height:B.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(B,C){this.element.scrollTo(B,C)},fps:50},initialize:function(C,B){this.setOptions(B);this.element=$(C);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(B){this.page=(this.listener.get("tag")=="body")?B.client:B.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this)}},scroll:function(){var C=this.element.getSize(),B=this.element.getScroll(),G=this.element.getOffsets(),D=this.element.getScrollSize(),F={x:0,y:0};for(var E in this.page){if(this.page[E]<(this.options.area+G[E])&&B[E]!=0){F[E]=(this.page[E]-this.options.area-G[E])*this.options.velocity}else{if(this.page[E]+this.options.area>(C[E]+G[E])&&B[E]+C[E]!=D[E]){F[E]=(this.page[E]-C[E]+this.options.area-G[E])*this.options.velocity}}}if(F.y||F.x){this.fireEvent("change",[B.x+F.x,B.y+F.y])}}});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(B){B.setStyle("visibility","visible")},onHide:function(B){B.setStyle("visibility","hidden")},title:"title",text:function(B){return B.get("rel")||B.get("href")},showDelay:100,hideDelay:100,className:null,offset:{x:16,y:16},fixed:false},initialize:function(){var B=Array.link(arguments,{options:Object.type,elements:$defined});if(B.options&&B.options.offsets){B.options.offset=B.options.offsets}this.setOptions(B.options);this.container=new Element("div",{"class":"tip"});this.tip=this.getTip();if(B.elements){this.attach(B.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(C){var B=function(E,D){if(E==null){return""}return $type(E)=="function"?E(D):D.get(E)};$$(C).each(function(E){var F=B(this.options.title,E);E.erase("title").store("tip:native",F).retrieve("tip:title",F);E.retrieve("tip:text",B(this.options.text,E));var D=["enter","leave"];if(!this.options.fixed){D.push("move")}D.each(function(G){E.addEvent("mouse"+G,E.retrieve("tip:"+G,this["element"+G.capitalize()].bindWithEvent(this,E)))},this)},this);return this},detach:function(B){$$(B).each(function(D){["enter","leave","move"].each(function(E){D.removeEvent("mouse"+E,D.retrieve("tip:"+E)||$empty)});D.eliminate("tip:enter").eliminate("tip:leave").eliminate("tip:move");if($type(this.options.title)=="string"&&this.options.title=="title"){var C=D.retrieve("tip:native");if(C){D.set("title",C)}}},this);return this},elementEnter:function(C,B){$A(this.container.childNodes).each(Element.dispose);["title","text"].each(function(E){var D=B.retrieve("tip:"+E);if(!D){return }this[E+"Element"]=new Element("div",{"class":"tip-"+E}).inject(this.container);this.fill(this[E+"Element"],D)},this);this.timer=$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this,B);this.tip.setStyle("display","block");this.position((!this.options.fixed)?C:{page:B.getPosition()})},elementLeave:function(C,B){$clear(this.timer);this.tip.setStyle("display","none");this.timer=this.hide.delay(this.options.hideDelay,this,B)},elementMove:function(B){this.position(B)},position:function(E){var C=window.getSize(),B=window.getScroll(),F={x:this.tip.offsetWidth,y:this.tip.offsetHeight},D={x:"left",y:"top"},G={};for(var H in D){G[D[H]]=E.page[H]+this.options.offset[H];if((G[D[H]]+F[H]-B[H])>C[H]){G[D[H]]=E.page[H]-this.options.offset[H]-F[H]}}this.tip.setStyles(G)},fill:function(B,C){if(typeof C=="string"){B.set("html",C)}else{B.adopt(C)}},show:function(B){this.fireEvent("show",[this.tip,B])},hide:function(B){this.fireEvent("hide",[this.tip,B])}});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(B){return(B>3&&B<21)?"th":["th","st","nd","rd","th"][Math.min(B%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 C=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var B=0;B<C.length;++B){window.console[C[B]]=function(){}}}});Class.Mutators.Family=function(B,C){if($defined(C)){B.$family={name:C};$[C]=$.object;return B}else{this.implement("$family",{name:B})}};if(typeof Jx=="undefined"){var Jx={};(function(){var D=document.getElementsByTagName("SCRIPT");for(var B=0;B<D.length;B++){var C=D[B].src;var E=/(.*[jx|js|lib])\/jxlib(.*)/.exec(C);if(E&&E[0]){Jx.aPixel=document.createElement("img",{alt:"",title:""});Jx.aPixel.src=E[1]+"/a_pixel.png";Jx.baseURL=Jx.aPixel.src.substring(0,Jx.aPixel.src.indexOf("a_pixel.png"))}}var F=D[0].src;if(F.contains("app:")){Jx.isAir=true}else{Jx.isAir=false}})()}Jx.applyPNGFilter=function(D){var B=Jx.aPixel.src;if(D.src!=B){var C=D.src;D.src=B;D.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+C+"',sizingMethod='scale')"}};Jx.imgQueue=[];Jx.imgLoaded={};Jx.imagesLoading=0;Jx.addToImgQueue=function(B){if(Jx.imgLoaded[B.src]){B.element.src=B.src}else{Jx.imgQueue.push(B);Jx.imgLoaded[B.src]=true}Jx.checkImgQueue()};Jx.checkImgQueue=function(){while(Jx.imagesLoading<2&&Jx.imgQueue.length>0){Jx.loadNextImg()}};Jx.loadNextImg=function(){var B=Jx.imgQueue.shift();if(B){++Jx.imagesLoading;B.element.onload=function(){--Jx.imagesLoading;Jx.checkImgQueue()};B.element.onerror=function(){--Jx.imagesLoading;Jx.checkImgQueue()};B.element.src=B.src}};Jx.createIframeShim=function(){return new Element("iframe",{"class":"jxIframeShim",scrolling:"no",frameborder:0})};Jx.getNumber=function(D,C){var B=D===null||isNaN(parseInt(D,10))?(C||0):parseInt(D,10);return B};Jx.getPageDimensions=function(){return{width:window.getWidth(),height:window.getHeight()}};Element.implement({getBoxSizing:function(){var C="content-box";if(Browser.Engine.trident||Browser.Engine.presto){var B=document.compatMode;if(B=="BackCompat"||B=="QuirksMode"){C="border-box"}else{C="content-box"}}else{if(arguments.length===0){node=document.documentElement}var D=this.getStyle("-moz-box-sizing");if(!D){D=this.getStyle("box-sizing")}C=(D?D:"content-box")}return C},getContentBoxSize:function(){var B=this.offsetWidth;var D=this.offsetHeight;var E=this.getPaddingSize();var C=this.getBorderSize();B=B-E.left-E.right-C.left-C.right;D=D-E.bottom-E.top-C.bottom-C.top;return{width:B,height:D}},getBorderBoxSize:function(){var B=this.offsetWidth;var C=this.offsetHeight;return{width:B,height:C}},getMarginBoxSize:function(){var D=this.getMarginSize();var B=this.offsetWidth+D.left+D.right;var C=this.offsetHeight+D.top+D.bottom;return{width:B,height:C}},setContentBoxSize:function(D){if(this.getBoxSizing()=="border-box"){var F=this.getPaddingSize();var C=this.getBorderSize();if(typeof D.width!="undefined"){var E=(D.width+F.left+F.right+C.left+C.right);if(E<0){E=0}this.style.width=E+"px"}if(typeof D.height!="undefined"){var B=(D.height+F.top+F.bottom+C.top+C.bottom);if(B<0){B=0}this.style.height=B+"px"}}else{if(typeof D.width!="undefined"){this.style.width=D.width+"px"}if(typeof D.height!="undefined"){this.style.height=D.height+"px"}}},setBorderBoxSize:function(D){if(this.getBoxSizing()=="content-box"){var G=this.getPaddingSize();var C=this.getBorderSize();var F=this.getMarginSize();if(typeof D.width!="undefined"){var E=(D.width-G.left-G.right-C.left-C.right-F.left-F.right);if(E<0){E=0}this.style.width=E+"px"}if(typeof D.height!="undefined"){var B=(D.height-G.top-G.bottom-C.top-C.bottom-F.top-F.bottom);if(B<0){B=0}this.style.height=B+"px"}}else{if(typeof D.width!="undefined"&&D.width>=0){this.style.width=D.width+"px"}if(typeof D.height!="undefined"&&D.height>=0){this.style.height=D.height+"px"}}},getPaddingSize:function(){var C=Jx.getNumber(this.getStyle("padding-left"));var D=Jx.getNumber(this.getStyle("padding-top"));var E=Jx.getNumber(this.getStyle("padding-right"));var B=Jx.getNumber(this.getStyle("padding-bottom"));return{left:C,top:D,right:E,bottom:B}},getBorderSize:function(){var C=Jx.getNumber(this.getStyle("border-left-width"));var D=Jx.getNumber(this.getStyle("border-top-width"));var E=Jx.getNumber(this.getStyle("border-right-width"));var B=Jx.getNumber(this.getStyle("border-bottom-width"));return{left:C,top:D,right:E,bottom:B}},getMarginSize:function(){var C=Jx.getNumber(this.getStyle("margin-left"));var D=Jx.getNumber(this.getStyle("margin-top"));var E=Jx.getNumber(this.getStyle("margin-right"));var B=Jx.getNumber(this.getStyle("margin-bottom"));return{left:C,top:D,right:E,bottom:B}},descendantOf:function(C){var B=$(this.parentNode);while(B!=C&&B&&B.parentNode&&B.parentNode!=B){B=$(B.parentNode)}return B==C},findElement:function(C){var D=this;var B=D.tagName;while(D.tagName!=C&&D&&D.parentNode&&D.parentNode!=D){D=$(D.parentNode)}return D.tagName==C?D:false}});Jx.ContentLoader=new Class({contentIsLoaded:false,loadContent:function(B){B=$(B);if(this.options.content){var D;if(this.options.content.domObj){D=$(this.options.content.domObj)}else{D=$(this.options.content)}if(D){if(this.options.content.addTo){this.options.content.addTo(B)}else{B.appendChild(D)}this.contentIsLoaded=true}else{B.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(E){B.innerHTML=E;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 C=$defined(this.options.timeout)?this.options.timeout:10000;this.reqTimeout=this.checkRequest.delay(C,this)}}else{this.contentIsLoaded=true}}if(this.options.contentId){B.id=this.options.contentId}if(this.contentIsLoaded){this.fireEvent("contentLoaded",this)}},processContent:function(B){$A(B.childNodes).each(function(C){if(C.tagName=="INPUT"||C.tagName=="SELECT"||C.tagName=="TEXTAREA"){if(C.type=="button"){C.addEvent("click",function(){this.fireEvent("click",this,C)})}else{C.addEvent("change",function(){this.fireEvent("change",C)})}}else{if(C.childNodes){this.processContent(C)}}},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(H,D,Q){H=$(H);D=$(D);var C=$splat(Q.horizontal||["center center"]);var I=$splat(Q.vertical||["center center"]);var G=$merge({top:0,right:0,bottom:0,left:0},Q.offsets||{});var N=D.getCoordinates();var K;var M;if(!$(H.parentNode)||H.parentNode==document.body){K=Jx.getPageDimensions();M=$(document.body).getScroll()}else{K=$(H.parentNode).getContentBoxSize();M=$(H.parentNode).getScroll()}if(D==document.body){N.left+=M.x;N.top+=M.y}else{if(H.parentNode==D){N.left=0;N.top=0}}var P=H.getMarginBoxSize();var F;var O;var L;var B;var E;if(!C.some(function(R){var S=R.split(" ");if(S.length!=2){return false}if(!isNaN(parseInt(S[0],10))){E=parseInt(S[0],10);if(E>=0){F=E}else{F=N.left+N.width+E}}else{switch(S[0]){case"right":F=N.left+N.width;break;case"center":F=N.left+Math.round(N.width/2);break;case"left":default:F=N.left;break}}if(!isNaN(parseInt(S[1],10))){E=parseInt(S[1],10);if(E<0){O=F+E;F=O-P.width}else{F+=E;O=F+P.width}O=N.left+N.width+parseInt(S[1],10);F=O-P.width}else{switch(S[1]){case"left":F-=G.left;O=F+P.width;break;case"right":F+=G.right;O=F;F=F-P.width;break;case"center":default:F=F-Math.round(P.width/2);O=F+P.width;break}}return(F>=M.x&&O<=M.x+K.width)})){if(O>K.width){F=M.x+K.width-P.width}if(F<0){F=0}}H.setStyle("left",F);if(!I.some(function(R){var S=R.split(" ");if(S.length!=2){return false}if(!isNaN(parseInt(S[0],10))){L=parseInt(S[0],10)}else{switch(S[0]){case"bottom":L=N.top+N.height;break;case"center":L=N.top+Math.round(N.height/2);break;case"top":default:L=N.top;break}}if(!isNaN(parseInt(S[1],10))){var T=parseInt(S[1],10);if(T>=0){L+=T;B=L+P.height}else{B=L+T;L=B-P.height}}else{switch(S[1]){case"top":L-=G.top;B=L+P.height;break;case"bottom":L+=G.bottom;B=L;L=L-P.height;break;case"center":default:L=L-Math.round(P.height/2);B=L+P.height;break}}return(L>=M.y&&B<=M.y+K.height)})){if(B>K.height){L=M.y+K.height-P.height}if(L<0){L=0}}H.setStyle("top",L);var J=H.retrieve("jxLayout");if(J){J.options.left=F;J.options.top=L}}});Jx.Chrome=new Class({chrome:null,makeChrome:function(B){var D=new Element("div",{"class":"jxChrome",events:{contextmenu:function(E){E.stop()}}});B.adopt(D);this.chromeOffsets=D.getPaddingSize();D.setStyle("padding",0);var C=D.getStyle("backgroundImage");if(C!=null){if(!(C.contains("http://")||C.contains("https://")||C.contains("file://")||C.contains("app:/"))){C=null}else{C=C.slice(4,-1);if(C.charAt(0)=='"'){C=C.slice(1,-1)}D.setStyle("backgroundImage","none");["TR","TL","BL","BR"].each(function(E){D.adopt(new Element("div",{"class":"jxChrome"+E}).adopt(new Element("img",{"class":"png24",src:C,alt:"",title:""})))},this)}}if(!window.opera){D.adopt(Jx.createIframeShim())}D.dispose();this.chrome=D},showChrome:function(B){B=$(B);if(!this.chrome){this.makeChrome(B)}this.resizeChrome(B);if(B&&this.chrome.parentNode!==B){B.adopt(this.chrome)}},hideChrome:function(){if(this.chrome){this.chrome.dispose()}},resizeChrome:function(B){if(this.chrome&&Browser.Engine.trident){this.chrome.setContentBoxSize($(B).getBorderBoxSize())}}});Jx.Addable=new Class({addable:null,addTo:function(B,C){$(this.addable||this.domObj).inject(B,C);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(E){this.setOptions(E);var I=new Element(this.options.container,{"class":"jx"+this.options.type+"Container"});if(this.options.toggle&&this.options.toggleClass){I.addClass("jx"+this.options.type+this.options.toggleClass)}var H;var B;var D=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(J){J.stop()}).bindWithEvent(this),mousedown:(function(J){this.domA.addClass("jx"+this.options.type+"Pressed");H=true;B=true;this.focus()}).bindWithEvent(this),mouseup:(function(J){this.domA.removeClass("jx"+this.options.type+"Pressed");B=false}).bindWithEvent(this),mouseleave:(function(J){this.domA.removeClass("jx"+this.options.type+"Pressed")}).bindWithEvent(this),mouseenter:(function(J){if(H&&B){this.domA.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keydown:(function(J){if(J.key=="enter"){this.domA.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keyup:(function(J){if(J.key=="enter"){this.domA.removeClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),blur:function(){H=false}}});I.adopt(D);if(typeof Drag!="undefined"){new Drag(D,{modifiers:{x:null,y:null},onStart:function(){this.stop()}})}var G=new Element("span",{"class":"jx"+this.options.type+"Content"});D.adopt(G);if(this.options.image||!this.options.label){var F=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){F.setStyle("backgroundImage","url("+this.options.image+")")}G.appendChild(F);if(this.options.imageClass){F.addClass(this.options.imageClass)}this.domImg=F}var C=new Element("span",{html:this.options.label});if(this.options.label){C.addClass("jx"+this.options.type+"Label")}G.appendChild(C);if(this.options.id){I.id=this.options.id}if(this.options.halign=="left"){I.addClass("jx"+this.options.type+"ContentLeft")}if(this.options.valign=="top"){I.addClass("jx"+this.options.type+"ContentTop")}this.domA=D;this.domLabel=C;this.domObj=I;this.setEnabled(this.options.enabled);if(this.options.active){this.options.active=false;this.setActive(true)}},clicked:function(B){if(this.options.enabled){if(this.options.toggle){this.setActive(!this.options.active)}else{this.fireEvent("click",{obj:this,event:B})}}},isEnabled:function(){return this.options.enabled},setEnabled:function(B){this.options.enabled=B;if(this.options.enabled){this.domObj.removeClass("jxDisabled")}else{this.domObj.addClass("jxDisabled")}},isActive:function(){return this.options.active},setActive:function(B){if(this.options.active==B){return }this.options.active=B;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(C){this.options.image=C;if(C){if(!this.domImg){var B=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.imageClass){B.addClass(this.options.imageClass)}this.domA.firstChild.grab(B,"top");this.domImg=B}this.domImg.setStyle("backgroundImage","url("+this.options.image+")")}else{if(this.domImg){this.domImg.dispose();this.domImg=null}}},setLabel:function(B){this.domLabel.set("html",B);if(!B&&this.domLabel.hasClass("jxButtonLabel")){this.domLabel.removeClass("jxButtonLabel")}else{if(B&&!this.domLabel.hasClass("jxButtonLabel")){this.domLabel.addClass("jxButtonLabel")}}},getLabel:function(){return this.domLabel?this.domLabel.innerHTML:""},setTooltip:function(B){if(this.domA){this.domA.set({title:B,alt:B})}},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(B){if(!Jx.Button.Flyout.Stack){Jx.Button.Flyout.Stack=[]}this.parent(B);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(D){if(!this.options.enabled){return }if(!this.owner){this.owner=document.body;var C=$(this.domObj.parentNode);while(C!=document.body&&this.owner==document.body){var B=C.retrieve("jxFlyout");if(B){this.owner=B;break}else{C=$(C.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(E){if(E.resize){E.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(C){C=new Event(C);var D=$(C.target);var B=Jx.Button.Flyout.Stack[Jx.Button.Flyout.Stack.length-1];if(!D.descendantOf(B.content)&&!D.descendantOf(B.domObj)){B.hide()}},keypressHandler:function(B){B=new Event(B);if(B.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(C,B){this.setOptions(B);this.domObj=$(C);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(L){this.resizeTimer=null;var C=false;if(L){for(var G in L){if(G=="forceResize"){continue}if(this.options[G]!=L[G]){C=true;this.options[G]=L[G]}}if(L.forceResize){C=true}}if(!$(this.domObj.parentNode)){return }var D;if(this.domObj.parentNode.tagName=="BODY"){D=Jx.getPageDimensions()}else{D=$(this.domObj.parentNode).getContentBoxSize()}if(this.lastParentSize&&!C){C=(this.lastParentSize.width!=D.width||this.lastParentSize.height!=D.height)}else{C=true}this.lastParentSize=D;if(!C){return }var E,K,J,H;if(this.options.left!=null){E=this.options.left;if(this.options.right==null){if(this.options.width==null){J=D.width-E;if(J<this.options.minWidth){J=this.options.minWidth}if(this.options.maxWidth>=0&&J>this.options.maxWidth){J=this.options.maxWidth}}else{J=this.options.width}}else{if(this.options.width==null){J=D.width-E-this.options.right;if(J<this.options.minWidth){J=this.options.minWidth}if(this.options.maxWidth>=0&&J>this.options.maxWidth){J=this.options.maxWidth}}else{J=this.options.width}}}else{if(this.options.right==null){if(this.options.width==null){E=0;J=D.width;if(this.options.maxWidth>=0&&J>this.options.maxWidth){E=E+parseInt(J-this.options.maxWidth)/2;J=this.options.maxWidth}}else{J=this.options.width;E=parseInt((D.width-J)/2);if(E<0){E=0}}}else{if(this.options.width!=null){J=this.options.width;E=D.width-J-this.options.right;if(E<0){E=0}}else{E=0;J=D.width-this.options.right;if(J<this.options.minWidth){J=this.options.minWidth}if(this.options.maxWidth>=0&&J>this.options.maxWidth){E=J-this.options.maxWidth-this.options.right;J=this.options.maxWidth}}}}if(this.options.top!=null){K=this.options.top;if(this.options.bottom==null){if(this.options.height==null){H=D.height-K;if(H<this.options.minHeight){H=this.options.minHeight}if(this.options.maxHeight>=0&&H>this.options.maxHeight){H=this.options.maxHeight}}else{H=this.options.height;if(this.options.maxHeight>=0&&H>this.options.maxHeight){K=H-this.options.maxHeight;H=this.options.maxHeight}}}else{if(this.options.height==null){H=D.height-K-this.options.bottom;if(H<this.options.minHeight){H=this.options.minHeight}if(this.options.maxHeight>=0&&H>this.options.maxHeight){H=this.options.maxHeight}}else{H=this.options.height}}}else{if(this.options.bottom==null){if(this.options.height==null){K=0;H=D.height;if(H<this.options.minHeight){H=this.options.minHeight}if(this.options.maxHeight>=0&&H>this.options.maxHeight){K=parseInt((D.height-this.options.maxHeight)/2);H=this.options.maxHeight}}else{H=this.options.height;K=parseInt((D.height-H)/2);if(K<0){K=0}}}else{if(this.options.height!=null){H=this.options.height;K=D.height-H-this.options.bottom;if(K<0){K=0}}else{K=0;H=D.height-this.options.bottom;if(H<this.options.minHeight){H=this.options.minHeight}if(this.options.maxHeight>=0&&H>this.options.maxHeight){K=D.height-this.options.maxHeight-this.options.bottom;H=this.options.maxHeight}}}}var F={width:J};if(this.options.position=="absolute"){var I=$(this.domObj.parentNode).getPaddingSize();this.domObj.setStyles({position:this.options.position,left:E+I.left,top:K+I.top});F.height=H}else{if(this.options.height){F.height=this.options.height}}this.domObj.setBorderBoxSize(F);if(this.options.propagate){var B={forceResize:L?L.forceResize:false};$A(this.domObj.childNodes).each(function(M){if(M.resize&&M.getStyle("display")!="none"){M.resize.delay(0,M,B)}})}this.fireEvent("sizeChange",this)}});Jx.Button.Tab=new Class({Family:"Jx.Button.Tab",Extends:Jx.Button,Implements:[Jx.ContentLoader],content:null,initialize:function(C){this.parent($merge(C,{type:"Tab",toggle:true}));this.content=new Element("div",{"class":"tabContent"});new Jx.Layout(this.content,C);this.loadContent(this.content);var D=this;this.addEvent("down",function(){D.content.addClass("tabContentActive")});this.addEvent("up",function(){D.content.removeClass("tabContentActive")});if(this.options.close){this.domObj.addClass("jxTabClose");var B=new Element("a",{"class":"jxTabClose",events:{click:(function(){this.fireEvent("close")}).bind(this)}});B.adopt(new Element("img",{src:Jx.aPixel.src,alt:"",title:""}));this.domObj.adopt(B)}},clicked:function(B){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(D){this.setOptions(D);this.domObj=new Element("div",{id:this.options.id,"class":"jxColorPalette"});var I=new Element("div",{"class":"jxColorBar"});var R=new Element("div",{"class":"jxColorPreview"});this.selectedSwatch=new Element("div",{"class":"jxColorSelected"});this.previewSwatch=new Element("div",{"class":"jxColorHover"});R.adopt(this.selectedSwatch);R.adopt(this.previewSwatch);I.adopt(R);this.colorInputLabel=new Element("label",{"class":"jxColorLabel",html:"#"});I.adopt(this.colorInputLabel);var L=this.changed.bind(this);this.colorInput=new Element("input",{"class":"jxHexInput",type:"text",maxLength:6,events:{keyup:L,blur:L,change:L}});I.adopt(this.colorInput);this.alphaLabel=new Element("label",{"class":"jxAlphaLabel",html:this.options.alphaLabel});I.adopt(this.alphaLabel);this.alphaInput=new Element("input",{"class":"jxAlphaInput",type:"text",maxLength:3,events:{keyup:this.alphaChanged.bind(this)}});I.adopt(this.alphaInput);this.domObj.adopt(I);var J=this.swatchClick.bindWithEvent(this);var H=this.swatchOver.bindWithEvent(this);var Q=new Element("table",{"class":"jxColorGrid"});var B=new Element("tbody");Q.adopt(B);for(var O=0;O<12;O++){var C=new Element("tr");for(var M=-3;M<18;M++){var G=false;var K,P,S;if(M<0){if(M==-3||M==-1){K=P=S=0;G=true}else{if(O<6){K=P=S=O}else{if(O==6){K=5;P=0;S=0}else{if(O==7){K=0;P=5;S=0}else{if(O==8){K=0;P=0;S=5}else{if(O==9){K=5;P=5;S=0}else{if(O==10){K=0;P=5;S=5}else{if(O==11){K=5;P=0;S=5}}}}}}}}}else{K=parseInt(O/6)*3+parseInt(M/6);P=M%6;S=O%6}var E="#"+this.options.hexColors[K]+this.options.hexColors[P]+this.options.hexColors[S];var F=new Element("td");if(!G){F.setStyle("backgroundColor",E);var T=new Element("a",{"class":"colorSwatch "+(((K>2&&P>2)||(K>2&&S>2)||(P>2&&S>2))?"borderBlack":"borderWhite"),href:"javascript:void(0)",title:E,alt:E,events:{mouseover:H,click:J}});T.store("swatchColor",E);F.adopt(T)}else{F.addClass("emptyCell");var N=new Element("span");F.adopt(N)}C.adopt(F)}B.adopt(C)}this.domObj.adopt(Q);this.updateSelected();if(this.options.parent){this.addTo(this.options.parent)}},swatchOver:function(C){var B=C.target;this.previewSwatch.setStyle("backgroundColor",B.retrieve("swatchColor"))},swatchClick:function(C){var B=C.target;this.options.color=B.retrieve("swatchColor");this.updateSelected();this.fireEvent("click",this)},changed:function(){var B=this.colorInput.value;if(B.substring(0,1)=="#"){B=B.substring(1)}if(B.toLowerCase().match(/^[0-9a-f]{6}$/)){this.options.color="#"+B.toUpperCase();this.updateSelected()}},alphaChanged:function(){var B=this.alphaInput.value;if(B.match(/^[0-9]{1,3}$/)){this.options.alpha=parseFloat(B/100);this.updateSelected()}},setColor:function(B){this.colorInput.value=B;this.changed()},setAlpha:function(B){this.alphaInput.value=B;this.alphaChanged()},updateSelected:function(){var B={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){B.opacity=this.options.alpha;B.filter="Alpha(opacity="+(this.options.alpha*100)+")"}else{B.opacity="";B.filter=""}this.selectedSwatch.setStyles(B);this.previewSwatch.setStyles(B);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(B){if(!Jx.Button.Color.ColorPalette){Jx.Button.Color.ColorPalette=new Jx.ColorPalette(this.options)}var C=new Element("span",{"class":"jxButtonSwatch"});this.selectedSwatch=new Element("span");C.appendChild(this.selectedSwatch);this.colorChangeFn=this.changed.bind(this);this.hideFn=this.hide.bind(this);B.image=Jx.aPixel.src;this.parent(B);C.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(B){this.options.color=B;this.updateSwatch()},setAlpha:function(B){this.options.alpha=B;this.updateSwatch()},changed:function(B){var C=false;if(this.options.color!=B.options.color){this.options.color=B.options.color;C=true}if(this.options.alpha!=B.options.alpha*100){this.options.alpha=B.options.alpha*100;C=true}if(C){this.updateSwatch();this.fireEvent("change",this)}},updateSwatch:function(){var B={backgroundColor:this.options.color};if(this.options.alpha<100){B.filter="Alpha(opacity="+(this.options.alpha)+")";B.opacity=this.options.alpha/100}else{B.opacity="";B.filter=""}this.selectedSwatch.setStyles(B)}});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(B){this.setOptions(B);if(!Jx.Menu.Menus){Jx.Menu.Menus=[]}this.items=[];this.contentContainer=new Element("div",{"class":"jxMenuContainer",events:{contextmenu:function(C){C.stop()}}});this.subDomObj=new Element("ul",{"class":"jxMenu"});this.contentContainer.adopt(this.subDomObj);if(B){this.button=new Jx.Button($merge(B,{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(B){this.items.push(B);B.setOwner(this);this.subDomObj.adopt(B.domObj)},this);return this},deactivate:function(){this.hide()},onMouseOver:function(B){if(Jx.Menu.Menus[0]&&Jx.Menu.Menus[0]!=this){this.show({event:B})}},eventInMenu:function(E){var D=$(E.target);if(!D){return false}if(D.descendantOf(this.domObj)||D.descendantOf(this.subDomObj)){return true}else{var C=D.findElement("ul");if(C){var F=C.retrieve("jxSubMenu");if(F){var B=F.owner;while(B){if(B==this){return true}B=B.owner}}}return false}},hide:function(B){if(B){if(this.visibleItem&&this.visibleItem.eventInMenu){if(this.visibleItem.eventInMenu(B)){return }}else{if(this.eventInMenu(B)){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(C){C.hide(B)});document.removeEvent("mousedown",this.hideWatcher);document.removeEvent("keydown",this.keypressWatcher);this.contentContainer.setStyle("display","none");this.fireEvent("hide",this)},show:function(C){var B=C.event;if(Jx.Menu.Menus[0]){if(Jx.Menu.Menus[0]!=this){Jx.Menu.Menus[0].button.blur();Jx.Menu.Menus[0].hide(B)}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(B){}document.addEvent("mousedown",this.hideWatcher);document.addEvent("keydown",this.keypressWatcher);this.fireEvent("show",this)},setVisibleItem:function(B){if(this.visibleItem!=B){if(this.visibleItem&&this.visibleItem.hide){this.visibleItem.hide()}this.visibleItem=B;this.visibleItem.show()}},keypressHandler:function(B){B=new Event(B);if(B.key=="esc"){this.hide()}}});Jx.ButtonSet=new Class({Family:"Jx.ButtonSet",Implements:[Options,Events],buttons:null,initialize:function(B){this.setOptions(B);this.buttons=[];this.buttonChangedHandler=this.buttonChanged.bind(this)},add:function(){$A(arguments).each(function(B){if(B.domObj.hasClass("jx"+B.options.type+"Toggle")){B.domObj.removeClass("jx"+B.options.type+"Toggle");B.domObj.addClass("jx"+B.options.type+"Set")}B.addEvent("down",this.buttonChangedHandler);var C=this;B.setActive=function(D){if(this.options.active&&C.activeButton==this){return }else{Jx.Button.prototype.setActive.apply(this,[D])}};if(!this.activeButton||B.options.active){B.options.active=false;B.setActive(true)}this.buttons.push(B)},this);return this},remove:function(B){this.buttons.erase(B);if(this.activeButton==B){if(this.buttons.length){this.buttons[0].setActive(true)}B.removeEvent("down",this.buttonChangedHandler);B.setActive=Jx.Button.prototype.setActive}},setActiveButton:function(C){var B=this.activeButton;this.activeButton=C;if(B&&B!=C){B.setActive(false)}},buttonChanged:function(B){this.setActiveButton(B);this.fireEvent("change",this)}});Jx.Button.Multi=new Class({Family:"Jx.Button.Multi",Extends:Jx.Button,activeButton:null,buttons:null,initialize:function(D){this.parent(D);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 B=new Element("a",{"class":"jxButtonDisclose",href:"javascript:void(0)"});var C=this;var E;B.addEvents({click:(function(F){if(this.items.length===0){return }if(!C.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(E){B.addClass("jx"+this.options.type+"Pressed")}}).bind(this),mouseleave:(function(){$(this.domObj.firstChild).removeClass("jxButtonHover");B.removeClass("jx"+this.options.type+"Pressed")}).bind(this),mousedown:(function(F){B.addClass("jx"+this.options.type+"Pressed");E=true;this.focus()}).bindWithEvent(this),mouseup:(function(F){B.removeClass("jx"+this.options.type+"Pressed")}).bindWithEvent(this),keydown:(function(F){if(F.key=="enter"){B.addClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),keyup:(function(F){if(F.key=="enter"){B.removeClass("jx"+this.options.type+"Pressed")}}).bindWithEvent(this),blur:function(){E=false}});if(typeof Drag!="undefined"){new Drag(B,{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)});B.adopt(new Element("img",{src:Jx.aPixel.src,alt:"",title:""}));this.domObj.adopt(B);this.discloser=B;if(this.options.items){this.add(this.options.items)}},add:function(){$A(arguments).flatten().each(function(C){if(!C instanceof Jx.Button){return }this.buttons.push(C);var E=this.setButton.bind(this,C);var D=$merge(C.options,{toggle:true,onClick:E});if(!D.label){D.label="&nbsp;"}if(!D.image||D.image.indexOf("a_pixel")!=-1){delete D.image}var B=new Jx.Menu.Item(D);this.buttonSet.add(B);this.menu.add(B);C.multiButton=B;C.domA.addClass("jxButtonMulti");if(!this.activeButton){this.domA.dispose();this.setActiveButton(C)}},this)},remove:function(B){if(!B||!B.multiButton){return }if(this.menu.remove(B.multiButton)){B.multiButton=null;if(this.activeButton==B){if(!this.buttons.some(function(C){if(C!=B){this.setActiveButton(C);return true}else{return false}},this)){this.setActiveButton(null)}}this.buttons.erase(B)}},setActiveButton:function(B){if(this.activeButton){this.activeButton.domA.dispose();this.activeButton.domA.removeEvent(this.clickHandler)}if(B&&B.domA){this.domObj.grab(B.domA,"top");this.domA=B.domA;this.domA.addEvent("click",this.clickHandler);if(this.options.toggle){this.options.active=false;this.setActive(true)}}this.activeButton=B},setButton:function(B){this.setActiveButton(B);B.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(B){this.parent($merge({image:Jx.aPixel.src},B,{container:"li",type:"MenuItem",toggleClass:(B.image?null:this.options.toggleClass)}));this.domObj.addEvent("mouseover",this.onMouseOver.bindWithEvent(this))},setOwner:function(B){this.owner=B},hide:function(){this.blur()},show:$empty,clicked:function(B){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(B.event)}}},onMouseOver:function(B){if(this.owner&&this.owner.setVisibleItem){this.owner.setVisibleItem(this)}this.show(B)}});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(B){this.parent();this.setOptions(B);this.domA.removeClass("jxButtonMulti");if(this.options.editable){var C=new Element("span",{"class":"jxButton"});C.adopt(this.domA.firstChild);this.domA=C.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(D){this.discloser.fireEvent("click",D)}).bindWithEvent(this))}this.buttonSet=new Jx.ButtonSet({onChange:(function(G){var F=G.activeButton;this.domA.removeClass("jxButtonComboDefault");if(this.options.editable){this.domInput.value=F.options.label}else{var D=F.options.label;if(D=="&nbsp;"){D=""}this.setLabel(D)}var E=F.options.image;if(E.indexOf("a_pixel")!=-1){E=""}this.setImage(E);if(this.options.imageClass&&this.domImg){this.domImg.removeClass(this.options.imageClass)}if(F.options.imageClass&&this.domImg){this.options.imageClass=F.options.imageClass;this.domImg.addClass(F.options.imageClass)}this.fireEvent("change",this)}).bind(this)});if(this.options.items){this.add(this.options.items)}this.setEnabled(this.options.enabled)},setEnabled:function(B){this.options.enabled=B;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(B){if(B.key=="enter"){this.valueChanged()}},add:function(){$A(arguments).flatten().each(function(C){var B=new Jx.Menu.Item($merge(C,{toggle:true}));this.menu.add(B);this.buttonSet.add(B)},this)},remove:function(B){},setValue:function(B){if(this.options.editable){this.domInput.value=B}else{this.setLabel(B)}},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(J){this.setOptions(J);this.toolbars=J?J.toolbars||[]:[];if($defined(this.options.height)&&!$defined(J.position)){this.options.position="relative"}this.title=new Element("div",{"class":"jx"+this.options.type+"Title"});var B=new Element("img",{"class":"jx"+this.options.type+"Icon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.image){B.setStyle("backgroundImage","url("+this.options.image+")")}this.title.adopt(B);this.labelObj=new Element("span",{"class":"jx"+this.options.type+"Label",html:this.options.label});this.title.adopt(this.labelObj);var G=new Element("div",{"class":"jx"+this.options.type+"Controls"});var C=new Element("div");G.adopt(C);this.toolbar=new Jx.Toolbar({parent:C});this.title.adopt(G);var D=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 F=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.collapseTooltip,onClick:function(){D.toggleCollapse()}});F.domObj.addClass("jx"+this.options.type+"Collapse");this.toolbar.add(F);if(this.menu){var I=new Jx.Menu.Item({label:this.options.collapseLabel,onClick:function(){D.toggleCollapse()}});this.addEvents({collapse:function(){I.setLabel(this.options.expandLabel)},expand:function(){I.setLabel(this.options.collapseLabel)}});this.menu.add(I)}}if(this.options.maximize){var F=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.maximizeTooltip,onClick:function(){D.maximize()}});F.domObj.addClass("jx"+this.options.type+"Maximize");this.toolbar.add(F);if(this.menu){var I=new Jx.Menu.Item({label:this.options.maximizeLabel,onClick:function(){D.maximize()}});this.menu.add(I)}}if(this.options.close){var F=new Jx.Button({image:Jx.aPixel.src,tooltip:this.options.closeTooltip,onClick:function(){D.close()}});F.domObj.addClass("jx"+this.options.type+"Close");this.toolbar.add(F);if(this.menu){var I=new Jx.Menu.Item({label:this.options.closeLabel,onClick:function(){D.close()}});this.menu.add(I)}}this.title.addEvent("dblclick",function(){D.toggleCollapse()});this.domObj=new Element("div",{"class":"jx"+this.options.type});if(this.options.id){this.domObj.id=this.options.id}var E=new Jx.Layout(this.domObj,$merge(this.options,{propagate:false}));var H=this.layoutContent.bind(this);E.addEvent("sizeChange",H);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(L){var K=L.options.position;var M=this.toolbarContainers[K];if(!M){var M=new Element("div");new Jx.Layout(M);this.contentContainer.adopt(M);this.toolbarContainers[K]=M}L.addTo(M)},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 G=0;var H=0;var B=0;var D=0;var J=0;var I;var E;var F;if(!this.options.hideTitle&&this.title.parentNode==this.domObj){G=this.title.getMarginBoxSize().height}var C=this.domObj.getContentBoxSize();if(C.height>G){this.contentContainer.setStyle("display","block");this.options.closed=false;this.contentContainer.resize({top:G,height:null,bottom:0});["left","right"].each(function(K){if(this.toolbarContainers[K]){this.toolbarContainers[K].style.width="auto"}},this);["top","bottom"].each(function(K){if(this.toolbarContainers[K]){this.toolbarContainers[K].style.height=""}},this);if($type(this.options.toolbars)=="array"){this.options.toolbars.each(function(K){F=K.options.position;I=this.toolbarContainers[F];if(Browser.Engine.trident4){var M=$(I.parentNode);I.style.visibility="hidden";$(document.body).adopt(I)}var L=I.getBorderBoxSize();if(Browser.Engine.trident4){M.adopt(I);I.style.visibility=""}switch(F){case"top":H=L.height;break;case"bottom":B=L.height;break;case"left":D=L.width;break;case"right":J=L.width;break}},this)}I=this.toolbarContainers.top;if(I){I.resize({top:0,left:D,right:J,bottom:null,height:H,width:null})}I=this.toolbarContainers.bottom;if(I){I.resize({top:null,left:D,right:J,bottom:0,height:B,width:null})}I=this.toolbarContainers.left;if(I){I.resize({top:H,left:0,right:null,bottom:B,height:null,width:D})}I=this.toolbarContainers.right;if(I){I.resize({top:H,left:null,right:0,bottom:B,height:null,width:J})}this.content.resize({top:H,bottom:B,left:D,right:J})}else{this.contentContainer.setStyle("display","none");this.options.closed=true}this.fireEvent("sizeChange",this)},setLabel:function(B){this.labelObj.innerHTML=B},getLabel:function(){return this.labelObj.innerHTML},finalize:function(){this.domObj=null;this.deregisterIds()},maximize:function(){if(this.manager){this.manager.maximizePanel(this)}},setContent:function(B){this.content.innerHTML=B;this.bContentReady=true},setContentURL:function(C){this.bContentReady=false;this.setBusy(true);if(arguments[1]){this.onContentReady=arguments[1]}if(C.indexOf("?")==-1){C=C+"?"}var B=new Request({url:C,method:"get",evalScripts:true,onSuccess:this.panelContentLoaded.bind(this),requestHeaders:["If-Modified-Since","Sat, 1 Jan 2000 00:00:00 GMT"]}).send()},panelContentLoaded:function(B){this.content.innerHTML=B;this.bContentReady=true;this.setBusy(false);if(this.onContentReady){window.setTimeout(this.onContentReady.bind(this),1)}},setBusy:function(B){this.busyCount+=B?1:-1;if(this.loadingObj){this.loadingObj.img.style.visibility=(this.busyCount>0)?"visible":"hidden"}},toggleCollapse:function(D){if($defined(D)){this.options.closed=D}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 C=this.domObj.getMarginSize();var B=C.top+C.bottom;if(this.title.parentNode==this.domObj){B+=this.title.getMarginBoxSize().height}this.domObj.resize({height:B});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(B){this.isOpening=false;this.firstShow=true;this.parent($merge({parent:document.body},B,{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 C=$(document.body).getScrollSize();this.setStyles({width:C.x,height:C.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 D=Math.max(this.chromeOffsets.left,parseInt(this.domObj.style.left,10));var C=Math.max(this.chromeOffsets.top,parseInt(this.domObj.style.top,10));this.options.horizontal=D+" left";this.options.vertical=C+" 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 C=this.domObj.getMarginBoxSize();this.options.width=C.width;this.options.height=C.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(C,B,D){this.options.width=C;this.options.height=B;if(this.domObj.getStyle("display")!="none"){this.layoutContent();this.domObj.resize(this.options);this.fireEvent("resize");this.resizeChrome(this.domObj);if(D){this.position(this.domObj,this.options.parent,this.options)}}else{this.firstShow=false}},sizeChanged:function(){if(!this.options.closed){this.layoutContent()}},toggleCollapse:function(D){if($defined(D)){this.options.closed=D}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 C=this.domObj.getMarginSize();var B=this.title.getMarginBoxSize();this.domObj.resize({height:C.top+B.height+C.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 C=this.domObj.getMarginSize();var B=this.title.getMarginBoxSize();this.domObj.resize({height:C.top+B.height+C.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(B){if(B){this.options.contentURL=B;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(B){Jx.Dialog.Stack.erase(B).push(B);if(Jx.Dialog.BaseZIndex===null){Jx.Dialog.BaseZIndex=Math.max(Jx.Dialog.Stack[0].domObj.getStyle("zIndex").toInt(),1)}Jx.Dialog.Stack.each(function(E,C){var D=Jx.Dialog.BaseZIndex+(C*2);if(E.blanket){E.blanket.setStyle("zIndex",D-1)}E.domObj.setStyle("zIndex",D)})};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(B,M){this.setOptions(M);this.domObj=$(B);this.domObj.addClass("jxSplitContainer");var L=this.domObj.retrieve("jxLayout");if(L){L.addEvent("sizeChange",this.sizeChanged.bind(this))}this.elements=[];this.bars=[];var K=2;if(this.options.useChildren){this.elements=this.domObj.getChildren();K=this.elements.length}else{K=this.options.elements?this.options.elements.length:this.options.splitInto;for(var H=0;H<K;H++){var E;if(this.options.elements&&this.options.elements[H]){if(M.elements[H].domObj){E=M.elements[H].domObj}else{E=$(this.options.elements[H])}if(!E){E=this.prepareElement();E.id=this.options.elements[H]}}else{E=this.prepareElement()}this.elements[H]=E;this.domObj.adopt(this.elements[H])}}this.elements.each(function(N){N.addClass("jxSplitArea")});for(var H=0;H<K;H++){var J=this.elements[H].retrieve("jxLayout");if(!J){new Jx.Layout(this.elements[H],this.options.containerOptions[H])}else{J.resize({position:"absolute"})}}for(var H=1;H<K;H++){var I;if(this.options.prepareBar){I=this.options.prepareBar(H-1)}else{I=this.prepareBar()}I.store("splitterObj",this);I.store("leftSide",this.elements[H-1]);I.store("rightSide",this.elements[H]);this.elements[H-1].store("rightBar",I);this.elements[H].store("leftBar",I);this.domObj.adopt(I);this.bars[H-1]=I}if($defined(Drag)){this.establishConstraints()}for(var H=0;H<this.options.barOptions.length;H++){if(!this.bars[H]){continue}var C=this.options.barOptions[H];if(C&&C.snap&&(C.snap=="before"||C.snap=="after")){var G;if(C.snap=="before"){G=this.bars[H].retrieve("leftSide")}else{if(C.snap=="after"){G=this.bars[H].retrieve("rightSide")}}var F;var D;if(C.snapElement){F=C.snapElement;D=C.snapEvents||["click","dblclick"]}else{F=this.bars[H];D=C.snapEvents||["dblclick"]}if(!F.parentNode){this.bars[H].adopt(F)}new Jx.Splitter.Snap(F,G,this,D)}}for(var H=0;H<this.options.snaps.length;H++){if(this.options.snaps[H]){new Jx.Splitter.Snap(this.options.snaps[H],this.elements[H],this)}}this.sizeChanged()},prepareElement:function(){var B=new Element("div",{styles:{position:"absolute"}});return B},prepareBar:function(){var B=new Element("div",{"class":"jxSplitBar"+this.options.layout.capitalize(),title:this.options.barTitle});return B},establishConstraints:function(){var B={x:null,y:null};var C;if(this.options.layout=="horizontal"){B.x="left";C=this.dragHorizontal}else{B.y="top";C=this.dragVertical}if(typeof Drag!="undefined"){this.bars.each(function(E){var D;new Drag(E,{modifiers:B,onSnap:function(F){F.addClass("jxSplitBarDrag")},onComplete:(function(F){D.destroy();F.removeClass("jxSplitBarDrag");if(F.retrieve("splitterObj")!=this){return }C.apply(this,[F])}).bind(this),onStart:(function(F){D=new Element("div",{"class":"jxSplitterMask"}).inject(F,"after");if(this.options.onStart){this.options.onStart()}}).bind(this),onFinish:(function(){if(this.options.onFinish){this.options.onFinish()}}).bind(this)})},this)}},dragHorizontal:function(G){var B=parseInt(G.style.left);var I=G.retrieve("leftSide");var D=G.retrieve("rightSide");var E=I.retrieve("jxLayout");var H=D.retrieve("jxLayout");var F=this.domObj.getPaddingSize().left;var J,P,L;var O=G.retrieve("size");if(!O){O=G.getBorderBoxSize();G.store("size",O)}J=B+O.width-F;var C=this.domObj.getContentBoxSize();if(H.options.width!=null){P=H.options.width+H.options.left-J;L=C.width-J-P}else{P=C.width-H.options.right-J;L=H.options.right}if(P<0){P=0}if(P<H.options.minWidth){P=H.options.minWidth}if(H.options.maxWidth>=0&&P>H.options.maxWidth){P=H.options.maxWidth}J=C.width-L-P;B=J-O.width;var K,N;K=E.options.left;N=B-K;if(N<0){N=0}if(N<E.options.minWidth){N=E.options.minWidth}if(E.options.maxWidth>=0&&N>E.options.maxWidth){N=E.options.maxWidth}if(K+N!=B){B=K+N;var M=B+O.width-J;J+=M;P-=M}G.style.left=F+B+"px";if(E.options.width==null){var C=this.domObj.getContentBoxSize();I.resize({right:C.width-K-N})}else{I.resize({width:N})}if(H.options.width==null){D.resize({left:J})}else{D.resize({left:J,width:P})}},dragVertical:function(G){var K=parseInt(G.style.top);var E=G.retrieve("leftSide");var B=G.retrieve("rightSide");var F=E.retrieve("jxLayout");var I=B.retrieve("jxLayout");var O=this.domObj.getPaddingSize().top;var P=G.retrieve("size");if(!P){P=G.getBorderBoxSize();G.store("size",P)}var C=this.domObj.getContentBoxSize();var D,N,L;D=K+P.height-O;if(I.options.height!=null){N=I.options.height+I.options.top-D;L=C.height-D-N}else{N=C.height-I.options.bottom-D;L=I.options.bottom}if(N<0){N=0}if(N<I.options.minHeight){N=I.options.minHeight}if(I.options.maxHeight>=0&&N>I.options.maxHeight){N=I.options.maxHeight}D=C.height-L-N;K=D-P.height;var J,H;J=F.options.top;H=K-J;if(H<0){H=0}if(H<F.options.minHeight){H=F.options.minHeight}if(F.options.maxHeight>=0&&H>F.options.maxHeight){H=F.options.maxHeight}if(J+H!=K){K=J+H;var M=K+P.height-D;D+=M;N-=M}G.style.top=O+K+"px";if(F.options.height==null){E.resize({bottom:C.height-J-H})}else{E.resize({height:H})}if(I.options.height==null){B.resize({top:D})}else{B.resize({top:D,height:N})}},sizeChanged:function(){if(this.options.layout=="horizontal"){this.horizontalResize()}else{this.verticalResize()}},horizontalResize:function(){var P=this.domObj.getContentBoxSize().width;var E=P;for(var F=0;F<this.bars.length;F++){var M=this.bars[F];var R=M.retrieve("size");if(!R||R.width==0){R=M.getBorderBoxSize();M.store("size",R)}P-=R.width}var J=0;var I;for(var F=0;F<this.elements.length;F++){var L=this.elements[F];I=L.retrieve("jxLayout").options;if(I.width!=null){P-=parseInt(I.width)}else{var O=0;if(I.right!=0||I.left!=0){O=L.getBorderBoxSize().width}P-=O;J++}}if(J==0){P+=I.width;I.width=null;J=1}var H=parseInt(P/J);var Q=P%J;var C=this.domObj.getPaddingSize().left;var D=0;for(var F=0;F<this.elements.length;F++){var L=this.elements[F];var K=L.retrieve("jxLayout");var I=K.options;if(I.width!=null){K.resize({left:D});D+=I.width}else{var N=H;if(J==1){N+=Q}J--;var O=0;if(I.right!=0||I.left!=0){O=L.getBorderBoxSize().width+N}else{O=N}if(O<0){if(J>0){H=H+O/J}O=0}if(O<I.minWidth){if(J>0){H=H+(O-I.minWidth)/J}O=I.minWidth}if(I.maxWidth>=0&&O>I.maxWidth){if(J>0){H=H+(O-I.maxWidth)/J}O=L.options.maxWidth}var B=E-D-O;K.resize({left:D,right:B});D+=O}var G=L.retrieve("rightBar");if(G){G.setStyle("left",C+D);D+=G.retrieve("size").width}}},verticalResize:function(){var O=this.domObj.getContentBoxSize().height;var C=O;for(var E=0;E<this.bars.length;E++){var M=this.bars[E];var R=M.retrieve("size");if(!R||R.height==0){R=M.getBorderBoxSize();M.store("size",R)}O-=R.height}var J=0;var I;for(var E=0;E<this.elements.length;E++){var L=this.elements[E];I=L.retrieve("jxLayout").options;if(I.height!=null){O-=parseInt(I.height)}else{var H=0;if(I.bottom!=0||I.top!=0){H=L.getBorderBoxSize().height}O-=H;J++}}if(J==0){O+=I.height;I.height=null;J=1}var G=parseInt(O/J);var P=O%J;var Q=this.domObj.getPaddingSize().top;var D=0;for(var E=0;E<this.elements.length;E++){var L=this.elements[E];var K=L.retrieve("jxLayout");var I=K.options;if(I.height!=null){K.resize({top:D});D+=I.height}else{var N=G;if(J==1){N+=P}J--;var H=0;if(I.bottom!=0||I.top!=0){H=L.getBorderBoxSize().height+N}else{H=N}if(H<0){if(J>0){G=G+H/J}H=0}if(H<I.minHeight){if(J>0){G=G+(H-I.minHeight)/J}H=I.minHeight}if(I.maxHeight>=0&&H>I.maxHeight){if(J>0){G=G+(H-I.maxHeight)/J}H=I.maxHeight}var B=C-D-H;K.resize({top:D,bottom:B});D+=H}var F=L.retrieve("rightBar");if(F){F.style.top=Q+D+"px";D+=F.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(B){if(B&&B.panels){this.panels=B.panels;B.panels=null}this.setOptions(B);this.domObj=new Element("div");new Jx.Layout(this.domObj);var D=new Element("div",{styles:{position:"absolute"}});new Jx.Layout(D,{minHeight:0,maxHeight:0,height:0});var C=[D];this.panels.each(function(E){C.push(E.domObj);E.options.hideTitle=true;E.contentContainer.resize({top:0});E.toggleCollapse=this.maximizePanel.bind(this,E);E.domObj.store("Jx.Panel",E);E.manager=this},this);this.splitter=new Jx.Splitter(this.domObj,{splitInto:this.panels.length+1,layout:"vertical",elements:C,prepareBar:(function(G){var H=new Element("div",{"class":"jxPanelBar",title:this.options.barTooltip});var E=this.panels[G];E.title.setStyle("visibility","hidden");$(document.body).adopt(E.title);var F=E.title.getBorderBoxSize();H.adopt(E.title);E.title.setStyle("visibility","");H.setStyle("height",F.height);H.store("size",F);return H}).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(D){var G=this.domObj.getContentBoxSize().height;var C=G;var L=D.domObj.retrieve("jxLayout").options.maxHeight;var J;for(var I=1;I<this.splitter.elements.length;I++){var E=this.splitter.elements[I];C-=E.retrieve("leftBar").getBorderBoxSize().height;if(E!==D.domObj){var H=E.retrieve("Jx.Panel");var F=E.retrieve("jxLayout").options;C-=F.minHeight}else{J=I}}if(L==-1||L>=C){L=C;C=0}else{C=C-L}var M=0;for(var I=1;I<this.splitter.elements.length;I++){var E=this.splitter.elements[I];M+=E.retrieve("leftBar").getBorderBoxSize().height;if(E!==D.domObj){var H=E.retrieve("Jx.Panel");var F=E.retrieve("jxLayout").options;var K=$chk(F.height)?F.height:E.getBorderBoxSize().height;if(C>0){if(C>=K){C-=K;E.resize({top:M,height:K});M+=K}else{if(C>F.minHeight){E.resize({top:M,height:C});M+=C;C=0}else{E.resize({top:M,height:F.minHeight});M+=F.minHeight}}}else{E.resize({top:M,height:F.minHeight});M+=F.minHeight}E.retrieve("rightBar").style.top=M+"px"}else{break}}var B=G;for(var I=this.splitter.elements.length-1;I>0;I--){E=this.splitter.elements[I];if(E!==D.domObj){var F=E.retrieve("jxLayout").options;var K=$chk(F.height)?F.height:E.getBorderBoxSize().height;if(C>0){if(C>=K){B-=K;C-=K;E.resize({top:B,height:K})}else{if(C>F.minHeight){B-=C;E.resize({top:B,height:C});C=0}else{B-=F.minHeight;E.resize({top:B,height:F.minHeight})}}}else{B-=F.minHeight;E.resize({top:B,height:F.minHeight,bottom:null})}B-=E.retrieve("leftBar").getBorderBoxSize().height;E.retrieve("leftBar").style.top=B+"px"}else{break}}D.domObj.resize({top:M,height:L,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(B){this.setOptions(B);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 D=this.options.columnHeaders?this.model.getColumnHeaderHeight():1;var B=this.options.rowHeaders?this.model.getRowHeaderWidth():1;var C=Element.getContentBoxSize(this.domObj);this.rowColObj.setStyles({width:B-1,height:D-1});this.rowObj.setStyles({top:D,left:0,width:B-1,height:C.height-D-1});this.colObj.setStyles({top:0,left:B,width:C.width-B-1,height:D-1});this.gridObj.setStyles({top:D,left:B,width:C.width-B-1,height:C.height-D-1})},setModel:function(B){this.model=B;if(this.model){if(this.domObj.resize){this.domObj.resize()}this.createGrid();this.resize()}else{this.destroyGrid()}},destroyGrid:function(){var B=this.colTableHead.cloneNode(false);this.colTable.replaceChild(B,this.colTableHead);this.colTableHead=B;B=this.colTableBody.cloneNode(false);this.colTable.replaceChild(B,this.colTableBody);this.colTableBody=B;B=this.rowTableHead.cloneNode(false);this.rowTable.replaceChild(B,this.rowTableHead);this.rowTableHead=B;B=this.gridTableBody.cloneNode(false);this.gridTable.replaceChild(B,this.gridTableBody);this.gridTableBody=B},createGrid:function(){this.destroyGrid();if(this.model){var M=this.model;var F=M.getColumnCount();var R=M.getRowCount();if(this.options.columnHeaders){var O=M.getColumnHeaderHeight();var Q=new Element("tr");this.colTableHead.appendChild(Q);var N=new Element("tr");this.colTableBody.appendChild(N);var D=new Element("th",{styles:{width:0,height:0}});Q.appendChild(D);D=D.cloneNode(true);D.setStyle("height",O);N.appendChild(D);for(var L=0;L<F;L++){var K=M.getColumnWidth(L);D=new Element("th",{"class":"jxGridColHeadHide",styles:{width:K}});var C=new Element("p",{styles:{height:0,width:K}});D.appendChild(C);Q.appendChild(D);D=new Element("th",{"class":"jxGridColHead",html:M.getColumnHeaderHTML(L)});N.appendChild(D)}var D=new Element("th",{styles:{width:1000,height:0}});Q.appendChild(D);D=D.cloneNode(true);D.setStyle("height",O-1);D.className="jxGridColHead";N.appendChild(D)}if(this.options.rowHeaders){var I=M.getRowHeaderWidth();var P=new Element("tr");var H=new Element("td",{styles:{width:0,height:0}});P.appendChild(H);var D=new Element("th",{styles:{width:I,height:0}});P.appendChild(D);this.rowTableHead.appendChild(P);for(var L=0;L<R;L++){var B=M.getRowHeight(L);var P=new Element("tr");var H=new Element("td",{"class":"jxGridRowHeadHide",styles:{width:0,height:B}});var C=new Element("p",{styles:{width:0,height:B}});H.appendChild(C);P.appendChild(H);var D=new Element("th",{"class":"jxGridRowHead",html:M.getRowHeaderHTML(L)});P.appendChild(D);this.rowTableHead.appendChild(P)}var P=new Element("tr");var H=new Element("td",{styles:{width:0,height:1000}});P.appendChild(H);var D=new Element("th",{"class":"jxGridRowHead",styles:{width:I,height:1000}});P.appendChild(D);this.rowTableHead.appendChild(P)}var O=M.getColumnHeaderHeight();var N=new Element("tr");this.gridTableBody.appendChild(N);var H=new Element("td",{styles:{width:0,height:0}});N.appendChild(H);for(var L=0;L<F;L++){var K=M.getColumnWidth(L);H=new Element("td",{"class":"jxGridColHeadHide",styles:{width:K}});var C=new Element("p",{styles:{width:K,height:0}});H.appendChild(C);N.appendChild(H)}for(var J=0;J<R;J++){var B=M.getRowHeight(J);var E=B;var P=new Element("tr");this.gridTableBody.appendChild(P);var H=new Element("td",{"class":"jxGridRowHeadHide",styles:{width:0,height:B}});var C=new Element("p",{styles:{height:B}});H.appendChild(C);P.appendChild(H);for(var L=0;L<F;L++){var K=M.getColumnWidth(L);H=new Element("td",{"class":"jxGridCell"});H.innerHTML=M.getValueAt(J,L);P.appendChild(H);var G=H.getSize();if(G.height>E){E=G.height}}if(document.all){E-=1}if(this.options.rowHeaders){this.setRowHeaderHeight(J,E)}if(this.options.alternateRowColors){P.className=(J%2)?"jxGridRowOdd":"jxGridRowEven"}else{P.className="jxGridRowAll"}}}},setRowHeaderHeight:function(C,B){this.rowTableHead.childNodes[C+1].childNodes[0].childNodes[0].style.height=(B)+"px"},gridChanged:function(C,E,B,D){if(this.model==C){this.gridObj.childNodes[E].childNodes[B].innerHTML=D}},prelightRowHeader:function(C){var B=(C>=0&&C<this.rowTableHead.rows.length-1)?this.rowTableHead.rows[C+1].cells[1]:null;if(this.prelitRowHeader!=B){if(this.prelitRowHeader){this.prelitRowHeader.removeClass("jxGridRowHeaderPrelight")}this.prelitRowHeader=B;if(this.prelitRowHeader){this.prelitRowHeader.addClass("jxGridRowHeaderPrelight")}}},prelightColumnHeader:function(C){if(this.colTableBody.rows.length==0){return }var B=(C>=0&&C<this.colTableBody.rows[0].cells.length-1)?this.colTableBody.rows[0].cells[C+1]:null;if(this.prelitColumnHeader!=B){if(this.prelitColumnHeader){this.prelitColumnHeader.removeClass("jxGridColumnHeaderPrelight")}this.prelitColumnHeader=B;if(this.prelitColumnHeader){this.prelitColumnHeader.addClass("jxGridColumnHeaderPrelight")}}},prelightRow:function(C){var B=(C>=0&&C<this.gridTableBody.rows.length-1)?this.gridTableBody.rows[C+1]:null;if(this.prelitRow!=C){if(this.prelitRow){this.prelitRow.removeClass("jxGridRowPrelight")}this.prelitRow=B;if(this.prelitRow){this.prelightRowHeader(C);this.prelitRow.addClass("jxGridRowPrelight")}}},prelightColumn:function(B){if(B>=0&&B<this.gridTable.rows[0].cells.length){if($chk(this.prelitColumn)){for(var C=0;C<this.gridTable.rows.length;C++){this.gridTable.rows[C].cells[this.prelitColumn+1].removeClass("jxGridColumnPrelight")}}this.prelitColumn=B;for(var C=0;C<this.gridTable.rows.length;C++){this.gridTable.rows[C].cells[B+1].addClass("jxGridColumnPrelight")}}this.prelightColumnHeader(B)},prelightCell:function(C,B){var D=(C>=0&&B>=0&&C<this.gridTableBody.rows.length-1&&B<this.gridTableBody.rows[C+1].cells.length-1)?this.gridTableBody.rows[C+1].cells[B+1]:null;if(this.prelitCell!=D){if(this.prelitCell){this.prelitCell.removeClass("jxGridCellPrelight")}this.prelitCell=D;if(this.prelitCell){this.prelitCell.addClass("jxGridCellPrelight")}}},selectCell:function(C,B){var D=(C>=0&&B>=0&&C<this.gridTableBody.rows.length-1&&B<this.gridTableBody.rows[C+1].cells.length-1)?this.gridTableBody.rows[C+1].cells[B+1]:null;if(!D){return }if(this.selectedCell){this.selectedCell.removeClass("jxGridCellSelected")}this.selectedCell=D;this.selectedCell.addClass("jxGridCellSelected")},selectRowHeader:function(D,C){var B=(D>=0&&D<this.rowTableHead.rows.length-1)?this.rowTableHead.rows[D+1].cells[1]:null;if(!B){return }if(C){B.addClass("jxGridRowHeaderSelected")}else{B.removeClass("jxGridRowHeaderSelected")}},selectRow:function(D,B){var C=(D>=0&&D<this.gridTableBody.rows.length-1)?this.gridTableBody.rows[D+1]:null;if(C){if(B){C.addClass("jxGridRowSelected")}else{C.removeClass("jxGridRowSelected")}this.selectRowHeader(D,B)}},selectColumnHeader:function(C,D){if(this.colTableBody.rows.length==0){return }var B=(C>=0&&C<this.colTableBody.rows[0].cells.length-1)?this.colTableBody.rows[0].cells[C+1]:null;if(B==null){return }if(D){B.addClass("jxGridColumnHeaderSelected")}else{B.removeClass("jxGridColumnHeaderSelected")}},selectColumn:function(B,D){if(B>=0&&B<this.gridTable.rows[0].cells.length){if(D){for(var C=0;C<this.gridTable.rows.length;C++){this.gridTable.rows[C].cells[B+1].addClass("jxGridColumnSelected")}}else{for(var C=0;C<this.gridTable.rows.length;C++){this.gridTable.rows[C].cells[B+1].removeClass("jxGridColumnSelected")}}this.selectColumnHeader(B,D)}},onMouseMoveGrid:function(C){var B=this.getRowColumnFromEvent(C);if(this.options.cellPrelight){this.prelightCell(B.row,B.column)}if(this.options.rowPrelight){this.prelightRow(B.row)}if(this.options.rowHeaderPrelight){this.prelightRowHeader(B.row)}if(this.options.columnPrelight){this.prelightColumn(B.column)}if(this.options.columnHeaderPrelight){this.prelightColumnHeader(B.column)}},onMouseMoveRowHeader:function(C){if(this.options.rowPrelight){var B=this.getRowColumnFromEvent(C);this.prelightRow(B.row)}},onMouseMoveColumnHeader:function(C){if(this.options.columnPrelight){var B=this.getRowColumnFromEvent(C);this.prelightColumn(B.column)}},onClickGrid:function(C){var B=this.getRowColumnFromEvent(C);if(this.options.cellSelection&&this.model.cellSelected){this.model.cellSelected(this,B.row,B.column)}if(this.options.rowSelection&&this.model.rowSelected){this.model.rowSelected(this,B.row)}if(this.options.columnSelection&&this.model.columnSelected){this.model.columnSelected(this,B.column)}},onClickRowHeader:function(C){var B=this.getRowColumnFromEvent(C);if(this.options.rowSelection&&this.model.rowSelected){this.model.rowSelected(this,B.row)}},onClickColumnHeader:function(C){var B=this.getRowColumnFromEvent(C);if(this.options.columnSelection&&this.model.columnSelected){this.model.columnSelected(this,B.column)}},getRowColumnFromEvent:function(E){var G=E.target;if(G.tagName!="TD"&&G.tagName!="TH"){return{row:-1,column:-1}}var D=G.parentNode;var B=G.cellIndex-1;var F=D.rowIndex-1;if(B==-1){for(var C=0;C<D.childNodes.length;C++){if(D.childNodes[C]==G){B=C-1;break}}}return{row:F,column:B}}});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(C,B){this.data=C||[];this.setOptions(B)},getColumnCount:function(){return(this.data&&this.data[0])?this.data[0].length:0},getColumnHeaderHTML:function(B){return this.options.columnHeaders?this.options.columnHeaders[B]:B+1},getColumnHeaderHeight:function(){return this.options.colHeaderHeight},getColumnWidth:function(B){return this.options.colWidth},getRowHeaderHTML:function(B){return this.options.rowHeaders?this.options.rowHeaders[B]:B+1},getRowHeaderWidth:function(){return this.options.rowHeaderWidth},getRowHeight:function(B){return this.options.rowHeight},getRowCount:function(){return this.data.length},getValueAt:function(C,B){return(this.data&&$chk(this.data[C]))?this.data[C][B]:""},setColumnWidth:function(){},isCellEditable:function(){return false},setValueAt:function(D,B,C){},rowSelected:function(B,C){if(this.selectedRow!=null){B.selectRow(this.selectedRow,false)}this.selectedRow=C;B.selectRow(C,true);this.fireEvent("select-row",C)},columnSelected:function(C,B){if(this.selectedCol!=null){C.selectColumn(this.selectedCol,false)}this.selectedCol=B;C.selectColumn(B,true);this.fireEvent("select-column",B)},cellSelected:function(C,D,B){C.selectCell(D,B);this.fireEvent("select-cell",[D,B])}});Jx.Menu.Context=new Class({Family:"Jx.Menu.Context",Extends:Jx.Menu,initialize:function(B){this.parent();if($(B)){$(B).addEvent("contextmenu",this.show.bindWithEvent(this))}},show:function(B){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:[B.page.x+" left"],vertical:[B.page.y+" top",B.page.y+" bottom"],offsets:this.chromeOffsets});this.contentContainer.setStyle("visibility","");this.showChrome(this.contentContainer);document.addEvent("mousedown",this.hideWatcher);document.addEvent("keyup",this.keypressWatcher);B.stop()}});Jx.Menu.Separator=new Class({Family:"Jx.Menu.Separator",domObj:null,owner:null,initialize:function(){this.domObj=new Element("li",{"class":"jxMenuItem"});var B=new Element("span",{"class":"jxMenuSeparator",html:"&nbsp;"});this.domObj.appendChild(B)},setOwner:function(B){this.owner=B},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(B){this.open=false;this.items=[];this.parent(B);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(B){this.owner=B},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(B){if(this.visibleItem&&this.visibleItem.eventInMenu&&this.visibleItem.eventInMenu(B)){return true}return $(B.target).descendantOf(this.domObj)||$(B.target).descendantOf(this.subDomObj)||this.items.some(function(C){return C instanceof Jx.Menu.SubMenu&&C.eventInMenu(B)})},hide:function(){if(!this.open){return }this.open=false;this.items.each(function(B){B.hide()});this.contentContainer.setStyle("display","none");this.visibleItem=null},add:function(){var B=this;$A(arguments).each(function(C){B.items.push(C);C.setOwner(B);B.subDomObj.adopt(C.domObj)});return this},insertBefore:function(D,E){var C=false;for(var B=0;B<this.items.length;B++){if(this.items[B]==E){this.items.splice(B,0,D);this.subDomObj.insertBefore(D.domObj,E.domObj);C=true;break}}if(!C){this.add(D)}},remove:function(C){for(var B=0;B<this.items.length;B++){if(this.items[B]==C){this.items.splice(B,1);this.subDomObj.removeChild(C.domObj);break}}},deactivate:function(B){if(this.owner){this.owner.deactivate(B)}},isActive:function(){if(this.owner){return this.owner.isActive()}else{return false}},setActive:function(B){if(this.owner&&this.owner.setActive){this.owner.setActive(B)}},setVisibleItem:function(B){if(this.visibleItem!=B){if(this.visibleItem&&this.visibleItem.hide){this.visibleItem.hide()}this.visibleItem=B;this.visibleItem.show()}}});Jx.Splitter.Snap=new Class({Family:"Jx.Splitter.Snap",snap:null,element:null,splitter:null,layout:"vertical",initialize:function(B,G,H,F){this.snap=B;this.element=G;var E=G.retrieve("jxLayout");E.addEvent("sizeChange",this.sizeChange.bind(this));this.splitter=H;this.layout=H.options.layout;var C=E.options;var D=this.element.getContentBoxSize();if(this.layout=="vertical"){this.originalSize=D.height;this.minimumSize=C.minHeight?C.minHeight:0}else{this.originalSize=D.width;this.minimumSize=C.minWidth?C.minWidth:0}F.each(function(I){B.addEvent(I,this.toggleElement.bind(this))},this)},toggleElement:function(){var B={};if(this.layout=="vertical"){if(this.element.clientHeight<=this.minimumSize){B.height=this.originalSize}else{this.originalSize=this.element.clientHeight;B.height=this.minimumSize}}else{if(this.element.clientWidth<=this.minimumSize){B.width=this.originalSize}else{this.originalSize=this.element.clientWidth;B.width=this.minimumSize}}this.element.resize(B);this.splitter.sizeChanged()},sizeChange:function(){var B=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(B){this.setOptions(B);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(B){var C=$(B).retrieve("jxBarContainer");if(!C){C=new Jx.Toolbar.Container({parent:B,position:this.options.position,autoSize:this.options.autoSize,scroll:this.options.scroll})}C.add(this);return this},add:function(){$A(arguments).flatten().each(function(B){if(B.domObj){B=B.domObj}if(B.tagName=="LI"){if(!B.hasClass("jxToolItem")){B.addClass("jxToolItem")}this.domObj.appendChild(B)}else{var C=new Jx.Toolbar.Item(B);this.domObj.appendChild(C.domObj)}},this);if(arguments.length>0){this.fireEvent("add",this)}return this},remove:function(C){if(C.domObj){C=C.domObj}var B=C.findElement("LI");if(B&&B.parentNode==this.domObj){C.dispose();B.dispose();this.fireEvent("remove",this)}else{return null}},deactivate:function(){this.items.each(function(B){B.hide()});this.setActive(false)},isActive:function(){return this.isActive},setActive:function(B){this.isActive=B;if(this.isActive){document.addEvent("click",this.deactivateWatcher)}else{document.removeEvent("click",this.deactivateWatcher)}},setVisibleItem:function(B){if(this.visibleItem&&this.visibleItem.hide&&this.visibleItem!=B){this.visibleItem.hide()}this.visibleItem=B;if(this.isActive()){this.visibleItem.show()}},showItem:function(B){this.fireEvent("show",B)}});Jx.TabSet=new Class({Family:"Jx.TabSet",Implements:[Options,Events],tabs:null,domObj:null,initialize:function(C,B){this.setOptions(B);this.tabs=[];this.domObj=$(C);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(B){if(B instanceof Jx.Button.Tab){B.addEvent("down",this.setActiveTabFn);B.tabSet=this;this.domObj.appendChild(B.content);this.tabs.push(B);if((!this.activeTab||B.options.active)&&B.options.enabled){B.options.active=false;B.setActive(true)}}},this);return this},remove:function(B){if(B instanceof Jx.Button.Tab&&this.tabs.indexOf(B)!=-1){this.tabs.erase(B);if(this.activeTab==B){if(this.tabs.length){this.tabs[0].setActive(true)}}B.removeEvent("down",this.setActiveTabFn);B.content.dispose()}},setActiveTab:function(B){if(this.activeTab&&this.activeTab!=B){this.activeTab.setActive(false)}this.activeTab=B;if(this.activeTab.content.resize){this.activeTab.content.resize({forceResize:true})}this.fireEvent("tabChange",[this,B])}});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(B){this.setOptions(B);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(C,D){this.showItem(D)}.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(B){B.addEvents({close:(function(){this.tabBar.remove(B);this.tabSet.remove(B)}).bind(this)})},this);return this},remove:function(B){this.tabBar.remove(B);this.tabSet.remove(B)}});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(B){this.setOptions(B);var C=$(this.options.parent);this.domObj=C||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 F=0;var D=this.scroller.getStyle("left");if(D){F=D.toInt()}if(isNaN(F)){F=0}var E=Math.min(F+100,0);if(E>=0){this.scrollLeft.domObj.setStyle("visibility","hidden")}this.scrollRight.domObj.setStyle("visibility","");if($defined(this.scrollFx)){this.scrollFx.start("left",F,E)}else{this.scroller.setStyle("left",E)}}).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 F=0;var D=this.scroller.getStyle("left");if(D){F=D.toInt()}if(isNaN(F)){F=0}var E=Math.max(F-100,this.scrollWidth);if(E==this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden")}this.scrollLeft.domObj.setStyle("visibility","");if($defined(this.scrollFx)){this.scrollFx.start("left",F,E)}else{this.scroller.setStyle("left",E)}}).bind(this)})}else{this.options.scroll=false}if(this.options.toolbars){this.add(this.options.toolbars)}},update:function(){if(this.options.autoSize){(function(){var B=0;this.scroller.getChildren().each(function(C){B+=C.getSize().x});this.domObj.setStyles({width:B});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(E){this.scrollWidth-=E.getSize().x},this);if(this.scrollWidth<0){var B=0;var C=this.scroller.getStyle("left");if(C){B=C.toInt()}if(B<0){this.scrollLeft.domObj.setStyle("visibility","")}else{this.scrollLeft.domObj.setStyle("visibility","hidden")}if(B<=this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden");if(B<this.scrollWidth){if($defined(this.scrollFx)){this.scrollFx.start("left",B,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 D=0;var C=this.scroller.getStyle("left");if(C){D=C.toInt()}if(!isNaN(D)&&D!==0){if($defined(this.scrollFx)){this.scrollFx.start("left",0)}else{this.scroller.setStyle("left",0)}}}},add:function(){$A(arguments).flatten().each(function(B){if(this.options.scroll){B.addEvent("add",this.update.bind(this));B.addEvent("remove",this.update.bind(this));B.addEvent("show",this.scrollIntoView.bind(this))}if(this.scroller){this.scroller.adopt(B.domObj)}else{this.domObj.adopt(B.domObj)}this.domObj.addClass("jx"+B.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(B){},scrollIntoView:function(E){var D=this.domObj.getSize().x;var G=E.domObj.getCoordinates(this.scroller);var C=0;var F=this.scroller.getStyle("left");if(F){C=F.toInt()}if(C==="auto"||C.length<=0){C=0}else{C=C.toInt()}var I=this.scrollLeftSize?this.scrollLeftSize.x:0;var B=this.scrollRightSize?this.scrollRightSize.x:0;var H=C;if(C<-G.left+I){H=-G.left+I;if(H>=0){H=0}}else{if(D-G.right-B<C){H=D-G.right-B;if(H<this.scrollWidth){H=this.scrollWidth}}}if(H<0){this.scrollLeft.domObj.setStyle("visibility","")}else{this.scrollLeft.domObj.setStyle("visibility","hidden")}if(H<=this.scrollWidth){this.scrollRight.domObj.setStyle("visibility","hidden")}else{this.scrollRight.domObj.setStyle("visibility","")}if(H!=C){if($defined(this.scrollFx)){this.scrollFx.start("left",H)}else{this.scroller.setStyle("left",H)}}}});Jx.Toolbar.Item=new Class({Family:"Jx.Toolbar.Item",Implements:[Options],options:{active:true},domObj:null,initialize:function(B){this.al=[];this.domObj=new Element("li",{"class":"jxToolItem"});if(B){if(B.domObj){this.domObj.appendChild(B.domObj);if(B instanceof Jx.Button.Tab){this.domObj.addClass("jxTabItem")}}else{this.domObj.appendChild(B);if(B.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(B){this.setOptions(B);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 D=new Element("img",{"class":"jxTreeIcon",src:Jx.aPixel.src,alt:"",title:""});if(this.options.image){D.setStyle("backgroundImage","url("+this.options.image+")")}if(this.options.imageClass){D.addClass(this.options.imageClass)}var E;var B;var C=new Element("a",{href:"javascript:void(0)",html:this.options.label});C.addEvents({click:this.selected.bind(this),dblclick:this.selected.bind(this),drag:function(F){F.stop()},contextmenu:function(F){F.stop()},mousedown:(function(F){C.addClass("jxTreeItemPressed");E=true;B=true;C.focus();if(F.rightClick&&this.options.contextMenu){this.options.contextMenu.show(F)}}).bind(this),mouseup:function(F){C.removeClass("jxTreeItemPressed");B=false},mouseleave:function(F){C.removeClass("jxTreeItemPressed")},mouseenter:function(F){if(E&&B){C.addClass("jxTreeItemPressed")}},keydown:function(F){if(F.key=="enter"){C.addClass("jxTreeItemPressed")}},keyup:function(F){if(F.key=="enter"){C.removeClass("jxTreeItemPressed")}},blur:function(){E=false}});C.appendChild(D);if(typeof Drag!="undefined"){new Drag(C,{onStart:function(){this.stop()}})}return C},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(C){var B=(arguments.length>1)?arguments[1]:(this.owner&&this.owner.isLastNode(this));if(B){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(B){this.fireEvent("click",this)},getName:function(){return this.options.label},propertyChanged:function(B){this.options.enabled=B.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(B){this.parent($merge(B,{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 B=this.nodes.length-1;B>=0;B--){this.nodes[B].finalize();this.nodes.pop()}},clone:function(){var B=new Jx.TreeFolder(this.options);this.nodes.each(function(C){B.append(C.clone())});return B},isLastNode:function(B){if(this.nodes.length==0){return false}else{return this.nodes[this.nodes.length-1]==B}},update:function(D){if(!this.parent){return }var C=false;if(arguments.length>1){C=arguments[1]}else{C=(this.owner&&this.owner.isLastNode(this))}var E="jxTree"+this.options.type;E+=C?"Last":"";E+=this.options.open?"Open":"Closed";this.domObj.className=E;if(C){this.subDomObj.className="jxTree"}else{this.subDomObj.className="jxTree jxTreeNest"}if(this.nodes&&D){var B=this;this.nodes.each(function(G,F){G.update(false,F==B.nodes.length-1)})}},append:function(B){B.owner=this;this.nodes.push(B);this.subDomObj.appendChild(B.domObj);this.update(true);return this},insert:function(E,C){E.owner=this;if(!C){this.nodes.unshift(E);if(this.subDomObj.childNodes.length==0){this.subDomObj.appendChild(E.domObj)}else{this.subDomObj.insertBefore(E.domObj,this.subDomObj.childNodes[0])}}else{var B=false;for(var D=0;D<this.nodes.length;D++){if(this.nodes[D]==C){D=D+1;if(D<this.nodes.length){this.nodes.splice(D,0,E);this.subDomObj.insertBefore(E.domObj,this.subDomObj.childNodes[D]);B=true;break}}}if(!B){this.nodes.push(E);this.subDomObj.appendChild(E.domObj)}}this.update(true);return this},remove:function(C){C.owner=null;for(var B=0;B<this.nodes.length;B++){if(this.nodes[B]==C){this.nodes.splice(B,1);this.subDomObj.removeChild(this.subDomObj.childNodes[B]);break}}this.update(true);return this},replace:function(E,C){var B=false;for(var D=0;D<this.nodes.length;D++){if(this.nodes[D]==C){if(D<this.nodes.length){E.owner=this;this.nodes.splice(D,1,E);this.subDomObj.replaceChild(E.domObj,C.domObj);return true}}}return false},clicked:function(B){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(D){if(D.length==0){return this}if(D.length==1){for(var C=0;C<this.nodes.length;C++){if(this.nodes[C].getName()==D[0]){return this.nodes[C]}}return null}var B=D.shift();for(var C=0;C<this.nodes.length;C++){if(this.nodes[C].getName()==B&&this.nodes[C].findChild){return this.nodes[C].findChild(D)}}return null}});Jx.Tree=new Class({Extends:Jx.TreeFolder,Implements:[Jx.Addable],Family:"Jx.Tree",initialize:function(B){this.parent(B);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 B=this.nodes.length-1;B>=0;B--){this.subDomObj.removeChild(this.nodes[B].domObj);this.nodes[B].finalize();this.nodes.pop()}},update:function(B){var C=true;if(this.subDomObj){if(C){this.subDomObj.removeClass("jxTreeNest")}else{this.subDomObj.addClass("jxTreeNest")}}if(this.nodes&&B){this.nodes.each(function(D){D.update(false)})}},append:function(B){B.owner=this;this.nodes.push(B);this.subDomObj.appendChild(B.domObj);this.update(true);return this}});Fusion.Error=OpenLayers.Class({type:null,message:null,initialize:function(B,C){this.type=B;this.message=C},alert:function(){var B=this.typeToString(this.type);alert(OpenLayers.i18n("fusionError",{type:B,message:this.message}))},toString:function(){var B=this.typeToString(this.type);return B+": "+this.message},typeToString:function(B){switch(B){case Fusion.Error.FATAL:return"FATAL";case Fusion.Error.WARNING:return"WARNING";case Fusion.Error.NOTICE:return"NOTICE";default:return"UNKNOWN ("+B+")"}}});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(B){if(!this.events){this.events=[]}if(!B){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,OpenLayers.i18n("registerEventError")))}var C=new String(B);if(!this.events[B]){this.events[B]=[]}},registerForEvent:function(B,D){var C=new String(B);this.events[B].push(D)},deregisterForEvent:function(D,F){var E=new String(D);var B=false;if(!this.events[D]){return false}for(var C=0;C<this.events[D].length;C++){if(this.events[D][C]==F){this.events[D].splice(C,1);B=true}}return B},triggerEvent:function(C){var D=new String(C);if(!this.events||!this.events[C]){return false}for(var B=0;B<this.events[C].length;B++){this.events[C][B].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(B){this.sessionId=B;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 B=Fusion.getScriptLanguage();var D="layers/MapGuide/"+B+"/CreateSession."+B;var C={onSuccess:OpenLayers.Function.bind(this.createSessionThenGetAppDefCB,this)};Fusion.ajaxRequest(D,C)},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 B=new Fusion.Lib.MGRequest.MGGetResourceContent(this.applicationDefinition);B.parameters.session=this.sessionId;B.parameters.format="application/json";this.oBroker.dispatchRequest(B,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(O){var B=O.ApplicationDefinition;if(B.Title){var L=B.Title[0];document.title=L}if(B.MapSet){var J=B.MapSet[0];if(J.MapGroup instanceof Array){for(var G=0;G<J.MapGroup.length;G++){var D=new Fusion.Lib.ApplicationDefinition.MapGroup(J.MapGroup[G]);this.mapGroups[D.mapId]=D}}}else{Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("appDefParseError")))}if(B.WidgetSet){for(var G=0;G<B.WidgetSet.length;G++){var E=new Fusion.Lib.ApplicationDefinition.WidgetSet(B.WidgetSet[G]);this.widgetSets.push(E)}}else{Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("widgetSetParseError")))}if(B.Extension){var N=B.Extension[0];if(N.SearchDefinitions instanceof Array){var H=N.SearchDefinitions[0];if(H.SearchCategory instanceof Array){for(var G=0;G<H.SearchCategory.length;G++){var K={};var C=H.SearchCategory[G];K.id=C["@id"];K.name=C["@name"];K.layer=C.Layer?C.Layer[0]:"";K.searchDefinitions=[];this.searchCategories[K.id]=K;var M=C.SearchDefinition;for(var F=0;F<M.length;F++){var I=new Fusion.Lib.ApplicationDefinition.SearchDefinition(M[F]);I.category=K;K.searchDefinitions[I.id]=I;this.searchDefinitions[I.id]=I}}}}}},create:function(){for(var B=0;B<this.widgetSets.length;B++){this.widgetSets[B].create(this)}},getMapByName:function(B){var D=null;for(var C=0;C<this.widgetSets.length;C++){D=this.widgetSets[C].getMapByName(B);if(D){break}}return D},getMapById:function(D){var C=null;for(var B=0;B<this.widgetSets.length;B++){C=this.widgetSets[B].mapWidget;if(C.mapId==D){break}}return C},getMapByIndice:function(C){var B=null;if(this.widgetSets.length>C){B=this.widgetSets[C].getMapWidget()}return B},getMapGroup:function(B){return this.mapGroups[B]},getWidgetsByType:function(D){var C=[];for(var B=0;B<this.widgetSets.length;B++){C=C.concat(this.widgetSets[B].getWidgetsByType(D))}return C}});Fusion.Lib.ApplicationDefinition.MapGroup=OpenLayers.Class({initialView:null,maps:null,initialize:function(I){this.mapId=I["@id"][0];this.maps=[];if(I.InitialView){var D=I.InitialView[0];if(D.CenterX&&D.CenterY&&D.Scale){this.setInitialView({x:parseFloat(D.CenterX[0]),y:parseFloat(D.CenterY[0]),scale:parseFloat(D.Scale[0])})}else{if(D.MinX&&D.MinY&&D.MaxX&&D.MaxY){this.setInitialView({minX:parseFloat(D.MinX[0]),minY:parseFloat(D.MinY[0]),maxX:parseFloat(D.MaxX[0]),maxY:parseFloat(D.MaxY[0])})}else{}}}if(I.Map instanceof Array){for(var F=0;F<I.Map.length;F++){var B=new Fusion.Lib.ApplicationDefinition.Map(I.Map[F]);var M={groups:[],layers:[]};var J={layerEvents:{},groupEvents:{}};if(I.Map[F].Extension){var L=I.Map[F].Extension[0];if(L.Links){if(L.Links[0].Group instanceof Array){for(var E=0;E<L.Links[0].Group.length;E++){var K=L.Links[0].Group[E];M.groups.push({name:K.Name[0],url:K.Url[0]})}}if(L.Links[0].Layer instanceof Array){for(var E=0;E<L.Links[0].Layer.length;E++){var G=L.Links[0].Layer[E];M.layers.push({name:G.Name[0],url:G.Url[0]})}}}if(L.MapEvents){if(L.MapEvents[0].Layer instanceof Array){for(var E=0;E<L.MapEvents[0].Layer.length;E++){var G=L.MapEvents[0].Layer[E];var C={};C.name=G.Name[0];C.onEnable=[];if(G.OnEnable instanceof Array){C.onEnable=this.parseMapEventSubBlock(G.OnEnable[0])}C.onDisable=[];if(G.OnDisable instanceof Array){C.onDisable=this.parseMapEventSubBlock(G.OnDisable[0])}J.layerEvents[C.name]=C}}if(L.MapEvents[0].Group instanceof Array){for(var E=0;E<L.MapEvents[0].Group.length;E++){var K=L.MapEvents[0].Group[E];var H={};H.name=K.Name[0];H.onEnable=[];if(G.OnEnable instanceof Array){H.onEnable=this.parseMapEventSubBlock(K.OnEnable[0])}H.onDisable=[];if(G.OnDisable instanceof Array){H.onDisable=this.parseMapEventSubBlock(K.OnDisable[0])}J.groupEvents[H.name]=H}}}}B.mapInfo={links:M,mapEvents:J};this.maps.push(B)}}else{}},parseMapEventSubBlock:function(F){var B=[];if(F.Layer&&F.Layer instanceof Array){for(var D=0;D<F.Layer.length;D++){var C=F.Layer[D];B.push({type:"layer",name:C.Name[0],enable:C.Enable[0]=="true"?true:false})}}if(F.Group&&F.Group instanceof Array){for(var D=0;D<F.Group.length;D++){var E=F.Group[D];B.push({type:"group",name:E.Name[0],enable:E.Enable[0]=="true"?true:false})}}return B},getInitialView:function(){return this.initialView},setInitialView:function(B){this.initialView=B}});Fusion.Lib.ApplicationDefinition.Map=OpenLayers.Class({type:null,singleTile:false,extension:null,initialize:function(E){this.type=E.Type[0];if(E.SingleTile){var B=E.SingleTile[0].toLowerCase();this.singleTile=(B=="true")?true:false}if(E.Extension){this.extension=E.Extension[0]}else{this.extension={}}this.resourceId=this.extension.ResourceId?this.extension.ResourceId[0]:"";var C=this.extension.Options;this.layerOptions={};if(C&&C[0]){for(var D in C[0]){this.layerOptions[D]=C[0][D][0];if(this.layerOptions[D].toLowerCase()=="true"){this.layerOptions[D]=true}else{if(this.layerOptions[D].toLowerCase()=="false"){this.layerOptions[D]=false}}if(D=="maxExtent"||D=="minExtent"){this.layerOptions[D]=OpenLayers.Bounds.fromString(this.layerOptions[D])}}}var G=this.extension.Parameters;this.layerParams={};if(G&&G[0]){for(var D in G[0]){this.layerParams[D]=G[0][D][0]}}if(this.extension.ProjectionCode){this.layerOptions.projection=this.extension.ProjectionCode[0]}if(this.extension.ProjectionDef){var F=this.extension.ProjectionDef[0];if(!this.layerOptions.projection){this.layerOptions.projection="APP-DEF-PROJ"}Proj4js.defs[this.layerOptions.projection]=F}if(!this.layerOptions.projection){this.layerOptions.projection="EPSG:4326"}switch(this.type){case"MapGuide":case"MapServer":if(!Fusion.Layers[this.type]){Fusion.require("layers/"+this.type+"/"+this.type+".js")}break;case"Google":case"Yahoo":case"VirtualEarth":this.layerOptions.isBaseLayer=true;this.layerOptions.sphericalMercator=true;this.layerOptions.displayProjection="EPSG:4326";default:if(this.layerOptions.sphericalMercator){this.layerOptions.projection="EPSG:3785"}else{this.layerOptions.projection="EPSG:4326"}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(D){this.containers=[];this.widgetTags=[];this.widgetInstances=[];this.widgetTagsByName={};this.containersByName={};if(D.MapWidget){for(var C=0;C<D.MapWidget.length;C++){var E=new Fusion.Lib.ApplicationDefinition.Widget(D.MapWidget[C]);E.widgetSet=this;this.mapWidgetTag=E;this.mapId=D.MapWidget[C].MapId[0]}}if(D.Widget){for(var C=0;C<D.Widget.length;C++){var E=new Fusion.Lib.ApplicationDefinition.Widget(D.Widget[C]);E.widgetSet=this;this.widgetTags.push(E);this.widgetTagsByName[E.name]=E}}if(D.Container){for(var C=0;C<D.Container.length;C++){var B=new Fusion.Lib.ApplicationDefinition.Container(D.Container[C]);this.containers.push(B);this.containersByName[B.name]=B}}},addWidgetInstance:function(B){this.widgetInstances.push(B)},getMapWidget:function(){return this.mapWidget},create:function(B){var E=null;var D=Fusion.getQueryParam("mapid");if(D.length>0){E=B.getMapGroup(D);if(E){this.mapId=D}else{Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"can't find MapGroup: "+D+" - reverting to default map"))}}if(!E){E=B.getMapGroup(this.mapId)}this.mapWidget=new Fusion.Widget.Map(this.mapWidgetTag,E,this);this.mapWidget.setMenu();$(this.mapWidgetTag.name).widget=this.mapWidget;this.mapWidget.message=new Fusion.MapMessage(this.mapWidget.oMapOL.viewPortDiv);this.mapWidget.registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,(function(){if(this.message!=null){this.message.refreshLayout()}}).bind(this.mapWidget));for(var C=0;C<this.widgetTags.length;C++){this.widgetTags[C].create(this)}for(var C=0;C<this.containers.length;C++){this.containers[C].create(this)}},getMapByName:function(B){var C=null;if(this.mapWidget.getMapName()==B){C=this.mapWidget}return C},getWidgetsByType:function(D){var C=[];for(var B=0;B<this.widgetInstances.length;B++){if(this.widgetInstances[B].type==D){C.push(this.widgetInstances[B])}}return C},getWidgetByName:function(B){return this.widgetTagsByName[B]},getContainerByName:function(B){return this.containersByName[B]}});Fusion.Lib.ApplicationDefinition.Container=OpenLayers.Class({name:null,type:null,validPositions:["top","left","bottom","right"],position:"top",items:null,initialize:function(D){this.type=D.Type[0];this.name=D.Name[0];var B=D.Position?D.Position[0].toLowerCase():this.position;for(var C=0;C<this.validPositions.length;C++){if(this.validPositions[C]==B){this.position=B;break}}this.items=[];if(D.Item){for(var C=0;C<D.Item.length;C++){var E=new Fusion.Lib.ApplicationDefinition.Item(D.Item[C]);this.items.push(E)}}else{}},create:function(D){var B;if(this.type=="Toolbar"||this.type=="Statusbar"){if($(this.name)){B=new Jx.Toolbar({parent:this.name,position:this.position});$(this.name).container=B;this.createWidgets(D,B)}}else{if(this.type=="Splitterbar"){if($(this.name)){B=new Jx.Splitter(this.name,{splitInto:this.items.length});for(var C=0;C<this.items.length;C++){B.elements[C].id=this.name+"_"+C}$(this.name).container=B;this.createWidgets(D,B)}}}if(B&&B.domObj.jxLayout){B.domObj.jxLayout.resize({forceResize:true})}},createWidgets:function(D,B){for(var C=0;C<this.items.length;C++){this.items[C].create(D,B,this.name+"_"+C)}}});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(B){if(B){this.type=B.Type[0];this.name=B.Name?B.Name[0]:"";this.statusText=B.StatusText?B.StatusText[0]:"";this.statusText=OpenLayers.i18n(this.statusText);this.location=B.Location?B.Location[0]:"widgets/";if(this.location.slice(-1)!="/"){this.location+="/"}this.imageUrl=B.ImageUrl?B.ImageUrl[0]:"";this.imageClass=B.ImageClass?B.ImageClass[0]:"";this.tooltip=B.Tooltip?B.Tooltip[0]:"";this.tooltip=OpenLayers.i18n(this.tooltip);this.label=B.Label?B.Label[0]:"";this.label=OpenLayers.i18n(this.label);this.disabled=B.Disabled?(B.Disabled[0].toLowerCase()=="true"?true:false):false;if(B.Extension){this.extension=B.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(B){this.type=B.Function[0];switch(this.type){case"Widget":this.widgetName=B.Widget[0];break;case"Flyout":this.flyout=new Fusion.Lib.ApplicationDefinition.Flyout(B);break;case"Multi":this.multi=new Fusion.Lib.ApplicationDefinition.Multi(B);break;case"Separator":break}},create:function(F,C,J){switch(this.type){case"Widget":var G=F.getWidgetByName(this.widgetName);if(G){var B="FusionItem"+this.uniqueId[0];this.uniqueId[0]++;if(C instanceof Jx.Toolbar){var H=G.create(F,"");if(!H.uiClass){H.uiClass=Jx.Toolbar.Item;H.setUiObject(new H.uiClass())}else{if(H.uiClass==Jx.Button||H.uiClass==Jx.Button.Color||H.uiClass==Jx.Menu||H.uiClass==Jx.Button.Flyout){H.setUiObject(new H.uiClass({label:G.label,image:G.imageUrl,imageClass:G.imageClass,toggle:H.isExclusive}))}}C.add(H.uiObj);if(H.uiObj.setEnabled){H.uiObj.setEnabled(H.isEnabled());H.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){H.uiObj.setEnabled(H.isEnabled())})}}else{if(C instanceof Jx.Splitter){var H=G.create(F,J)}else{if(C instanceof Jx.Menu||C instanceof Jx.Menu.Context||C instanceof Jx.Menu.SubMenu){var H=G.create(F,"");if(!H.uiClass||H.uiClass==Jx.Button){H.uiClass=Jx.Menu.Item}else{if(H.uiClass==Jx.Menu){H.uiClass=Jx.Menu.SubMenu}}H.setUiObject(new H.uiClass({label:G.label,image:G.imageUrl,imageClass:G.imageClass,toggle:H.isExclusive}));C.add(H.uiObj);if(H.uiObj.setEnabled){H.uiObj.setEnabled(H.isEnabled());H.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){H.uiObj.setEnabled(H.isEnabled())})}}else{if(C instanceof Jx.Button.Multi){var H=G.create(F,"");H.uiClass=Jx.Button;H.setUiObject(new H.uiClass({label:G.label,image:G.imageUrl,imageClass:G.imageClass,toggle:H.isExclusive}));C.add(H.uiObj);if(H.uiObj.setEnabled){H.uiObj.setEnabled(H.isEnabled());H.registerForEvent(Fusion.Event.WIDGET_STATE_CHANGED,function(){H.uiObj.setEnabled(H.isEnabled())})}}}}}}else{Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"can't find widget: "+this.widgetName))}break;case"Flyout":var E;var D={label:this.flyout.label,tooltip:this.flyout.tooltip,image:this.flyout.imageUrl,imageClass:this.flyout.imageClass};if(C instanceof Jx.Toolbar){E=new Jx.Menu(D)}else{if(C instanceof Jx.Menu||C instanceof Jx.Menu.Context||C instanceof Jx.Menu.SubMenu){E=new Jx.Menu.SubMenu(D)}}C.add(E);this.flyout.create(F,E);break;case"Multi":var I;var D={label:this.multi.label,tooltip:this.multi.tooltip,image:this.multi.imageUrl,imageClass:this.multi.imageClass};I=new Jx.Button.Multi(D);C.add(I);this.multi.create(F,I);break;case"Separator":if(C instanceof Jx.Toolbar){C.add(new Jx.Toolbar.Separator())}else{if(C instanceof (Jx.Menu)||C instanceof (Jx.Menu.SubMenu)||C instanceof (Jx.Menu.Context)){C.add(new Jx.Menu.Separator())}}break}}});Fusion.Lib.ApplicationDefinition.Flyout=OpenLayers.Class({label:null,tooltip:null,description:null,imageUrl:null,items:null,initialize:function(C){this.label=C.Label?C.Label[0]:"";this.tooltip=C.Tooltip?C.Tooltip[0]:"";this.description=C.Description?C.Description[0]:"";this.imageUrl=C.ImageUrl?C.ImageUrl[0]:"";this.items=[];if(C.Item instanceof Array){for(var B=0;B<C.Item.length;B++){this.items.push(new Fusion.Lib.ApplicationDefinition.Item(C.Item[B]))}}},create:function(C,D){for(var B=0;B<this.items.length;B++){this.items[B].create(C,D)}}});Fusion.Lib.ApplicationDefinition.Multi=OpenLayers.Class({label:null,tooltip:null,description:null,imageUrl:null,items:null,initialize:function(C){this.label=C.Label?C.Label[0]:"";this.tooltip=C.Tooltip?C.Tooltip[0]:"";this.description=C.Description?C.Description[0]:"";this.imageUrl=C.ImageUrl?C.ImageUrl[0]:"";this.items=[];if(C.Item instanceof Array){for(var B=0;B<C.Item.length;B++){this.items.push(new Fusion.Lib.ApplicationDefinition.Item(C.Item[B]))}}},create:function(C,D){for(var B=0;B<this.items.length;B++){this.items[B].create(C,D)}}});Fusion.Lib.ApplicationDefinition.SearchDefinition=OpenLayers.Class({id:null,name:null,category:null,parameters:null,join:null,rule:null,initialize:function(D){this.id=D["@id"];this.name=D["@name"];if(D.Join instanceof Array){this.join=new Fusion.Lib.ApplicationDefinition.SearchJoin(D.Join[0])}this.parameters=[];if(D.Parameter instanceof Array){for(var C=0;C<D.Parameter.length;C++){this.parameters.push(D.Parameter[C]["@name"])}}this.reports=[];if(D.Report instanceof Array){for(var C=0;C<D.Report.length;C++){var B=D.Report[C].Label[0];var E=D.Report[C].Link[0];this.reports.push({label:B,link:E})}}var F;if(D.SearchAnd instanceof Array){this.rule=new Fusion.Lib.ApplicationDefinition.SearchRule("AND");F=D.SearchAnd[0]}else{if(D.SearchOr instanceof Array){this.rule=new Fusion.Lib.ApplicationDefinition.SearchRule("OR");F=D.SearchOr[0]}}if(F&&F.SearchCondition instanceof Array){for(var C=0;C<F.SearchCondition.length;C++){this.rule.add(new Fusion.Lib.ApplicationDefinition.SearchCondition(F.SearchCondition[C]))}}},getJoinUrl:function(B){if(this.join){return"&joinlayer="+this.join.layer+"&joinpk="+this.join.primaryKey+"&joinfk="+this.join.foreignKey}else{return""}},getFilterUrl:function(B){return"&filter="+encodeURIComponent(this.rule.toString(B))}});Fusion.Lib.ApplicationDefinition.SearchJoin=OpenLayers.Class({layer:null,primaryKey:null,foreignKey:null,initialize:function(B){this.layer=B.Layer?B.Layer[0]:"";this.primaryKey=B.PrimaryKey?B.PrimaryKey[0]:"";this.foreignKey=B.ForeignKey?B.ForeignKey[0]:""}});Fusion.Lib.ApplicationDefinition.SearchRule=OpenLayers.Class({type:null,conditions:null,initialize:function(B){this.type=B;this.conditions=[]},add:function(B){this.conditions.push(B)},remove:function(C){for(var B=0;B<this.conditions.length;B++){if(this.conditions[B]==C){this.conditions.splice(B,1);break}}},toString:function(D){var C=[];for(var B=0;B<this.conditions.length;B++){this.conditions[B].setParams(D);var E=this.conditions[B].toString();if(E!=""){C.push(E)}}return"("+C.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(B){this.column=B.Column[0];this.operator=this.operators[B.Operator[0].toLowerCase()];this.parameter=B.Parameter[0];this.quote=B["@quote"]?B["@quote"]:"";this.wildcard=B["@wildcard"]?B["@wildcard"]:"both";this.caseSensitive=true;if(B["@caseSensitive"]&&B["@caseSensitive"]=="false"){this.caseSensitive=false}},setParams:function(B){if(B[this.parameter]){this.value=B[this.parameter]}else{this.value=""}},toString:function(){var F=this.value?this.value:"";if(F==""&&!this.includeIfEmpty){return""}var E="";if(!this.caseSensitive){F=F.toUpperCase();E="Upper"}var D="";var D="";var B="";if(this.operator=="like"){if(this.wildcard=="before"||this.wildcard=="both"){D="*"}if(this.wildcard=="after"||this.wildcard=="both"){B="*"}}var C=this.operator=="like"?"*":"";return E+"("+this.column+") "+this.operator+" "+this.quote+D+F+B+this.quote}});Fusion.Lib.MGBroker=OpenLayers.Class({mapGuideURL:"",mapAgentURL:"",method:null,initialize:function(){},dispatchRequest:function(D,E){var C=D.encode()+"&ts="+(new Date()).getTime();if(this.method){D.options.method=this.method}var B=new OpenLayers.Ajax.Request(this.mapAgentURL,OpenLayers.Util.extend({parameters:D.parameters,onComplete:E},D.options));B.originalRequest=D},setSiteURL:function(C,B,D){this.user=B;this.pass=D;if(C.indexOf("mapagent.fcgi")==-1){if(C.charAt(C.length-1)!="/"){C=C+"/"}this.mapGuideURL=C;C=C+"mapagent/mapagent.fcgi"}this.mapAgentURL=C},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(B){OpenLayers.Util.extend(this.parameters,(B||{}))},setOptions:function(B){OpenLayers.Util.extend(this.options,(B||{}))},encode:function(){var B=sep="";for(var C in this.parameters){if(this.parameters[C]){B=B+sep+C+"="+encodeURI(this.parameters[C])}sep="&"}return B}});Fusion.Lib.MGRequest.MGEnumerateResources=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(D,B,C){this.initializeRequest();this.setParams({operation:"ENUMERATERESOURCES",resourceid:(D||"Library://"),type:(B||""),depth:(typeof C=="undefined"?-1:C)})}});Fusion.Lib.MGRequest.MGGetResourceContent=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B){this.initializeRequest();this.setParams({operation:"GETRESOURCECONTENT",resourceid:(B||"Library://")})}});Fusion.Lib.MGRequest.MGGetResourceHeader=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B){this.initializeRequest();this.setParams({operation:"GETRESOURCEHEADER",resourceid:(B||"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(C,D,B){this.initializeRequest();this.setParams({operation:"COPYRESOURCE",source:C,destination:D,overwrite:B})}});Fusion.Lib.MGRequest.MGDeleteResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B){this.initializeRequest();this.setParams({operation:"DELETERESOURCE",resourceid:B})}});Fusion.Lib.MGRequest.MGMoveResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(C,D,B){this.initializeRequest();this.setParams({operation:"MOVERESOURCE",source:C,destination:D,overwrite:B})}});Fusion.Lib.MGRequest.MGMoveResource=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(C,B,D){this.initializeRequest();this.setParams({method:"post",operation:"SETRESOURCE",resourceid:C,content:B,header:D})}});Fusion.Lib.MGRequest.MGDescribeSchema=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(C,B){this.initializeRequest();this.setParams({operation:"DESCRIBEFEATURESCHEMA",resourceid:C,schema:B})}});Fusion.Lib.MGRequest.MGGetSpatialContexts=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(C,B){this.initializeRequest();this.setParams({operation:"GETSPATIALCONTEXTS",resourceid:C,activeonly:B?"1":"0"})}});Fusion.Lib.MGRequest.MGEnumerateResourceReferences=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B){this.initializeRequest();this.setParams({operation:"ENUMERATERESOURCEREFERENCES",resourceid:B})}});Fusion.Lib.MGRequest.MGEnumerateResourceData=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(B){this.initializeRequest();this.setParams({operation:"ENUMERATERESOURCEDATA",resourceid:B})}});Fusion.Lib.MGRequest.MGGetVisibleMapExtent=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(E,J,I,H,K,M,O,N,C,G,L,D,F,B){this.initializeRequest();this.setParams({operation:"GETVISIBLEMAPEXTENT",session:E,mapname:J,setviewcenterx:I,setviewcentery:H,setviewscale:K,setdataextent:M,setdisplaydpi:O,setdisplaywidth:N,setdisplayheight:C,showlayers:G,hidelayers:L,showgroups:D,hidegroups:F,refreshlayers:B})}});Fusion.Lib.MGRequest.MGQueryMapFeatures=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(I,D,H,C,E,B,G,F){this.initializeRequest();this.setParams({operation:"QUERYMAPFEATURES",session:I,mapname:D,geometry:H,maxFeatures:C,persist:E,selectionVariant:B,layerNames:G,layerAttributeFilter:F})}});Fusion.Lib.MGRequest.MGGetFeatureSetEnvelope=OpenLayers.Class(Fusion.Lib.MGRequest,{initialize:function(D,C,B){this.initializeRequest();this.setParams({operation:"GETFEATURESETENVELOPE",session:D,mapname:C,featureSet:B})}});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(B){this.type=B.type;this.name=B.name;this.widgetTag=B;this.registerEventID(Fusion.Event.WIDGET_STATE_CHANGED);if(!Fusion.Widget.uiInstances[this.type]){Fusion.Widget.uiInstances[this.type]=[]}var C=B.extension.Group?B.extension.Group[0]:"";if(C!=""){if(!this.groups[C]){this.groups[C]=[]}this.groups[C].push(this);this.group=C}this.setMap(B.getMapWidget());if(B.name){this.domObj=$(B.name)}this.paramRegister=[];this.initializeWidget(B)},initializeWidget:function(){},activate:function(){},deactivate:function(){},setUiObject:function(B){Fusion.Widget.uiInstances[this.type].push(this);if(this.widgetTag.tooltip){if(B.setTooltip){B.setTooltip(this.widgetTag.tooltip)}else{if(B.button&&B.button.setTooltip){B.button.setTooltip(this.widgetTag.tooltip)}}}if(this.isExclusive){this.getMap().buttonSet.add(B)}if(B.options.active){this.activate()}if(B.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)){B.options.active=true;if(B.domA){B.domA.addClass("jx"+B.options.type+"Active")}}B.addEvents({click:(function(){this.activate()}).bind(this),up:(function(){var E=Fusion.Widget.uiInstances[this.type];for(var D=0;D<E.length;D++){var C=E[D];if(C.shouldActivateWith(this)&&C.uiObj){C.uiObj.options.active=false;if(C.uiObj.domA){C.uiObj.domA.removeClass("jx"+C.uiObj.options.type+"Active")}}}this.deactivate()}).bind(this),down:(function(){var E=Fusion.Widget.uiInstances[this.type];for(var D=0;D<E.length;D++){var C=E[D];if(C.shouldActivateWith(this)&&C.uiObj){C.uiObj.options.active=true;if(C.uiObj.domA){C.uiObj.domA.addClass("jx"+C.uiObj.options.type+"Active")}}}this.activate()}).bind(this)})}this.uiObj=B},shouldActivateWith:function(B){return true},setMap:function(B){if(this.mapLoadedWatcher){this.oMap.deregisterForEvent(Fusion.Event.MAP_LOADED,this.mapLoadedWatcher);this.mapLoadedWatcher=null}this.oMap=B;if(B){this.mapLoadedWatcher=OpenLayers.Function.bind(this._mapLoaded,this);B.registerForEvent(Fusion.Event.MAP_LOADED,this.mapLoadedWatcher)}if(B&&B.isLoaded()){this.enable()}else{this.disable()}},getMap:function(){return this.oMap},addControl:function(B){this.getMap().oMapOL.addControl(B)},_mapLoaded:function(){if(this.oMap&&this.oMap.isLoaded()){this.enable()}else{this.disable()}},setMutEx:function(B){this.isExclusive=B},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(C,B){},registerParameter:function(B){this.paramRegister.push(B)}});Fusion.Widget.uiInstances={};Fusion.Tool.Search=OpenLayers.Class({lastSearch:null,lastResult:null,resultOffset:0,initialize:function(){},getProperties:function(){var B=null;if(this.lastResult&&this.lastResult.properties){B=this.lastResult.properties}return B},getNumberOfProperties:function(){var B=0;if(this.lastResult&&this.lastResult.properties){B=this.lastResult.properties.length}return B},getProperty:function(C){var B="";if(this.lastResult&&this.lastResult.properties){B=this.lastResult.properties[C]}return B},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(B){result=null;if(this.lastResult&&this.lastResult.values){result=this.lastResult.values[B]}return result},zoomToResult:function(C){var C="&filter="+C;var B=this.getMap().arch+"/"+Fusion.getScriptLanguage()+"/Query."+Fusion.getScriptLanguage();var D={};D.parameters="session="+this.getMap().getSessionID()+"&mapname="+this.getMap().getMapName()+"&layers="+this.layerName+C;D.onComplete=OpenLayers.Function.bind(this.selectComplete,this);Fusion.ajaxRequest(B,D)},selectComplete:function(C){var B=new DomNode(C.responseXML);var D=B.getNodeText("Selection");if(D=="true"){this.getMap().newSelection();this.getMap().getSelection(OpenLayers.Function.bind(this.zoomToSelection,this))}},zoomToSelection:function(D){var E=D.getLowerLeftCoord();var F=D.getUpperRightCoord();var C=F.x-E.x;var B=F.y-E.y;E.x=E.x-C;F.x=F.x+C;E.y=E.y-B;F.y=F.y+B;this.getMap().setExtents(new OpenLayers.Bounds(E.x,E.y,F.x,F.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:"",_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(E,C,D){this.widgetTag=E;var B=E.name;this.aMaps=[];this.buttonSet=new Jx.ButtonSet();this.widgetSet=D;this._sDomObj=B;this._oDomObj=$(this._sDomObj);this.layerRoot=new Fusion.Layers.Group({legendLabel:"mapRoot",uniqueId:"mapRoot",groupName:"mapRoot",visible:true});var G=this._oDomObj.retrieve("jxLayout");if(G){G.addEvent("sizeChange",OpenLayers.Function.bind(this.sizeChanged,this))}if(E.extension.FractionalZoom){this.fractionalZoom=E.extension.FractionalZoom[0]=="false"?false:true}var H=null;if(E.extension.Scales){H=E.extension.Scales[0].split(",");this.fractionalZoom=false}if(E.extension.MaxScale){this.maxScale=parseInt(E.extension.MaxExtent[0])}var I=null;if(E.extension.MaxExtent){I=OpenLayers.Bounds.fromString(E.extension.MaxExtent[0])}OpenLayers.DOTS_PER_INCH=this._nDpi;if(!this.oMapOL){var J={controls:[],fallThrough:true,scales:H,fractionalZoom:this.fractionalZoom};if(E.extension.ConstrainMapExtent){this.bRestrictExtent=E.extension.ConstrainMapExtent[0]=="true"?true:false}if(I){J.maxExtent=I;this.maxExtent=I}this.oMapOL=new OpenLayers.Map(this._sDomObj,J)}this.oMapOL.viewPortDiv.style.position="absolute";this.oMapOL.viewPortDiv.style.zIndex=0;this.handlers=[];var F=true;if(E.extension.DisableMouseWheel&&E.extension.DisableMouseWheel[0]=="true"){F=false}if(F){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)}$(B).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(C)},mapLoaded:function(){this.setViewOptions(this.getUnits())},setMenu:function(){if(this.widgetTag.extension.MenuContainer){var C=new Jx.Menu.Context();var B=this.widgetSet.getContainerByName(this.widgetTag.extension.MenuContainer[0]);if(B){B.createWidgets(this.widgetSet,C);this.setContextMenu(C)}}},loadMapGroup:function(D){this.mapsLoaded=false;this.clearSelection();this.mapGroup=D;for(var C=0;C<this.aMaps.length;C++){if(this.aMaps[C].oLayerOL){this.aMaps[C].oLayerOL.destroy()}}this._fMetersperunit=-1;this.oMapOL.center=null;this.maxExtent=new OpenLayers.Bounds();this.aMaps=[];this.layerRoot.clear();for(var C=0;C<D.maps.length;++C){var B=D.maps[C];if(Fusion.Layers[B.type]){this.aMaps[C]=new Fusion.Layers[B.type](this,B,true);this.layerRoot.addGroup(this.aMaps[C].layerRoot)}else{this.aMaps[C]=new Fusion.Layers.Generic(this,B,true);this.layerRoot.addLayer(this.aMaps[C].layerRoot);this.layerLoaded()}this.aMaps[C].registerForEvent(Fusion.Event.LAYER_LOADED,OpenLayers.Function.bind(this.layerLoaded,this))}this.triggerEvent(Fusion.Event.MAP_MAP_GROUP_LOADED)},layerLoaded:function(){for(var C=0;C<this.aMaps.length;++C){if(!this.aMaps[C].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 B=this.aMaps[0].oRestoredState.extents.split(",");B[0]=parseFloat(B[0]);B[1]=parseFloat(B[1]);B[2]=parseFloat(B[2]);B[3]=parseFloat(B[3]);this.setExtents(new OpenLayers.Bounds(B[0],B[1],B[2],B[3]))}else{var D=this.setInitialExtents();this.setExtents(D)}this.triggerEvent(Fusion.Event.MAP_LOADED)},wheelChange:function(B,C){if(this.wheelTimer){clearTimeout(this.wheelTimer)}else{this.cumulativeDelta=0}this.cumulativeDelta+=(C<0)?-1:1;this.wheelTimer=setTimeout(OpenLayers.Function.bind(function(){this.doWheelChange(B,C)},this),200)},doWheelChange:function(J,E){this.wheelTimer=null;if(this.cumulativeDelta==0){return }var K=this.oMapOL.getSize();var H=K.w/2-J.xy.x;var G=J.xy.y-K.h/2;var F=this.cumulativeDelta>0?1/(this.cumulativeDelta+1):Math.abs(this.cumulativeDelta)+1;var I=this.oMapOL.baseLayer.getResolution()*F;var B=this.oMapOL.getLonLatFromPixel(J.xy);var D=new OpenLayers.LonLat(B.lon+H*I,B.lat+G*I);var C=new OpenLayers.Bounds(D.lon-K.w*I/2,D.lat-K.h*I/2,D.lon+K.w*I/2,D.lat+K.h*I/2);this.setExtents(C)},wheelUp:function(B){this.wheelChange(B,1)},wheelDown:function(B){this.wheelChange(B,-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(B){this.oMapOL.setOptions(B)},addMap:function(B){if(B.mapTag.layerOptions.maxExtent){this.maxExtent.extend(B.mapTag.layerOptions.maxExtent);this.oMapOL.setOptions({maxExtent:this.maxExtent})}if(this.bRestrictExtent!=null){if(this.bRestrictExtent){this.oMapOL.restrictedExtent=B.mapTag.layerOptions.maxExtent}else{this.oMapOL.restrictedExtent=false}}this.oMapOL.addLayer(B.oLayerOL);if(B.oLayerOL.isBaseLayer){this.projection=this.oMapOL.baseLayer.projection;this.units=this.oMapOL.baseLayer.units;this.oMapOL.setOptions({units:this.units,projection:this.projection})}B.registerForEvent(Fusion.Event.MAP_SELECTION_OFF,OpenLayers.Function.bind(this.selectionHandler,this));B.registerForEvent(Fusion.Event.MAP_SELECTION_ON,OpenLayers.Function.bind(this.selectionHandler,this))},getAllMaps:function(){return this.aMaps},reloadMap:function(){for(var B=0;B<this.aMaps.length;++B){var C=this.aMaps[B];window.setTimeout(OpenLayers.Function.bind(C.reloadMap,C),1)}},reloadNamedMap:function(C){if(C!=null&&C!=""){for(var B=0;B<this.aMaps.length;++B){var D=this.aMaps[B];if(D.getMapName()==C){window.setTimeout(OpenLayers.Function.bind(D.reloadMap,D),1)}}}},loadScaleRanges:function(D){for(var B=0;B<this.aMaps.length;++B){var C=this.aMaps[B];OpenLayers.Function.bind(C.loadScaleRanges(D),C)}},query:function(B){this.lastQueryOptions=B;for(var C=0;C<this.aMaps.length;C++){if(this.aMaps[C].query(B)){}}},selectionHandler:function(){if(this.hasSelection()){this.triggerEvent(Fusion.Event.MAP_SELECTION_ON)}else{this.triggerEvent(Fusion.Event.MAP_SELECTION_OFF)}},hasSelection:function(){for(var B=0;B<this.aMaps.length;B++){if(this.aMaps[B].hasSelection()){return true}}return false},clearSelection:function(){this.oSelection=null;this.lastQueryOptions=null;for(var B=0;B<this.aMaps.length;B++){this.aMaps[B].clearSelection()}},getSelection:function(E,D,C){var D=(arguments[1])?arguments[1]:"";var C=(arguments[2])?arguments[2]:"";this.aSelectionCallbacks.push(E);if(this.bFetchingSelection){return }this.bFetchingSelection=true;this.oSelection={};this.nSelectionMaps=0;for(var B=0;B<this.aMaps.length;B++){if(this.aMaps[B].layerType=="Google"||this.aMaps[B].layerType=="Yahoo"||this.aMaps[B].layerType=="VirtualEarth"||this.aMaps[B].layerType=="OpenStreetMap"){continue}this.nSelectionMaps++;this.aMaps[B].getSelection(OpenLayers.Function.bind(this.accumulateSelection,this,this.aMaps[B]),D,C)}},setSelection:function(D,C){for(var B=0;B<this.aMaps.length;B++){this.aMaps[B].setSelection(D,C)}},accumulateSelection:function(D,C){this.oSelection[D._sMapname]=C;if(!--this.nSelectionMaps){this.bFetchingSelection=false;for(var B=0;B<this.aSelectionCallbacks.length;B++){this.aSelectionCallbacks[B](this.oSelection)}this.aSelectionCallbacks=[]}},setActiveLayer:function(B){this.oActiveLayer=B;if(B){this.oActiveMap=B.map}this.triggerEvent(Fusion.Event.MAP_ACTIVE_LAYER_CHANGED,B)},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 B=$(this.getDomObj()).getContentBoxSize();if(this._oCurrentExtents){this.setExtents(this._oCurrentExtents)}this.triggerEvent(Fusion.Event.MAP_RESIZED,this)},redraw:function(){for(var B=0;B<this.aMaps.length;B++){if(this.aMaps[B].oLayerOL.params){this.aMaps[B].oLayerOL.params.ts=(new Date()).getTime()}}this.oMapOL.setCenter(this.oMapOL.getCenter(),this.oMapOL.getZoom(),false,true)},setBackgroundColor:function(B){this._oDomObj.style.backgroundColor=B},setExtents:function(C){if(!C){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,OpenLayers.i18n("nullExtents")))}if(C instanceof Array&&C.length==4){C=new OpenLayers.Bounds(C[0],C[1],C[2],C[3])}for(var B=0;B<this.aMaps.length;B++){if(this.aMaps[B].oLayerOL.params&&this.aMaps[B].noCache){this.aMaps[B].oLayerOL.params.ts=(new Date()).getTime()}}this.oMapOL.zoomToExtent(C,true);this._oCurrentExtents=this.oMapOL.getExtent()},setInitialExtents:function(){var C;var D=Fusion.getQueryParam("extent");if(D){C=new OpenLayers.Bounds.fromArray(D.split(","))}else{if(this.mapGroup.initialView){var B=this.mapGroup.getInitialView();if(B.x){C=this.getExtentFromPoint(B.x,B.y,B.scale)}else{if(B.minX){C=new OpenLayers.Bounds(B.minX,B.minY,B.maxX,B.maxY)}}if(!C.intersectsBounds(this.maxExtent)){Fusion.reportError("AppDef initial view is outside map maxExtent, resetting initialView to maxExtent");C=this.maxExtent}}else{C=this.getMapGroupExtent();if(!C){C=this.getMapGroupExtent(true)}}}this.initialExtents=C;return C},getMapGroupExtent:function(C){var D;for(var B=0;B<this.aMaps.length;++B){if(!C&&this.aMaps[B].arch=="Generic"){continue}D=this.aMaps[B].getMaxExtent()}return D},fullExtents:function(){var B=this.maxExtent;this.setExtents(B)},isMapLoaded:function(){return(this._oCurrentExtents)?true:false},zoom:function(G,F,D){if(D==1||D==0){this.oMapOL.panTo(new OpenLayers.LonLat(G,F))}else{var K=this.oMapOL.getExtent();if(this.fractionalZoom){var L=K.right-K.left;var J=K.top-K.bottom;var I,E,H,C;if(D>0){I=G-(L/2/D);E=G+(L/2/D);H=F-(J/2/D);C=F+(J/2/D)}else{if(D<0){I=G-((L/2)*Math.abs(D));E=G+((L/2)*Math.abs(D));H=F-((J/2)*Math.abs(D));C=F+((J/2)*Math.abs(D))}}this.setExtents(new OpenLayers.Bounds(I,H,E,C))}else{var B=this.oMapOL.getZoom();if(D>1){this.oMapOL.zoomTo(B+1)}else{if(D<1){this.oMapOL.zoomTo(B-1)}}}}},zoomToScale:function(C){var B=this.getCurrentCenter();var D=this.getExtentFromPoint(B.x,B.y,C);this.setExtents(D)},queryRect:function(E,D,C,B){},queryPoint:function(C,B){},pixToGeo:function(D,B){var C=this.oMapOL.getLonLatFromPixel(new OpenLayers.Pixel(D,B));if(C!=null){return{x:C.lon,y:C.lat}}return null},geoToPix:function(D,C){if(!(this._oCurrentExtents)){return null}var B=this.oMapOL.getPixelFromLonLat(new OpenLayers.LonLat(D,C));return{x:Math.floor(B.x),y:Math.floor(B.y)}},pixToGeoMeasure:function(B){var C=this.oMapOL.getResolution();return(B*C)},setProjection:function(C,B){this.projection=C;this.oMapOL.projection=C;this.oMapOL.units=B},setMetersPerUnit:function(B){if(this._fMetersperunit<0){Fusion.initUnits(B);this._fMetersperunit=B}else{if(B!=this._fMetersperunit){Fusion.reportError(new Fusion.Error(Fusion.Error.WARNING,"meters per unit value already set"))}}},getMetersPerUnit:function(){return this._fMetersperunit},setViewOptions:function(B){this.setWidgetParam("Units",B)},setWidgetParam:function(H,G){for(var D=0;D<Fusion.applicationDefinition.widgetSets.length;++D){var E=Fusion.applicationDefinition.widgetSets[D];for(var C=0;C<E.widgetInstances.length;++C){var F=E.widgetInstances[C];for(var B=0;B<F.paramRegister.length;++B){if(F.paramRegister[B]==H){F.setParameter(H,G)}}}}},geoToPixMeasure:function(B){return parseInt(B/this.oMapOL.getResolution())},getCurrentCenter:function(){var B=this.getCurrentExtents().getCenterLonLat();return{x:B.lon,y:B.lat}},getCurrentExtents:function(){return this.oMapOL.getExtent()},getExtentFromPoint:function(G,F,B){if(!B){B=this.getScale()}var E=OpenLayers.Util.getResolutionFromScale(B,this.oMapOL.baseLayer.units);var D=this.getSize();var H=D.w*E;var C=D.h*E;return new OpenLayers.Bounds(G-H/2,F-C/2,G+H/2,F+C/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(B){return this.oMapOL.events.getMousePosition(B)},setCursor:function(C){this.cursor=C;if(this.isBusy()){return }if(C&&C.length&&typeof C=="object"){for(var B=0;B<C.length;B++){this._oDomObj.style.cursor=C[B];if(this._oDomObj.style.cursor==C[B]){break}}}else{if(typeof C=="string"){this._oDomObj.style.cursor=C}else{this._oDomObj.style.cursor="auto"}}},observeEvent:function(C,B){OpenLayers.Event.observe(this._oDomObj,C,B,false)},stopObserveEvent:function(C,B){OpenLayers.Event.stopObserving(this._oDomObj,C,B,false)},activateWidget:function(B){},deactivateWidget:function(B){},isLoaded:function(){return(this.oMapOL.getExtent()!=null)},getLinkParams:function(){var C={extent:this.getCurrentExtents().toBBOX()};if(this.lastQueryOptions){if(this.lastQueryOptions.filter){C.filter=this.lastQueryOptions.filter}if(this.lastQueryOptions.geometry){C.spatialfilter=this.lastQueryOptions.geometry}if(this.lastQueryOptions.queryHiddenLayers){C.queryHiddenLayers=this.lastQueryOptions.queryHiddenLayers}if(this.lastQueryOptions.maxFeatures){C.maxfeatures=this.lastQueryOptions.maxFeatures}if(this.lastQueryOptions.layers){C.selectlayer=this.lastQueryOptions.layers}if(this.lastQueryOptions.selectionType){C.variant=this.lastQueryOptions.selectionType}}for(var B=0;B<this.aMaps.length;++B){C=OpenLayers.Util.extend(C,this.aMaps[B].getLinkParams())}return OpenLayers.Util.getParameterString(C)},getMapTip:function(B){var E=this.getScale();for(var C=this.aMaps.length-1;C>=0;C--){var D=this.aMaps[C];if(E>=D.minScale&&E<=D.maxScale&&D.layerRoot.visible){D.getMapTip(B)}}},supressContextMenu:function(B){this.bSupressContextMenu=B},setContextMenu:function(B){this.oContextMenu=B},onContextMenu:function(B){B=window.event?window.event:B;if(this.oContextMenu&&!this.bSupressContextMenu&&this.isLoaded()){this.oContextMenu.show(new Event(B));this.contextMenuPosition=this.getEventPosition(B);OpenLayers.Event.stop(B)}},executeFromContextMenu:function(B){B.activate(this.contextMenuPosition.x,this.contextMenuPosition.y)}});Fusion.SelectionObject=OpenLayers.Class({aLayers:null,initialize:function(C){this.aLayers=[];this.nTotalElements=0;this.nLayers=0;if(C.layers&&C.layers.length>0){this.fMinX=C.extents.minx;this.fMinY=C.extents.miny;this.fMaxX=C.extents.maxx;this.fMaxY=C.extents.maxy;this.nLayers=C.layers.length;for(var B=0;B<C.layers.length;B++){this.aLayers[B]=new Fusion.SelectionObject.Layer(C,C.layers[B])}}},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(C){var B=null;for(var D=0;D<this.nLayers;D++){if(this.aLayers[D].getName()==C){B=this.aLayers[D];break}}return B},getLayer:function(B){if(B>=0&&B<this.nLayers){return this.aLayers[B]}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(E,J){this.name=J;this.nElements=E[J].numelements;this.aElements=[];this.nProperties=E[J].propertyvalues.length;this.aPropertiesName=[];this.aPropertiesName=E[J].propertyvalues;this.aPropertiesTypes=[];this.aPropertiesTypes=E[J].propertytypes;this.area=0;this.distance=0;for(var G=0;G<E[J].values.length;G++){this.aElements[G]=[];for(var F=0;F<E[J].values[G].length;F++){this.aElements[G][F]=E[J].values[G][F]}}for(var G=0;G<E[J].metadata.length;G++){var I=E[J].metadata[G];var H=I[0];var K=I[1];var B=I[2];var C=I[3];var D=I[4];this.area+=parseFloat(C);this.distance+=parseFloat(D)}},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(C,B){if(C>=0&&C<this.nElements&&B>=0&&B<this.nProperties){return this.aElements[C][B]}else{return null}}});Fusion.MapMessage=OpenLayers.Class({parentNode:null,domObj:null,leadingIcon:null,textCell:null,message:"",infoIconName:"images/icons/info.png",warningIconName:"images/icons/warning.png",errorIconName:"images/icons/error.png",containerCssText:"position:absolute; z-index:10000; padding:10px; border:solid 2px #ECECEC; background:#FFFFBB",iconCssText:"margin-right:10px",textCellCssText:"width:100%; vertical-align:top; font: 8pt Tahoma",opacity:0.95,initialize:function(C){this.parentNode=$(C);var D=document.createElement("div");D.style.visibility="hidden";this.container=$(D);C.appendChild(D);D.style.cssText=this.containerCssText;var H={left:10,top:10};D.style.left=H.left+"px";D.style.top=H.top+"px";var F=document.createElement("table");D.appendChild(F);F.style.width="100%";F.cellSpacing="0";F.cellPadding="0";F.border="0";var G=F.insertRow(0);var B=G.insertCell(0);var E=document.createElement("img");E.src=this.infoIconName;B.appendChild(E);E.style.cssText=this.iconCssText;this.leadingIcon=E;B=G.insertCell(1);B.style.cssText=this.textCellCssText;this.textCell=$(B);this.textCell.innerHTML=this.message;this.refreshLayout();this.container.setOpacity(0);this.container.style.visibility="visible"},info:function(B){this.message=B;this.leadingIcon.src=this.infoIconName;this.show()},warn:function(B){this.message=B;this.leadingIcon.src=this.warningIconName;this.show()},error:function(B){this.message=B;this.leadingIcon.src=this.errorIconName;this.show()},clear:function(){this.message="";this.textCell.innerHTML="";this.hide()},show:function(){this.textCell.innerHTML=this.message;this.container.fade(this.opacity)},hide:function(){this.container.fade(0)},refreshLayout:function(){var B=this.parentNode.offsetWidth-44;if(B>=0){this.container.style.width=this.parentNode.offsetWidth-44+"px"}},CLASS_NAME:"Fusion.MapMessage"});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,C,B){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(B!=null){this.bIsMapWidgetLayer=B}this.mapTag=C;if(!this.mapTag.layerOptions){this.mapTag.layerOptions={}}this.ratio=this.mapTag.layerOptions.MapRatio?this.extension.MapRatio[0]:1;this.bSingleTile=C.singleTile;this.bIsBaseLayer=C.isBaseLayer;this.sMapResourceId=C.resourceId?C.resourceId:"";this.mapInfo=C.mapInfo;this.layerType=C.type},loadScaleRanges:function(B){B()},getMapName:function(){return this._sMapname},getMapTitle:function(){return this._sMapTitle},isMapLoaded:function(){return this.bMapLoaded},getMaxExtent:function(){var B=null;if(this.oLayerOL){B=this.oLayerOL.maxExtent}return B},hasSelection:function(){return this.bSelectionOn},getSelectedFeatureCount:function(){var B=0;return B},getSelectedLayers:function(){var B=[];return B},getSelectableLayers:function(){var B=[];return B},setSelection:function(C,B){},getSelection:function(D,C,B){},clearSelection:function(){},query:function(B){},processLayerEvents:function(F,C){if(this.mapInfo&&this.mapInfo.mapEvents.layerEvents[F.layerName]){var H=this.mapInfo.mapEvents.layerEvents[F.layerName];var E=C?H.onEnable:H.onDisable;for(var D=0;D<E.length;D++){var I=E[D];if(I.type=="layer"){var B=this.layerRoot.findLayer(I.name);if(B){if(I.enable){B.show(true)}else{B.hide(true)}}}else{if(I.type=="group"){var G=this.layerRoot.findGroupByAttribute("groupName",I.name);if(G){if(I.enable){G.show(true)}else{G.hide(true)}}}}}}},processGroupEvents:function(G,C){if(this.mapInfo&&this.mapInfo.mapEvents.groupEvents[G.groupName]){var I=this.mapInfo.mapEvents.groupEvents[G.groupName];var E=C?I.onEnable:I.onDisable;for(var D=0;D<E.length;D++){var H=E[D];if(H.type=="layer"){var B=this.layerRoot.findLayer(H.name);if(B){if(H.enable){B.show(true)}else{B.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)}}}}}}},refreshLayer:function(B){this.drawMap()},setParameter:function(C,B){if(C=="SelectionType"){this.selectionType=B}},loadStart:function(){if(this.bIsMapWidgetLayer){this.mapWidget._addWorker()}},loadEnd:function(){if(this.bIsMapWidgetLayer){this.mapWidget._removeWorker()}},getGroupInfoUrl:function(D){if(this.mapInfo){var B=this.mapInfo.links.groups;for(var C=0;C<B.length;C++){if(B[C].name==D){return B[C].url}}}return null},getLayerInfoUrl:function(B){if(this.mapInfo){var D=this.mapInfo.links.layers;for(var C=0;C<D.length;C++){if(D[C].name==B){return D[C].url}}}return null},getMapTip:function(B){}});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(C,B){this.uniqueId=C.uniqueId;this.name=C.groupName;this.groups=[];this.layers=[];this.oMap=B;this.groupName=C.groupName;this.legendLabel=C.legendLabel;this.parentUniqueId=C.parentUniqueId;this.groupType=C.groupType;this.displayInLegend=C.displayInLegend;this.expandInLegend=C.expandInLegend;this.visible=C.visible;this.initiallyVisible=C.visible;this.actuallyVisible=C.actuallyVisible;this.isBaseMapGroup=C.isBaseMapGroup;this.registerEventID(Fusion.Event.GROUP_PROPERTY_CHANGED)},show:function(B){if(this.visible){return }this.oMap.showGroup(this,B?true:false);this.set("visible",true);if(this.legend&&this.legend.treeItem&&this.legend.treeItem.checkBox){this.legend.treeItem.checkBox.checked=true}},hide:function(B){if(!this.visible){return }this.oMap.hideGroup(this,B?true:false);this.set("visible",false);if(this.legend&&this.legend.treeItem&&this.legend.treeItem.checkBox){this.legend.treeItem.checkBox.checked=false}},isVisible:function(){return this.visible},clear:function(){for(var B=0;B<this.groups.length;B++){this.groups[B].clear()}for(var B=0;B<this.layers.length;B++){this.layers[B].clear()}this.groups=[];this.layers=[]},set:function(C,B){this[C]=B;this.triggerEvent(Fusion.Event.GROUP_PROPERTY_CHANGED,this)},addGroup:function(C,B){C.parentGroup=this;if(B){this.groups.unshift(C)}else{this.groups.push(C)}},addLayer:function(C,B){C.parentGroup=this;if(B){this.layers.unshift(C)}else{this.layers.push(C)}},findGroup:function(B){return this.findGroupByAttribute("name",B)},findGroupByAttribute:function(C,D){if(this[C]==D){return this}for(var B=0;B<this.groups.length;B++){var E=this.groups[B].findGroupByAttribute(C,D);if(E){return E}}return null},findLayer:function(B){return this.findLayerByAttribute("name",B)},findLayerByAttribute:function(D,E){for(var C=0;C<this.layers.length;C++){if(this.layers[C][D]==E){return this.layers[C]}}for(var C=0;C<this.groups.length;C++){var B=this.groups[C].findLayerByAttribute(D,E);if(B){return B}}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(E,B){this.oMap=B;this.layerName=E.layerName;this.uniqueId=E.uniqueId;this.resourceId=E.resourceId;this.selectedFeatureCount=0;this.layerTypes=[].concat(E.layerTypes);this.legendLabel=E.legendLabel;this.displayInLegend=E.displayInLegend;this.expandInLegend=E.expandInLegend;this.actuallyVisible=E.actuallyVisible;this.statusDefault=E.statusdefault;this.editable=E.editable;this.visible=E.visible;this.initiallyVisible=E.visible;this.selectable=E.selectable;this.isBaseMapLayer=E.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=E.parentGroup;this.minScale=E.minScale;this.maxScale=E.maxScale;if(this.maxScale=="infinity"){this.maxScale=1000000000000}this.scaleRanges=[];if(E.scaleRanges){for(var C=0;C<E.scaleRanges.length;C++){var D=new Fusion.Layers.ScaleRange(E.scaleRanges[C],this.layerType);this.scaleRanges.push(D)}}},supportsType:function(C){for(var B=0;B<this.layerTypes.length;B++){if(this.layerTypes[B]==C){return true}}return false},getScaleRange:function(B){for(var C=0;C<this.scaleRanges.length;C++){if(this.scaleRanges[C].contains(B)){return this.scaleRanges[C]}}return null},show:function(B){if(this.visible){return }this.set("visible",true);this.oMap.showLayer(this,B?true:false);if(this.legend&&this.legend.treeItem&&this.legend.treeItem.checkBox){this.legend.treeItem.checkBox.checked=true}},hide:function(B){if(!this.visible){return }this.set("visible",false);this.oMap.hideLayer(this,B?true:false);if(this.legend&&this.legend.treeItem&&this.legend.treeItem.checkBox){this.legend.treeItem.checkBox.checked=false}},isVisible:function(){return this.visible},clear:function(){},set:function(C,B){this[C]=B;this.oMap.triggerEvent(Fusion.Event.LAYER_PROPERTY_CHANGED,this)}});Fusion.Layers.ScaleRange=OpenLayers.Class({styles:null,initialize:function(G,C,F){this.minScale=G.minScale;this.maxScale=G.maxScale;if(this.maxScale=="infinity"||this.maxScale=="auto"){this.maxScale=Infinity}this.styles=[];if(!G.styles){var E=new Fusion.Layers.StyleItem({legendLabel:"DWF"},C,F);this.styles.push(E);return }var D=G.styles.length>1?false:C;for(var B=0;B<G.styles.length;B++){var E=new Fusion.Layers.StyleItem(G.styles[B],D,F);this.styles.push(E)}},contains:function(B){var C=Math.round(B);return C>=this.minScale&&C<=this.maxScale}});Fusion.Layers.StyleItem=OpenLayers.Class({clientAgent:"Fusion Viewer",initialize:function(D,B,C){this.iconOpt=C;this.iconX=D.icon_x||0;this.iconY=D.icon_y||0;this.legendLabel=D.legendLabel;this.filter=D.filter;this.geometryType=D.geometryType;if(this.geometryType==""){this.geometryType=-1}this.categoryIndex=D.categoryIndex;if(this.categoryindex==""){this.categoryindex=-1}this.index=D.index;this.staticIcon=B}});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 features selected",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",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",redlineLayerName:"Digitizing Layer ",printShowTitle:"Show Title?",printOptions:"Options",printTitleText:"Title",printShowLegend:"Show Legend?",printShowNorthArrow:"Show North Arrow?",quickPlotResolutionWarning:"The current settings exceed the map resolution. Zooming out or increasing the scaling will help create a more legible plot",noCommercialMapLayers:"NONE",googleStreet:"Google Street",googleSatellite:"Google Satellite",googleTerrain:"Google Terrain",googleHybrid:"Google Hybrid",yahooStreet:"Yahoo Street",yahooSatellite:"Yahoo Satellite",yahooHybrid:"Yahoo Hybrid",bingStreet:"Bing Street",bingSatellite:"Bing Satellite",bingHybrid:"Bing Hybrid",openStreetMap:"Open Street Map",openStreetMapOsmarender:"Open Street Map (Osmarender)",openStreetMapCycleMap:"Open Street Map (CycleMap)",searchPaneTitle:"Search",searchButton:"find",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",quickPlotResolutionWarning:"The current settings exceed the map resolution. Zooming out or increasing the scaling will help create a more legible plot",noCommercialMapLayers:"NINGUNO",googleStreet:"Google Callejero",googleSatellite:"Google Sat&eacute;lite",googleTerrain:"Google Terrain",googleHybrid:"Google H�brido",yahooStreet:"Yahoo Street",yahooSatellite:"Yahoo Satellite",yahooHybrid:"Yahoo Hybrid",bingStreet:"Bing Street",bingSatellite:"Bing Satellite",bingHybrid:"Bing Hybrid",openStreetMap:"Open Street Map",openStreetMapOsmarender:"Open Street Map (Osmarender)",openStreetMapCycleMap:"Open Street Map (CycleMap)",end:"Fin"};OpenLayers.Lang.ca={unhandledRequest:"Resposta a petici� no gestionada ${statusText}",permalink:"Enlla� permanent",overlays:"Capes addicionals",baseLayer:"Capa Base",sameProjection:"El mapa de refer�ncia nom�s funciona si t� la mateixa projecci� que el mapa principal",readNotImplemented:"Lectura no implementada.",writeNotImplemented:"Escriptura no implementada.",noFID:"No es pot actualitzar un element per al que no existeix FID.",errorLoadingGML:"Error caregant el fitxer GML ${url}",browserNotSupported:"El seu navegador no suporta renderitzaci� vectorial. Els renderitzadors suportats actualmente s�n:\n${renderers}",componentShouldBe:"addFeatures : el component ha de ser de tipus ${geomType}",getFeatureError:"getFeatureFromEvent ha estat cridat a una capa sense renderizador. Aix� normalment vol dir que s'ha eliminat una capa, per� no el handler associat a ella.",minZoomLevelError:"La propietat minZoomLevel s'ha d'utilitzar nom�s amb les capes que tenen FixedZoomLevels. El fet que una capa wfs comprovi minZoomLevel �s una reliquia del passat. No podem, per�, eliminar-la sense trencar les aplicacions d'OpenLayers que en puguin dependre. Aix� doncs estem fent-la obsoleta -- la comprovaci� minZoomLevel s'eliminar� a la versi� 3.0. Feu servir els par�metres min/max resolution en substituci�, tal com es descriu aqu�: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"Transacci� WFS: CORRECTA ${response}",commitFailed:"Transacci� WFS: HA FALLAT ${response}",googleWarning:"La capa Google no s'ha pogut carregar correctament.<br><br>Per evitar aquest missatge, sel�leccioneu una nova Capa Base al gestor de capes de la cantonada superior dreta.<br><br>Probablement aix� �s degut a que l'script de la biblioteca de Google Maps no ha estat incl�s a la vostra p�gina, o no cont� la clau de l'API correcta per a la vostra adre�a.<br><br>Desenvolupadors: Per obtenir consells sobre com fer anar aix�, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>f�u clic aqu�</a>",getLayerWarning:"Per evitar aquest missatge, sel�leccioneu una nova Capa Base al gestor de capes de la cantonada superior dreta.<br><br>Probablement aix� �s degut a que l'script de la biblioteca ${layerLib} no ha estat incl�s a la vostra p�gina.<br><br>Desenvolupadors: Per obtenir consells sobre com fer anar aix�, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>f�u clic aqu�</a>",scale:"Escala = 1 : ${scaleDenom}",layerAlreadyAdded:"Heu intentat afegir la capa: ${layerName} al mapa, pero ja ha estat afegida anteriorment",reprojectDeprecated:"Esteu fent servir l'opci� 'reproject' a la capa ${layerName}. Aquesta opci� �s obsoleta: el seu �s fou concebut per suportar la visualitzaci� de dades sobre mapes base comercials, per� aquesta funcionalitat s'hauria d'assolir ara mitjan�ant el suport de la projecci� Spherical Mercator. M�s informaci� disponible a http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Aquest m�tode �s obsolet i s'eliminar� a la versi� 3.0. Si us plau feu servir em m�tode alternatiu ${newMethod}.",boundsAddError:"Ha de proporcionar els valors x i y a la funci� add.",lonlatAddError:"Ha de proporcionar els valors lon i lat a la funci� add.",pixelAddError:"Ha de proporcionar els valors x i y a la funci� add.",unsupportedGeometryType:"Tipus de geometria no suportada: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition ha fallat: l'element amb id ${elemId} pot estar fora de lloc.",filterEvaluateNotImplemented:"evaluate no est� implementat per aquest tipus de filtre.",end:""};OpenLayers.Lang["cs-CZ"]={unhandledRequest:"Nezpracovaná návratová hodnota ${statusText}",permalink:"Odkaz na aktuální mapu",overlays:"Překryvné vrstvy",baseLayer:"Podkladové vrstvy",sameProjection:"Přehledka pracuje správně pouze pokud je ve stejné projekci, jako hlavní mapa",readNotImplemented:"Read není implementováno.",writeNotImplemented:"Write není implementováno.",noFID:"Nelze aktualizovat prvek, pro který neexistuje FID.",errorLoadingGML:"Chyba při načítání souboru GML ${url}",browserNotSupported:"Váš prohlížeč nepodporuje vykreslování vektorů. Momentálně podporované nástroje jsou::\n${renderers}",componentShouldBe:"addFeatures : komponenta by měla být ${geomType}",getFeatureError:"getFeatureFromEvent bylo zavoláno na vrstvě, která nemá vykreslovač. To obyčejně znamená, že jste odstranil vrstvu, ale ne rutinu s ní asociovanou.",minZoomLevelError:"Vlastnost minZoomLevel by se měla používat pouze s potomky FixedZoomLevels vrstvami. To znamená, že vrstva wfs kontroluje, zda-li minZoomLevel není zbytek z minulosti.Nelze to ovšem vyjmout bez možnosti, že bychom rozbili aplikace postavené na OL, které by na tom mohly záviset. Proto tuto vlastnost nedoporučujeme používat --  kontrola minZoomLevel bude odstraněna ve verzi 3.0. Použijte prosím raději nastavení min/max podle příkaldu popsaného na: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: ÚSPĚCH ${response}",commitFailed:"WFS Transaction: CHYBA ${response}",googleWarning:"Nepodařilo se správně načíst vrstvu Google.<br><br>Abyste se zbavili této zprávy, zvolte jinou základní vrstvu v přepínači vrstev.<br><br>To se většinou stává, pokud nebyl načten skript, nebo neobsahuje správný klíč pro API pro tuto stránku.<br><br>Vývojáři: Pro pomoc, aby tohle fungovalo , <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>klikněte sem</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 either 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:"Měřítko = 1 : ${scaleDenom}",layerAlreadyAdded:"Pokusili jste se přidat vrstvu: ${layerName} do mapy, ale tato vrstva je již v mapě přítomna.",reprojectDeprecated:"Použil jste volbu 'reproject' ve vrstvě ${layerName}. Tato volba není doporučená: byla zde proto, aby bylo možno zobrazovat data z okomerčních serverů, ale tato funkce je nyní zajištěna pomocí podpory Spherical Mercator. Více informací naleznete na http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Tato metodat není doporučená a bude vyjmuta ve verzi 3.0. Prosím, použijte raději ${newMethod}.",boundsAddError:"Pro přídavnou funkci musíte zadat obě souřadnice x a y.",lonlatAddError:"Pro přídavnou funkci musíte zadat obě souřadnice lon a lat.",pixelAddError:"Pro přídavnou funkci musíte zadat obě souřadnice x a y.",unsupportedGeometryType:"Nepodporovaný typ geometrie: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition selhalo: element s  id ${elemId} je asi umístěn chybně.",end:""};OpenLayers.Lang["da-DK"]={unhandledRequest:"En ikke h�ndteret foresp�rgsel returnerede ${statusText}",permalink:"Permalink",overlays:"Kortlag",baseLayer:"Baggrundslag",sameProjection:"Oversigtskortet fungerer kun n�r det har samme projektion som hovedkortet",readNotImplemented:"L�sning er ikke implementeret.",writeNotImplemented:"Skrivning er ikke implementeret.",noFID:"Kan ikke opdateret en feature (et objekt) der ikke har et FID.",errorLoadingGML:"Fejlede under indl�sning af GML fil ${url}",browserNotSupported:"Din browser underst�tter ikke vektor visning. F�lgende vektor visninger underst�ttes:\n${renderers}",componentShouldBe:"addFeatures : komponenten skal v�re en ${geomType}",getFeatureError:"getFeatureFromEvent blev kaldt p� et lag uden en visning. Dette betyder som regel at du har destrueret et lag, men ikke de h�ndteringer der var tilknyttet.",minZoomLevelError:"Egenskaben minZoomLevel er kun beregnet til brug med FixedZoomLevels. At dette WFS lag kontrollerer minZoomLevel egenskaben, er et levn fra en tidligere version. Vi kan desv�rre ikke fjerne dette uden at risikere at �del�gge eksisterende OL baserede programmer der  benytter denne funktionalitet. Egenskaben b�r derfor ikke anvendes, og minZoomLevel kontrollen herunder vil blive fjernet i version 3.0. Benyt istedet min/max opl�snings indstillingerne, som er beskrevet her: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS transaktion: LYKKEDES ${response}",commitFailed:"WFS transaktion: MISLYKKEDES ${response}",googleWarning:"Google laget kunne ikke indl�ses.<br><br>For at fjerne denne besked, v�lg et nyt bagrundskort i lagskifteren i �verste h�jre hj�rne.<br><br>Fejlen skyldes formentlig at Google Maps bibliotekts scriptet ikke er inkluderet, eller ikke indeholder den korrkte API n�gle for dit site.<br><br>Udviklere: For hj�lp til at f� dette til at fungere, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>klik her</a>",getLayerWarning:"${layerType}-laget kunne ikke indl�ses.<br><br>For at fjerne denne besked, v�lg et nyt bagrundskort i lagskifteren i �verste h�jre hj�rne.<br><br>Fejlen skyldes formentlig at ${layerLib} bibliotekts scriptet ikke er inkluderet.<br><br>Udviklere: For hj�lp til at f� dette til at fungere, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>klik her</a>",scale:"M�lforhold = 1 : ${scaleDenom}",layerAlreadyAdded:"Du har fors�gt at tilf�je laget: ${layerName} til kortet, men det er allerede tilf�jet",reprojectDeprecated:"Du anvender indstillingen 'reproject' p� laget ${layerName}.Denne indstilling b�r ikke l�ngere anvendes. Den var beregnet til at vise data ovenp� kommercielle grundkort, men den funktionalitet b�r nu opn�s ved at anvende Spherical Mercator underst�ttelsen. Mere information er tilg�ngelig her: http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Denne funktion b�r ikke l�ngere anvendes, og vil blive fjernet i version 3.0. Anvend venligst funktionen ${newMethod} istedet.",boundsAddError:"Du skal angive b�de x og y v�rdier i kaldet til add funktionen.",lonlatAddError:"Du skal angive b�de lon og lat v�rdier i kaldet til add funktionen.",pixelAddError:"Du skal angive b�de x og y v�rdier i kaldet til add funktionen.",unsupportedGeometryType:"Geometri typen: ${geomType} er ikke underst�ttet.",pagePositionFailed:"OpenLayers.Util.pagePosition fejlede: elementet med id ${elemId} er m�ske placeret forkert.",filterEvaluateNotImplemented:"evaluering er ikke implementeret for denne filter type."};OpenLayers.Lang.de=OpenLayers.Util.applyDefaults({unhandledRequest:"Unbehandelte Anfragerückmeldung ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Grundkarte",sameProjection:"Die Übersichtskarte funktioniert nur, wenn sie dieselbe Projektion wie die Hauptkarte verwendet",readNotImplemented:"Lesen nicht implementiert.",writeNotImplemented:"Schreiben nicht implementiert.",noFID:"Ein Feature, für das keine FID existiert, kann nicht aktualisiert werden.",errorLoadingGML:"Fehler beim Laden der GML-Datei ${url}",browserNotSupported:"Ihr Browser unterstützt keine Vektordarstellung. Aktuell unterstützte Renderer:\n${renderers}",componentShouldBe:"addFeatures : Komponente sollte vom Typ ${geomType} sein",commitSuccess:"WFS-Transaktion: ERFOLGREICH ${response}",commitFailed:"WFS-Transaktion: FEHLGESCHLAGEN ${response}",googleWarning:"Der Google-Layer konnte nicht korrekt geladen werden.<br><br>Um diese Meldung nicht mehr zu erhalten, wählen Sie einen anderen Hintergrundlayer aus dem LayerSwitcher in der rechten oberen Ecke.<br><br>Sehr wahrscheinlich tritt dieser Fehler auf, weil das Skript der Google-Maps-Bibliothek nicht eingebunden wurde oder keinen gültigen API-Schlüssel für Ihre URL enthält.<br><br>Entwickler: Für Hilfe zum korrekten Einbinden des Google-Layers <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>hier klicken</a>",getLayerWarning:"Der ${layerType}-Layer konnte nicht korrekt geladen werden.<br><br>Um diese Meldung nicht mehr zu erhalten, wählen Sie einen anderen Hintergrundlayer aus dem LayerSwitcher in der rechten oberen Ecke.<br><br>Sehr wahrscheinlich tritt dieser Fehler auf, weil das Skript der \"${layerLib}\"-Bibliothek nicht eingebunden wurde.<br><br>Entwickler: Für Hilfe zum korrekten Einbinden von Layern <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>hier klicken</a>",scale:"Maßstab = 1 : ${scaleDenom}",end:""},OpenLayers.Lang.en);OpenLayers.Lang["en-CA"]=OpenLayers.Util.applyDefaults({},OpenLayers.Lang.en);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:""};OpenLayers.Lang.fr={unhandledRequest:"Requête non gérée, retournant ${statusText}",permalink:"Permalien",overlays:"Calques",baseLayer:"Calque de base",sameProjection:"La carte de situation ne fonctionne que lorsque sa projection est la même que celle de la carte principale",readNotImplemented:"Lecture non implémentée.",writeNotImplemented:"Ecriture non implémentée.",noFID:"Impossible de mettre à jour un objet sans identifiant (fid).",errorLoadingGML:"Erreur au chargement du fichier GML ${url}",browserNotSupported:"Votre navigateur ne supporte pas le rendu vectoriel. Les renderers actuellement supportés sont : \n${renderers}",componentShouldBe:"addFeatures : le composant devrait être de type ${geomType}",getFeatureError:"getFeatureFromEvent a été appelé sur un calque sans renderer. Cela signifie généralement que vous avez détruit cette couche, mais que vous avez conservé un handler qui lui était associé.",minZoomLevelError:"La propriété minZoomLevel doit seulement être utilisée pour des couches FixedZoomLevels-descendent. Le fait que cette couche WFS vérifie la présence de minZoomLevel est une relique du passé. Nous ne pouvons toutefois la supprimer sans casser des applications qui pourraient en dépendre. C'est pourquoi nous la déprécions -- la vérification du minZoomLevel sera supprimée en version 3.0. A la place, merci d'utiliser les paramètres de résolutions min/max tel que décrit sur : http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"Transaction WFS : SUCCES ${response}",commitFailed:"Transaction WFS : ECHEC ${response}",googleWarning:"La couche Google n'a pas été en mesure de se charger correctement.<br><br>Pour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.<br><br>Cela est possiblement causé par la non-inclusion de la librairie Google Maps, ou alors parce que la clé de l'API ne correspond pas à votre site.<br><br>Développeurs : pour savoir comment corriger ceci, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>cliquez ici</a>",getLayerWarning:"La couche ${layerType} n'est pas en mesure de se charger correctement.<br><br>Pour supprimer ce message, choisissez une nouvelle BaseLayer dans le sélecteur de couche en haut à droite.<br><br>Cela est possiblement causé par la non-inclusion de la librairie ${layerLib}.<br><br>Développeurs : pour savoir comment corriger ceci, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>cliquez ici</a>",scale:"Echelle ~ 1 : ${scaleDenom}",layerAlreadyAdded:"Vous avez essayé d'ajouter à la carte le calque : ${layerName}, mais il est déjà présent",reprojectDeprecated:"Vous utilisez l'option 'reproject' sur la couche ${layerName}. Cette option est dépréciée : Son usage permettait d'afficher des données au dessus de couches raster commerciales.Cette fonctionalité est maintenant supportée en utilisant le support de la projection Mercator Sphérique. Plus d'information est disponible sur http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Cette méthode est dépréciée, et sera supprimée à la version 3.0. Merci d'utiliser ${newMethod} à la place.",boundsAddError:"Vous devez passer les deux valeurs x et y à la fonction add.",lonlatAddError:"Vous devez passer les deux valeurs lon et lat à la fonction add.",pixelAddError:"Vous devez passer les deux valeurs x et y à la fonction add.",unsupportedGeometryType:"Type de géométrie non supporté : ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition a échoué: l'élément d'id ${elemId} pourrait être mal positionné.",end:""};OpenLayers.Lang.hu=OpenLayers.Util.applyDefaults({unhandledRequest:"Nem kezelt kérés visszatérése ${statusText}",permalink:"Permalink",overlays:"Rávetítések",baseLayer:"Alapréteg",sameProjection:"Az áttekintő térkép csak abban az esetben működik, ha ugyanazon a vetületen van mint a fő térkép.",readNotImplemented:"Olvasás nincs végrehajtva.",writeNotImplemented:"Írás nincs végrehajtva.",noFID:"Nem frissíthető olyan jellemző, amely nem rendelkezik FID-del.",errorLoadingGML:"Hiba GML-fájl betöltésekor ${url}",browserNotSupported:"A böngészője nem támogatja a vektoros renderelést. A jelenleg támogatott renderelők:\n${renderers}",componentShouldBe:"addFeatures : az összetevőnek ilyen típusúnak kell lennie: ${geomType}",getFeatureError:"A getFeatureFromEvent réteget hívott meg renderelő nélkül. Ez rendszerint azt jelenti, hogy megsemmisített egy fóliát, de néhány ahhoz társított kezelőt nem.",minZoomLevelError:"A minZoomLevel tulajdonságot csak a következővel való használatra szánták: a FixedZoomLevels-leszármazott fóliák. Ez azt jelenti, hogy a minZoomLevel wfs fólia jelölőnégyzetei már a múlté. Mi azonban nem távolíthatjuk el annak a veszélye nélkül, hogy az esetlegesen ettől függő OL alapú alkalmazásokat tönkretennénk.Ezért ezt érvénytelenítjük -- a minZoomLevel az alul levő jelölőnégyzet a 3.0-s verzióból el lesz távolítva. Kérjük, helyette használja a  min/max felbontás beállítást, amelyről az alábbi helyen talál leírást: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS tranzakció: SIKERES ${response}",commitFailed:"WFS tranzakció: SIKERTELEN ${response}",googleWarning:"A Google fólia betöltése sikertelen.<br><br>Ahhoz, hogy ez az üzenet eltűnjön, válasszon egy új BaseLayer fóliát a jobb felső sarokban található fóliakapcsoló segítségével.<br><br>Nagy valószínűséggel ez azért van, mert a Google Maps könyvtár parancsfájlja nem található, vagy nem tartalmazza az Ön oldalához tartozó megfelelő API-kulcsot.<br><br>Fejlesztőknek: A helyes működtetésre vonatkozó segítség az alábbi helyen érhető el, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>kattintson ide</a>",getLayerWarning:"A ${layerType} fólia nem töltődött be helyesen.<br><br>Ahhoz, hogy ez az üzenet eltűnjön, válasszon egy új BaseLayer fóliát a jobb felső sarokban található fóliakapcsoló segítségével.<br><br>Nagy valószínűséggel ez azért van, mert a ${layerLib} könyvtár parancsfájlja helytelen.<br><br>Fejlesztőknek: A helyes működtetésre vonatkozó segítség az alábbi helyen érhető el, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>kattintson ide</a>",scale:"Lépték = 1 : ${scaleDenom}",layerAlreadyAdded:"Megpróbálta hozzáadni a ${layerName} fóliát a térképhez, de az már hozzá van adva",reprojectDeprecated:"Ön a 'reproject' beállítást használja a ${layerName} fólián. Ez a beállítás érvénytelen: használata az üzleti alaptérképek fölötti adatok megjelenítésének támogatására szolgált, de ezt a funkció ezentúl a Gömbi Mercator használatával érhető el. További információ az alábbi helyen érhető el: http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Ez a módszer érvénytelenítve lett és a 3.0-s verzióból el lesz távolítva. Használja a ${newMethod} módszert helyette.",boundsAddError:"Az x és y értékeknek egyaránt meg kell felelnie, hogy a funkciót hozzáadhassa.",lonlatAddError:"A hossz. és szél. értékeknek egyaránt meg kell felelnie, hogy a funkciót hozzáadhassa.",pixelAddError:"Az x és y értékeknek egyaránt meg kell felelnie, hogy a funkciót hozzáadhassa.",unsupportedGeometryType:"Nem támogatott geometriatípus: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition failed: lehetséges, hogy az ${elemId} azonosítójú elem téves helyre került.",filterEvaluateNotImplemented:"ennél a szűrőtípusnál kiértékelés nem hajtódik végre.",end:""},OpenLayers.Lang.en);OpenLayers.Lang.it={unhandledRequest:"Codice di ritorno della richiesta ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Livello base",sameProjection:"La mini mappa funziona solamente se ha la stessa proiezione della mappa principale",readNotImplemented:"Lettura non implementata.",writeNotImplemented:"Scrittura non implementata.",noFID:"Impossibile aggiornare un elemento grafico che non abbia il FID.",errorLoadingGML:"Errore nel caricamento del file GML ${url}",browserNotSupported:"Il tuo browser non supporta il rendering vettoriale. I renderizzatore attualemnte supportati sono:\n${renderers}",componentShouldBe:"addFeatures : il componente dovrebbe essere di tipo ${geomType}",getFeatureError:"getFeatureFromEvent chiamata su di un livello senza renderizzatore. Ciò significa che il livello è stato cancellato, ma non i gestori associati ad esso.",minZoomLevelError:"La proprietà minZoomLevel è da utilizzare solamente con livelli che abbiano FixedZoomLevels. Il fatto che questo livello wfs controlli la proprietà minZoomLevel è un retaggio del passato. Non possiamo comunque rimuoverla senza rompere le vecchie applicazioni che dipendono su di essa.Quindi siamo costretti a deprecarla -- minZoomLevel e sarà rimossa dalla vesione 3.0. Si prega di utilizzare i settaggi di risoluzione min/max come descritto qui: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"Transazione WFS: SUCCESS ${response}",commitFailed:"Transazione WFS: FAILED ${response}",googleWarning:"Il livello Google non è riuscito a caricare correttamente.<br><br>Per evitare questo messaggio, seleziona un nuovo BaseLayer nel selettore di livelli nell'angolo in alto a destra.<br><br>Più precisamente, ciò accade perchè la libreria Google Maps non è stata inclusa nella pagina, oppure non contiene la corretta API key per il tuo sito.<br><br>Sviluppatori: Per aiuto su come farlo funzionare correttamente, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>clicca qui</a>",getLayerWarning:"Il livello ${layerType} non è riuscito a caricare correttamente.<br><br>Per evitare questo messaggio, seleziona un nuovo BaseLayer nel selettore di livelli nell'angolo in alto a destra.<br><br>Più precisamente, ciò accade perchè la libreria ${layerLib} non è stata inclusa nella pagina.<br><br>Sviluppatori: Per aiuto su come farlo funzionare correttamente, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>clicca qui</a>",scale:"Scala = 1 : ${scaleDenom}",layerAlreadyAdded:"Stai cercando di aggiungere il livello: ${layerName} alla mappa, ma tale livello è già stato aggiunto.",reprojectDeprecated:"Stai utilizzando l'opzione 'reproject' sul livello ${layerName}. Questa opzione è deprecata: il suo utilizzo è stato introdotto persupportare il disegno dei dati sopra mappe commerciali, ma tale funzionalità dovrebbe essere ottenuta tramite l'utilizzo della proiezione Spherical Mercator. Per maggiori informazioni consultare qui http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Questo metodo è stato deprecato e sarà rimosso dalla versione 3.0. Si prega di utilizzare il metodo ${newMethod} in alternativa.",boundsAddError:"Devi specificare i valori di x e y alla funzione add.",lonlatAddError:"Devi specificare i valori di lon e lat alla funzione add.",pixelAddError:"Devi specificare i valori di x e y alla funzione add.",unsupportedGeometryType:"Tipo di geometria non supportata: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition fallita: l'elemento con id ${elemId} è posizionato in modo errato.",end:""};OpenLayers.Lang.ja=OpenLayers.Util.applyDefaults({unhandledRequest:"未処理の要求が ${statusText} を返しました",permalink:"Permalink",overlays:"オーバーレイ",baseLayer:"基準画層",sameProjection:"オーバービュー マップは、メイン マップと同じ投影内にある場合のみ機能します",readNotImplemented:"読み込みは実行されませんでした。",writeNotImplemented:"書き込みは実行されませんでした。",noFID:"FID が指定されていないフィーチャは更新できません。",errorLoadingGML:"GML ファイル ${url} のロードでエラーが発生しました",browserNotSupported:"ご使用のブラウザではベクトルのレンダリングがサポートされていません。現在サポートされているレンダラは次のとおりです:\n${renderers}",componentShouldBe:"addFeatures : コンポーネントは ${geomType} である必要があります",getFeatureError:"レンダラがない画層で getFeatureFromEvent が呼び出されました。通常これは、画層が壊れていて、それに関連付けられている一部のハンドラが壊れていないことを意味します。",minZoomLevelError:"minZoomLevel プロパティは、FixedZoomLevels の下位画層で使用することを意図したものです。wfs 画層が minZoomLevel をチェックすることはなくなりました。ただしこのプロパティを削除するには、これに依存する OL ベースのアプリケーションを削除する必要があります。このため、minZoomLevel 以下のチェックは、3.0 で廃止されます。代わりに最小/最大解像度設定を使用してください。次のサイトを参照してください:http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS トランザクション: 成功 ${response}",commitFailed:"WFS トランザクション: 失敗 ${response}",googleWarning:"Google 画層を正しくロードできませんでした。<br><br>このメッセージを非表示にするには、右上にある画層スイッチ内の新しい BaseLayer を選択します。<br><br>これは、Google Maps ライブラリ スクリプトが含まれていないか、サイトの正しい API キーが含まれていないことが原因であると考えられます。<br><br>開発者の方へ: この作業を正しく実行するための情報は、<a href='http://trac.openlayers.org/wiki/Google' target='_blank'>ここ</a>をクリックしてください",getLayerWarning:"${layerType} 画層を正しくロードできませんでした。<br><br>このメッセージを非表示にするには、右上にある画層スイッチ内の新しい BaseLayer を選択します。<br><br>これは、${layerLib} ライブラリ スクリプトが正しく含まれていないことが原因であると考えられます。<br><br>開発者の方へ: この作業を正しく実行するための情報は、<a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>ここ</a>をクリックしてください",scale:"尺度 = 1 : ${scaleDenom}",layerAlreadyAdded:"画層 ${layerName} をマップに追加しようとしましたが、この画層は既に追加されています",reprojectDeprecated:"'reproject' オプションを同じ ${layerName} 画層で使用しています。このオプションは推奨しません。このオプションは商用のベースマップにデータを表示することを意図したものですが、その場合は Spherical Mercator サポートを使用してください。詳細については、http://trac.openlayers.org/wiki/SphericalMercatorを参照してください。",methodDeprecated:"このメソッドは非推奨で、3.0 で廃止されます。 代わりに ${newMethod} を使用してください。",boundsAddError:"関数を追加するには、x と y の両方の値を渡す必要があります。",lonlatAddError:"関数を追加するには、lon と lat の両方の値を渡す必要があります。",pixelAddError:"関数を追加するには、x と y の両方の値を渡す必要があります。",unsupportedGeometryType:"サポートされていないジオメトリ タイプ: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition が失敗しました: ID ${elemId} を持つエレメントは誤った場所に配置されている可能性があります。",filterEvaluateNotImplemented:"このフィルタの種類では評価が実装されていません。",end:""},OpenLayers.Lang.en);OpenLayers.Lang.nb={unhandledRequest:"Ubehandlet foresp�rsel returnerte ${statusText}",permalink:"Kobling til denne siden",overlays:"Kartlag",baseLayer:"Bakgrunnskart",sameProjection:"Oversiktskartet fungerer bare n�r det har samme projeksjon som hovedkartet",readNotImplemented:"Lesing er ikke implementert.",writeNotImplemented:"Skriving er ikke implementert.",noFID:"Kan ikke oppdatere feature (objekt) som ikke har FID.",errorLoadingGML:"Feil under lasting av GML-fil ${url}",browserNotSupported:"Din nettleser st�tter ikke vektortegning. F�lgende tegnemetoder st�ttes:\n${renderers}",componentShouldBe:"addFeatures : komponenten m� v�re en ${geomType}",getFeatureError:"getFeatureFromEvent kj�rt mot lag uten tegnemetode. Dette betyr som regel at du fjernet et lag uten � fjerne alle handlere tilknyttet laget.",minZoomLevelError:"Egenskapen minZoomLevel er kun tenkt for bruk p� lag basert p� FixedZoomLevels. At dette wfs-laget sjekker minZoomLevel er en fortidslevning. Det kan dog ikke tas bort uten � risikere at OL-baserte applikasjoner slutter � virke, s� det er merket som foreldet: minZoomLevel i sjekken nedenfor vil fjernes i 3.0. Vennligst bruk innstillingene for min/maks oppl�sning som er beskrevet her: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS-transaksjon: SUKSESS ${response}",commitFailed:"WFS-transaksjon: FEILET ${response}",googleWarning:"Google-laget kunne ikke lastes.<br><br>Bytt til et annet bakgrunnslag i lagvelgeren i �vre h�yre hj�rne for � slippe denne meldingen.<br><br>Sannsynligvis for�rsakes feilen av at Google Maps-biblioteket ikke er riktig inkludert p� nettsiden, eller at det ikke er angitt riktig API-n�kkel for nettstedet.<br><br>Utviklere: For hjelp til � f� dette til � virke se <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>her</a>.",getLayerWarning:"${layerType}-laget kunne ikke lastes.<br><br>Bytt til et annet bakgrunnslag i lagvelgeren i �vre h�yre hj�rne for � slippe denne meldingen.<br><br>Sannsynligvis for�rsakes feilen av at ${layerLib}-biblioteket ikke var riktig inkludert p� nettsiden.<br><br>Utviklere: For hjelp til � f� dette til � virke se <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>her</a>.",scale:"<strong>Skala</strong> 1 : ${scaleDenom}",layerAlreadyAdded:"Du fors�kte � legge til laget ${layerName} p� kartet, men det er allerede lagt til",reprojectDeprecated:"Du bruker innstillingen 'reproject' p� laget ${layerName}. Denne innstillingen er foreldet, den var ment for � st�tte visning av kartdata over kommersielle bakgrunnskart, men det b�r n� gj�res med st�tten for Spherical Mercator. Mer informasjon finnes p� http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Denne metoden er markert som foreldet og vil bli fjernet i 3.0. Bruk ${newMethod} i stedet.",boundsAddError:"Du m� gi b�de x- og y-verdier til funksjonen add.",lonlatAddError:"Du m� gi b�de lon- og lat-verdier til funksjonen add.",pixelAddError:"Du m� gi b�de x- og y-verdier til funksjonen add.",unsupportedGeometryType:"Ust�ttet geometritype: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition feilet: elementet med id ${elemId} kan v�re feilplassert.",end:""};OpenLayers.Lang.nl=OpenLayers.Util.applyDefaults({unhandledRequest:"Niet afgehandeld request met als terugmelding ${statusText}",permalink:"Permalink",overlays:"Overlays",baseLayer:"Achtergrondkaart",sameProjection:"De overzichtskaart werkt alleen als de projectie gelijk is aan de projectie van de hoofdkaart",readNotImplemented:"Lezen niet geïmplementeerd.",writeNotImplemented:"Schrijven niet geïmplementeerd.",noFID:"Een feature welke geen FID heeft kan niet bijgewerkt worden.",errorLoadingGML:"Fout bij het laden van GML bestand ${url}",browserNotSupported:"Uw browser ondersteunt het weergeven van vector niet. Momenteel ondersteunde weergave engines:\n${renderers}",componentShouldBe:"addFeatures : component zou van het type ${geomType} moeten zijn",commitSuccess:"WFS-transactie: SUCCESVOL ${response}",commitFailed:"WFS-transactie: MISLUKT ${response}",googleWarning:"De Google-Layer kon niet correct geladen worden.<br><br>Om deze melding niet meer te krijgen, moet u een andere achtergrondkaart kiezen in de LayerSwitcher in de rechterbovenhoek.<br><br>Dit is waarschijnlijk omdat de ${layerLib} bilbiotheek niet correct ingevoegd is.<br><br>Ontwikkelaars: om dit werkend te krijgen, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>klik hier</a>",getLayerWarning:"De ${layerType} Layer kon niet goed geladen worden.<br><br>Om deze melding niet meer te krijgen, moet u een andere achtergrondkaart kiezen in de LayerSwitcher in de rechterbovenhoek.<br><br>Dit is waarschijnlijk omdat de ${layerLib} bilbiotheek niet correct ingevoegd is.<br><br>Ontwikkelaars: om dit werkend te krijgen, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>klik hier</a>",scale:"Schaal = 1 : ${scaleDenom}",end:""},OpenLayers.Lang.en);OpenLayers.Lang["pt-BR"]={unhandledRequest:"A requisição retornou um erro não tratado: ${statusText}",permalink:"Link para essa página",overlays:"Camadas de Sobreposição",baseLayer:"Camada Base",sameProjection:"O mapa de referência só funciona quando ele está na mesma projeção do mapa principal",readNotImplemented:"Leitura não implementada.",writeNotImplemented:"Escrita não implementada.",noFID:"Não é possível atualizar uma feição que não tenha um FID.",errorLoadingGML:"Erro ao carregar o arquivo GML ${url}",browserNotSupported:"Seu navegador não suporta renderização de vetores. Os renderizadores suportados atualmente são:\n${renderers}",componentShouldBe:"addFeatures: o componente deve ser do tipo ${geomType}",getFeatureError:"getFeatureFromEvent foi executado mas nenhum renderizador foi encontrado. Isso pode indicar que você destruiu uma camana, mas não o handler associado a ela.",minZoomLevelError:"A propriedade minZoomLevel é de uso restrito das camadas descendentes de FixedZoomLevels. A verificação dessa propriedade pelas camadas wfs é um resíduo do passado. Não podemos, entretanto não é possível removê-la sem possívelmente quebrar o funcionamento de aplicações OL que possuem depência com ela. Portanto estamos tornando seu uso obsoleto -- a verificação desse atributo será removida na versão 3.0. Ao invés, use as opções de resolução min/max como descrito em: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"Transação WFS : SUCESSO ${response}",commitFailed:"Transação WFS : ERRO ${response}",googleWarning:"Não foi possível carregar a camada Google corretamente.<br><br>Para se livrar dessa mensagem, selecione uma nova Camada Base, na ferramenta de alternação de camadas localização do canto superior direito.<br><br>Muito provavelmente, isso foi causado porque o script da biblioteca do Google Maps não foi incluído, ou porque ele não contém a chave correta da API para o seu site.<br><br>Desenvolvedores: Para obter ajuda em solucionar esse problema <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>cliquem aqui</a>",getLayerWarning:"Não foi possível carregar a camada ${layerType} corretamente.<br><br>Para se livrar dessa mensagem, selecione uma nova Camada Base, na ferramenta de alternação de camadas localização do canto superior direito.<br><br>Muito provavelmente, isso foi causado porque o script da biblioteca ${layerLib} não foi incluído corretamente.<br><br>Desenvolvedores: Para obter ajuda em solucionar esse problema <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>cliquem aqui</a>",scale:"Escala = 1 : ${scaleDenom}",layerAlreadyAdded:"Você tentou adicionar a camada: ${layerName} ao mapa, mas ela já foi adicionada",reprojectDeprecated:"Você está usando a opção 'reproject' na camada ${layerName}. Essa opção está obsoleta: seu uso foi projetado para suportar a visualização de dados sobre bases de mapas comerciais, entretanto essa funcionalidade deve agora ser alcançada usando o suporte à projeção Mercator. Mais informação está disponível em: http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Esse método está obsoleto e será removido na versão 3.0. Ao invés, por favor use ${newMethod}.",boundsAddError:"Você deve informar ambos os valores x e y para a função add.",lonlatAddError:"Você deve informar ambos os valores lon e lat para a função add.",pixelAddError:"Você deve informar ambos os valores x e y para a função add.",unsupportedGeometryType:"Tipo geométrico não suportado: ${geomType}.",pagePositionFailed:"OpenLayers.Util.pagePosition falhou: o elemento de id ${elemId} deve estar fora do lugar.",end:""};OpenLayers.Lang["sv-SE"]={unhandledRequest:"Ej hanterad fr�ga retur ${statusText}",permalink:"Permal�nk",overlays:"Kartlager",baseLayer:"Bakgrundskarta",sameProjection:"�versiktskartan fungerar endast n�r den har samma projektion som huvudkartan",readNotImplemented:"L�sning ej implementerad.",writeNotImplemented:"Skrivning ej implementerad.",noFID:"Kan ej uppdatera feature (objekt) f�r vilket FID saknas.",errorLoadingGML:"Fel i laddning av GML-fil ${url}",browserNotSupported:"Din webbl�sare st�der inte vektorvisning. F�r n�rvarande st�ds f�ljande visning:\n${renderers}",componentShouldBe:"addFeatures : komponenten skall vara en ${geomType}",getFeatureError:"getFeatureFromEvent anropad f�r lager utan utritning. Detta betyder oftast att man raderat ett lager, men inte en hanterare som �r knuten till lagret.",minZoomLevelError:"Egenskapen minZoomLevel �r endast avsedd att anv�ndas med lager med FixedZoomLevels. Att detta WFS-lager kontrollerar minZoomLevel �r en relik fr�n �ldre versioner. Vi kan dock inte ta bort det utan att riskera att OL-baserade till�mpningar som anv�nder detta slutar fungera. D�rf�r �r det satt som deprecated, minZoomLevel kommer att tas bort i version 3.0. Anv�nd i st�llet inst�llning av min/max resolution som beskrivs h�r: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS-transaktion: LYCKADES ${response}",commitFailed:"WFS-transaktion: MISSLYCKADES ${response}",googleWarning:"Google-lagret kunde inte laddas korrekt.<br><br>F�r att slippa detta meddelande, v�lj en annan bakgrundskarta i lagerv�ljaren i �vre h�gra h�rnet.<br><br>Sannolikt beror felet p� att Google Maps-biblioteket inte �r inkluderat p� webbsidan eller p� att sidan inte anger korrekt API-nyckel f�r webbplatsen.<br><br>Utvecklare: hj�lp f�r att �tg�rda detta, <a href='http://trac.openlayers.org/wiki/Google' target='_blank'>klicka h�r</a>.",getLayerWarning:"${layerType}-lagret kunde inte laddas korrekt.<br><br>F�r att slippa detta meddelande, v�lj en annan bakgrundskarta i lagerv�ljaren i �vre h�gra h�rnet.<br><br>Sannolikt beror felet p� att ${layerLib}-biblioteket inte �r inkluderat p� webbsidan.<br><br>Utvecklare: hj�lp f�r att �tg�rda detta, <a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>klicka h�r</a>.",scale:"<strong>Skala</strong> 1 : ${scaleDenom}",layerAlreadyAdded:"Du f�rs�kte l�gga till lagret: ${layerName} p� kartan, men det har lagts till tidigare",reprojectDeprecated:"Du anv�nder inst�llningen 'reproject' p� lagret ${layerName}. Denna inst�llning markerad som deprecated: den var avsedd att anv�ndas f�r att st�dja visning av kartdata p� kommersiella bakgrundskartor, men nu b�r man i st�llet anv�nda Spherical Mercator-st�d f�r den funktionaliteten. Mer information finns p� http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"Denna metod �r markerad som deprecated och kommer att tas bort i 3.0. Anv�nd ${newMethod} i st�llet.",boundsAddError:"Du m�ste skicka b�de x- och y-v�rde till funktionen add.",lonlatAddError:"Du m�ste skicka b�de lon- och lat-v�rde till funktionen add.",pixelAddError:"Du m�ste skicka b�de x- och y-v�rde till funktionen add.",unsupportedGeometryType:"St�d saknas f�r geometritypen: ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition misslyckades: elementet med id ${elemId} kan placeras fel.",end:""};OpenLayers.Lang["zh-CN"]={unhandledRequest:"未处理的请求，返回值为 ${statusText}",permalink:"永久链接",overlays:"叠加层",baseLayer:"基础图层",sameProjection:"鹰眼地图只有在和主地图使用相同的投影的时候才能正常共工作",readNotImplemented:"读取功能没有实现。",writeNotImplemented:"写入功能没有实现。",noFID:"无法更新feature，缺少FID。",errorLoadingGML:"加载GML文件 ${url} 出现错误。",browserNotSupported:"你使用的浏览器不支持矢量渲染。当前支持的渲染方式包括：\n${renderers}",componentShouldBe:"addFeatures : 组件类型应该是 ${geomType}",getFeatureError:"getFeatureFromEvent方法在一个没有渲染器的图层上被调用。 这通常意味着您销毁了一个图层，但并未销毁其关联的handler。",minZoomLevelError:"minZoomLevel属性仅适合用于使用了固定缩放级别的图层。这个 wfs 图层检查 minZoomLevel 是过去遗留下来的。然而，我们不能移除它，而破坏依赖于它的基于OL的应用程序。因此，我们废除了它 -- minZoomLevel 将会在3.0中被移除。请改用 min/max resolution 设置，参考：http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: 成功。 ${response}",commitFailed:"WFS Transaction: 失败。 ${response}",googleWarning:"Google图层不能正确加载。<br><br>要消除这个信息，请在右上角的图层控制面板中选择其他的基础图层。<br><br>这种情况很可能是没有正确的包含Google地图脚本库，或者是没有包含在你的站点上使用的正确的Google Maps API密匙。<br><br>开发者：获取使其正确工作的帮助信息，<a href='http://trac.openlayers.org/wiki/Google' target='_blank'>点击这里</a>",getLayerWarning:"${layerType} 图层不能正确加载。<br><br>要消除这个信息，请在右上角的图层控制面板中选择其他的基础图层。<br><br>这种情况很可能是没有正确的包含${layerLib} 脚本库。<br><br>开发者：获取使其正确工作的帮助信息，<a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>点击这里</a>",scale:"比例尺 = 1 : ${scaleDenom}",layerAlreadyAdded:"你尝试添加图层： ${layerName} 到地图中，但是它之前就已经被添加。",reprojectDeprecated:"你正在使用 ${layerName} 图层上的'reproject'选项。这个选项已经不再使用：它是被设计用来支持显示商业的地图数据，不过现在该功能可以通过使用Spherical Mercator来实现。更多信息可以参阅http://trac.openlayers.org/wiki/SphericalMercator.",methodDeprecated:"该方法已经不再被支持，并且将在3.0中被移除。请使用 ${newMethod} 方法来替代。",boundsAddError:"您必须传递 x 和 y 两个参数值到 add 方法。",lonlatAddError:"您必须传递 lon 和 lat 两个参数值到 add 方法。",pixelAddError:"您必须传递 x and y 两个参数值到 add 方法。",unsupportedGeometryType:"不支持的几何体类型： ${geomType}",pagePositionFailed:"OpenLayers.Util.pagePosition 失败：id 为 ${elemId} 的元素可能被错置。",end:""};OpenLayers.Lang["zh-TW"]={unhandledRequest:"未處理的請求，傳回值為 ${statusText}。",permalink:"永久連結",overlays:"額外圖層",baseLayer:"基礎圖層",sameProjection:"地圖縮覽(OverviewMap)只能在跟主地圖相同投影時起作用。",readNotImplemented:"沒有實作讀取的功能。",writeNotImplemented:"沒有實作寫入的功能。",noFID:"因為沒有 FID 所以無法更新 feature。",errorLoadingGML:"讀取GML檔案 ${url} 錯誤。",browserNotSupported:"您的瀏覽器未支援向量渲染. 目前支援的渲染方式是:\n${renderers}",componentShouldBe:"addFeatures : 元件應該為 ${geomType}",getFeatureError:"getFeatureFromEvent 在一個沒有被渲染的圖層裡被呼叫。這通常意味著您 摧毀了一個圖層，但並未摧毀相關的handler。",minZoomLevelError:"minZoomLevel 屬性僅適合用在 FixedZoomLevels-descendent 類型的圖層. 這個wfs layer 的 minZoomLevel 是過去所遺留下來的，然而我們不能移除它而不讓它將過去的程式相容性給破壞掉。因此我們將會迴避使用它 -- minZoomLevel 會在3.0被移除，請改用在這邊描述的 min/max resolution 設定: http://trac.openlayers.org/wiki/SettingZoomLevels",commitSuccess:"WFS Transaction: 成功 ${response}",commitFailed:"WFS Transaction: 失敗 ${response}",googleWarning:"The Google Layer 圖層無法被正確的載入。<br><br>要迴避這個訊息, 請在右上角的圖層改變器裡，選一個新的基礎圖層。<br><br>很有可能是因為 Google Maps 的函式庫腳本沒有被正確的置入，或沒有包含 您網站上正確的 API key <br><br>開發者: 要幫助這個行為正確完成，<a href='http://trac.openlayers.org/wiki/Google' target='_blank'>請按這裡</a>",getLayerWarning:"${layerType} 圖層無法被正確的載入。<br><br>要迴避這個訊息, 請在右上角的圖層改變器裡，選一個新的基礎圖層。<br><br>很有可能是因為 ${layerLib} 的函式庫腳本沒有被正確的置入。<br><br>開發者: 要幫助這個行為正確完成，<a href='http://trac.openlayers.org/wiki/${layerLib}' target='_blank'>請按這裡</a>",scale:"Scale = 1 : ${scaleDenom}",layerAlreadyAdded:"你試著新增圖層: ${layerName} 到地圖上，但圖層之前就已經被新增了。",reprojectDeprecated:"你正使用 'reproject' 這個選項 在 ${layerName} 層。這個選項已經不再使用:它的使用原本是設計用來支援在商業地圖上秀出資料，但這個功能已經被Spherical Mercator所取代。更多的資訊可以在 http://trac.openlayers.org/wiki/SphericalMercator 找到。",methodDeprecated:"這個方法已經不再使用且在3.0將會被移除，請使用 ${newMethod} 來代替。",boundsAddError:"您必須傳入 x 跟 y 兩者的值進 add 函數。",lonlatAddError:"您必須傳入 lon 跟 lat 兩者的值進 add 函數。",pixelAddError:"您必須傳入 x 跟 y 兩者的值進 add 函數。",unsupportedGeometryType:"未支援的幾何型別: ${geomType}。",pagePositionFailed:"OpenLayers.Util.pagePosition 失敗: id ${elemId} 的 element 可能被錯置。",end:""};Fusion.configuration={general:{scriptLanguage:"php",temporaryDirectory:"c:/mapaverdecache"},mapguide:{webTierUrl:"",useAsyncOverlay:true,tileCacheUrl:"c:/mapaverdecache"},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.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",oLayerOL2:false,initialize:function(F,D,C){Fusion.Layers.prototype.initialize.apply(this,arguments);var G=Fusion.getQueryParam("theme");if(G!=""){this.sMapResourceId=G;Fusion.queryParams.theme=null}this.registerEventID(Fusion.Event.MAP_SESSION_CREATED);this.mapInfo=D.mapInfo;this.imageFormat=D.extension.ImageFormat?D.extension.ImageFormat[0]:this.defaultFormat;this.selectionType=D.extension.SelectionType?D.extension.SelectionType[0]:"INTERSECTS";this.selectionColor=D.extension.SelectionColor?D.extension.SelectionColor[0]:"";this.selectionFormat=D.extension.SelectionFormat?D.extension.SelectionFormat[0]:"PNG";if(D.extension.SelectionAsOverlay&&D.extension.SelectionAsOverlay[0]=="false"){this.selectionAsOverlay=false}if(!this.bIsMapWidgetLayer){this.selectionAsOverlay=false}if(this.bIsMapWidgetLayer){var E=true;if(D.extension.DisableCtrlClick&&D.extension.DisableCtrlClick[0]=="true"){E=false}if(E){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(D.extension.KeepAliveInterval?D.extension.KeepAliveInterval[0]:300);this.noCache=true;var B=Fusion.sessionId;if(B){this.session[0]=B;this.mapSessionCreated()}else{this.createSession()}},createSession:function(){if(!this.session[0]){this.session[0]=this;var B=Fusion.getScriptLanguage();var D="layers/"+this.arch+"/"+B+"/CreateSession."+B;var C={onSuccess:OpenLayers.Function.bind(this.createSessionCB,this)};Fusion.ajaxRequest(D,C)}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 B={};if(this.bIsMapWidgetLayer){var D=Fusion.getQueryParam("showlayers");Fusion.queryParams.showlayers=null;var C=Fusion.getQueryParam("hidelayers");Fusion.queryParams.hidelayers=null;var F=Fusion.getQueryParam("showgroups");Fusion.queryParams.showgroups=null;var E=Fusion.getQueryParam("hidegroups");Fusion.queryParams.hidegroups=null;var B={showlayers:D==""?[]:D.split(","),hidelayers:C==""?[]:C.split(","),showgroups:F==""?[]:F.split(","),hidegroups:E==""?[]:E.split(",")}}this.loadMap(this.sMapResourceId,B)}this.keepAliveTimer=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(G,D){this.bMapLoaded=false;if(!this.sessionReady()){this.sMapResourceId=G;return }this.triggerEvent(Fusion.Event.LAYER_LOADING);this.mapWidget._addWorker();this._fScale=-1;this._nDpi=96;D=D||{};this.aShowLayers=D.showlayers||[];this.aHideLayers=D.hidelayers||[];this.aShowGroups=D.showgroups||[];this.aHideGroups=D.hidegroups||[];this.aRefreshLayers=D.refreshlayers||[];this.aLayers=[];this.oSelection=null;this.aSelectionCallbacks=[];this._bSelectionIsLoading=false;var B=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+B+"/LoadMap."+B;var E=this.getSessionID();var F={mapid:G,session:E};var D={onSuccess:OpenLayers.Function.bind(this.mapLoaded,this),parameters:F};Fusion.ajaxRequest(C,D)},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(o.hasBaseMapLayers&&this.bIsMapWidgetLayer){this.bSingleTile=false}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}}var wktProj;if(o.wkt&&o.wkt.length>0){wktProj=new OpenLayers.Projection(o.wkt)}else{if(o.epsg!=0){this.mapTag.layerOptions.projection="EPSG:"+o.epsg}else{o.wkt='LOCAL_CS["Non-Earth (Meter)",LOCAL_DATUM["Local Datum",0],UNIT["Meter", 1],AXIS["X",EAST],AXIS["Y",NORTH]]';wktProj=new OpenLayers.Projection(o.wkt)}}this.mapTag.layerOptions.units=Fusion.getClosestUnits(o.metersPerUnit);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);if(wktProj){this.oLayerOL.projection=wktProj}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();var F=$A(this.aLayers);this.aLayers=[];var B=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+B+"/LoadMap."+B;var E=this.getSessionID();var G={mapname:this._sMapname,session:E};var D={onSuccess:OpenLayers.Function.bind(this.mapReloaded,this,F),onException:OpenLayers.Function.bind(this.reloadFailed,this),parameters:G};Fusion.ajaxRequest(C,D)},reloadFailed:function(B){Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,OpenLayers.i18n("mapLoadError",{error:B.transport.responseText})));this.mapWidget._removeWorker()},loadScaleRanges:function(G){var B=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+B+"/LoadScaleRanges."+B;var E=this.getSessionID();var F={mapname:this._sMapname,session:E};var D={onSuccess:OpenLayers.Function.bind(this.scaleRangesLoaded,this,G),parameters:F};Fusion.ajaxRequest(C,D)},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(oldLayers,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<oldLayers.length;++j){if(oldLayers[j].uniqueId==newLayer.uniqueId){newLayer.selectedFeatureCount=oldLayers[j].selectedFeatureCount;newLayer.noCache=oldLayers[j].noCache;break}}}this.mapWidget.triggerEvent(Fusion.Event.MAP_RELOADED);this.drawMap()}this.mapWidget._removeWorker()},reorderLayers:function(E){var B=Fusion.getScriptLanguage();var C="layers/"+this.arch+"/"+B+"/SetLayers."+B;var F={mapname:this._sMapname,session:this.getSessionID(),layerindex:E.join()};var D={onSuccess:OpenLayers.Function.bind(this.mapLayersReset,this,E),parameters:F};Fusion.ajaxRequest(C,D)},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(F){for(var C=0;C<F.groups.length;C++){var E=new Fusion.Layers.Group(F.groups[C],this);var D;if(E.parentUniqueId!=""){D=this.layerRoot.findGroupByAttribute("uniqueId",E.parentUniqueId)}else{D=this.layerRoot}D.addGroup(E,this.bLayersReversed)}for(var C=0;C<F.layers.length;C++){var B=new Fusion.Layers.Layer(F.layers[C],this);var D;if(B.parentGroup!=""){D=this.layerRoot.findGroupByAttribute("uniqueId",B.parentGroup)}else{D=this.layerRoot}D.addLayer(B,this.bLayersReversed);this.aLayers.push(B)}},drawMap:function(){if(!this.bMapLoaded){return }var B={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(B)}else{this.oLayerOL.mergeNewParams(B)}},drawSelection:function(){if(this.queryLayer){this.queryLayer.redraw(true)}else{this.drawMap()}},createOLLayer:function(D,H,F,G){this.useAsyncOverlay=Fusion.getConfigurationItem("mapguide","useAsyncOverlay");if(!this.useAsyncOverlay){this.selectionAsOverlay=false}var E={maxResolution:"auto",useOverlay:this.selectionAsOverlay,useAsyncOverlay:this.useAsyncOverlay,ratio:this.ratio};if((F&1)==0&&!/WebKit/.test(navigator.userAgent)){E.transitionEffect="resize"}if(this.scales&&this.scales.length>0){E.scales=this.scales}if(this.maxScale!=Infinity){E.minScale=this.maxScale}else{if(this.mapWidget.minScale){E.minScale=this.mapWidget.maxScale}}if(!this.mapWidget.oMapOL.scales&&!this.scales){E.maxScale=this.minScale}E.singleTile=H;OpenLayers.Util.extend(E,this.mapTag.layerOptions);var I={};if(H){I={session:this.getSessionID(),mapname:this._sMapname,format:this.imageFormat,behavior:F,clientagent:this.clientAgent};I.showLayers=this.aShowLayers.length>0?this.aShowLayers.toString():null;I.hideLayers=this.aHideLayers.length>0?this.aHideLayers.toString():null;I.showGroups=this.aShowGroups.length>0?this.aShowGroups.toString():null;I.hideGroups=this.aHideGroups.length>0?this.aHideGroups.toString():null;I.refreshLayers=this.aRefreshLayers.length>0?this.aRefreshLayers.toString():null;if(F==5){I.selectioncolor=this.selectionColor;I.format=this.selectionFormat}if(G){E.isBaseLayer=false}}else{I={mapdefinition:this._sResourceId,basemaplayergroupname:this.groupName,session:this.getSessionID(),clientagent:this.clientAgent}}if(I.format&&I.format.toLowerCase().indexOf("png")>=0){E.alpha=true}var C;if(!H&&E.useHttpTile){C=Fusion.getConfigurationItem("mapguide","tileCacheUrl")}else{C=Fusion.getConfigurationItem("mapguide","mapAgentUrl")}var B=new OpenLayers.Layer.MapGuide(D,C,I,E);return B},getLayerByName:function(C){var B=null;for(var D=0;D<this.aLayers.length;D++){if(this.aLayers[D].layerName==C){B=this.aLayers[D];break}}return B},getLayerById:function(D){var B=null;for(var C=0;C<this.aLayers.length;C++){if(this.aLayers[C].uniqueId==D){B=this.aLayers[C];break}}return B},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 C=0;for(var B=0;B<this.aLayers.length;++B){C+=this.aLayers[B].selectedFeatureCount}return C},getSelectedLayers:function(){var C=[];for(var B=0;B<this.aLayers.length;++B){if(this.aLayers[B].selectedFeatureCount>0){C.push(this.aLayers[B])}}return C},getSelectableLayers:function(){var C=[];for(var B=0;B<this.aLayers.length;++B){if(this.aLayers[B].selectable){C.push(this.aLayers[B])}}return C},setSelection:function(C,B){if(C!=""&&C!=null){this.updateSelection(C,B,false)}else{this.clearSelection()}},updateSelection:function(D,C,B){this.updateMapSelection(D,C);this.getSelectedFeatureProperties(D)},getSelectedFeatureProperties:function(F){this.mapWidget._addWorker();var B=Fusion.getScriptLanguage();var D="layers/"+this.arch+"/"+B+"/GetSelectionProperties."+B;var E={mapname:this.getMapName(),session:this.getSessionID(),selection:F,seq:Math.random()};var C={onSuccess:OpenLayers.Function.bind(this.processSelectedFeatureProperties,this),parameters:E};Fusion.ajaxRequest(D,C)},updateMapSelection:function(G,F){this.mapWidget._addWorker();var B=Fusion.getScriptLanguage();var D="layers/"+this.arch+"/"+B+"/SaveSelection."+B;var E={mapname:this.getMapName(),session:this.getSessionID(),selection:G,seq:Math.random(),getextents:F?"true":"false"};var C={onSuccess:OpenLayers.Function.bind(this.renderSelection,this,F),parameters:E};Fusion.ajaxRequest(D,C)},getSelection:function(F,E,D){if(F){var C="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/Selection."+Fusion.getScriptLanguage();var B={parameters:{session:this.getSessionID(),mapname:this._sMapname,layers:E,startcount:D},onSuccess:OpenLayers.Function.bind(this.getSelectionCB,this,F)};Fusion.ajaxRequest(C,B)}},selectionCleared:function(){for(var B=0;B<this.aLayers.length;++B){this.aLayers[B].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 C="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/ClearSelection."+Fusion.getScriptLanguage();var B={parameters:{session:this.getSessionID(),mapname:this._sMapname},onSuccess:OpenLayers.Function.bind(this.selectionCleared,this)};Fusion.ajaxRequest(C,B)}if(this.previousSelection!=null){this.previousSelection.clear()}},removeQueryLayer:function(){if(this.queryLayer){this.queryLayer.destroy();this.queryLayer=null}},processQueryResults:function(C,B){this.renderSelection(C,B);this.processSelectedFeatureProperties(B)},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(D){this.mapWidget._addWorker();for(var C=0;C<this.aLayers.length;++C){this.aLayers[C].selectedFeatureCount=0}var F=1;var G=3;var B=D.maxFeatures;if(B==null||B==0){B=-1}var E=new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),this._sMapname,D.geometry,B,F,D.selectionType||this.selectionType,D.layers,G);var H=(D.extendSelection==true)?OpenLayers.Function.bind(this.processAndMergeFeatureInfo,this):OpenLayers.Function.bind(this.processFeatureInfo,this);Fusion.oBroker.dispatchRequest(E,OpenLayers.Function.bind(Fusion.xml2json,this,H))},showLayer:function(B,C){this.processLayerEvents(B,true);this.aShowLayers.push(B.uniqueId);if(!C){this.drawMap()}},hideLayer:function(B,C){this.processLayerEvents(B,false);this.aHideLayers.push(B.uniqueId);if(!C){this.drawMap()}},showGroup:function(C,B){this.processGroupEvents(C,true);if(C.groupName=="layerRoot"){this.oLayerOL.setVisibility(true);if(this.oLayerOL2){this.oLayerOL2.setVisibility(true)}}else{if(C.isBaseMapGroup){this.oLayerOL.setVisibility(true)}else{this.aShowGroups.push(C.uniqueId);if(!B){this.drawMap()}}}},hideGroup:function(C,B){this.processGroupEvents(C,false);if(C.groupName=="layerRoot"){this.oLayerOL.setVisibility(false);if(this.oLayerOL2){this.oLayerOL2.setVisibility(false)}}else{if(C.isBaseMapGroup){this.oLayerOL.setVisibility(false)}else{this.aHideGroups.push(C.uniqueId);if(!B){this.drawMap()}}}},refreshLayer:function(B){this.aRefreshLayers.push(B.uniqueId);this.drawMap()},mouseUpCRTLClick:function(L){if(L.ctrlKey){var E=this.mapWidget.pixToGeo(L.xy.x-this.nTolerance,L.xy.y-this.nTolerance);var J=this.mapWidget.pixToGeo(L.xy.x+this.nTolerance,L.xy.y+this.nTolerance);if(!E){return }var G="POLYGON(("+E.x+" "+E.y+", "+E.x+" "+J.y+", "+J.x+" "+J.y+", "+J.x+" "+E.y+", "+E.x+" "+E.y+"))";var C=1;var H=0;var K="INTERSECTS";var I="";var D=3;var N="";for(var F=0;F<this.aLayers.length;++F){I+=N+this.aLayers[F].layerName;N=","}var B=new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.mapWidget.getSessionID(),this._sMapname,G,C,H,K,I,D);var M=OpenLayers.Function.bind(this.crtlClickDisplay,this);Fusion.oBroker.dispatchRequest(B,OpenLayers.Function.bind(Fusion.xml2json,this,M))}},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 B=this.mapWidget.oMapOL.getCenter();var D=this.mapWidget.oMapOL.getSize();var C=new Fusion.Lib.MGRequest.MGGetVisibleMapExtent(this.mapWidget.getSessionID(),this._sMapname,B.lon,B.lat,this.mapWidget.oMapOL.getScale(),null,this._nDpi,D.w,D.h);Fusion.oBroker.dispatchRequest(C)}},pingServer:function(){var B="layers/"+this.arch+"/"+Fusion.getScriptLanguage()+"/Common."+Fusion.getScriptLanguage();var C={onSuccess:OpenLayers.Function.bind(this.checkPingResponse,this)};C.parameters={session:this.getSessionID()};Fusion.ajaxRequest(B,C)},checkPingResponse:function(xhr){if(xhr.responseText){var o;eval("o="+xhr.responseText);if(!o.success){Fusion.reportError(o.message);clearInterval(this.keepAliveTimer)}}},getLinkParams:function(){var F={};F.theme=this.sMapResourceId;var E=[];var D=[];for(var C=0;C<this.aLayers.length;++C){var B=this.aLayers[C];if(B.visible&&!B.initiallyVisible){E.push(B.layerName)}if(!B.visible&&B.initiallyVisible){D.push(B.layerName)}}F.showlayers=E.join(",");F.hidelayers=D.join(",");var I=[];var G=[];for(var C=0;C<this.layerRoot.groups.length;++C){var H=this.layerRoot.groups[C];if(H.visible&&!H.initiallyVisible){I.push(H.groupName)}if(!H.visible&&H.initiallyVisible){G.push(H.groupName)}}F.showgroups=I.join(",");F.hidegroups=G.join(",");return F},getMapTip:function(C){var I=Fusion.oBroker;var M=C.oCurrentPosition.x;var K=C.oCurrentPosition.y;var F=this.mapWidget.pixToGeo(M-C.nTolerance,K-C.nTolerance);var L=this.mapWidget.pixToGeo(M+C.nTolerance,K+C.nTolerance);if(!F){return }var G="POLYGON(("+F.x+" "+F.y+", "+F.x+" "+L.y+", "+L.x+" "+L.y+", "+L.x+" "+F.y+", "+F.x+" "+F.y+"))";var D=1;var H=0;var N="INTERSECTS";var E=5;var J=C.aLayers.toString();var B=new Fusion.Lib.MGRequest.MGQueryMapFeatures(this.getSessionID(),this._sMapname,G,D,H,N,J,E);I.dispatchRequest(B,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]}if(this.oMaptip.t!=""||this.oMaptip.h!=""){this.mapWidget.triggerEvent(Fusion.Event.MAP_MAPTIP_REQ_FINISHED,this.oMaptip)}},getLegendImageURL:function(C,D,E,F){if(D.layerTypes[0]==4){return F}else{var B=Fusion.getConfigurationItem("mapguide","mapAgentUrl");B+="?OPERATION=GETLEGENDIMAGE&SESSION="+D.oMap.getSessionID();B+="&VERSION=1.0.0&SCALE="+C;op=/\(/g;cp=/\)/g;B+="&LAYERDEFINITION="+encodeURIComponent(D.resourceId).replace(op,"%28").replace(cp,"%29");B+="&THEMECATEGORY="+E.categoryIndex;B+="&TYPE="+E.geometryType;B+="&CLIENTAGENT="+encodeURIComponent(this.clientAgent);if(this.noCache){B+="&TS="+(new Date()).getTime()}return B}},processAndMergeFeatureInfo:function(B){this.processSelectedFeatureInfo(B,true)},processFeatureInfo:function(B){this.processSelectedFeatureInfo(B,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(G){this.aLayers=[];this.nLayers=0;try{var E=G.FeatureInformation.FeatureSet[0].Layer;if(E!=null){for(var F=0;F<E.length;F++){var D=o.FeatureInformation["FeatureSet"][0]["Layer"][F]["@id"][0];var K=o.FeatureInformation["FeatureSet"][0]["Layer"][F]["Class"][0];var J=o.FeatureInformation["FeatureSet"][0]["Layer"][F]["Class"][0]["@id"][0];var H=new Fusion.SimpleSelectionObject.Layer(D,J);this.addLayer(H);var B=K.ID;for(var C=0;C<B.length;C++){H.addFeature(B[C])}}}}catch(I){}},addLayer:function(B){this.aLayers[this.nLayers]=B;this.nLayers++},getNumLayers:function(){return this.nLayers},getLayerByName:function(C){var B=null;for(var D=0;D<this.nLayers;D++){if(this.aLayers[D].getName()==C){B=this.aLayers[D];break}}return B},getLayer:function(B){if(B>=0&&B<this.nLayers){return this.aLayers[B]}else{return null}},getSelectionXml:function(){var E="";if(this.nLayers>0){E='<?xml version="1.0" encoding="UTF-8"?>\n<FeatureSet>\n';for(var D=0;D<this.nLayers;D++){var C=this.aLayers[D];E+='<Layer id="'+C.getName()+'">\n';E+='<Class id="'+C.getClassName()+'">\n';for(var B=0;B<C.getNumFeatures();B++){var F=C.featIds[B];E+="<ID>"+F+"</ID>\n"}E+="</Class>\n</Layer>\n"}E+="</FeatureSet>\n"}return E},merge:function(C){if(C!=null&&C.nLayers>0){for(var I=0;I<C.nLayers;I++){var B=C.aLayers[I];var E=this.getLayerByName(B.getName());if(E!=null){for(var F=0;F<B.getNumFeatures();F++){var H=E.featIds.find(B.featIds[F]);if(H==null){E.addFeature(B.featIds[F])}else{E.removeFeatures(H)}}if(E.featIds.length==0){this.clear()}}else{var G=new Fusion.SimpleSelectionObject.Layer(B.getName(),B.getClassName());for(var D=0;D<B.getNumFeatures();D++){G.addFeature(B.featIds[D])}this.addLayer(G)}}}},clear:function(){this.aLayers=[];this.nLayers=0}});Fusion.SimpleSelectionObject.Layer=OpenLayers.Class({name:"",className:"",featIds:null,nFeatures:0,initialize:function(B,C){this.name=B;this.className=C;this.nFeatures=0;this.featIds=[]},addFeature:function(B){this.featIds[this.nFeatures]=B;this.nFeatures++},getName:function(){return this.name},getClassName:function(){return this.className},getNumFeatures:function(){return this.nFeatures},removeFeatures:function(B){var C=B.length;for(var D=0;D<C;D++){this.featIds.remove(B[D]);this.nFeatures--}}});Array.prototype.find=function(B){var C=null;for(i=0;i<this.length;i++){if(typeof (B)=="function"){if(B.test(this[i])){if(!C){C=[]}C.push(i)}}else{if(this[i]===B){if(!C){C=[]}C.push(i)}}}return C};Array.prototype.remove=function(B){this.splice(B,1)};Fusion.Layers.Generic=OpenLayers.Class(Fusion.Layers,{arch:"Generic",sActiveLayer:null,selectionType:"INTERSECTS",bSelectionOn:false,oSelection:null,initialize:function(E,C,B){Fusion.Layers.prototype.initialize.apply(this,arguments);this._sMapname=C.layerOptions.name?C.layerOptions.name:"generic layer";this.minScale=C.layerOptions.minScale?C.layerOptions.minScale:1;this.maxScale=C.layerOptions.maxScale?C.layerOptions.maxScale:"auto";var D=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:[D],parentGroup:E.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(B){this.loadMap(this.sMapResourceId)}},loadMap:function(B){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;case"OpenStreetMap":if(this.mapTag.layerOptions.type){this.mapTag.layerOptions.type=this.mapTag.layerOptions.type}else{this.mapTag.layerOptions.type="Mapnik"}break;default:this.oLayerOL=new OpenLayers.Layer[this.layerType](this.getMapName(),this.sMapResourceId,this.mapTag.layerParams,this.mapTag.layerOptions);break}if(!this.oLayerOL){if(typeof this.mapTag.layerOptions.sphericalMercator=="undefined"){this.mapTag.layerOptions.sphericalMercator=true}if(this.mapTag.layerOptions.sphericalMercator){if(!this.mapTag.layerOptions.maxExtent){this.mapTag.layerOptions.maxExtent=new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892)}this.mapTag.layerOptions.units="m";this.mapTag.layerOptions.projection="EPSG:3785"}else{if(!this.mapTag.layerOptions.maxExtent){this.mapTag.layerOptions.maxExtent=new OpenLayers.Bounds(-180,-90,180,90)}this.mapTag.layerOptions.units="dd";this.mapTag.layerOptions.projection="EPSG:4326"}if(typeof this.mapTag.layerOptions.numZoomLevels=="undefined"){this.mapTag.layerOptions.numZoomLevels=20}if(this.layerType=="OpenStreetMap"){this.oLayerOL=new OpenLayers.Layer.OSM[this.mapTag.layerOptions.type](this.getMapName(),this.mapTag.layerOptions)}else{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(B,C){this.processLayerEvents(B,true);if(!C){this.oLayerOL.setVisibility(true)}},hideLayer:function(B,C){this.processLayerEvents(B,false);if(!C){this.oLayerOL.setVisibility(false)}},showGroup:function(C,B){this.processGroupEvents(C,true)},hideGroup:function(C,B){this.processGroupEvents(C,false)},refreshLayer:function(B){this.drawMap()},getLegendImageURL:function(B,C,D,E){return E},getSessionID:function(){return""},getLinkParams:function(){var B={};B.layerType=this.layerType;return 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(D){var C=D.extension;var B=C.Direction?C.Direction[0].toLowerCase():"previous";if(B!="previous"&&B!="next"){this.sDirection="previous"}else{this.sDirection=B}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 B=this.getMap().getCurrentExtents();if(this.aHistory.history.length==0){this.aHistory.history.push(B);this.aHistory.index=0}else{var C=this.aHistory.history[this.aHistory.index];if(this.boundsEqual(B,C)){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(B);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(C,B){var D=false;var E=100;if(B.top==0){C.top+=E;B.top+=E}if(B.bottom==0){C.bottom+=E;B.bottom+=E}if(B.left==0){C.left+=E;B.left+=E}if(B.right==0){C.right+=E;B.right+=E}D=(Math.abs((C.top-B.top)/B.top)<this.EPS&&Math.abs((C.bottom-B.bottom)/B.bottom)<this.EPS&&Math.abs((C.left-B.left)/B.left)<this.EPS&&Math.abs((C.right-B.right)/B.right)<this.EPS);return D}});Fusion.Widget.SaveMap=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,iframe:null,printLayout:null,printScale:null,imageWidth:null,imageHeight:null,initializeWidget:function(E){var J=E.extension;this.format=(J.Format&&J.Format[0]!="")?J.Format[0]:"png";if(this.format=="DWF"&&J.PrintLayout.length){var I=J.PrintLayout;for(var G=0;G<I.length;G++){var H=I[G];var C={label:H.Name[0]};var F={rid:H.ResourceId[0]};if(H.PageHeight){F.pageHeight=H.PageHeight[0]}if(H.PageWidth){F.pageWidth=H.PageWidth[0]}if(H.Margins){F.margins=[H.Margins[0].Top[0],H.Margins[0].Left[0],H.Margins[0].Right[0],H.Margins[0].Bottom[0]]}var B=null;if(H.Scale){B=new Jx.Menu.SubMenu(C);F.scales=[];for(var D=0;D<H.Scale.length;D++){F.scales.push(H.Scale[D]);B.add(new Jx.Menu.Item({label:H.Scale[D],onClick:OpenLayers.Function.bind(this.setLayout,this,F,D)}))}B.add(new Jx.Menu.Item({label:"Current Scale",onClick:OpenLayers.Function.bind(this.setLayout,this,F)}))}else{C.onClick=OpenLayers.Function.bind(this.setLayout,this,F);B=new Jx.Menu.Item(C)}this.oMenu.add(B)}}else{if(this.format.toLowerCase()=="dwf"){var H=J;if(H.ResourceId){this.printLayout=H.ResourceId[0]}if(H.PageHeight){this.pageHeight=H.PageHeight[0]}if(H.PageWidth){this.pageWidth=H.PageWidth[0]}if(H.Margins){this.margins=[H.Margins[0].Top[0],H.Margins[0].Left[0],H.Margins[0].Right[0],H.Margins[0].Bottom[0]]}if(H.Scale&&H.Scale!="0"){this.printScale=H.Scale[0]}}else{if(J.Width&&J.Width[0]!=""){this.imageWidth=J.Width[0]}if(J.Height&&J.Height[0]!=""){this.imageHeight=J.Height[0]}}}this.enable=Fusion.Widget.SaveMap.prototype.enable},enable:function(){Fusion.Widget.prototype.enable.apply(this,[])},setLayout:function(B){this.printLayout=B.rid;this.pageHeight=B.pageHeight;this.pageWidth=B.pageWidth;this.pageMargins=B.margins;if(arguments.length==3){this.printScale=parseFloat(B.scales[arguments[1]])}else{this.printScale=null}this.activateTool()},activate:function(){if(!this.iframe){this.iframe=document.createElement("iframe");this.iframe.id="w";this.iframe.style.visibility="hidden";document.body.appendChild(this.iframe)}var C="";var K="";var D="";var I="";var G="";if(this.format.toLowerCase()=="dwf"){if(this.printLayout){C="&layout="+this.printLayout}if(this.printScale){K="&scale="+this.printScale}if(this.pageHeight){D="&pageheight="+this.pageHeight}if(this.pageWidth){I="&pagewidth="+this.pageWidth}if(this.pageMargins){G="&margins="+this.pageMargins.join(",")}}var F="";if(this.imageHeight){F="&height="+this.imageHeight}var H="";if(this.imageWidth){H="&width="+this.imageWidth}var E=this.getMap().aMaps[0];if(navigator.appVersion.match(/\bMSIE\b/)){var B=Fusion.fusionURL+"layers/"+E.arch+"/"+Fusion.getScriptLanguage()+"/SaveMapFrame."+Fusion.getScriptLanguage()+"?session="+E.getSessionID()+"&mapname="+E.getMapName()+"&format="+this.format.toUpperCase()+C+K+H+F+D+I+G;w=open(B,"Save","menubar=no,height=200,width=300")}else{var J=Fusion.fusionURL+"layers/"+E.arch+"/"+Fusion.getScriptLanguage()+"/SaveMap."+Fusion.getScriptLanguage()+"?session="+E.getSessionID()+"&mapname="+E.getMapName()+"&format="+this.format.toUpperCase()+C+K+H+F+D+I+G;this.iframe.src=J}}});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(B){this.oSMAselectionPanel=B;this.iResultsPerPage=B.iResultsPerPage;this.aiCurrentIndex=new Array()},updatePageIndexes:function(){var C=this.oSelection.getNumLayers();for(var B=0;B<C;B++){this.aiCurrentIndex[this.oSelection.getLayer(B).getName()]=0}},getNextPage:function(B){if(B&&(this.iResultsPerPage!=0)){var D=B.getName();if(this.aiCurrentIndex[D]>=B.getNumElements()){this.aiCurrentIndex[D]=this.aiCurrentIndex[D]-this.iResultsPerPage}var C=B.getNumElements();var G=this.aiCurrentIndex[D];var E=G+this.iResultsPerPage;if(E>=C){E=C}if(G<0){G=0}this.aiCurrentIndex[D]=E;var F=(E-G);if(F!=this.iResultsPerPage){this.aiCurrentIndex[D]=this.aiCurrentIndex[D]+(this.iResultsPerPage-F)}return this.getPage(B,G,E)}return this.getPage(B)},getPreviousPage:function(B){var D=B.getName();if(B&&(this.aiCurrentIndex[D]!=0)&&(this.iResultsPerPage!=0)){var C=B.getNumElements();var F=this.aiCurrentIndex[D]-(this.iResultsPerPage*2);var E=this.aiCurrentIndex[D]-this.iResultsPerPage;if(F<0){F=0;E=(C<this.iResultsPerPage)?C:this.iResultsPerPage}this.aiCurrentIndex[D]=E;return this.getPage(B,F,E)}return this.getPage(B)},getMap:function(){return this.oSMAselectionPanel.getMap()},getPage:function(B,H,G){var F=false;if(B){F=new Array();H=H?H:0;G=G?G:B.getNumElements();var I=B.getPropertyNames();var D=0;for(var E=H;E<G;E++,D++){F[D]=new Array();for(var C=0;C<I.length;C++){F[D][C]=B.getElementValue(E,C)}}}return F},updateSelection:function(){},clearSelection:function(){},CLASS_NAME:"Fusion.Widget.SMAselectionPanel.SelectionRenderer"});Fusion.Widget.SMAselectionPanel.SelectionRendererDefault=OpenLayers.Class(Fusion.Widget.SMAselectionPanel.SelectionRenderer,{initialize:function(B){Fusion.Widget.SMAselectionPanel.SelectionRenderer.prototype.initialize.apply(this,[B]);var C=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();C.appendChild(this.toolbar);C.appendChild(this.featureDiv);this.oSMAselectionPanel.domObj.appendChild(C)},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(F){this.oSelection=null;for(var J in F){this.oSelection=F[J];break}if(!this.oSelection){return }this.featureDiv.className="SMAselectionPanelContent";while(this.layerList.length>0){this.layerList.remove(this.layerList.options[0])}var D=this.oSelection.getNumLayers();for(var H=0;H<D;H++){var E=this.oSelection.getLayer(H);var C=this.getMap().aMaps[0].aLayers;var I=E.getName();for(var G=0;G<C.length;++G){if(C[G].layerName==I){I=C[G].legendLabel;break}}var B=new Option(I,H);this.layerList.options[H]=B}this.layerList.selectedIndex=0;this.renderSelectionFeatures()},renderSelectionFeatures:function(){var C=this.layerList.selectedIndex;var F=this.oSelection.getLayer(C);while(this.featureList.length>0){this.featureList.remove(this.featureList.options[0])}var B=F.getNumElements();for(var E=0;E<B;E++){var D=new Option(E+1,E);this.featureList.options[E]=D}this.featureList.selectedIndex=0;this.renderFeature()},renderFeature:function(){var I=this.layerList.selectedIndex;var F=this.featureList.selectedIndex;var E=this.oSelection.getLayer(I);var H=E.getNumProperties();var D=E.getPropertyNames();this.featureDiv.className="selectionDiv";if(H>4){var L=E.getElementValue(F,0);L=L.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\\/g,"");var C=E.getElementValue(F,1);C=C.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');var K=E.getElementValue(F,2);K=K.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\\/g,"");var B=E.getElementValue(F,3);B=B.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');if(B){facebook='&nbsp;&nbsp;&nbsp;&nbsp;<a target="_blank" href="'+B+'"><img title="facebook"alt="facebook" src="/images/website/facebook16.png" height="16px" width="16px"></a>'}else{facebook=""}var G=E.getElementValue(F,4);directoryURL="/directory/"+G+".php?locale="+Fusion.locale;if(Fusion.locale=="en"){dirTip="GreenMap directory"}else{dirTip="directorio MapaVerde"}if(directoryURL){G='<a target="_blank" href="'+directoryURL+'"><img title="'+dirTip+'"alt="'+dirTip+'" src="/images/website/map16.png" height="16px" width="16px"></a>'}else{G=""}var J=E.getElementValue(F,5);J=J.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');if(Fusion.locale=="en"){webTip="website"}else{webTip="sitio web"}if(J){website='&nbsp;&nbsp;&nbsp;&nbsp;<a target="_blank" href="'+B+'"><img title="'+webTip+'"alt="'+webTip+'" src="/images/website/weblink16.png" height="16px" width="16px"></a>'}else{website=""}this.featureDiv.innerHTML=L+'<p class="selectionName">'+C+'</p><p class="selectionDesc">'+K+"</p>"+G+website+facebook}else{if(H>1){var L=E.getElementValue(F,0);L=L.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\\/g,"");var C=E.getElementValue(F,1);C=C.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');this.featureDiv.innerHTML=L+"<br>"+C}else{if(H>0){var C=E.getElementValue(F,0);C=C.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"');this.featureDiv.innerHTML=C}else{this.featureDiv.innerHTML=""}}}}});Fusion.Widget.SMAselectionPanel.SelectionRendererHorizontal=OpenLayers.Class(Fusion.Widget.SMAselectionPanel.SelectionRenderer,{initialize:function(B){Fusion.Widget.SMAselectionPanel.SelectionRenderer.prototype.initialize.apply(this,[B]);var C=document.createElement("div");this.featureDiv=document.createElement("div");this.featureDiv.innerHTML="No Selection";this.featureDiv.className="SMAselectionPanelContent noSelection";C.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"));C.appendChild(this.previousButton);C.appendChild(this.nextButton)}Fusion.addWidgetStyleSheet(this.oSMAselectionPanel.getLocation()+"SMAselectionPanel/SMAselectionPanel.css");this.oSMAselectionPanel.domObj.appendChild(C)},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(C){this.oSelection=null;for(var B in C){this.oSelection=C[B];break}this.updatePageIndexes();this.renderLayers("next")},renderLayers:function(B){if(!this.oSelection){return }$(this.featureDiv).removeClass("noSelection");this.featureDiv.innerHTML="";var E=this.oSelection.getNumLayers();for(var J=0;J<E;J++){var O=document.createElement("table");O.style.borderLeft="1px solid #CCCCCC";O.style.marginBottom="10px";var G=this.oSelection.getLayer(J);var F=G.getPropertyNames();var D=this.getMap().aMaps[0].aLayers;var K=G.getName();for(var H=0;H<D.length;++H){if(D[H].layerName==K){K=D[H].legendLabel;break}}var M=document.createElement("thead");var N=document.createElement("tr");var C=document.createElement("th");C.innerHTML=K;C.colSpan=F.length;C.style.textAlign="center";N.appendChild(C);M.appendChild(N);N=document.createElement("tr");for(var H=0;H<F.length;H++){C=document.createElement("th");C.innerHTML=F[H];C.style.textAlign="center";N.appendChild(C)}M.appendChild(N);O.appendChild(M);var I=document.createElement("tbody");var L=(B=="next")?this.getNextPage(G):this.getPreviousPage(G);this.renderFeatures(L,I);O.appendChild(I);this.featureDiv.appendChild(O)}},renderFeatures:function(E,F){if(!E){return }for(var C=0;C<E.length;C++){var D=document.createElement("tr");if(C%2){D.className="oddRow"}for(var B=0;B<E[C].length;B++){var G=document.createElement("td");G.innerHTML=E[C][B];D.appendChild(G)}F.appendChild(D)}}});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(F){this.asCursor=["auto"];var D=F.extension;this.selectionType=D.SelectionType?D.SelectionType[0]:"INTERSECTS";if(D.Tolerance&&(parseInt(D.Tolerance[0])>0)){nTolerance=parseInt(D.Tolerance[0])}this.defaultRadius=D.DefaultRadius?parseInt(D.DefaultRadius[0]):this.defaultRadius;this.bComputeMetadata=(D.ComputeMetadata&&(D.ComputeMetadata[0]=="true"||D.ComputeMetadata[0]=="1"))?true:false;var B=D.RadiusTooltipContainer?D.RadiusTooltipContainer[0]:"";if(B!=""){this.radiusTip=$(B)}if(this.radiusTip){this.radiusTipType=D.RadiusTooltipType?D.RadiusTooltipType[0].toLowerCase():"dynamic";if(this.radiusTipType=="dynamic"){var E=this.getMap().getDomObj();E.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 C=this.getMap();this.map=C.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);C.handlers.push(this.handler)},setRadius:function(B){this.defaultRadius=B},getRadius:function(){if(this.handler.active){return this.handler.radius}else{return this.defaultRadius}},activate:function(){var B=this.getMap().pixToGeoMeasure(this.defaultRadius);this.handler.setOptions({radius:B});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(F){var D=this.handler.evt;if(OpenLayers.Event.isLeftClick(D)){this.handler.fixedRadius=false;var G=this.getMap().getEventPosition(D);var C=this.getMap().pixToGeo(G.x,G.y);var B=this.getMap().pixToGeoMeasure(this.handler.radius);if(this.radiusTip&&this.radiusTipType=="dynamic"){this.radiusTip.style.display="block";var E=$(this.radiusTip).getBorderBoxSize();this.radiusTip.style.top=(G.y-E.height*2)+"px";this.radiusTip.style.left=G.x+"px";if(this.units=="m"||this.units=="ft"){B=Math.round(B*100)/100}this.radiusTip.innerHTML=B+this.units}}},mouseMove:function(F){var D=this.handler.evt;if(OpenLayers.Event.isLeftClick(D)){var H=this.getMap();var G=H.getEventPosition(D);var C=H.pixToGeo(G.x,G.y);var B=this.getMap().pixToGeoMeasure(this.handler.radius);if(this.radiusTip&&this.radiusTipType=="dynamic"){this.radiusTip.style.display="block";var E=$(this.radiusTip).getBorderBoxSize();this.radiusTip.style.top=(G.y-E.height*2)+"px";this.radiusTip.style.left=G.x+"px";if(this.units=="m"||this.units=="ft"){B=Math.round(B*100)/100}this.radiusTip.innerHTML=B+this.units}}},mouseUp:function(B){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(B)}},execute:function(D){var B={};B.geometry=D.toString();B.selectionType=this.selectionType;B.computed=this.bComputeMetadata;if(this.bActiveOnly){var C=this.getMap().getActiveLayer();if(C){B.layers=C.layerName}else{return }}if(this.handler.evt.shiftKey){B.extendSelection=true}this.getMap().query(B)},setParameter:function(C,B){if(C=="Tolerance"&&B>0){this.nTolerance=B}if(C=="SelectionType"){this.selectionType=B}}});Fusion.Widget.Zoom=OpenLayers.Class(Fusion.Widget,{isExclusive:true,tolerance:5,factor:2,zoomIn:true,uiClass:Jx.Button,initializeWidget:function(H){var C=window.location.href.indexOf("?");var F=window.location.href.substring(0,C);C=F.lastIndexOf("/");F=F.substring(0,C+1);var G="url("+F+"images/zoomin.cur), auto";var E="url("+F+"images/zoomout.cur), auto";this.asCursor=[G,"-moz-zoom-in","auto"];this.zoomInCursor=[G,"-moz-zoom-in","auto"];this.zoomOutCursor=[E,"-moz-zoom-out","auto"];var D=H.extension;this.tolerance=D.Tolerance?D.Tolerance[0]:this.tolerance;this.factor=D.Factor?D.Factor[0]:this.factor;this.zoomIn=(D.Direction&&D.Direction[0]=="out")?false:true;this.keypressWatcher=OpenLayers.Function.bind(this.keypressHandler,this);var B=this.getMap();this.map=B.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});B.handlers.push(this.handler);B.handlers.push(this.shiftHandler)},shouldActivateWith:function(B){return(B instanceof Fusion.Widget.Zoom&&B.zoomIn==this.zoomIn&&B.factor==this.factor&&B.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(I,N){var G=this.zoomIn;if(N){G=!G}if(I instanceof OpenLayers.Bounds){var J=this.map.getLonLatFromPixel(new OpenLayers.Pixel(I.left,I.bottom));var L=this.map.getLonLatFromPixel(new OpenLayers.Pixel(I.right,I.top));var C=new OpenLayers.Bounds(J.lon,J.lat,L.lon,L.lat);if(G){this.getMap().setExtents(C)}else{var H=C.getWidth();var D=C.getHeight();var M=this.getMap().getCurrentExtents();var E=M.getWidth();var F=M.getHeight();var K=Math.min(H/E,D/F);var B=C.getCenterLonLat();this.getMap().zoom(B.lon,B.lat,K)}}else{var B=this.map.getLonLatFromPixel(I);var K;if(!G&&this.factor>1){K=1/this.factor}else{K=this.factor}this.getMap().zoom(B.lon,B.lat,K)}},altZoom:function(B){this.execute(B,true)},setParameter:function(C,B){if(C=="Factor"&&B>0){this.factor=B}},keypressHandler:function(C){var B=(C.charCode)?C.charCode:C.keyCode;if(B==Event.KEY_ESC){this.handler.deactivate();this.handler.activate()}}});Fusion.Widget.SMAcursorPosition=OpenLayers.Class(Fusion.Widget,{defaultTemplate:"x: {x}, y: {y}",domSpan:null,units:Fusion.UNKNOWN,initializeWidget:function(C){var B=C.extension;this.template=B.Template?B.Template[0]:this.defaultTemplate;this.precision=B.Precision?parseInt(B.Precision[0]):-1;this.units=B.Units?Fusion.unitFromName(B.Units[0]):Fusion.UNKOWN;this.domSpan=document.createElement("span");this.domSpan.className="spanCursorPosition";this.domSpan.innerHTML=this.emptyText;this.emptyText=B.EmptyText?B.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(B){Fusion.Widget.prototype.setUiObject.apply(this,[B]);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(B){this.domSpan.innerHTML=this.emptyText},mouseMove:function(G){var F=this.getMap();var E=F.getEventPosition(G);if(this.units!=Fusion.PIXELS){E=F.pixToGeo(E.x,E.y);if(E){if(this.units!=Fusion.UNKNOWN){var C=F.getMetersPerUnit();E.x=Fusion.fromMeter(this.units,E.x*C);E.y=Fusion.fromMeter(this.units,E.y*C)}if(this.precision>=0){var D=Math.pow(10,this.precision);E.x=Math.round(E.x*D)/D;E.y=Math.round(E.y*D)/D}}}if(E){var B=Fusion.unitAbbr(this.units);this.domSpan.innerHTML=this.template.replace("{x}",E.x).replace("{y}",E.y).replace("{units}",B).replace("{units}",B)}},setUnits:function(){if(this.units==Fusion.UNKNOWN){this.setParameter("Units",this.getMap().getUnits())}},setParameter:function(C,B){if(C=="Units"){this.units=10}}});Fusion.Widget.SMAcursorPositionMeters=OpenLayers.Class(Fusion.Widget,{defaultTemplate:"x: {x}, y: {y}",domSpan:null,units:Fusion.UNKNOWN,initializeWidget:function(C){var B=C.extension;this.template=B.Template?B.Template[0]:this.defaultTemplate;this.precision=B.Precision?parseInt(B.Precision[0]):-1;this.units=B.Units?Fusion.unitFromName(B.Units[0]):Fusion.UNKOWN;this.domSpan=document.createElement("span");this.domSpan.className="spanCursorPosition";this.domSpan.innerHTML=this.emptyText;this.emptyText=B.EmptyText?B.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(B){Fusion.Widget.prototype.setUiObject.apply(this,[B]);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(B){this.domSpan.innerHTML=this.emptyText},mouseMove:function(G){var F=this.getMap();var E=F.getEventPosition(G);if(this.units!=Fusion.PIXELS){E=F.pixToGeo(E.x,E.y);if(E){if(this.units!=Fusion.UNKNOWN){var C=F.getMetersPerUnit();E.x=Fusion.fromMeter(this.units,E.x*C);E.y=Fusion.fromMeter(this.units,E.y*C)}if(this.precision>=0){var D=Math.pow(10,this.precision);E.x=Math.round(E.x*D)/D;E.y=Math.round(E.y*D)/D}}}if(E){var B=Fusion.unitAbbr(this.units);this.domSpan.innerHTML=this.template.replace("{x}",E.x).replace("{y}",E.y).replace("{units}",B).replace("{units}",B)}},setUnits:function(){if(this.units==Fusion.UNKNOWN){this.setParameter("Units",this.getMap().getUnits())}},setParameter:function(C,B){if(C=="Units"){B="m";this.units=Fusion.unitFromName(B)}}});Fusion.Widget.EditableScale=OpenLayers.Class(Fusion.Widget,{precision:4,initializeWidget:function(C){var B=C.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=B.Precision?parseInt(B.Precision[0]):this.precision;this.getMap().registerForEvent(Fusion.Event.MAP_EXTENTS_CHANGED,OpenLayers.Function.bind(this.scaleChanged,this));Fusion.addWidgetStyleSheet(C.location+"/EditableScale/EditableScale.css");if(this.domObj){this.domObj.appendChild(this.domPrefix);this.domObj.appendChild(this.domScale)}},setUiObject:function(B){Fusion.Widget.prototype.setUiObject.apply(this,[B]);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(B){B=Math.abs(parseFloat(B));return""+Math.round(B*Math.pow(10,this.precision))/Math.pow(10,this.precision)},keyPressHandler:function(B){if(B.keyCode==OpenLayers.Event.KEY_RETURN){this.zoomToScale()}},zoomToScale:function(B){var C=parseFloat(this.domScale.value);if(C){this.getMap().zoomToScale(C)}}});Fusion.Widget.ClearSelection=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,initializeWidget:function(B){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.SMAaboutGreen=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,_nWidth:500,_nHeight:400,_sAboutUrl:null,_sDefaultUrl:"widgets/SMAabout/enAbout.html",initializeWidget:function(C){var B=C.extension;this._sDefaultUrl="widgets/SMAabout/"+Fusion.locale+"GreenAbout.html";this._sAboutUrl=(B.AboutURL)?B.AboutURL[0]:this._sDefaultUrl;if(this._sAboutUrl==this._sDefaultUrl){this._sAboutUrl=Fusion.getFusionURL()+this._sAboutUrl}this.enable()},activate:function(){var B="menubar=no,location=no,resizable=no,status=no";B+=",width="+this._nWidth;B+=",height="+this._nHeight;window.open(this._sAboutUrl,"AboutPopup",B)}});Fusion.Widget.SMAsearch=OpenLayers.Class(Fusion.Widget,{uiClass:Jx.Button,sFeatures:"menubar=no,location=no,status=no,scrollbars=yes",initializeWidget:function(C){var B=C.extension;this.sTarget=B.Target?B.Target[0]:"SearchWindow";this.sBaseUrl=Fusion.getFusionURL()+"widgets/SMAsearch/SearchPrompt.php";this.prompt=B.Prompt?B.Prompt[0]:"";this.layer=B.Layer?B.Layer[0]:"";this.filter=B.Filter?B.Filter[0]:"";this.limit=B.MatchLimit?B.MatchLimit[0]:100;this.resultColumns=B.ResultColumns?B.ResultColumns[0].Column:[];this.title=B.Title?B.Title[0]:C.label;this.searchButton=OpenLayers.i18n("searchButton")},activate:function(){var C=this.sBaseUrl;var B=this.getMap();var D=B.getAllMaps();var E=Fusion.getWidgetById(this.sTarget);var J=$(this.sTarget);var F=[];F.push("locale="+Fusion.locale);F.push("session="+D[0].getSessionID());F.push("mapname="+D[0].getMapName());if(E||J){F.push("popup=false")}else{F.push("popup=true")}F.push("title="+this.title);F.push("prompt="+this.prompt);F.push("target="+this.sTarget);F.push("filter="+this.filter);F.push("layer="+this.layer);F.push("limit="+this.limit);F.push("searchButton="+this.searchButton);var H=[];var I=[];for(var G=0;G<this.resultColumns.length;++G){H.push(this.resultColumns[G].Name);I.push(this.resultColumns[G].Property)}F.push("properties="+I.join(","));F.push("propNames="+H.join(","));if(C.indexOf("?")<0){C+="?"}else{if(C.slice(-1)!="&"){C+="&"}}C+=F.join("&");if(E){E.setContent(C)}else{if(J){J.src=C}else{window.open(C,this.sTarget,this.sFeatures)}}}});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(E){this.asCursor=["crosshair"];var L=E.extension;this.units=(L.Units&&(L.Units[0]!=""))?Fusion.unitFromName(L.Units[0]):this.units;this.distPrecision=L.DistancePrecision?parseInt(L.DistancePrecision[0]):4;this.areaPrecision=L.AreaPrecision?parseInt(L.AreaPrecision[0]):4;if(L.SegmentLabels){this.segmentLabels=(L.SegmentLabels[0].toLowerCase=="true"&&L.SegmentLabels[0])?true:false}this.sTarget=L.Target?L.Target[0]:"";this.sBaseUrl=Fusion.getFusionURL()+"widgets/SMAmeasure/Measure.php";this.measureType=0;if(L.Type){switch(L.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 J=L.FillStyle?L.FillStyle[0]:"rgba(0,0,255, 0.3)";var D=L.LineStyleWidth?L.LineStyleWidth[0]:2;var G=L.LineStyleColor?L.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 C=this.getMap();this.keyHandler=OpenLayers.Function.bind(this.onKeyPress,this);C.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 B=new OpenLayers.Style();B.addRules([new OpenLayers.Rule({symbolizer:this.sketchSymbolizers})]);var H=new OpenLayers.StyleMap({"default":B});this.map=C.oMapOL;var F={style:"default",layerOptions:{styleMap:H}};var K=OpenLayers.Handler.Path;if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){K=OpenLayers.Handler.Polygon}var I={persist:true,handlerOptions:F,callbacks:{modify:OpenLayers.Function.bind(this.measurePartial,this),cancel:OpenLayers.Function.bind(this.resetMeasure,this)}};this.control=new OpenLayers.Control.Measure(K,I);this.getMap().oMapOL.addControl(this.control);this.control.events.on({measure:this.measure,scope:this})},shouldActivateWith:function(B){return(B instanceof Fusion.Widget.SMAmeasure&&B.SMAmeasureType==this.measureType)},measure:function(G){this.hasMeasure=true;var F=G.geometry;if(this.measureType&Fusion.Constant.MEASURE_TYPE_DISTANCE){var D=F.getVertices();while(this.distanceMarkers.length>D.length-1){this.distanceMarkers.pop().destroy()}var H=v0=D[0];for(var E=1;E<D.length;E++){v1=D[E];if(this.distanceMarkers[E-1]){var B=this.distanceMarkers[E-1];B.label=""}else{B=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,E+": ")}var C=new OpenLayers.Geometry.LineString();C.addPoint(v0.clone());C.addPoint(v1.clone());this.updateMarker(B,C);v0=v1}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){C=new OpenLayers.Geometry.LineString();C.addPoint(H);C.addPoint(v0);this.lastMarker.label=E+": ";this.updateMarker(this.lastMarker,C)}}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){this.updateArea(F)}this.triggerEvent(Fusion.Event.MEASURE_COMPLETE)},measurePartial:function(B,D){if(this.hasMeasure){this.resetMeasure();this.hasMeasure=false}var C=D.geometry;if(this.measureType&Fusion.Constant.MEASURE_TYPE_DISTANCE){this.updateDistances(C)}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){this.updateArea(C)}this.triggerEvent(Fusion.Event.MEASURE_SEGMENT_UPDATE)},updateDistances:function(D){var C=D.getVertices();var E=C.length-1;if(E>0){var F=new OpenLayers.Geometry.LineString();F.addPoint(C[E-1].clone());F.addPoint(C[E].clone());var B;if(this.distanceMarkers.length<E){B=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,E+": ");this.distanceMarkers.push(B)}else{B=this.distanceMarkers[E-1]}this.updateMarker(B,F);if(E>1&&D.CLASS_NAME.indexOf("LineString")==-1){F=new OpenLayers.Geometry.LineString();F.addPoint(C[0].clone());F.addPoint(C[E].clone());if(!this.lastMarker){this.lastMarker=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,"")}this.lastMarker.label="";this.updateMarker(this.lastMarker,F)}}},updateArea:function(B){if(!this.areaMarker){this.areaMarker=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,"",true)}this.updateMarker(this.areaMarker,B)},delayUpdate:function(B,C){this.delayUpdateTimer=null;this.updateMarker(B,C)},updateMarker:function(F,H){if(!F){return }var D,I,J;var K=H.getVertices();var C=this.getMap();var E=C.oMapOL.baseLayer.projection;if(H.CLASS_NAME.indexOf("LineString")!=-1){I=this.getMap().geoToPix(K[0].x,K[0].y);J=this.getMap().geoToPix(K[1].x,K[1].y);at={x:(I.x+J.x)/2,y:(I.y+J.y)/2};D=H.getGeodesicLength(E);measureUnits=Fusion.METERS;if(measureUnits!=this.units){D=Fusion.convert(measureUnits,this.units,D)}}else{var B=H.getCentroid();at=this.getMap().geoToPix(B.x,B.y);D=H.getGeodesicArea(E);measureUnits=Fusion.METERS;if(measureUnits!=this.units){var G=Fusion.convert(measureUnits,this.units,1);D=D*G*G}}if(D>1){F.setQuantity(D);this.positionMarker(F,at)}},positionMarker:function(D,B){var G=this.getMap().getDomObj();if(!D.domObj.parentNode||D.domObj.parentNode!=G){G.appendChild(D.domObj)}var F=D.getSize();var E=B.y-F.height/2;var C=B.x-F.width/2;if(!isNaN(E)&&!isNaN(C)){D.domObj.style.top=E+"px";D.domObj.style.left=C+"px";if(this.segmentLabels===true){D.domObj.style.display="block"}}else{if(this.segmentLabels===true){D.domObj.style.display="none"}}},onKeyPress:function(C){var B=(C.charCode)?C.charCode:((C.keyCode)?C.keyCode:C.which);if(B==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 B=this.sBaseUrl;var F="locale="+Fusion.locale;if(B.indexOf("?")<0){B+="?"}else{if(B.slice(-1)!="&"){B+="&"}}B+=F+"&type="+this.measureType;var E=Fusion.getWidgetById(this.sTarget);var D=window;if(E){E.setContent(B);D=E.iframe.contentWindow}else{D=window.open(B,this.sTarget,this.sWinFeatures)}this.registerForEvent(Fusion.Event.MEASURE_CLEAR,OpenLayers.Function.bind(this.clearDisplay,this,D));this.registerForEvent(Fusion.Event.MEASURE_SEGMENT_UPDATE,OpenLayers.Function.bind(this.updateDisplay,this,D));this.registerForEvent(Fusion.Event.MEASURE_COMPLETE,OpenLayers.Function.bind(this.updateDisplay,this,D))}else{this.totalDistanceMarker=new Fusion.Widget.SMAmeasure.Marker(this.units,this.distPrecision,"Total:");var C=this.getMap().getDomObj();if(!this.totalDistanceMarker.domObj.parentNode||this.totalDistanceMarker.domObj.parentNode!=C){C.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 B=0;B<this.distanceMarkers.length;B++){this.distanceMarkers[B].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(D,H,I,G){var B=this.getMap();var E=B.getAllMaps();var K="layers/"+E[0].arch+"/"+Fusion.getScriptLanguage()+"/Measure."+Fusion.getScriptLanguage();var F=B.pixToGeo(H.x,H.y);var C=B.pixToGeo(I.x,I.y);var J={parameters:{session:E[0].getSessionID(),locale:Fusion.locale,mapname:B.getMapName(),x1:F.x,y1:F.y,x2:C.x,y2:C.y},onComplete:OpenLayers.Function.bind(this.remoteMeasureCompleted,this,H,I,D)};Fusion.ajaxRequest(K,J)},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(G){var L=G.document;this.clearDisplay(G);var H=Fusion.unitAbbr(this.units);var K;var F=this.distPrecision;var I=function(N,Q){if(Q<1){return }var O=L.createElement("tr");var P=L.createElement("td");P.innerHTML=OpenLayers.i18n("segment",{seg:N});O.appendChild(P);P=L.createElement("td");if(F==0){K=Math.floor(Q)}else{K=Q.toPrecision(F)}P.innerHTML=K+" "+H;O.appendChild(P);E.appendChild(O)};if(this.measureType&Fusion.Constant.MEASURE_TYPE_DISTANCE){var E=L.getElementById("segmentTBody");var J=0;if(E){for(var D=0;D<this.distanceMarkers.length;D++){var B=this.distanceMarkers[D].getQuantity();J+=B;I(D+1,B)}if(this.lastMarker){J+=this.lastMarker.getQuantity();I(D+1,this.lastMarker.getQuantity())}var M=L.getElementById("totalDistance");if(this.distPrecision==0){K=Math.floor(J)}else{K=J.toPrecision(this.distPrecision)}M.innerHTML=K+" "+H}}if(this.measureType&Fusion.Constant.MEASURE_TYPE_AREA){var C=L.getElementById("totalArea");K=this.areaMarker.getQuantity();if(this.areaPrecision==0){K=Math.floor(K)}else{K=K.toPrecision(this.areaPrecision)}C.innerHTML=K+" "+H+"<sup>2</sup>"}},updateTotalDistance:function(){if(this.distanceMarkers.length>1){var B=0;var C=Fusion.unitAbbr(this.units);for(var D=0;D<this.distanceMarkers.length;D++){var E=this.distanceMarkers[D].getQuantity();B+=E}this.totalDistanceMarker.domObj.style.display="block";this.totalDistanceMarker.setQuantity(B)}},clearDisplay:function(D){var C=D.document;var B=C.getElementById("segmentTBody");if(B){while(B.firstChild){B.firstChild.marker=null;B.removeChild(B.firstChild)}var E=C.getElementById("totalDistance");E.innerHTML=""}},clearTotalDistance:function(){this.totalDistanceMarker.domObj.style.display="none"},setUnits:function(B){B=(B==Fusion.UNKNOWN)?Fusion.unitFromName(this.getMap().getUnits()):B;this.setParameter("Units",Fusion.unitName(B))},setParameter:function(D,C){if(D=="Units"){this.units=Fusion.unitFromName(C);for(var B=0;B<this.distanceMarkers.length;B++){this.distanceMarkers[B].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(C,B,D,E){this.precision=B;this.label=D?D:"";this.isArea=E||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(C);this.setCalculating()},destroy:function(){if(this.domObj.parentNode){this.domObj.parentNode.removeChild(this.domObj);this.domObj.style.display="none"}},setUnits:function(B){this.unit=B;this.unitAbbr=Fusion.unitAbbr(B)},getQuantity:function(){return this.quantity},getQuantityLabel:function(){var C;if(this.precision==0){C=Math.floor(this.quantity)}else{C=this.quantity.toPrecision(this.precision)}var B="";if(this.isArea){B="<sup>2<sup>"}return this.label+" "+C+" "+this.unitAbbr+B},setQuantity:function(B){if(this.calculatingImg.parentNode){this.calculatingImg.parentNode.removeChild(this.calculatingImg)}this.quantity=B;this.domObj.innerHTML=this.getQuantityLabel()},setCalculating:function(){if(!this.calculatingImg.parentNode){this.domObj.innerHTML="";this.domObj.appendChild(this.calculatingImg)}},getSize:function(){var B=$(this.domObj).getBorderBoxSize();var C={width:19,height:4};if(B.width<C.width){B.width+=C.width}if(B.height<C.height){B.height+=C.height}return B}});
