var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var d=document.createElement("div"),b=document.createElement("form"),a=false;if(d.__proto__&&(d.__proto__!==b.__proto__)){a=true}d=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var d;for(var b=0,f=arguments.length;b<f;b++){var a=arguments[b];try{d=a();break}catch(g){}}return d}};var Class=(function(){var e=(function(){for(var f in {toString:1}){if(f==="toString"){return false}}return true})();function a(){}function b(){var j=null,h=$A(arguments);if(Object.isFunction(h[0])){j=h.shift()}function f(){this.initialize.apply(this,arguments)}Object.extend(f,Class.Methods);f.superclass=j;f.subclasses=[];if(j){a.prototype=j.prototype;f.prototype=new a;j.subclasses.push(f)}for(var g=0,k=h.length;g<k;g++){f.addMethods(h[g])}if(!f.prototype.initialize){f.prototype.initialize=Prototype.emptyFunction}f.prototype.constructor=f;return f}function d(m){var h=this.superclass&&this.superclass.prototype,g=Object.keys(m);if(e){if(m.toString!=Object.prototype.toString){g.push("toString")}if(m.valueOf!=Object.prototype.valueOf){g.push("valueOf")}}for(var f=0,j=g.length;f<j;f++){var l=g[f],k=m[l];this.prototype[l]=k}return this}return{create:b,Methods:{addMethods:d}}})();(function(){var G=Object.prototype.toString,F="Null",q="Undefined",z="Boolean",g="Number",v="String",L="Object",w="[object Function]",C="[object Boolean]",h="[object Number]",n="[object String]",j="[object Array]",B="[object Date]",k=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function m(N){switch(N){case null:return F;case (void 0):return q}var M=typeof N;switch(M){case"boolean":return z;case"number":return g;case"string":return v}return L}function D(M,O){for(var N in O){M[N]=O[N]}return M}function K(M){try{if(d(M)){return"undefined"}if(M===null){return"null"}return M.inspect?M.inspect():String(M)}catch(N){if(N instanceof RangeError){return"..."}throw N}}function H(M){return J("",{"":M},[])}function J(V,S,T){var U=S[V],R=typeof U;if(m(U)===L&&typeof U.toJSON==="function"){U=U.toJSON(V)}var O=G.call(U);switch(O){case h:case C:case n:U=U.valueOf()}switch(U){case null:return"null";case true:return"true";case false:return"false"}R=typeof U;switch(R){case"string":return U.inspect(true);case"number":return isFinite(U)?String(U):"null";case"object":for(var N=0,M=T.length;N<M;N++){if(T[N]===U){throw new TypeError()}}T.push(U);var Q=[];if(O===j){for(var N=0,M=U.length;N<M;N++){var P=J(N,U,T);Q.push(typeof P==="undefined"?"null":P)}Q="["+Q.join(",")+"]"}else{var W=Object.keys(U);for(var N=0,M=W.length;N<M;N++){var V=W[N],P=J(V,U,T);if(typeof P!=="undefined"){Q.push(V.inspect(true)+":"+P)}}Q="{"+Q.join(",")+"}"}T.pop();return Q}}function A(M){return JSON.stringify(M)}function l(M){return $H(M).toQueryString()}function s(M){return M&&M.toHTML?M.toHTML():String.interpret(M)}function u(M){if(m(M)!==L){throw new TypeError()}var N=[];for(var O in M){if(M.hasOwnProperty(O)){N.push(O)}}return N}function e(M){var N=[];for(var O in M){N.push(M[O])}return N}function E(M){return D({},M)}function x(M){return !!(M&&M.nodeType==1)}function o(M){return G.call(M)===j}var b=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(b){o=Array.isArray}function f(M){return M instanceof Hash}function a(M){return G.call(M)===w}function p(M){return G.call(M)===n}function t(M){return G.call(M)===h}function I(M){return G.call(M)===B}function d(M){return typeof M==="undefined"}D(Object,{extend:D,inspect:K,toJSON:k?A:H,toQueryString:l,toHTML:s,keys:Object.keys||u,values:e,clone:E,isElement:x,isArray:o,isHash:f,isFunction:a,isString:p,isNumber:t,isDate:I,isUndefined:d})})();Object.extend(Function.prototype,(function(){var m=Array.prototype.slice;function e(q,n){var p=q.length,o=n.length;while(o--){q[p+o]=n[o]}return q}function k(o,n){o=m.call(o,0);return e(o,n)}function h(){var n=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return n.length==1&&!n[0]?[]:n}function j(p){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var n=this,o=m.call(arguments,1);return function(){var q=k(o,arguments);return n.apply(p,q)}}function g(p){var n=this,o=m.call(arguments,1);return function(s){var q=e([s||window.event],o);return n.apply(p,q)}}function l(){if(!arguments.length){return this}var n=this,o=m.call(arguments,0);return function(){var p=k(o,arguments);return n.apply(this,p)}}function f(p){var n=this,o=m.call(arguments,1);p=p*1000;return window.setTimeout(function(){return n.apply(n,o)},p)}function a(){var n=e([0.01],arguments);return this.delay.apply(this,n)}function d(o){var n=this;return function(){var p=e([n.bind(this)],arguments);return o.apply(this,p)}}function b(){if(this._methodized){return this._methodized}var n=this;return this._methodized=function(){var o=e([this],arguments);return n.apply(null,o)}}return{argumentNames:h,bind:j,bindAsEventListener:g,curry:l,delay:f,defer:a,wrap:d,methodize:b}})());(function(d){function b(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"}function a(){return this.toISOString()}if(!d.toISOString){d.toISOString=b}if(!d.toJSON){d.toJSON=a}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(e){if(a==null){return(e[1]+"")}var g=e[1]||"";if(g=="\\"){return e[2]}var b=a,h=e[3],f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;e=f.exec(h);if(e==null){return g}while(e!=null){var d=e[1].startsWith("[")?e[2].replace(/\\\\]/g,"]"):e[1];b=b[d];if(null==b||""==e[3]){break}h=h.substring("["==e[3]?e[1].length:e[0].length);e=f.exec(h)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function d(C,B){var A=0;try{this._each(function(E){C.call(B,E,A++)})}catch(D){if(D!=$break){throw D}}return this}function u(D,C,B){var A=-D,E=[],F=this.toArray();if(D<1){return F}while((A+=D)<F.length){E.push(F.slice(A,A+D))}return E.collect(C,B)}function b(C,B){C=C||Prototype.K;var A=true;this.each(function(E,D){A=A&&!!C.call(B,E,D);if(!A){throw $break}});return A}function k(C,B){C=C||Prototype.K;var A=false;this.each(function(E,D){if(A=!!C.call(B,E,D)){throw $break}});return A}function l(C,B){C=C||Prototype.K;var A=[];this.each(function(E,D){A.push(C.call(B,E,D))});return A}function w(C,B){var A;this.each(function(E,D){if(C.call(B,E,D)){A=E;throw $break}});return A}function j(C,B){var A=[];this.each(function(E,D){if(C.call(B,E,D)){A.push(E)}});return A}function h(D,C,B){C=C||Prototype.K;var A=[];if(Object.isString(D)){D=new RegExp(RegExp.escape(D))}this.each(function(F,E){if(D.match(F)){A.push(C.call(B,F,E))}});return A}function a(A){if(Object.isFunction(this.indexOf)){if(this.indexOf(A)!=-1){return true}}var B=false;this.each(function(C){if(C==A){B=true;throw $break}});return B}function t(B,A){A=Object.isUndefined(A)?null:A;return this.eachSlice(B,function(C){while(C.length<B){C.push(A)}return C})}function n(A,C,B){this.each(function(E,D){A=C.call(B,A,E,D)});return A}function z(B){var A=$A(arguments).slice(1);return this.map(function(C){return C[B].apply(C,A)})}function s(C,B){C=C||Prototype.K;var A;this.each(function(E,D){E=C.call(B,E,D);if(A==null||E>=A){A=E}});return A}function p(C,B){C=C||Prototype.K;var A;this.each(function(E,D){E=C.call(B,E,D);if(A==null||E<A){A=E}});return A}function f(D,B){D=D||Prototype.K;var C=[],A=[];this.each(function(F,E){(D.call(B,F,E)?C:A).push(F)});return[C,A]}function g(B){var A=[];this.each(function(C){A.push(C[B])});return A}function e(C,B){var A=[];this.each(function(E,D){if(!C.call(B,E,D)){A.push(E)}});return A}function o(B,A){return this.map(function(D,C){return{value:D,criteria:B.call(A,D,C)}}).sort(function(F,E){var D=F.criteria,C=E.criteria;return D<C?-1:D>C?1:0}).pluck("value")}function q(){return this.map()}function v(){var B=Prototype.K,A=$A(arguments);if(Object.isFunction(A.last())){B=A.pop()}var C=[this].concat(A).map($A);return this.map(function(E,D){return B(C.pluck(D))})}function m(){return this.toArray().length}function x(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:d,eachSlice:u,all:b,every:b,any:k,some:k,collect:l,map:l,detect:w,findAll:j,select:j,filter:j,grep:h,include:a,member:a,inGroupsOf:t,inject:n,invoke:z,max:s,min:p,partition:f,pluck:g,reject:e,sortBy:o,toArray:q,entries:q,zip:v,size:m,inspect:x,find:w}})();function $A(d){if(!d){return[]}if("toArray" in Object(d)){return d.toArray()}var b=d.length||0,a=new Array(b);while(b--){a[b]=d[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var u=Array.prototype,o=u.slice,q=u.forEach;function b(A,z){for(var x=0,B=this.length>>>0;x<B;x++){if(x in this){A.call(z,this[x],x,this)}}}if(!q){q=b}function n(){this.length=0;return this}function e(){return this[0]}function h(){return this[this.length-1]}function k(){return this.select(function(x){return x!=null})}function w(){return this.inject([],function(z,x){if(Object.isArray(x)){return z.concat(x.flatten())}z.push(x);return z})}function j(){var x=o.call(arguments,0);return this.select(function(z){return !x.include(z)})}function g(x){return(x===false?this.toArray():this)._reverse()}function m(x){return this.inject([],function(B,A,z){if(0==z||(x?B.last()!=A:!B.include(A))){B.push(A)}return B})}function s(x){return this.uniq().findAll(function(z){return x.detect(function(A){return z===A})})}function t(){return o.call(this,0)}function l(){return this.length}function v(){return"["+this.map(Object.inspect).join(", ")+"]"}function a(A,x){x||(x=0);var z=this.length;if(x<0){x=z+x}for(;x<z;x++){if(this[x]===A){return x}}return -1}function p(z,x){x=isNaN(x)?this.length:(x<0?this.length+x:x)+1;var A=this.slice(0,x).reverse().indexOf(z);return(A<0)?A:x-A-1}function d(){var D=o.call(this,0),B;for(var z=0,A=arguments.length;z<A;z++){B=arguments[z];if(Object.isArray(B)&&!("callee" in B)){for(var x=0,C=B.length;x<C;x++){D.push(B[x])}}else{D.push(B)}}return D}Object.extend(u,Enumerable);if(!u._reverse){u._reverse=u.reverse}Object.extend(u,{_each:q,clear:n,first:e,last:h,compact:k,flatten:w,without:j,reverse:g,uniq:m,intersect:s,clone:t,toArray:t,size:l,inspect:v});var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){u.concat=d}if(!u.indexOf){u.indexOf=a}if(!u.lastIndexOf){u.lastIndexOf=p}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function f(s){this._object=Object.isHash(s)?s.toObject():Object.clone(s)}function g(t){for(var s in this._object){var u=this._object[s],v=[s,u];v.key=s;v.value=u;t(v)}}function l(s,t){return this._object[s]=t}function d(s){if(this._object[s]!==Object.prototype[s]){return this._object[s]}}function o(s){var t=this._object[s];delete this._object[s];return t}function q(){return Object.clone(this._object)}function p(){return this.pluck("key")}function n(){return this.pluck("value")}function h(t){var s=this.detect(function(u){return u.value===t});return s&&s.key}function k(s){return this.clone().update(s)}function e(s){return new Hash(s).inject(this,function(t,u){t.set(u.key,u.value);return t})}function b(s,t){if(Object.isUndefined(t)){return s}return s+"="+encodeURIComponent(String.interpret(t))}function a(){return this.inject([],function(w,A){var v=encodeURIComponent(A.key),t=A.value;if(t&&typeof t=="object"){if(Object.isArray(t)){var z=[];for(var u=0,s=t.length,x;u<s;u++){x=t[u];z.push(b(v,x))}return w.concat(z)}}else{w.push(b(v,t))}return w}).join("&")}function m(){return"#<Hash:{"+this.map(function(s){return s.map(Object.inspect).join(": ")}).join(", ")+"}>"}function j(){return new Hash(this)}return{initialize:f,_each:g,set:l,get:d,unset:o,toObject:q,toTemplateReplacements:q,keys:p,values:n,index:h,merge:k,update:e,toQueryString:a,inspect:m,toJSON:q,clone:j}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function e(){return this.toPaddedString(2,16)}function b(){return this+1}function j(l,k){$R(0,this,true).each(l,k);return this}function h(m,l){var k=this.toString(l||10);return"0".times(m-k.length)+k}function a(){return Math.abs(this)}function d(){return Math.round(this)}function f(){return Math.ceil(this)}function g(){return Math.floor(this)}return{toColorPart:e,succ:b,times:j,toPaddedString:h,abs:a,round:d,ceil:f,floor:g}})());function $R(d,a,b){return new ObjectRange(d,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,e,f){this.start=g;this.end=e;this.exclusive=f}function d(e){var f=this.start;while(this.include(f)){e(f);f=f.succ()}}function a(e){if(e<this.start){return false}if(this.exclusive){return e<this.end}return e<=this.end}return{initialize:b,_each:d,include:a}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(e,b,d,a){this.each(function(f){if(Object.isFunction(f[e])){try{f[e].apply(f,[b,d,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function(b,a){Ajax.Base.prototype.initialize.apply(this,[a]);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var f=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){f+=(f?"&":"")+"_method="+this.method;this.method="post"}if(f&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+f}this.parameters=f.toQueryParams();try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||f):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};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(Object.isFunction(d.push)){for(var b=0,e=d.length;b<e;b+=2){f[d[b]]=d[b+1]}}else{$H(d).each(function(g){f[g.key]=g.value})}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var d=Ajax.Request.Events[a],b=new Ajax.Response(this);if(d=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(f){this.dispatchException(f)}var g=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&g&&g.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+d]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+d,this,b,b.headerJSON)}catch(f){this.dispatchException(f)}if(d=="Complete"){this.transport.onreadystatechange=null}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(d){this.request=d;var e=this.transport=d.transport,a=this.readyState=e.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(e.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=e.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function(a,d,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};b=Object.clone(b);var e=b.onComplete;b.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(e)){e(f,g)}}).bind(this);Ajax.Request.prototype.initialize.apply(this,[d,b])},updateContent:function(e){var d=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){e=e.stripScripts()}if(d=$(d)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=e;d.insert(b)}else{a.insertion(d,e)}}else{d.update(e)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function(a,d,b){Ajax.Base.prototype.initialize.apply(this,[b]);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=d;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(b){if(arguments.length>1){for(var a=0,e=[],d=arguments.length;a<d;a++){e.push($(arguments[a]))}return e}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var d=[];var f=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,e=f.snapshotLength;b<e;b++){d.push(Element.extend(f.snapshotItem(b)))}return d}}if(!Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(d){function e(g,f){if(g==="select"){return false}if("type" in f){return false}return true}var b=(function(){try{var f=document.createElement('<input name="x">');return f.tagName.toLowerCase()==="input"&&f.name==="x"}catch(g){return false}})();var a=d.Element;d.Element=function(h,g){g=g||{};h=h.toLowerCase();var f=Element.cache;if(b&&g.name){h="<"+h+' name="'+g.name+'">';delete g.name;return Element.writeAttribute(document.createElement(h),g)}if(!f[h]){f[h]=Element.extend(document.createElement(h))}var j=e(h,g)?f[h].cloneNode(false):document.createElement(h);return Element.writeAttribute(j,g)};Object.extend(d.Element,a||{});if(a){d.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var a=b._prototypeUID;if(a){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[a]}};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var e=(function(){var h=document.createElement("select"),j=true;h.innerHTML='<option value="test">test</option>';if(h.options&&h.options[0]){j=h.options[0].nodeName.toUpperCase()!=="OPTION"}h=null;return j})();var b=(function(){try{var h=document.createElement("table");if(h&&h.tBodies){h.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var k=typeof h.tBodies[0]=="undefined";h=null;return k}}catch(j){return true}})();var a=(function(){try{var h=document.createElement("div");h.innerHTML="<link>";var k=(h.childNodes.length===0);h=null;return k}catch(j){return true}})();var d=e||b||a;var g=(function(){var h=document.createElement("script"),k=false;try{h.appendChild(document.createTextNode(""));k=!h.firstChild||h.firstChild&&h.firstChild.nodeType!==3}catch(j){k=true}h=null;return k})();function f(m,n){m=$(m);var h=Element._purgeElement;var o=m.getElementsByTagName("*"),l=o.length;while(l--){h(o[l])}if(n&&n.toElement){n=n.toElement()}if(Object.isElement(n)){return m.update().insert(n)}n=Object.toHTML(n);var k=m.tagName.toUpperCase();if(k==="SCRIPT"&&g){m.text=n;return m}if(d){if(k in Element._insertionTranslations.tags){while(m.firstChild){m.removeChild(m.firstChild)}Element._getContentFromAnonymousElement(k,n.stripScripts()).each(function(p){m.appendChild(p)})}else{if(a&&Object.isString(n)&&n.indexOf("<link")>-1){while(m.firstChild){m.removeChild(m.firstChild)}var j=Element._getContentFromAnonymousElement(k,n.stripScripts(),true);j.each(function(p){m.appendChild(p)})}else{m.innerHTML=n.stripScripts()}}}else{m.innerHTML=n.stripScripts()}n.evalScripts.bind(n).defer();return m}return f})(),replace:function(b,d){b=$(b);if(d&&d.toElement){d=d.toElement()}else{if(!Object.isElement(d)){d=Object.toHTML(d);var a=b.ownerDocument.createRange();a.selectNode(b);d.evalScripts.bind(d).defer();d=a.createContextualFragment(d.stripScripts())}}b.parentNode.replaceChild(d,b);return b},insert:function(d,f){d=$(d);if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}}var e,g,b,h;for(var a in f){e=f[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){g(d,e);continue}e=Object.toHTML(e);b=((a=="before"||a=="after")?d.parentNode:d).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,e.stripScripts());if(a=="top"||a=="after"){h.reverse()}h.each(g.curry(d));e.evalScripts.bind(e).defer()}return d},wrap:function(b,d,a){b=$(b);if(Object.isElement(d)){$(d).writeAttribute(a||{})}else{if(Object.isString(d)){d=new Element(d,a)}else{d=new Element("div",d)}}if(b.parentNode){b.parentNode.replaceChild(d,b)}d.appendChild(b);return d},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),d=g.last(),e=(b[f]||"").toString();if(e){a+=" "+d+"="+e.inspect(true)}});return a+">"},recursivelyCollect:function(a,d,e){a=$(a);e=e||-1;var b=[];while(a=a[d]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==e){break}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(b){var a=[],d=$(b).firstChild;while(d){if(d.nodeType===1){a.push(Element.extend(d))}d=d.nextSibling}return a},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){b=$(b);if(Object.isString(a)){return Prototype.Selector.match(b,a)}return a.match(b)},up:function(b,e,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var d=Element.ancestors(b);return Object.isNumber(e)?d[e]:Prototype.Selector.find(d,e,a)},down:function(b,d,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(d)?Element.descendants(b)[d]:Element.select(b,d)[a||0]},previous:function(b,d,a){b=$(b);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.previousSiblings(),d,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,e,a){b=$(b);if(Object.isNumber(e)){a=e,e=false}if(!Object.isNumber(a)){a=0}if(e){return Prototype.Selector.find(b.nextSiblings(),e,a)}else{var d=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(d,a){d=$(d);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](d,a)}if(b.names[a]){a=b.names[a]}if(a.include(":")){return(!d.attributes||!d.attributes[a])?null:d.attributes[a].value}}return d.getAttribute(a)},writeAttribute:function(f,d,g){f=$(f);var b={},e=Element._attributeTranslations.write;if(typeof d=="object"){b=d}else{b[d]=Object.isUndefined(g)?true:g}for(var a in b){d=e.names[a]||a;g=b[a];if(e.values[a]){d=e.values[a](f,g)}if(g===false||g===null){f.removeAttribute(d)}else{if(g===true){f.setAttribute(d,d)}else{f.setAttribute(d,g)}}}return f},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var d=a.className;return(d.length>0&&(d==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(d)))},addClassName:function(a,b){if(!(a=$(a))){return}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var d=b.firstChild;while(d){var a=d.nextSibling;if(d.nodeType==3&&!/\S/.test(d.nodeValue)){b.removeChild(d)}d=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,d){b=$(b);d=d=="float"?"cssFloat":d.camelize();var e=b.style[d];if(!e||e=="auto"){var a=document.defaultView.getComputedStyle(b,null);e=a?a[d]:null}if(d=="opacity"){return e?parseFloat(e):1}return e=="auto"?null:e},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,d){b=$(b);var f=b.style,a;if(Object.isString(d)){b.style.cssText+=";"+d;return d.include("opacity")?b.setOpacity(d.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var e in d){if(e=="opacity"){b.setOpacity(d[e])}else{f[(e=="float"||e=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):e]=d[e]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(b,e){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});e=$(e);var f=Element.viewportOffset(e),g=[0,0],d=null;b=$(b);if(Element.getStyle(b,"position")=="absolute"){d=Element.getOffsetParent(b);g=Element.viewportOffset(d)}if(d==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=e.offsetWidth+"px"}if(a.setHeight){b.style.height=e.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(e,b,d){switch(d){case"height":case"width":if(!Element.visible(b)){return null}var f=parseInt(e(b,d),10);if(f!==b["offset"+d.capitalize()]){return f+"px"}var a;if(d==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(f,function(g,h){var j=e(b,h);return j===null?g:g-parseInt(j,10)})+"px";default:return e(b,d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(d,a,b){if(b==="title"){return a.title}return d(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var d=a.style[b];if(!d&&a.currentStyle){d=a.currentStyle[b]}if(b=="opacity"){if(d=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(d[1]){return parseFloat(d[1])/100}}return 1}if(d=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return d};Element.Methods.setOpacity=function(b,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var e=b.getStyle("filter"),d=b.style;if(f==1||f===""){(e=g(e))?d.filter=e:d.removeAttribute("filter");return b}else{if(f<0.00001){f=0}}d.filter=g(e)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var b="className",a="for",d=document.createElement("div");d.setAttribute(b,"x");if(d.className!=="x"){d.setAttribute("class","x");if(d.className==="x"){b="class"}}d=null;d=document.createElement("label");d.setAttribute(a,"x");if(d.htmlFor!=="x"){d.setAttribute("htmlFor","x");if(d.htmlFor==="x"){a="htmlFor"}}d=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(e,f){return e.getAttribute(f)},_getAttr2:function(e,f){return e.getAttribute(f,2)},_getAttrNode:function(e,g){var f=e.getAttributeNode(g);return f?f.value:""},_getEv:(function(){var e=document.createElement("div"),h;e.onclick=Prototype.emptyFunction;var g=e.getAttribute("onclick");if(String(g).indexOf("{")>-1){h=function(f,j){j=f.getAttribute(j);if(!j){return null}j=j.toString();j=j.split("{")[1];j=j.split("}")[0];return j.strip()}}else{if(g===""){h=function(f,j){j=f.getAttribute(j);if(!j){return null}return j.strip()}}}e=null;return h})(),_flag:function(e,f){return $(e).hasAttribute(f)?f:null},style:function(e){return e.style.cssText.toLowerCase()},title:function(e){return e.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),e=[];for(var d=0,g;g=b[d];d++){if(g.tagName!=="!"){e.push(g)}}return e}Element.Methods.down=function(d,e,b){d=$(d);if(arguments.length==1){return d.firstDescendant()}return Object.isNumber(e)?a(d)[e]:Element.select(d,e)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var f=document.createTextNode(" ");a.appendChild(f);a.removeChild(f)}catch(d){}}}return a}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(d,f){d=$(d);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){d.parentNode.replaceChild(f,d);return d}f=Object.toHTML(f);var e=d.parentNode,b=e.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var g=d.next(),a=Element._getContentFromAnonymousElement(b,f.stripScripts());e.removeChild(d);if(g){a.each(function(h){e.insertBefore(h,g)})}else{a.each(function(h){e.appendChild(h)})}}else{d.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return d}}Element._returnOffset=function(b,d){var a=[b,d];a.left=b;a.top=d;return a};Element._getContentFromAnonymousElement=function(f,e,g){var h=new Element("div"),d=Element._insertionTranslations.tags[f];var a=false;if(d){a=true}else{if(g){a=true;d=["","",0]}}if(a){h.innerHTML="&nbsp;"+d[0]+e+d[1];h.removeChild(h.firstChild);for(var b=d[2];b--;){h=h.firstChild}}else{h.innerHTML=e}return $A(h.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,d){d=Element._attributeTranslations.has[d]||d;var b=$(a).getAttributeNode(d);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function d(h){if(typeof window.Element!="undefined"){var k=window.Element.prototype;if(k){var m="_"+(Math.random()+"").slice(2),j=document.createElement(h);k[m]="x";var l=(j[m]!=="x");delete k[m];j=null;return l}}return false}function b(j,h){for(var l in h){var k=h[l];if(Object.isFunction(k)&&!(l in j)){j[l]=k.methodize()}}}var e=d("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(e){return function(j){if(j&&typeof j._extendedByPrototype=="undefined"){var h=j.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(j,Element.Methods);b(j,Element.Methods.Simulated);b(j,Element.Methods.ByTag[h.toUpperCase()])}}return j}}return Prototype.K}var a={},f=Element.Methods.ByTag;var g=Object.extend(function(k){if(!k||typeof k._extendedByPrototype!="undefined"||k.nodeType!=1||k==window){return k}var h=Object.clone(a),j=k.tagName.toUpperCase();if(f[j]){Object.extend(h,f[j])}b(k,h);k._extendedByPrototype=Prototype.emptyFunction;return k},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});g.refresh();return g})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(d){var k=Prototype.BrowserFeatures,e=Element.Methods.ByTag;if(!d){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var b=d;d=arguments[1]}if(!b){Object.extend(Element.Methods,d||{})}else{if(Object.isArray(b)){b.each(h)}else{h(b)}}function h(m){m=m.toUpperCase();if(!Element.Methods.ByTag[m]){Element.Methods.ByTag[m]={}}Object.extend(Element.Methods.ByTag[m],d)}function a(o,n,m){m=m||false;for(var q in o){var p=o[q];if(!Object.isFunction(p)){continue}if(!m||!(q in n)){n[q]=p.methodize()}}}function f(p){var m;var o={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};if(o[p]){m="HTML"+o[p]+"Element"}if(window[m]){return window[m]}m="HTML"+p+"Element";if(window[m]){return window[m]}m="HTML"+p.capitalize()+"Element";if(window[m]){return window[m]}var n=document.createElement(p),q=n.__proto__||n.constructor.prototype;n=null;return q}var j=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(k.ElementExtensions){a(Element.Methods,j);a(Element.Methods.Simulated,j,true)}if(k.SpecificElementExtensions){for(var l in Element.Methods.ByTag){var g=f(l);if(Object.isUndefined(g)){continue}a(e[l],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};(function(b){var h=Prototype.Browser,f=document,d,e={};function a(){if(h.WebKit&&!f.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(j){if(!d){d=a()}e[j]="client"+j;b["get"+j]=function(){return d[e[j]]};return b["get"+j]()}b.getWidth=g.curry("Width");b.getHeight=g.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=Element.Storage.UID++}a=b._prototypeUID}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,d){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,d)}return b},retrieve:function(d,b,a){if(!(d=$(d))){return}var f=Element.getStorage(d),e=f.get(b);if(Object.isUndefined(e)){f.set(b,a);e=a}return e},clone:function(d,a){if(!(d=$(d))){return}var f=d.cloneNode(a);f._prototypeUID=void 0;if(a){var e=Element.select(f,"*"),b=e.length;while(b--){e[b]._prototypeUID=void 0}}return Element.extend(f)},purge:function(d){if(!(d=$(d))){return}var a=Element._purgeElement;a(d);var e=d.getElementsByTagName("*"),b=e.length;while(b--){a(e[b])}return null}});(function(){function j(z){var x=z.match(/^(\d+)%?$/i);if(!x){return null}return(Number(x[1])/100)}function q(J,K,z){var C=null;if(Object.isElement(J)){C=J;J=C.getStyle(K)}if(J===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(J)){return window.parseFloat(J)}var E=J.include("%"),A=(z===document.viewport);if(/\d/.test(J)&&C&&C.runtimeStyle&&!(E&&A)){var x=C.style.left,I=C.runtimeStyle.left;C.runtimeStyle.left=C.currentStyle.left;C.style.left=J||0;J=C.style.pixelLeft;C.style.left=x;C.runtimeStyle.left=I;return J}if(C&&E){z=z||C.parentNode;var B=j(J);var F=null;var D=C.getStyle("position");var H=K.include("left")||K.include("right")||K.include("width");var G=K.include("top")||K.include("bottom")||K.include("height");if(z===document.viewport){if(H){F=document.viewport.getWidth()}else{if(G){F=document.viewport.getHeight()}}}else{if(H){F=$(z).measure("width")}else{if(G){F=$(z).measure("height")}}}return(F===null)?0:F*B}return 0}function h(x){if(Object.isString(x)&&x.endsWith("px")){return x}return x+"px"}function l(z){var x=z;while(z&&z.parentNode){var A=z.getStyle("display");if(A==="none"){return false}z=$(z.parentNode)}return true}var e=Prototype.K;if("currentStyle" in document.documentElement){e=function(x){if(!x.currentStyle.hasLayout){x.style.zoom=1}return x}}function g(x){if(x.include("border")){x=x+"-width"}return x.camelize()}Element.Layout=Class.create(Hash,{initialize:function(z,x){Hash.prototype.initialize.apply(this);this.element=$(z);Element.Layout.PROPERTIES.each(function(A){this._set(A,null)},this);if(x){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(z,x){return Hash.prototype.set.call(this,z,x)},set:function(z,x){throw"Properties of Element.Layout are read-only."},get:function(z){var x=Hash.prototype.get.apply(this,[z]);return x===null?this._compute(z):x},_begin:function(){if(this._prepared){return}var C=this.element;if(l(C)){this._prepared=true;return}var E={position:C.style.position||"",width:C.style.width||"",visibility:C.style.visibility||"",display:C.style.display||""};C.store("prototype_original_styles",E);var F=C.getStyle("position"),x=C.getStyle("width");if(x==="0px"||x===null){C.style.display="block";x=C.getStyle("width")}var z=(F==="fixed")?document.viewport:C.parentNode;C.setStyle({position:"absolute",visibility:"hidden",display:"block"});var A=C.getStyle("width");var B;if(x&&(A===x)){B=q(C,"width",z)}else{if(F==="absolute"||F==="fixed"){B=q(C,"width",z)}else{var G=C.parentNode,D=$(G).getLayout();B=D.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}C.setStyle({width:B+"px"});this._prepared=true},_end:function(){var z=this.element;var x=z.retrieve("prototype_original_styles");z.store("prototype_original_styles",null);z.setStyle(x);this._prepared=false},_compute:function(z){var x=Element.Layout.COMPUTATIONS;if(!(z in x)){throw"Property not found."}return this._set(z,x[z].call(this,this.element))},toObject:function(){var x=$A(arguments);var z=(x.length===0)?Element.Layout.PROPERTIES:x.join(" ").split(" ");var A={};z.each(function(B){if(!Element.Layout.PROPERTIES.include(B)){return}var C=this.get(B);if(C!=null){A[B]=C}},this);return A},toHash:function(){var x=this.toObject.apply(this,arguments);return new Hash(x)},toCSS:function(){var x=$A(arguments);var A=(x.length===0)?Element.Layout.PROPERTIES:x.join(" ").split(" ");var z={};A.each(function(B){if(!Element.Layout.PROPERTIES.include(B)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(B)){return}var C=this.get(B);if(C!=null){z[g(B)]=C+"px"}},this);return z},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(A){if(!this._preComputing){this._begin()}var x=this.get("border-box-height");if(x<=0){if(!this._preComputing){this._end()}return 0}var B=this.get("border-top"),z=this.get("border-bottom");var D=this.get("padding-top"),C=this.get("padding-bottom");if(!this._preComputing){this._end()}return x-B-z-D-C},width:function(A){if(!this._preComputing){this._begin()}var z=this.get("border-box-width");if(z<=0){if(!this._preComputing){this._end()}return 0}var D=this.get("border-left"),x=this.get("border-right");var B=this.get("padding-left"),C=this.get("padding-right");if(!this._preComputing){this._end()}return z-D-x-B-C},"padding-box-height":function(z){var x=this.get("height"),B=this.get("padding-top"),A=this.get("padding-bottom");return x+B+A},"padding-box-width":function(x){var z=this.get("width"),A=this.get("padding-left"),B=this.get("padding-right");return z+A+B},"border-box-height":function(z){if(!this._preComputing){this._begin()}var x=z.offsetHeight;if(!this._preComputing){this._end()}return x},"border-box-width":function(x){if(!this._preComputing){this._begin()}var z=x.offsetWidth;if(!this._preComputing){this._end()}return z},"margin-box-height":function(z){var x=this.get("border-box-height"),A=this.get("margin-top"),B=this.get("margin-bottom");if(x<=0){return 0}return x+A+B},"margin-box-width":function(A){var z=this.get("border-box-width"),B=this.get("margin-left"),x=this.get("margin-right");if(z<=0){return 0}return z+B+x},top:function(x){var z=x.positionedOffset();return z.top},bottom:function(x){var B=x.positionedOffset(),z=x.getOffsetParent(),A=z.measure("height");var C=this.get("border-box-height");return A-C-B.top},left:function(x){var z=x.positionedOffset();return z.left},right:function(A){var C=A.positionedOffset(),B=A.getOffsetParent(),x=B.measure("width");var z=this.get("border-box-width");return x-z-C.left},"padding-top":function(x){return q(x,"paddingTop")},"padding-bottom":function(x){return q(x,"paddingBottom")},"padding-left":function(x){return q(x,"paddingLeft")},"padding-right":function(x){return q(x,"paddingRight")},"border-top":function(x){return q(x,"borderTopWidth")},"border-bottom":function(x){return q(x,"borderBottomWidth")},"border-left":function(x){return q(x,"borderLeftWidth")},"border-right":function(x){return q(x,"borderRightWidth")},"margin-top":function(x){return q(x,"marginTop")},"margin-bottom":function(x){return q(x,"marginBottom")},"margin-left":function(x){return q(x,"marginLeft")},"margin-right":function(x){return q(x,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(z){var A=e(z.getOffsetParent());var B=z.getBoundingClientRect(),x=A.getBoundingClientRect();return(x.right-B.right).round()},bottom:function(z){var A=e(z.getOffsetParent());var B=z.getBoundingClientRect(),x=A.getBoundingClientRect();return(x.bottom-B.bottom).round()}})}Element.Offset=Class.create({initialize:function(z,x){this.left=z.round();this.top=x.round();this[0]=this.left;this[1]=this.top},relativeTo:function(x){return new Element.Offset(this.left-x.left,this.top-x.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function u(z,x){return new Element.Layout(z,x)}function b(x,z){return $(x).getLayout().get(z)}function p(z){z=$(z);var D=Element.getStyle(z,"display");if(D&&D!=="none"){return{width:z.offsetWidth,height:z.offsetHeight}}var A=z.style;var x={visibility:A.visibility,position:A.position,display:A.display};var C={visibility:"hidden",display:"block"};if(x.position!=="fixed"){C.position="absolute"}Element.setStyle(z,C);var B={width:z.offsetWidth,height:z.offsetHeight};Element.setStyle(z,x);return B}function n(x){x=$(x);if(f(x)||d(x)||o(x)||m(x)){return $(document.body)}var z=(Element.getStyle(x,"display")==="inline");if(!z&&x.offsetParent){return $(x.offsetParent)}while((x=x.parentNode)&&x!==document.body){if(Element.getStyle(x,"position")!=="static"){return m(x)?$(document.body):$(x)}}return $(document.body)}function w(z){z=$(z);var x=0,A=0;if(z.parentNode){do{x+=z.offsetTop||0;A+=z.offsetLeft||0;z=z.offsetParent}while(z)}return new Element.Offset(A,x)}function s(z){z=$(z);var A=z.getLayout();var x=0,C=0;do{x+=z.offsetTop||0;C+=z.offsetLeft||0;z=z.offsetParent;if(z){if(o(z)){break}var B=Element.getStyle(z,"position");if(B!=="static"){break}}}while(z);C-=A.get("margin-top");x-=A.get("margin-left");return new Element.Offset(C,x)}function a(z){var x=0,A=0;do{x+=z.scrollTop||0;A+=z.scrollLeft||0;z=z.parentNode}while(z);return new Element.Offset(A,x)}function v(C){z=$(z);var x=0,B=0,A=document.body;var z=C;do{x+=z.offsetTop||0;B+=z.offsetLeft||0;if(z.offsetParent==A&&Element.getStyle(z,"position")=="absolute"){break}}while(z=z.offsetParent);z=C;do{if(z!=A){x-=z.scrollTop||0;B-=z.scrollLeft||0}}while(z=z.parentNode);return new Element.Offset(B,x)}function t(x){x=$(x);if(Element.getStyle(x,"position")==="absolute"){return x}var C=n(x);var B=x.viewportOffset(),z=C.viewportOffset();var D=B.relativeTo(z);var A=x.getLayout();x.store("prototype_absolutize_original_styles",{left:x.getStyle("left"),top:x.getStyle("top"),width:x.getStyle("width"),height:x.getStyle("height")});x.setStyle({position:"absolute",top:D.top+"px",left:D.left+"px",width:A.get("width")+"px",height:A.get("height")+"px"});return x}function k(z){z=$(z);if(Element.getStyle(z,"position")==="relative"){return z}var x=z.retrieve("prototype_absolutize_original_styles");if(x){z.setStyle(x)}return z}if(Prototype.Browser.IE){n=n.wrap(function(A,z){z=$(z);if(f(z)||d(z)||o(z)||m(z)){return $(document.body)}var x=z.getStyle("position");if(x!=="static"){return A(z)}z.setStyle({position:"relative"});var B=A(z);z.setStyle({position:x});return B});s=s.wrap(function(B,z){z=$(z);if(!z.parentNode){return new Element.Offset(0,0)}var x=z.getStyle("position");if(x!=="static"){return B(z)}var A=z.getOffsetParent();if(A&&A.getStyle("position")==="fixed"){e(A)}z.setStyle({position:"relative"});var C=B(z);z.setStyle({position:x});return C})}else{if(Prototype.Browser.Webkit){w=function(z){z=$(z);var x=0,A=0;do{x+=z.offsetTop||0;A+=z.offsetLeft||0;if(z.offsetParent==document.body){if(Element.getStyle(z,"position")=="absolute"){break}}z=z.offsetParent}while(z);return new Element.Offset(A,x)}}}Element.addMethods({getLayout:u,measure:b,getDimensions:p,getOffsetParent:n,cumulativeOffset:w,positionedOffset:s,cumulativeScrollOffset:a,viewportOffset:v,absolutize:t,relativize:k});function o(x){return x.nodeName.toUpperCase()==="BODY"}function m(x){return x.nodeName.toUpperCase()==="HTML"}function f(x){return x.nodeType===Node.DOCUMENT_NODE}function d(x){return x!==document.body&&!Element.descendantOf(x,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(x){x=$(x);if(d(x)){return new Element.Offset(0,0)}var z=x.getBoundingClientRect(),A=document.documentElement;return new Element.Offset(z.left-A.clientLeft,z.top-A.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function d(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function e(m,n,j){j=j||0;var h=Prototype.Selector.match,l=m.length,g=0,k;for(k=0;k<l;k++){if(h(m[k],n)&&j==g++){return Element.extend(m[k])}}}function f(j){for(var g=0,h=j.length;g<h;g++){Element.extend(j[g])}return j}var b=Prototype.K;return{select:a,match:d,find:e,extendElements:(Element.extend===b)?b:f,extendElement:Element.extend}})();Prototype._original_property=window.Sizzle;
/*!
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var t=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,l=0,f=Object.prototype.toString,q=false,k=true;[0,0].sort(function(){k=false;return 0});var b=function(I,x,F,A){F=F||[];var e=x=x||document;if(x.nodeType!==1&&x.nodeType!==9){return[]}if(!I||typeof I!=="string"){return F}var G=[],H,D,M,L,E,w,v=true,B=s(x),K=I;while((t.exec(""),H=t.exec(K))!==null){K=H[3];G.push(H[1]);if(H[2]){w=H[3];break}}if(G.length>1&&m.exec(I)){if(G.length===2&&g.relative[G[0]]){D=h(G[0]+G[1],x)}else{D=g.relative[G[0]]?[x]:b(G.shift(),x);while(G.length){I=G.shift();if(g.relative[I]){I+=G.shift()}D=h(I,D)}}}else{if(!A&&G.length>1&&x.nodeType===9&&!B&&g.match.ID.test(G[0])&&!g.match.ID.test(G[G.length-1])){var N=b.find(G.shift(),x,B);x=N.expr?b.filter(N.expr,N.set)[0]:N.set[0]}if(x){var N=A?{expr:G.pop(),set:a(A)}:b.find(G.pop(),G.length===1&&(G[0]==="~"||G[0]==="+")&&x.parentNode?x.parentNode:x,B);D=N.expr?b.filter(N.expr,N.set):N.set;if(G.length>0){M=a(D)}else{v=false}while(G.length){var z=G.pop(),C=z;if(!g.relative[z]){z=""}else{C=G.pop()}if(C==null){C=x}g.relative[z](M,C,B)}}else{M=G=[]}}if(!M){M=D}if(!M){throw"Syntax error, unrecognized expression: "+(z||I)}if(f.call(M)==="[object Array]"){if(!v){F.push.apply(F,M)}else{if(x&&x.nodeType===1){for(var J=0;M[J]!=null;J++){if(M[J]&&(M[J]===true||M[J].nodeType===1&&j(x,M[J]))){F.push(D[J])}}}else{for(var J=0;M[J]!=null;J++){if(M[J]&&M[J].nodeType===1){F.push(D[J])}}}}}else{a(M,F)}if(w){b(w,e,F,A);b.uniqueSort(F)}return F};b.uniqueSort=function(v){if(d){q=k;v.sort(d);if(q){for(var e=1;e<v.length;e++){if(v[e]===v[e-1]){v.splice(e--,1)}}}}return v};b.matches=function(e,v){return b(e,null,null,v)};b.find=function(C,e,D){var B,z;if(!C){return[]}for(var x=0,w=g.order.length;x<w;x++){var A=g.order[x],z;if((z=g.leftMatch[A].exec(C))){var v=z[1];z.splice(1,1);if(v.substr(v.length-1)!=="\\"){z[1]=(z[1]||"").replace(/\\/g,"");B=g.find[A](z,e,D);if(B!=null){C=C.replace(g.match[A],"");break}}}}if(!B){B=e.getElementsByTagName("*")}return{set:B,expr:C}};b.filter=function(F,E,I,x){var w=F,K=[],C=E,A,e,B=E&&E[0]&&s(E[0]);while(F&&E.length){for(var D in g.filter){if((A=g.match[D].exec(F))!=null){var v=g.filter[D],J,H;e=false;if(C==K){K=[]}if(g.preFilter[D]){A=g.preFilter[D](A,C,I,K,x,B);if(!A){e=J=true}else{if(A===true){continue}}}if(A){for(var z=0;(H=C[z])!=null;z++){if(H){J=v(H,A,z,C);var G=x^!!J;if(I&&J!=null){if(G){e=true}else{C[z]=false}}else{if(G){K.push(H);e=true}}}}}if(J!==undefined){if(!I){C=K}F=F.replace(g.match[D],"");if(!e){return[]}break}}}if(F==w){if(e==null){throw"Syntax error, unrecognized expression: "+F}else{break}}w=F}return C};var g=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(C,e,B){var z=typeof e==="string",D=z&&!/\W/.test(e),A=z&&!D;if(D&&!B){e=e.toUpperCase()}for(var x=0,w=C.length,v;x<w;x++){if((v=C[x])){while((v=v.previousSibling)&&v.nodeType!==1){}C[x]=A||v&&v.nodeName===e?v||false:v===e}}if(A){b.filter(e,C,true)}},">":function(B,v,C){var z=typeof v==="string";if(z&&!/\W/.test(v)){v=C?v:v.toUpperCase();for(var w=0,e=B.length;w<e;w++){var A=B[w];if(A){var x=A.parentNode;B[w]=x.nodeName===v?x:false}}}else{for(var w=0,e=B.length;w<e;w++){var A=B[w];if(A){B[w]=z?A.parentNode:A.parentNode===v}}if(z){b.filter(v,B,true)}}},"":function(x,v,A){var w=l++,e=u;if(!/\W/.test(v)){var z=v=A?v:v.toUpperCase();e=p}e("parentNode",v,w,x,z,A)},"~":function(x,v,A){var w=l++,e=u;if(typeof v==="string"&&!/\W/.test(v)){var z=v=A?v:v.toUpperCase();e=p}e("previousSibling",v,w,x,z,A)}},find:{ID:function(v,w,x){if(typeof w.getElementById!=="undefined"&&!x){var e=w.getElementById(v[1]);return e?[e]:[]}},NAME:function(w,A,B){if(typeof A.getElementsByName!=="undefined"){var v=[],z=A.getElementsByName(w[1]);for(var x=0,e=z.length;x<e;x++){if(z[x].getAttribute("name")===w[1]){v.push(z[x])}}return v.length===0?null:v}},TAG:function(e,v){return v.getElementsByTagName(e[1])}},preFilter:{CLASS:function(x,v,w,e,B,C){x=" "+x[1].replace(/\\/g,"")+" ";if(C){return x}for(var z=0,A;(A=v[z])!=null;z++){if(A){if(B^(A.className&&(" "+A.className+" ").indexOf(x)>=0)){if(!w){e.push(A)}}else{if(w){v[z]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(v,e){for(var w=0;e[w]===false;w++){}return e[w]&&s(e[w])?v[1]:v[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var v=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(v[1]+(v[2]||1))-0;e[3]=v[3]-0}e[0]=l++;return e},ATTR:function(z,v,w,e,A,B){var x=z[1].replace(/\\/g,"");if(!B&&g.attrMap[x]){z[1]=g.attrMap[x]}if(z[2]==="~="){z[4]=" "+z[4]+" "}return z},PSEUDO:function(z,v,w,e,A){if(z[1]==="not"){if((t.exec(z[3])||"").length>1||/^\w/.test(z[3])){z[3]=b(z[3],null,null,v)}else{var x=b.filter(z[3],v,w,true^A);if(!w){e.push.apply(e,x)}return false}}else{if(g.match.POS.test(z[0])||g.match.CHILD.test(z[0])){return true}}return z},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(w,v,e){return !!b(e[3],w).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(v,e){return e===0},last:function(w,v,e,x){return v===x.length-1},even:function(v,e){return e%2===0},odd:function(v,e){return e%2===1},lt:function(w,v,e){return v<e[3]-0},gt:function(w,v,e){return v>e[3]-0},nth:function(w,v,e){return e[3]-0==v},eq:function(w,v,e){return e[3]-0==v}},filter:{PSEUDO:function(B,w,x,C){var v=w[1],z=g.filters[v];if(z){return z(B,x,w,C)}else{if(v==="contains"){return(B.textContent||B.innerText||"").indexOf(w[3])>=0}else{if(v==="not"){var A=w[3];for(var x=0,e=A.length;x<e;x++){if(A[x]===B){return false}}return true}}}},CHILD:function(e,x){var B=x[1],v=e;switch(B){case"only":case"first":while((v=v.previousSibling)){if(v.nodeType===1){return false}}if(B=="first"){return true}v=e;case"last":while((v=v.nextSibling)){if(v.nodeType===1){return false}}return true;case"nth":var w=x[2],E=x[3];if(w==1&&E==0){return true}var A=x[0],D=e.parentNode;if(D&&(D.sizcache!==A||!e.nodeIndex)){var z=0;for(v=D.firstChild;v;v=v.nextSibling){if(v.nodeType===1){v.nodeIndex=++z}}D.sizcache=A}var C=e.nodeIndex-E;if(w==0){return C==0}else{return(C%w==0&&C/w>=0)}}},ID:function(v,e){return v.nodeType===1&&v.getAttribute("id")===e},TAG:function(v,e){return(e==="*"&&v.nodeType===1)||v.nodeName===e},CLASS:function(v,e){return(" "+(v.className||v.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(A,x){var w=x[1],e=g.attrHandle[w]?g.attrHandle[w](A):A[w]!=null?A[w]:A.getAttribute(w),B=e+"",z=x[2],v=x[4];return e==null?z==="!=":z==="="?B===v:z==="*="?B.indexOf(v)>=0:z==="~="?(" "+B+" ").indexOf(v)>=0:!v?B&&e!==false:z==="!="?B!=v:z==="^="?B.indexOf(v)===0:z==="$="?B.substr(B.length-v.length)===v:z==="|="?B===v||B.substr(0,v.length+1)===v+"-":false},POS:function(z,v,w,A){var e=v[2],x=g.setFilters[e];if(x){return x(z,w,v,A)}}}};var m=g.match.POS;for(var o in g.match){g.match[o]=new RegExp(g.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source);g.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+g.match[o].source)}var a=function(v,e){v=Array.prototype.slice.call(v,0);if(e){e.push.apply(e,v);return e}return v};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(n){a=function(z,x){var v=x||[];if(f.call(z)==="[object Array]"){Array.prototype.push.apply(v,z)}else{if(typeof z.length==="number"){for(var w=0,e=z.length;w<e;w++){v.push(z[w])}}else{for(var w=0;z[w];w++){v.push(z[w])}}}return v}}var d;if(document.documentElement.compareDocumentPosition){d=function(v,e){if(!v.compareDocumentPosition||!e.compareDocumentPosition){if(v==e){q=true}return 0}var w=v.compareDocumentPosition(e)&4?-1:v===e?0:1;if(w===0){q=true}return w}}else{if("sourceIndex" in document.documentElement){d=function(v,e){if(!v.sourceIndex||!e.sourceIndex){if(v==e){q=true}return 0}var w=v.sourceIndex-e.sourceIndex;if(w===0){q=true}return w}}else{if(document.createRange){d=function(x,v){if(!x.ownerDocument||!v.ownerDocument){if(x==v){q=true}return 0}var w=x.ownerDocument.createRange(),e=v.ownerDocument.createRange();w.setStart(x,0);w.setEnd(x,0);e.setStart(v,0);e.setEnd(v,0);var z=w.compareBoundaryPoints(Range.START_TO_END,e);if(z===0){q=true}return z}}}}(function(){var v=document.createElement("div"),w="script"+(new Date).getTime();v.innerHTML="<a name='"+w+"'/>";var e=document.documentElement;e.insertBefore(v,e.firstChild);if(!!document.getElementById(w)){g.find.ID=function(z,A,B){if(typeof A.getElementById!=="undefined"&&!B){var x=A.getElementById(z[1]);return x?x.id===z[1]||typeof x.getAttributeNode!=="undefined"&&x.getAttributeNode("id").nodeValue===z[1]?[x]:undefined:[]}};g.filter.ID=function(A,x){var z=typeof A.getAttributeNode!=="undefined"&&A.getAttributeNode("id");return A.nodeType===1&&z&&z.nodeValue===x}}e.removeChild(v);e=v=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){g.find.TAG=function(v,A){var z=A.getElementsByTagName(v[1]);if(v[1]==="*"){var x=[];for(var w=0;z[w];w++){if(z[w].nodeType===1){x.push(z[w])}}z=x}return z}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){g.attrHandle.href=function(v){return v.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=b,w=document.createElement("div");w.innerHTML="<p class='TEST'></p>";if(w.querySelectorAll&&w.querySelectorAll(".TEST").length===0){return}b=function(B,A,x,z){A=A||document;if(!z&&A.nodeType===9&&!s(A)){try{return a(A.querySelectorAll(B),x)}catch(C){}}return e(B,A,x,z)};for(var v in e){b[v]=e[v]}w=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}g.order.splice(1,0,"CLASS");g.find.CLASS=function(v,w,x){if(typeof w.getElementsByClassName!=="undefined"&&!x){return w.getElementsByClassName(v[1])}};e=null})()}function p(v,B,A,F,C,E){var D=v=="previousSibling"&&!E;for(var x=0,w=F.length;x<w;x++){var e=F[x];if(e){if(D&&e.nodeType===1){e.sizcache=A;e.sizset=x}e=e[v];var z=false;while(e){if(e.sizcache===A){z=F[e.sizset];break}if(e.nodeType===1&&!E){e.sizcache=A;e.sizset=x}if(e.nodeName===B){z=e;break}e=e[v]}F[x]=z}}}function u(v,B,A,F,C,E){var D=v=="previousSibling"&&!E;for(var x=0,w=F.length;x<w;x++){var e=F[x];if(e){if(D&&e.nodeType===1){e.sizcache=A;e.sizset=x}e=e[v];var z=false;while(e){if(e.sizcache===A){z=F[e.sizset];break}if(e.nodeType===1){if(!E){e.sizcache=A;e.sizset=x}if(typeof B!=="string"){if(e===B){z=true;break}}else{if(b.filter(B,[e]).length>0){z=e;break}}}e=e[v]}F[x]=z}}}var j=document.compareDocumentPosition?function(v,e){return v.compareDocumentPosition(e)&16}:function(v,e){return v!==e&&(v.contains?v.contains(e):true)};var s=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var h=function(e,C){var x=[],z="",A,w=C.nodeType?[C]:C;while((A=g.match.PSEUDO.exec(e))){z+=A[0];e=e.replace(g.match.PSEUDO,"")}e=g.relative[e]?e+"*":e;for(var B=0,v=w.length;B<v;B++){b(e,w[B],x)}return b.filter(z,x)};window.Sizzle=b})();(function(d){var e=Prototype.Selector.extendElements;function a(f,g){return e(d(f,g||document))}function b(g,f){return d.matches(f,[g]).length==1}Prototype.Selector.engine=d;Prototype.Selector.select=a;Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(j,e){if(typeof e!="object"){e={hash:!!e}}else{if(Object.isUndefined(e.hash)){e.hash=true}}var f,h,a=false,g=e.submit,b,d;if(e.hash){d={};b=function(k,l,m){if(l in k){if(!Object.isArray(k[l])){k[l]=[k[l]]}k[l].push(m)}else{k[l]=m}return k}}else{d="";b=function(k,l,m){return k+(k?"&":"")+encodeURIComponent(l)+"="+encodeURIComponent(m)}}return j.inject(d,function(k,l){if(!l.disabled&&l.name){f=l.name;h=$(l).getValue();if(h!=null&&l.type!="file"&&(l.type!="submit"||(!a&&g!==false&&(!g||f==g)&&(a=true)))){k=b(k,f,h)}}return k})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var g=$(f).getElementsByTagName("*"),e,a=[],d=Form.Element.Serializers;for(var b=0;e=g[b];b++){a.push(e)}return a.inject([],function(h,j){if(d[j.tagName.toLowerCase()]){h.push(Element.extend(j))}return h})},getInputs:function(h,d,e){h=$(h);var a=h.getElementsByTagName("input");if(!d&&!e){return $A(a).map(Element.extend)}for(var f=0,j=[],g=a.length;f<g;f++){var b=a[f];if((d&&b.type!=d)||(e&&b.name!=e)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var d=$(b).getElements().findAll(function(e){return"hidden"!=e.type&&!e.disabled});var a=d.findAll(function(e){return e.hasAttribute("tabIndex")&&e.tabIndex>=0}).sortBy(function(e){return e.tabIndex}).first();return a?a:d.find(function(e){return/^(?:input|select|textarea)$/i.test(e.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,a){b=$(b),a=Object.clone(a||{});var e=a.parameters,d=b.readAttribute("action")||"";if(d.blank()){d=window.location.href}a.parameters=b.serialize(true);if(e){if(Object.isString(e)){e=e.toQueryParams()}Object.extend(a.parameters,e)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(d,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var d={};d[a.name]=b;return Object.toQueryString(d)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var d=a.tagName.toLowerCase();Form.Element.Serializers[d](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function b(j,k){switch(j.type.toLowerCase()){case"checkbox":case"radio":return g(j,k);default:return f(j,k)}}function g(j,k){if(Object.isUndefined(k)){return j.checked?j.value:null}else{j.checked=!!k}}function f(j,k){if(Object.isUndefined(k)){return j.value}else{j.value=k}}function a(l,o){if(Object.isUndefined(o)){return(l.type==="select-one"?d:e)(l)}var k,m,p=!Object.isArray(o);for(var j=0,n=l.length;j<n;j++){k=l.options[j];m=this.optionValue(k);if(p){if(m==o){k.selected=true;return}}else{k.selected=o.include(m)}}}function d(k){var j=k.selectedIndex;return j>=0?h(k.options[j]):null}function e(m){var j,n=m.length;if(!n){return null}for(var l=0,j=[];l<n;l++){var k=m.options[l];if(k.selected){j.push(h(k))}}return j}function h(j){return Element.hasAttribute(j,"value")?j.value:j.text}return{input:b,inputSelector:g,textarea:f,select:a,selectOne:d,selectMany:e,optionValue:h,button:f}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function(a,b,d){PeriodicalExecuter.prototype.initialize.apply(this,[d,b]);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var G={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,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var g=document.documentElement;var H="onmouseenter" in g&&"onmouseleave" in g;var a=function(I){return false};if(window.attachEvent){if(window.addEventListener){a=function(I){return !(I instanceof window.Event)}}else{a=function(I){return true}}}var u;function E(J,I){return J.which?(J.which===I+1):(J.button===I)}var q={0:1,1:4,2:2};function C(J,I){return J.button===q[I]}function F(J,I){switch(I){case 0:return J.which==1&&!J.metaKey;case 1:return J.which==2||(J.which==1&&J.metaKey);case 2:return J.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){u=C}else{u=function(J,I){return a(J)?C(J,I):E(J,I)}}}else{if(Prototype.Browser.WebKit){u=F}else{u=E}}function z(I){return u(I,0)}function w(I){return u(I,1)}function p(I){return u(I,2)}function e(K){K=G.extend(K);var J=K.target,I=K.type,L=K.currentTarget;if(L&&L.tagName){if(I==="load"||I==="error"||(I==="click"&&L.tagName.toLowerCase()==="input"&&L.type==="radio")){J=L}}if(J.nodeType==Node.TEXT_NODE){J=J.parentNode}return Element.extend(J)}function s(J,K){var I=G.element(J);if(!K){return I}while(I){if(Object.isElement(I)&&Prototype.Selector.match(I,K)){return Element.extend(I)}I=I.parentNode}}function v(I){return{x:d(I),y:b(I)}}function d(K){var J=document.documentElement,I=document.body||{scrollLeft:0};return K.pageX||(K.clientX+(J.scrollLeft||I.scrollLeft)-(J.clientLeft||0))}function b(K){var J=document.documentElement,I=document.body||{scrollTop:0};return K.pageY||(K.clientY+(J.scrollTop||I.scrollTop)-(J.clientTop||0))}function t(I){G.extend(I);I.preventDefault();I.stopPropagation();I.stopped=true}G.Methods={isLeftClick:z,isMiddleClick:w,isRightClick:p,element:e,findElement:s,pointer:v,pointerX:d,pointerY:b,stop:t};var B=Object.keys(G.Methods).inject({},function(I,J){I[J]=G.Methods[J].methodize();return I});if(window.attachEvent){function k(J){var I;switch(J.type){case"mouseover":case"mouseenter":I=J.fromElement;break;case"mouseout":case"mouseleave":I=J.toElement;break;default:return null}return Element.extend(I)}var x={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};G.extend=function(J,I){if(!J){return false}if(!a(J)){return J}if(J._extendedByPrototype){return J}J._extendedByPrototype=Prototype.emptyFunction;var K=G.pointer(J);Object.extend(J,{target:J.srcElement||I,relatedTarget:k(J),pageX:K.x,pageY:K.y});Object.extend(J,B);Object.extend(J,x);return J}}else{G.extend=Prototype.K}if(window.addEventListener){G.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(G.prototype,B)}function o(M,L,N){var K=Element.retrieve(M,"prototype_event_registry");if(Object.isUndefined(K)){f.push(M);K=Element.retrieve(M,"prototype_event_registry",$H())}var I=K.get(L);if(Object.isUndefined(I)){I=[];K.set(L,I)}if(I.pluck("handler").include(N)){return false}var J;if(L.include(":")){J=function(O){if(Object.isUndefined(O.eventName)){return false}if(O.eventName!==L){return false}G.extend(O,M);N.call(M,O)}}else{if(!H&&(L==="mouseenter"||L==="mouseleave")){if(L==="mouseenter"||L==="mouseleave"){J=function(P){G.extend(P,M);var O=P.relatedTarget;while(O&&O!==M){try{O=O.parentNode}catch(Q){O=M}}if(O===M){return}N.call(M,P)}}}else{J=function(O){G.extend(O,M);N.call(M,O)}}}J.handler=N;I.push(J);return J}function j(){for(var I=0,J=f.length;I<J;I++){G.stopObserving(f[I]);f[I]=null}}var f=[];if(Prototype.Browser.IE){window.attachEvent("onunload",j)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var n=Prototype.K,h={mouseenter:"mouseover",mouseleave:"mouseout"};if(!H){n=function(I){return(h[I]||I)}}function A(L,K,M){L=$(L);var J=o(L,K,M);if(!J){return L}if(K.include(":")){if(L.addEventListener){L.addEventListener("dataavailable",J,false)}else{L.attachEvent("ondataavailable",J);L.attachEvent("onlosecapture",J)}}else{var I=n(K);if(L.addEventListener){L.addEventListener(I,J,false)}else{L.attachEvent("on"+I,J)}}return L}function m(O,L,P){O=$(O);var K=Element.retrieve(O,"prototype_event_registry");if(!K){return O}if(!L){K.each(function(R){var Q=R.key;m(O,Q)});return O}var M=K.get(L);if(!M){return O}if(!P){M.each(function(Q){m(O,L,Q.handler)});return O}var N=M.length,J;while(N--){if(M[N].handler===P){J=M[N];break}}if(!J){return O}if(L.include(":")){if(O.removeEventListener){O.removeEventListener("dataavailable",J,false)}else{O.detachEvent("ondataavailable",J);O.detachEvent("onlosecapture",J)}}else{var I=n(L);if(O.removeEventListener){O.removeEventListener(I,J,false)}else{O.detachEvent("on"+I,J)}}K.set(L,M.without(J));return O}function D(L,K,J,I){L=$(L);if(Object.isUndefined(I)){I=true}if(L==document&&document.createEvent&&!L.dispatchEvent){L=document.documentElement}var M;if(document.createEvent){M=document.createEvent("HTMLEvents");M.initEvent("dataavailable",I,true)}else{M=document.createEventObject();M.eventType=I?"ondataavailable":"onlosecapture"}M.eventName=K;M.memo=J||{};if(document.createEvent){L.dispatchEvent(M)}else{L.fireEvent(M.eventType,M)}return G.extend(M)}G.Handler=Class.create({initialize:function(K,J,I,L){this.element=$(K);this.eventName=J;this.selector=I;this.callback=L;this.handler=this.handleEvent.bind(this)},start:function(){G.observe(this.element,this.eventName,this.handler);return this},stop:function(){G.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(J){var I=G.findElement(J,this.selector);if(I){this.callback.call(this.element,J,I)}}});function l(K,J,I,L){K=$(K);if(Object.isFunction(I)&&Object.isUndefined(L)){L=I,I=null}return new G.Handler(K,J,I,L).start()}Object.extend(G,G.Methods);Object.extend(G,{fire:D,observe:A,stopObserving:m,on:l});Element.addMethods({fire:D,observe:A,stopObserving:m,on:l});Object.extend(document,{fire:D.methodize(),observe:A.methodize(),stopObserving:m.methodize(),on:l.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,G)}else{window.Event=G}})();(function(){var e;function a(){if(document.loaded){return}if(e){window.clearTimeout(e)}document.loaded=true;document.fire("dom:loaded")}function d(){if(document.readyState==="complete"){document.stopObserving("readystatechange",d);a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){e=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",d);if(window==top){e=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,d){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,d)}this.xcomp=a;this.ycomp=d;this.offset=Element.cumulativeOffset(b);return(d>=this.offset[1]&&d<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,e){var d=Element.cumulativeScrollOffset(b);this.xcomp=a+d[0]-this.deltaX;this.ycomp=e+d[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,d,a){a=a||{};return Element.clonePosition(d,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(d){return d.blank()?null:"[contains(concat(' ', @class, ' '), ' "+d+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(d,f){f=f.toString().strip();var e=/\s/.test(f)?$w(f).map(a).join(""):a(f);return e?document._getElementsByXPath(".//*"+e,d):[]}:function(f,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&&!g){return h}var d=$(f).getElementsByTagName("*");g=" "+g+" ";for(var e=0,l,k;l=d[e];e++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(m){return !m.toString().blank()&&k.include(" "+m+" ")})))){h.push(Element.extend(l))}}return h};return function(e,d){return $(d||document.body).getElementsByClassName(e)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(g,h){var a=Prototype.Selector.match,e=[];for(var d=0,f=g.length;d<f;d++){var b=g[d];if(a(b,h)){e.push(Element.extend(b))}}return e},findElement:function(g,h,b){b=b||0;var a=0,e;for(var d=0,f=g.length;d<f;d++){e=g[d];if(Prototype.Selector.match(e,h)&&b===a++){return Element.extend(e)}}},findChildElements:function(b,d){var a=d.toArray().join(", ");return Prototype.Selector.select(a,b||document)}})})();(function(){var b;var a=false;window.OpenLayers={_getScriptLocation:function(){if(b!=undefined){return b}b="";var j=new RegExp("(^|(.*?\\/))("+OpenLayers._scriptName+")(\\?|$)");var e=document.getElementsByTagName("script");for(var g=0,d=e.length;g<d;g++){var h=e[g].getAttribute("src");if(h){var f=h.match(j);if(f){b=f[1];break}}}return b},VERSION_NUMBER:"OpenLayers 2.9.1 -- $Revision: 10129 $"}})();OpenLayers.Util={};OpenLayers.Util.getElement=function(){var e=[];for(var d=0,a=arguments.length;d<a;d++){var b=arguments[d];if(typeof b=="string"){b=document.getElementById(b)}if(arguments.length==1){return b}e.push(b)}return e};OpenLayers.Util.isElement=function(a){return !!(a&&a.nodeType===1)};if(typeof window.$==="undefined"){window.$=OpenLayers.Util.getElement}OpenLayers.Util.extend=function(a,f){a=a||{};if(f){for(var e in f){var d=f[e];if(d!==undefined){a[e]=d}}var b=typeof window.Event=="function"&&f instanceof window.Event;if(!b&&f.hasOwnProperty&&f.hasOwnProperty("toString")){a.toString=f.toString}}return a};OpenLayers.Util.removeItem=function(d,b){for(var a=d.length-1;a>=0;a--){if(d[a]==b){d.splice(a,1)}}return d};OpenLayers.Util.clearArray=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"array = []"}));a.length=0};OpenLayers.Util.indexOf=function(e,d){if(typeof e.indexOf=="function"){return e.indexOf(d)}else{for(var b=0,a=e.length;b<a;b++){if(e[b]==d){return b}}return -1}};OpenLayers.Util.modifyDOMElement=function(f,j,e,g,a,d,h,b){if(j){f.id=j}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(a){f.style.position=a}if(d){f.style.border=d}if(h){f.style.overflow=h}if(parseFloat(b)>=0&&parseFloat(b)<1){f.style.filter="alpha(opacity="+(b*100)+")";f.style.opacity=b}else{if(parseFloat(b)==1){f.style.filter="";f.style.opacity=""}}};OpenLayers.Util.createDiv=function(a,k,j,g,f,d,b,h){var e=document.createElement("div");if(g){e.style.backgroundImage="url("+g+")"}if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!f){f="absolute"}OpenLayers.Util.modifyDOMElement(e,a,k,j,f,d,b,h);return e};OpenLayers.Util.createImage=function(a,j,h,f,e,d,g,k){var b=document.createElement("img");if(!a){a=OpenLayers.Util.createUniqueID("OpenLayersDiv")}if(!e){e="relative"}OpenLayers.Util.modifyDOMElement(b,a,j,h,e,d,null,g);if(k){b.style.display="none";OpenLayers.Event.observe(b,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,b));OpenLayers.Event.observe(b,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,b))}b.style.alt=a;b.galleryImg="no";if(f){b.src=f}return b};OpenLayers.Util.setOpacity=function(b,a){OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)};OpenLayers.Util.onImageLoad=function(){if(!this.viewRequestID||(this.map&&this.viewRequestID==this.map.viewRequestID)){this.style.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,a;for(a=0;d=e[a];a++){if(f.indexOf(d)!=-1){break}}var g=Math.floor(e.length*Math.random());var b=e[g];a=0;while(b==d&&a++<4){g=Math.floor(e.length*Math.random());b=e[g]}this.src=f.replace(d,b)}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 f=navigator.appVersion.split("MSIE");var a=parseFloat(f[1]);var b=false;try{b=!!(document.body.filters)}catch(d){}OpenLayers.Util.alphaHackNeeded=(b&&(a>=5.5)&&(a<7))}return OpenLayers.Util.alphaHackNeeded};OpenLayers.Util.modifyAlphaImageDiv=function(a,b,l,k,h,g,d,e,j){OpenLayers.Util.modifyDOMElement(a,b,l,k,g,null,null,j);var f=a.childNodes[0];if(h){f.src=h}OpenLayers.Util.modifyDOMElement(f,a.id+"_innerImage",null,k,"relative",d);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none"){a.style.display="inline-block"}if(e==null){e="scale"}a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f.src+"', sizingMethod='"+e+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)<1){a.style.filter+=" alpha(opacity="+a.style.opacity*100+")"}f.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(b,l,k,h,g,d,e,j,m){var a=OpenLayers.Util.createDiv();var f=OpenLayers.Util.createImage(null,null,null,null,null,null,null,false);a.appendChild(f);if(m){f.style.display="none";OpenLayers.Event.observe(f,"load",OpenLayers.Function.bind(OpenLayers.Util.onImageLoad,a));OpenLayers.Event.observe(f,"error",OpenLayers.Function.bind(OpenLayers.Util.onImageLoadError,a))}OpenLayers.Util.modifyAlphaImageDiv(a,b,l,k,h,g,d,e,j);return a};OpenLayers.Util.upperCaseObject=function(b){var a={};for(var d in b){a[d.toUpperCase()]=b[d]}return a};OpenLayers.Util.applyDefaults=function(e,d){e=e||{};var b=typeof window.Event=="function"&&d instanceof window.Event;for(var a in d){if(e[a]===undefined||(!b&&d.hasOwnProperty&&d.hasOwnProperty(a)&&!e.hasOwnProperty(a))){e[a]=d[a]}}if(!b&&d&&d.hasOwnProperty&&d.hasOwnProperty("toString")&&!e.hasOwnProperty("toString")){e.toString=d.toString}return e};OpenLayers.Util.getParameterString=function(d){var b=[];for(var j in d){var h=d[j];if((h!=null)&&(typeof h!="function")){var e;if(typeof h=="object"&&h.constructor==Array){var f=[];var k;for(var a=0,g=h.length;a<g;a++){k=h[a];f.push(encodeURIComponent((k===null||k===undefined)?"":k))}e=f.join(",")}else{e=encodeURIComponent(h)}b.push(encodeURIComponent(j)+"="+e)}}return b.join("&")};OpenLayers.Util.urlAppend=function(a,b){var e=a;if(b){var d=(a+" ").split(/[?&]/);e+=(d.pop()===" "?b:d.length?"&"+b:"?"+b)}return e};OpenLayers.ImgPath="";OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||(OpenLayers._getScriptLocation()+"img/")};OpenLayers.Util.Try=function(){var f=null;for(var d=0,a=arguments.length;d<a;d++){var b=arguments[d];try{f=b();break}catch(g){}}return f};OpenLayers.Util.getNodes=function(d,b){var a=OpenLayers.Util.Try(function(){return OpenLayers.Util._getNodes(d.documentElement.childNodes,b)},function(){return OpenLayers.Util._getNodes(d.childNodes,b)});return a};OpenLayers.Util._getNodes=function(d,f){var b=[];for(var e=0,a=d.length;e<a;e++){if(d[e].nodeName==f){b.push(d[e])}}return b};OpenLayers.Util.getTagText=function(d,e,b){var a=OpenLayers.Util.getNodes(d,e);if(a&&(a.length>0)){if(!b){b=0}if(a[b].childNodes.length>1){return a.childNodes[1].nodeValue}else{if(a[b].childNodes.length==1){return a[b].firstChild.nodeValue}}}else{return""}};OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;if(!b){b=a.textContent}if(!b){b=a.firstChild.nodeValue}},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,d){var b=(a.relatedTarget)?a.relatedTarget:a.toElement;while(b!=d&&b!=null){b=b.parentNode}return(b!=d)};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(b,a){if(a==null){a=OpenLayers.Util.DEFAULT_PRECISION}var b;if(a==0){b=parseFloat(b)}else{b=parseFloat(parseFloat(b).toPrecision(a))}return b};OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.distVincenty=function(h,e){var P=6378137,O=6356752.3142,J=1/298.257223563;var o=OpenLayers.Util.rad(e.lon-h.lon);var N=Math.atan((1-J)*Math.tan(OpenLayers.Util.rad(h.lat)));var M=Math.atan((1-J)*Math.tan(OpenLayers.Util.rad(e.lat)));var n=Math.sin(N),k=Math.cos(N);var m=Math.sin(M),j=Math.cos(M);var u=o,p=2*Math.PI;var t=20;while(Math.abs(u-p)>1e-12&&--t>0){var F=Math.sin(u),g=Math.cos(u);var Q=Math.sqrt((j*F)*(j*F)+(k*m-n*j*g)*(k*m-n*j*g));if(Q==0){return 0}var H=n*m+k*j*g;var E=Math.atan2(Q,H);var l=Math.asin(k*j*F/Q);var I=Math.cos(l)*Math.cos(l);var q=H-2*n*m/I;var x=J/16*I*(4+J*(4-3*I));p=u;u=o+(1-x)*J*Math.sin(l)*(E+x*Q*(q+x*H*(-1+2*q*q)))}if(t==0){return NaN}var w=I*(P*P-O*O)/(O*O);var D=1+w/16384*(4096+w*(-768+w*(320-175*w)));var z=w/1024*(256+w*(-128+w*(74-47*w)));var G=z*Q*(q+z/4*(H*(-1+2*q*q)-z/6*q*(-3+4*Q*Q)*(-3+4*q*q)));var v=O*D*(E-G);var K=v.toFixed(3)/1000;return K};OpenLayers.Util.getParameters=function(b){b=b||window.location.href;var a="";if(OpenLayers.String.contains(b,"?")){var d=b.indexOf("?")+1;var f=OpenLayers.String.contains(b,"#")?b.indexOf("#"):b.length;a=b.substring(d,f)}var m={};var e=a.split(/[&;]/);for(var h=0,j=e.length;h<j;++h){var g=e[h].split("=");if(g[0]){var l=decodeURIComponent(g[0]);var k=g[1]||"";k=decodeURIComponent(k.replace(/\+/g," ")).split(",");if(k.length==1){k=k[0]}m[l]=k}}return m};OpenLayers.Util.getArgs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Util.getParameters"}));return OpenLayers.Util.getParameters(a)};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){if(a==null){a="id_"}OpenLayers.Util.lastSeqID+=1;return a+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.3701,km:39370.1,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m;OpenLayers.METERS_PER_INCH=0.0254000508001016;OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:0.0000254/OpenLayers.METERS_PER_INCH,Mil:2.54e-8/OpenLayers.METERS_PER_INCH,Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1000/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH,Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH,SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":50000/OpenLayers.METERS_PER_INCH,"150kilometers":150000/OpenLayers.METERS_PER_INCH});OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1000,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:OpenLayers.INCHES_PER_UNIT.Meter*100,km:OpenLayers.INCHES_PER_UNIT.Meter*1000,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain,"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(b){var a=(b>1)?(1/b):b;return a};OpenLayers.Util.getResolutionFromScale=function(e,a){var b;if(e){if(a==null){a="degrees"}var d=OpenLayers.Util.normalizeScale(e);b=1/(d*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH)}return b};OpenLayers.Util.getScaleFromResolution=function(b,a){if(a==null){a="degrees"}var d=b*OpenLayers.INCHES_PER_UNIT[a]*OpenLayers.DOTS_PER_INCH;return d};OpenLayers.Util.safeStopPropagation=function(a){OpenLayers.Event.stop(a,true)};OpenLayers.Util.pagePosition=function(g){var a=0,f=0;var b=g;var h=g;while(b){if(b==document.body){if(OpenLayers.Element.getStyle(h,"position")=="absolute"){break}}a+=b.offsetTop||0;f+=b.offsetLeft||0;h=b;try{b=b.offsetParent}catch(d){OpenLayers.Console.error(OpenLayers.i18n("pagePositionFailed",{elemId:b.id}));break}}b=g;while(b){a-=b.scrollTop||0;f-=b.scrollLeft||0;b=b.parentNode}return[f,a]};OpenLayers.Util.isEquivalentUrl=function(g,f,d){d=d||{};OpenLayers.Util.applyDefaults(d,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var b=OpenLayers.Util.createUrlObject(g,d);var a=OpenLayers.Util.createUrlObject(f,d);for(var e in b){if(e!=="args"){if(b[e]!=a[e]){return false}}}for(var e in b.args){if(b.args[e]!=a.args[e]){return false}delete a.args[e]}for(var e in a.args){return false}return true};OpenLayers.Util.createUrlObject=function(d,m){m=m||{};if(!(/^\w+:\/\//).test(d)){var h=window.location;var f=h.port?":"+h.port:"";var j=h.protocol+"//"+h.host.split(":").shift()+f;if(d.indexOf("/")===0){d=j+d}else{var g=h.pathname.split("/");g.pop();d=j+g.join("/")+"/"+d}}if(m.ignoreCase){d=d.toLowerCase()}var k=document.createElement("a");k.href=d;var e={};e.host=k.host.split(":").shift();e.protocol=k.protocol;if(m.ignorePort80){e.port=(k.port=="80"||k.port=="0")?"":k.port}else{e.port=(k.port==""||k.port=="0")?"80":k.port}e.hash=(m.ignoreHash||k.hash==="#")?"":k.hash;var b=k.search;if(!b){var l=d.indexOf("?");b=(l!=-1)?d.substr(l):""}e.args=OpenLayers.Util.getParameters(b);e.pathname=(k.pathname.charAt(0)=="/")?k.pathname:"/"+k.pathname;return e};OpenLayers.Util.removeTail=function(b){var d=null;var a=b.indexOf("?");var e=b.indexOf("#");if(a==-1){d=(e!=-1)?b.substr(0,e):b}else{d=(e!=-1)?b.substr(0,Math.min(a,e)):b.substr(0,a)}return d};OpenLayers.Util.getBrowserName=function(){var b="";var a=navigator.userAgent.toLowerCase();if(a.indexOf("opera")!=-1){b="opera"}else{if(a.indexOf("msie")!=-1){b="msie"}else{if(a.indexOf("safari")!=-1){b="safari"}else{if(a.indexOf("mozilla")!=-1){if(a.indexOf("firefox")!=-1){b="firefox"}else{b="mozilla"}}}}}return b};OpenLayers.Util.getRenderedDimensions=function(b,p,q){var m,f;var a=document.createElement("div");a.style.visibility="hidden";var o=(q&&q.containerElement)?q.containerElement:document.body;if(p){if(p.w){m=p.w;a.style.width=m+"px"}else{if(p.h){f=p.h;a.style.height=f+"px"}}}if(q&&q.displayClass){a.className=q.displayClass}var g=document.createElement("div");g.innerHTML=b;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"}}a.appendChild(g);o.appendChild(a);var n=false;var k=a.parentNode;while(k&&k.tagName.toLowerCase()!="body"){var j=OpenLayers.Element.getStyle(k,"position");if(j=="absolute"){n=true;break}else{if(j&&j!="static"){break}}k=k.parentNode}if(!n){a.style.position="absolute"}if(!m){m=parseInt(g.scrollWidth);a.style.width=m+"px"}if(!f){f=parseInt(g.scrollHeight)}a.removeChild(g);o.removeChild(a);return new OpenLayers.Size(m,f)};OpenLayers.Util.getScrollbarWidth=function(){var d=OpenLayers.Util._scrollbarWidth;if(d==null){var f=null;var e=null;var a=0;var b=0;f=document.createElement("div");f.style.position="absolute";f.style.top="-1000px";f.style.left="-1000px";f.style.width="100px";f.style.height="50px";f.style.overflow="hidden";e=document.createElement("div");e.style.width="100%";e.style.height="200px";f.appendChild(e);document.body.appendChild(f);a=e.offsetWidth;f.style.overflow="scroll";b=e.offsetWidth;document.body.removeChild(document.body.lastChild);OpenLayers.Util._scrollbarWidth=(a-b);d=OpenLayers.Util._scrollbarWidth}return d};OpenLayers.Util.getFormattedLonLat=function(j,b,f){if(!f){f="dms"}var e=Math.abs(j);var k=Math.floor(e);var a=(e-k)/(1/60);var d=a;a=Math.floor(a);var h=(d-a)/(1/60);h=Math.round(h*10);h/=10;if(k<10){k="0"+k}var g=k+" ";if(f.indexOf("dm")>=0){if(a<10){a="0"+a}g+=a+"'";if(f.indexOf("dms")>=0){if(h<10){h="0"+h}g+=h+'"'}}if(b=="lon"){g+=j<0?OpenLayers.i18n("W"):OpenLayers.i18n("E")}else{g+=j<0?OpenLayers.i18n("S"):OpenLayers.i18n("N")}return g};OpenLayers.String={startsWith:function(b,a){return(b.indexOf(a)==0)},contains:function(b,a){return(b.indexOf(a)!=-1)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(g){var e=g.split("-");var b=e[0];for(var d=1,a=e.length;d<a;d++){var f=e[d];b+=f.charAt(0).toUpperCase()+f.substring(1)}return b},format:function(e,d,a){if(!d){d=window}var b=function(k,f){var j;var h=f.split(/\.+/);for(var g=0;g<h.length;g++){if(g==0){j=d}j=j[h[g]]}if(typeof j=="function"){j=a?j.apply(null,a):j()}if(typeof j=="undefined"){return"undefined"}else{return j}};return e.replace(OpenLayers.String.tokenRegEx,b)},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a){return OpenLayers.String.isNumeric(a)?parseFloat(a):a}};if(!String.prototype.startsWith){String.prototype.startsWith=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.startsWith"}));return OpenLayers.String.startsWith(this,a)}}if(!String.prototype.contains){String.prototype.contains=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.contains"}));return OpenLayers.String.contains(this,a)}}if(!String.prototype.trim){String.prototype.trim=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.trim"}));return OpenLayers.String.trim(this)}}if(!String.prototype.camelize){String.prototype.camelize=function(){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.String.camelize"}));return OpenLayers.String.camelize(this)}}OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,d){var b=0;if(d>0){b=parseFloat(a.toPrecision(d))}return b},format:function(d,a,h,k){a=(typeof a!="undefined")?a:0;h=(typeof h!="undefined")?h:OpenLayers.Number.thousandsSeparator;k=(typeof k!="undefined")?k:OpenLayers.Number.decimalSeparator;if(a!=null){d=parseFloat(d.toFixed(a))}var b=d.toString().split(".");if(b.length==1&&a==null){a=0}var e=b[0];if(h){var f=/(-?[0-9]+)([0-9]{3})/;while(f.test(e)){e=e.replace(f,"$1"+h+"$2")}}var g;if(a==0){g=e}else{var j=b.length>1?b[1]:"0";if(a!=null){j=j+new Array(a-j.length+1).join("0")}g=e+k+j}return g}};if(!Number.prototype.limitSigDigs){Number.prototype.limitSigDigs=function(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Number.limitSigDigs"}));return OpenLayers.Number.limitSigDigs(this,a)}}OpenLayers.Function={bind:function(d,b){var a=Array.prototype.slice.apply(arguments,[2]);return function(){var e=a.concat(Array.prototype.slice.apply(arguments,[0]));return d.apply(b,e)}},bindAsEventListener:function(b,a){return function(d){return b.call(a,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(a){OpenLayers.Console.warn(OpenLayers.i18n("methodDeprecated",{newMethod:"OpenLayers.Function.bindAsEventListener"}));return OpenLayers.Function.bindAsEventListener(this,a)}}OpenLayers.Array={filter:function(h,g,b){var e=[];if(Array.prototype.filter){e=h.filter(g,b)}else{var a=h.length;if(typeof g!="function"){throw new TypeError()}for(var d=0;d<a;d++){if(d in h){var f=h[d];if(g.call(b,f,d,h)){e.push(f)}}}}return e}};OpenLayers.Class=function(){var e=function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}};var d={};var g,b;for(var f=0,a=arguments.length;f<a;++f){if(typeof arguments[f]=="function"){if(f==0&&a>1){b=arguments[f].prototype.initialize;arguments[f].prototype.initialize=function(){};d=new arguments[f];if(b===undefined){delete arguments[f].prototype.initialize}else{arguments[f].prototype.initialize=b}}g=arguments[f].prototype}else{g=arguments[f]}OpenLayers.Util.extend(d,g)}e.prototype=d;return e};OpenLayers.Class.isPrototype=function(){};OpenLayers.Class.create=function(){return function(){if(arguments&&arguments[0]!=OpenLayers.Class.isPrototype){this.initialize.apply(this,arguments)}}};OpenLayers.Class.inherit=function(){var e=arguments[0];var f=new e(OpenLayers.Class.isPrototype);for(var d=1,a=arguments.length;d<a;d++){if(typeof arguments[d]=="function"){var b=arguments[d];arguments[d]=new b(OpenLayers.Class.isPrototype)}OpenLayers.Util.extend(f,arguments[d])}return f};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(e,a,b,d){if(e!=null){this.left=OpenLayers.Util.toFloat(e)}if(a!=null){this.bottom=OpenLayers.Util.toFloat(a)}if(b!=null){this.right=OpenLayers.Util.toFloat(b)}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(b){var a=false;if(b!=null){a=((this.left==b.left)&&(this.right==b.right)&&(this.top==b.top)&&(this.bottom==b.bottom))}return a},toString:function(){return("left-bottom=("+this.left+","+this.bottom+") right-top=("+this.right+","+this.top+")")},toArray:function(a){if(a===true){return[this.bottom,this.left,this.top,this.right]}else{return[this.left,this.bottom,this.right,this.top]}},toBBOX:function(b,f){if(b==null){b=6}var h=Math.pow(10,b);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 a=Math.round(this.top*h)/h;if(f===true){return e+","+g+","+a+","+d}else{return g+","+e+","+d+","+a}},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return(this.right-this.left)},getHeight:function(){return(this.top-this.bottom)},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())},getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){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 a,j;if(d.CLASS_NAME=="OpenLayers.LonLat"){a=d.lon;j=d.lat}else{a=d.x;j=d.y}var h=(this.left-a)*f+a;var b=(this.bottom-j)*f+j;var e=(this.right-a)*f+a;var g=(this.top-j)*f+j;return new OpenLayers.Bounds(h,b,e,g)},add:function(a,d){if((a==null)||(d==null)){var b=OpenLayers.i18n("boundsAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Bounds(this.left+a,this.bottom+d,this.right+a,this.top+d)},extend:function(a){var b=null;if(a){switch(a.CLASS_NAME){case"OpenLayers.LonLat":b=new OpenLayers.Bounds(a.lon,a.lat,a.lon,a.lat);break;case"OpenLayers.Geometry.Point":b=new OpenLayers.Bounds(a.x,a.y,a.x,a.y);break;case"OpenLayers.Bounds":b=a;break}if(b){this.centerLonLat=null;if((this.left==null)||(b.left<this.left)){this.left=b.left}if((this.bottom==null)||(b.bottom<this.bottom)){this.bottom=b.bottom}if((this.right==null)||(b.right>this.right)){this.right=b.right}if((this.top==null)||(b.top>this.top)){this.top=b.top}}}},containsLonLat:function(b,a){return this.contains(b.lon,b.lat,a)},containsPixel:function(b,a){return this.contains(b.x,b.y,a)},contains:function(b,e,a){if(a==null){a=true}if(b==null||e==null){return false}b=OpenLayers.Util.toFloat(b);e=OpenLayers.Util.toFloat(e);var d=false;if(a){d=((b>=this.left)&&(b<=this.right)&&(e>=this.bottom)&&(e<=this.top))}else{d=((b>this.left)&&(b<this.right)&&(e>this.bottom)&&(e<this.top))}return d},intersectsBounds:function(f,b){if(b==null){b=true}var e=false;var j=(this.left==f.right||this.right==f.left||this.top==f.bottom||this.bottom==f.top);if(b||!j){var h=(((f.bottom>=this.bottom)&&(f.bottom<=this.top))||((this.bottom>=f.bottom)&&(this.bottom<=f.top)));var g=(((f.top>=this.bottom)&&(f.top<=this.top))||((this.top>f.bottom)&&(this.top<f.top)));var d=(((f.left>=this.left)&&(f.left<=this.right))||((this.left>=f.left)&&(this.left<=f.right)));var a=(((f.right>=this.left)&&(f.right<=this.right))||((this.right>=f.left)&&(this.right<=f.right)));e=((h||g)&&(d||a))}return e},containsBounds:function(h,b,a){if(b==null){b=false}if(a==null){a=true}var d=this.contains(h.left,h.bottom,a);var e=this.contains(h.right,h.bottom,a);var g=this.contains(h.left,h.top,a);var f=this.contains(h.right,h.top,a);return(b)?(d||e||g||f):(d&&e&&g&&f)},determineQuadrant:function(d){var b="";var a=this.getCenterLonLat();b+=(d.lat<a.lat)?"b":"t";b+=(d.lon<a.lon)?"l":"r";return b},transform:function(e,b){this.centerLonLat=null;var f=OpenLayers.Projection.transform({x:this.left,y:this.bottom},e,b);var a=OpenLayers.Projection.transform({x:this.right,y:this.bottom},e,b);var d=OpenLayers.Projection.transform({x:this.left,y:this.top},e,b);var g=OpenLayers.Projection.transform({x:this.right,y:this.top},e,b);this.left=Math.min(f.x,d.x);this.bottom=Math.min(f.y,a.y);this.right=Math.max(a.x,g.x);this.top=Math.max(d.y,g.y);return this},wrapDateLine:function(a,d){d=d||{};var e=d.leftTolerance||0;var b=d.rightTolerance||0;var f=this.clone();if(a){while(f.left<a.left&&(f.right-b)<=a.left){f=f.add(a.getWidth(),0)}while((f.left+e)>=a.right&&f.right>a.right){f=f.add(-a.getWidth(),0)}}return f},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(b){var a=b.split(",");return OpenLayers.Bounds.fromArray(a)};OpenLayers.Bounds.fromArray=function(a){return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(a[2]),parseFloat(a[3]))};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b="";b+=(a.charAt(0)=="t")?"b":"t";b+=(a.charAt(1)=="l")?"r":"l";return b};OpenLayers.Element={visible:function(a){return OpenLayers.Util.getElement(a).style.display!="none"},toggle:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);var e=OpenLayers.Element.visible(b)?"hide":"show";OpenLayers.Element[e](b)}},hide:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);b.style.display="none"}},show:function(){for(var d=0,a=arguments.length;d<a;d++){var b=OpenLayers.Util.getElement(arguments[d]);b.style.display=""}},remove:function(a){a=OpenLayers.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=OpenLayers.Util.getElement(a);return a.offsetHeight},getDimensions:function(d){d=OpenLayers.Util.getElement(d);if(OpenLayers.Element.getStyle(d,"display")!="none"){return{width:d.offsetWidth,height:d.offsetHeight}}var b=d.style;var g=b.visibility;var e=b.position;var a=b.display;b.visibility="hidden";b.position="absolute";b.display="";var h=d.clientWidth;var f=d.clientHeight;b.display=a;b.position=e;b.visibility=g;return{width:h,height:f}},hasClass:function(b,a){var d=b.className;return(!!d&&new RegExp("(^|\\s)"+a+"(\\s|$)").test(d))},addClass:function(b,a){if(!OpenLayers.Element.hasClass(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClass:function(b,a){var d=b.className;if(d){b.className=OpenLayers.String.trim(d.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," "))}return b},toggleClass:function(b,a){if(OpenLayers.Element.hasClass(b,a)){OpenLayers.Element.removeClass(b,a)}else{OpenLayers.Element.addClass(b,a)}return b},getStyle:function(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 b=document.defaultView.getComputedStyle(d,null);f=b?b.getPropertyValue(e):null}else{if(d.currentStyle){f=d.currentStyle[OpenLayers.String.camelize(e)]}}}var a=["left","top","right","bottom"];if(window.opera&&(OpenLayers.Util.indexOf(a,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(b,a){this.lon=OpenLayers.Util.toFloat(b);this.lat=OpenLayers.Util.toFloat(a)},toString:function(){return("lon="+this.lon+",lat="+this.lat)},toShortString:function(){return(this.lon+", "+this.lat)},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(d,a){if((d==null)||(a==null)){var b=OpenLayers.i18n("lonlatAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.LonLat(this.lon+d,this.lat+a)},equals:function(b){var a=false;if(b!=null){a=((this.lon==b.lon&&this.lat==b.lat)||(isNaN(this.lon)&&isNaN(this.lat)&&isNaN(b.lon)&&isNaN(b.lat)))}return a},transform:function(d,b){var a=OpenLayers.Projection.transform({x:this.lon,y:this.lat},d,b);this.lon=a.x;this.lat=a.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){while(b.lon<a.left){b.lon+=a.getWidth()}while(b.lon>a.right){b.lon-=a.getWidth()}}return b},CLASS_NAME:"OpenLayers.LonLat"});OpenLayers.LonLat.fromString=function(b){var a=b.split(",");return new OpenLayers.LonLat(parseFloat(a[0]),parseFloat(a[1]))};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return("x="+this.x+",y="+this.y)},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},add:function(a,d){if((a==null)||(d==null)){var b=OpenLayers.i18n("pixelAddError");OpenLayers.Console.error(b);return null}return new OpenLayers.Pixel(this.x+a,this.y+d)},offset:function(a){var b=this.clone();if(a){b=this.add(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return("w="+this.w+",h="+this.h)},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(b){var a=false;if(b!=null){a=((this.w==b.w&&this.h==b.h)||(isNaN(this.w)&&isNaN(this.h)&&isNaN(b.w)&&isNaN(b.h)))}return a},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Tween=OpenLayers.Class({INTERVAL:10,easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,interval:null,playing:false,initialize:function(a){this.easing=(a)?a:OpenLayers.Easing.Expo.easeOut},start:function(d,b,e,a){this.playing=true;this.begin=d;this.finish=b;this.duration=e;this.callbacks=a.callbacks;this.time=0;if(this.interval){window.clearInterval(this.interval);this.interval=null}if(this.callbacks&&this.callbacks.start){this.callbacks.start.call(this,this.begin)}this.interval=window.setInterval(OpenLayers.Function.bind(this.play,this),this.INTERVAL)},stop:function(){if(!this.playing){return}if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish)}window.clearInterval(this.interval);this.interval=null;this.playing=false},play:function(){var g={};for(var d in this.begin){var a=this.begin[d];var e=this.finish[d];if(a==null||e==null||isNaN(a)||isNaN(e)){OpenLayers.Console.error("invalid value for Tween")}var h=e-a;g[d]=this.easing.apply(this,[this.time,a,h,this.duration])}this.time++;if(this.callbacks&&this.callbacks.eachStep){this.callbacks.eachStep.call(this,g)}if(this.time>this.duration){if(this.callbacks&&this.callbacks.done){this.callbacks.done.call(this,this.finish);this.playing=false}window.clearInterval(this.interval);this.interval=null}},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(e,a,g,f){return g*e/f+a},easeOut:function(e,a,g,f){return g*e/f+a},easeInOut:function(e,a,g,f){return g*e/f+a},CLASS_NAME:"OpenLayers.Easing.Linear"};OpenLayers.Easing.Expo={easeIn:function(e,a,g,f){return(e==0)?a:g*Math.pow(2,10*(e/f-1))+a},easeOut:function(e,a,g,f){return(e==f)?a+g:g*(-Math.pow(2,-10*e/f)+1)+a},easeInOut:function(e,a,g,f){if(e==0){return a}if(e==f){return a+g}if((e/=f/2)<1){return g/2*Math.pow(2,10*(e-1))+a}return g/2*(-Math.pow(2,-10*--e)+2)+a},CLASS_NAME:"OpenLayers.Easing.Expo"};OpenLayers.Easing.Quad={easeIn:function(e,a,g,f){return g*(e/=f)*e+a},easeOut:function(e,a,g,f){return -g*(e/=f)*(e-2)+a},easeInOut:function(e,a,g,f){if((e/=f/2)<1){return g/2*e*e+a}return -g/2*((--e)*(e-2)-1)+a},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Rico=new Object();OpenLayers.Rico.Corner={round:function(f,b){f=OpenLayers.Util.getElement(f);this._setOptions(b);var a=this.options.color;if(this.options.color=="fromElement"){a=this._background(f)}var d=this.options.bgColor;if(this.options.bgColor=="fromParent"){d=this._background(f.offsetParent)}this._roundCornersImpl(f,a,d)},changeColor:function(d,b){d.style.backgroundColor=b;var a=d.parentNode.getElementsByTagName("span");for(var e=0;e<a.length;e++){a[e].style.backgroundColor=b}},changeOpacity:function(d,g){var e=g;var a="alpha(opacity="+g*100+")";d.style.opacity=e;d.style.filter=a;var b=d.parentNode.getElementsByTagName("span");for(var f=0;f<b.length;f++){b[f].style.opacity=e;b[f].style.filter=a}},reRound:function(e,d){var b=e.parentNode.childNodes[0];var a=e.parentNode.childNodes[2];e.parentNode.removeChild(b);e.parentNode.removeChild(a);this.round(e.parentNode,d)},_roundCornersImpl:function(d,a,b){if(this.options.border){this._renderBorder(d,b)}if(this._isTopRounded()){this._roundTopCorners(d,a,b)}if(this._isBottomRounded()){this._roundBottomCorners(d,a,b)}},_renderBorder:function(e,f){var b="1px solid "+this._borderColor(f);var a="border-left: "+b;var g="border-right: "+b;var d="style='"+a+";"+g+"'";e.innerHTML="<div "+d+">"+e.innerHTML+"</div>"},_roundTopCorners:function(d,a,f){var e=this._createCorner(f);for(var b=0;b<this.options.numSlices;b++){e.appendChild(this._createCornerSlice(a,f,b,"top"))}d.style.paddingTop=0;d.insertBefore(e,d.firstChild)},_roundBottomCorners:function(d,a,f){var e=this._createCorner(f);for(var b=(this.options.numSlices-1);b>=0;b--){e.appendChild(this._createCornerSlice(a,f,b,"bottom"))}d.style.paddingBottom=0;d.appendChild(e)},_createCorner:function(b){var a=document.createElement("div");a.style.backgroundColor=(this._isTransparent()?"transparent":b);return a},_createCornerSlice:function(d,e,h,a){var f=document.createElement("span");var b=f.style;b.backgroundColor=d;b.display="block";b.height="1px";b.overflow="hidden";b.fontSize="1px";var g=this._borderColor(d,e);if(this.options.border&&h==0){b.borderTopStyle="solid";b.borderTopWidth="1px";b.borderLeftWidth="0px";b.borderRightWidth="0px";b.borderBottomWidth="0px";b.height="0px";b.borderColor=g}else{if(g){b.borderColor=g;b.borderStyle="solid";b.borderWidth="0px 1px"}}if(!this.options.compact&&(h==(this.options.numSlices-1))){b.height="2px"}this._setMargin(f,h,a);this._setBorder(f,h,a);return f},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return""}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return""}if(this.options.corners.indexOf("tl")>=0){return"left"}else{if(this.options.corners.indexOf("tr")>=0){return"right"}}return""},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return""}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return""}if(this.options.corners.indexOf("bl")>=0){return"left"}else{if(this.options.corners.indexOf("br")>=0){return"right"}}return""},_borderColor:function(a,b){if(a=="transparent"){return b}else{if(this.options.border){return this.options.border}else{if(this.options.blend){return this._blend(b,a)}else{return""}}}},_setMargin:function(e,f,b){var d=this._marginSize(f);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.marginLeft=d+"px";e.style.marginRight="0px"}else{if(a=="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,b){var d=this._borderSize(f);var a=b=="top"?this._whichSideTop():this._whichSideBottom();if(a=="left"){e.style.borderLeftWidth=d+"px";e.style.borderRightWidth="0px"}else{if(a=="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 a=[3,2,1,0];var d=[2,1];var b=[1,0];if(this.options.compact&&this.options.blend){return b[f]}else{if(this.options.compact){return d[f]}else{if(this.options.blend){return a[f]}else{return e[f]}}}},_borderSize:function(f){var e=[5,3,2,1];var b=[2,1,1,1];var a=[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 a[f]}else{if(this.options.blend){return b[f]}else{if(this.options.border){return d[f]}else{if(this._isTransparent()){return e[f]}}}}}return 0},_hasString:function(b){for(var a=1;a<arguments.length;a++){if(b.indexOf(arguments[a])>=0){return true}}return false},_blend:function(d,a){var b=OpenLayers.Rico.Color.createFromHex(d);b.blend(OpenLayers.Rico.Color.createFromHex(a));return b},_background:function(a){try{return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()}catch(b){return"#ffffff"}},_isTransparent:function(){return this.options.color=="transparent"},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(a){return a.childNodes.length==1&&a.childNodes[0].nodeType==3}};OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(d,b,a){this.rgb={r:d,g:b,b:a}},setRed:function(a){this.rgb.r=a},setGreen:function(a){this.rgb.g=a},setBlue:function(a){this.rgb.b=a},setHue:function(b){var a=this.asHSB();a.h=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setSaturation:function(b){var a=this.asHSB();a.s=b;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,a.b)},setBrightness:function(a){var d=this.asHSB();d.b=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(d.h,d.s,d.b)},darken:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.max(a.b-b,0))},brighten:function(b){var a=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(a.h,a.s,Math.min(a.b+b,1))},blend:function(a){this.rgb.r=Math.floor((this.rgb.r+a.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+a.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+a.rgb.b)/2)},isBright:function(){var a=this.asHSB();return this.asHSB().b>0.5},isDark:function(){return !this.isBright()},asRGB:function(){return"rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}});OpenLayers.Rico.Color.createFromHex=function(e){if(e.length==4){var b=e;var e="#";for(var d=1;d<4;d++){e+=(b.charAt(d)+b.charAt(d))}}if(e.indexOf("#")==0){e=e.substring(1)}var g=e.substring(0,2);var f=e.substring(2,4);var a=e.substring(4,6);return new OpenLayers.Rico.Color(parseInt(g,16),parseInt(f,16),parseInt(a,16))};OpenLayers.Rico.Color.createColorFromBackground=function(e){var b=RicoUtil.getElementsComputedStyle(OpenLayers.Util.getElement(e),"backgroundColor","background-color");if(b=="transparent"&&e.parentNode){return OpenLayers.Rico.Color.createColorFromBackground(e.parentNode)}if(b==null){return new OpenLayers.Rico.Color(255,255,255)}if(b.indexOf("rgb(")==0){var a=b.substring(4,b.length-1);var d=a.split(",");return new OpenLayers.Rico.Color(parseInt(d[0]),parseInt(d[1]),parseInt(d[2]))}else{if(b.indexOf("#")==0){return OpenLayers.Rico.Color.createFromHex(b)}else{return new OpenLayers.Rico.Color(255,255,255)}}};OpenLayers.Rico.Color.HSBtoRGB=function(k,g,m){var d=0;var e=0;var n=0;if(g==0){d=parseInt(m*255+0.5);e=d;n=d}else{var j=(k-Math.floor(k))*6;var l=j-Math.floor(j);var b=m*(1-g);var a=m*(1-g*l);var o=m*(1-(g*(1-l)));switch(parseInt(j)){case 0:d=(m*255+0.5);e=(o*255+0.5);n=(b*255+0.5);break;case 1:d=(a*255+0.5);e=(m*255+0.5);n=(b*255+0.5);break;case 2:d=(b*255+0.5);e=(m*255+0.5);n=(o*255+0.5);break;case 3:d=(b*255+0.5);e=(a*255+0.5);n=(m*255+0.5);break;case 4:d=(o*255+0.5);e=(b*255+0.5);n=(m*255+0.5);break;case 5:d=(m*255+0.5);e=(b*255+0.5);n=(a*255+0.5);break}}return{r:parseInt(d),g:parseInt(e),b:parseInt(n)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,h,n){var j;var f;var m;var o=(a>h)?a:h;if(n>o){o=n}var k=(a<h)?a:h;if(n<k){k=n}m=o/255;if(o!=0){f=(o-k)/o}else{f=0}if(f==0){j=0}else{var d=(o-a)/(o-k);var l=(o-h)/(o-k);var e=(o-n)/(o-k);if(a==o){j=e-l}else{if(h==o){j=2+d-e}else{j=4+l-d}}j=j/6;if(j<0){j=j+1}}return{h:j,s:f,b:m}};OpenLayers.ProxyHost="";OpenLayers.nullHandler=function(a){OpenLayers.Console.userError(OpenLayers.i18n("unhandledRequest",{statusText:a.statusText}))};OpenLayers.loadURL=function(e,h,b,f,d){if(typeof h=="string"){h=OpenLayers.Util.getParameters(h)}var g=(f)?f:OpenLayers.nullHandler;var a=(d)?d:OpenLayers.nullHandler;return OpenLayers.Request.GET({url:e,params:h,success:g,failure:a,scope:b})};OpenLayers.parseXMLString=function(d){var a=d.indexOf("<");if(a>0){d=d.substring(a)}var b=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 b};OpenLayers.Ajax={emptyFunction:function(){},getTransport:function(){return OpenLayers.Util.Try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};OpenLayers.Ajax.Responders={responders:[],register:function(b){for(var a=0;a<this.responders.length;a++){if(b==this.responders[a]){return}}this.responders.push(b)},unregister:function(a){OpenLayers.Util.removeItem(this.reponders,a)},dispatch:function(h,d,g){var a;for(var b=0;b<this.responders.length;b++){a=this.responders[b];if(a[h]&&typeof a[h]=="function"){try{a[h].apply(a,[d,g])}catch(f){}}}}};OpenLayers.Ajax.Responders.register({onCreate:function(){OpenLayers.Ajax.activeRequestCount++},onComplete:function(){OpenLayers.Ajax.activeRequestCount--}});OpenLayers.Ajax.Base=OpenLayers.Class({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/xml",parameters:""};OpenLayers.Util.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(typeof this.options.parameters=="string"){this.options.parameters=OpenLayers.Util.getParameters(this.options.parameters)}}});OpenLayers.Ajax.Request=OpenLayers.Class(OpenLayers.Ajax.Base,{_complete:false,initialize:function(b,a){OpenLayers.Ajax.Base.prototype.initialize.apply(this,[a]);if(OpenLayers.ProxyHost&&OpenLayers.String.startsWith(b,"http")){b=OpenLayers.ProxyHost+encodeURIComponent(b)}this.transport=OpenLayers.Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var f=OpenLayers.Util.extend({},this.options.parameters);if(this.method!="get"&&this.method!="post"){f._method=this.method;this.method="post"}this.parameters=f;if(f=OpenLayers.Util.getParameterString(f)){if(this.method=="get"){this.url+=((this.url.indexOf("?")>-1)?"&":"?")+f}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){f+="&_="}}}try{var a=new OpenLayers.Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}OpenLayers.Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){window.setTimeout(OpenLayers.Function.bind(this.respondToReadyState,this,1),10)}this.transport.onreadystatechange=OpenLayers.Function.bind(this.onStateChange,this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||f):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*",OpenLayers:true};if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var d=this.options.requestHeaders;if(typeof d.push=="function"){for(var b=0,e=d.length;b<e;b+=2){f[d[b]]=d[b+1]}}else{for(var b in d){f[b]=d[b]}}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var d=OpenLayers.Ajax.Request.Events[a];var b=new OpenLayers.Ajax.Response(this);if(d=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||OpenLayers.Ajax.emptyFunction)(b)}catch(f){this.dispatchException(f)}var g=b.getHeader("Content-type")}try{(this.options["on"+d]||OpenLayers.Ajax.emptyFunction)(b);OpenLayers.Ajax.Responders.dispatch("on"+d,this,b)}catch(f){this.dispatchException(f)}if(d=="Complete"){this.transport.onreadystatechange=OpenLayers.Ajax.emptyFunction}},getHeader:function(a){try{return this.transport.getResponseHeader(a)}catch(b){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 a=OpenLayers.Ajax.Responders.responders;for(var b=0;b<a.length;b++){if(a[b].onException){f=true;break}}if(f){OpenLayers.Ajax.Responders.dispatch("onException",this,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,a=this.readyState=e.readyState;if((a>2&&!(!!(window.attachEvent&&!window.opera)))||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=e.responseText==null?"":String(e.responseText)}if(a==4){var b=e.responseXML;this.responseXML=b===undefined?null:b}},getStatus:OpenLayers.Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:OpenLayers.Ajax.Request.prototype.getHeader,getResponseHeader:function(a){return this.transport.getResponseHeader(a)}});OpenLayers.Ajax.getElementsByTagNameNS=function(b,a,d,f){var e=null;if(b.getElementsByTagNameNS){e=b.getElementsByTagNameNS(a,f)}else{e=b.getElementsByTagName(d+":"+f)}return e};OpenLayers.Ajax.serializeXMLToString=function(a){var b=new XMLSerializer();var d=b.serializeToString(a);return d};OpenLayers.Event={observers:false,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isLeftClick:function(a){return(((a.which)&&(a.which==1))||((a.button)&&(a.button==1)))},isRightClick:function(a){return(((a.which)&&(a.which==3))||((a.button)&&(a.button==2)))},stop:function(b,a){if(!a){if(b.preventDefault){b.preventDefault()}else{b.returnValue=false}}if(b.stopPropagation){b.stopPropagation()}else{b.cancelBubble=true}},findElement:function(d,b){var a=OpenLayers.Event.element(d);while(a.parentNode&&(!a.tagName||(a.tagName.toUpperCase()!=b.toUpperCase()))){a=a.parentNode}return a},observe:function(b,e,d,a){var f=OpenLayers.Util.getElement(b);a=a||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:a});if(f.addEventListener){f.addEventListener(e,d,a)}else{if(f.attachEvent){f.attachEvent("on"+e,d)}}},stopObservingElement:function(a){var b=OpenLayers.Util.getElement(a);var d=b._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[d])},_removeElementObservers:function(f){if(f){for(var b=f.length-1;b>=0;b--){var d=f[b];var a=new Array(d.element,d.name,d.observer,d.useCapture);var e=OpenLayers.Event.stopObserving.apply(this,a)}}},stopObserving:function(j,a,h,b){b=b||false;var g=OpenLayers.Util.getElement(j);var e=g._eventCacheID;if(a=="keypress"){if(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||g.detachEvent){a="keydown"}}var l=false;var d=OpenLayers.Event.observers[e];if(d){var f=0;while(!l&&f<d.length){var k=d[f];if((k.name==a)&&(k.observer==h)&&(k.useCapture==b)){d.splice(f,1);if(d.length==0){delete OpenLayers.Event.observers[e]}l=true;break}f++}}if(l){if(g.removeEventListener){g.removeEventListener(a,h,b)}else{if(g&&g.detachEvent){g.detachEvent("on"+a,h)}}}return l},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers){var b=OpenLayers.Event.observers[a];OpenLayers.Event._removeElementObservers.apply(this,[b])}OpenLayers.Event.observers=false}},CLASS_NAME:"OpenLayers.Event"};OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,false);if(window.Event){OpenLayers.Util.applyDefaults(window.Event,OpenLayers.Event)}else{var Event=OpenLayers.Event}OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:["mouseover","mouseout","mousedown","mouseup","mousemove","click","dblclick","rightclick","dblrightclick","resize","focus","blur"],listeners:null,object:null,element:null,eventTypes:null,eventHandler:null,fallThrough:null,includeXY:false,clearMouseListener:null,initialize:function(d,f,h,g,b){OpenLayers.Util.extend(this,b);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,a=h.length;e<a;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(a){if(!this.listeners[a]){this.eventTypes.push(a);this.listeners[a]=[]}},attachToElement:function(e){if(this.element){OpenLayers.Event.stopObservingElement(this.element)}this.element=e;for(var d=0,a=this.BROWSER_EVENTS.length;d<a;d++){var b=this.BROWSER_EVENTS[d];this.addEventType(b);OpenLayers.Event.observe(e,b,this.eventHandler)}OpenLayers.Event.observe(e,"dragstart",OpenLayers.Event.stop)},on:function(a){for(var b in a){if(b!="scope"){this.register(b,a.scope,a[b])}}},register:function(b,e,d){if((d!=null)&&(OpenLayers.Util.indexOf(this.eventTypes,b)!=-1)){if(e==null){e=this.object}var a=this.listeners[b];a.push({obj:e,func:d})}},registerPriority:function(b,e,d){if(d!=null){if(e==null){e=this.object}var a=this.listeners[b];if(a!=null){a.unshift({obj:e,func:d})}}},un:function(a){for(var b in a){if(b!="scope"){this.unregister(b,a.scope,a[b])}}},unregister:function(e,g,f){if(g==null){g=this.object}var d=this.listeners[e];if(d!=null){for(var b=0,a=d.length;b<a;b++){if(d[b].obj==g&&d[b].func==f){d.splice(b,1);break}}}},remove:function(a){if(this.listeners[a]!=null){this.listeners[a]=[]}},triggerEvent:function(f,b){var e=this.listeners[f];if(!e||e.length==0){return}if(b==null){b={}}b.object=this.object;b.element=this.element;if(!b.type){b.type=f}var e=e.slice(),g;for(var d=0,a=e.length;d<a;d++){var h=e[d];g=h.func.apply(h.obj,[b]);if((g!=undefined)&&(g==false)){break}}if(!this.fallThrough){OpenLayers.Event.stop(b,true)}return g},handleBrowserEvent:function(a){if(this.includeXY){a.xy=this.getMousePosition(a)}this.triggerEvent(a.type,a)},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){if(!this.includeXY){this.clearMouseCache()}else{if(!this.element.hasScrollEvent){OpenLayers.Event.observe(window,"scroll",this.clearMouseListener);this.element.hasScrollEvent=true}}if(!this.element.scrolls){this.element.scrolls=[(document.documentElement.scrollLeft||document.body.scrollLeft),(document.documentElement.scrollTop||document.body.scrollTop)]}if(!this.element.lefttop){this.element.lefttop=[(document.documentElement.clientLeft||0),(document.documentElement.clientTop||0)]}if(!this.element.offsets){this.element.offsets=OpenLayers.Util.pagePosition(this.element);this.element.offsets[0]+=this.element.scrolls[0];this.element.offsets[1]+=this.element.scrolls[1]}return new OpenLayers.Pixel((a.clientX+this.element.scrolls[0])-this.element.offsets[0]-this.element.lefttop[0],(a.clientY+this.element.scrolls[1])-this.element.offsets[1]-this.element.lefttop[1])},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Request={DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:true,user:undefined,password:undefined,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},events:new OpenLayers.Events(this,null,["complete","success","failure"]),issue:function(b){var f=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});b=OpenLayers.Util.applyDefaults(b,f);var e=new OpenLayers.Request.XMLHttpRequest();var a=b.url;if(b.params){var d=OpenLayers.Util.getParameterString(b.params);if(d.length>0){var h=(a.indexOf("?")>-1)?"&":"?";a+=h+d}}if(b.proxy&&(a.indexOf("http")==0)){if(typeof b.proxy=="function"){a=b.proxy(a)}else{a=b.proxy+encodeURIComponent(a)}}e.open(b.method,a,b.async,b.user,b.password);for(var g in b.headers){e.setRequestHeader(g,b.headers[g])}var k=this.events;var j=this;e.onreadystatechange=function(){if(e.readyState==OpenLayers.Request.XMLHttpRequest.DONE){var l=k.triggerEvent("complete",{request:e,config:b,requestUrl:a});if(l!==false){j.runCallbacks({request:e,config:b,requestUrl:a})}}};if(b.async===false){e.send(b.data)}else{window.setTimeout(function(){e.send(b.data)},0)}return e},runCallbacks:function(e){var f=e.request;var d=e.config;var a=(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 b;if(d.failure){b=(d.scope)?OpenLayers.Function.bind(d.failure,d.scope):d.failure}a(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(b){b(f)}}},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},PUT:function(a){a=OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};if(!("CONTENT-TYPE" in OpenLayers.Util.upperCaseObject(a.headers))){a.headers["Content-Type"]="application/xml"}return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}};(function(){var e=window.XMLHttpRequest;var j=!!window.controllers,f=window.document.all&&!window.opera;function d(){this._object=e?new e:new window.ActiveXObject("Microsoft.XMLHTTP")}if(j&&e.wrapped){d.wrapped=e.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.onreadystatechange=null;d.onreadystatechange=null;d.onopen=null;d.onsend=null;d.onabort=null;d.prototype.open=function(n,q,m,s,l){this._async=m;var p=this,o=this.readyState;if(f){var k=function(){if(p._object.readyState!=d.DONE){a(p)}};if(m){window.attachEvent("onunload",k)}}this._object.onreadystatechange=function(){if(j&&!m){return}p.readyState=p._object.readyState;h(p);if(p._aborted){p.readyState=d.UNSENT;return}if(p.readyState==d.DONE){a(p);if(f&&m){window.detachEvent("onunload",k)}}if(o!=p.readyState){g(p)}o=p.readyState};if(d.onopen){d.onopen.apply(this,arguments)}this._object.open(n,q,m,s,l);if(!m&&j){this.readyState=d.OPENED;g(this)}};d.prototype.send=function(k){if(d.onsend){d.onsend.apply(this,arguments)}if(k&&k.nodeType){k=window.XMLSerializer?new window.XMLSerializer().serializeToString(k):k.xml;if(!this._headers["Content-Type"]){this._object.setRequestHeader("Content-Type","application/xml")}}this._object.send(k);if(j&&!this._async){this.readyState=d.OPENED;h(this);while(this.readyState<d.DONE){this.readyState++;g(this);if(this._aborted){return}}}};d.prototype.abort=function(){if(d.onabort){d.onabort.apply(this,arguments)}if(this.readyState>d.UNSENT){this._aborted=true}this._object.abort();a(this)};d.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};d.prototype.getResponseHeader=function(k){return this._object.getResponseHeader(k)};d.prototype.setRequestHeader=function(k,l){if(!this._headers){this._headers={}}this._headers[k]=l;return this._object.setRequestHeader(k,l)};d.prototype.toString=function(){return"[object XMLHttpRequest]"};d.toString=function(){return"[XMLHttpRequest]"};function g(k){if(k.onreadystatechange){k.onreadystatechange.apply(k)}if(d.onreadystatechange){d.onreadystatechange.apply(k)}}function b(l){var k=l.responseXML;if(f&&k&&!k.documentElement&&l.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/)){k=new ActiveXObject("Microsoft.XMLDOM");k.loadXML(l.responseText)}if(k){if((f&&k.parseError!=0)||(k.documentElement&&k.documentElement.tagName=="parsererror")){return null}}return k}function h(k){try{k.responseText=k._object.responseText}catch(l){}try{k.responseXML=b(k._object)}catch(l){}try{k.status=k._object.status}catch(l){}try{k.statusText=k._object.statusText}catch(l){}}function a(k){k._object.onreadystatechange=new window.Function;delete k._headers}if(!window.Function.prototype.apply){window.Function.prototype.apply=function(k,l){if(!l){l=[]}k.__func=this;k.__func(l[0],l[1],l[2],l[3],l[4]);delete k.__func}}OpenLayers.Request.XMLHttpRequest=d})();OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.projCode=b;if(window.Proj4js){this.proj=new Proj4js.Proj(b)}},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){if(a&&a.getCode){return this.getCode()==a.getCode()}else{return false}},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={};OpenLayers.Projection.addTransform=function(d,b,a){if(!OpenLayers.Projection.transforms[d]){OpenLayers.Projection.transforms[d]={}}OpenLayers.Projection.transforms[d][b]=a};OpenLayers.Projection.transform=function(a,d,b){if(d.proj&&b.proj){a=Proj4js.transform(d.proj,b.proj,a)}else{if(d&&b&&OpenLayers.Projection.transforms[d.getCode()]&&OpenLayers.Projection.transforms[d.getCode()][b.getCode()]){OpenLayers.Projection.transforms[d.getCode()][b.getCode()](a)}}return a};OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1000},EVENT_TYPES:["preaddlayer","addlayer","removelayer","changelayer","movestart","move","moveend","zoomend","popupopen","popupclose","addmarker","removemarker","clearmarkers","mouseover","mouseout","mousemove","dragstart","drag","dragend","changebaselayer"],id:null,fractionalZoom:false,events:null,allOverlays:false,div:null,dragging:false,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,viewRequestID:0,tileSize:null,projection:"EPSG:4326",units:"degrees",resolutions:null,maxResolution:1.40625,minResolution:null,maxScale:null,minScale:null,maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:true,panTween:null,eventListeners:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,paddingForPopups:null,initialize:function(j,e){if(arguments.length===1&&typeof j==="object"){e=j;j=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";OpenLayers.Util.extend(this,e);this.layers=[];this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(j);if(!this.div){this.div=document.createElement("div");this.div.style.height="1px";this.div.style.width="1px"}OpenLayers.Element.addClass(this.div,"olMap");var h=this.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.div,this.EVENT_TYPES,this.fallThrough,{includeXY:true});this.updateSize();if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}this.events.register("movestart",this,this.updateSize);if(OpenLayers.String.contains(navigator.appName,"Microsoft")){this.events.register("resize",this,this.updateSize)}else{this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this);OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy)}if(this.theme){var g=true;var d=document.getElementsByTagName("link");for(var f=0,a=d.length;f<a;++f){if(OpenLayers.Util.isEquivalentUrl(d.item(f).href,this.theme)){g=false;break}}if(g){var b=document.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",this.theme);document.getElementsByTagName("head")[0].appendChild(b)}}if(this.controls==null){if(OpenLayers.Control!=null){this.controls=[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoom(),new OpenLayers.Control.ArgParser(),new OpenLayers.Control.Attribution()]}else{this.controls=[]}}for(var f=0,a=this.controls.length;f<a;f++){this.addControlToMap(this.controls[f])}this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);if(e&&e.layers){this.addLayers(e.layers);if(e.center){this.setCenter(e.center,e.zoom)}}},render:function(a){this.div=OpenLayers.Util.getElement(a);OpenLayers.Element.addClass(this.div,"olMap");this.events.attachToElement(this.div);this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy){return false}if(this.panTween&&this.panTween.playing){this.panTween.stop()}OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;if(this.updateSizeDestroy){OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy)}else{this.events.unregister("resize",this,this.updateSize)}this.paddingForPopups=null;if(this.controls!=null){for(var a=this.controls.length-1;a>=0;--a){this.controls[a].destroy()}this.controls=null}if(this.layers!=null){for(var a=this.layers.length-1;a>=0;--a){this.layers[a].destroy(false)}this.layers=null}if(this.viewPortDiv){this.div.removeChild(this.viewPortDiv)}this.viewPortDiv=null;if(this.eventListeners){this.events.un(this.eventListeners);this.eventListeners=null}this.events.destroy();this.events=null},setOptions:function(a){OpenLayers.Util.extend(this,a)},getTileSize:function(){return this.tileSize},getBy:function(f,d,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this[f],function(g){return g[d]==a||(e&&a.test(g[d]))});return b},getLayersBy:function(b,a){return this.getBy("layers",b,a)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(b,a){return this.getBy("controls",b,a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(f){var b=null;for(var e=0,a=this.layers.length;e<a;e++){var d=this.layers[e];if(d.id==f){b=d;break}}return b},setLayerZIndex:function(b,a){b.setZIndex(this.Z_INDEX_BASE[b.isBaseLayer?"BaseLayer":"Overlay"]+a*5)},resetLayersZIndex:function(){for(var d=0,a=this.layers.length;d<a;d++){var b=this.layers[d];this.setLayerZIndex(b,d)}},addLayer:function(d){for(var b=0,a=this.layers.length;b<a;b++){if(this.layers[b]==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 b=0,a=d.length;b<a;b++){this.addLayer(d[b])}},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 b=0,a=this.layers.length;b<a;b++){var e=this.layers[b];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(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(e,b){var f=this.getLayerIndex(e);if(b<0){b=0}else{if(b>this.layers.length){b=this.layers.length}}if(f!=b){this.layers.splice(f,1);this.layers.splice(b,0,e);for(var d=0,a=this.layers.length;d<a;d++){this.setLayerZIndex(this.layers[d],d)}this.events.triggerEvent("changelayer",{layer:e,property:"order"});if(this.allOverlays){if(b===0){this.setBaseLayer(e)}else{if(this.baseLayer!==this.layers[0]){this.setBaseLayer(this.layers[0])}}}}},raiseLayer:function(b,d){var a=this.getLayerIndex(b)+d;this.setLayerIndex(b,a)},setBaseLayer:function(d){if(d!=this.baseLayer){if(OpenLayers.Util.indexOf(this.layers,d)!=-1){var a=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(a!=null){var b=this.getZoomForResolution(e||this.resolution,true);this.setCenter(a,b,false,true)}this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}}},addControl:function(b,a){this.controls.push(b);this.addControlToMap(b,a)},addControls:function(b,h){var f=(arguments.length===1)?[]:h;for(var e=0,a=b.length;e<a;e++){var g=b[e];var d=(f[e])?f[e]:null;this.addControl(g,d)}},addControlToMap:function(b,a){b.outsideViewport=(b.div!=null);if(this.displayProjection&&!b.displayProjection){b.displayProjection=this.displayProjection}b.setMap(this);var d=b.draw(a);if(d){if(!b.outsideViewport){d.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length;this.viewPortDiv.appendChild(d)}}if(b.autoActivate){b.activate()}},getControl:function(f){var b=null;for(var d=0,a=this.controls.length;d<a;d++){var e=this.controls[d];if(e.id==f){b=e;break}}return b},removeControl:function(a){if((a)&&(a==this.getControl(a.id))){if(a.div&&(a.div.parentNode==this.viewPortDiv)){this.viewPortDiv.removeChild(a.div)}OpenLayers.Util.removeItem(this.controls,a)}},addPopup:function(a,e){if(e){for(var b=this.popups.length-1;b>=0;--b){this.removePopup(this.popups[b])}}a.map=this;this.popups.push(a);var d=a.draw();if(d){d.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length;this.layerContainerDiv.appendChild(d)}},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div){try{this.layerContainerDiv.removeChild(a.div)}catch(b){}}a.map=null},getSize:function(){var a=null;if(this.size!=null){a=this.size.clone()}return a},updateSize:function(){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,b=this.layers.length;e<b;e++){this.layers[e].onMapResize()}var a=this.getCenter();if(this.baseLayer!=null&&a!=null){var f=this.getZoom();this.zoom=null;this.setCenter(a,f)}}}},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=this.div.offsetWidth;a.h=this.div.offsetHeight}if(a.w==0&&a.h==0||isNaN(a.w)&&isNaN(a.h)){a.w=parseInt(this.div.style.width);a.h=parseInt(this.div.style.height)}return a},calculateBounds:function(a,b){var f=null;if(a==null){a=this.getCenter()}if(b==null){b=this.getResolution()}if((a!=null)&&(b!=null)){var e=this.getSize();var g=e.w*b;var d=e.h*b;f=new OpenLayers.Bounds(a.lon-g/2,a.lat-d/2,a.lon+g/2,a.lat+d/2)}return f},getCenter:function(){var a=null;if(this.center){a=this.center.clone()}return a},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 b=g.add(e,d);if(!f.dragging||!b.equals(g)){var a=this.getLonLatFromViewPortPx(b);if(f.animate){this.panTo(a)}else{this.setCenter(a,null,f.dragging)}}},panTo:function(b){if(this.panMethod&&this.getExtent().scale(this.panRatio).containsLonLat(b)){if(!this.panTween){this.panTween=new OpenLayers.Tween(this.panMethod)}var a=this.getCenter();if(b.lon==a.lon&&b.lat==a.lat){return}var e={lon:a.lon,lat:a.lat};var d={lon:b.lon,lat:b.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(b)}},setCenter:function(d,a,b,e){this.moveTo(d,a,{dragging:b,forceZoomChange:e,caller:"setCenter"})},moveTo:function(h,o,s){if(!s){s={}}if(o!=null){o=parseFloat(o);if(!this.fractionalZoom){o=Math.round(o)}}var n=s.dragging;var d=s.forceZoomChange;var j=s.noEvent;if(this.panTween&&s.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(o==null){o=this.getZoom()}var e=this.getResolutionForZoom(o);var p=this.calculateBounds(h,e);if(!this.restrictedExtent.containsBounds(p)){var q=this.restrictedExtent.getCenterLonLat();if(p.getWidth()>this.restrictedExtent.getWidth()){h=new OpenLayers.LonLat(q.lon,h.lat)}else{if(p.left<this.restrictedExtent.left){h=h.add(this.restrictedExtent.left-p.left,0)}else{if(p.right>this.restrictedExtent.right){h=h.add(this.restrictedExtent.right-p.right,0)}}}if(p.getHeight()>this.restrictedExtent.getHeight()){h=new OpenLayers.LonLat(h.lon,q.lat)}else{if(p.bottom<this.restrictedExtent.bottom){h=h.add(0,this.restrictedExtent.bottom-p.bottom)}else{if(p.top>this.restrictedExtent.top){h=h.add(0,this.restrictedExtent.top-p.top)}}}}}var b=d||((this.isValidZoomLevel(o))&&(o!=this.getZoom()));var f=(this.isValidLonLat(h))&&(!h.equals(this.center));if(b||f||!n){if(!this.dragging&&!j){this.events.triggerEvent("movestart")}if(f){if((!b)&&(this.center)){this.centerLayerContainer(h)}this.center=h.clone()}if((b)||(this.layerContainerOrigin==null)){this.layerContainerOrigin=this.center.clone();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px"}if(b){this.zoom=o;this.resolution=this.getResolutionForZoom(o);this.viewRequestID++}var a=this.getExtent();if(this.baseLayer.visibility){this.baseLayer.moveTo(a,b,n);if(n){this.baseLayer.events.triggerEvent("move")}else{this.baseLayer.events.triggerEvent("moveend",{zoomChanged:b})}}a=this.baseLayer.getExtent();for(var g=0,l=this.layers.length;g<l;g++){var k=this.layers[g];if(k!==this.baseLayer&&!k.isBaseLayer){var m=k.calculateInRange();if(k.inRange!=m){k.inRange=m;if(!m){k.display(false)}this.events.triggerEvent("changelayer",{layer:k,property:"visibility"})}if(m&&k.visibility){k.moveTo(a,b,n);if(n){k.events.triggerEvent("move")}else{k.events.triggerEvent("moveend",{zoomChanged:b})}}}}if(b){for(var g=0,l=this.popups.length;g<l;g++){this.popups[g].updatePosition()}}this.events.triggerEvent("move");if(b){this.events.triggerEvent("zoomend")}}if(!n&&!j){this.events.triggerEvent("moveend")}this.dragging=!!n},centerLayerContainer:function(b){var a=this.getViewPortPxFromLonLat(this.layerContainerOrigin);var d=this.getViewPortPxFromLonLat(b);if((a!=null)&&(d!=null)){this.layerContainerDiv.style.left=Math.round(a.x-d.x)+"px";this.layerContainerDiv.style.top=Math.round(a.y-d.y)+"px"}},isValidZoomLevel:function(a){return((a!=null)&&(a>=0)&&(a<this.getNumZoomLevels()))},isValidLonLat:function(d){var b=false;if(d!=null){var a=this.getMaxExtent();b=a.containsLonLat(d)}return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode():null},getProjectionObject:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.projection}return a},getMaxResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.maxResolution}return a},getMaxExtent:function(b){var a=null;if(b&&b.restricted&&this.restrictedExtent){a=this.restrictedExtent}else{if(this.baseLayer!=null){a=this.baseLayer.maxExtent}}return a},getNumZoomLevels:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.numZoomLevels}return a},getExtent:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getExtent()}return a},getResolution:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getResolution()}else{if(this.allOverlays===true&&this.layers.length>0){a=this.layers[0].getResolution()}}return a},getUnits:function(){var a=null;if(this.baseLayer!=null){a=this.baseLayer.units}return a},getScale:function(){var d=null;if(this.baseLayer!=null){var b=this.getResolution();var a=this.baseLayer.units;d=OpenLayers.Util.getScaleFromResolution(b,a)}return d},getZoomForExtent:function(d,b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getZoomForExtent(d,b)}return a},getResolutionForZoom:function(b){var a=null;if(this.baseLayer){a=this.baseLayer.getResolutionForZoom(b)}return a},getZoomForResolution:function(a,d){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getZoomForResolution(a,d)}return b},zoomTo:function(a){if(this.isValidZoomLevel(a)){this.setCenter(null,a)}},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(e,d){var b=e.getCenterLonLat();if(this.baseLayer.wrapDateLine){var a=this.getMaxExtent();e=e.clone();while(e.right<e.left){e.right+=a.getWidth()}b=e.getCenterLonLat().wrapDateLine(a)}this.setCenter(b,this.getZoomForExtent(e,d))},zoomToMaxExtent:function(d){var b=(d)?d.restricted:true;var a=this.getMaxExtent({restricted:b});this.zoomToExtent(a)},zoomToScale:function(j,h){var e=OpenLayers.Util.getResolutionFromScale(j,this.baseLayer.units);var d=this.getSize();var g=d.w*e;var b=d.h*e;var a=this.getCenter();var f=new OpenLayers.Bounds(a.lon-g/2,a.lat-b/2,a.lon+g/2,a.lat+b/2);this.zoomToExtent(f,h)},getLonLatFromViewPortPx:function(a){var b=null;if(this.baseLayer!=null){b=this.baseLayer.getLonLatFromViewPortPx(a)}return b},getViewPortPxFromLonLat:function(b){var a=null;if(this.baseLayer!=null){a=this.baseLayer.getViewPortPxFromLonLat(b)}return a},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(b){var a=this.getViewPortPxFromLonLat(b);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getViewPortPxFromLayerPx:function(e){var d=null;if(e!=null){var b=parseInt(this.layerContainerDiv.style.left);var a=parseInt(this.layerContainerDiv.style.top);d=e.add(b,a)}return d},getLayerPxFromViewPortPx:function(d){var e=null;if(d!=null){var b=-parseInt(this.layerContainerDiv.style.left);var a=-parseInt(this.layerContainerDiv.style.top);e=d.add(b,a);if(isNaN(e.x)||isNaN(e.y)){e=null}}return e},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(b){var a=this.getPixelFromLonLat(b);return this.getLayerPxFromViewPortPx(a)},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:null,alwaysInRange:null,EVENT_TYPES:["loadstart","loadend","loadcancel","visibilitychanged","move","moveend"],events:null,map:null,isBaseLayer:false,alpha:false,displayInLayerSwitcher:true,visibility:true,attribution:null,inRange:false,imageSize:null,imageOffset:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null,numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:false,wrapDateLine:false,transitionEffect:null,SUPPORTED_TRANSITIONS:["resize"],initialize:function(b,a){this.addOptions(a);this.name=b;if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_");this.div=OpenLayers.Util.createDiv(this.id);this.div.style.width="100%";this.div.style.height="100%";this.div.dir="ltr";this.events=new OpenLayers.Events(this,this.div,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}}if(this.wrapDateLine){this.displayOutsideMaxExtent=true}},destroy:function(a){if(a==null){a=true}if(this.map!=null){this.map.removeLayer(this,a)}this.projection=null;this.map=null;this.name=null;this.div=null;this.options=null;if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy()}this.eventListeners=null;this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Layer(this.name,this.getOptions())}OpenLayers.Util.applyDefaults(a,this);a.map=null;return a},getOptions:function(){var a={};for(var b in this.options){a[b]=this[b]}return a},setName:function(a){if(a!=this.name){this.name=a;if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"name"})}}},addOptions:function(a){if(this.options==null){this.options={}}OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},onMapResize:function(){},redraw:function(){var b=false;if(this.map){this.inRange=this.calculateInRange();var d=this.getExtent();if(d&&this.inRange&&this.visibility){var a=true;this.moveTo(d,a,false);this.events.triggerEvent("moveend",{zoomChanged:a});b=true}}return b},moveTo:function(b,a,d){var e=this.visibility;if(!this.isBaseLayer){e=e&&this.inRange}this.display(e)},setMap:function(b){if(this.map==null){this.map=b;this.maxExtent=this.maxExtent||this.map.maxExtent;this.projection=this.projection||this.map.projection;if(this.projection&&typeof this.projection=="string"){this.projection=new OpenLayers.Projection(this.projection)}this.units=this.projection.getUnits()||this.units||this.map.units;this.initResolutions();if(!this.isBaseLayer){this.inRange=this.calculateInRange();var a=((this.visibility)&&(this.inRange));this.div.style.display=a?"":"none"}this.setTileSize()}},afterAdd:function(){},removeMap:function(a){},getImageSize:function(a){return(this.imageSize||this.tileSize)},setTileSize:function(a){var b=(a)?a:((this.tileSize)?this.tileSize:this.map.getTileSize());this.tileSize=b;if(this.gutter){this.imageOffset=new OpenLayers.Pixel(-this.gutter,-this.gutter);this.imageSize=new OpenLayers.Size(b.w+(2*this.gutter),b.h+(2*this.gutter))}},getVisibility:function(){return this.visibility},setVisibility:function(a){if(a!=this.visibility){this.visibility=a;this.display(a);this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"})}this.events.triggerEvent("visibilitychanged")}},display:function(a){if(a!=(this.div.style.display!="none")){this.div.style.display=(a&&this.calculateInRange())?"block":"none"}},calculateInRange:function(){var b=false;if(this.alwaysInRange){b=true}else{if(this.map){var a=this.map.getResolution();b=((a>=this.minResolution)&&(a<=this.maxResolution))}}return b},setIsBaseLayer:function(a){if(a!=this.isBaseLayer){this.isBaseLayer=a;if(this.map!=null){this.map.events.triggerEvent("changebaselayer",{layer:this})}}},initResolutions:function(){var o=new Array("projection","units","scales","resolutions","maxScale","minScale","maxResolution","minResolution","minExtent","maxExtent","numZoomLevels","maxZoomLevel");var b=["projection","units"];var f=false;var e={};for(var g=0,k=o.length;g<k;g++){var q=o[g];if(this.options[q]&&OpenLayers.Util.indexOf(b,q)==-1){f=true}e[q]=this.options[q]||this.map[q]}if(this.alwaysInRange==null){this.alwaysInRange=!f}if((this.options.minScale!=null||this.options.maxScale!=null)&&this.options.scales==null){e.scales=null}if((this.options.minResolution!=null||this.options.maxResolution!=null)&&this.options.resolutions==null){e.resolutions=null}if((!e.numZoomLevels)&&(e.maxZoomLevel)){e.numZoomLevels=e.maxZoomLevel+1}if((e.scales!=null)||(e.resolutions!=null)){if(e.scales!=null){e.resolutions=[];for(var g=0,k=e.scales.length;g<k;g++){var d=e.scales[g];e.resolutions[g]=OpenLayers.Util.getResolutionFromScale(d,e.units)}}e.numZoomLevels=e.resolutions.length}else{if(e.minScale){e.maxResolution=OpenLayers.Util.getResolutionFromScale(e.minScale,e.units)}else{if(e.maxResolution=="auto"){var p=this.map.getSize();var n=e.maxExtent.getWidth()/p.w;var j=e.maxExtent.getHeight()/p.h;e.maxResolution=Math.max(n,j)}}if(e.maxScale!=null){e.minResolution=OpenLayers.Util.getResolutionFromScale(e.maxScale,e.units)}else{if((e.minResolution=="auto")&&(e.minExtent!=null)){var p=this.map.getSize();var n=e.minExtent.getWidth()/p.w;var j=e.minExtent.getHeight()/p.h;e.minResolution=Math.max(n,j)}}if(e.minResolution!=null&&this.options.numZoomLevels==undefined){var m=e.maxResolution/e.minResolution;e.numZoomLevels=Math.floor(Math.log(m)/Math.log(2))+1}e.resolutions=new Array(e.numZoomLevels);var a=2;if(typeof e.minResolution=="number"&&e.numZoomLevels>1){a=Math.pow((e.maxResolution/e.minResolution),(1/(e.numZoomLevels-1)))}for(var g=0;g<e.numZoomLevels;g++){var l=e.maxResolution/Math.pow(a,g);e.resolutions[g]=l}}e.resolutions.sort(function(t,s){return(s-t)});this.resolutions=e.resolutions;this.maxResolution=e.resolutions[0];var h=e.resolutions.length-1;this.minResolution=e.resolutions[h];this.scales=[];for(var g=0,k=e.resolutions.length;g<k;g++){this.scales[g]=OpenLayers.Util.getScaleFromResolution(e.resolutions[g],e.units)}this.minScale=this.scales[0];this.maxScale=this.scales[this.scales.length-1];this.numZoomLevels=e.numZoomLevels},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)},getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(b,d){var e=this.map.getSize();if(e){var a=Math.max(b.getWidth()/e.w,b.getHeight()/e.h);return this.getZoomForResolution(a,d)}return null},getDataExtent:function(){},getResolutionForZoom:function(d){d=Math.max(0,Math.min(d,this.resolutions.length-1));var b;if(this.map.fractionalZoom){var a=Math.floor(d);var e=Math.ceil(d);b=this.resolutions[a]-((d-a)*(this.resolutions[a]-this.resolutions[e]))}else{b=this.resolutions[Math.round(d)]}return b},getZoomForResolution:function(f,a){var o;if(this.map.fractionalZoom){var l=0;var d=this.resolutions.length-1;var e=this.resolutions[l];var b=this.resolutions[d];var k;for(var g=0,h=this.resolutions.length;g<h;++g){k=this.resolutions[g];if(k>=f){e=k;l=g}if(k<=f){b=k;d=g;break}}var j=e-b;if(j>0){o=l+((e-f)/j)}else{o=l}}else{var m;var n=Number.POSITIVE_INFINITY;for(var g=0,h=this.resolutions.length;g<h;g++){if(a){m=Math.abs(this.resolutions[g]-f);if(m>n){break}n=m}else{if(this.resolutions[g]<f){break}}}o=Math.max(0,g-1)}return o},getLonLatFromViewPortPx:function(b){var f=null;if(b!=null){var e=this.map.getSize();var a=this.map.getCenter();if(a){var d=this.map.getResolution();var h=b.x-(e.w/2);var g=b.y-(e.h/2);f=new OpenLayers.LonLat(a.lon+h*d,a.lat-g*d);if(this.wrapDateLine){f=f.wrapDateLine(this.maxExtent)}}}return f},getViewPortPxFromLonLat:function(e){var b=null;if(e!=null){var a=this.map.getResolution();var d=this.map.getExtent();b=new OpenLayers.Pixel((1/a*(e.lon-d.left)),(1/a*(d.top-e.lat)))}return b},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var e=0,a=this.div.childNodes.length;e<a;++e){var d=this.div.childNodes[e].firstChild;OpenLayers.Util.modifyDOMElement(d,null,null,null,null,null,null,b)}if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(b){if(this.gutter){var a=this.gutter*this.map.getResolution();b=new OpenLayers.Bounds(b.left-a,b.bottom-a,b.right+a,b.top+a)}if(this.wrapDateLine){var d={rightTolerance:this.getResolution()};b=b.wrapDateLine(this.maxExtent,d)}return b},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(a,b,e,d){this.url=a;this.size=(b)?b: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(a){if(a!=null){this.size=a}this.draw()},setUrl:function(a){if(a!=null){this.url=a}this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},erase:function(){if(this.imageDiv!=null&&this.imageDiv.parentNode!=null){OpenLayers.Element.remove(this.imageDiv)}},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null,null,null,null,a)},moveTo:function(a){if(a!=null){this.px=a}if(this.imageDiv!=null){if(this.px==null){this.display(false)}else{if(this.calculateOffset){this.offset=this.calculateOffset(this.size)}var b=this.px.offset(this.offset);OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,b)}}},display:function(a){this.imageDiv.style.display=(a)?"":"none"},isDrawn:function(){var a=(this.imageDiv&&this.imageDiv.parentNode&&(this.imageDiv.parentNode.nodeType!=11));return a},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(d,b){this.lonlat=d;var a=(b)?b:OpenLayers.Marker.defaultIcon();if(this.icon==null){this.icon=a}else{this.icon.url=a.url;this.icon.size=a.size;this.icon.offset=a.offset;this.icon.calculateOffset=a.calculateOffset}this.events=new OpenLayers.Events(this,this.icon.imageDiv,null)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;if(this.icon!=null){this.icon.destroy();this.icon=null}},draw:function(a){return this.icon.draw(a)},erase:function(){if(this.icon!=null){this.icon.erase()}},moveTo:function(a){if((a!=null)&&(this.icon!=null)){this.icon.moveTo(a)}this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){var a=(this.icon&&this.icon.isDrawn());return a},onScreen:function(){var b=false;if(this.map){var a=this.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},inflate:function(b){if(this.icon){var a=new OpenLayers.Size(this.icon.size.w*b,this.icon.size.h*b);this.icon.setSize(a)}},setOpacity:function(a){this.icon.setOpacity(a)},setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){var a=OpenLayers.Util.getImagesLocation()+"marker.png";var b=new OpenLayers.Size(21,25);var d=function(e){return new OpenLayers.Pixel(-(e.w/2),-e.h)};return new OpenLayers.Icon(a,b,null,d)};OpenLayers.Marker.Label=OpenLayers.Class(OpenLayers.Marker,{alignment:null,labelDiv:null,label:null,mouseOver:false,labelClass:"olMarkerLabel",events:null,div:null,onlyOnMouseOver:false,mouseover:false,mousedownTimeout:null,isMoving:false,cursorcache:null,markerStartXY:null,mouseStartXY:null,initialize:function(f,e,d,b){var a=[];OpenLayers.Util.extend(this,b);a.push(f,e,d);OpenLayers.Marker.prototype.initialize.apply(this,a);this.label=d;this.mousedownTimeout=null;this.isMoving=false;this.cursorcache=null;this.mouseStartXY=null;this.markerStartXY=null;this.events.includeXY=true;this.events.addEventType("moveend");this.events.addEventType("movestart");this.events.addEventType("markerclicked");this.labelDiv=OpenLayers.Util.createDiv(this.icon.id+"_Text",null,null);this.labelDiv.className=this.labelClass;this.labelDiv.innerHTML=d;this.labelDiv.style.top="0px";if(this.alignment=="left"){this.labelDiv.style.right=""+((this.icon)?(this.icon.size.w+5):0)+"px";this.labelDiv.style.textAlign="right"}else{this.labelDiv.style.left=""+((this.icon)?(this.icon.size.w+5):0)+"px"}},beginmove:function(){if(this.div){this.cursorcache=this.div.style.cursor;this.div.style.cursor="move"}if(this.mouseOver===true){this.events.unregister("mouseover",this,this.onmouseover);this.events.unregister("mouseout",this,this.onmouseout)}this.events.triggerEvent("movestart",this);this.isMoving=true;this.map.events.register("mousemove",this,this.onmousemove)},destroy:function(){this.label=null;this.labelDiv=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},draw:function(a){this.div=OpenLayers.Marker.prototype.draw.apply(this,arguments);this.div.style.cursor="pointer";this.div.appendChild(this.labelDiv,this.div.firstChild);this.labelDiv.style.display="block";if(this.mouseOver===true){this.labelDiv.style.display="none";this.events.register("mouseover",this,this.onmouseover);this.events.register("mouseout",this,this.onmouseout)}this.events.register("mousedown",this,this.onmousedown);this.events.register("mouseup",this,this.onmouseup);return this.div},onmousedown:function(a){this.isMoving=false;if(this.mousedownTimeout){clearTimeout(this.mousedownTimeout);this.mousedownTimeout=null}this.mouseStartXY=this.map.events.getMousePosition(a);this.markerStartXY=this.icon.px.clone();this.mousedownTimeout=setTimeout(this.beginmove.bind(this),200);OpenLayers.Event.stop(a,true)},onmousemove:function(a){if((a)&&(a.xy)){var b=a.xy.add(-this.mouseStartXY.x,-this.mouseStartXY.y);if((this.icon)&&(this.icon.px)){this.moveTo(this.markerStartXY.add(b.x,b.y))}}},onmouseover:function(a){if(!this.mouseover){this.labelDiv.style.display=(this.labelDiv.style.display=="none"?"block":"none");this.mouseover=true}OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mouseover=false;this.labelDiv.style.display="none";OpenLayers.Event.stop(a,true)},onmouseup:function(a){if(this.mousedownTimeout){clearTimeout(this.mousedownTimeout);this.mousedownTimeout=null}this.map.events.unregister("mousemove",this,this.onmousemove);if(this.isMoving===true){if(this.div){this.div.style.cursor=this.cursorcache}if(this.mouseOver===true){this.events.register("mouseover",this,this.onmouseover);this.events.register("mouseout",this,this.onmouseout)}this.events.triggerEvent("moveend",this)}else{this.events.triggerEvent("markerclicked",this)}this.isMoving=false},CLASS_NAME:"OpenLayers.Marker.Label"});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,b,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(b!=null){this.contentHTML=b}this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass;var a=this.id+"_GroupDiv";this.groupDiv=OpenLayers.Util.createDiv(a,null,null,null,"relative",null,"hidden");var h=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(h,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);if(f){this.addCloseBox(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(a){if(a==null){if((this.lonlat!=null)&&(this.map!=null)){a=this.map.getLayerPxFromLonLat(this.lonlat)}}if(this.closeOnMove){this.map.events.register("movestart",this,this.hide)}if(!this.disableFirefoxOverflowHack&&OpenLayers.Util.getBrowserName()=="firefox"){this.map.events.register("movestart",this,function(){var b=document.defaultView.getComputedStyle(this.contentDiv,null);var d=b.getPropertyValue("overflow");if(d!="hidden"){this.contentDiv._oldOverflow=d;this.contentDiv.style.overflow="hidden"}});this.map.events.register("moveend",this,function(){var b=this.contentDiv._oldOverflow;if(b){this.contentDiv.style.overflow=b;this.contentDiv._oldOverflow=null}})}this.moveTo(a);if(!this.autoSize&&!this.size){this.setSize(this.contentSize)}this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();if(this.panMapIfOutOfView){this.panIntoView()}return this.div},updatePosition:function(){if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);if(a){this.moveTo(a)}}},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){if(this.visible()){this.hide()}else{this.show()}},show:function(){OpenLayers.Element.show(this.div);if(this.panMapIfOutOfView){this.panIntoView()}},hide:function(){OpenLayers.Element.hide(this.div)},setSize:function(d){this.size=d.clone();var b=this.getContentDivPadding();var a=b.left+b.right;var f=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;f+=this.padding.top+this.padding.bottom;if(this.closeDiv){var e=parseInt(this.closeDiv.style.width);a+=e+b.right}this.size.w+=a;this.size.h+=f;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=b.left+b.right;this.contentSize.h+=b.bottom+b.top}if(this.div!=null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}if(this.contentDiv!=null){this.contentDiv.style.width=d.w+"px";this.contentDiv.style.height=d.h+"px"}},updateSize:function(){var f="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>";var j=(this.map)?this.map.layerContainerDiv:document.body;var k=OpenLayers.Util.getRenderedDimensions(f,null,{displayClass:this.displayClass,containerElement:j});var h=this.getSafeContentSize(k);var g=null;if(h.equals(k)){g=k}else{var b=new OpenLayers.Size();b.w=(h.w<k.w)?h.w:null;b.h=(h.h<k.h)?h.h:null;if(b.w&&b.h){g=h}else{var e=OpenLayers.Util.getRenderedDimensions(f,b,{displayClass:this.contentDisplayClass,containerElement:j});var d=OpenLayers.Element.getStyle(this.contentDiv,"overflow");if((d!="hidden")&&(e.equals(h))){var a=OpenLayers.Util.getScrollbarWidth();if(b.w){e.h+=a}else{e.w+=a}}g=this.getSafeContentSize(e)}}this.setSize(g)},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){this.div.style.backgroundColor=this.backgroundColor}},setOpacity:function(a){if(a!=undefined){this.opacity=a}if(this.div!=null){this.div.style.opacity=this.opacity;this.div.style.filter="alpha(opacity="+this.opacity*100+")"}},setBorder:function(a){if(a!=undefined){this.border=a}if(this.div!=null){this.div.style.border=this.border}},setContentHTML:function(a){if(a!=null){this.contentHTML=a}if((this.contentDiv!=null)&&(this.contentHTML!=null)&&(this.contentHTML!=this.contentDiv.innerHTML)){this.contentDiv.innerHTML=this.contentHTML;if(this.autoSize){this.registerImageListeners();this.updateSize()}}},registerImageListeners:function(){var g=function(){this.popup.updateSize();if(this.popup.visible()&&this.popup.panMapIfOutOfView){this.popup.panIntoView()}OpenLayers.Event.stopObserving(this.img,"load",this.img._onImageLoad)};var b=this.contentDiv.getElementsByTagName("img");for(var f=0,a=b.length;f<a;f++){var d=b[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(m){var e=m.clone();var k=this.getContentDivPadding();var l=k.left+k.right;var h=k.top+k.bottom;this.fixPadding();l+=this.padding.left+this.padding.right;h+=this.padding.top+this.padding.bottom;if(this.closeDiv){var d=parseInt(this.closeDiv.style.width);l+=d+k.right}if(this.minSize){e.w=Math.max(e.w,(this.minSize.w-l));e.h=Math.max(e.h,(this.minSize.h-h))}if(this.maxSize){e.w=Math.min(e.w,(this.maxSize.w-l));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 j=this.map.getPixelFromLonLat(this.lonlat);switch(this.relativePosition){case"tr":g=j.x;f=this.map.size.h-j.y;break;case"tl":g=this.map.size.w-j.x;f=this.map.size.h-j.y;break;case"bl":g=this.map.size.w-j.x;f=j.y;break;case"br":g=j.x;f=j.y;break;default:g=j.x;f=this.map.size.h-j.y;break}}var a=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-h-f;var b=this.map.size.w-this.map.paddingForPopups.left-this.map.paddingForPopups.right-l-g;e.w=Math.min(e.w,b);e.h=Math.min(e.h,a)}return e},getContentDivPadding:function(){var a=this._contentDivPadding;if(!a){if(this.div.parentNode==null){this.div.style.display="none";document.body.appendChild(this.div)}a=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv,"padding-top"));this._contentDivPadding=a;if(this.div.parentNode==document.body){document.body.removeChild(this.div);this.div.style.display=""}}return a},addCloseBox:function(d){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,new OpenLayers.Size(17,17));this.closeDiv.className="olPopupCloseBox";var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+"px";this.closeDiv.style.top=b.top+"px";this.groupDiv.appendChild(this.closeDiv);var a=d||function(f){this.hide();OpenLayers.Event.stop(f)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,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 b=e.x-d.x;var a=e.y-d.y;this.map.pan(b,a)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,true);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,scope:this})},onmousedown:function(a){this.mousedown=true;OpenLayers.Event.stop(a,true)},onmousemove:function(a){if(this.mousedown){OpenLayers.Event.stop(a,true)}},onmouseup:function(a){if(this.mousedown){this.mousedown=false;OpenLayers.Event.stop(a,true)}},onclick:function(a){OpenLayers.Event.stop(a,true)},onmouseout:function(a){this.mousedown=false},ondblclick:function(a){OpenLayers.Event.stop(a,true)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white";OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.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(e,a,f,b,d){this.layer=e;this.position=a.clone();this.bounds=f.clone();this.url=b;this.size=d.clone();this.id=OpenLayers.Util.createUniqueID("Tile_");this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},unload:function(){if(this.isLoading){this.isLoading=false;this.events.triggerEvent("unload")}},destroy:function(){this.layer=null;this.bounds=null;this.size=null;this.position=null;this.events.destroy();this.events=null},clone:function(a){if(a==null){a=new OpenLayers.Tile(this.layer,this.position,this.bounds,this.url,this.size)}OpenLayers.Util.applyDefaults(a,this);return a},draw:function(){var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));this.shouldDraw=(b||this.layer.displayOutsideMaxExtent);this.clear();return this.shouldDraw},moveTo:function(b,a,d){if(d==null){d=true}this.bounds=b.clone();this.position=a.clone();if(d){this.draw()}},clear:function(){},getBoundsFromBaseLayer:function(a){var g=OpenLayers.i18n("reprojectDeprecated",{layerName:this.layer.name});OpenLayers.Console.warn(g);var e=this.layer.map.getLonLatFromLayerPx(a);var d=a.clone();d.x+=this.size.w;d.y+=this.size.h;var b=this.layer.map.getLonLatFromLayerPx(d);if(e.lon>b.lon){if(e.lon<0){e.lon=-180-(e.lon+180)}else{b.lon=180+b.lon+180}}var f=new OpenLayers.Bounds(e.lon,b.lat,b.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,initialize:function(e,a,f,b,d){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=b;this.frame=document.createElement("div");this.frame.style.overflow="hidden";this.frame.style.position="absolute";this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack()},destroy:function(){if(this.imgDiv!=null){if(this.layerAlphaHack){OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0])}OpenLayers.Event.stopObservingElement(this.imgDiv);if(this.imgDiv.parentNode==this.frame){this.frame.removeChild(this.imgDiv);this.imgDiv.map=null}this.imgDiv.urls=null;this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}this.imgDiv=null;if((this.frame!=null)&&(this.frame.parentNode==this.layer.div)){this.layer.div.removeChild(this.frame)}this.frame=null;if(this.backBufferTile){this.backBufferTile.destroy();this.backBufferTile=null}this.layer.events.unregister("loadend",this,this.resetBackBuffer);OpenLayers.Tile.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Tile.Image(this.layer,this.position,this.bounds,this.url,this.size)}a=OpenLayers.Tile.prototype.clone.apply(this,[a]);a.imgDiv=null;return a},draw:function(){if(this.layer!=this.layer.map.baseLayer&&this.layer.reproject){this.bounds=this.getBoundsFromBaseLayer(this.position)}var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(OpenLayers.Util.indexOf(this.layer.SUPPORTED_TRANSITIONS,this.layer.transitionEffect)!=-1){if(a){if(!this.backBufferTile){this.backBufferTile=this.clone();this.backBufferTile.hide();this.backBufferTile.isBackBuffer=true;this.events.register("loadend",this,this.resetBackBuffer);this.layer.events.register("loadend",this,this.resetBackBuffer)}this.startTransition()}else{if(this.backBufferTile){this.backBufferTile.clear()}}}else{if(a&&this.isFirstDraw){this.events.register("loadend",this,this.showTile);this.isFirstDraw=false}}if(!a){return false}if(this.isLoading){this.events.triggerEvent("reload")}else{this.isLoading=true;this.events.triggerEvent("loadstart")}return this.renderTile()},resetBackBuffer:function(){this.showTile();if(this.backBufferTile&&(this.isFirstDraw||!this.layer.numLoadingTiles)){this.isFirstDraw=false;var a=this.layer.maxExtent;var b=(a&&this.bounds.intersectsBounds(a,false));if(b){this.backBufferTile.position=this.position;this.backBufferTile.bounds=this.bounds;this.backBufferTile.size=this.size;this.backBufferTile.imageSize=this.layer.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.imgDiv==null){this.initImgDiv()}this.imgDiv.viewRequestID=this.layer.map.viewRequestID;if(this.layer.async){this.layer.getURLasync(this.bounds,this,"url",this.positionImage)}else{if(this.layer.url instanceof Array){this.imgDiv.urls=this.layer.url.slice()}this.url=this.layer.getURL(this.bounds);this.positionImage()}return true},positionImage:function(){if(this.layer==null){return}var a=this.frame.style;a.left=this.position.x+"px";a.top=this.position.y+"px";a.height=this.size.h+"px";a.width=this.size.w+"px";var b=this.layer.getImageSize(this.bounds);if(this.layerAlphaHack){OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,null,null,b,this.url)}else{this.imgDiv.style.height=b.h+"px";this.imgDiv.style.width=b.w+"px";this.imgDiv.src=this.url}},clear:function(){if(this.imgDiv){this.hide();if(OpenLayers.Tile.Image.useBlankTile){this.imgDiv.src=OpenLayers.Util.getImagesLocation()+"blank.gif"}}},initImgDiv:function(){var e=this.layer.imageOffset;var b=this.layer.getImageSize(this.bounds);if(this.layerAlphaHack){this.imgDiv=OpenLayers.Util.createAlphaImageDiv(null,e,b,null,"relative",null,null,null,true)}else{this.imgDiv=OpenLayers.Util.createImage(null,e,b,null,"relative",null,null,true)}this.imgDiv.className="olTileImage";this.frame.style.zIndex=this.isBackBuffer?0:1;this.frame.appendChild(this.imgDiv);this.layer.div.appendChild(this.frame);if(this.layer.opacity!=null){OpenLayers.Util.modifyDOMElement(this.imgDiv,null,null,null,null,null,null,this.layer.opacity)}this.imgDiv.map=this.layer.map;var 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 a=function(){if(this.imgDiv._attempts>OpenLayers.IMAGE_RELOAD_ATTEMPTS){d.call(this)}};OpenLayers.Event.observe(this.imgDiv,"error",OpenLayers.Function.bind(a,this))},checkImgURL:function(){if(this.layer){var a=this.layerAlphaHack?this.imgDiv.firstChild.src:this.imgDiv.src;if(!OpenLayers.Util.isEquivalentUrl(a,this.url)){this.hide()}}},startTransition:function(){if(!this.backBufferTile||!this.backBufferTile.imgDiv){return}var 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 b=new OpenLayers.Size(this.backBufferTile.size.w*e,this.backBufferTile.size.h*e);var a=this.layer.map.getLayerPxFromLonLat(d);OpenLayers.Util.modifyDOMElement(this.backBufferTile.frame,null,a,b);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(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.frame.scrollLeft=this.frame.scrollLeft}}},hide:function(){this.frame.style.display="none"},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Tile.Image.useBlankTile=(OpenLayers.Util.getBrowserName()=="safari"||OpenLayers.Util.getBrowserName()=="opera");OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:true,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(d,b,f,e,a){this.url=b;this.extent=f;this.maxExtent=f;this.size=e;OpenLayers.Layer.prototype.initialize.apply(this,[d,a]);this.aspectRatio=(this.extent.getHeight()/this.size.h)/(this.extent.getWidth()/this.size.w)},destroy:function(){if(this.tile){this.removeTileMonitoringHooks(this.tile);this.tile.destroy();this.tile=null}OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions())}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setMap:function(a){if(this.options.maxResolution==null){this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w}OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(f,a,g){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var b=(this.tile==null);if(a||b){this.setTileSize();var e=new OpenLayers.LonLat(this.extent.left,this.extent.top);var d=this.map.getLayerPxFromLonLat(e);if(b){this.tile=new OpenLayers.Tile.Image(this,d,this.extent,null,this.tileSize);this.addTileMonitoringHooks(this.tile)}else{this.tile.size=this.tileSize.clone();this.tile.position=d.clone()}this.tile.draw()}},setTileSize:function(){var b=this.extent.getWidth()/this.map.getResolution();var a=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(b,a)},addTileMonitoringHooks:function(a){a.onLoadStart=function(){this.events.triggerEvent("loadstart")};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.events.triggerEvent("loadend")};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},setUrl:function(a){this.url=a;this.tile.draw()},getURL:function(a){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;if(this.sphericalMercator){a=this.map.calculateBounds()}else{a=OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)}return a},initMercatorParameters:function(){this.RESOLUTIONS=[];var a=156543.0339;for(var b=0;b<=this.MAX_ZOOM_LEVEL;++b){this.RESOLUTIONS[b]=a/Math.pow(2,b)}this.units="m";this.projection="EPSG:900913"},forwardMercator:function(d,b){var a=d*20037508.34/180;var e=Math.log(Math.tan((90+b)*Math.PI/360))/(Math.PI/180);e=e*20037508.34/180;return new OpenLayers.LonLat(a,e)},inverseMercator:function(a,e){var d=(a/20037508.34)*180;var b=(e/20037508.34)*180;b=180/Math.PI*(2*Math.atan(Math.exp(b*Math.PI/180))-Math.PI/2);return new OpenLayers.LonLat(d,b)},projectForward:function(a){var b=OpenLayers.Layer.SphericalMercator.forwardMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a},projectInverse:function(a){var b=OpenLayers.Layer.SphericalMercator.inverseMercator(a.x,a.y);a.x=b.lon;a.y=b.lat;return a}};OpenLayers.Projection.addTransform("EPSG:4326","EPSG:900913",OpenLayers.Layer.SphericalMercator.projectForward);OpenLayers.Projection.addTransform("EPSG:900913","EPSG:4326",OpenLayers.Layer.SphericalMercator.projectInverse);OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:true,isBaseLayer:true,isFixed:true,pane:null,mapObject:null,initialize:function(b,a){OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(this.pane==null){this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane")}},destroy:function(){this.mapObject=null;this.pane=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";if(OpenLayers.Util.getBrowserName()=="msie"){this.pane.style.background="url("+OpenLayers.Util.getImagesLocation()+"blank.gif)"}if(this.isFixed){this.map.viewPortDiv.appendChild(this.pane)}else{this.map.layerContainerDiv.appendChild(this.pane)}this.loadMapObject();if(this.mapObject==null){this.loadWarningMessage()}},removeMap:function(a){if(this.pane&&this.pane.parentNode){this.pane.parentNode.removeChild(this.pane)}OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var h=this.map.getSize();if(!h){h={w:300,h:200}}var a=Math.min(h.w,300);var f=Math.min(h.h,200);var b=new OpenLayers.Size(a,f);var e=new OpenLayers.Pixel(h.w/2,h.h/2);var d=e.add(-b.w/2,-b.h/2);var g=OpenLayers.Util.createDiv(this.name+"_warning",d,b,null,null,null,"auto");g.style.padding="7px";g.style.backgroundColor="yellow";g.innerHTML=this.getWarningHTML();this.div.appendChild(g)},getWarningHTML:function(){return""},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(a){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveTo:function(d,e,l){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(this.mapObject!=null){var f=this.map.getCenter();var h=this.map.getZoom();if(f!=null){var g=this.getMapObjectCenter();var b=this.getOLLonLatFromMapObjectLonLat(g);var j=this.getMapObjectZoom();var o=this.getOLZoomFromMapObjectZoom(j);if(!(f.equals(b))||!(h==o)){if(l&&this.dragPanMapObject&&this.smoothDragPan){var k=this.map.getViewPortPxFromLonLat(b);var m=this.map.getViewPortPxFromLonLat(f);this.dragPanMapObject(m.x-k.x,k.y-m.y)}else{var a=this.getMapObjectLonLatFromOLLonLat(f);var n=this.getMapObjectZoomFromOLZoom(h);this.setMapObjectCenter(a,n,l)}}}}},getLonLatFromViewPortPx:function(a){var b=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var e=this.getMapObjectPixelFromOLPixel(a);var d=this.getMapObjectLonLatFromMapObjectPixel(e);b=this.getOLLonLatFromMapObjectLonLat(d)}return b},getViewPortPxFromLonLat:function(b){var a=null;if((this.mapObject!=null)&&(this.getMapObjectCenter()!=null)){var e=this.getMapObjectLonLatFromOLLonLat(b);var d=this.getMapObjectPixelFromMapObjectLonLat(e);a=this.getOLPixelFromMapObjectPixel(d)}return a},getOLLonLatFromMapObjectLonLat:function(e){var a=null;if(e!=null){var d=this.getLongitudeFromMapObjectLonLat(e);var b=this.getLatitudeFromMapObjectLonLat(e);a=new OpenLayers.LonLat(d,b)}return a},getMapObjectLonLatFromOLLonLat:function(a){var b=null;if(a!=null){b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat)}return b},getOLPixelFromMapObjectPixel:function(e){var b=null;if(e!=null){var a=this.getXFromMapObjectPixel(e);var d=this.getYFromMapObjectPixel(e);b=new OpenLayers.Pixel(a,d)}return b},getMapObjectPixelFromOLPixel:function(a){var b=null;if(a!=null){b=this.getMapObjectPixelFromXY(a.x,a.y)}return b},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){var d=new Array("minZoomLevel","maxZoomLevel","numZoomLevels");for(var b=0,a=d.length;b<a;b++){var g=d[b];this[g]=(this.options[g]!=null)?this.options[g]:this.map[g]}if((this.minZoomLevel==null)||(this.minZoomLevel<this.MIN_ZOOM_LEVEL)){this.minZoomLevel=this.MIN_ZOOM_LEVEL}var h;var f=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;if(((this.options.numZoomLevels==null)&&(this.options.maxZoomLevel!=null))||((this.numZoomLevels==null)&&(this.maxZoomLevel!=null))){h=this.maxZoomLevel-this.minZoomLevel+1}else{h=this.numZoomLevels}if(h!=null){this.numZoomLevels=Math.min(h,f)}else{this.numZoomLevels=f}this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(this.RESOLUTIONS!=null){var e=0;this.resolutions=[];for(var b=this.minZoomLevel;b<=this.maxZoomLevel;b++){this.resolutions[e++]=this.RESOLUTIONS[b]}this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getResolution.apply(this,arguments)}else{var a=null;var d=this.map.getSize();var b=this.getExtent();if((d!=null)&&(b!=null)){a=Math.max(b.getWidth()/d.w,b.getHeight()/d.h)}return a}},getExtent:function(){var d=null;var b=this.map.getSize();if(b){var f=new OpenLayers.Pixel(0,0);var g=this.getLonLatFromViewPortPx(f);var a=new OpenLayers.Pixel(b.w,b.h);var e=this.getLonLatFromViewPortPx(a);if((g!=null)&&(e!=null)){d=new OpenLayers.Bounds(g.lon,e.lat,e.lon,g.lat)}}return d},getZoomForResolution:function(a){if(this.resolutions!=null){return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments)}else{var b=OpenLayers.Layer.prototype.getExtent.apply(this,[]);return this.getZoomForExtent(b)}},getOLZoomFromMapObjectZoom:function(a){var b=null;if(a!=null){b=a-this.minZoomLevel}return b},getMapObjectZoomFromOLZoom:function(a){var b=null;if(a!=null){b=a+this.minZoomLevel}return b},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.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,sphericalMercator:false,dragObject:null,termsOfUse:null,poweredBy:null,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);this.addContainerPxFunction();if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters()}},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},loadMapObject:function(){if(!this.type){this.type=G_NORMAL_MAP}var h,f,a;var d=OpenLayers.Layer.Google.cache[this.map.id];if(d){h=d.mapObject;f=d.termsOfUse;a=d.poweredBy;++d.count}else{var b=this.map.viewPortDiv;var j=document.createElement("div");j.id=this.map.id+"_GMap2Container";j.style.position="absolute";j.style.width="100%";j.style.height="100%";b.appendChild(j);try{h=new GMap2(j);f=j.lastChild;b.appendChild(f);f.style.zIndex="1100";f.style.right="";f.style.bottom="";f.className="olLayerGoogleCopyright";a=j.lastChild;b.appendChild(a);a.style.zIndex="1100";a.style.right="";a.style.bottom="";a.className="olLayerGooglePoweredBy gmnoprint"}catch(g){OpenLayers.Console.error(g);return}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:h,termsOfUse:f,poweredBy:a,count:1}}this.mapObject=h;this.termsOfUse=f;this.poweredBy=a;if(OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)===-1){this.mapObject.addMapType(this.type)}if(typeof h.getDragObject=="function"){this.dragObject=h.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 a=this;var b=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(b);delete a._resized;a.mapObject.checkResize();a.moveTo(a.map.getCenter(),a.map.getZoom())})}this._resized=true}},setVisibility:function(b){this.setGMapVisibility(b);var a=this.opacity==null?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments);this.setOpacity(a)},setGMapVisibility:function(d){var b=OpenLayers.Layer.Google.cache[this.map.id];if(b){var a=this.mapObject.getContainer();if(d===true){this.mapObject.setMapType(this.type);a.style.display="";this.termsOfUse.style.left="";this.termsOfUse.style.display="";this.poweredBy.style.display="";b.displayed=this.id}else{if(b.displayed===this.id){delete b.displayed}if(!b.displayed){a.style.display="none";this.termsOfUse.style.display="none";this.termsOfUse.style.left="-9999px";this.poweredBy.style.display="none"}}}},setOpacity:function(b){if(b!==this.opacity){if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}this.opacity=b}if(this.getVisibility()){var a=this.mapObject.getContainer();OpenLayers.Util.modifyDOMElement(a,null,null,null,null,null,null,b)}},destroy:function(){if(this.map){this.setGMapVisibility(false);var a=OpenLayers.Layer.Google.cache[this.map.id];if(a&&a.count<=1){this.removeGMapElements(false)}}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var e=OpenLayers.Layer.Google.cache[this.map.id];if(e){var b=this.mapObject&&this.mapObject.getContainer();if(b&&b.parentNode){b.parentNode.removeChild(b)}var d=e.termsOfUse;if(d&&d.parentNode){d.parentNode.removeChild(d)}var a=e.poweredBy;if(a&&a.parentNode){a.parentNode.removeChild(a)}}},removeMap:function(b){if(this.visibility&&this.mapObject){this.setGMapVisibility(false)}var a=OpenLayers.Layer.Google.cache[b.id];if(a){if(a.count<=1){this.removeGMapElements();delete OpenLayers.Layer.Google.cache[b.id]}else{--a.count}}delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(b){var d=null;if(b!=null){var a=b.getSouthWest();var e=b.getNorthEast();if(this.sphericalMercator){a=this.forwardMercator(a.lng(),a.lat());e=this.forwardMercator(e.lng(),e.lat())}else{a=new OpenLayers.LonLat(a.lng(),a.lat());e=new OpenLayers.LonLat(e.lng(),e.lat())}d=new OpenLayers.Bounds(a.lon,a.lat,e.lon,e.lat)}return d},getMapObjectBoundsFromOLBounds:function(d){var b=null;if(d!=null){var a=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);b=new GLatLngBounds(new GLatLng(a.lat,a.lon),new GLatLng(e.lat,e.lon))}return b},addContainerPxFunction:function(){if((typeof GMap2!="undefined")&&!GMap2.prototype.fromLatLngToContainerPixel){GMap2.prototype.fromLatLngToContainerPixel=function(b){var a=this.fromLatLngToDivPixel(b);var d=this.getContainer().firstChild.firstChild;a.x+=d.offsetLeft;a.y+=d.offsetTop;return a}}},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},dragPanMapObject:function(b,a){this.dragObject.moveBy(new GSize(-b,a))},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.fromContainerPixelToLatLng(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.fromLatLngToContainerPixel(a)},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lon:a.lng()},getLatitudeFromMapObjectLonLat:function(b){var a=this.sphericalMercator?this.forwardMercator(b.lng(),b.lat()).lat:b.lat();return a},getMapObjectLonLatFromLonLat:function(e,b){var d;if(this.sphericalMercator){var a=this.inverseMercator(e,b);d=new GLatLng(a.lat,a.lon)}else{d=new GLatLng(b,e)}return d},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Google.cache={};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,b){var a=arguments;a=[e,b];OpenLayers.Layer.prototype.initialize.apply(this,a);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(a){if(a==null){a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())}a=OpenLayers.Layer.prototype.clone.apply(this,[a]);return a},setUrl:function(a){this.url=a},mergeNewParams:function(b){this.params=OpenLayers.Util.extend(this.params,b);var a=this.redraw();if(this.map!=null){this.map.events.triggerEvent("changelayer",{layer:this,property:"params"})}return a},redraw:function(a){if(a){return this.mergeNewParams({_olSalt:Math.random()})}else{return OpenLayers.Layer.prototype.redraw.apply(this,[])}},selectUrl:function(f,e){var d=1;for(var b=0,a=f.length;b<a;b++){d*=f.charCodeAt(b)*this.URL_HASH_FACTOR;d-=Math.floor(d)}return e[Math.floor(d*e.length)]},getFullRequestString:function(h,e){var b=e||this.url;var g=OpenLayers.Util.extend({},this.params);g=OpenLayers.Util.extend(g,h);var f=OpenLayers.Util.getParameterString(g);if(b instanceof Array){b=this.selectUrl(f,b)}var a=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var d in g){if(d.toUpperCase() in a){delete g[d]}}f=OpenLayers.Util.getParameterString(g);return OpenLayers.Util.urlAppend(b,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:0,numLoadingTiles:0,tileLoadingDelay:100,timerId:null,initialize:function(d,b,e,a){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.events.addEventType("tileloaded");this.grid=[];this._moveGriddedTiles=OpenLayers.Function.bind(this.moveGriddedTiles,this)},removeMap:function(a){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},destroy:function(){this.clearGrid();this.grid=null;this.tileSize=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var g=0,b=this.grid.length;g<b;g++){var f=this.grid[g];for(var d=0,a=f.length;d<a;d++){var e=f[d];this.removeTileMonitoringHooks(e);e.destroy()}}this.grid=[]}},clone:function(a){if(a==null){a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions())}a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this,[a]);if(this.tileSize!=null){a.tileSize=this.tileSize.clone()}a.grid=[];return a},moveTo:function(e,a,f){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);e=e||this.map.getExtent();if(e!=null){var d=!this.grid.length||a;var b=this.getTilesBounds();if(this.singleTile){if(d||(!f&&!b.containsBounds(e))){this.initSingleTile(e)}}else{if(d||!b.containsBounds(e,true)){this.initGriddedTiles(e)}else{this.scheduleMoveGriddedTiles()}}}},moveByPx:function(b,a){this.scheduleMoveGriddedTiles()},scheduleMoveGriddedTiles:function(){if(this.timerId!=null){window.clearTimeout(this.timerId)}this.timerId=window.setTimeout(this._moveGriddedTiles,this.tileLoadingDelay)},setTileSize:function(b){if(this.singleTile){var a=this.map.getSize();if(a){b=a.clone();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 a="The getGridBounds() function is deprecated. It will be removed in 3.0. Please use getTilesBounds() instead.";OpenLayers.Console.warn(a);return this.getTilesBounds()},getTilesBounds:function(){var f=null;if(this.grid.length){var a=this.grid.length-1;var e=this.grid[a][0];var b=this.grid[0].length-1;var d=this.grid[0][b];f=new OpenLayers.Bounds(e.bounds.left,e.bounds.bottom,d.bounds.right,d.bounds.top)}return f},initSingleTile:function(g){var a=g.getCenterLonLat();var j=g.getWidth()*this.ratio;var b=g.getHeight()*this.ratio;var h=new OpenLayers.Bounds(a.lon-(j/2),a.lat-(b/2),a.lon+(j/2),a.lat+(b/2));var 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(a,p,f){var m=f*this.tileSize.w;var d=f*this.tileSize.h;var k=a.left-p.lon;var n=Math.floor(k/m)-this.buffer;var l=k/m-n;var g=-l*this.tileSize.w;var o=p.lon+n*m;var b=a.top-(p.lat+d);var j=Math.ceil(b/d)+this.buffer;var q=j-b/d;var e=-q*this.tileSize.h;var h=p.lat+j*d;return{tilelon:m,tilelat:d,tileoffsetlon:o,tileoffsetlat:h,tileoffsetx:g,tileoffsety:e}},getTileOrigin:function(){var b=this.tileOrigin;if(!b){var d=this.getMaxExtent();var a=({tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]})[this.tileOriginCorner];b=new OpenLayers.LonLat(d[a[0]],d[a[1]])}return b},initGriddedTiles:function(k){var h=this.map.getSize();var z=Math.ceil(h.h/this.tileSize.h)+Math.max(1,2*this.buffer);var B=Math.ceil(h.w/this.tileSize.w)+Math.max(1,2*this.buffer);var D=this.getTileOrigin();var t=this.map.getResolution();var s=this.calculateGridLayout(k,D,t);var g=Math.round(s.tileoffsetx);var d=Math.round(s.tileoffsety);var m=s.tileoffsetlon;var p=s.tileoffsetlat;var f=s.tilelon;var l=s.tilelat;this.origin=new OpenLayers.Pixel(g,d);var w=g;var A=m;var v=0;var a=parseInt(this.map.layerContainerDiv.style.left);var u=parseInt(this.map.layerContainerDiv.style.top);do{var j=this.grid[v++];if(!j){j=[];this.grid.push(j)}m=A;g=w;var e=0;do{var b=new OpenLayers.Bounds(m,p,m+f,p+l);var o=g;o-=a;var n=d;n-=u;var q=new OpenLayers.Pixel(o,n);var C=j[e++];if(!C){C=this.addTile(b,q);this.addTileMonitoringHooks(C);j.push(C)}else{C.moveTo(b,q,false)}m+=f;g+=this.tileSize.w}while((m<=k.right+f*this.buffer)||e<B);p-=l;d+=this.tileSize.h}while((p>=k.bottom-l*this.buffer)||v<z);this.removeExcessTiles(v,e);this.spiralTileLoad()},getMaxExtent:function(){return this.maxExtent},spiralTileLoad:function(){var b=[];var j=["right","down","left","up"];var h=0;var a=-1;var l=OpenLayers.Util.indexOf(j,"right");var m=0;while(m<j.length){var k=h;var d=a;switch(j[l]){case"right":d++;break;case"down":k++;break;case"left":d--;break;case"up":k--;break}var g=null;if((k<this.grid.length)&&(k>=0)&&(d<this.grid[0].length)&&(d>=0)){g=this.grid[k][d]}if((g!=null)&&(!g.queued)){b.unshift(g);g.queued=true;m=0;h=k;a=d}else{l=(l+1)%4;m++}}for(var e=0,f=b.length;e<f;e++){var g=b[e];g.draw();g.queued=false}},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize,this.tileOptions)},addTileMonitoringHooks:function(a){a.onLoadStart=function(){if(this.numLoadingTiles==0){this.events.triggerEvent("loadstart")}this.numLoadingTiles++};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.numLoadingTiles--;this.events.triggerEvent("tileloaded");if(this.numLoadingTiles==0){this.events.triggerEvent("loadend")}};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},moveGriddedTiles:function(){var e=true;var d=this.buffer||1;var b=this.grid[0][0].position;var a=parseInt(this.map.layerContainerDiv.style.left);var g=parseInt(this.map.layerContainerDiv.style.top);var f=b.add(a,g);if(f.x>-this.tileSize.w*(d-1)){this.shiftColumn(true)}else{if(f.x<-this.tileSize.w*d){this.shiftColumn(false)}else{if(f.y>-this.tileSize.h*(d-1)){this.shiftRow(true)}else{if(f.y<-this.tileSize.h*d){this.shiftRow(false)}else{e=false}}}}if(e){this.timerId=window.setTimeout(this._moveGriddedTiles,0)}},shiftRow:function(o){var d=(o)?0:(this.grid.length-1);var b=this.grid;var g=b[d];var f=this.map.getResolution();var j=(o)?-this.tileSize.h:this.tileSize.h;var h=f*-j;var n=(o)?b.pop():b.shift();for(var k=0,m=g.length;k<m;k++){var e=g[k];var a=e.bounds.clone();var l=e.position.clone();a.bottom=a.bottom+h;a.top=a.top+h;l.y=l.y+j;n[k].moveTo(a,l)}if(o){b.unshift(n)}else{b.push(n)}},shiftColumn:function(n){var e=(n)?-this.tileSize.w:this.tileSize.w;var d=this.map.getResolution();var l=d*e;for(var f=0,h=this.grid.length;f<h;f++){var m=this.grid[f];var k=(n)?0:(m.length-1);var b=m[k];var a=b.bounds.clone();var g=b.position.clone();a.left=a.left+l;a.right=a.right+l;g.x=g.x+e;var j=n?this.grid[f].pop():this.grid[f].shift();j.moveTo(a,g);if(n){m.unshift(j)}else{m.push(j)}}},removeExcessTiles:function(f,d){while(this.grid.length>f){var g=this.grid.pop();for(var b=0,a=g.length;b<a;b++){var e=g[b];this.removeTileMonitoringHooks(e);e.destroy()}}while(this.grid[0].length>d){for(var b=0,a=this.grid.length;b<a;b++){var g=this.grid[b];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 b=g*this.tileSize.h;var j=this.getLonLatFromViewPortPx(e);var a=d.left+(f*Math.floor((j.lon-d.left)/f));var h=d.bottom+(b*Math.floor((j.lat-d.bottom)/b));return new OpenLayers.Bounds(a,h,a+f,h+b)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(e,d,f,b){var a=[];a.push(e,d,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(b==null||b.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(a){if(a==null){a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(d){d=this.adjustBounds(d);var b=[d.left,d.bottom,d.right,d.top];var e=this.getImageSize();var a=this.getFullRequestString({mapext:b,imgext:b,map_size:[e.w,e.h],imgx:e.w/2,imgy:e.h/2,imgxy:[e.w,e.h]});return a},getFullRequestString:function(g,f){var b=(f==null)?this.url:f;var h=OpenLayers.Util.extend({},this.params);h=OpenLayers.Util.extend(h,g);var a=OpenLayers.Util.getParameterString(h);if(b instanceof Array){b=this.selectUrl(a,b)}var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(b));for(var j in h){if(j.toUpperCase() in e){delete h[j]}}a=OpenLayers.Util.getParameterString(h);var k=b;a=a.replace(/,/g,"+");if(a!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){k+=a}else{if(b.indexOf("?")==-1){k+="?"+a}else{k+="&"+a}}}return k},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Layer.SRCMapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{rt:"bc"},initialize:function(e,d,f,b){var a=[];a.push(e,d,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);if(arguments.length>0){OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)}if(b==null||b.isBaseLayer==null){this.isBaseLayer=((this.params.transparent!="true")&&(this.params.transparent!=true))}},clone:function(a){if(a==null){a=new OpenLayers.Layer.SRCMapServer(this.name,this.url,this.params,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},getURL:function(d){d=this.adjustBounds(d);var b=[d.left,d.bottom,d.right,d.top];var e=this.getImageSize();var a=this.getFullRequestString({minx:d.left,miny:d.bottom,maxx:d.right,maxy:d.top,w:e.w,h:e.h});return a},getFullRequestString:function(h,e){var b=(e==null)?this.url:e;var g=OpenLayers.Util.extend({},this.params);g=OpenLayers.Util.extend(g,h);var f=aw.Object.toQueryString(g);if(b instanceof Array){b=this.selectUrl(f,b)}var a=b;if(f!=""){var d=b.charAt(b.length-1);if((d=="&")||(d=="?")){a+=f}else{if(b.indexOf("?")==-1){a+="?"+f}else{a+="&"+f}}}return a},CLASS_NAME:"OpenLayers.Layer.SRCMapServer"});OpenLayers.Layer.MultiMap=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:1,MAX_ZOOM_LEVEL:17,RESOLUTIONS:[9,1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.0006866455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.00004291534423828125],type:null,initialize:function(b,a){OpenLayers.Layer.EventPane.prototype.initialize.apply(this,arguments);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this,arguments);if(this.sphericalMercator){OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator);this.initMercatorParameters();this.RESOLUTIONS.unshift(10)}},loadMapObject:function(){try{this.mapObject=new MultimapViewer(this.div)}catch(a){}},getWarningHTML:function(){return OpenLayers.i18n("getLayerWarning",{layerType:"MM",layerLib:"MultiMap"})},setMapObjectCenter:function(a,b){this.mapObject.goToPosition(a,b)},getMapObjectCenter:function(){return this.mapObject.getCurrentPosition()},getMapObjectZoom:function(){return this.mapObject.getZoomFactor()},getMapObjectLonLatFromMapObjectPixel:function(a){a.x=a.x-(this.map.getSize().w/2);a.y=a.y-(this.map.getSize().h/2);return this.mapObject.getMapPositionAt(a)},getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.geoPosToContainerPixels(a)},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lon:a.lon},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lon,a.lat).lat:a.lat},getMapObjectLonLatFromLonLat:function(e,d){var a;if(this.sphericalMercator){var b=this.inverseMercator(e,d);a=new MMLatLon(b.lat,b.lon)}else{a=new MMLatLon(d,e)}return a},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},getMapObjectPixelFromXY:function(a,b){return new MMPoint(a,b)},CLASS_NAME:"OpenLayers.Layer.MultiMap"});OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:false,markers:null,drawn:false,initialize:function(b,a){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(b){if(b!=this.opacity){this.opacity=b;for(var d=0,a=this.markers.length;d<a;d++){this.markers[d].setOpacity(this.opacity)}}},moveTo:function(e,b,f){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);if(b||!this.drawn){for(var d=0,a=this.markers.length;d<a;d++){this.drawMarker(this.markers[d])}this.drawn=true}},addMarker:function(a){this.markers.push(a);if(this.opacity!=null){a.setOpacity(this.opacity)}if(this.map&&this.map.getExtent()){a.map=this.map;this.drawMarker(a)}},removeMarker:function(a){if(this.markers&&this.markers.length){OpenLayers.Util.removeItem(this.markers,a);a.erase()}},clearMarkers:function(){if(this.markers!=null){while(this.markers.length>0){this.removeMarker(this.markers[0])}}},drawMarker:function(a){var b=this.map.getLayerPxFromLonLat(a.lonlat);if(b==null){a.display(false)}else{if(!a.isDrawn()){var d=a.draw(b);this.div.appendChild(d)}else{if(a.icon){a.icon.moveTo(b)}}}},getDataExtent:function(){var b=null;if(this.markers&&(this.markers.length>0)){var b=new OpenLayers.Bounds();for(var e=0,a=this.markers.length;e<a;e++){var d=this.markers[e];b.extend(d.lonlat)}}return b},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=new Array()},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){if(!this.loaded){if(this.location!=null){var a=function(b){this.events.triggerEvent("loadend")};this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.location,success:this.parseData,failure:a,scope:this});this.loaded=true}}},moveTo:function(d,a,b){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadText()}},parseData:function(l){var n=l.responseText;var p={};OpenLayers.Util.extend(p,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){p.externalProjection=this.projection;p.internalProjection=this.map.getProjectionObject()}var b=new OpenLayers.Format.Text(p);var d=b.read(n);for(var h=0,j=d.length;h<j;h++){var g={};var o=d[h];var m;var k,e;m=new OpenLayers.LonLat(o.geometry.x,o.geometry.y);if(o.style.graphicWidth&&o.style.graphicHeight){k=new OpenLayers.Size(o.style.graphicWidth,o.style.graphicHeight)}if(o.style.graphicXOffset!==undefined&&o.style.graphicYOffset!==undefined){e=new OpenLayers.Pixel(o.style.graphicXOffset,o.style.graphicYOffset)}if(o.style.externalGraphic!=null){g.icon=new OpenLayers.Icon(o.style.externalGraphic,k,e)}else{g.icon=OpenLayers.Marker.defaultIcon();if(k!=null){g.icon.setSize(k)}}if((o.attributes.title!=null)&&(o.attributes.description!=null)){g.popupContentHTML="<h2>"+o.attributes.title+"</h2><p>"+o.attributes.description+"</p>"}g.overflow=o.attributes.overflow||"auto";var a=new OpenLayers.Feature(this,m,g);this.features.push(a);var f=a.createMarker();if((o.attributes.title!=null)&&(o.attributes.description!=null)){f.events.register("click",a,this.markerClick)}this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(b){var e=(this==this.layer.selectedFeature);this.layer.selectedFeature=(!e)?this:null;for(var d=0,a=this.layer.map.popups.length;d<a;d++){this.layer.map.removePopup(this.layer.map.popups[d])}if(!e){this.layer.map.addPopup(this.createPopup())}OpenLayers.Event.stop(b)},clearFeatures:function(){if(this.features!=null){while(this.features.length>0){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:true,initialize:function(e,d,f,b){var a=[];f=OpenLayers.Util.upperCaseObject(f);a.push(e,d,f,b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));if(this.params.TRANSPARENT&&this.params.TRANSPARENT.toString().toLowerCase()=="true"){if((b==null)||(!b.isBaseLayer)){this.isBaseLayer=false}if(this.params.FORMAT=="jpg"){this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"}}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments)},clone:function(a){if(a==null){a=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions())}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(f){f=this.adjustBounds(f);var e=this.projection.getCode().split(":");var d=e[e.length-1];var h=this.getImageSize();var j={BBOX:f.toBBOX(),SIZE:h.w+","+h.h,F:"image",BBOXSR:d,IMAGESR:d};if(this.layerDefs){var g=[];var a;for(a in this.layerDefs){if(this.layerDefs.hasOwnProperty(a)){if(this.layerDefs[a]){g.push(a);g.push(":");g.push(this.layerDefs[a]);g.push(";")}}}if(g.length>0){j.LAYERDEFS=g.join("")}}var b=this.getFullRequestString(j);return b},setLayerFilter:function(b,a){if(!this.layerDefs){this.layerDefs={}}if(a){this.layerDefs[b]=a}else{delete this.layerDefs[b]}},clearLayerFilter:function(a){if(a){delete this.layerDefs[a]}else{delete this.layerDefs}},mergeNewParams:function(d){var b=OpenLayers.Util.upperCaseObject(d);var a=[b];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{initialize:function(b,a){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments)},drawMarker:function(a){var e=a.bounds;var g=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(e.left,e.top));var d=this.map.getLayerPxFromLonLat(new OpenLayers.LonLat(e.right,e.bottom));if(d==null||g==null){a.display(false)}else{var f=new OpenLayers.Size(Math.max(1,d.x-g.x),Math.max(1,d.y-g.y));var b=a.draw(g,f);if(!a.drawn){this.div.appendChild(b);a.drawn=true}}},removeMarker:function(a){OpenLayers.Util.removeItem(this.markers,a);if((a.div!=null)&&(a.div.parentNode==this.div)){this.div.removeChild(a.div)}},CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,sphericalMercator:false,zoomOffset:0,serverResolutions:null,initialize:function(e,d,b){if(b&&b.sphericalMercator||this.sphericalMercator){b=OpenLayers.Util.extend({maxExtent:new OpenLayers.Bounds(-128*156543.03390625,-128*156543.03390625,128*156543.03390625,128*156543.03390625),maxResolution:156543.03390625,numZoomLevels:19,units:"m",projection:"EPSG:900913"},b)}d=d||this.url;e=e||this.name;var a=[e,d,{},b];OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},clone:function(a){if(a==null){a=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions())}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(e){var a=this.getXYZ(e);var b=this.url;if(b instanceof Array){var d=""+a.x+a.y+a.z;b=this.selectUrl(d,b)}return OpenLayers.String.format(b,a)},getXYZ:function(e){var d=this.map.getResolution();var a=Math.round((e.left-this.maxExtent.left)/(d*this.tileSize.w));var g=Math.round((this.maxExtent.top-e.top)/(d*this.tileSize.h));var f=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,d):this.map.getZoom()+this.zoomOffset;var b=Math.pow(2,f);if(this.wrapDateLine){a=((a%b)+b)%b}return{x:a,y:g,z:f}},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);if(!this.tileOrigin){this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom)}},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",attribution:"Data CC-By-SA by <a href='http://openstreetmap.org/'>OpenStreetMap</a>",sphericalMercator:true,url:"http://tile.openstreetmap.org/${z}/${x}/${y}.png",clone:function(a){if(a==null){a=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions())}a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a]);return a},wrapDateLine:true,CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Layer.Bing=OpenLayers.Class(OpenLayers.Layer.XYZ,{attributionTemplate:'<span class="olBingAttribution ${type}"><div><a target="_blank" href="http://www.bing.com/maps/"><img src="${logo}" /></a></div>${copyrights}<a style="white-space: nowrap" target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a></span>',metadata:null,type:"Road",metadataParams:null,initialize:function(d){d=OpenLayers.Util.applyDefaults({restrictedMinZoom:1,sphericalMercator:true},d);var b=d.name||"Bing "+(d.type||this.type);var a=[b,null,d];OpenLayers.Layer.XYZ.prototype.initialize.apply(this,a);this.loadMetadata()},loadMetadata:function(){this._callbackId="_callback_"+this.id.replace(/\./g,"_");window[this._callbackId]=OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata,this);var d=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams);var b="http://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(d);var a=document.createElement("script");a.type="text/javascript";a.src=b;a.id=this._callbackId;document.getElementsByTagName("head")[0].appendChild(a)},initLayer:function(){var d=this.metadata.resourceSets[0].resources[0];var a=d.imageUrl.replace("{quadkey}","${quadkey}");this.url=[];for(var b=0;b<d.imageUrlSubdomains.length;++b){this.url.push(a.replace("{subdomain}",d.imageUrlSubdomains[b]))}this.addOptions({restrictedMinZoom:d.zoomMin,numZoomLevels:d.zoomMax+1});this.updateAttribution();this.redraw()},getURL:function(a){if(!this.url){return OpenLayers.Util.getImagesLocation()+"blank.gif"}var h=this.getXYZ(a),l=h.x,j=h.y,g=h.z;var d=[];for(var e=g;e>0;--e){var k="0";var m=1<<(e-1);if((l&m)!=0){k++}if((j&m)!=0){k++;k++}d.push(k)}var f=d.join("");var b=this.selectUrl(""+l+j+g,this.url);return OpenLayers.String.format(b,{quadkey:f})},updateAttribution:function(){var h=this.metadata;if(!h||!this.map||!this.map.center){return}var g=h.resourceSets[0].resources[0];var p=this.map.getExtent().transform(this.map.getProjectionObject(),new OpenLayers.Projection("EPSG:4326"));var d=g.imageryProviders,o=this.map.getZoom()+1,a="",k,e,n,b,f,m,l;for(e=0,n=d.length;e<n;++e){k=d[e];for(b=0,f=k.coverageAreas.length;b<f;++b){l=k.coverageAreas[b];m=OpenLayers.Bounds.fromArray(l.bbox);if(p.intersectsBounds(m)&&o<=l.zoomMax&&o>=l.zoomMin){a+=k.attribution+" "}}}this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),logo:h.brandLogoUri,copyrights:a});this.map&&this.map.events.triggerEvent("changelayer",{layer:this})},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments);this.updateAttribution();this.map.events.register("moveend",this,this.updateAttribution)},clone:function(a){if(a==null){a=new OpenLayers.Layer.Bing(this.options)}a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a]);return a},destroy:function(){this.map&&this.map.events.unregister("moveend",this,this.updateAttribution);OpenLayers.Layer.XYZ.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.Bing"});OpenLayers.Layer.Bing.processMetadata=function(b){this.metadata=b;this.initLayer();var a=document.getElementById(this._callbackId);a.parentNode.removeChild(a);window[this._callbackId]=undefined;delete this._callbackId};OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:true,format:"image/png",serverResolutions:null,initialize:function(d,b,e,a){this.layername=e;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[d,b,{},a]);this.extension=this.format.split("/")[1].toLowerCase();this.extension=(this.extension=="jpg")?"jpeg":this.extension},clone:function(a){if(a==null){a=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.getOptions())}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(b){var g=this.map.getResolution();var h=this.maxExtent;var m=this.tileSize;var a=Math.round((b.left-h.left)/(g*m.w));var l=Math.round((b.bottom-h.bottom)/(g*m.h));var j=this.serverResolutions!=null?OpenLayers.Util.indexOf(this.serverResolutions,g):this.map.getZoom();function f(q,p){q=String(q);var n=[];for(var o=0;o<p;++o){n.push("0")}return n.join("").substring(0,p-q.length)+q}var e=[this.layername,f(j,2),f(parseInt(a/1000000),3),f((parseInt(a/1000)%1000),3),f((parseInt(a)%1000),3),f(parseInt(l/1000000),3),f((parseInt(l/1000)%1000),3),f((parseInt(l)%1000),3)+"."+this.extension];var k=e.join("/");var d=this.url;if(d instanceof Array){d=this.selectUrl(k,d)}d=(d.charAt(d.length-1)=="/")?d:d+"/";return d+k},addTile:function(d,a){var b=this.getURL(d);return new OpenLayers.Tile.Image(this,a,d,b,this.tileSize)},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Layer.Zoomify=OpenLayers.Class(OpenLayers.Layer.Grid,{url:null,size:null,isBaseLayer:true,standardTileSize:256,numberOfTiers:0,tileCountUpToTier:new Array(),tierSizeInTiles:new Array(),tierImageSize:new Array(),initialize:function(e,d,f,b){this.initializeZoomify(f);var a=[];a.push(e,d,f,{},b);OpenLayers.Layer.Grid.prototype.initialize.apply(this,a)},initializeZoomify:function(d){var e=d.clone();var a=new OpenLayers.Size(Math.ceil(e.w/this.standardTileSize),Math.ceil(e.h/this.standardTileSize));this.tierSizeInTiles.push(a);this.tierImageSize.push(e);while(e.w>this.standardTileSize||e.h>this.standardTileSize){e=new OpenLayers.Size(Math.floor(e.w/2),Math.floor(e.h/2));a=new OpenLayers.Size(Math.ceil(e.w/this.standardTileSize),Math.ceil(e.h/this.standardTileSize));this.tierSizeInTiles.push(a);this.tierImageSize.push(e)}this.tierSizeInTiles.reverse();this.tierImageSize.reverse();this.numberOfTiers=this.tierSizeInTiles.length;this.tileCountUpToTier[0]=0;for(var b=1;b<this.numberOfTiers;b++){this.tileCountUpToTier.push(this.tierSizeInTiles[b-1].w*this.tierSizeInTiles[b-1].h+this.tileCountUpToTier[b-1])}},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);this.tileCountUpToTier.length=0;this.tierSizeInTiles.length=0;this.tierImageSize.length=0},clone:function(a){if(a==null){a=new OpenLayers.Layer.Zoomify(this.name,this.url,this.size,this.options)}a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a]);return a},getURL:function(e){e=this.adjustBounds(e);var d=this.map.getResolution();var a=Math.round((e.left-this.tileOrigin.lon)/(d*this.tileSize.w));var j=Math.round((this.tileOrigin.lat-e.top)/(d*this.tileSize.h));var h=this.map.getZoom();var g=a+j*this.tierSizeInTiles[h].w+this.tileCountUpToTier[h];var f="TileGroup"+Math.floor((g)/256)+"/"+h+"-"+a+"-"+j+".jpg";var b=this.url;if(b instanceof Array){b=this.selectUrl(f,b)}return b+f},getImageSize:function(){if(arguments.length>0){bounds=this.adjustBounds(arguments[0]);var d=this.map.getResolution();var a=Math.round((bounds.left-this.tileOrigin.lon)/(d*this.tileSize.w));var g=Math.round((this.tileOrigin.lat-bounds.top)/(d*this.tileSize.h));var f=this.map.getZoom();var b=this.standardTileSize;var e=this.standardTileSize;if(a==this.tierSizeInTiles[f].w-1){var b=this.tierImageSize[f].w%this.standardTileSize}if(g==this.tierSizeInTiles[f].h-1){var e=this.tierImageSize[f].h%this.standardTileSize}return(new OpenLayers.Size(b,e))}else{return this.tileSize}},addTile:function(b,a){return new OpenLayers.Tile.Image(this,a,b,null,this.tileSize)},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.top)},calculateGridLayout:function(a,q,f){var m=f*this.tileSize.w;var d=f*this.tileSize.h;var k=a.left-q.left;var n=Math.floor(k/m)-this.buffer;var l=k/m-n;var g=-l*this.tileSize.w;var o=q.left+n*m;var b=q.top-a.top+d;var j=Math.floor(b/d)-this.buffer;var p=j-b/d;var e=p*this.tileSize.h;var h=q.top-d*j;return{tilelon:m,tilelat:d,tileoffsetlon:o,tileoffsetlat:h,tileoffsetx:g,tileoffsety:e}},CLASS_NAME:"OpenLayers.Layer.Zoomify"});OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:true,anchor:null,initialize:function(j,e,h,d,b,g,f){var a=[j,e,h,d,g,f];OpenLayers.Popup.prototype.initialize.apply(this,a);this.anchor=(b!=null)?b:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.anchor=null;this.relativePosition=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)},moveTo:function(d){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(d);var e=this.calculateNewPx(d);var a=new Array(e);OpenLayers.Popup.prototype.moveTo.apply(this,a);if(this.relativePosition!=b){this.updateRelativePosition()}},setSize:function(b){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if((this.lonlat)&&(this.map)){var a=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(a)}},calculateRelativePosition:function(b){var e=this.map.getLonLatFromLayerPx(b);var d=this.map.getExtent();var a=d.determineQuadrant(e);return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(b){var f=b.offset(this.anchor.offset);var a=this.size||this.contentSize;var e=(this.relativePosition.charAt(0)=="t");f.y+=(e)?-a.h:this.anchor.size.h;var d=(this.relativePosition.charAt(1)=="l");f.x+=(d)?-a.w:this.anchor.size.w;return f},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Popup.AnchoredBubble=OpenLayers.Class(OpenLayers.Popup.Anchored,{rounded:false,initialize:function(h,d,g,b,a,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(a){OpenLayers.Popup.Anchored.prototype.draw.apply(this,arguments);this.setContentHTML();this.setBackgroundColor();this.setOpacity();return this.div},updateRelativePosition:function(){this.setRicoCorners()},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.setRicoCorners()},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.div!=null){if(this.contentDiv!=null){this.div.style.background="transparent";OpenLayers.Rico.Corner.changeColor(this.groupDiv,this.backgroundColor)}}},setOpacity:function(a){OpenLayers.Popup.Anchored.prototype.setOpacity.call(this,a);if(this.div!=null){if(this.groupDiv!=null){OpenLayers.Rico.Corner.changeOpacity(this.groupDiv,this.opacity)}}},setBorder:function(a){this.border=0},setRicoCorners:function(){var a=this.getCornersToRound(this.relativePosition);var b={corners:a,color:this.backgroundColor,bgColor:"transparent",blend:false};if(!this.rounded){OpenLayers.Rico.Corner.round(this.div,b);this.rounded=true}else{OpenLayers.Rico.Corner.reRound(this.groupDiv,b);this.setBackgroundColor();this.setOpacity()}},getCornersToRound:function(){var a=["tl","tr","bl","br"];var b=OpenLayers.Bounds.oppositeQuadrant(this.relativePosition);OpenLayers.Util.removeItem(a,b);return a.join(" ")},CLASS_NAME:"OpenLayers.Popup.AnchoredBubble"});OpenLayers.Popup.AnchoredBubble.CORNER_SIZE=5;OpenLayers.Popup.Annotation=OpenLayers.Class(OpenLayers.Popup.Anchored,{displayClass:"olPopupAnnotation",initialize:function(f,e,d,b){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,[f,e,new OpenLayers.Size(300,150),d,b,false,null]);this.div=OpenLayers.Util.createDiv(this.id,null,this.contentSize,null,null,null,"hidden");this.div.className=this.displayClass;this.div.innerHTML='<div class="t"><div class="l"></div><div class="c"></div><div class="r"></div></div><div class="m"><div class="l"></div><div class="c"></div><div class="r"></div></div><div class="b"><div class="l"></div><div class="c"></div><div class="r"></div></div>';this.contentDiv=OpenLayers.Util.createDiv();this.contentDiv.className=this.contentDisplayClass;this.div.appendChild(this.contentDiv);this.arrowdiv=OpenLayers.Util.createDiv();this.arrowdiv.className="arrow";this.div.appendChild(this.arrowdiv);this.closeDiv=OpenLayers.Util.createDiv();this.closeDiv.className="olPopupCloseBox";this.div.appendChild(this.closeDiv);var a=function(g){this.hide();OpenLayers.Event.stop(g)};OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},setSize:function(d){this.size=d.clone();var b=this.getContentDivPadding();var a=b.left+b.right;var f=b.top+b.bottom;this.fixPadding();a+=this.padding.left+this.padding.right;f+=this.padding.top+this.padding.bottom;if(this.closeDiv){var e=parseInt(this.closeDiv.style.width);if(!isNaN(e)){a+=e+b.right}}this.size.w+=a;this.size.h+=f;if(OpenLayers.Util.getBrowserName()=="msie"){this.contentSize.w+=b.left+b.right;this.contentSize.h+=b.bottom+b.top}if(this.div!==null){this.div.style.width=this.size.w+"px";this.div.style.height=this.size.h+"px"}},setBackgroundColor:function(a){if(a!=undefined){this.backgroundColor=a}if(this.contentDiv!==null){this.contentDiv.style.backgroundColor=this.backgroundColor}},updateRelativePosition:function(){var a="";switch(this.relativePosition){case"tl":a="br";break;case"tr":a="bl";break;case"bl":a="tr";break;case"br":a="tl";break}if(this.div){this.div.className=this.displayClass+" "+this.relativePosition}if(this.arrowdiv){this.arrowdiv.className="arrow "+a}},CLASS_NAME:"OpenLayers.Popup.Annotation"});OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:OpenLayers.Popup.AnchoredBubble,popup:null,initialize:function(a,d,b){this.layer=a;this.lonlat=d;this.data=(b!=null)?b:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){if((this.layer!=null)&&(this.layer.map!=null)){if(this.popup!=null){this.layer.map.removePopup(this.popup)}}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 b=false;if((this.layer!=null)&&(this.layer.map!=null)){var a=this.layer.map.getExtent();b=a.containsLonLat(this.lonlat)}return b},createMarker:function(){if(this.lonlat!=null){this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon)}return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(b){if(this.lonlat!=null){var d=this.id+"_popup";var a=(this.marker)?this.marker.icon:null;if(!this.popup){this.popup=new this.popupClass(d,this.lonlat,this.data.popupSize,this.data.popupContentHTML,a,b)}if(this.data.overflow!=null){this.popup.contentDiv.style.overflow=this.data.overflow}this.popup.feature=this}return this.popup},destroyPopup:function(){if(this.popup){this.popup.feature=null;this.popup.destroy();this.popup=null}},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.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,a,b){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,a]);this.lonlat=null;this.geometry=d?d:null;this.state=null;this.attributes={};if(a){this.attributes=OpenLayers.Util.extend(this.attributes,a)}this.style=b?b:null},destroy:function(){if(this.layer){this.layer.removeFeatures(this);this.layer=null}this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(e){var d=false;if(this.layer&&this.layer.map){var a=this.layer.map.getExtent();if(e){var b=this.geometry.getBounds();d=a.intersectsBounds(b)}else{var f=a.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(b,e,d){var a=false;if(this.geometry){a=this.geometry.atPoint(b,e,d)}return a},destroyPopup:function(){},move:function(a){if(!this.layer||!this.geometry.move){return}var b;if(a.CLASS_NAME=="OpenLayers.LonLat"){b=this.layer.getViewPortPxFromLonLat(a)}else{b=a}var e=this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat());var d=this.layer.map.getResolution();this.geometry.move(d*(b.x-e.x),d*(e.y-b.y));this.layer.drawFeature(this);return e},toState:function(a){if(a==OpenLayers.State.UPDATE){switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a;break;case OpenLayers.State.UPDATE:case OpenLayers.State.INSERT:break}}else{if(a==OpenLayers.State.INSERT){switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a;break}}else{if(a==OpenLayers.State.DELETE){switch(this.state){case OpenLayers.State.INSERT:break;case OpenLayers.State.DELETE:break;case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state=a;break}}else{if(a==OpenLayers.State.UNKNOWN){this.state=a}}}}},CLASS_NAME:"OpenLayers.Feature.Vector"});OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},select:{fillColor:"blue",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer"},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1,strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit"},"delete":{display:"none"}};OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:false,evt:null,initialize:function(d,b,a){OpenLayers.Util.extend(this,a);this.control=d;this.callbacks=b;if(d.map){this.setMap(d.map)}OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){if(this.keyMask==null){return true}var b=(a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT:0);return(b==this.keyMask)},activate:function(){if(this.active){return false}var d=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b<a;b++){if(this[d[b]]){this.register(d[b],this[d[b]])}}this.active=true;return true},deactivate:function(){if(!this.active){return false}var d=OpenLayers.Events.prototype.BROWSER_EVENTS;for(var b=0,a=d.length;b<a;b++){if(this[d[b]]){this.unregister(d[b],this[d[b]])}}this.active=false;return true},callback:function(b,a){if(b&&this.callbacks[b]){this.callbacks[b].apply(this.control,a)}},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;return true},destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.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,b,a){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(b){var a=true;if(this.checkModifiers(b)&&this.control.handleRightClicks&&OpenLayers.Event.isRightClick(b)){a=this.rightclick(b)}return a},rightclick:function(b){if(this.passesTolerance(b)){if(this.rightclickTimerId!=null){this.clearTimer();this.callback("dblrightclick",[b]);return !this.stopDouble}else{var a=this["double"]?OpenLayers.Util.extend({},b):this.callback("rightclick",[b]);var d=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(d,this.delay)}}return !this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;if(a){this.callback("rightclick",[a])}return !this.stopSingle},dblclick:function(a){if(this.passesTolerance(a)){if(this["double"]){this.callback("dblclick",[a])}this.clearTimer()}return !this.stopDouble},click:function(b){if(this.passesTolerance(b)){if(this.timerId!=null){this.clearTimer()}else{var a=this.single?OpenLayers.Util.extend({},b):null;this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}}return !this.stopSingle},passesTolerance:function(b){var d=true;if(this.pixelTolerance!=null&&this.down){var a=Math.sqrt(Math.pow(this.down.x-b.xy.x,2)+Math.pow(this.down.y-b.xy.y,2));if(a>this.pixelTolerance){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(a){this.timerId=null;if(a){this.callback("click",[a])}},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();this.down=null;a=true}return a},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:false,px:null,timerId:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},mousemove:function(a){if(this.passesTolerance(a.xy)){this.clearTimer();this.callback("move",[a]);this.px=a.xy;a=OpenLayers.Util.extend({},a);this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay)}return !this.stopMove},mouseout:function(a){if(OpenLayers.Util.mouseLeft(a,this.map.div)){this.clearTimer();this.callback("move",[a])}return true},passesTolerance:function(b){var d=true;if(this.pixelTolerance&&this.px){var a=Math.sqrt(Math.pow(this.px.x-b.x,2)+Math.pow(this.px.y-b.y,2));if(a<this.pixelTolerance){d=false}}return d},clearTimer:function(){if(this.timerId!=null){window.clearTimeout(this.timerId);this.timerId=null}},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.clearTimer();a=true}return a},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Handler.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,b,a){if(!(a&&a.layerOptions&&a.layerOptions.styleMap)){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{})}OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this,arguments)){return false}var a=OpenLayers.Util.extend({displayInLayerSwitcher:false,calculateInRange:OpenLayers.Function.True},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return true},createFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.layer.addFeatures([this.point],{silent:true})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){return false}if(this.drawing){this.cancel()}this.destroyFeature();if(this.layer.map!=null){this.layer.destroy(false)}this.layer=null;return true},destroyFeature:function(){if(this.layer){this.layer.destroyFeatures()}this.point=null},finalize:function(b){var a=b?"cancel":"done";this.drawing=false;this.mouseDown=false;this.lastDown=null;this.lastUp=null;this.callback(a,[this.geometryClone()]);if(b||!this.persist){this.destroyFeature()}},cancel:function(){this.finalize(true)},click:function(a){OpenLayers.Event.stop(a);return false},dblclick:function(a){OpenLayers.Event.stop(a);return false},modifyFeature:function(a){var b=this.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.point]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point&&this.point.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPoint([a])}return a},geometryClone:function(){var a=this.getGeometry();return a&&a.clone()},mousedown:function(a){if(!this.checkModifiers(a)){return true}if(this.lastDown&&this.lastDown.equals(a.xy)){return true}this.drawing=true;if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{this.modifyFeature(a.xy)}this.lastDown=a.xy;return false},mousemove:function(a){if(this.drawing){this.modifyFeature(a.xy)}return true},mouseup:function(a){if(this.drawing){this.finalize();return false}else{return true}},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,freehand:false,freehandToggle:"shiftKey",initialize:function(d,b,a){OpenLayers.Handler.Point.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Point.prototype.destroyFeature.apply(this);this.line=null},removePoint:function(){if(this.point){this.layer.removeFeatures([this.point])}},addPoint:function(a){this.layer.removeFeatures([this.point]);var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature()},freehandMode:function(a){return(this.freehandToggle&&a[this.freehandToggle])?!this.freehand:this.freehand},modifyFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point.geometry.x=b.lon;this.point.geometry.y=b.lat;this.callback("modify",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var a=this.line&&this.line.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiLineString([a])}return a},mousedown:function(a){if(this.lastDown&&this.lastDown.equals(a.xy)){return false}if(this.lastDown==null){if(this.persist){this.destroyFeature()}this.createFeature(a.xy)}else{if((this.lastUp==null)||!this.lastUp.equals(a.xy)){this.addPoint(a.xy)}}this.mouseDown=true;this.lastDown=a.xy;this.drawing=true;return false},mousemove:function(a){if(this.drawing){if(this.mouseDown&&this.freehandMode(a)){this.addPoint(a.xy)}else{this.modifyFeature(a.xy)}}return true},mouseup:function(a){this.mouseDown=false;if(this.drawing){if(this.freehandMode(a)){this.removePoint();this.finalize()}else{if(this.lastUp==null){this.addPoint(a.xy)}this.lastUp=a.xy}return false}return true},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-1;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{polygon:null,initialize:function(d,b,a){OpenLayers.Handler.Path.prototype.initialize.apply(this,arguments)},createFeature:function(a){var b=this.control.map.getLonLatFromPixel(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat));this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:true})},destroyFeature:function(){OpenLayers.Handler.Path.prototype.destroyFeature.apply(this);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var a=this.polygon&&this.polygon.geometry;if(a&&this.multi){a=new OpenLayers.Geometry.MultiPolygon([a])}return a},dblclick:function(a){if(!this.freehandMode(a)){var b=this.line.geometry.components.length-2;this.line.geometry.removeComponent(this.line.geometry.components[b]);this.removePoint();this.finalize()}return false},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.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,b,d,a){OpenLayers.Handler.prototype.initialize.apply(this,[e,d,a]);this.layer=b},mousedown:function(a){this.down=a.xy;return this.handle(a)?!this.stopDown:true},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:true},click:function(a){return this.handle(a)?!this.stopClick:true},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out){return true}this.handle(a);return true},dblclick:function(a){return !this.handle(a)},geometryTypeMatches:function(a){return this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)>-1},handle:function(a){if(this.feature&&!this.feature.layer){this.feature=null}var d=a.type;var g=false;var f=!!(this.feature);var e=(d=="click"||d=="dblclick");this.feature=this.layer.getFeatureFromEvent(a);if(this.feature&&!this.feature.layer){this.feature=null}if(this.lastFeature&&!this.lastFeature.layer){this.lastFeature=null}if(this.feature){var b=(this.feature!=this.lastFeature);if(this.geometryTypeMatches(this.feature)){if(f&&b){if(this.lastFeature){this.triggerCallback(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&&b||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,b){var d=this.EVENTMAP[e][f];if(d){if(e=="click"&&this.up&&this.down){var a=Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2));if(a<=this.clickTolerance){this.callback(d,b)}}else{this.callback(d,b)}}},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.moveLayerBack();this.feature=null;this.lastFeature=null;this.down=null;this.up=null;this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});a=true}return a},handleMapEvents:function(a){if(!a.property||a.property=="order"){this.moveLayerToTop()}},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;if(a>=this.map.Z_INDEX_BASE.Feature){this.layer.setZIndex(a)}else{this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))}},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Handler.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(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments)},down:function(a){},move:function(a){},up:function(a){},out:function(a){},mousedown:function(b){var a=true;this.dragging=false;if(this.checkModifiers(b)&&OpenLayers.Event.isLeftClick(b)){this.started=true;this.start=b.xy;this.last=b.xy;OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown");this.down(b);this.callback("down",[b.xy]);OpenLayers.Event.stop(b);if(!this.oldOnselectstart){this.oldOnselectstart=(document.onselectstart)?document.onselectstart:OpenLayers.Function.True;document.onselectstart=OpenLayers.Function.False}a=!this.stopDown}else{this.started=false;this.start=null;this.last=null}return a},mousemove:function(a){if(this.started&&!this.timeoutId&&(a.xy.x!=this.last.x||a.xy.y!=this.last.y)){if(this.documentDrag===true&&this.documentEvents){if(a.element===document){this.adjustXY(a);this.setEvent(a)}else{this.destroyDocumentEvents()}}if(this.interval>0){this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)}this.dragging=true;this.move(a);this.callback("move",[a.xy]);if(!this.oldOnselectstart){this.oldOnselectstart=document.onselectstart;document.onselectstart=OpenLayers.Function.False}this.last=this.evt.xy}return true},removeTimeout:function(){this.timeoutId=null},mouseup:function(b){if(this.started){if(this.documentDrag===true&&this.documentEvents){this.adjustXY(b);this.destroyDocumentEvents()}var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(b);this.callback("up",[b.xy]);if(a){this.callback("done",[b.xy])}document.onselectstart=this.oldOnselectstart}return true},mouseout:function(b){if(this.started&&OpenLayers.Util.mouseLeft(b,this.map.div)){if(this.documentDrag===true){this.documentEvents=new OpenLayers.Events(this,document,null,null,{includeXY:true});this.documentEvents.on({mousemove:this.mousemove,mouseup:this.mouseup});OpenLayers.Element.addClass(document.body,"olDragDown")}else{var a=(this.start!=this.last);this.started=false;this.dragging=false;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(b);this.callback("out",[]);if(a){this.callback("done",[b.xy])}if(document.onselectstart){document.onselectstart=this.oldOnselectstart}}}return true},click:function(a){return(this.start==this.last)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragging=false;a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.started=false;this.dragging=false;this.start=null;this.last=null;a=true;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown")}return a},adjustXY:function(a){var b=OpenLayers.Util.pagePosition(this.map.div);a.xy.x-=b[0];a.xy.y-=b[1]},destroyDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents.destroy();this.documentEvents=null},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",persist:false,irregular:false,angle:null,fixedRadius:false,feature:null,layer:null,origin:null,initialize:function(d,b,a){this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,[d,b,a]);this.options=(a)?a:new Object()},setOptions:function(a){OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a)},activate:function(){var a=false;if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b={displayInLayerSwitcher:false,calculateInRange:OpenLayers.Function.True};this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,b);this.map.addLayer(this.layer);a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)){if(this.dragging){this.cancel()}if((this.layer)&&(this.layer.map!=null)){this.layer.destroy(false);if(this.feature){this.feature.destroy()}}this.layer=null;this.feature=null;a=true}return a},down:function(a){this.fixedRadius=!!(this.radius);var b=this.map.getLonLatFromPixel(a.xy);this.origin=new OpenLayers.Geometry.Point(b.lon,b.lat);if(!this.fixedRadius||this.irregular){this.radius=this.map.getResolution()}if(this.persist){this.clear()}this.feature=new OpenLayers.Feature.Vector();this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature],{silent:true});this.layer.drawFeature(this.feature,this.style)},move:function(d){var g=this.map.getLonLatFromPixel(d.xy);var a=new OpenLayers.Geometry.Point(g.lon,g.lat);if(this.irregular){var h=Math.sqrt(2)*Math.abs(a.y-this.origin.y)/2;this.radius=Math.max(this.map.getResolution()/2,h)}else{if(this.fixedRadius){this.origin=a}else{this.calculateAngle(a,d);this.radius=Math.max(this.map.getResolution()/2,a.distanceTo(this.origin))}}this.modifyGeometry();if(this.irregular){var e=a.x-this.origin.x;var b=a.y-this.origin.y;var f;if(b==0){f=e/(this.radius*Math.sqrt(2))}else{f=e/b}this.feature.geometry.resize(1,this.origin,f);this.feature.geometry.move(e/2,b/2)}this.layer.drawFeature(this.feature,this.style)},up:function(a){this.finalize();if(this.start==this.last){this.callback("done",[a.xy])}},out:function(a){this.finalize()},createGeometry:function(){this.angle=Math.PI*((1/this.sides)-(1/2));if(this.snapAngle){this.angle+=this.snapAngle*(Math.PI/180)}this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius,this.sides,this.snapAngle)},modifyGeometry:function(){var g,d,b,a;var e=this.feature.geometry.components[0];if(e.components.length!=(this.sides+1)){this.createGeometry();e=this.feature.geometry.components[0]}for(var f=0;f<this.sides;++f){a=e.components[f];g=this.angle+(f*2*Math.PI/this.sides);a.x=this.origin.x+(this.radius*Math.cos(g));a.y=this.origin.y+(this.radius*Math.sin(g));a.clearBounds()}},calculateAngle:function(a,b){var e=Math.atan2(a.y-this.origin.y,a.x-this.origin.x);if(this.snapAngle&&(this.snapToggle&&!b[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){if(this.layer.renderer){this.layer.renderer.clear()}this.layer.destroyFeatures()}},callback:function(b,a){if(this.callbacks[b]){this.callbacks[b].apply(this.control,[this.feature.geometry.clone()])}if(!this.persist&&(b=="done"||b=="cancel")){this.clear()}},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxCharacteristics:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);var b={down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox};this.dragHandler=new OpenLayers.Handler.Drag(this,b,{keyMask:this.keyMask})},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);if(this.dragHandler){this.dragHandler.setMap(a)}},startBox:function(a){this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.dragHandler.start);this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(g){var e=this.dragHandler.start.x;var b=this.dragHandler.start.y;var d=Math.abs(e-g.x);var a=Math.abs(b-g.y);this.zoomBox.style.width=Math.max(1,d)+"px";this.zoomBox.style.height=Math.max(1,a)+"px";this.zoomBox.style.left=g.x<e?g.x+"px":e+"px";this.zoomBox.style.top=g.y<b?g.y+"px":b+"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>b){this.zoomBox.style.height=Math.max(1,a-f.yOffset)+"px"}}},endBox:function(b){var a;if(Math.abs(this.dragHandler.start.x-b.x)>5||Math.abs(this.dragHandler.start.y-b.y)>5){var h=this.dragHandler.start;var g=Math.min(h.y,b.y);var d=Math.max(h.y,b.y);var f=Math.min(h.x,b.x);var e=Math.max(h.x,b.x);a=new OpenLayers.Bounds(f,d,e,g)}else{a=this.dragHandler.start.clone()}this.removeBox();this.callback("done",[a])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null;this.boxCharacteristics=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){this.dragHandler.activate();return true}else{return false}},deactivate:function(){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){this.dragHandler.deactivate();return true}else{return false}},getBoxCharacteristics:function(){if(!this.boxCharacteristics){var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width"))+1;var d=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"))+1;var b=OpenLayers.Util.getBrowserName()=="msie"?document.compatMode!="BackCompat":true;this.boxCharacteristics={xOffset:a,yOffset:d,newBoxModel:b}}return this.boxCharacteristics},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,mousePosition:null,interval:0,delta:0,cumulative:true,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(l){if(!this.map||!this.checkModifiers(l)){return}var h=false;var n=false;var g=false;var b=OpenLayers.Event.element(l);while((b!=null)&&!g&&!h){if(!h){try{if(b.currentStyle){d=b.currentStyle.overflow}else{var a=document.defaultView.getComputedStyle(b,null);var d=a.getPropertyValue("overflow")}h=(d&&(d=="auto")||(d=="scroll"))}catch(f){}}if(!n){for(var j=0,k=this.map.layers.length;j<k;j++){if(b==this.map.layers[j].div||b==this.map.layers[j].pane){n=true;break}}}g=(b==this.map.div);b=b.parentNode}if(!h&&g){if(n){var m=0;if(!l){l=window.event}if(l.wheelDelta){m=l.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){m=-m}}else{if(l.detail){m=-l.detail/3}}this.delta=this.delta+m;if(this.interval){window.clearTimeout(this._timeoutId);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(l)},this),this.interval)}else{this.wheelZoom(l)}}OpenLayers.Event.stop(l)}},wheelZoom:function(a){var b=this.delta;this.delta=0;if(b){if(this.mousePosition){a.xy=this.mousePosition}if(!a.xy){a.xy=this.map.getPixelFromLonLat(this.map.getCenter())}if(b<0){this.callback("down",[a,this.cumulative?b:-1])}else{this.callback("up",[a,this.cumulative?b:1])}}},mousemove:function(a){this.mousePosition=a.xy},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return true}else{return false}},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel",b);OpenLayers.Event.stopObserving(document,"mousewheel",b);return true}else{return false}},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,initialize:function(d,b,a){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.observe(document,this.KEY_EVENTS[b],this.eventListener)}return true}else{return false}},deactivate:function(){var d=false;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.KEY_EVENTS.length;b<a;b++){OpenLayers.Event.stopObserving(document,this.KEY_EVENTS[b],this.eventListener)}d=true}return d},handleKeyEvent:function(a){if(this.checkModifiers(a)){this.callback(a.type,[a])}},CLASS_NAME:"OpenLayers.Handler.Keyboard"});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(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES);if(this.eventListeners instanceof Object){this.events.on(this.eventListeners)}if(this.id==null){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")}},destroy:function(){if(this.events){if(this.eventListeners){this.events.un(this.eventListeners)}this.events.destroy();this.events=null}this.eventListeners=null;if(this.handler){this.handler.destroy();this.handler=null}if(this.handlers){for(var a in this.handlers){if(this.handlers.hasOwnProperty(a)&&typeof this.handlers[a].destroy=="function"){this.handlers[a].destroy()}}this.handlers=null}if(this.map){this.map.removeControl(this);this.map=null}},setMap:function(a){this.map=a;if(this.handler){this.handler.setMap(a)}},draw:function(a){if(this.div==null){this.div=OpenLayers.Util.createDiv(this.id);this.div.className=this.displayClass;if(!this.allowSelection){this.div.className+=" olControlNoSelect";this.div.setAttribute("unselectable","on",0);this.div.onselectstart=OpenLayers.Function.False}if(this.title!=""){this.div.title=this.title}}if(a!=null){this.position=a.clone()}this.moveTo(this.position);return this.div},moveTo:function(a){if((a!=null)&&(this.div!=null)){this.div.style.left=a.x+"px";this.div.style.top=a.y+"px"}},activate:function(){if(this.active){return false}if(this.handler){this.handler.activate()}this.active=true;if(this.map){OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("activate");return true},deactivate:function(){if(this.active){if(this.handler){this.handler.deactivate()}this.active=false;if(this.map){OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active")}this.events.triggerEvent("deactivate");return true}return false},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution,addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});this.updateAttribution();return this.div},updateAttribution:function(){var e=[];if(this.map&&this.map.layers){for(var d=0,a=this.map.layers.length;d<a;d++){var b=this.map.layers[d];if(b.attribution&&b.getVisibility()){if(OpenLayers.Util.indexOf(e,b.attribution)===-1){e.push(b.attribution)}}}this.div.innerHTML=e.join(this.separator)}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:false,alwaysZoom:false,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(j){if(j instanceof OpenLayers.Bounds){var b;if(!this.out){var k=this.map.getLonLatFromPixel(new OpenLayers.Pixel(j.left,j.bottom));var o=this.map.getLonLatFromPixel(new OpenLayers.Pixel(j.right,j.top));b=new OpenLayers.Bounds(k.lon,k.lat,o.lon,o.lat)}else{var h=Math.abs(j.right-j.left);var l=Math.abs(j.top-j.bottom);var f=Math.min((this.map.size.h/l),(this.map.size.w/h));var p=this.map.getExtent();var a=this.map.getLonLatFromPixel(j.getCenterPixel());var d=a.lon-(p.getWidth()/2)*f;var g=a.lon+(p.getWidth()/2)*f;var n=a.lat-(p.getHeight()/2)*f;var e=a.lat+(p.getHeight()/2)*f;b=new OpenLayers.Bounds(d,n,g,e)}var m=this.map.getZoom();this.map.zoomToExtent(b);if(m==this.map.getZoom()&&this.alwaysZoom==true){this.map.zoomTo(m+(this.out?-1:1))}}else{if(!this.out){this.map.setCenter(this.map.getLonLatFromPixel(j),this.map.getZoom()+1)}else{this.map.setCenter(this.map.getLonLatFromPixel(j),this.map.getZoom()-1)}}},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){if(this.map){this.map.zoomToMaxExtent()}},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.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(a){this.panned=true;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:this.handler.dragging,animate:false})},panMapDone:function(a){if(this.panned){this.panMap(a);this.panned=false}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Control.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(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();if(this.dragPan){this.dragPan.destroy()}this.dragPan=null;if(this.zoomBox){this.zoomBox.destroy()}this.zoomBox=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();if(this.zoomWheelEnabled){this.handlers.wheel.activate()}this.handlers.click.activate();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 a={dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick};var b={"double":true,stopDouble:true};this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,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(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1)},defaultDblRightClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom-1)},wheelChange:function(k,d){var j=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===j){return}var l=this.map.getSize();var f=l.w/2-k.xy.x;var e=k.xy.y-l.h/2;var h=this.map.baseLayer.getResolutionForZoom(g);var a=this.map.getLonLatFromPixel(k.xy);var b=new OpenLayers.LonLat(a.lon+f*h,a.lat+e*h);this.map.setCenter(b,g)},wheelUp:function(a,b){this.wheelChange(a,b||1)},wheelDown:function(a,b){this.wheelChange(a,b||-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.Control.MouseDefaults=OpenLayers.Class(OpenLayers.Control,{performedDrag:false,wheelObserver:null,initialize:function(){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.handler){this.handler.destroy()}this.handler=null;this.map.events.un({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});OpenLayers.Event.stopObserving(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.stopObserving(window,"mousewheel",this.wheelObserver);OpenLayers.Event.stopObserving(document,"mousewheel",this.wheelObserver);this.wheelObserver=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){this.map.events.on({click:this.defaultClick,dblclick:this.defaultDblClick,mousedown:this.defaultMouseDown,mouseup:this.defaultMouseUp,mousemove:this.defaultMouseMove,mouseout:this.defaultMouseOut,scope:this});this.registerWheelEvents()},registerWheelEvents:function(){this.wheelObserver=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this);OpenLayers.Event.observe(window,"DOMMouseScroll",this.wheelObserver);OpenLayers.Event.observe(window,"mousewheel",this.wheelObserver);OpenLayers.Event.observe(document,"mousewheel",this.wheelObserver)},defaultClick:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}var a=!this.performedDrag;this.performedDrag=false;return a},defaultDblClick:function(b){var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(a,this.map.zoom+1);OpenLayers.Event.stop(b);return false},defaultMouseDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.mouseDragStart=a.xy.clone();this.performedDrag=false;if(a.shiftKey){this.map.div.style.cursor="crosshair";this.zoomBox=OpenLayers.Util.createDiv("zoomBox",this.mouseDragStart,null,null,"absolute","2px solid red");this.zoomBox.style.backgroundColor="white";this.zoomBox.style.filter="alpha(opacity=50)";this.zoomBox.style.opacity="0.50";this.zoomBox.style.fontSize="1px";this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox)}document.onselectstart=OpenLayers.Function.False;OpenLayers.Event.stop(a)},defaultMouseMove:function(f){this.mousePosition=f.xy.clone();if(this.mouseDragStart!=null){if(this.zoomBox){var e=Math.abs(this.mouseDragStart.x-f.xy.x);var b=Math.abs(this.mouseDragStart.y-f.xy.y);this.zoomBox.style.width=Math.max(1,e)+"px";this.zoomBox.style.height=Math.max(1,b)+"px";if(f.xy.x<this.mouseDragStart.x){this.zoomBox.style.left=f.xy.x+"px"}if(f.xy.y<this.mouseDragStart.y){this.zoomBox.style.top=f.xy.y+"px"}}else{var e=this.mouseDragStart.x-f.xy.x;var b=this.mouseDragStart.y-f.xy.y;var g=this.map.getSize();var a=new OpenLayers.Pixel(g.w/2+e,g.h/2+b);var d=this.map.getLonLatFromViewPortPx(a);this.map.setCenter(d,null,true);this.mouseDragStart=f.xy.clone();this.map.div.style.cursor="move"}this.performedDrag=true}},defaultMouseUp:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}if(this.zoomBox){this.zoomBoxEnd(a)}else{if(this.performedDrag){this.map.setCenter(this.map.center)}}document.onselectstart=null;this.mouseDragStart=null;this.map.div.style.cursor=""},defaultMouseOut:function(a){if(this.mouseDragStart!=null&&OpenLayers.Util.mouseLeft(a,this.map.div)){if(this.zoomBox){this.removeZoomBox()}this.mouseDragStart=null}},defaultWheelUp:function(a){if(this.map.getZoom()<=this.map.getNumZoomLevels()){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()+1)}},defaultWheelDown:function(a){if(this.map.getZoom()>0){this.map.setCenter(this.map.getLonLatFromPixel(a.xy),this.map.getZoom()-1)}},zoomBoxEnd:function(b){if(this.mouseDragStart!=null){if(Math.abs(this.mouseDragStart.x-b.xy.x)>5||Math.abs(this.mouseDragStart.y-b.xy.y)>5){var j=this.map.getLonLatFromViewPortPx(this.mouseDragStart);var a=this.map.getLonLatFromViewPortPx(b.xy);var h=Math.max(j.lat,a.lat);var d=Math.min(j.lat,a.lat);var g=Math.min(j.lon,a.lon);var e=Math.max(j.lon,a.lon);var f=new OpenLayers.Bounds(g,d,e,h);this.map.zoomToExtent(f)}else{var a=this.map.getLonLatFromViewPortPx(b.xy);this.map.setCenter(new OpenLayers.LonLat((a.lon),(a.lat)),this.map.getZoom()+1)}this.removeZoomBox()}},removeZoomBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.zoomBox=null},onWheelEvent:function(d){var b=false;var a=OpenLayers.Event.element(d);while(a!=null){if(this.map&&a==this.map.div){b=true;break}a=a.parentNode}if(b){var f=0;if(!d){d=window.event}if(d.wheelDelta){f=d.wheelDelta/120;if(window.opera&&window.opera.version()<9.2){f=-f}}else{if(d.detail){f=-d.detail/3}}if(f){d.xy=this.mousePosition;if(f<0){this.defaultWheelDown(d)}else{this.defaultWheelUp(d)}}OpenLayers.Event.stop(d)}},CLASS_NAME:"OpenLayers.Control.MouseDefaults"});OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,emptyString:null,lastXy:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){if(this.map){this.map.events.unregister("mousemove",this,this.redraw)}OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.left="";this.div.top="";this.element=this.div}this.redraw();return this.div},redraw:function(a){var d;if(a==null){this.reset();return}else{if(this.lastXy==null||Math.abs(a.xy.x-this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity){this.lastXy=a.xy;return}d=this.map.getLonLatFromPixel(a.xy);if(!d){return}if(this.displayProjection){d.transform(this.map.getProjectionObject(),this.displayProjection)}this.lastXy=a.xy}var b=this.formatOutput(d);if(b!=this.element.innerHTML){this.element.innerHTML=b}},reset:function(a){if(this.emptyString!=null){this.element.innerHTML=this.emptyString}},formatOutput:function(b){var d=parseInt(this.numDigits);var a=this.prefix+b.lon.toFixed(d)+this.separator+b.lat.toFixed(d)+this.suffix;return a},setMap:function(){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("mousemove",this,this.redraw);this.map.events.register("mouseout",this,this.reset)},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:new OpenLayers.Size(180,90),layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:false,handlers:null,resolutionFactor:1,initialize:function(a){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[a])},destroy:function(){if(!this.mapDiv){return}if(this.handlers.click){this.handlers.click.destroy()}if(this.handlers.drag){this.handlers.drag.destroy()}this.mapDiv.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.mapDiv.appendChild(this.extentRectangle);this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(!this.outsideViewport){this.div.className+=" "+this.displayClass+"Container";var f=OpenLayers.Util.getImagesLocation();var b=f+"layer-switcher-maximize.png";this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,new OpenLayers.Size(18,18),b,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton";OpenLayers.Event.observe(this.maximizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.maximizeControl,this));this.div.appendChild(this.maximizeDiv);var b=f+"layer-switcher-minimize.png";this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,new OpenLayers.Size(18,18),b,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton";OpenLayers.Event.observe(this.minimizeDiv,"click",OpenLayers.Function.bindAsEventListener(this.minimizeControl,this));this.div.appendChild(this.minimizeDiv);var g=["dblclick","mousedown"];for(var d=0,a=g.length;d<a;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);return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(k){var e=this.handlers.drag.last.x-k.x;var b=this.handlers.drag.last.y-k.y;if(e!=0||b!=0){var h=this.rectPxBounds.top;var a=this.rectPxBounds.left;var f=Math.abs(this.rectPxBounds.getHeight());var d=this.rectPxBounds.getWidth();var g=Math.max(0,(h-b));g=Math.min(g,this.ovmap.size.h-this.hComp-f);var j=Math.max(0,(a-e));j=Math.min(j,this.ovmap.size.w-this.wComp-d);this.setRectPxBounds(new OpenLayers.Bounds(j,g+f,j+d,g))}},mapDivClick:function(k){var b=this.rectPxBounds.getCenterPixel();var f=k.xy.x-b.x;var e=k.xy.y-b.y;var h=this.rectPxBounds.top;var d=this.rectPxBounds.left;var l=Math.abs(this.rectPxBounds.getHeight());var a=this.rectPxBounds.getWidth();var g=Math.max(0,(h+e));g=Math.min(g,this.ovmap.size.h-l);var j=Math.max(0,(d+f));j=Math.min(j,this.ovmap.size.w-a);this.setRectPxBounds(new OpenLayers.Bounds(j,g+l,j+a,g));this.updateMapToRect()},maximizeControl:function(a){this.element.style.display="";this.showToggle(false);if(a!=null){OpenLayers.Event.stop(a)}},minimizeControl:function(a){this.element.style.display="none";this.showToggle(true);if(a!=null){OpenLayers.Event.stop(a)}},showToggle:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":""},update:function(){if(this.ovmap==null){this.createMap()}if(this.autoPan||!this.isSuitableOverview()){this.updateOverview()}this.updateRectToMap()},isSuitableOverview:function(){var b=this.map.getExtent();var a=this.map.maxExtent;var d=new OpenLayers.Bounds(Math.max(b.left,a.left),Math.max(b.bottom,a.bottom),Math.min(b.right,a.right),Math.min(b.top,a.top));if(this.ovmap.getProjection()!=this.map.getProjection()){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 b=this.ovmap.getResolution();var e=b/d;if(e>this.maxRatio){b=this.minRatio*d}else{if(e<=this.minRatio){b=this.maxRatio*d}}var a;if(this.ovmap.getProjection()!=this.map.getProjection()){a=this.map.center.clone();a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{a=this.map.center}this.ovmap.setCenter(a,this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var b=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:false},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,b);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width"));this.wComp=(this.wComp)?this.wComp:2;this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width"));this.hComp=(this.hComp)?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:true,"double":false,stopSingle:true,stopDouble:true,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,true);this.rectEvents.register("mouseover",this,function(f){if(!this.handlers.drag.active&&!this.map.dragging){this.handlers.drag.activate()}});this.rectEvents.register("mouseout",this,function(f){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 a=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=d&&a?OpenLayers.INCHES_PER_UNIT[d]/OpenLayers.INCHES_PER_UNIT[a]:1}},updateRectToMap:function(){var b;if(this.ovmap.getProjection()!=this.map.getProjection()){b=this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())}else{b=this.map.getExtent()}var a=this.getRectBoundsFromMapBounds(b);if(a){this.setRectPxBounds(a)}},updateMapToRect:function(){var a=this.getMapBoundsFromRectBounds(this.rectPxBounds);if(this.ovmap.getProjection()!=this.map.getProjection()){a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject())}this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(e){var h=Math.max(e.top,0);var f=Math.max(e.left,0);var b=Math.min(e.top+Math.abs(e.getHeight()),this.ovmap.size.h-this.hComp);var j=Math.min(e.left+e.getWidth(),this.ovmap.size.w-this.wComp);var d=Math.max(j-f,0);var k=Math.max(b-h,0);if(d<this.minRectSize||k<this.minRectSize){this.extentRectangle.className=this.displayClass+this.minRectDisplayClass;var g=f+(d/2)-(this.minRectSize/2);var a=h+(k/2)-(this.minRectSize/2);this.extentRectangle.style.top=Math.round(a)+"px";this.extentRectangle.style.left=Math.round(g)+"px";this.extentRectangle.style.height=this.minRectSize+"px";this.extentRectangle.style.width=this.minRectSize+"px"}else{this.extentRectangle.className=this.displayClass+"ExtentRectangle";this.extentRectangle.style.top=Math.round(h)+"px";this.extentRectangle.style.left=Math.round(f)+"px";this.extentRectangle.style.height=Math.round(k)+"px";this.extentRectangle.style.width=Math.round(d)+"px"}this.rectPxBounds=new OpenLayers.Bounds(Math.round(f),Math.round(b),Math.round(j),Math.round(h))},getRectBoundsFromMapBounds:function(e){var a=new OpenLayers.LonLat(e.left,e.bottom);var g=new OpenLayers.LonLat(e.right,e.top);var d=this.getOverviewPxFromLonLat(a);var b=this.getOverviewPxFromLonLat(g);var f=null;if(d&&b){f=new OpenLayers.Bounds(d.x,d.y,b.x,b.y)}return f},getMapBoundsFromRectBounds:function(e){var d=new OpenLayers.Pixel(e.left,e.bottom);var b=new OpenLayers.Pixel(e.right,e.top);var a=this.getLonLatFromOverviewPx(d);var f=this.getLonLatFromOverviewPx(b);return new OpenLayers.Bounds(a.lon,a.lat,f.lon,f.lat)},getLonLatFromOverviewPx:function(g){var d=this.ovmap.size;var b=this.ovmap.getResolution();var a=this.ovmap.getExtent().getCenterLonLat();var f=g.x-(d.w/2);var e=g.y-(d.h/2);return new OpenLayers.LonLat(a.lon+f*b,a.lat-e*b)},getOverviewPxFromLonLat:function(e){var b=this.ovmap.getResolution();var d=this.ovmap.getExtent();var a=null;if(d){a=new OpenLayers.Pixel(Math.round(1/b*(e.lon-d.left)),Math.round(1/b*(d.top-e.lat)))}return a},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(a){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);this.removeButtons();this.buttons=null;this.position=null},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position;this.buttons=[];var d=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+d.w/2,b.y);this._addButton("panup","north-mini.png",a,d);b.y=a.y+d.h;this._addButton("panleft","west-mini.png",b,d);this._addButton("panright","east-mini.png",b.add(d.w,0),d);this._addButton("pandown","south-mini.png",a.add(0,d.h*2),d);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,d.h*3+5),d);this._addButton("zoomworld","zoom-world-mini.png",a.add(0,d.h*4+5),d);this._addButton("zoomout","zoom-minus-mini.png",a.add(0,d.h*5+5),d);return this.div},_addButton:function(a,e,k,h){var g=OpenLayers.Util.getImagesLocation()+e;var b=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,k,h,g,"absolute");this.div.appendChild(b);OpenLayers.Event.observe(b,"mousedown",OpenLayers.Function.bindAsEventListener(this.buttonDown,b));OpenLayers.Event.observe(b,"dblclick",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));OpenLayers.Event.observe(b,"click",OpenLayers.Function.bindAsEventListener(this.doubleClick,b));b.action=a;b.map=this.map;if(!this.slideRatio){var d=this.slideFactor;var f=function(){return d}}else{var j=this.slideRatio;var f=function(l){return this.map.getSize()[l]*j}}b.getSlideFactor=f;this.buttons.push(b);return b},_removeButton:function(a){OpenLayers.Event.stopObservingElement(a);a.map=null;a.getSlideFactor=null;this.div.removeChild(a);OpenLayers.Util.removeItem(this.buttons,a)},removeButtons:function(){for(var a=this.buttons.length-1;a>=0;--a){this._removeButton(this.buttons[a])}},doubleClick:function(a){OpenLayers.Event.stop(a);return false},buttonDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}switch(this.action){case"panup":this.map.pan(0,-this.getSlideFactor("h"));break;case"pandown":this.map.pan(0,this.getSlideFactor("h"));break;case"panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case"panright":this.map.pan(this.getSlideFactor("w"),0);break;case"zoomin":this.map.zoomIn();break;case"zoomout":this.map.zoomOut();break;case"zoomworld":this.map.zoomToMaxExtent();break}OpenLayers.Event.stop(a)},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoombarDiv:null,divEvents:null,zoomWorldIcon:false,forceFixedZoomLevel:false,mouseDragStart:null,zoomStart:null,initialize:function(){OpenLayers.Control.PanZoom.prototype.initialize.apply(this,arguments)},destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);delete this.mouseDragStart;delete this.zoomStart},setMap:function(a){OpenLayers.Control.PanZoom.prototype.setMap.apply(this,arguments);this.map.events.register("changebaselayer",this,this.redraw)},redraw:function(){if(this.div!=null){this.removeButtons();this._removeZoomBar()}this.draw()},draw:function(b){OpenLayers.Control.prototype.draw.apply(this,arguments);b=this.position.clone();this.buttons=[];var e=new OpenLayers.Size(18,18);var a=new OpenLayers.Pixel(b.x+e.w/2,b.y);var d=e.w;if(this.zoomWorldIcon){a=new OpenLayers.Pixel(b.x+e.w,b.y)}this._addButton("panup","north-mini.png",a,e);b.y=a.y+e.h;this._addButton("panleft","west-mini.png",b,e);if(this.zoomWorldIcon){this._addButton("zoomworld","zoom-world-mini.png",b.add(e.w,0),e);d*=2}this._addButton("panright","east-mini.png",b.add(d,0),e);this._addButton("pandown","south-mini.png",a.add(0,e.h*2),e);this._addButton("zoomin","zoom-plus-mini.png",a.add(0,e.h*3+5),e);a=this._addZoomBar(a.add(0,e.h*4+5));this._addButton("zoomout","zoom-minus-mini.png",a,e);return this.div},_addZoomBar:function(a){var f=OpenLayers.Util.getImagesLocation();var h=this.id+"_"+this.map.id;var b=this.map.getNumZoomLevels()-1-this.map.getZoom();var d=OpenLayers.Util.createAlphaImageDiv(h,a.add(-1,b*this.zoomStopHeight),new OpenLayers.Size(20,9),f+"slider.png","absolute");this.slider=d;this.sliderEvents=new OpenLayers.Events(this,d,null,true,{includeXY:true});this.sliderEvents.on({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});var e=new OpenLayers.Size();e.h=this.zoomStopHeight*this.map.getNumZoomLevels();e.w=this.zoomStopWidth;var g=null;if(OpenLayers.Util.alphaHack()){var h=this.id+"_"+this.map.id;g=OpenLayers.Util.createAlphaImageDiv(h,a,new OpenLayers.Size(e.w,this.zoomStopHeight),f+"zoombar.png","absolute",null,"crop");g.style.height=e.h+"px"}else{g=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,e,f+"zoombar.png")}this.zoombarDiv=g;this.divEvents=new OpenLayers.Events(this,g,null,true,{includeXY:true});this.divEvents.on({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.div.appendChild(g);this.startTop=parseInt(g.style.top);this.div.appendChild(d);this.map.events.register("zoomend",this,this.moveZoomBar);a=a.add(0,this.zoomStopHeight*this.map.getNumZoomLevels());return a},_removeZoomBar:function(){this.sliderEvents.un({mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp,dblclick:this.doubleClick,click:this.doubleClick});this.sliderEvents.destroy();this.divEvents.un({mousedown:this.divClick,mousemove:this.passEventToSlider,dblclick:this.doubleClick,click:this.doubleClick});this.divEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},divClick:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}var f=a.xy.y;var e=OpenLayers.Util.pagePosition(a.object)[1];var d=(f-e)/this.zoomStopHeight;if(this.forceFixedZoomLevel||!this.map.fractionalZoom){d=Math.floor(d)}var b=(this.map.getNumZoomLevels()-1)-d;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(b);OpenLayers.Event.stop(a)},zoomBarDown:function(a){if(!OpenLayers.Event.isLeftClick(a)){return}this.map.events.on({mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this});this.mouseDragStart=a.xy.clone();this.zoomStart=a.xy.clone();this.div.style.cursor="move";this.zoombarDiv.offsets=null;OpenLayers.Event.stop(a)},zoomBarDrag:function(b){if(this.mouseDragStart!=null){var a=this.mouseDragStart.y-b.xy.y;var e=OpenLayers.Util.pagePosition(this.zoombarDiv);if((b.clientY-e[1])>0&&(b.clientY-e[1])<parseInt(this.zoombarDiv.style.height)-2){var d=parseInt(this.slider.style.top)-a;this.slider.style.top=d+"px";this.mouseDragStart=b.xy.clone()}OpenLayers.Event.stop(b)}},zoomBarUp:function(b){if(!OpenLayers.Event.isLeftClick(b)){return}if(this.mouseDragStart){this.div.style.cursor="";this.map.events.un({mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var a=this.zoomStart.y-b.xy.y;var d=this.map.zoom;if(!this.forceFixedZoomLevel&&this.map.fractionalZoom){d+=a/this.zoomStopHeight;d=Math.min(Math.max(d,0),this.map.getNumZoomLevels()-1)}else{d+=Math.round(a/this.zoomStopHeight)}this.map.zoomTo(d);this.mouseDragStart=null;this.zoomStart=null;OpenLayers.Event.stop(b)}},moveZoomBar:function(){var a=((this.map.getNumZoomLevels()-1)-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments)},setMap:function(f){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var d=0,a=this.map.controls.length;d<a;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 b=OpenLayers.Util.getParameters();if(b.layers){this.layers=b.layers;this.map.events.register("addlayer",this,this.configureLayers);this.configureLayers()}if(b.lat&&b.lon){this.center=new OpenLayers.LonLat(parseFloat(b.lon),parseFloat(b.lat));if(b.zoom){this.zoom=parseInt(b.zoom)}this.map.events.register("changebaselayer",this,this.setCenter);this.setCenter()}}},setCenter:function(){if(this.map.baseLayer){this.map.events.unregister("changebaselayer",this,this.setCenter);if(this.displayProjection){this.center.transform(this.displayProjection,this.map.getProjectionObject())}this.map.setCenter(this.center,this.zoom)}},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var d=0,a=this.layers.length;d<a;d++){var b=this.map.layers[d];var e=this.layers.charAt(d);if(e=="B"){this.map.setBaseLayer(b)}else{if((e=="T")||(e=="F")){b.setVisibility(e=="T")}}}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,base:"",displayProjection:null,initialize:function(b,d,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b);this.base=d||document.location.href},destroy:function(){if(this.element.parentNode==this.div){this.div.removeChild(this.element)}this.element=null;this.map.events.unregister("moveend",this,this.updateLink);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(e){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,a=this.map.controls.length;b<a;b++){var d=this.map.controls[b];if(d.CLASS_NAME==this.argParserClass.CLASS_NAME){if(d.displayProjection!=this.displayProjection){this.displayProjection=d.displayProjection}break}}if(b==this.map.controls.length){this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.div.className=this.displayClass;this.element=document.createElement("a");this.element.innerHTML=OpenLayers.i18n("permalink");this.element.href="";this.div.appendChild(this.element)}this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink,changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.base;if(a.indexOf("?")!=-1){a=a.substring(0,a.indexOf("?"))}a+="?"+OpenLayers.Util.getParameterString(this.createParams());this.element.href=a},createParams:function(a,l,f){a=a||this.map.getCenter();var e=OpenLayers.Util.getParameters(this.base);if(a){e.zoom=l||this.map.getZoom();var k=a.lat;var b=a.lon;if(this.displayProjection){var d=OpenLayers.Projection.transform({x:b,y:k},this.map.getProjectionObject(),this.displayProjection);b=d.x;k=d.y}e.lat=Math.round(k*100000)/100000;e.lon=Math.round(b*100000)/100000;f=f||this.map.layers;e.layers="";for(var g=0,j=f.length;g<j;g++){var h=f[g];if(h.isBaseLayer){e.layers+=(h==this.map.baseLayer)?"B":"0"}else{e.layers+=(h.getVisibility())?"T":"F"}}}return e},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.element=OpenLayers.Util.getElement(b)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.element){this.element=document.createElement("div");this.div.appendChild(this.element)}this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var a=this.map.getScale();if(!a){return}if(a>=9500&&a<=950000){a=Math.round(a/1000)+"K"}else{if(a>=950000){a=Math.round(a/1000000)+"M"}else{a=Math.round(a)}}this.element.innerHTML=OpenLayers.i18n("scale",{scaleDenom:a})},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:false,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a])},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.eTop){this.eTop=document.createElement("div");this.eTop.className=this.displayClass+"Top";var a=this.topInUnits.length;this.div.appendChild(this.eTop);if((this.topOutUnits=="")||(this.topInUnits=="")){this.eTop.style.visibility="hidden"}else{this.eTop.style.visibility="visible"}this.eBottom=document.createElement("div");this.eBottom.className=this.displayClass+"Bottom";this.div.appendChild(this.eBottom);if((this.bottomOutUnits=="")||(this.bottomInUnits=="")){this.eBottom.style.visibility="hidden"}else{this.eBottom.style.visibility="visible"}}this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(b){var e=parseInt(Math.log(b)/Math.log(10));var a=Math.pow(10,e);var d=parseInt(b/a);var f;if(d>5){f=5}else{if(d>2){f=2}else{f=1}}return f*a},update:function(){var l=this.map.getResolution();if(!l){return}var q=this.map.getUnits();var f=OpenLayers.INCHES_PER_UNIT;var n=this.maxWidth*l*f[q];var p=1;if(this.geodesic===true){var b=this.getGeodesicLength(this.maxWidth);var g=n/f.km;p=b/g;n*=p}var a;var e;if(n>100000){a=this.topOutUnits;e=this.bottomOutUnits}else{a=this.topInUnits;e=this.bottomInUnits}var j=n/f[a];var m=n/f[e];var k=this.getBarLen(j);var h=this.getBarLen(m);j=k/f[q]*f[a];m=h/f[q]*f[e];var d=j/l/p;var o=m/l/p;if(this.eBottom.style.visibility=="visible"){this.eBottom.style.width=Math.round(o)+"px";this.eBottom.innerHTML=h+" "+e}if(this.eTop.style.visibility=="visible"){this.eTop.style.width=Math.round(d)+"px";this.eTop.innerHTML=k+" "+a}},getGeodesicLength:function(h){var g=this.map;var d=g.getPixelFromLonLat(g.getCenter());var a=g.getLonLatFromPixel(d.add(0,-h/2));var f=g.getLonLatFromPixel(d.add(0,h/2));var e=g.getProjectionObject();var b=new OpenLayers.Projection("EPSG:4326");if(!e.equals(b)){a.transform(e,b);f.transform(e,b)}return OpenLayers.Util.distVincenty(a,f)},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesnap","snap","unsnap"],DEFAULTS:{tolerance:10,node:true,edge:true,vertex:true},greedy:true,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.layer){this.setLayer(this.options.layer)}var b=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(b,this.DEFAULTS);this.setTargets(this.options.targets);if(this.targets.length===0&&this.layer){this.addTargetLayer(this.layer)}this.geoToleranceCache={}},setLayer:function(a){if(this.active){this.deactivate();this.layer=a;this.activate()}else{this.layer=a}},setTargets:function(b){this.targets=[];if(b&&b.length){var e;for(var d=0,a=b.length;d<a;++d){e=b[d];if(e instanceof OpenLayers.Layer.Vector){this.addTargetLayer(e)}else{this.addTarget(e)}}}},addTargetLayer:function(a){this.addTarget({layer:a})},addTarget:function(a){a=OpenLayers.Util.applyDefaults(a,this.defaults);a.nodeTolerance=a.nodeTolerance||a.tolerance;a.vertexTolerance=a.vertexTolerance||a.tolerance;a.edgeTolerance=a.edgeTolerance||a.tolerance;this.targets.push(a)},removeTargetLayer:function(b){var d;for(var a=this.targets.length-1;a>=0;--a){d=this.targets[a];if(d.layer===b){this.removeTarget(d)}}},removeTarget:function(a){return OpenLayers.Util.removeItem(this.targets,a)},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.on({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.layer&&this.layer.events){this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this})}}this.feature=null;this.point=null;return a},onSketchModified:function(a){this.feature=a.feature;this.considerSnapping(a.vertex,a.vertex)},onVertexModified:function(a){this.feature=a.feature;var b=this.layer.map.getLonLatFromViewPortPx(a.pixel);this.considerSnapping(a.vertex,new OpenLayers.Geometry.Point(b.lon,b.lat))},considerSnapping:function(j,e){var a={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null};var d=false;var k,g;for(var b=0,f=this.targets.length;b<f;++b){g=this.targets[b];k=this.testTarget(g,e);if(k){if(this.greedy){a=k;a.target=g;d=true;break}else{if((k.rank<a.rank)||(k.rank===a.rank&&k.dist<a.dist)){a=k;a.target=g;d=true}}}}if(d){var h=this.events.triggerEvent("beforesnap",{point:j,x:a.x,y:a.y,distance:a.dist,layer:a.target.layer,snapType:this.precedence[a.rank]});if(h!==false){j.x=a.x;j.y=a.y;this.point=j;this.events.triggerEvent("snap",{point:j,snapType:this.precedence[a.rank],layer:a.target.layer,distance:a.dist})}else{d=false}}if(this.point&&!d){j.x=e.x;j.y=e.y;this.point=null;this.events.triggerEvent("unsnap",{point:j})}},testTarget:function(B,g){var z={node:this.getGeoTolerance(B.nodeTolerance),vertex:this.getGeoTolerance(B.vertexTolerance),edge:this.getGeoTolerance(B.edgeTolerance)};var h=Math.max(z.node,z.vertex,z.edge);var l={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY};var f=false;var d=B.layer.features;var b,a,e,A,p,q,o;var n=this.precedence.length;var m=new OpenLayers.LonLat(g.x,g.y);for(var w=0,x=d.length;w<x;++w){b=d[w];if(b!==this.feature&&!b._sketch&&b.state!==OpenLayers.State.DELETE&&(!B.filter||B.filter.evaluate(b.attributes))){if(b.atPoint(m,h,h)){for(var v=0,s=Math.min(l.rank+1,n);v<s;++v){a=this.precedence[v];if(B[a]){if(a==="edge"){p=b.geometry.distanceTo(g,{details:true});q=p.distance;if(q<=z[a]&&q<l.dist){l={rank:v,dist:q,x:p.x0,y:p.y0};f=true;break}}else{e=b.geometry.getVertices(a==="node");o=false;for(var u=0,t=e.length;u<t;++u){A=e[u];q=A.distanceTo(g);if(q<=z[a]&&(v<l.rank||(v===l.rank&&q<l.dist))){l={rank:v,dist:q,x:A.x,y:A.y};f=true;o=true}}if(o){break}}}}}}}return f?l:null},getGeoTolerance:function(a){var b=this.layer.map.getResolution();if(b!==this.resolution){this.resolution=b;this.geoToleranceCache={}}var d=this.geoToleranceCache[a];if(d===undefined){d=a*b;this.geoToleranceCache[a]=d}return d},destroy:function(){if(this.active){this.deactivate()}delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesplit","split","aftersplit"],layer:null,source:null,sourceOptions:null,tolerance:null,edge:true,deferDelete:false,mutual:true,targetFilter:null,sourceFilter:null,handler:null,initialize:function(a){Array.prototype.push.apply(this.EVENT_TYPES,OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};if(this.options.source){this.setSource(this.options.source)}},setSource:function(a){if(this.active){this.deactivate();if(this.handler){this.handler.destroy();delete this.handler}this.source=a;this.activate()}else{this.source=a}},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a){if(!this.source){if(!this.handler){this.handler=new OpenLayers.Handler.Path(this,{done:function(b){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(b)})}},{layerOptions:this.sourceOptions})}this.handler.activate()}else{if(this.source.events){this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);if(a){if(this.source&&this.source.events){this.layer.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this})}}return a},onSketchComplete:function(a){this.feature=null;return !this.considerSplit(a.feature)},afterFeatureModified:function(b){if(b.modified){var a=b.feature;if(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString){this.feature=b.feature;this.considerSplit(b.feature)}}},removeByGeometry:function(d,e){for(var b=0,a=d.length;b<a;++b){if(d[b].geometry===e){d.splice(b,1);break}}},isEligible:function(a){return(a.state!==OpenLayers.State.DELETE)&&(a.geometry instanceof OpenLayers.Geometry.LineString||a.geometry instanceof OpenLayers.Geometry.MultiLineString)&&(this.feature!==a)&&(!this.targetFilter||this.targetFilter.evaluate(a.attributes))},considerSplit:function(d){sourceSplit=false;targetSplit=false;if(!this.sourceFilter||this.sourceFilter.evaluate(d.attributes)){var g=this.layer&&this.layer.features||[];var A,p,h,a;var m=[],z=[];var e=(this.layer===this.source)&&this.mutual;var b={edge:this.edge,tolerance:this.tolerance,mutual:e};var l=[d.geometry];var o,f;var s,q;for(var w=0,x=g.length;w<x;++w){o=g[w];if(this.isEligible(o)){f=[o.geometry];for(var v=0;v<l.length;++v){s=l[v];for(var t=0;t<f.length;++t){A=f[t];if(s.getBounds().intersectsBounds(A.getBounds())){p=s.split(A,b);if(p){a=this.events.triggerEvent("beforesplit",{source:d,target:o});if(a!==false){if(e){q=p[0];if(q.length>1){q.unshift(v,1);Array.prototype.splice.apply(l,q);v+=q.length-3}p=p[1]}if(p.length>1){p.unshift(t,1);Array.prototype.splice.apply(f,p);t+=p.length-3}}}}}}if(f&&f.length>1){this.geomsToFeatures(o,f);this.events.triggerEvent("split",{original:o,features:f});Array.prototype.push.apply(m,f);z.push(o);targetSplit=true}}}if(l&&l.length>1){this.geomsToFeatures(d,l);this.events.triggerEvent("split",{original:d,features:l});Array.prototype.push.apply(m,l);z.push(d);sourceSplit=true}if(sourceSplit||targetSplit){if(this.deferDelete){var n,u=[];for(var w=0,x=z.length;w<x;++w){n=z[w];if(n.state===OpenLayers.State.INSERT){u.push(n)}else{n.state=OpenLayers.State.DELETE;this.layer.drawFeature(n)}}this.layer.destroyFeatures(u,{silent:true});for(var w=0,x=m.length;w<x;++w){m[w].state=OpenLayers.State.INSERT}}else{this.layer.destroyFeatures(z,{silent:true})}this.layer.addFeatures(m,{silent:true});this.events.triggerEvent("aftersplit",{source:d,features:m})}}return sourceSplit},geomsToFeatures:function(d,e){var g=d.clone();delete g.geometry;var f;for(var b=0,a=e.length;b<a;++b){f=g.clone();f.geometry=e[b];f.state=OpenLayers.State.INSERT;e[b]=f}},destroy:function(){if(this.active){this.deactivate()}OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,EVENT_TYPES:["featureadded"],multi:false,featureAdded:function(){},handlerOptions:null,initialize:function(b,d,a){this.EVENT_TYPES=OpenLayers.Control.DrawFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(g,f){this.layer.events.triggerEvent("sketchmodified",{vertex:g,feature:f})},create:function(g,f){this.layer.events.triggerEvent("sketchstarted",{vertex:g,feature:f})}},this.callbacks);this.layer=b;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 a=new OpenLayers.Feature.Vector(d);var b=this.layer.events.triggerEvent("sketchcomplete",{feature:a});if(b!==false){a.state=OpenLayers.State.INSERT;this.layer.addFeatures([a]);this.featureAdded(a);this.events.triggerEvent("featureadded",{feature:a})}},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(b,a){},onDrag:function(b,a){},onComplete:function(b,a){},documentDrag:false,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(b,a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature,up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{documentDrag:this.documentDrag}),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return(this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=false;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){if(!this.handlers.drag.dragging){this.feature=a;this.handlers.drag.activate();this.over=true;OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over")}else{if(this.feature.id==a.id){this.over=true}else{this.over=false}}},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b*(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(a){if(!this.over){this.handlers.drag.deactivate()}},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){if(!this.handlers.drag.dragging){this.over=false;this.handlers.drag.deactivate();OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over");this.feature=null}else{if(this.feature.id==a.id){this.over=false}}},cancel:function(){this.handlers.drag.deactivate();this.over=false},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,clickout:true,toggle:true,standalone:false,layer:null,feature:null,vertices:null,virtualVertices:null,selectControl:null,dragControl:null,handlers:null,deleteCodes:null,virtualStyle:null,mode:null,modified:false,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(e,d){this.layer=e;this.vertices=[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer());this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[d]);if(!(this.deleteCodes instanceof Array)){this.deleteCodes=[this.deleteCodes]}var g=this;var a={geometryTypes:this.geometryTypes,clickout:this.clickout,toggle:this.toggle,onBeforeSelect:this.beforeSelectFeature,onSelect:this.selectFeature,onUnselect:this.unselectFeature,scope:this};if(this.standalone===false){this.selectControl=new OpenLayers.Control.SelectFeature(e,a)}var b={geometryTypes:["OpenLayers.Geometry.Point"],snappingOptions:this.snappingOptions,onStart:function(j,h){g.dragStart.apply(g,[j,h])},onDrag:function(j,h){g.dragVertex.apply(g,[j,h])},onComplete:function(h){g.dragComplete.apply(g,[h])},featureCallbacks:{over:function(h){if(g.standalone!==true||h._sketch||g.feature===h){g.dragControl.overFeature.apply(g.dragControl,[h])}}}};this.dragControl=new OpenLayers.Control.DragFeature(e,b);var f={keydown:this.handleKeypress};this.handlers={keyboard:new OpenLayers.Handler.Keyboard(this,f)}},destroy:function(){this.layer=null;this.standalone||this.selectControl.destroy();this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return((this.standalone||this.selectControl.activate())&&this.handlers.keyboard.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments))},deactivate:function(){var d=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.vertices,{silent:true});this.layer.removeFeatures(this.virtualVertices,{silent:true});this.vertices=[];this.dragControl.deactivate();var a=this.feature;var b=a&&a.geometry&&a.layer;if(this.standalone===false){if(b){this.selectControl.unselect.apply(this.selectControl,[a])}this.selectControl.deactivate()}else{if(b){this.unselectFeature(a)}}this.handlers.keyboard.deactivate();d=true}return d},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified",{feature:a})},selectFeature:function(a){this.feature=a;this.modified=false;this.resetVertices();this.dragControl.activate();this.onModificationStart(this.feature)},unselectFeature:function(a){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[];if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});delete this.dragHandle}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});delete this.radiusHandle}this.feature=null;this.dragControl.deactivate();this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified",{feature:a,modified:this.modified});this.modified=false},dragStart:function(b,a){if(b!=this.feature&&!b.geometry.parent&&b!=this.dragHandle&&b!=this.radiusHandle){if(this.standalone===false&&this.feature){this.selectControl.clickFeature.apply(this.selectControl,[this.feature])}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,b.geometry.CLASS_NAME)!=-1){this.standalone||this.selectControl.clickFeature.apply(this.selectControl,[b]);this.dragControl.overFeature.apply(this.dragControl,[b]);this.dragControl.lastPixel=a;this.dragControl.handlers.drag.started=true;this.dragControl.handlers.drag.start=a;this.dragControl.handlers.drag.last=a}}},dragVertex:function(b,a){this.modified=true;if(this.feature.geometry.CLASS_NAME=="OpenLayers.Geometry.Point"){if(this.feature!=b){this.feature=b}this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}else{if(b._index){b.geometry.parent.addComponent(b.geometry,b._index);delete b._index;OpenLayers.Util.removeItem(this.virtualVertices,b);this.vertices.push(b)}else{if(b==this.dragHandle){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[];if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}}else{if(b!==this.radiusHandle){this.layer.events.triggerEvent("vertexmodified",{vertex:b.geometry,feature:this.feature,pixel:a})}}}if(this.virtualVertices.length>0){this.layer.destroyFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}this.layer.drawFeature(this.feature,this.standalone?undefined:this.selectControl.renderIntent)}this.layer.drawFeature(b)},dragComplete:function(a){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&&this.feature.state!=OpenLayers.State.DELETE){this.feature.state=OpenLayers.State.UPDATE}},resetVertices:function(){if(this.dragControl.feature){this.dragControl.outFeature(this.dragControl.feature)}if(this.vertices.length>0){this.layer.removeFeatures(this.vertices,{silent:true});this.vertices=[]}if(this.virtualVertices.length>0){this.layer.removeFeatures(this.virtualVertices,{silent:true});this.virtualVertices=[]}if(this.dragHandle){this.layer.destroyFeatures([this.dragHandle],{silent:true});this.dragHandle=null}if(this.radiusHandle){this.layer.destroyFeatures([this.radiusHandle],{silent:true});this.radiusHandle=null}if(this.feature&&this.feature.geometry.CLASS_NAME!="OpenLayers.Geometry.Point"){if((this.mode&OpenLayers.Control.ModifyFeature.DRAG)){this.collectDragHandle()}if((this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE))){this.collectRadiusHandle()}if(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE){if(!(this.mode&OpenLayers.Control.ModifyFeature.RESIZE)){this.collectVertices()}}}},handleKeypress:function(a){var b=a.keyCode;if(this.feature&&OpenLayers.Util.indexOf(this.deleteCodes,b)!=-1){var d=this.dragControl.feature;if(d&&OpenLayers.Util.indexOf(this.vertices,d)!=-1&&!this.dragControl.handlers.drag.dragging&&d.geometry.parent){d.geometry.parent.removeComponent(d.geometry);this.layer.drawFeature(this.feature,this.standalone?undefined:this.selectControl.renderIntent);this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})}}},collectVertices:function(){this.vertices=[];this.virtualVertices=[];var a=this;function b(j){var e,f,k,g;if(j.CLASS_NAME=="OpenLayers.Geometry.Point"){f=new OpenLayers.Feature.Vector(j);f._sketch=true;a.vertices.push(f)}else{var d=j.components.length;if(j.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){d-=1}for(e=0;e<d;++e){k=j.components[e];if(k.CLASS_NAME=="OpenLayers.Geometry.Point"){f=new OpenLayers.Feature.Vector(k);f._sketch=true;a.vertices.push(f)}else{b(k)}}if(j.CLASS_NAME!="OpenLayers.Geometry.MultiPoint"){for(e=0,g=j.components.length;e<g-1;++e){var n=j.components[e];var o=j.components[e+1];if(n.CLASS_NAME=="OpenLayers.Geometry.Point"&&o.CLASS_NAME=="OpenLayers.Geometry.Point"){var l=(n.x+o.x)/2;var h=(n.y+o.y)/2;var m=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(l,h),null,a.virtualStyle);m.geometry.parent=j;m._index=e+1;m._sketch=true;a.virtualVertices.push(m)}}}}}b.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:true});this.layer.addFeatures(this.vertices,{silent:true})},collectDragHandle:function(){var e=this.feature.geometry;var a=e.getBounds().getCenterLonLat();var d=new OpenLayers.Geometry.Point(a.lon,a.lat);var b=new OpenLayers.Feature.Vector(d);d.move=function(f,g){OpenLayers.Geometry.Point.prototype.move.call(this,f,g);e.move(f,g)};b._sketch=true;this.dragHandle=b;this.layer.addFeatures([this.dragHandle],{silent:true})},collectRadiusHandle:function(){var j=this.feature.geometry;var a=j.getBounds();var b=a.getCenterLonLat();var k=new OpenLayers.Geometry.Point(b.lon,b.lat);var h=new OpenLayers.Geometry.Point(a.right,a.bottom);var g=new OpenLayers.Feature.Vector(h);var d=(this.mode&OpenLayers.Control.ModifyFeature.RESIZE);var f=(this.mode&OpenLayers.Control.ModifyFeature.RESHAPE);var e=(this.mode&OpenLayers.Control.ModifyFeature.ROTATE);h.move=function(w,v){OpenLayers.Geometry.Point.prototype.move.call(this,w,v);var z=this.x-k.x;var s=this.y-k.y;var A=z-w;var t=s-v;if(e){var m=Math.atan2(t,A);var l=Math.atan2(s,z);var p=l-m;p*=180/Math.PI;j.rotate(p,k)}if(d){var o,u;if(f){o=s/t;u=(z/A)/o}else{var q=Math.sqrt((A*A)+(t*t));var n=Math.sqrt((z*z)+(s*s));o=n/q}j.resize(o,k,u)}};g._sketch=true;this.radiusHandle=g;this.layer.addFeatures([this.radiusHandle],{silent:true})},setMap:function(a){this.standalone||this.selectControl.setMap(a);this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.ModifyFeature"});OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:true,defaultControl:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[]},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a=this.controls.length-1;a>=0;a--){if(this.controls[a].events){this.controls[a].events.un({activate:this.redraw,deactivate:this.redraw,scope:this})}OpenLayers.Event.stopObservingElement(this.controls[a].panel_div);this.controls[a].panel_div=null}},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]==this.defaultControl){this.controls[b].activate()}}this.redraw();return true}else{return false}},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var b=0,a=this.controls.length;b<a;b++){this.controls[b].deactivate()}return true}else{return false}},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);for(var b=0,a=this.controls.length;b<a;b++){this.map.addControl(this.controls[b]);this.controls[b].deactivate();this.controls[b].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}return this.div},redraw:function(){this.div.innerHTML="";if(this.active){for(var d=0,a=this.controls.length;d<a;d++){var b=this.controls[d].panel_div;if(this.controls[d].active){b.className=this.controls[d].displayClass+"ItemActive"}else{b.className=this.controls[d].displayClass+"ItemInactive"}this.div.appendChild(b)}}},activateControl:function(d){if(!this.active){return false}if(d.type==OpenLayers.Control.TYPE_BUTTON){d.trigger();this.redraw();return}if(d.type==OpenLayers.Control.TYPE_TOGGLE){if(d.active){d.deactivate()}else{d.activate()}this.redraw();return}for(var b=0,a=this.controls.length;b<a;b++){if(this.controls[b]!=d){if(this.controls[b].type!=OpenLayers.Control.TYPE_TOGGLE){this.controls[b].deactivate()}}}d.activate()},addControls:function(b){if(!(b instanceof Array)){b=[b]}this.controls=this.controls.concat(b);for(var e=0,a=b.length;e<a;e++){var d=document.createElement("div");b[e].panel_div=d;if(b[e].title!=""){b[e].panel_div.title=b[e].title}OpenLayers.Event.observe(b[e].panel_div,"click",OpenLayers.Function.bind(this.onClick,this,b[e]));OpenLayers.Event.observe(b[e].panel_div,"dblclick",OpenLayers.Function.bind(this.onDoubleClick,this,b[e]));OpenLayers.Event.observe(b[e].panel_div,"mousedown",OpenLayers.Function.bindAsEventListener(OpenLayers.Event.stop))}if(this.map){for(var e=0,a=b.length;e<a;e++){this.map.addControl(b[e]);b[e].deactivate();b[e].events.on({activate:this.redraw,deactivate:this.redraw,scope:this})}this.redraw()}},onClick:function(b,a){OpenLayers.Event.stop(a?a:window.event);this.activateControl(b)},onDoubleClick:function(b,a){OpenLayers.Event.stop(a?a:window.event)},getControlsBy:function(d,a){var e=(typeof a.test=="function");var b=OpenLayers.Array.filter(this.controls,function(f){return f[d]==a||(e&&a.test(f[d]))});return b},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforefeaturehighlighted","featurehighlighted","featureunhighlighted"],multipleKey:null,toggleKey:null,multiple:false,clickout:true,toggle:false,hover:false,highlightOnly:false,box:false,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(d,a){this.EVENT_TYPES=OpenLayers.Control.SelectFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);if(this.scope===null){this.scope=this}this.initLayer(d);var b={click:this.clickFeature,clickout:this.clickoutFeature};if(this.hover){b.over=this.overFeature;b.out=this.outFeature}this.callbacks=OpenLayers.Util.extend(b,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"})}},initLayer:function(a){if(a instanceof Array){this.layers=a;this.layer=new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:a})}else{this.layer=a}},destroy:function(){if(this.active&&this.layers){this.map.removeLayer(this.layer)}OpenLayers.Control.prototype.destroy.apply(this,arguments);if(this.layers){this.layer.destroy()}},activate:function(){if(!this.active){if(this.layers){this.map.addLayer(this.layer)}this.handlers.feature.activate();if(this.box&&this.handlers.box){this.handlers.box.activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){this.handlers.feature.deactivate();if(this.handlers.box){this.handlers.box.deactivate()}if(this.layers){this.map.removeLayer(this.layer)}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(b){var g=this.layers||[this.layer];var f,e;for(var a=0;a<g.length;++a){f=g[a];for(var d=f.selectedFeatures.length-1;d>=0;--d){e=f.selectedFeatures[d];if(!b||b.except!=e){this.unselect(e)}}}},clickFeature:function(a){if(!this.hover){var b=(OpenLayers.Util.indexOf(a.layer.selectedFeatures,a)>-1);if(b){if(this.toggleSelect()){this.unselect(a)}else{if(!this.multipleSelect()){this.unselectAll({except:a})}}}else{if(!this.multipleSelect()){this.unselectAll({except:a})}this.select(a)}}},multipleSelect:function(){return this.multiple||(this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey])},toggleSelect:function(){return this.toggle||(this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey])},clickoutFeature:function(a){if(!this.hover&&this.clickout){this.unselectAll()}},overFeature:function(b){var a=b.layer;if(this.hover){if(this.highlightOnly){this.highlight(b)}else{if(OpenLayers.Util.indexOf(a.selectedFeatures,b)==-1){this.select(b)}}}},outFeature:function(a){if(this.hover){if(this.highlightOnly){if(a._lastHighlighter==this.id){if(a._prevHighlighter&&a._prevHighlighter!=this.id){delete a._lastHighlighter;var b=this.map.getControl(a._prevHighlighter);if(b){b.highlight(a)}}else{this.unhighlight(a)}}}else{this.unselect(a)}}},highlight:function(d){var b=d.layer;var a=this.events.triggerEvent("beforefeaturehighlighted",{feature:d});if(a!==false){d._prevHighlighter=d._lastHighlighter;d._lastHighlighter=this.id;var e=this.selectStyle||this.renderIntent;b.drawFeature(d,e);this.events.triggerEvent("featurehighlighted",{feature:d})}},unhighlight:function(b){var a=b.layer;b._lastHighlighter=b._prevHighlighter;delete b._prevHighlighter;a.drawFeature(b,b.style||b.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:b})},select:function(d){var a=this.onBeforeSelect.call(this.scope,d);var b=d.layer;if(a!==false){a=b.events.triggerEvent("beforefeatureselected",{feature:d});if(a!==false){b.selectedFeatures.push(d);this.highlight(d);if(!this.handlers.feature.lastFeature){this.handlers.feature.lastFeature=b.selectedFeatures[0]}b.events.triggerEvent("featureselected",{feature:d});this.onSelect.call(this.scope,d)}}},unselect:function(b){var a=b.layer;this.unhighlight(b);OpenLayers.Util.removeItem(a.selectedFeatures,b);a.events.triggerEvent("featureunselected",{feature:b});this.onUnselect.call(this.scope,b)},selectBox:function(f){if(f instanceof OpenLayers.Bounds){var j=this.map.getLonLatFromPixel(new OpenLayers.Pixel(f.left,f.bottom));var m=this.map.getLonLatFromPixel(new OpenLayers.Pixel(f.right,f.top));var a=new OpenLayers.Bounds(j.lon,j.lat,m.lon,m.lat);if(!this.multipleSelect()){this.unselectAll()}var k=this.multiple;this.multiple=true;var e=this.layers||[this.layer];var g;for(var b=0;b<e.length;++b){g=e[b];for(var d=0,h=g.features.length;d<h;++d){var n=g.features[d];if(!n.getVisibility()){continue}if(this.geometryTypes==null||OpenLayers.Util.indexOf(this.geometryTypes,n.geometry.CLASS_NAME)>-1){if(a.toGeometry().intersects(n.geometry)){if(OpenLayers.Util.indexOf(g.selectedFeatures,n)==-1){this.select(n)}}}}}this.multiple=k}},setMap:function(a){this.handlers.feature.setMap(a);if(this.box){this.handlers.box.setMap(a)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(b){var a=this.active;this.unselectAll();this.deactivate();if(this.layers){this.layer.destroy();this.layers=null}this.initLayer(b);this.handlers.feature.layer=this.layer;if(a){this.activate()}},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["measure","measurepartial"],handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:false,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:false,initialize:function(b,a){this.EVENT_TYPES=OpenLayers.Control.Measure.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.callbacks=OpenLayers.Util.extend({done:this.measureComplete,point:this.measurePartial},this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new b(this,this.callbacks,this.handlerOptions)},cancel:function(){this.handler.cancel()},updateHandler:function(b,a){var d=this.active;if(d){this.deactivate()}this.handler=new b(this,this.callbacks,a);if(d){this.activate()}},measureComplete:function(a){if(this.delayedTrigger){window.clearTimeout(this.delayedTrigger)}this.measure(a,"measure")},measurePartial:function(a,b){this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.measure(b,"measurepartial")},this),this.partialDelay)},measure:function(e,b){var d,a;if(e.CLASS_NAME.indexOf("LineString")>-1){d=this.getBestLength(e);a=1}else{d=this.getBestArea(e);a=2}this.events.triggerEvent(b,{measure:d[0],units:d[1],order:a,geometry:e})},getBestArea:function(g){var b=this.displaySystemUnits[this.displaySystem];var f,e;for(var d=0,a=b.length;d<a;++d){f=b[d];e=this.getArea(g,f);if(e>1){break}}return[e,f]},getArea:function(g,a){var b,d;if(this.geodesic){b=g.getGeodesicArea(this.map.getProjectionObject());d="m"}else{b=g.getArea();d=this.map.getUnits()}var f=OpenLayers.INCHES_PER_UNIT[a];if(f){var e=OpenLayers.INCHES_PER_UNIT[d];b*=Math.pow((e/f),2)}return b},getBestLength:function(g){var b=this.displaySystemUnits[this.displaySystem];var f,e;for(var d=0,a=b.length;d<a;++d){f=b[d];e=this.getLength(g,f);if(e>1){break}}return[e,f]},getLength:function(g,a){var b,d;if(this.geodesic){b=g.getGeodesicLength(this.map.getProjectionObject());d="m"}else{b=g.getLength();d=this.map.getUnits()}var f=OpenLayers.INCHES_PER_UNIT[a];if(f){var e=OpenLayers.INCHES_PER_UNIT[d];b*=(e/f)}return b},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Control.Graticule=OpenLayers.Class(OpenLayers.Control,{intervals:[45,30,20,10,5,2,1,0.5,0.2,0.1,0.05,0.01,0.005,0.002,0.001],displayInLayerSwitcher:true,visible:true,numPoints:50,targetSize:200,layerName:"Graticule",labelled:true,labelFormat:"dm",lineSymbolizer:{strokeColor:"#333",strokeWidth:1,strokeOpacity:0.5},labelSymbolizer:{},gratLayer:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.labelSymbolizer.stroke=false;this.labelSymbolizer.fill=false;this.labelSymbolizer.label="${label}";this.labelSymbolizer.labelAlign="${labelAlign}";this.labelSymbolizer.labelXOffset="${xOffset}";this.labelSymbolizer.labelYOffset="${yOffset}"},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.gratLayer){var a=new OpenLayers.Style({},{rules:[new OpenLayers.Rule({symbolizer:{Point:this.labelSymbolizer,Line:this.lineSymbolizer}})]});this.gratLayer=new OpenLayers.Layer.Vector(this.layerName,{styleMap:new OpenLayers.StyleMap({"default":a}),visibility:this.visible,displayInLayerSwitcher:this.displayInLayerSwitcher});this.map.addLayer(this.gratLayer)}this.map.events.register("moveend",this,this.update);this.update();return this.div},update:function(){var l=this.map.getExtent();if(!l){return}this.gratLayer.destroyFeatures();var m=new OpenLayers.Projection("EPSG:4326");var J=this.map.getProjectionObject();var h=this.map.getResolution();if(J.proj&&J.proj.projName=="longlat"){this.numPoints=1}var M=this.map.getCenter();var F=new OpenLayers.Pixel(M.lon,M.lat);OpenLayers.Projection.transform(F,J,m);var A=this.targetSize*h;A*=A;var q;for(var E=0;E<this.intervals.length;++E){q=this.intervals[E];var K=q/2;var e=F.offset(new OpenLayers.Pixel(-K,-K));var b=F.offset(new OpenLayers.Pixel(K,K));OpenLayers.Projection.transform(e,m,J);OpenLayers.Projection.transform(b,m,J);var f=(e.x-b.x)*(e.x-b.x)+(e.y-b.y)*(e.y-b.y);if(f<=A){break}}F.x=Math.floor(F.x/q)*q;F.y=Math.floor(F.y/q)*q;var D=0;var s=[F.clone()];var p=F.clone();var B;do{p=p.offset(new OpenLayers.Pixel(0,q));B=OpenLayers.Projection.transform(p.clone(),m,J);s.unshift(p)}while(l.containsPixel(B)&&++D<1000);p=F.clone();do{p=p.offset(new OpenLayers.Pixel(0,-q));B=OpenLayers.Projection.transform(p.clone(),m,J);s.push(p)}while(l.containsPixel(B)&&++D<1000);D=0;var x=[F.clone()];p=F.clone();do{p=p.offset(new OpenLayers.Pixel(-q,0));B=OpenLayers.Projection.transform(p.clone(),m,J);x.unshift(p)}while(l.containsPixel(B)&&++D<1000);p=F.clone();do{p=p.offset(new OpenLayers.Pixel(q,0));B=OpenLayers.Projection.transform(p.clone(),m,J);x.push(p)}while(l.containsPixel(B)&&++D<1000);var a=[];for(var E=0;E<x.length;++E){var g=x[E].x;var w=[];var L=null;var G=Math.min(s[0].y,90);var o=Math.max(s[s.length-1].y,-90);var d=(G-o)/this.numPoints;var k=o;for(var C=0;C<=this.numPoints;++C){var H=new OpenLayers.Geometry.Point(g,k);H.transform(m,J);w.push(H);k+=d;if(H.y>=l.bottom&&!L){L=H}}if(this.labelled){var u=new OpenLayers.Geometry.Point(L.x,l.bottom);var I={value:g,label:this.labelled?OpenLayers.Util.getFormattedLonLat(g,"lon",this.labelFormat):"",labelAlign:"cb",xOffset:0,yOffset:2};this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(u,I))}var v=new OpenLayers.Geometry.LineString(w);a.push(new OpenLayers.Feature.Vector(v))}for(var C=0;C<s.length;++C){k=s[C].y;if(k<-90||k>90){continue}var w=[];var z=x[0].x;var t=x[x.length-1].x;var n=(t-z)/this.numPoints;var g=z;var L=null;for(var E=0;E<=this.numPoints;++E){var H=new OpenLayers.Geometry.Point(g,k);H.transform(m,J);w.push(H);g+=n;if(H.x<l.right){L=H}}if(this.labelled){var u=new OpenLayers.Geometry.Point(l.right,L.y);var I={value:k,label:this.labelled?OpenLayers.Util.getFormattedLonLat(k,"lat",this.labelFormat):"",labelAlign:"rb",xOffset:-2,yOffset:2};this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(u,I))}var v=new OpenLayers.Geometry.LineString(w);a.push(new OpenLayers.Feature.Vector(v))}this.gratLayer.addFeatures(a)},CLASS_NAME:"OpenLayers.Control.Graticule"});OpenLayers.Control.TransformFeature=OpenLayers.Class(OpenLayers.Control,{EVENT_TYPES:["beforesetfeature","setfeature","beforetransform","transform","transformcomplete"],geometryTypes:null,layer:null,preserveAspectRatio:false,rotate:true,feature:null,renderIntent:"temporary",rotationHandleSymbolizer:null,box:null,center:null,scale:1,ratio:1,rotation:0,handles:null,rotationHandles:null,dragControl:null,initialize:function(b,a){this.EVENT_TYPES=OpenLayers.Control.TransformFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);OpenLayers.Control.prototype.initialize.apply(this,[a]);this.layer=b;if(!this.rotationHandleSymbolizer){this.rotationHandleSymbolizer={stroke:false,pointRadius:10,fillOpacity:0,cursor:"pointer"}}this.createBox();this.createControl()},activate:function(){var a=false;if(OpenLayers.Control.prototype.activate.apply(this,arguments)){this.dragControl.activate();this.layer.addFeatures([this.box]);this.rotate&&this.layer.addFeatures(this.rotationHandles);this.layer.addFeatures(this.handles);a=true}return a},deactivate:function(){var a=false;if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){this.layer.removeFeatures(this.handles);this.rotate&&this.layer.removeFeatures(this.rotationHandles);this.layer.removeFeatures([this.box]);this.dragControl.deactivate();a=true}return a},setMap:function(a){this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setFeature:function(l,d){d=OpenLayers.Util.applyDefaults(d,{rotation:0,scale:1,ratio:1});var k={feature:l};var f=this.rotation;var a=this.center;OpenLayers.Util.extend(this,d);if(this.events.triggerEvent("beforesetfeature",k)===false){return}this.feature=l;this.activate();this._setfeature=true;var b=this.feature.geometry.getBounds();this.box.move(b.getCenterLonLat());this.box.geometry.rotate(-f,a);this._angle=0;var g;if(this.rotation){var h=l.geometry.clone();h.rotate(-this.rotation,this.center);var e=new OpenLayers.Feature.Vector(h.getBounds().toGeometry());e.geometry.rotate(this.rotation,this.center);this.box.geometry.rotate(this.rotation,this.center);this.box.move(e.geometry.getBounds().getCenterLonLat());var j=e.geometry.components[0].components[0];g=j.getBounds().getCenterLonLat()}else{g=new OpenLayers.LonLat(b.left,b.bottom)}this.handles[0].move(g);delete this._setfeature;this.events.triggerEvent("setfeature",k)},createBox:function(){var f=this;this.center=new OpenLayers.Geometry.Point(0,0);var g=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(-1,-1),new OpenLayers.Geometry.Point(0,-1),new OpenLayers.Geometry.Point(1,-1),new OpenLayers.Geometry.Point(1,0),new OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(0,1),new OpenLayers.Geometry.Point(-1,1),new OpenLayers.Geometry.Point(-1,0),new OpenLayers.Geometry.Point(-1,-1)]),null,typeof this.renderIntent=="string"?null:this.renderIntent);g.geometry.move=function(p,q){f._moving=true;OpenLayers.Geometry.LineString.prototype.move.apply(this,arguments);f.center.move(p,q);delete f._moving};var a=function(p,q){OpenLayers.Geometry.Point.prototype.move.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.move(p,q);this._handle.geometry.move(p,q)};var o=function(s,p,q){OpenLayers.Geometry.Point.prototype.resize.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.resize(s,p,q);this._handle.geometry.resize(s,p,q)};var m=function(q,p){OpenLayers.Geometry.Point.prototype.rotate.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.rotate(q,p);this._handle.geometry.rotate(q,p)};var j=function(D,B){var I=this.x,F=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,D,B);if(f._moving){return}var G=f.dragControl.handlers.drag.evt;var p=!f._setfeature&&f.preserveAspectRatio;var u=!p&&!(G&&G.shiftKey);var C=new OpenLayers.Geometry.Point(I,F);var z=f.center;this.rotate(-f.rotation,z);C.rotate(-f.rotation,z);var E=this.x-z.x;var v=this.y-z.y;var H=E-(this.x-C.x);var w=v-(this.y-C.y);this.x=I;this.y=F;var s,A=1;if(u){s=Math.abs(w)<0.00001?1:v/w;A=(Math.abs(H)<0.00001?1:(E/H))/s}else{var t=Math.sqrt((H*H)+(w*w));var q=Math.sqrt((E*E)+(v*v));s=q/t}f._moving=true;f.box.geometry.rotate(-f.rotation,z);delete f._moving;f.box.geometry.resize(s,z,A);f.box.geometry.rotate(f.rotation,z);f.transformFeature({scale:s,ratio:A})};var d=function(A,w){var G=this.x,D=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,A,w);if(f._moving){return}var E=f.dragControl.handlers.drag.evt;var z=(E&&E.shiftKey)?45:1;var v=f.center;var C=this.x-v.x;var t=this.y-v.y;var F=C-A;var u=t-w;this.x=G;this.y=D;var q=Math.atan2(u,F);var p=Math.atan2(t,C);var s=p-q;s*=180/Math.PI;f._angle=(f._angle+s)%360;var B=f.rotation%z;if(Math.abs(f._angle)>=z||B!==0){s=Math.round(f._angle/z)*z-B;f._angle=0;f.box.geometry.rotate(s,v);f.transformFeature({rotation:s})}};var n=new Array(8);var k=new Array(4);var l,h,b;for(var e=0;e<8;++e){l=g.geometry.components[e];h=new OpenLayers.Feature.Vector(l.clone(),null,typeof this.renderIntent=="string"?null:this.renderIntent);if(e%2==0){b=new OpenLayers.Feature.Vector(l.clone(),null,typeof this.rotationHandleSymbolizer=="string"?null:this.rotationHandleSymbolizer);b.geometry.move=d;l._rotationHandle=b;k[e/2]=b}l.move=a;l.resize=o;l.rotate=m;h.geometry.move=j;l._handle=h;n[e]=h}this.box=g;this.rotationHandles=k;this.handles=n},createControl:function(){var a=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:true,moveFeature:function(b){if(this.feature===a.feature){this.feature=a.box}OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(e,b){var d=e.geometry;if(e===a.box){a.transformFeature({center:a.center});a.drawHandles()}},onStart:function(f,d){var b=!a.geometryTypes||OpenLayers.Util.indexOf(a.geometryTypes,f.geometry.CLASS_NAME)!==-1;var e=OpenLayers.Util.indexOf(a.handles,f);e+=OpenLayers.Util.indexOf(a.rotationHandles,f);if(f!==a.feature&&f!==a.box&&e==-2&&b){a.setFeature(f)}},onComplete:function(d,b){a.events.triggerEvent("transformcomplete",{feature:d})}})},drawHandles:function(){var b=this.layer;for(var a=0;a<8;++a){if(this.rotate&&a%2===0){b.drawFeature(this.rotationHandles[a/2],this.rotationHandleSymbolizer)}b.drawFeature(this.handles[a],this.renderIntent)}},transformFeature:function(f){if(!this._setfeature){this.scale*=(f.scale||1);this.ratio*=(f.ratio||1);var b=this.rotation;this.rotation=(this.rotation+(f.rotation||0))%360;if(this.events.triggerEvent("beforetransform",f)!==false){var e=this.feature;var d=e.geometry;var a=this.center;d.rotate(-b,a);if(f.scale||f.ratio){d.resize(f.scale,a,f.ratio)}else{if(f.center){e.move(f.center.getBounds().getCenterLonLat())}}d.rotate(this.rotation,a);this.layer.drawFeature(e);e.toState(OpenLayers.State.UPDATE);this.events.triggerEvent("transform",f)}}this.layer.drawFeature(this.box,this.renderIntent);this.drawHandles()},destroy:function(){var b;for(var a=0;a<8;++a){b=this.box.geometry.components[a];b._handle.destroy();b._handle=null;b._rotationHandle&&b._rotationHandle.destroy();b._rotationHandle=null}this.box.destroy();this.box=null;this.layer=null;this.dragControl.destroy();OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.TransformFeature"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.id=null;this.bounds=null},clone:function(){return new OpenLayers.Geometry()},setBounds:function(a){if(a){this.bounds=a.clone()}},clearBounds:function(){this.bounds=null;if(this.parent){this.parent.clearBounds()}},extendBounds:function(b){var a=this.getBounds();if(!a){this.setBounds(b)}else{this.bounds.extend(b)}},getBounds:function(){if(this.bounds==null){this.calculateBounds()}return this.bounds},calculateBounds:function(){},distanceTo:function(b,a){},getVertices:function(a){},atPoint:function(f,j,g){var d=false;var e=this.getBounds();if((e!=null)&&(f!=null)){var b=(j!=null)?j:0;var a=(g!=null)?g:0;var h=new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-a,this.bounds.right+b,this.bounds.top+a);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 b=h.read(g);if(b instanceof OpenLayers.Feature.Vector){e=b.geometry}else{if(b instanceof Array){var a=b.length;var f=new Array(a);for(var d=0;d<a;++d){f[d]=b[d].geometry}e=new OpenLayers.Geometry.Collection(f)}}return e};OpenLayers.Geometry.segmentsIntersect=function(a,J,b){var u=b&&b.point;var B=b&&b.tolerance;var g=false;var D=a.x1-J.x1;var H=a.y1-J.y1;var q=a.x2-a.x1;var A=a.y2-a.y1;var v=J.y2-J.y1;var m=J.x2-J.x1;var F=(v*q)-(m*A);var f=(m*H)-(v*D);var e=(q*H)-(A*D);if(F==0){if(f==0&&e==0){g=true}}else{var G=f/F;var E=e/F;if(G>=0&&G<=1&&E>=0&&E<=1){if(!u){g=true}else{var k=a.x1+(G*q);var h=a.y1+(G*A);g=new OpenLayers.Geometry.Point(k,h)}}}if(B){var t;if(g){if(u){var o=[a,J];var C,k,h;outer:for(var z=0;z<2;++z){C=o[z];for(var w=1;w<3;++w){k=C["x"+w];h=C["y"+w];t=Math.sqrt(Math.pow(k-g.x,2)+Math.pow(h-g.y,2));if(t<B){g.x=k;g.y=h;break outer}}}}}else{var o=[a,J];var s,I,k,h,n,l;outer:for(var z=0;z<2;++z){s=o[z];I=o[(z+1)%2];for(var w=1;w<3;++w){n={x:s["x"+w],y:s["y"+w]};l=OpenLayers.Geometry.distanceToSegment(n,I);if(l.distance<B){if(u){g=new OpenLayers.Geometry.Point(n.x,n.y)}else{g=true}break outer}}}}}return g};OpenLayers.Geometry.distanceToSegment=function(m,e){var d=m.x;var l=m.y;var b=e.x1;var k=e.y1;var a=e.x2;var g=e.y2;var o=a-b;var n=g-k;var j=((o*(d-b))+(n*(l-k)))/(Math.pow(o,2)+Math.pow(n,2));var h,f;if(j<=0){h=b;f=k}else{if(j>=1){h=a;f=g}else{h=b+j*o;f=k+j*n}}return{distance:Math.sqrt(Math.pow(h-d,2)+Math.pow(f-l,2)),x:h,y:f}};OpenLayers.Geometry.Rectangle=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,width:null,height:null,initialize:function(b,e,d,a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=b;this.y=e;this.width=d;this.height=a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x+this.width,this.y+this.height)},getLength:function(){var a=(2*this.width)+(2*this.height);return a},getArea:function(){var a=this.width*this.height;return a},CLASS_NAME:"OpenLayers.Geometry.Rectangle"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(a!=null){this.addComponents(a)}},destroy:function(){this.components.length=0;this.components=null},clone:function(){var geometry=eval("new "+this.CLASS_NAME+"()");for(var i=0,len=this.components.length;i<len;i++){geometry.addComponent(this.components[i].clone())}OpenLayers.Util.applyDefaults(geometry,this);return geometry},getComponentsString:function(){var b=[];for(var d=0,a=this.components.length;d<a;d++){b.push(this.components[d].toShortString())}return b.join(",")},calculateBounds:function(){this.bounds=null;if(this.components&&this.components.length>0){this.setBounds(this.components[0].getBounds());for(var b=1,a=this.components.length;b<a;b++){this.extendBounds(this.components[b].getBounds())}}},addComponents:function(d){if(!(d instanceof Array)){d=[d]}for(var b=0,a=d.length;b<a;b++){this.addComponent(d[b])}},addComponent:function(b,a){var e=false;if(b){if(this.componentTypes==null||(OpenLayers.Util.indexOf(this.componentTypes,b.CLASS_NAME)>-1)){if(a!=null&&(a<this.components.length)){var f=this.components.slice(0,a);var d=this.components.slice(a,this.components.length);f.push(b);this.components=f.concat(d)}else{this.components.push(b)}b.parent=this;this.clearBounds();e=true}}return e},removeComponents:function(b){if(!(b instanceof Array)){b=[b]}for(var a=b.length-1;a>=0;--a){this.removeComponent(b[a])}},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds()},getLength:function(){var d=0;for(var b=0,a=this.components.length;b<a;b++){d+=this.components[b].getLength()}return d},getArea:function(){var d=0;for(var b=0,a=this.components.length;b<a;b++){d+=this.components[b].getArea()}return d},getGeodesicArea:function(b){var e=0;for(var d=0,a=this.components.length;d<a;d++){e+=this.components[d].getGeodesicArea(b)}return e},getCentroid:function(){return this.components.length&&this.components[0].getCentroid()},getGeodesicLength:function(b){var e=0;for(var d=0,a=this.components.length;d<a;d++){e+=this.components[d].getGeodesicLength(b)}return e},move:function(b,e){for(var d=0,a=this.components.length;d<a;d++){this.components[d].move(b,e)}},rotate:function(e,b){for(var d=0,a=this.components.length;d<a;++d){this.components[d].rotate(e,b)}},resize:function(e,a,d){for(var b=0;b<this.components.length;++b){this.components[b].resize(e,a,d)}return this},distanceTo:function(j,k){var d=!(k&&k.edge===false);var a=d&&k&&k.details;var l,e,b;var f=Number.POSITIVE_INFINITY;for(var g=0,h=this.components.length;g<h;++g){l=this.components[g].distanceTo(j,k);b=a?l.distance:l;if(b<f){f=b;e=l;if(f==0){break}}}return e},equals:function(e){var b=true;if(!e||!e.CLASS_NAME||(this.CLASS_NAME!=e.CLASS_NAME)){b=false}else{if(!(e.components instanceof Array)||(e.components.length!=this.components.length)){b=false}else{for(var d=0,a=this.components.length;d<a;++d){if(!this.components[d].equals(e.components[d])){b=false;break}}}}return b},transform:function(f,d){if(f&&d){for(var e=0,a=this.components.length;e<a;e++){var b=this.components[e];b.transform(f,d)}this.bounds=null}return this},intersects:function(e){var b=false;for(var d=0,a=this.components.length;d<a;++d){b=e.intersects(this.components[d]);if(b){break}}return b},getVertices:function(b){var d=[];for(var e=0,a=this.components.length;e<a;++e){Array.prototype.push.apply(d,this.components[e].getVertices(b))}return d},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,d,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);if(b!==false){this.x=parseFloat(a);this.y=parseFloat(d)}else{this.x=a;this.y=d}},clone:function(a){if(a==null){a=new OpenLayers.Geometry.Point(this.x,this.y)}OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(g,l){var e=!(l&&l.edge===false);var a=e&&l&&l.details;var b,f,j,d,h,k;if(g instanceof OpenLayers.Geometry.Point){f=this.x;j=this.y;d=g.x;h=g.y;b=Math.sqrt(Math.pow(f-d,2)+Math.pow(j-h,2));k=!a?b:{x0:f,y0:j,x1:d,y1:h,distance:b}}else{k=g.distanceTo(this,l);if(a){k={x0:k.x1,y0:k.y1,x1:k.x0,y1:k.y0,distance:k.distance}}}return k},equals:function(a){var b=false;if(a!=null){b=((this.x==a.x&&this.y==a.y)||(isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y)))}return b},toShortString:function(){return(this.x+", "+this.y)},move:function(a,b){this.x=this.x+a;this.y=this.y+b;this.clearBounds()},rotate:function(e,b){e*=Math.PI/180;var a=this.distanceTo(b);var d=e+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+(a*Math.cos(d));this.y=b.y+(a*Math.sin(d));this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(d,a,b){b=(b==undefined)?1:b;this.x=a.x+(d*b*(this.x-a.x));this.y=a.y+(d*(this.y-a.y));this.clearBounds();return this},intersects:function(b){var a=false;if(b.CLASS_NAME=="OpenLayers.Geometry.Point"){a=this.equals(b)}else{a=b.intersects(this)}return a},transform:function(b,a){if((b&&a)){OpenLayers.Projection.transform(this,b,a);this.bounds=null}return this},getVertices:function(a){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},addPoint:function(a,b){this.addComponent(a,b)},removePoint:function(a){this.removeComponent(a)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.MultiPoint.prototype.initialize.apply(this,arguments)},getLength:function(){var d=0;if(this.components&&(this.components.length>1)){for(var b=1,a=this.components.length;b<a;b++){d+=this.components[b-1].distanceTo(this.components[b])}}return d},getGeodesicLength:function(b){var f=this;if(b){var d=new OpenLayers.Projection("EPSG:4326");if(!d.equals(b)){f=this.clone().transform(b,d)}}var g=0;if(f.components&&(f.components.length>1)){var j,h;for(var e=1,a=f.components.length;e<a;e++){j=f.components[e-1];h=f.components[e];g+=OpenLayers.Util.distVincenty({lon:j.x,lat:j.y},{lon:h.x,lat:h.y})}}return g*1000},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{initialize:function(a){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments)},removeComponent:function(a){if(this.components&&(this.components.length>2)){OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments)}},intersects:function(n){var d=false;var m=n.CLASS_NAME;if(m=="OpenLayers.Geometry.LineString"||m=="OpenLayers.Geometry.LinearRing"||m=="OpenLayers.Geometry.Point"){var q=this.getSortedSegments();var o;if(m=="OpenLayers.Geometry.Point"){o=[{x1:n.x,y1:n.y,x2:n.x,y2:n.y}]}else{o=n.getSortedSegments()}var u,h,f,a,t,s,e,b;outer:for(var k=0,l=q.length;k<l;++k){u=q[k];h=u.x1;f=u.x2;a=u.y1;t=u.y2;inner:for(var g=0,p=o.length;g<p;++g){s=o[g];if(s.x1>f){break}if(s.x2<h){continue}e=s.y1;b=s.y2;if(Math.min(e,b)>Math.max(a,t)){continue}if(Math.max(e,b)<Math.min(a,t)){continue}if(OpenLayers.Geometry.segmentsIntersect(u,s)){d=true;break outer}}}}else{d=n.intersects(this)}return d},getSortedSegments:function(){var a=this.components.length-1;var b=new Array(a),f,e;for(var d=0;d<a;++d){f=this.components[d];e=this.components[d+1];if(f.x<e.x){b[d]={x1:f.x,y1:f.y,x2:e.x,y2:e.y}}else{b[d]={x1:e.x,y1:e.y,x2:f.x,y2:f.y}}}function g(j,h){return j.x1-h.x1}return b.sort(g)},splitWithSegment:function(t,b){var d=!(b&&b.edge===false);var p=b&&b.tolerance;var a=[];var v=this.getVertices();var o=[];var x=[];var j=false;var f,e,m;var k,s,w;var g={point:true,tolerance:p};var h=null;for(var n=0,l=v.length-2;n<=l;++n){f=v[n];o.push(f.clone());e=v[n+1];w={x1:f.x,y1:f.y,x2:e.x,y2:e.y};m=OpenLayers.Geometry.segmentsIntersect(t,w,g);if(m instanceof OpenLayers.Geometry.Point){if((m.x===t.x1&&m.y===t.y1)||(m.x===t.x2&&m.y===t.y2)||m.equals(f)||m.equals(e)){s=true}else{s=false}if(s||d){if(!m.equals(x[x.length-1])){x.push(m.clone())}if(n===0){if(m.equals(f)){continue}}if(m.equals(e)){continue}j=true;if(!m.equals(f)){o.push(m)}a.push(new OpenLayers.Geometry.LineString(o));o=[m.clone()]}}}if(j){o.push(e.clone());a.push(new OpenLayers.Geometry.LineString(o))}if(x.length>0){var q=t.x1<t.x2?1:-1;var u=t.y1<t.y2?1:-1;h={lines:a,points:x.sort(function(A,z){return(q*A.x-q*z.x)||(u*A.y-u*z.y)})}}return h},split:function(A,b){var o=null;var e=b&&b.mutual;var m,f,n,d;if(A instanceof OpenLayers.Geometry.LineString){var z=this.getVertices();var h,g,x,l,a,q;var u=[];n=[];for(var v=0,p=z.length-2;v<=p;++v){h=z[v];g=z[v+1];x={x1:h.x,y1:h.y,x2:g.x,y2:g.y};d=d||[A];if(e){u.push(h.clone())}for(var t=0;t<d.length;++t){l=d[t].splitWithSegment(x,b);if(l){a=l.lines;if(a.length>0){a.unshift(t,1);Array.prototype.splice.apply(d,a);t+=a.length-2}if(e){for(var s=0,w=l.points.length;s<w;++s){q=l.points[s];if(!q.equals(h)){u.push(q);n.push(new OpenLayers.Geometry.LineString(u));if(q.equals(g)){u=[]}else{u=[q.clone()]}}}}}}}if(e&&n.length>0&&u.length>0){u.push(g.clone());n.push(new OpenLayers.Geometry.LineString(u))}}else{o=A.splitWith(this,b)}if(d&&d.length>1){f=true}else{d=[]}if(n&&n.length>1){m=true}else{n=[]}if(f||m){if(e){o=[n,d]}else{o=d}}return o},splitWith:function(b,a){return b.split(this,a)},getVertices:function(a){var b;if(a===true){b=[this.components[0],this.components[this.components.length-1]]}else{if(a===false){b=this.components.slice(1,this.components.length-1)}else{b=this.components.slice()}}return b},distanceTo:function(k,h){var l=!(h&&h.edge===false);var D=l&&h&&h.details;var s,f={};var v=Number.POSITIVE_INFINITY;if(k instanceof OpenLayers.Geometry.Point){var t=this.getSortedSegments();var q=k.x;var p=k.y;var B;for(var z=0,A=t.length;z<A;++z){B=t[z];s=OpenLayers.Geometry.distanceToSegment(k,B);if(s.distance<v){v=s.distance;f=s;if(v===0){break}}else{if(B.x2>q&&((p>B.y1&&p<B.y2)||(p<B.y1&&p>B.y2))){break}}}if(D){f={distance:f.distance,x0:f.x,y0:f.y,x1:q,y1:p}}else{f=f.distance}}else{if(k instanceof OpenLayers.Geometry.LineString){var e=this.getSortedSegments();var d=k.getSortedSegments();var b,a,o,C,g;var n=d.length;var m={point:true};outer:for(var z=0,A=e.length;z<A;++z){b=e[z];C=b.x1;g=b.y1;for(var w=0;w<n;++w){a=d[w];o=OpenLayers.Geometry.segmentsIntersect(b,a,m);if(o){v=0;f={distance:0,x0:o.x,y0:o.y,x1:o.x,y1:o.y};break outer}else{s=OpenLayers.Geometry.distanceToSegment({x:C,y:g},a);if(s.distance<v){v=s.distance;f={distance:v,x0:C,y0:g,x1:s.x,y1:s.y}}}}}if(!D){f=f.distance}if(v!==0){if(b){s=k.distanceTo(new OpenLayers.Geometry.Point(b.x2,b.y2),h);var u=D?s.distance:s;if(u<v){if(D){f={distance:v,x0:s.x1,y0:s.y1,x1:s.x0,y1:s.y0}}else{f=u}}}}}else{f=k.distanceTo(this,h);if(D){f={distance:f.distance,x0:f.x1,y0:f.y1,x1:f.x0,y1:f.y0}}}}return f},CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],initialize:function(a){OpenLayers.Geometry.LineString.prototype.initialize.apply(this,arguments)},addComponent:function(a,b){var d=false;var e=this.components.pop();if(b!=null||!a.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(a){if(this.components.length>4){this.components.pop();OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);var b=this.components[0];OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[b])}},move:function(b,e){for(var d=0,a=this.components.length;d<a-1;d++){this.components[d].move(b,e)}},rotate:function(e,b){for(var d=0,a=this.components.length;d<a-1;++d){this.components[d].rotate(e,b)}},resize:function(f,b,e){for(var d=0,a=this.components.length;d<a-1;++d){this.components[d].resize(f,b,e)}return this},transform:function(f,d){if(f&&d){for(var e=0,a=this.components.length;e<a-1;e++){var b=this.components[e];b.transform(f,d)}this.bounds=null}return this},getCentroid:function(){if(this.components&&(this.components.length>2)){var h=0;var g=0;for(var e=0;e<this.components.length-1;e++){var d=this.components[e];var k=this.components[e+1];h+=(d.x+k.x)*(d.x*k.y-k.x*d.y);g+=(d.y+k.y)*(d.x*k.y-k.x*d.y)}var f=-1*this.getArea();var a=h/(6*f);var j=g/(6*f);return new OpenLayers.Geometry.Point(a,j)}else{return null}},getArea:function(){var g=0;if(this.components&&(this.components.length>2)){var f=0;for(var e=0,d=this.components.length;e<d-1;e++){var a=this.components[e];var h=this.components[e+1];f+=(a.x+h.x)*(h.y-a.y)}g=-f/2}return g},getGeodesicArea:function(b){var e=this;if(b){var d=new OpenLayers.Projection("EPSG:4326");if(!d.equals(b)){e=this.clone().transform(b,d)}}var g=0;var a=e.components&&e.components.length;if(a>2){var j,h;for(var f=0;f<a-1;f++){j=e.components[f];h=e.components[f+1];g+=OpenLayers.Util.rad(h.x-j.x)*(2+Math.sin(OpenLayers.Util.rad(j.y))+Math.sin(OpenLayers.Util.rad(h.y)))}g=g*6378137*6378137/2}return g},containsPoint:function(n){var u=OpenLayers.Number.limitSigDigs;var m=14;var l=u(n.x,m);var k=u(n.y,m);function t(A,w,z,v,x){return(((w-v)*A)+((v*z)-(w*x)))/(z-x)}var a=this.components.length-1;var h,g,s,e,p,b,f,d;var j=0;for(var o=0;o<a;++o){h=this.components[o];s=u(h.x,m);e=u(h.y,m);g=this.components[o+1];p=u(g.x,m);b=u(g.y,m);if(e==b){if(k==e){if(s<=p&&(l>=s&&l<=p)||s>=p&&(l<=s&&l>=p)){j=-1;break}}continue}f=u(t(k,s,e,p,b),m);if(f==l){if(e<b&&(k>=e&&k<=b)||e>b&&(k<=e&&k>=b)){j=-1;break}}if(f<=l){continue}if(s!=p&&(f<Math.min(s,p)||f>Math.max(s,p))){continue}if(e<b&&(k>=e&&k<b)||e>b&&(k<e&&k>=b)){++j}}var q=(j==-1)?1:!!(j&1);return q},intersects:function(e){var b=false;if(e.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(e)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LineString"){b=e.intersects(this)}else{if(e.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[e])}else{for(var d=0,a=e.components.length;d<a;++d){b=e.components[d].intersects(this);if(b){break}}}}}return b},getVertices:function(a){return(a===true)?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],initialize:function(a){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 b=1,a=this.components.length;b<a;b++){d-=Math.abs(this.components[b].getArea())}}return d},getGeodesicArea:function(b){var e=0;if(this.components&&(this.components.length>0)){e+=Math.abs(this.components[0].getGeodesicArea(b));for(var d=1,a=this.components.length;d<a;d++){e-=Math.abs(this.components[d].getGeodesicArea(b))}}return e},containsPoint:function(a){var f=this.components.length;var d=false;if(f>0){d=this.components[0].containsPoint(a);if(d!==1){if(d&&f>1){var e;for(var b=1;b<f;++b){e=this.components[b].containsPoint(a);if(e){if(e===1){d=1}else{d=false}break}}}}}return d},intersects:function(f){var b=false;var e,a;if(f.CLASS_NAME=="OpenLayers.Geometry.Point"){b=this.containsPoint(f)}else{if(f.CLASS_NAME=="OpenLayers.Geometry.LineString"||f.CLASS_NAME=="OpenLayers.Geometry.LinearRing"){for(e=0,a=this.components.length;e<a;++e){b=f.intersects(this.components[e]);if(b){break}}if(!b){for(e=0,a=f.components.length;e<a;++e){b=this.containsPoint(f.components[e]);if(b){break}}}}else{for(e=0,a=f.components.length;e<a;++e){b=this.intersects(f.components[e]);if(b){break}}}}if(!b&&f.CLASS_NAME=="OpenLayers.Geometry.Polygon"){var d=this.components[0];for(e=0,a=d.components.length;e<a;++e){b=f.containsPoint(d.components[e]);if(b){break}}}return b},distanceTo:function(e,b){var d=!(b&&b.edge===false);var a;if(!d&&this.intersects(e)){a=0}else{a=OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this,[e,b])}return a},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(k,g,b,m){var d=Math.PI*((1/b)-(1/2));if(m){d+=(m/180)*Math.PI}var a,j,h;var l=[];for(var f=0;f<b;++f){a=d+(f*2*Math.PI/b);j=k.x+(g*Math.cos(a));h=k.y+(g*Math.sin(a));l.push(new OpenLayers.Geometry.Point(j,h))}var e=new OpenLayers.Geometry.LinearRing(l);return new OpenLayers.Geometry.Polygon([e])};OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},split:function(o,u){var h=null;var t=u&&u.mutual;var p,a,s,n,b;var f=[];var q=[o];for(var g=0,l=this.components.length;g<l;++g){a=this.components[g];n=false;for(var e=0;e<q.length;++e){p=a.split(q[e],u);if(p){if(t){s=p[0];for(var d=0,m=s.length;d<m;++d){if(d===0&&f.length){f[f.length-1].addComponent(s[d])}else{f.push(new OpenLayers.Geometry.MultiLineString([s[d]]))}}n=true;p=p[1]}if(p.length){p.unshift(e,1);Array.prototype.splice.apply(q,p);break}}}if(!n){if(f.length){f[f.length-1].addComponent(a.clone())}else{f=[new OpenLayers.Geometry.MultiLineString(a.clone())]}}}if(f&&f.length>1){n=true}else{f=[]}if(q&&q.length>1){b=true}else{q=[]}if(n||b){if(t){h=[f,q]}else{h=q}}return h},splitWith:function(o,u){var h=null;var t=u&&u.mutual;var p,d,s,n,a,f,q;if(o instanceof OpenLayers.Geometry.LineString){q=[];f=[o];for(var g=0,l=this.components.length;g<l;++g){a=false;d=this.components[g];for(var e=0;e<f.length;++e){p=f[e].split(d,u);if(p){if(t){s=p[0];if(s.length){s.unshift(e,1);Array.prototype.splice.apply(f,s);e+=s.length-2}p=p[1];if(p.length===0){p=[d.clone()]}}for(var b=0,m=p.length;b<m;++b){if(b===0&&q.length){q[q.length-1].addComponent(p[b])}else{q.push(new OpenLayers.Geometry.MultiLineString([p[b]]))}}a=true}}if(!a){if(q.length){q[q.length-1].addComponent(d.clone())}else{q=[new OpenLayers.Geometry.MultiLineString([d.clone()])]}}}}else{h=o.split(this)}if(f&&f.length>1){n=true}else{f=[]}if(q&&q.length>1){a=true}else{q=[]}if(n||a){if(t){h=[f,q]}else{h=q}}return h},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],initialize:function(a){OpenLayers.Geometry.Collection.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Geometry.Surface=OpenLayers.Class(OpenLayers.Geometry,{initialize:function(){OpenLayers.Geometry.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Geometry.Surface"});OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:false,size:null,resolution:null,map:null,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a)},destroy:function(){this.container=null;this.extent=null;this.size=null;this.resolution=null;this.map=null},supported:function(){return false},setExtent:function(a,b){this.extent=a.clone();if(b){this.resolution=null}},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){this.resolution=this.resolution||this.map.getResolution();return this.resolution},drawFeature:function(d,e){if(e==null){e=d.style}if(d.geometry){var f=d.geometry.getBounds();if(f){if(!f.intersectsBounds(this.extent)){e={display:"none"}}var g=this.drawGeometry(d.geometry,e,d.id);if(e.display!="none"&&e.label&&g!==false){var a=d.geometry.getCentroid();if(e.labelXOffset||e.labelYOffset){xOffset=isNaN(e.labelXOffset)?0:e.labelXOffset;yOffset=isNaN(e.labelYOffset)?0:e.labelYOffset;var b=this.getResolution();a.move(xOffset*b,yOffset*b)}this.drawText(d.id,e,a)}else{this.removeText(d.id)}return g}}},drawGeometry:function(d,a,b){},drawText:function(d,b,a){},removeText:function(a){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(d){if(!(d instanceof Array)){d=[d]}for(var b=0,a=d.length;b<a;++b){this.eraseGeometry(d[b].geometry);this.removeText(d[b].id)}},eraseGeometry:function(a){},moveRoot:function(a){},getRenderLayerId:function(){return this.container.id},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.order=[];this.indices={};this.maxZIndex=0},insert:function(d){if(this.exists(d)){this.remove(d)}var g=d.id;this.determineZIndex(d);var e=-1;var f=this.order.length;var a;while(f-e>1){a=parseInt((e+f)/2);var b=this.compare(this,d,OpenLayers.Util.getElement(this.order[a]));if(b>0){e=a}else{f=a}}this.order.splice(f,0,g);this.indices[g]=this.getZIndex(d);return this.getNextElement(f)},remove:function(b){var e=b.id;var a=OpenLayers.Util.indexOf(this.order,e);if(a>=0){this.order.splice(a,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(a){return(this.indices[a.id]!=null)},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex;if(b==null){b=this.maxZIndex;a._style.graphicZIndex=b}else{if(b>this.maxZIndex){this.maxZIndex=b}}},getNextElement:function(b){var a=b+1;if(a<this.order.length){var d=OpenLayers.Util.getElement(this.order[a]);if(d==undefined){d=this.getNextElement(a)}return d}else{return null}},CLASS_NAME:"OpenLayers.ElementsIndexer"});OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(f,e,b){var a=f.getZIndex(e);var g=0;if(b){var d=f.getZIndex(b);g=a-d}return g},Z_ORDER_DRAWING_ORDER:function(d,b,a){var e=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(d,b,a);if(a&&e==0){e=1}return e},Z_ORDER_Y_ORDER:function(e,d,b){var f=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(e,d,b);if(b&&f===0){var a=b._boundsBottom-d._boundsBottom;f=(a===0)?1:a}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",minimumSymbolizer:{strokeLinecap:"round",strokeOpacity:1,strokeDashstyle:"solid",fillOpacity:1,pointRadius:0},initialize:function(a,b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot);this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);if(b&&(b.zIndexing||b.yOrdering)){this.indexer=new OpenLayers.ElementsIndexer(b.yOrdering)}},destroy:function(){this.clear();this.rendererRoot=null;this.root=null;this.xmlns=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){if(this.vectorRoot){while(this.vectorRoot.childNodes.length>0){this.vectorRoot.removeChild(this.vectorRoot.firstChild)}}if(this.textRoot){while(this.textRoot.childNodes.length>0){this.textRoot.removeChild(this.textRoot.firstChild)}}if(this.indexer){this.indexer.clear()}},getNodeType:function(b,a){},drawGeometry:function(h,e,g){var d=h.CLASS_NAME;var j=true;if((d=="OpenLayers.Geometry.Collection")||(d=="OpenLayers.Geometry.MultiPoint")||(d=="OpenLayers.Geometry.MultiLineString")||(d=="OpenLayers.Geometry.MultiPolygon")){for(var b=0,a=h.components.length;b<a;b++){j=this.drawGeometry(h.components[b],e,g)&&j}return j}j=false;if(e.display!="none"){if(e.backgroundGraphic){this.redrawBackgroundNode(h.id,h,e,g)}j=this.redrawNode(h.id,h,e,g)}if(j==false){var f=document.getElementById(h.id);if(f){if(f._style.backgroundGraphic){f.parentNode.removeChild(document.getElementById(h.id+this.BACKGROUND_ID_SUFFIX))}f.parentNode.removeChild(f)}}return j},redrawNode:function(h,g,b,f){var d=this.nodeFactory(h,this.getNodeType(g,b));d._featureId=f;d._boundsBottom=g.getBounds().bottom;d._geometryClass=g.CLASS_NAME;d._style=b;var a=this.drawGeometryNode(d,g,b);if(a===false){return false}d=a.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 a.complete},redrawBackgroundNode:function(f,e,b,d){var a=OpenLayers.Util.extend({},b);a.externalGraphic=a.backgroundGraphic;a.graphicXOffset=a.backgroundXOffset;a.graphicYOffset=a.backgroundYOffset;a.graphicZIndex=a.backgroundGraphicZIndex;a.graphicWidth=a.backgroundWidth||a.graphicWidth;a.graphicHeight=a.backgroundHeight||a.graphicHeight;a.backgroundGraphic=null;a.backgroundXOffset=null;a.backgroundYOffset=null;a.backgroundGraphicZIndex=null;return this.redrawNode(f+this.BACKGROUND_ID_SUFFIX,e,a,null)},drawGeometryNode:function(d,f,b){b=b||d._style;OpenLayers.Util.applyDefaults(b,this.minimumSymbolizer);var a={isFilled:b.fill===undefined?true:b.fill,isStroked:b.stroke===undefined?!!b.strokeWidth:b.stroke};var e;switch(f.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.graphic===false){a.isFilled=false;a.isStroked=false}e=this.drawPoint(d,f);break;case"OpenLayers.Geometry.LineString":a.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=a;if(e!=false){return{node:this.setStyle(d,b,a,f),complete:e}}else{return false}},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},drawSurface:function(a,b){},removeText:function(b){var a=document.getElementById(b+this.LABEL_ID_SUFFIX);if(a){this.textRoot.removeChild(a)}},getFeatureIdFromEvent:function(a){var e=a.target;var b=e&&e.correspondingUseElement;var d=b?b:(e||a.srcElement);var f=d._featureId;return f},eraseGeometry:function(g){if((g.CLASS_NAME=="OpenLayers.Geometry.MultiPoint")||(g.CLASS_NAME=="OpenLayers.Geometry.MultiLineString")||(g.CLASS_NAME=="OpenLayers.Geometry.MultiPolygon")||(g.CLASS_NAME=="OpenLayers.Geometry.Collection")){for(var e=0,a=g.components.length;e<a;e++){this.eraseGeometry(g.components[e])}}else{var d=OpenLayers.Util.getElement(g.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 b=g.id+this.BACKGROUND_ID_SUFFIX;var f=OpenLayers.Util.getElement(b);if(f&&f.parentNode){f.parentNode.removeChild(f)}}}}},nodeFactory:function(d,a){var b=OpenLayers.Util.getElement(d);if(b){if(!this.nodeTypeCompare(b,a)){b.parentNode.removeChild(b);b=this.nodeFactory(d,a)}}else{b=this.createNode(a,d)}return b},nodeTypeCompare:function(b,a){},createNode:function(a,b){},moveRoot:function(b){var a=this.root;if(b.root.parentNode==this.rendererRoot){a=b.root}a.parentNode.removeChild(a);b.rendererRoot.appendChild(a)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(a){return(a!="circle")&&!!a},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.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,isGecko:null,supportUse:null,initialize:function(a){if(!this.supported()){return}OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments);this.translationParameters={x:0,y:0};this.supportUse=(navigator.userAgent.toLowerCase().indexOf("applewebkit/5")==-1);this.isGecko=(navigator.userAgent.toLowerCase().indexOf("gecko/")!=-1);this.symbolMetrics={}},destroy:function(){OpenLayers.Renderer.Elements.prototype.destroy.apply(this,arguments)},supported:function(){var a="http://www.w3.org/TR/SVG11/feature#";return(document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature(a+"SVG","1.1")||document.implementation.hasFeature(a+"BasicStructure","1.1")))},inValidRange:function(a,f,b){var e=a+(b?0:this.translationParameters.x);var d=f+(b?0:this.translationParameters.y);return(e>=-this.MAX_PIXEL&&e<=this.MAX_PIXEL&&d>=-this.MAX_PIXEL&&d<=this.MAX_PIXEL)},setExtent:function(b,e){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var a=this.getResolution();var g=-b.left/a;var f=b.top/a;if(e){this.left=g;this.top=f;if(this.size){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(b,true)}return h}},translate:function(a,d){if(!this.inValidRange(a,d,true)){return false}else{var b="";if(a||d){b="translate("+a+","+d+")"}this.root.setAttributeNS(null,"transform",b);this.translationParameters={x:a,y:d};return true}},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w);this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="image"}else{if(this.isComplexSymbol(b.graphicName)){a=this.supportUse===false?"svg":"use"}else{a="circle"}}break;case"OpenLayers.Geometry.Rectangle":a="rect";break;case"OpenLayers.Geometry.LineString":a="polyline";break;case"OpenLayers.Geometry.LinearRing":a="polygon";break;case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="path";break;default:break}return a},setStyle:function(q,u,b){u=u||q._style;b=b||q._options;var l=parseFloat(q.getAttributeNS(null,"r"));var k=1;var e;if(q._geometryClass=="OpenLayers.Geometry.Point"&&l){q.style.visibility="";if(u.graphic===false){q.style.visibility="hidden"}else{if(u.externalGraphic){e=this.getPosition(q);if(u.graphicTitle){q.setAttributeNS(null,"title",u.graphicTitle)}if(u.graphicWidth&&u.graphicHeight){q.setAttributeNS(null,"preserveAspectRatio","none")}var p=u.graphicWidth||u.graphicHeight;var n=u.graphicHeight||u.graphicWidth;p=p?p:u.pointRadius*2;n=n?n:u.pointRadius*2;var v=(u.graphicXOffset!=undefined)?u.graphicXOffset:-(0.5*p);var g=(u.graphicYOffset!=undefined)?u.graphicYOffset:-(0.5*n);var a=u.graphicOpacity||u.fillOpacity;q.setAttributeNS(null,"x",(e.x+v).toFixed());q.setAttributeNS(null,"y",(e.y+g).toFixed());q.setAttributeNS(null,"width",p);q.setAttributeNS(null,"height",n);q.setAttributeNS(this.xlinkns,"href",u.externalGraphic);q.setAttributeNS(null,"style","opacity: "+a)}else{if(this.isComplexSymbol(u.graphicName)){var d=u.pointRadius*3;var m=d*2;var o=this.importSymbol(u.graphicName);e=this.getPosition(q);k=this.symbolMetrics[o][0]*3/m;var h=q.parentNode;var j=q.nextSibling;if(h){h.removeChild(q)}if(this.supportUse===false){var f=document.getElementById(o);q.firstChild&&q.removeChild(q.firstChild);q.appendChild(f.firstChild.cloneNode(true));q.setAttributeNS(null,"viewBox",f.getAttributeNS(null,"viewBox"))}else{q.setAttributeNS(this.xlinkns,"href","#"+o)}q.setAttributeNS(null,"width",m);q.setAttributeNS(null,"height",m);q.setAttributeNS(null,"x",e.x-d);q.setAttributeNS(null,"y",e.y-d);if(j){h.insertBefore(q,j)}else{if(h){h.appendChild(q)}}}else{q.setAttributeNS(null,"r",u.pointRadius)}}}var t=u.rotation;if((t!==undefined||q._rotation!==undefined)&&e){q._rotation=t;t|=0;if(q.nodeName!=="svg"){q.setAttributeNS(null,"transform","rotate("+t+" "+e.x+" "+e.y+")")}else{var s=this.symbolMetrics[o];q.firstChild.setAttributeNS(null,"transform","rotate("+u.rotation+" "+s[1]+" "+s[2]+")")}}}if(b.isFilled){q.setAttributeNS(null,"fill",u.fillColor);q.setAttributeNS(null,"fill-opacity",u.fillOpacity)}else{q.setAttributeNS(null,"fill","none")}if(b.isStroked){q.setAttributeNS(null,"stroke",u.strokeColor);q.setAttributeNS(null,"stroke-opacity",u.strokeOpacity);q.setAttributeNS(null,"stroke-width",u.strokeWidth*k);q.setAttributeNS(null,"stroke-linecap",u.strokeLinecap);q.setAttributeNS(null,"stroke-linejoin","round");q.setAttributeNS(null,"stroke-dasharray",this.dashStyle(u,k))}else{q.setAttributeNS(null,"stroke","none")}if(u.pointerEvents){q.setAttributeNS(null,"pointer-events",u.pointerEvents)}if(u.cursor!=null){q.setAttributeNS(null,"cursor",u.cursor)}return q},dashStyle:function(d,b){var a=d.strokeWidth*b;var e=d.strokeDashstyle;switch(e){case"solid":return"none";case"dot":return[1,4*a].join();case"dash":return[4*a,4*a].join();case"dashdot":return[4*a,4*a,1,4*a].join();case"longdash":return[8*a,4*a].join();case"longdashdot":return[8*a,4*a,1,4*a].join();default:return OpenLayers.String.trim(e).replace(/\s+/g,",")}},createNode:function(a,d){var b=document.createElementNS(this.xmlns,a);if(d){b.setAttributeNS(null,"id",d)}return b},nodeTypeCompare:function(b,a){return(a==b.nodeName)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_svgRoot","svg")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"g")},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(e,f,b){var d=this.getResolution();var a=(f.x/d+this.left);var g=(this.top-f.y/d);if(this.inValidRange(a,g)){e.setAttributeNS(null,"cx",a);e.setAttributeNS(null,"cy",g);e.setAttributeNS(null,"r",b);return e}else{return false}},drawLineString:function(b,d){var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawLinearRing:function(b,d){var a=this.getComponentsString(d.components);if(a.path){b.setAttributeNS(null,"points",a.path);return(a.complete?b:null)}else{return false}},drawPolygon:function(b,l){var k="";var m=true;var a=true;var e,n;var g=l.components;var h=g.length;var f=0;if(l.path){k=l.path}else{for(f=0;f<h;f++){k+=" M";e=this.getComponentsString(g[f].components," ");n=e.path;if(n){k+=" "+n;a=e.complete&&a}else{m=false}}k+=" z"}if(m){b.setAttributeNS(null,"d",k);b.setAttributeNS(null,"fill-rule","evenodd");return a?b:null}else{return false}},drawRectangle:function(d,e){var b=this.getResolution();var a=(e.x/b+this.left);var f=(this.top-e.y/b);if(this.inValidRange(a,f)){d.setAttributeNS(null,"x",a);d.setAttributeNS(null,"y",f);d.setAttributeNS(null,"width",e.width/b);d.setAttributeNS(null,"height",e.height/b);return d}else{return false}},drawSurface:function(h,k){var j=null;var b=true;var f=this.getResolution();for(var g=0,a=k.components.length;g<a;g++){if((g%3)==0&&(g/3)==0){var e=this.getShortString(k.components[g],f);if(!e){b=false}j="M "+e}else{if((g%3)==1){var e=this.getShortString(k.components[g],f);if(!e){b=false}j+=" C "+e}else{var e=this.getShortString(k.components[g],f);if(!e){b=false}j+=" "+e}}}j+=" Z";if(b){h.setAttributeNS(null,"d",j);return h}else{return false}},drawText:function(d,a,k){var b=this.getResolution();var j=(k.x/b+this.left);var f=(k.y/b-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",j);h.setAttributeNS(null,"y",-f);if(a.fontColor){h.setAttributeNS(null,"fill",a.fontColor)}if(a.fontOpacity){h.setAttributeNS(null,"opacity",a.fontOpacity)}if(a.fontFamily){h.setAttributeNS(null,"font-family",a.fontFamily)}if(a.fontSize){h.setAttributeNS(null,"font-size",a.fontSize)}if(a.fontWeight){h.setAttributeNS(null,"font-weight",a.fontWeight)}if(a.labelSelect===true){h.setAttributeNS(null,"pointer-events","visible");h._featureId=d;g._featureId=d;g._geometry=k;g._geometryClass=k.CLASS_NAME}else{h.setAttributeNS(null,"pointer-events","none")}var e=a.labelAlign||"cm";h.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[e[0]]||"middle");if(this.isGecko){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=a.label;if(!h.parentNode){h.appendChild(g);this.textRoot.appendChild(h)}},getComponentsString:function(g,f){var k=[];var a=true;var h=g.length;var n=[];var l,m,d;var b=this.getResolution();for(var e=0;e<h;e++){m=g[e];k.push(m);l=this.getShortString(m,b);if(l){n.push(l)}else{if(e>0){if(this.getShortString(g[e-1],b)){n.push(this.clipLine(m,g[e-1]))}}if(e<h-1){if(this.getShortString(g[e+1],b)){n.push(this.clipLine(m,g[e+1]))}}a=false}}return{path:n.join(f||","),complete:a}},clipLine:function(f,j){if(j.equals(f)){return""}var g=this.getResolution();var b=this.MAX_PIXEL-this.translationParameters.x;var a=this.MAX_PIXEL-this.translationParameters.y;var e=j.x/g+this.left;var m=this.top-j.y/g;var d=f.x/g+this.left;var l=this.top-f.y/g;var h;if(d<-b||d>b){h=(l-m)/(d-e);d=d<0?-b:b;l=m+(d-e)*h}if(l<-a||l>a){h=(d-e)/(l-m);l=l<0?-a:a;d=e+(l-m)*h}return d+","+l},getShortString:function(b,d){var a=(b.x/d+this.left);var e=(this.top-b.y/d);if(this.inValidRange(a,e)){return a+","+e}else{return false}},getPosition:function(a){return({x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))})},importSymbol:function(f){if(!this.defs){this.defs=this.createDefs()}var b=this.container.id+"-"+f;if(document.getElementById(b)!=null){return b}var e=OpenLayers.Renderer.symbol[f];if(!e){throw new Error(f+" is not a valid symbol name");return}var h=this.nodeFactory(b,"symbol");var d=this.nodeFactory(null,"polygon");h.appendChild(d);var n=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);var l="";var k,j;for(var g=0;g<e.length;g=g+2){k=e[g];j=e[g+1];n.left=Math.min(n.left,k);n.bottom=Math.min(n.bottom,j);n.right=Math.max(n.right,k);n.top=Math.max(n.top,j);l+=" "+k+","+j}d.setAttributeNS(null,"points",l);var a=n.getWidth();var m=n.getHeight();var o=[n.left-a,n.bottom-m,a*3,m*3];h.setAttributeNS(null,"viewBox",o.join(" "));this.symbolMetrics[b]=[Math.max(a,m),n.getCenterLonLat().lon,n.getCenterLonLat().lat];this.defs.appendChild(h);return h.id},getFeatureIdFromEvent:function(a){var d=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this,arguments);if(this.supportUse===false&&!d){var b=a.target;d=b.parentNode&&b!=this.rendererRoot&&b.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.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{canvas:null,features:null,geometryMap:null,initialize:function(a){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.geometryMap={}},eraseGeometry:function(a){this.eraseFeatures(this.features[this.geometryMap[a.id]][0])},supported:function(){var a=document.createElement("canvas");return !!a.getContext},setExtent:function(a){this.extent=a.clone();this.resolution=null;this.redraw()},setSize:function(a){this.size=a.clone();this.root.style.width=a.w+"px";this.root.style.height=a.h+"px";this.root.width=a.w;this.root.height=a.h;this.resolution=null},drawFeature:function(a,b){if(b==null){b=a.style}b=OpenLayers.Util.extend({fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1},b);this.features[a.id]=[a,b];if(a.geometry){this.geometryMap[a.geometry.id]=a.id}this.redraw()},drawGeometry:function(e,d){var b=e.CLASS_NAME;if((b=="OpenLayers.Geometry.Collection")||(b=="OpenLayers.Geometry.MultiPoint")||(b=="OpenLayers.Geometry.MultiLineString")||(b=="OpenLayers.Geometry.MultiPolygon")){for(var a=0;a<e.components.length;a++){this.drawGeometry(e.components[a],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(k,a){var f=new Image();f.src=a.externalGraphic;if(a.graphicTitle){f.title=a.graphicTitle}var d=a.graphicWidth||a.graphicHeight;var j=a.graphicHeight||a.graphicWidth;d=d?d:a.pointRadius*2;j=j?j:a.pointRadius*2;var h=(a.graphicXOffset!=undefined)?a.graphicXOffset:-(0.5*d);var e=(a.graphicYOffset!=undefined)?a.graphicYOffset:-(0.5*j);var g=a.graphicOpacity||a.fillOpacity;var b={img:f,x:(k[0]+h),y:(k[1]+e),width:d,height:j,canvas:this.canvas};f.onload=OpenLayers.Function.bind(function(){this.canvas.drawImage(this.img,this.x,this.y,this.width,this.height)},b)},setCanvasStyle:function(b,a){if(b=="fill"){this.canvas.globalAlpha=a.fillOpacity;this.canvas.fillStyle=a.fillColor}else{if(b=="stroke"){this.canvas.globalAlpha=a.strokeOpacity;this.canvas.strokeStyle=a.strokeColor;this.canvas.lineWidth=a.strokeWidth}else{this.canvas.globalAlpha=0;this.canvas.lineWidth=1}}},drawPoint:function(d,a){if(a.graphic!==false){var b=this.getLocalXY(d);if(a.externalGraphic){this.drawExternalGraphic(b,a)}else{if(a.fill!==false){this.setCanvasStyle("fill",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],a.pointRadius,0,Math.PI*2,true);this.canvas.fill()}if(a.stroke!==false){this.setCanvasStyle("stroke",a);this.canvas.beginPath();this.canvas.arc(b[0],b[1],a.pointRadius,0,Math.PI*2,true);this.canvas.stroke();this.setCanvasStyle("reset")}}}},drawLineString:function(e,b){if(b.stroke!==false){this.setCanvasStyle("stroke",b);this.canvas.beginPath();var f=this.getLocalXY(e.components[0]);this.canvas.moveTo(f[0],f[1]);for(var a=1;a<e.components.length;a++){var d=this.getLocalXY(e.components[a]);this.canvas.lineTo(d[0],d[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawLinearRing:function(f,d){if(d.fill!==false){this.setCanvasStyle("fill",d);this.canvas.beginPath();var g=this.getLocalXY(f.components[0]);this.canvas.moveTo(g[0],g[1]);for(var b=1;b<f.components.length-1;b++){var e=this.getLocalXY(f.components[b]);this.canvas.lineTo(e[0],e[1])}this.canvas.fill()}if(d.stroke!==false){var a=this.canvas.lineWidth;this.setCanvasStyle("stroke",d);this.canvas.beginPath();var g=this.getLocalXY(f.components[0]);this.canvas.moveTo(g[0],g[1]);for(var b=1;b<f.components.length;b++){var e=this.getLocalXY(f.components[b]);this.canvas.lineTo(e[0],e[1])}this.canvas.stroke()}this.setCanvasStyle("reset")},drawPolygon:function(d,b){this.drawLinearRing(d.components[0],b);for(var a=1;a<d.components.length;a++){this.drawLinearRing(d.components[a],{fillOpacity:0,strokeWidth:0,strokeOpacity:0,strokeColor:"#000000",fillColor:"#000000"})}},drawText:function(b,e){e=OpenLayers.Util.extend({fontColor:"#000000",labelAlign:"cm"},e);var f=this.getLocalXY(b);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 a=this.canvas.mozMeasureText(e.label);switch(e.labelAlign[0]){case"l":break;case"r":f[0]-=a;break;case"c":default:f[0]-=a/2}this.canvas.translate(f[0],f[1]);this.canvas.mozDrawText(e.label);this.canvas.translate(-1*f[0],-1*f[1])}}this.setCanvasStyle("reset")},getLocalXY:function(b){var d=this.getResolution();var e=this.extent;var a=(b.x/d+(-e.left/d));var f=((e.top/d)-b.y/d);return[a,f]},clear:function(){this.canvas.clearRect(0,0,this.root.width,this.root.height)},getFeatureIdFromEvent:function(a){var g=this.map.getLonLatFromPixel(a.xy);var b=this.getResolution();var f=new OpenLayers.Bounds(g.lon-b*5,g.lat-b*5,g.lon+b*5,g.lat+b*5);var 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(b){if(!(b instanceof Array)){b=[b]}for(var a=0;a<b.length;++a){delete this.features[b[a].id]}this.redraw()},redraw:function(){if(!this.locked){this.clear();var f=[];var b,d;for(var g in this.features){if(!this.features.hasOwnProperty(g)){continue}b=this.features[g][0];d=this.features[g][1];if(!b.geometry){continue}this.drawGeometry(b.geometry,d);if(d.label){f.push([b,d])}}var e;for(var a=0;len=f.length,a<len;++a){e=f[a];this.drawText(e[0].geometry.getCentroid(),e[1])}}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right"};OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(b){if(!this.supported()){return}if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);var f=document.createStyleSheet();var d=["shape","rect","oval","fill","stroke","imagedata","group","textbox"];for(var e=0,a=d.length;e<a;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(k,a){OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments);var d=this.getResolution();if(this.size){var b=(k.left/d)|0;var g=(k.top/d-this.size.h)|0;if(a||!this.offset){this.offset={x:b,y:g};b=0;g=0}else{b=b-this.offset.x;g=g-this.offset.y}var m=b+" "+g;this.root.coordorigin=m;var j=[this.root,this.vectorRoot,this.textRoot];var h;for(var e=0,f=j.length;e<f;++e){h=j[e];var l=this.size.w+" "+this.size.h;h.coordsize=l}this.root.style.flip="y"}return true},setSize:function(g){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);var e=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot];var d=this.size.w+"px";var j=this.size.h+"px";var b;for(var f=0,a=e.length;f<a;++f){b=e[f];b.style.width=d;b.style.height=j}},getNodeType:function(d,b){var a=null;switch(d.CLASS_NAME){case"OpenLayers.Geometry.Point":if(b.externalGraphic){a="olv:rect"}else{if(this.isComplexSymbol(b.graphicName)){a="olv:shape"}else{a="olv:oval"}}break;case"OpenLayers.Geometry.Rectangle":a="olv:rect";break;case"OpenLayers.Geometry.LineString":case"OpenLayers.Geometry.LinearRing":case"OpenLayers.Geometry.Polygon":case"OpenLayers.Geometry.Curve":case"OpenLayers.Geometry.Surface":a="olv:shape";break;default:break}return a},setStyle:function(n,s,a,d){s=s||n._style;a=a||n._options;var h=1;var b=s.fillColor;if(n._geometryClass==="OpenLayers.Geometry.Point"){if(s.externalGraphic){if(s.graphicTitle){n.title=s.graphicTitle}var m=s.graphicWidth||s.graphicHeight;var k=s.graphicHeight||s.graphicWidth;m=m?m:s.pointRadius*2;k=k?k:s.pointRadius*2;var p=this.getResolution();var u=(s.graphicXOffset!=undefined)?s.graphicXOffset:-(0.5*m);var f=(s.graphicYOffset!=undefined)?s.graphicYOffset:-(0.5*k);n.style.left=(((d.x/p-this.offset.x)+u)|0)+"px";n.style.top=(((d.y/p-this.offset.y)-(f+k))|0)+"px";n.style.width=m+"px";n.style.height=k+"px";n.style.flip="y";b="none";a.isStroked=false}else{if(this.isComplexSymbol(s.graphicName)){var g=this.importSymbol(s.graphicName);n.path=g.path;n.coordorigin=g.left+","+g.bottom;var j=g.size;n.coordsize=j+","+j;this.drawCircle(n,d,s.pointRadius);n.style.flip="y"}else{this.drawCircle(n,d,s.pointRadius)}}}if(a.isFilled){n.fillcolor=b}else{n.filled="false"}var l=n.getElementsByTagName("fill");var q=(l.length==0)?null:l[0];if(!a.isFilled){if(q){n.removeChild(q)}}else{if(!q){q=this.createNode("olv:fill",n.id+"_fill")}q.opacity=s.fillOpacity;if(n._geometryClass==="OpenLayers.Geometry.Point"&&s.externalGraphic){if(s.graphicOpacity){q.opacity=s.graphicOpacity}q.src=s.externalGraphic;q.type="frame";if(!(s.graphicWidth&&s.graphicHeight)){q.aspect="atmost"}}if(q.parentNode!=n){n.appendChild(q)}}var o=s.rotation;if(o!==n._rotation){n._rotation=o;if(s.externalGraphic){this.graphicRotate(n,u,f,s);q.opacity=0}else{if(n._geometryClass==="OpenLayers.Geometry.Point"){n.style.rotation=o||0}}}if(a.isStroked){n.strokecolor=s.strokeColor;n.strokeweight=s.strokeWidth+"px"}else{n.stroked=false}var t=n.getElementsByTagName("stroke");var e=(t.length==0)?null:t[0];if(!a.isStroked){if(e){n.removeChild(e)}}else{if(!e){e=this.createNode("olv:stroke",n.id+"_stroke");n.appendChild(e)}e.opacity=s.strokeOpacity;e.endcap=!s.strokeLinecap||s.strokeLinecap=="butt"?"flat":s.strokeLinecap;e.dashstyle=this.dashStyle(s)}if(s.cursor!="inherit"&&s.cursor!=null){n.style.cursor=s.cursor}return n},graphicRotate:function(q,v,g,u){var u=u||q._style;var e=q._options;var t=u.rotation||0;var a,m;if(!(u.graphicWidth&&u.graphicHeight)){var w=new Image();w.onreadystatechange=OpenLayers.Function.bind(function(){if(w.readyState=="complete"||w.readyState=="interactive"){a=w.width/w.height;m=Math.max(u.pointRadius*2,u.graphicWidth||0,u.graphicHeight||0);v=v*a;u.graphicWidth=m*a;u.graphicHeight=m;this.graphicRotate(q,v,g,u)}},this);w.src=u.externalGraphic;return}else{m=Math.max(u.graphicWidth,u.graphicHeight);a=u.graphicWidth/u.graphicHeight}var p=Math.round(u.graphicWidth||m*a);var n=Math.round(u.graphicHeight||m);q.style.width=p+"px";q.style.height=n+"px";var o=document.getElementById(q.id+"_image");if(!o){o=this.createNode("olv:imagedata",q.id+"_image");q.appendChild(o)}o.style.width=p+"px";o.style.height=n+"px";o.src=u.externalGraphic;o.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')";var h=t*Math.PI/180;var k=Math.sin(h);var f=Math.cos(h);var j="progid:DXImageTransform.Microsoft.Matrix(M11="+f+",M12="+(-k)+",M21="+k+",M22="+f+",SizingMethod='auto expand')\n";var b=u.graphicOpacity||u.fillOpacity;if(b&&b!=1){j+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+b+")\n"}q.style.filter=j;var s=new OpenLayers.Geometry.Point(-v,-g);var d=new OpenLayers.Bounds(0,0,p,n).toGeometry();d.rotate(u.rotation,s);var l=d.getBounds();q.style.left=Math.round(parseInt(q.style.left)+l.left)+"px";q.style.top=Math.round(parseInt(q.style.top)-l.bottom)+"px"},postDraw:function(a){a.style.visibility="visible";var d=a._style.fillColor;var b=a._style.strokeColor;if(d=="none"&&a.fillcolor!=d){a.fillcolor=d}if(b=="none"&&a.strokecolor!=b){a.strokecolor=b}},setNodeDimension:function(b,f){var e=f.getBounds();if(e&&this.offset){var a=this.getResolution();var d=new OpenLayers.Bounds((e.left/a-this.offset.x)|0,(e.bottom/a-this.offset.y)|0,(e.right/a-this.offset.x)|0,(e.top/a-this.offset.y)|0);b.style.left=d.left+"px";b.style.top=d.top+"px";b.style.width=d.getWidth()+"px";b.style.height=d.getHeight()+"px";b.coordorigin=d.left+" "+d.top;b.coordsize=d.getWidth()+" "+d.getHeight()}},dashStyle:function(a){var d=a.strokeDashstyle;switch(d){case"solid":case"dot":case"dash":case"dashdot":case"longdash":case"longdashdot":return d;default:var b=d.split(/[ ,]/);if(b.length==2){if(1*b[0]>=2*b[1]){return"longdash"}return(b[0]==1||b[1]==1)?"dot":"dash"}else{if(b.length==4){return(1*b[0]>=2*b[1])?"longdashdot":"dashdot"}}return"solid"}},createNode:function(a,d){var b=document.createElement(a);if(d){b.id=d}b.unselectable="on";b.onselectstart=OpenLayers.Function.False;return b},nodeTypeCompare:function(d,b){var e=b;var a=e.indexOf(":");if(a!=-1){e=e.substr(a+1)}var f=d.nodeName;a=f.indexOf(":");if(a!=-1){f=f.substr(a+1)}return(e==f)},createRenderRoot:function(){return this.nodeFactory(this.container.id+"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(e,f,a){if(!isNaN(f.x)&&!isNaN(f.y)){var b=this.getResolution();e.style.left=(((f.x/b-this.offset.x)|0)-a)+"px";e.style.top=(((f.y/b-this.offset.y)|0)-a)+"px";var d=a*2;e.style.width=d+"px";e.style.height=d+"px";return e}return false},drawLineString:function(a,b){return this.drawLine(a,b,false)},drawLinearRing:function(a,b){return this.drawLine(a,b,true)},drawLine:function(b,l,h){this.setNodeDimension(b,l);var d=this.getResolution();var a=l.components.length;var f=new Array(a);var j,m,k;for(var g=0;g<a;g++){j=l.components[g];m=(j.x/d-this.offset.x)|0;k=(j.y/d-this.offset.y)|0;f[g]=" "+m+","+k+" l "}var e=(h)?" x e":" e";b.path="m"+f.join("")+e;return b},drawPolygon:function(b,m){this.setNodeDimension(b,m);if(m.path){b.path=m.path}else{var d=this.getResolution();var o=[];var g,f,e,k,a,h,n,l;for(e=0,k=m.components.length;e<k;e++){g=m.components[e];o.push("m");for(f=0,a=g.components.length;f<a;f++){h=g.components[f];n=(h.x/d-this.offset.x)|0;l=(h.y/d-this.offset.y)|0;o.push(" "+n+","+l);if(f==0){o.push(" l")}}o.push(" x ")}o.push("e");b.path=o.join("")}return b},drawRectangle:function(b,d){var a=this.getResolution();b.style.left=((d.x/a-this.offset.x)|0)+"px";b.style.top=((d.y/a-this.offset.y)|0)+"px";b.style.width=((d.width/a)|0)+"px";b.style.height=((d.height/a)|0)+"px";return b},drawText:function(e,a,j){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=((j.x/d-this.offset.x)|0)+"px";h.style.top=((j.y/d-this.offset.y)|0)+"px";h.style.flip="y";g.innerText=a.label;if(a.fontColor){g.style.color=a.fontColor}if(a.fontOpacity){g.style.filter="alpha(opacity="+(a.fontOpacity*100)+")"}if(a.fontFamily){g.style.fontFamily=a.fontFamily}if(a.fontSize){g.style.fontSize=a.fontSize}if(a.fontWeight){g.style.fontWeight=a.fontWeight}if(a.labelSelect===true){h._featureId=e;g._featureId=e;g._geometry=j;g._geometryClass=j.CLASS_NAME}g.style.whiteSpace="nowrap";g.inset="1px,0px,0px,0px";if(!h.parentNode){h.appendChild(g);this.textRoot.appendChild(h)}var f=a.labelAlign||"cm";var k=g.clientWidth*(OpenLayers.Renderer.VML.LABEL_SHIFT[f[0]||"c"]);var b=g.clientHeight*(OpenLayers.Renderer.VML.LABEL_SHIFT[f[1]||"m"]);h.style.left=parseInt(h.style.left)-k-1+"px";h.style.top=parseInt(h.style.top)+b+"px"},drawSurface:function(a,h){this.setNodeDimension(a,h);var b=this.getResolution();var k=[];var e,j,g;for(var d=0,f=h.components.length;d<f;d++){e=h.components[d];j=(e.x/b-this.offset.x)|0;g=(e.y/b-this.offset.y)|0;if((d%3)==0&&(d/3)==0){k.push("m")}else{if((d%3)==1){k.push(" c")}}k.push(" "+j+","+g)}k.push(" x e");a.path=k.join("");return a},moveRoot:function(b){var a=this.map.getLayer(b.container.id);if(a instanceof OpenLayers.Layer.Vector.RootContainer){a=this.map.getLayer(this.container.id)}a&&a.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);a&&a.redraw()},importSymbol:function(e){var b=this.container.id+"-"+e;var a=this.symbolCache[b];if(a){return a}var d=OpenLayers.Renderer.symbol[e];if(!d){throw new Error(e+" is not a valid symbol name");return}var l=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 j=d[g];var h=d[g+1];l.left=Math.min(l.left,j);l.bottom=Math.min(l.bottom,h);l.right=Math.max(l.right,j);l.top=Math.max(l.top,h);f.push(j);f.push(h);if(g==0){f.push("l")}}f.push("x e");var m=f.join(" ");var k=(l.getWidth()-l.getHeight())/2;if(k>0){l.bottom=l.bottom-k;l.top=l.top+k}else{l.left=l.left+k;l.right=l.right-k}a={path:m,size:l.getWidth(),left:l.left,bottom:l.bottom};this.symbolCache[b]=a;return a},CLASS_NAME:"OpenLayers.Renderer.VML"});OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{EVENT_TYPES:["beforefeatureadded","beforefeaturesadded","featureadded","featuresadded","beforefeatureremoved","featureremoved","featuresremoved","beforefeatureselected","featureselected","featureunselected","beforefeaturemodified","featuremodified","afterfeaturemodified","vertexmodified","sketchstarted","sketchmodified","sketchcomplete","refresh"],isBaseLayer:false,isFixed:false,isVector:true,features:null,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,b){this.EVENT_TYPES=OpenLayers.Layer.Vector.prototype.EVENT_TYPES.concat(OpenLayers.Layer.prototype.EVENT_TYPES);OpenLayers.Layer.prototype.initialize.apply(this,arguments);if(!this.renderer||!this.renderer.supported()){this.assignRenderer()}if(!this.renderer||!this.renderer.supported()){this.renderer=null;this.displayError()}if(!this.styleMap){this.styleMap=new OpenLayers.StyleMap()}this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies){for(var e=0,a=this.strategies.length;e<a;e++){this.strategies[e].setLayer(this)}}},destroy:function(){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];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 a=d.length;var e=new Array(a);for(var b=0;b<a;++b){e[b]=d[b].clone()}f.features=e;return f},refresh:function(a){if(this.calculateInRange()&&this.visibility){this.events.triggerEvent("refresh",a)}},assignRenderer:function(){for(var d=0,a=this.renderers.length;d<a;d++){var b=OpenLayers.Renderer[this.renderers[d]];if(b&&b.prototype.supported()){this.renderer=new b(this.div,this.rendererOptions);break}}},displayError:function(){if(this.reportError){OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))}},setMap:function(b){OpenLayers.Layer.prototype.setMap.apply(this,arguments);if(!this.renderer){this.map.removeLayer(this)}else{this.renderer.map=this.map;var a=this.map.getSize();if(a){this.renderer.setSize(this.map.getSize())}}},afterAdd:function(){if(this.strategies){var d,b,a;for(b=0,a=this.strategies.length;b<a;b++){d=this.strategies[b];if(d.autoActivate){d.activate()}}}},removeMap:function(d){if(this.strategies){var e,b,a;for(b=0,a=this.strategies.length;b<a;b++){e=this.strategies[b];if(e.autoActivate){e.deactivate()}}}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this,arguments);this.renderer.setSize(this.map.getSize())},moveTo:function(h,b,j){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var f=true;if(!j){this.renderer.root.style.visibility="hidden";this.div.style.left=-parseInt(this.map.layerContainerDiv.style.left)+"px";this.div.style.top=-parseInt(this.map.layerContainerDiv.style.top)+"px";var g=this.map.getExtent();f=this.renderer.setExtent(g,b);this.renderer.root.style.visibility="visible";if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){this.div.scrollLeft=this.div.scrollLeft}if(!b&&f){for(var e in this.unrenderedFeatures){var d=this.unrenderedFeatures[e];this.drawFeature(d)}}}if(!this.drawn||b||!f){this.drawn=true;var d;for(var e=0,a=this.features.length;e<a;e++){this.renderer.locked=(e!==(a-1));d=this.features[e];this.drawFeature(d)}}},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);var b=this.div.style.display;if(b!=this.renderer.root.style.display){this.renderer.root.style.display=b}},addFeatures:function(b,k){if(!(b instanceof Array)){b=[b]}var h=!k||!k.silent;if(h){var a={features:b};var g=this.events.triggerEvent("beforefeaturesadded",a);if(g===false){return}b=a.features}for(var d=0,f=b.length;d<f;d++){if(d!=(b.length-1)){this.renderer.locked=true}else{this.renderer.locked=false}var j=b[d];if(this.geometryType&&!(j.geometry instanceof this.geometryType)){var e=OpenLayers.i18n("componentShouldBe",{geomType:this.geometryType.prototype.CLASS_NAME});throw e}this.features.push(j);j.layer=this;if(!j.style&&this.style){j.style=OpenLayers.Util.extend({},this.style)}if(h){if(this.events.triggerEvent("beforefeatureadded",{feature:j})===false){continue}this.preFeatureInsert(j)}this.drawFeature(j);if(h){this.events.triggerEvent("featureadded",{feature:j});this.onFeatureInsert(j)}}if(h){this.events.triggerEvent("featuresadded",{features:b})}},removeFeatures:function(f,a){if(!f||f.length===0){return}if(!(f instanceof Array)){f=[f]}if(f===this.features||f===this.selectedFeatures){f=f.slice()}var e=!a||!a.silent;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 b=f[d];delete this.unrenderedFeatures[b.id];if(e){this.events.triggerEvent("beforefeatureremoved",{feature:b})}this.features=OpenLayers.Util.removeItem(this.features,b);b.layer=null;if(b.geometry){this.renderer.eraseFeatures(b)}if(OpenLayers.Util.indexOf(this.selectedFeatures,b)!=-1){OpenLayers.Util.removeItem(this.selectedFeatures,b)}if(e){this.events.triggerEvent("featureremoved",{feature:b})}}if(e){this.events.triggerEvent("featuresremoved",{features:f})}},destroyFeatures:function(e,a){var d=(e==undefined);if(d){e=this.features}if(e){this.removeFeatures(e,a);for(var b=e.length-1;b>=0;b--){e[b].destroy()}}},drawFeature:function(a,b){if(!this.drawn){return}if(typeof b!="object"){if(!b&&a.state===OpenLayers.State.DELETE){b="delete"}var d=b||a.renderIntent;b=a.style||this.style;if(!b){b=this.styleMap.createSymbolizer(a,d)}}if(!this.renderer.drawFeature(a,b)){this.unrenderedFeatures[a.id]=a}else{delete this.unrenderedFeatures[a.id]}},eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer){OpenLayers.Console.error(OpenLayers.i18n("getFeatureError"));return null}var b=this.renderer.getFeatureIdFromEvent(a);return this.getFeatureById(b)},getFeatureById:function(e){var d=null;for(var b=0,a=this.features.length;b<a;++b){if(this.features[b].id==e){d=this.features[b];break}}return d},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var b=null;var e=this.features;if(e&&(e.length>0)){b=new OpenLayers.Bounds();var f=null;for(var d=0,a=e.length;d<a;d++){f=e[d].geometry;if(f){b.extend(f.getBounds())}}}return b},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:false,layers:null,initialize:function(b,a){OpenLayers.Layer.Vector.prototype.initialize.apply(this,arguments)},display:function(){},getFeatureFromEvent:function(a){var e=this.layers;var d;for(var b=0;b<e.length;b++){d=e[b].getFeatureFromEvent(a);if(d){return d}}},addLayer:function(a){this.layers.push(a);this.collectRoots()},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();a.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(a){a.events.unregister("changelayer",this,this.handleChangeLayer);this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){var b;for(var a=0;a<this.map.layers.length;++a){b=this.map.layers[a];if(OpenLayers.Util.indexOf(this.layers,b)!=-1){b.renderer.moveRoot(this.renderer)}}},resetRoots:function(){var b;for(var a=0;a<this.layers.length;++a){b=this.layers[a];if(this.renderer&&b.renderer.getRenderLayerId()==this.id){this.renderer.moveRoot(b.renderer)}}},handleChangeLayer:function(a){var b=a.layer;if(a.property=="order"&&OpenLayers.Util.indexOf(this.layers,b)!=-1){this.resetRoots();this.collectRoots()}},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:true,autoDestroy:true,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a;this.active=false},destroy:function(){this.deactivate();this.layer=null;this.options=null},setLayer:function(a){this.layer=a},activate:function(){if(!this.active){this.active=true;return true}return false},deactivate:function(){if(this.active){this.active=false;return true}return false},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},destroy:function(){OpenLayers.Strategy.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Strategy.prototype.activate.apply(this,arguments)){this.layer.events.on({refresh:this.load,scope:this});if(this.layer.visibility==true||this.preload){this.load()}else{this.layer.events.on({visibilitychanged:this.load,scope:this})}return true}return false},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({refresh:this.load,visibilitychanged:this.load,scope:this})}return a},load:function(a){this.layer.events.triggerEvent("loadstart");this.layer.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,filter:this.layer.filter,scope:this},a));this.layer.events.un({visibilitychanged:this.load,scope:this})},merge:function(h){this.layer.destroyFeatures();var f=h.features;if(f&&f.length>0){var g=this.layer.projection;var e=this.layer.map.getProjectionObject();if(!e.equals(g)){var d;for(var b=0,a=f.length;b<a;++b){d=f[b].geometry;if(d){d.transform(g,e)}}}this.layer.addFeatures(f)}this.layer.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:false,resolution:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,moveend:this.cluster,scope:this})}return a},cacheFeatures:function(b){var a=true;if(!this.clustering){this.clearCache();this.features=b.features;this.cluster();a=false}return a},clearCache:function(){this.features=null},cluster:function(a){if((!a||a.zoomChanged)&&this.features){var d=this.layer.map.getResolution();if(d!=this.resolution||!this.clustersExist()){this.resolution=d;var k=[];var n,b,l;for(var f=0;f<this.features.length;++f){n=this.features[f];if(n.geometry){b=false;for(var e=0;e<k.length;++e){l=k[e];if(this.shouldCluster(l,n)){this.addToCluster(l,n);b=true;break}}if(!b){k.push(this.createCluster(this.features[f]))}}}this.layer.destroyFeatures();if(k.length>0){if(this.threshold>1){var h=k.slice();k=[];var m;for(var f=0,g=h.length;f<g;++f){m=h[f];if(m.attributes.count<this.threshold){Array.prototype.push.apply(k,m.cluster)}else{k.push(m)}}}this.clustering=true;this.layer.addFeatures(k);this.clustering=false}this.clusters=k}}},clustersExist:function(){var b=false;if(this.clusters&&this.clusters.length>0&&this.clusters.length==this.layer.features.length){b=true;for(var a=0;a<this.clusters.length;++a){if(this.clusters[a]!=this.layer.features[a]){b=false;break}}}return b},shouldCluster:function(a,b){var f=a.geometry.getBounds().getCenterLonLat();var d=b.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(a,b){a.cluster.push(b);a.attributes.count+=1},createCluster:function(d){var b=d.geometry.getBounds().getCenterLonLat();var a=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat),{count:1});a.cluster=[d];return a},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:false,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.clearCache();this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this})}return a},cacheFeatures:function(a){if(!this.paging){this.clearCache();this.features=a.features;this.pageNext(a)}},clearCache:function(){if(this.features){for(var a=0;a<this.features.length;++a){this.features[a].destroy()}}this.features=null;this.num=null},pageCount:function(){var a=this.features?this.features.length:0;return Math.ceil(a/this.length)},pageNum:function(){return this.num},pageLength:function(a){if(a&&a>0){this.length=a}return this.length},pageNext:function(a){var b=false;if(this.features){if(this.num===null){this.num=-1}var d=(this.num+1)*this.length;b=this.page(d,a)}return b},pagePrevious:function(){var a=false;if(this.features){if(this.num===null){this.num=this.pageCount()}var b=(this.num-1)*this.length;a=this.page(b)}return a},page:function(f,d){var e=false;if(this.features){if(f>=0&&f<this.features.length){var a=Math.floor(f/this.length);if(a!=this.num){this.paging=true;var b=this.features.slice(f,f+this.length);this.layer.removeFeatures(this.layer.features);this.num=a;if(d&&d.features){d.features=b}else{this.layer.addFeatures(b)}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(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){this.layer.events.on({moveend:this.update,scope:this});this.layer.events.on({refresh:this.update,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.layer.events.un({moveend:this.update,scope:this});this.layer.events.un({refresh:this.update,scope:this})}return a},update:function(b){var a=this.getMapBounds();if((b&&b.force)||this.invalidBounds(a)){this.calculateBounds(a);this.resolution=this.layer.map.getResolution();this.triggerRead()}},getMapBounds:function(){var a=this.layer.map.getExtent();if(!this.layer.projection.equals(this.layer.map.getProjectionObject())){a=a.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)}return a},invalidBounds:function(a){if(!a){a=this.getMapBounds()}var d=!this.bounds||!this.bounds.containsBounds(a);if(!d&&this.resFactor){var b=this.resolution/this.layer.map.getResolution();d=(b>=this.resFactor||b<=(1/this.resFactor))}return d},calculateBounds:function(b){if(!b){b=this.getMapBounds()}var a=b.getCenterLonLat();var e=b.getWidth()*this.ratio;var d=b.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(a.lon-(e/2),a.lat-(d/2),a.lon+(e/2),a.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 a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});if(this.layer.filter){a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.layer.filter,a]})}return a},merge:function(h){this.layer.destroyFeatures();var f=h.features;if(f&&f.length>0){var g=this.layer.projection;var e=this.layer.map.getProjectionObject();if(!e.equals(g)){var d;for(var b=0,a=f.length;b<a;++b){d=f[b].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.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{EVENT_TYPES:["start","success","fail"],events:null,auto:false,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a]);this.events=new OpenLayers.Events(this,null,this.EVENT_TYPES)},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),this.auto*1000)}else{this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){if(this.auto){if(typeof this.auto==="number"){window.clearInterval(this.timer)}else{this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this})}}}return a},triggerSave:function(b){var a=b.feature;if(a.state===OpenLayers.State.INSERT||a.state===OpenLayers.State.UPDATE||a.state===OpenLayers.State.DELETE){this.save([b.feature])}},save:function(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 a=e.length;var f=new Array(a);var j,h;for(var b=0;b<a;++b){j=e[b];h=j.clone();h.fid=j.fid;h.state=j.state;if(j.url){h.url=j.url}h._original=j;h.geometry.transform(d,g);f[b]=h}e=f}this.layer.protocol.commit(e,{callback:this.onCommit,scope:this})},onCommit:function(e){var l={response:e};if(e.success()){var b=e.reqFeatures;var a,m;var d=[];var k=e.insertIds||[];var f=0;for(var g=0,h=b.length;g<h;++g){m=b[g];m=m._original||m;a=m.state;if(a){if(a==OpenLayers.State.DELETE){d.push(m)}else{if(a==OpenLayers.State.INSERT){m.fid=k[f];++f}}m.state=null}}if(d.length>0){this.layer.destroyFeatures(d)}this.events.triggerEvent("success",l)}else{this.events.triggerEvent("fail",l)}},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:false,interval:0,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a])},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a){if(this.layer.visibility===true){this.start()}this.layer.events.on({visibilitychanged:this.reset,scope:this})}return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);if(a){this.stop()}return a},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.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(a){return true},clone:function(){return null},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){for(var b=0,a=this.fids.length;b<a;b++){var e=d.fid||d.id;if(e==this.fids[b]){return true}}return false},clone:function(){var a=new OpenLayers.Filter.FeatureId();OpenLayers.Util.extend(a,this);a.fids=this.fids.slice();return a},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(a){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(d){switch(this.type){case OpenLayers.Filter.Logical.AND:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(d)==false){return false}}return true;case OpenLayers.Filter.Logical.OR:for(var b=0,a=this.filters.length;b<a;b++){if(this.filters[b].evaluate(d)==true){return true}}return false;case OpenLayers.Filter.Logical.NOT:return(!this.filters[0].evaluate(d))}},clone:function(){var d=[];for(var b=0,a=this.filters.length;b<a;++b){d.push(this.filters[b].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(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){var a=false;switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:var b=d[this.property];var f=this.value;if(!this.matchCase&&typeof b=="string"&&typeof f=="string"){a=(b.toUpperCase()==f.toUpperCase())}else{a=(b==f)}break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:var b=d[this.property];var f=this.value;if(!this.matchCase&&typeof b=="string"&&typeof f=="string"){a=(b.toUpperCase()!=f.toUpperCase())}else{a=(b!=f)}break;case OpenLayers.Filter.Comparison.LESS_THAN:a=d[this.property]<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:a=d[this.property]>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:a=d[this.property]<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:a=d[this.property]>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:a=(d[this.property]>=this.lowerBoundary)&&(d[this.property]<=this.upperBoundary);break;case OpenLayers.Filter.Comparison.LIKE:var e=new RegExp(this.value,"gi");a=e.test(d[this.property]);break}return a},value2regex:function(e,b,a){if(e=="."){var d="'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison";OpenLayers.Console.error(d);return null}e=e?e:"*";b=b?b:".";a=a?a:"!";this.value=this.value.replace(new RegExp("\\"+a+"(.|$)","g"),"\\$1");this.value=this.value.replace(new RegExp("\\"+b,"g"),".");this.value=this.value.replace(new RegExp("\\"+e,"g"),".*");this.value=this.value.replace(new RegExp("\\\\.\\*","g"),"\\"+e);this.value=this.value.replace(new RegExp("\\\\\\.","g"),"\\"+b);return this.value},regex2value:function(){var a=this.value;a=a.replace(/!/g,"!!");a=a.replace(/(\\)?\\\./g,function(d,b){return b?d:"!."});a=a.replace(/(\\)?\\\*/g,function(d,b){return b?d:"!*"});a=a.replace(/\\\\/g,"\\");a=a.replace(/\.\*/g,"*");return a},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison(),this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(d){var a=false;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(d.geometry){var b=this.value;if(this.value.CLASS_NAME=="OpenLayers.Bounds"){b=this.value.toGeometry()}if(d.geometry.intersects(b)){a=true}}break;default:OpenLayers.Console.error(OpenLayers.i18n("filterEvaluateNotImplemented"));break}return a},clone:function(){var a=OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(a)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:true,defaultFilter:null,initialize:function(a){a=a||{};OpenLayers.Util.extend(this,a);this.options=a},mergeWithDefaultFilter:function(a){if(a){if(this.defaultFilter){a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,a]})}}else{a=this.defaultFilter}return a},destroy:function(){this.options=null;this.format=null},read:function(a){a=a||{};a.filter=this.mergeWithDefaultFilter(a.filter)},create:function(){},update:function(){},"delete":function(){},commit:function(){},abort:function(a){},createCallback:function(d,a,b){return OpenLayers.Function.bind(function(){d.apply(this,[a,b])},this)},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:true,features:null,reqFeatures:null,priv:null,initialize:function(a){OpenLayers.Util.extend(this,a)},success:function(){return this.code>0},CLASS_NAME:"OpenLayers.Protocol.Response"});OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:false,wildcarded:false,initialize:function(a){a=a||{};this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments)},destroy:function(){this.params=null;this.headers=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){OpenLayers.Protocol.prototype.read.apply(this,arguments);a=OpenLayers.Util.applyDefaults(a,this.options);a.params=OpenLayers.Util.applyDefaults(a.params,this.options.params);if(a.filter){a.params=this.filterToParams(a.filter,a.params)}var b=(a.readWithPOST!==undefined)?a.readWithPOST:this.readWithPOST;var d=new OpenLayers.Protocol.Response({requestType:"read"});if(b){d.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,d,a),data:OpenLayers.Util.getParameterString(a.params),headers:{"Content-Type":"application/x-www-form-urlencoded"}})}else{d.priv=OpenLayers.Request.GET({url:a.url,callback:this.createCallback(this.handleRead,d,a),params:a.params,headers:a.headers})}return d},handleRead:function(b,a){this.handleResponse(b,a)},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();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 j=OpenLayers.Protocol.HTTP.COMP_TYPE_TO_OP_STR[e.type];if(j!==undefined){var g=e.value;if(e.type==OpenLayers.Filter.Comparison.LIKE){g=this.regex2value(g);if(this.wildcarded){g="%"+g+"%"}}h[e.property+"__"+j]=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 b=0,a=e.filters.length;b<a;b++){h=this.filterToParams(e.filters[b],h)}}else{OpenLayers.Console.warn("Unsupported logical filter type "+e.type)}break;default:OpenLayers.Console.warn("Unknown filter type "+f)}return h},regex2value:function(a){a=a.replace(/%/g,"\\%");a=a.replace(/\\\\\.(\*)?/g,function(d,b){return b?d:"\\\\_"});a=a.replace(/\\\\\.\*/g,"\\\\%");a=a.replace(/(\\)?\.(\*)?/g,function(d,b,e){return b||e?d:"_"});a=a.replace(/(\\)?\.\*/g,function(d,b){return b?d:"%"});a=a.replace(/\\\./g,".");a=a.replace(/(\\)?\\\*/g,function(d,b){return b?d:"*"});return a},create:function(b,a){a=OpenLayers.Util.applyDefaults(a,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:b,requestType:"create"});d.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleCreate,d,a),headers:a.headers,data:this.format.write(b)});return d},handleCreate:function(b,a){this.handleResponse(b,a)},update:function(d,b){b=b||{};var a=b.url||d.url||this.options.url+"/"+d.fid;b=OpenLayers.Util.applyDefaults(b,this.options);var e=new OpenLayers.Protocol.Response({reqFeatures:d,requestType:"update"});e.priv=OpenLayers.Request.PUT({url:a,callback:this.createCallback(this.handleUpdate,e,b),headers:b.headers,data:this.format.write(d)});return e},handleUpdate:function(b,a){this.handleResponse(b,a)},"delete":function(d,b){b=b||{};var a=b.url||d.url||this.options.url+"/"+d.fid;b=OpenLayers.Util.applyDefaults(b,this.options);var e=new OpenLayers.Protocol.Response({reqFeatures:d,requestType:"delete"});e.priv=OpenLayers.Request.DELETE({url:a,callback:this.createCallback(this.handleDelete,e,b),headers:b.headers});return e},handleDelete:function(b,a){this.handleResponse(b,a)},handleResponse:function(d,a){var b=d.priv;if(a.callback){if(b.status>=200&&b.status<300){if(d.requestType!="delete"){d.features=this.parseFeatures(b)}d.code=OpenLayers.Protocol.Response.SUCCESS}else{d.code=OpenLayers.Protocol.Response.FAILURE}a.callback.call(a.scope,d)}},parseFeatures:function(a){var b=a.responseXML;if(!b||!b.documentElement){b=a.responseText}if(!b||b.length<=0){return null}return this.format.read(b)},commit:function(b,s){s=OpenLayers.Util.applyDefaults(s,this.options);var e=[],n=0;var l={};l[OpenLayers.State.INSERT]=[];l[OpenLayers.State.UPDATE]=[];l[OpenLayers.State.DELETE]=[];var q,m,d=[];for(var f=0,k=b.length;f<k;++f){q=b[f];m=l[q.state];if(m){m.push(q);d.push(q)}}var h=(l[OpenLayers.State.INSERT].length>0?1:0)+l[OpenLayers.State.UPDATE].length+l[OpenLayers.State.DELETE].length;var p=true;var a=new OpenLayers.Protocol.Response({reqFeatures:d});function j(u){var t=u.features?u.features.length:0;var w=new Array(t);for(var v=0;v<t;++v){w[v]=u.features[v].fid}a.insertIds=w;o.apply(this,[u])}function o(t){this.callUserCallback(t,s);p=p&&t.success();n++;if(n>=h){if(s.callback){a.code=p?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE;s.callback.apply(s.scope,[a])}}}var g=l[OpenLayers.State.INSERT];if(g.length>0){e.push(this.create(g,OpenLayers.Util.applyDefaults({callback:j,scope:this},s.create)))}g=l[OpenLayers.State.UPDATE];for(var f=g.length-1;f>=0;--f){e.push(this.update(g[f],OpenLayers.Util.applyDefaults({callback:o,scope:this},s.update)))}g=l[OpenLayers.State.DELETE];for(var f=g.length-1;f>=0;--f){e.push(this["delete"](g[f],OpenLayers.Util.applyDefaults({callback:o,scope:this},s["delete"])))}return e},abort:function(a){if(a){a.priv.abort()}},callUserCallback:function(d,a){var b=a[d.requestType];if(b&&b.callback){b.callback.call(b.scope,d)}},CLASS_NAME:"OpenLayers.Protocol.HTTP"});(function(){var a=OpenLayers.Protocol.HTTP.COMP_TYPE_TO_OP_STR={};a[OpenLayers.Filter.Comparison.EQUAL_TO]="eq";a[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne";a[OpenLayers.Filter.Comparison.LESS_THAN]="lt";a[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte";a[OpenLayers.Filter.Comparison.GREATER_THAN]="gt";a[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte";a[OpenLayers.Filter.Comparison.LIKE]="ilike"})();OpenLayers.Layer.GML=OpenLayers.Class(OpenLayers.Layer.Vector,{loaded:false,format:null,formatOptions:null,initialize:function(e,d,b){var a=[];a.push(e,b);OpenLayers.Layer.Vector.prototype.initialize.apply(this,a);this.url=d},setVisibility:function(a,b){OpenLayers.Layer.Vector.prototype.setVisibility.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},moveTo:function(d,a,b){OpenLayers.Layer.Vector.prototype.moveTo.apply(this,arguments);if(this.visibility&&!this.loaded){this.loadGML()}},loadGML:function(){if(!this.loaded){this.events.triggerEvent("loadstart");OpenLayers.Request.GET({url:this.url,success:this.requestSuccess,failure:this.requestFailure,scope:this});this.loaded=true}},setUrl:function(a){this.url=a;this.destroyFeatures();this.loaded=false;this.loadGML()},requestSuccess:function(d){var e=d.responseXML;if(!e||!e.documentElement){e=d.responseText}var a={};OpenLayers.Util.extend(a,this.formatOptions);if(this.map&&!this.projection.equals(this.map.getProjectionObject())){a.externalProjection=this.projection;a.internalProjection=this.map.getProjectionObject()}var b=this.format?new this.format(a):new OpenLayers.Format.GML(a);this.addFeatures(b.read(e));this.events.triggerEvent("loadend")},requestFailure:function(a){OpenLayers.Console.userError(OpenLayers.i18n("errorLoadingGML",{url:this.url}));this.events.triggerEvent("loadend")},CLASS_NAME:"OpenLayers.Layer.GML"});OpenLayers.Style=OpenLayers.Class({name:null,title:null,description:null,layerName:null,isDefault:false,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:false,propertyStyles:null,initialize:function(b,a){OpenLayers.Util.extend(this,a);this.rules=[];if(a&&a.rules){this.addRules(a.rules)}this.setDefaultStyle(b||OpenLayers.Feature.Vector.style["default"])},destroy:function(){for(var b=0,a=this.rules.length;b<a;b++){this.rules[b].destroy();this.rules[b]=null}this.rules=null;this.defaultStyle=null},createSymbolizer:function(l){var a=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),l);var k=this.rules;var j,b;var d=[];var g=false;for(var e=0,f=k.length;e<f;e++){j=k[e];var h=j.evaluate(l);if(h){if(j instanceof OpenLayers.Rule&&j.elseFilter){d.push(j)}else{g=true;this.applySymbolizer(j,a,l)}}}if(g==false&&d.length>0){g=true;for(var e=0,f=d.length;e<f;e++){this.applySymbolizer(d[e],a,l)}}if(k.length>0&&g==false){a.display="none"}return a},applySymbolizer:function(g,e,b){var a=b.geometry?this.getSymbolizerPrefix(b.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];var d=g.symbolizer[a]||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),b)},createLiterals:function(e,d){var b=OpenLayers.Util.extend({},d.attributes||d.data);OpenLayers.Util.extend(b,this.context);for(var a in this.propertyStyles){e[a]=OpenLayers.Style.createLiteral(e[a],b,d,a)}return e},findPropertyStyles:function(){var e={};var g=this.defaultStyle;this.addPropertyStyles(e,g);var j=this.rules;var f,h;for(var d=0,a=j.length;d<a;d++){f=j[d].symbolizer;for(var b in f){h=f[b];if(typeof h=="object"){this.addPropertyStyles(e,h)}else{this.addPropertyStyles(e,f);break}}}return e},addPropertyStyles:function(b,d){var e;for(var a in d){e=d[a];if(typeof e=="string"&&e.match(/\$\{\w+\}/)){b[a]=true}}return b},addRules:function(a){this.rules=this.rules.concat(a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(e){var d=OpenLayers.Style.SYMBOLIZER_PREFIXES;for(var b=0,a=d.length;b<a;b++){if(e.CLASS_NAME.indexOf(d[b])!=-1){return d[b]}}},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(e,b,a,d){if(typeof e=="string"&&e.indexOf("${")!=-1){e=OpenLayers.String.format(e,b,[a,d]);e=(isNaN(e)||!e)?e:parseFloat(e)}return e};OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text"];OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:true,initialize:function(d,a){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(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 b in d){if(d[b] instanceof OpenLayers.Style){this.styles[b]=d[b]}else{if(typeof d[b]=="object"){this.styles[b]=new OpenLayers.Style(d[b])}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,a)},destroy:function(){for(var a in this.styles){this.styles[a].destroy()}this.styles=null},createSymbolizer:function(b,d){if(!b){b=new OpenLayers.Feature.Vector()}if(!this.styles[d]){d="default"}b.renderIntent=d;var a={};if(this.extendDefault&&d!="default"){a=this.styles["default"].createSymbolizer(b)}return OpenLayers.Util.extend(a,this.styles[d].createSymbolizer(b))},addUniqueValueRules:function(b,e,g,a){var f=[];for(var d in g){f.push(new OpenLayers.Rule({symbolizer:g[d],context:a,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:e,value:d})}))}this.styles[b].addRules(f)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Rule=OpenLayers.Class({id:null,name:"default",title:null,description:null,context:null,filter:null,elseFilter:false,symbolizer:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer){this.symbolizer[a]=null}this.symbolizer=null},evaluate:function(d){var b=this.getContext(d);var a=true;if(this.minScaleDenominator||this.maxScaleDenominator){var e=d.layer.map.getScale()}if(this.minScaleDenominator){a=e>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b)}if(a&&this.maxScaleDenominator){a=e<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b)}if(a&&this.filter){if(this.filter.CLASS_NAME=="OpenLayers.Filter.FeatureId"){a=this.filter.evaluate(d)}else{a=this.filter.evaluate(b)}}return a},getContext:function(b){var a=this.context;if(!a){a=b.attributes||b.data}if(typeof this.context=="function"){a=this.context(b)}return a},clone:function(){var a=OpenLayers.Util.extend({},this);a.symbolizer={};for(var b in this.symbolizer){value=this.symbolizer[b];type=typeof value;if(type==="object"){a.symbolizer[b]=OpenLayers.Util.extend({},value)}else{if(type==="string"){a.symbolizer[b]=value}}}a.filter=this.filter&&this.filter.clone();a.context=this.context&&OpenLayers.Util.extend({},this.context);return new OpenLayers.Rule(a)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:false,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(a){OpenLayers.Console.userError(OpenLayers.i18n("readNotImplemented"))},write:function(a){OpenLayers.Console.userError(OpenLayers.i18n("writeNotImplemented"))},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:true,initialize:function(a){a=a||{};if(a.extractStyles!==false){a.defaultStyle={externalGraphic:OpenLayers.Util.getImagesLocation()+"marker.png",graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5}}OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(l){var a=l.split("\n");var b;var h=[];for(var w=0;w<(a.length-1);w++){var v=a[w].replace(/^\s*/,"").replace(/\s*$/,"");if(v.charAt(0)!="#"){if(!b){b=v.split("\t")}else{var n=v.split("\t");var e=new OpenLayers.Geometry.Point(0,0);var j={};var s=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null;var t,u,d,p;var m=false;for(var k=0;k<n.length;k++){if(n[k]){if(b[k]=="point"){var q=n[k].split(",");e.y=parseFloat(q[0]);e.x=parseFloat(q[1]);m=true}else{if(b[k]=="lat"){e.y=parseFloat(n[k]);m=true}else{if(b[k]=="lon"){e.x=parseFloat(n[k]);m=true}else{if(b[k]=="title"){j.title=n[k]}else{if(b[k]=="image"||b[k]=="icon"&&s){s.externalGraphic=n[k]}else{if(b[k]=="iconSize"&&s){var o=n[k].split(",");s.graphicWidth=parseFloat(o[0]);s.graphicHeight=parseFloat(o[1])}else{if(b[k]=="iconOffset"&&s){var g=n[k].split(",");s.graphicXOffset=parseFloat(g[0]);s.graphicYOffset=parseFloat(g[1])}else{if(b[k]=="description"){j.description=n[k]}else{if(b[k]=="overflow"){j.overflow=n[k]}else{j[b[k]]=n[k]}}}}}}}}}}}if(m){if(this.internalProjection&&this.externalProjection){e.transform(this.externalProjection,this.internalProjection)}var f=new OpenLayers.Feature.Vector(e,j,s);h.push(f)}}}}return h},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:"    ",space:" ",newline:"\n",level:0,pretty:false,initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(json,filter){try{if(/^[\],:{}\s]*$/.test(json.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){var object=eval("("+json+")");if(typeof filter==="function"){function walk(k,v){if(v&&typeof v==="object"){for(var i in v){if(v.hasOwnProperty(i)){v[i]=walk(i,v[i])}}}return filter(k,v)}object=walk("",object)}if(this.keepData){this.data=object}return object}}catch(e){}return null},write:function(f,d){this.pretty=!!d;var a=null;var b=typeof f;if(this.serialize[b]){try{a=this.serialize[b].apply(this,[f])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}}return a},writeIndent:function(){var b=[];if(this.pretty){for(var a=0;a<this.level;++a){b.push(this.indent)}}return b.join("")},writeNewline:function(){return(this.pretty)?this.newline:""},writeSpace:function(){return(this.pretty)?this.space:""},serialize:{object:function(d){if(d==null){return"null"}if(d.constructor==Date){return this.serialize.date.apply(this,[d])}if(d.constructor==Array){return this.serialize.array.apply(this,[d])}var g=["{"];this.level+=1;var e,b,f;var a=false;for(e in d){if(d.hasOwnProperty(e)){b=OpenLayers.Format.JSON.prototype.write.apply(this,[e,this.pretty]);f=OpenLayers.Format.JSON.prototype.write.apply(this,[d[e],this.pretty]);if(b!=null&&f!=null){if(a){g.push(",")}g.push(this.writeNewline(),this.writeIndent(),b,":",this.writeSpace(),f);a=true}}}this.level-=1;g.push(this.writeNewline(),this.writeIndent(),"}");return g.join("")},array:function(f){var d;var e=["["];this.level+=1;for(var b=0,a=f.length;b<a;++b){d=OpenLayers.Format.JSON.prototype.write.apply(this,[f[b],this.pretty]);if(d!=null){if(b>0){e.push(",")}e.push(this.writeNewline(),this.writeIndent(),d)}}this.level-=1;e.push(this.writeNewline(),this.writeIndent(),"]");return e.join("")},string:function(b){var a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};if(/["\\\x00-\x1f]/.test(b)){return'"'+b.replace(/([\x00-\x1f\\"])/g,function(e,d){var f=a[d];if(f){return f}f=d.charCodeAt();return"\\u00"+Math.floor(f/16).toString(16)+(f%16).toString(16)})+'"'}return'"'+b+'"'},number:function(a){return isFinite(a)?String(a):"null"},"boolean":function(a){return String(a)},date:function(a){function b(d){return(d<10)?"0"+d:d}return'"'+a.getFullYear()+"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:false,initialize:function(a){OpenLayers.Format.JSON.prototype.initialize.apply(this,[a])},read:function(k,h,a){h=(h)?h:"FeatureCollection";var e=null;var d=null;if(typeof k=="string"){d=OpenLayers.Format.JSON.prototype.read.apply(this,[k,a])}else{d=k}if(!d){OpenLayers.Console.error("Bad JSON: "+k)}else{if(typeof(d.type)!="string"){OpenLayers.Console.error("Bad GeoJSON - no type: "+k)}else{if(this.isValidType(d,h)){switch(h){case"Geometry":try{e=this.parseGeometry(d)}catch(b){OpenLayers.Console.error(b)}break;case"Feature":try{e=this.parseFeature(d);e.type="Feature"}catch(b){OpenLayers.Console.error(b)}break;case"FeatureCollection":e=[];switch(d.type){case"Feature":try{e.push(this.parseFeature(d))}catch(b){e=null;OpenLayers.Console.error(b)}break;case"FeatureCollection":for(var f=0,g=d.features.length;f<g;++f){try{e.push(this.parseFeature(d.features[f]))}catch(b){e=null;OpenLayers.Console.error(b)}}break;default:try{var j=this.parseGeometry(d);e.push(new OpenLayers.Feature.Vector(j))}catch(b){e=null;OpenLayers.Console.error(b)}}break}}}}return e},isValidType:function(d,a){var b=false;switch(a){case"Geometry":if(OpenLayers.Util.indexOf(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","Box","GeometryCollection"],d.type)==-1){OpenLayers.Console.error("Unsupported geometry type: "+d.type)}else{b=true}break;case"FeatureCollection":b=true;break;default:if(d.type==a){b=true}else{OpenLayers.Console.error("Cannot convert types from "+d.type+" to "+a)}}return b},parseFeature:function(e){var b,g,a,f;a=(e.properties)?e.properties:{};f=(e.geometry&&e.geometry.bbox)||e.bbox;try{g=this.parseGeometry(e.geometry)}catch(d){throw d}b=new OpenLayers.Feature.Vector(g,a);if(f){b.bounds=OpenLayers.Bounds.fromArray(f)}if(e.id){b.fid=e.id}return b},parseGeometry:function(f){if(f==null){return null}var h,g=false;if(f.type=="GeometryCollection"){if(!(f.geometries instanceof Array)){throw"GeometryCollection must have geometries array: "+f}var b=f.geometries.length;var e=new Array(b);for(var a=0;a<b;++a){e[a]=this.parseGeometry.apply(this,[f.geometries[a]])}h=new OpenLayers.Geometry.Collection(e);g=true}else{if(!(f.coordinates instanceof Array)){throw"Geometry must have coordinates array: "+f}if(!this.parseCoords[f.type.toLowerCase()]){throw"Unsupported geometry type: "+f.type}try{h=this.parseCoords[f.type.toLowerCase()].apply(this,[f.coordinates])}catch(d){throw d}}if(this.internalProjection&&this.externalProjection&&!g){h.transform(this.externalProjection,this.internalProjection)}return h},parseCoords:{point:function(a){if(this.ignoreExtraDims==false&&a.length!=2){throw"Only 2D points are supported: "+a}return new OpenLayers.Geometry.Point(a[0],a[1])},multipoint:function(g){var d=[];var f=null;for(var b=0,a=g.length;b<a;++b){try{f=this.parseCoords.point.apply(this,[g[b]])}catch(e){throw e}d.push(f)}return new OpenLayers.Geometry.MultiPoint(d)},linestring:function(g){var d=[];var f=null;for(var b=0,a=g.length;b<a;++b){try{f=this.parseCoords.point.apply(this,[g[b]])}catch(e){throw e}d.push(f)}return new OpenLayers.Geometry.LineString(d)},multilinestring:function(g){var d=[];var b=null;for(var e=0,a=g.length;e<a;++e){try{b=this.parseCoords.linestring.apply(this,[g[e]])}catch(f){throw f}d.push(b)}return new OpenLayers.Geometry.MultiLineString(d)},polygon:function(h){var g=[];var f,b;for(var d=0,a=h.length;d<a;++d){try{b=this.parseCoords.linestring.apply(this,[h[d]])}catch(e){throw e}f=new OpenLayers.Geometry.LinearRing(b.components);g.push(f)}return new OpenLayers.Geometry.Polygon(g)},multipolygon:function(g){var b=[];var f=null;for(var d=0,a=g.length;d<a;++d){try{f=this.parseCoords.polygon.apply(this,[g[d]])}catch(e){throw e}b.push(f)}return new OpenLayers.Geometry.MultiPolygon(b)},box:function(a){if(a.length!=2){throw"GeoJSON box coordinates must have 2 elements"}return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a[0][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[0][1])])])}},write:function(f,e){var a={type:null};if(f instanceof Array){a.type="FeatureCollection";var h=f.length;a.features=new Array(h);for(var d=0;d<h;++d){var b=f[d];if(!b instanceof OpenLayers.Feature.Vector){var g="FeatureCollection only supports collections of features: "+b;throw g}a.features[d]=this.extract.feature.apply(this,[b])}}else{if(f.CLASS_NAME.indexOf("OpenLayers.Geometry")==0){a=this.extract.geometry.apply(this,[f])}else{if(f instanceof OpenLayers.Feature.Vector){a=this.extract.feature.apply(this,[f]);if(f.layer&&f.layer.projection){a.crs=this.createCRSObject(f)}}}}return OpenLayers.Format.JSON.prototype.write.apply(this,[a,e])},createCRSObject:function(b){var d=b.layer.projection.toString();var a={};if(d.match(/epsg:/i)){var e=parseInt(d.substring(d.indexOf(":")+1));if(e==4326){a={type:"OGC",properties:{urn:"urn:ogc:def:crs:OGC:1.3:CRS84"}}}else{a={type:"EPSG",properties:{code:e}}}}return a},extract:{feature:function(b){var a=this.extract.geometry.apply(this,[b.geometry]);return{type:"Feature",id:b.fid==null?b.id:b.fid,properties:b.attributes,geometry:a}},geometry:function(e){if(e==null){return null}if(this.internalProjection&&this.externalProjection){e=e.clone();e.transform(this.internalProjection,this.externalProjection)}var a=e.CLASS_NAME.split(".")[2];var d=this.extract[a.toLowerCase()].apply(this,[e]);var b;if(a=="Collection"){b={type:"GeometryCollection",geometries:d}}else{b={type:a,coordinates:d}}return b},point:function(a){return[a.x,a.y]},multipoint:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.point.apply(this,[d.components[b]]))}return e},linestring:function(b){var e=[];for(var d=0,a=b.components.length;d<a;++d){e.push(this.extract.point.apply(this,[b.components[d]]))}return e},multilinestring:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[d.components[b]]))}return e},polygon:function(d){var e=[];for(var b=0,a=d.components.length;b<a;++b){e.push(this.extract.linestring.apply(this,[d.components[b]]))}return e},multipolygon:function(e){var d=[];for(var b=0,a=e.components.length;b<a;++b){d.push(this.extract.polygon.apply(this,[e.components[b]]))}return d},collection:function(d){var a=d.components.length;var e=new Array(a);for(var b=0;b<a;++b){e[b]=this.extract.geometry.apply(this,[d.components[b]])}return e}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:false,click:true,clickout:true,toggle:false,clickTolerance:5,hover:false,box:false,maxFeatures:10,features:null,hoverFeature:null,handlerOptions:null,handlers:null,hoverResponse:null,filterType:OpenLayers.Filter.Spatial.BBOX,EVENT_TYPES:["featureselected","featuresselected","featureunselected","clickout","beforefeatureselected","beforefeaturesselected","hoverfeature","outfeature"],initialize:function(a){this.EVENT_TYPES=OpenLayers.Control.GetFeature.prototype.EVENT_TYPES.concat(OpenLayers.Control.prototype.EVENT_TYPES);a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.features={};this.handlers={};if(this.click){this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.selectSingle},this.handlerOptions.click||{})}if(this.box){this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"}))}if(this.hover){this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250}))}},activate:function(){if(!this.active){for(var a in this.handlers){this.handlers[a].activate()}}return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active){for(var a in this.handlers){this.handlers[a].deactivate()}}return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},selectSingle:function(a){OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");var b=this.pixelToBounds(a.xy);this.setModifiers(a);this.request(b,{single:true})},selectBox:function(a){var d;if(a instanceof OpenLayers.Bounds){var e=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.left,a.bottom));var b=this.map.getLonLatFromPixel(new OpenLayers.Pixel(a.right,a.top));d=new OpenLayers.Bounds(e.lon,e.lat,b.lon,b.lat)}else{if(this.click){return}d=this.pixelToBounds(a)}this.setModifiers(this.handlers.box.dragHandler.evt);this.request(d)},selectHover:function(a){var b=this.pixelToBounds(a.xy);this.request(b,{single:true,hover:true})},cancelHover:function(){if(this.hoverResponse){this.protocol.abort(this.hoverResponse);this.hoverResponse=null}},request:function(e,b){b=b||{};var d=new OpenLayers.Filter.Spatial({type:this.filterType,value:e});var a=this.protocol.read({maxFeatures:b.single==true?this.maxFeatures:undefined,filter:d,callback:function(f){if(f.success()){if(f.features.length){if(b.single==true){this.selectBestFeature(f.features,e.getCenterLonLat(),b)}else{this.select(f.features)}}else{if(b.hover){this.hoverSelect()}else{this.events.triggerEvent("clickout");if(this.clickout){this.unselectAll()}}}}OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});if(b.hover==true){this.hoverResponse=a}},selectBestFeature:function(b,a,k){k=k||{};if(b.length){var h=new OpenLayers.Geometry.Point(a.lon,a.lat);var j,e,f;var g=Number.MAX_VALUE;for(var d=0;d<b.length;++d){j=b[d];if(j.geometry){f=h.distanceTo(j.geometry,{edge:false});if(f<g){g=f;e=j;if(g==0){break}}}}if(k.hover==true){this.hoverSelect(e)}else{this.select(e||b)}}},setModifiers:function(a){this.modifiers={multiple:this.multiple||(this.multipleKey&&a[this.multipleKey]),toggle:this.toggle||(this.toggleKey&&a[this.toggleKey])}},select:function(f){if(!this.modifiers.multiple&&!this.modifiers.toggle){this.unselectAll()}if(!(f instanceof Array)){f=[f]}var b=this.events.triggerEvent("beforefeaturesselected",{features:f});if(b!==false){var g=[];var e;for(var d=0,a=f.length;d<a;++d){e=f[d];if(this.features[e.fid||e.id]){if(this.modifiers.toggle){this.unselect(this.features[e.fid||e.id])}}else{b=this.events.triggerEvent("beforefeatureselected",{feature:e});if(b!==false){this.features[e.fid||e.id]=e;g.push(e);this.events.triggerEvent("featureselected",{feature:e})}}}this.events.triggerEvent("featuresselected",{features:g})}},hoverSelect:function(a){var d=a?a.fid||a.id:null;var b=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;if(b&&b!=d){this.events.triggerEvent("outfeature",{feature:this.hoverFeature});this.hoverFeature=null}if(d&&d!=b){this.events.triggerEvent("hoverfeature",{feature:a});this.hoverFeature=a}},unselect:function(a){delete this.features[a.fid||a.id];this.events.triggerEvent("featureunselected",{feature:a})},unselectAll:function(){for(var a in this.features){this.unselect(this.features[a])}},setMap:function(b){for(var a in this.handlers){this.handlers[a].setMap(b)}OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(b){var f=b.add(-this.clickTolerance/2,this.clickTolerance/2);var a=b.add(this.clickTolerance/2,-this.clickTolerance/2);var d=this.map.getLonLatFromPixel(f);var e=this.map.getLonLatFromPixel(a);return new OpenLayers.Bounds(d.lon,d.lat,e.lon,e.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{slideFactor:50,initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,{slideFactor:this.slideFactor}),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,{slideFactor:this.slideFactor}),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,{slideFactor:this.slideFactor}),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,{slideFactor:this.slideFactor})])},CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,direction:null,type:OpenLayers.Control.TYPE_BUTTON,initialize:function(b,a){this.direction=b;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[a])},trigger:function(){switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0,this.slideFactor);break;case OpenLayers.Control.Pan.WEST:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(this.slideFactor,0);break}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.ZoomIn(),new OpenLayers.Control.ZoomToMaxExtent(),new OpenLayers.Control.ZoomOut()])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){if(!OpenLayers.Lang.code){OpenLayers.Lang.setCode()}return OpenLayers.Lang.code},setCode:function(b){var e;if(!b){b=(OpenLayers.Util.getBrowserName()=="msie")?navigator.userLanguage:navigator.language}var d=b.split("-");d[0]=d[0].toLowerCase();if(typeof OpenLayers.Lang[d[0]]=="object"){e=d[0]}if(d[1]){var a=d[0]+"-"+d[1].toUpperCase();if(typeof OpenLayers.Lang[a]=="object"){e=a}}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(b,a){var e=OpenLayers.Lang[OpenLayers.Lang.getCode()];var d=e[b];if(!d){d=b}if(a){d=OpenLayers.String.format(d,a)}return d}};OpenLayers.i18n=OpenLayers.Lang.translate;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}",W:"W",E:"E",N:"N",S:"S",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."};aw=Class.create({eventRegistry:[],id:null,_destroy_fx:null,initialize:function(a){this.id=this.getId();this.eventRegistry=[];if(a){for(var b in a){this.registerEvent(b,a[b])}}},createCookie:function(b,e,g){var a="";if(g){var f=new Date();f.setTime(f.getTime()+(g*24*60*60*1000));a="; expires="+f.toGMTString()}document.cookie=""+b+"="+e+a+";path=/"},clearCookie:function(a){this.createCookie(a,"",-1)},derivesFrom:function(b){if(this.CLASS_NAME==b){return true}if(!this._superclass()){return false}var d=this._superclass();d=new d();if(d){var a=d.derivesFrom(b);d.destroy();d=null;return a}return false},destroy:function(){aw.EventManager.clearBySource(this);aw.EventManager.clearByTarget(this)},getId:function(a){var b=new Date();return(a||"aw")+"_"+b.getHours()+""+b.getMinutes()+""+b.getSeconds()+""+b.getMilliseconds()+""+Math.round(Math.random()*10000)},readCookie:function(a,l){var k=document.cookie.split(";");var d=null,b=null,h=null,j=null,f=null,g=[];for(var e=0;b=k[e];e++){while(b.charAt(0)==" "){b=b.substring(1,b.length)}h=b.split("=");j=h.shift();f=h.join("=");if((j)&&(!j.toLowerCase().match("__ut"))){d=new RegExp("^"+a.replace(/\./ig,"\\.").replace(/\*/ig,".*")+"$","ig");if(d.test(j)){g.push({name:j,value:f})}}}if((g.length==1)&&(l!==true)){return g[0].value}else{if(g.length>0){return g}else{return null}}},registerEvent:function(a,h,d){var g=null,f=this.EVENTS,a=a.toLowerCase();for(var b=f.length;b--;){g=f[b];if(g.toLowerCase()==a){aw.EventManager.register(this,a,h,d);return true}}return false},triggerEvent:function(){if((arguments)&&(arguments.length>0)){var a=arguments[0];Array.prototype.unshift.call(arguments,this);aw.EventManager.trigger.apply(aw.EventManager,arguments)}},unregisterEvent:function(a,b){aw.EventManager.unregister(this,a,b)},_superclass:function(){return eval("("+this.CLASS_NAME+".superclass)")},EVENTS:[],CLASS_NAME:"aw"});var namespace={separator:".",create:function(a){return a.split(namespace.separator).inject(window,function(b,d){return b[d]=b[d]||{}})}};document.getURLParameters=function(a){a=a||window.location.href;var k="",d={},b=null;if(a.indexOf("?")>0){k=a.substring((a.indexOf("?")>0?a.indexOf("?")+1:0),(a.indexOf("#")>0?a.indexOf("#"):a.length))}var e=k.split(/[&;]/);for(var f=0;b=e[f];f++){var g=b.split("=");if(g[0]){var j=decodeURIComponent(g[0]);var h=decodeURIComponent(g[1]||"");if(d[j]){if(typeof(d[j])=="string"){d[j]=[d[j]]}d[j].push(h)}else{d[j]=h}}}return d};Array.prototype.sortNum=function(){return this.sort(function(e,d){return e-d})};Array.prototype.sortBy=function(b,a){this.sort(function(g,f){var e,d;if(g&&f&&typeof g==="object"&&typeof f==="object"){e=(g[b].toLowerCase)?g[b].toLowerCase():g[b];d=(f[b].toLowerCase)?f[b].toLowerCase():f[b];if(e===d){return typeof a==="function"?a(g,f):0}if(typeof e===typeof d){return e<d?-1:1}return typeof e<typeof d?-1:1}else{throw {name:"Error",message:"Expected an Object when sorting by "+b}}})};Math.boundsIntersect=function(e,d,f){if(((!e)||(!d))||((e.l>=d.r)||(e.r<=d.l))||((e.t>=d.b)||(e.b<=d.t))){return false}if((!f)||(f===0)){return true}var b=Math.calculateArea(Math.findIntersection(e,d));if((b>=Math.calculateArea(e)*f)||(b>=Math.calculateArea(d)*f)){b=null;return true}b=null;return false};Math.findIntersection=function(b,a){if((!b)||(!a)){return null}return{t:((b.t>a.t)&&(b.t<a.b))?b.t:a.t,r:((b.r<a.r)&&(b.r>a.l))?b.r:a.r,b:((b.b<a.b)&&(b.b>a.t))?b.b:a.b,l:((b.l>a.l)&&(b.l<a.r))?b.l:a.l}};Math.calculateArea=function(a){if(!a){return 0}return((a.r-a.l)*(a.b-a.t))};Number.prototype.addCommas=function(){var f="";var g=this.toString();var a=g.split(".");var e=a[0];var b=a.length>1?"."+a[1]:"";var d=/(\d+)(\d{3})/;while(d.test(e)){e=e.replace(d,"$1,$2")}return e+b};Number.prototype.roundTo=function(a){return Math.round(this*Math.pow(10,a))/Math.pow(10,a)};String.prototype.parse=function(b,h){var d=this;b=b||",";h=(h===true?true:false);var g=false;var f=[];var k=0;while((k<d.length)&&(d.length>0)){var j=d.substr(k,1);if(j==b){if((h)||((!h)&&(!g))){var a=d.substr(0,k).replace(/^\s*|\s*$/gi,"");a=(h?a:a.replace(/^"|"$/gi,""));f.push(a);d=d.substring(k+1);k=0;continue}}if(j=='"'){g=!g;k++;continue}k++}if(d.length>0){d=d.replace(/^\s*|\s*$/gi,"");d=(h?d:d.replace(/^"|"$/gi,""));f.push(d)}return f};aw.base=Class.create(aw,{componentBus:null,_onAuthenticationSuccess_fx:null,_onAuthenticationFailure_fx:null,initialize:function(b,a){this._onAuthenticationSuccess_fx=null;this._onAuthenticationFailure_fx=null;aw.prototype.initialize.apply(this,[a]);this.componentBus=null;this.applyProperties(b)},applyProperties:function(d){if((this.VALID_PROPERTIES)&&(this.VALID_PROPERTIES.length>0)&&(d)){var b=null,e=null;for(var a=this.VALID_PROPERTIES.length;a--;){b=this.VALID_PROPERTIES[a];e=d[b];if(typeof e!=="undefined"){if(b.toLowerCase()=="componentbus"){e.registerComponent(this)}else{this[b]=e}}}}},clearComponentBus:function(){if((!arguments)||(!arguments.length>0)||(arguments[0]!==false)){if(this.componentBus){if(this._onAuthenticationFailure_fx){this.componentBus.unregisterEvent("onauthenticationfailure",this._onAuthenticationFailure_fx);this._onAuthenticationFailure_fx=null}if(this._onAuthenticationSuccess_fx){this.componentBus.unregisterEvent("onauthenticationsuccess",this._onAuthenticationSuccess_fx);this._onAuthenticationSuccess_fx=null}this.componentBus.unregisterComponent(this)}}this.componentBus=null},clearRecordStore:function(a){if(!this.componentBus){return}this.componentBus.clearRecordStore(a)},debug:function(){return{}},destroy:function(){this.clearComponentBus();aw.prototype.destroy.apply(this)},getCSSClassName:function(){return this.CLASS_NAME.replace(/\./gi,"_")},getRecordStore:function(a,b){if(!this.componentBus){return}this.componentBus.getRecordStore(a,b)},isSessionValidated:function(){return((this.componentBus)&&(this.componentBus.isSessionValidated))?this.componentBus.isSessionValidated():false},isValidating:function(){return((this.componentBus)&&(this.componentBus.isValidating))?this.componentBus.isValidating():false},onAuthenticationFailure:function(){},onAuthenticationSuccess:function(){},request:function(a,e,b,d){this._request(a,e,b,d,0)},setComponentBus:function(a){if(!a){return}this.componentBus=a;this._onAuthenticationSuccess_fx=this.onAuthenticationSuccess.bind(this);this._onAuthenticationFailure_fx=this.onAuthenticationFailure.bind(this);this.componentBus.registerEvent("onauthenticationfailure",this._onAuthenticationFailure_fx);this.componentBus.registerEvent("onauthenticationsuccess",this._onAuthenticationSuccess_fx)},setRecordStore:function(a){if(!this.componentBus){return}this.componentBus.setRecordStore(a)},_request:function(b,f,d,e,a){if(!this.componentBus){return}a=a||0;if(a>=40){throw"The component ["+this.CLASS_NAME+"] has not been registered with a valid aw.ComponentBus class."}if(this.componentBus.isValidating()===true){a++;this._request.bind(this,b,f,d,e,a).delay(0.5);return}d=d||this.componentBus._componentServer;this.componentBus.request(b,f,d,e)},CLASS_NAME:"aw.base",VALID_PROPERTIES:["componentBus"]});aw.AccountManager=Class.create(aw.base,{_hashEngine:null,initialize:function(b,a){aw.base.prototype.initialize.apply(this,[b,a]);this._hashEngine=new aw.Hash.SHA1()},addUsersToGroup:function(a,d,e){if((!a)||(!d)||(d.length<1)){return}d=(d instanceof Array)?d:[d];var b={cn:"SRC.Web.Client.Handler.GroupHandler",service:"addUsers",id:a,uid:d};this.request(b,function(p,h,g){if((!g)||(!g.payload)){return}var k,l=g.payload.length,j;var m=[],f=[];for(k=0;k<l;k++){j=g.payload[k];if(j.status=="success"){m.push(j.message)}else{if(j.status=="failure"){f.push(j.message)}}}var n=(f.length>0||m.length<1)?"failure":"success";if(p){p(n,m,f)}}.bind(this,e))},addWizardsToGroups:function(a,d,e){if((!a)||(!d)||(a.length<1)||(d.length<1)){return}a=(a instanceof Array)?a:[a];d=(d instanceof Array)?d:[d];var b={cn:"SRC.Web.Client.Handler.GroupHandler",service:"addWizards",id:a,wizard_guid:d};this.request(b,function(p,h,g){if((!g)||(!g.payload)){return}var k,l=g.payload.length,j;var m=[],f=[];for(k=0;k<l;k++){j=g.payload[k];if(j.status=="success"){m.push(j.message)}else{if(j.status=="failure"){f.push(((!j.message)||(j.message.length<1))?"An unknown error has occurred.":j.message)}}}var n=(f.length>0||m.length<1)?"failure":"success";if(p){p(n,m,f)}}.bind(this,e))},createAccount:function(a,b){if(!a){return}this._createUpdateAccount("createUserAccount",a,b)},createGroup:function(a,d){if(!a){return}var b={cn:"SRC.Web.Client.Handler.GroupHandler",service:"create",name:a};this.request(b,function(k,h,j){if((!j)||(!j.payload)){return}var g=j.payload,e=g.status,f=g.message;this.triggerEvent("oncreategroup"+e,f);if(typeof k=="function"){k(j.payload)}}.bind(this,d))},deleteGroup:function(a){if(!a){return}var b={cn:"SRC.Web.Client.Handler.GroupHandler",service:"delete",id:a};this.request(b,function(d,e){if((!e)||(!e.payload)){return}if(e.payload.status=="success"){this.triggerEvent("ongroupdeleted")}else{new aw.ui.Dialog.Error({title:"Error!",content:e.payload.message||"An unknown error has occurred."})}}.bind(this))},getActivationMessage:function(a,d){if((!a)||(!a.match("success|failure"))){return}var b={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:(a+"Message")};this.request(b,function(g,e,f){if((!f)||(!f.payload)){return}if(g){g(f.payload)}}.bind(this,d))},importDomainUser:function(d,f){if(!d||(!d.importAll&&(!d.sid||d.sid.length<1))){return}var b=d.importAll,a=d.sid;b=(typeof b=="boolean"&&b===true)?true:null;a=(!b)?a:null;var e={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:"importDomainUser",sid:a,importall:b};this.request(e,function(j,g,h){if(!h||!h.payload){return}if(typeof j=="function"){j(h.payload)}}.bind(this,f))},removeUsersFromGroup:function(a,d,e){if((!a)||(!d)||(d.length<1)){return}d=(d instanceof Array)?d:[d];var b={cn:"SRC.Web.Client.Handler.GroupHandler",service:"removeUsers",id:a,uid:d};this.request(b,function(p,h,g){if((!g)||(!g.payload)){return}var k,l=g.payload.length,j;var m=[],f=[];for(k=0;k<l;k++){j=g.payload[k];if(j.status=="success"){m.push(j.message)}else{if(j.status=="failure"){f.push(j.message)}}}var n=(f.length>0||m.length<1)?"failure":"success";if(p){p(n,m,f)}}.bind(this,e))},removeWizardsFromGroups:function(a,d,e){if((!a)||(!d)||(a.length<1)||(d.length<1)){return}a=(a instanceof Array)?a:[a];d=(d instanceof Array)?d:[d];var b={cn:"SRC.Web.Client.Handler.GroupHandler",service:"removeWizards",id:a,wizard_guid:d};this.request(b,function(p,h,g){if((!g)||(!g.payload)){return}var k,l=g.payload.length,j;var m=[],f=[];for(k=0;k<l;k++){j=g.payload[k];if(j.status=="success"){m.push(j.message)}else{if(j.status=="failure"){f.push(j.message)}}}var n=(f.length>0||m.length<1)?"failure":"success";if(p){p(n,m,f)}}.bind(this,e))},renameGroup:function(b,a,e){if((!b)||(!a)){return}var d={cn:"SRC.Web.Client.Handler.GroupHandler",service:"rename",id:b,name:a};this.request(d,function(h,f,g){if((!g)||(!g.payload)){return}if(g.payload.status=="success"){this.triggerEvent("ongrouprenamed")}if(typeof h=="function"){h(g.payload.status,g.payload.message)}}.bind(this,e))},resendActivationEmail:function(a,d){if(!a){return}var b={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:"resendactivationemail",email:a};this.request(b,function(g,e,f){if(!f||!f.payload){return}if(g){g(f.payload)}}.bind(this,d))},retrieveAccountInfo:function(){var a,d;if(arguments.length>1){d=arguments[0];a=arguments[1]}else{a=arguments[0]}var b={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:"accountManifest"};if(d){b.email=d}this.request(b,function(e,g,h){if((!h)||(!h.payload)){return}var f={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:"userManifest"};if(d){f.email=d}this.request(f,function(j,k,l,m){if((!m)||(!m.payload)){return}if(j){j(k.concat(m.payload))}}.bind(this,e,h.payload))}.bind(this,a))},retrieveAvailablePartNumbers:function(b){var a={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:"partnumbermanifest"};this.request(a,function(f,d,e){if((!e)||(!e.payload)){return}if(f){f(e.payload)}}.bind(this,b))},updateAccount:function(a,b){if((!a)||(this.isSessionValidated()!==true)){return}this._createUpdateAccount("updateUserAccount",a,b)},updateUserPermissions:function(b,e,a,f){if((!b)||(b.length<1)||((!e||e.length<1)&&(!a||a.length<1))){return}e=(e instanceof Array)?e:[e];a=(a instanceof Array)?a:[a];var d={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:"updateuserpermissions",userId:b,add:e,remove:a};this.request(d,function(q,j,h){if((!h)||(!h.payload)){return}var l,m=h.payload.length,k;var n=[],g=[];for(l=0;l<m;l++){k=h.payload[l];if(k.status=="success"){n.push(k.message)}else{if(k.status=="failure"){g.push(k.message)}}}var p=(g.length>0||n.length<1)?"failure":"success";if(q){q(p,n,g)}}.bind(this,f))},_createUpdateAccount:function(a,e,f){if((!a)||(!e)){return}var b={cn:"SRC.Web.Client.Handler.AccountManagementHandler",service:a};for(var d in e){if((d)&&((d.toLowerCase()=="password")||(d.toLowerCase()=="passwordconfirm"))){e[d]=this._hashEngine.toHex(e[d])}b[d]=e[d]}this.request(b,function(g,n,l,m){if((!m)||(!m.payload)){return}var k=m.payload;var j=k.errorMessage||false;var h=k.confirmationMessage||"";if(j){this.triggerEvent(((g=="createUserAccount")?"oncreateaccountfailure":"onupdateaccountfailure"),j);if(n){n("failure",j)}return}this.triggerEvent(((g=="createUserAccount")?"oncreateaccountsuccess":"onupdateaccountsuccess"),h);if(n){n("success",h,k.userId)}}.bind(this,a,f))},EVENTS:["oncreateaccountfailure","oncreateaccountsuccess","onupdateaccountfailure","onupdateaccountsuccess","oncreategroupsuccess","oncreategroupfailure","ongroupdeleted","ongrouprenamed"],CLASS_NAME:"aw.AccountManager"});aw.AnnotationManager=Class.create(aw.base,{activeAnnotationSet:null,annotationSets:[],defaultSet:{name:"Default Set",style:{fontFamily:"tahoma",fontSize:"16pt",fontWeight:"bold",fontColor:"003300",fontStyle:"italic",fontDecoration:"underline",mouseOver:false,icon:"aws:icon:server:Pushpin (Red).png"}},_onUserDataActionExecuted_fx:null,initialize:function(b,a){this.activeAnnotationSet=null;this.annotationSets=[];aw.base.prototype.initialize.apply(this,[b,a]);if(this.componentBus){this.componentBus.getComponentReferences("aw.UserDataManager",function(d){if((d)&&(d.length>0)){this._onUserDataActionExecuted_fx=this._onUserDataActionExecuted.bind(this);d[0].registerEvent("onactionexecuted",this._onUserDataActionExecuted_fx)}}.bind(this),false)}this._initializeAnnotationSets()},createAnnotation:function(j,a,g,h,d,b){if((!j)||(!j.name)||(!j.style)||(!a)||(!g)||(!h)){return}if((h>180)||(h<-180)||(g>90)||(g<-90)){return}var f={label:a,x:h,y:g,pointData:[{type:1,name:"some text",value:d}],style:b};var e=this.componentBus.getComponentReferences("aw.UserDataManager");if((!e)||(!e.length>0)){return}e=e[0];e.executeAction({action:"save",datatype:"AnnotationLayer",name:j.name,params:{style:Object.toJSON(j.style),type:"user",content:"["+Object.toJSON(f)+"]"}})},createAnnotationSet:function(a,b){if((!a)||(a==="")){return}var d=this.componentBus.getComponentReferences("aw.UserDataManager");if((!d)||(!d.length>0)){return}d=d[0];d.executeAction({action:"save",datatype:"AnnotationLayer",name:a,params:{style:Object.toJSON(b),type:"user",content:Object.toJSON([])}})},deleteAnnotation:function(b,a){if((!b)||(!b.name)||(!a)){return}new aw.ui.Dialog.Confirm({title:"Confirm Delete",content:"Are you certain you want to delete the selected annotation(s)? This action cannot be undone."},{onconfirm:this._deleteAnnotation.bind(this,b,a)})},destroy:function(){if(this.componentBus){var a=this.componentBus.getComponentReferences("aw.UserDataManager");if((a)&&(a.length>0)){a=a[0];if(this._onUserDataActionExecuted_fx){a.unregisterEvent("onactionexecuted",this._onUserDataActionExecuted_fx);this._onUserDataActionExecuted_fx=null}}a=null}aw.base.prototype.destroy.apply(this)},getAnnotationData:function(b,a,e){var d=this.componentBus.getComponentReferences("aw.UserDataManager");if((!d)||(!d.length>0)){return}d[0].retrieveData("AnnotationLayer",b,null,this._onAnnotationDataReceived.bind(this,e),{child:a.key})},getAnnotationsBySet:function(j,b,a,f,e,h){if((!j)||(!j.name)||(!b)||(!a)||(!f)||(!e)){return}var g={minx:parseFloat(b),miny:parseFloat(a),maxx:parseFloat(f),maxy:parseFloat(e)};var d=this.componentBus.getComponentReferences("aw.UserDataManager");if((!d)||(!d.length>0)){return}d[0].retrieveData("AnnotationLayer",j.name,null,this._onAnnotationsReceived.bind(this,j.name,h),g)},getAnnotationsBySetKey:function(d,b,a,f,e,g){this.getAnnotationsBySet(this.getAnnotationSetByKey(d),b,a,f,e,g)},getAnnotationsBySetName:function(d,b,a,f,e,g){this.getAnnotationsBySet(this.getAnnotationSetByName(d),b,a,f,e,g)},getAnnotationSetByKey:function(d){var e=this.annotationSets||[];if((!d)||(!e)||(!e.length>0)){return null}var b;var a=null;for(b=0;a=e[b];b++){if(a.key===d){return a}}return null},getAnnotationSetByName:function(b){var e=this.annotationSets||[];if((!b)||(!e)||(!e.length>0)){return null}var d;var a=null;for(d=0;a=e[d];d++){if(a.name==b){return a}}return null},moveAnnotation:function(f,a,d,e){if((!f)||(!a)||(!d)||(!e)){return}if((!f.name)||(!a.key)){return}if((e>180)||(e<-180)||(d>90)||(d<-90)){return}a.x=e;a.y=d;var b=this.componentBus.getComponentReferences("aw.UserDataManager");if((!b)||(!b.length>0)){return}b=b[0];b.executeAction({action:"save",datatype:"AnnotationLayer",name:f.name,params:{style:Object.toJSON(f.style),type:"user",content:"["+Object.toJSON(a)+"]"}})},onAuthenticationFailure:function(){aw.base.prototype.onAuthenticationFailure.apply(this);this._initializeAnnotationSets()},onAuthenticationSuccess:function(){aw.base.prototype.onAuthenticationSuccess.apply(this);this._initializeAnnotationSets()},setActiveAnnotationSet:function(a){if((!a)||(this.activeAnnotationSet===a)){return}this.activeAnnotationSet=a;this.triggerEvent("onactiveannotationsetchanged",a);if(this.isSessionValidated()===true){this.setRecordStore({key:"Maps.ActiveAnnotationSet",content:{name:a.name}})}this._retrieveAnnotationSetDetails(a)},setActiveAnnotationSetByKey:function(b){var a=this.getAnnotationSetByKey(b);if(!a){return false}this.setActiveAnnotationSet(a);return true},setActiveAnnotationSetByName:function(b){var a=this.getAnnotationSetByName(b);if(!a){return false}this.setActiveAnnotationSet(a);return true},updateAnnotation:function(j,a,b,g,h,f,d){if((!j)||(!a)||(!b)||(!g)||(!h)){return}if((h>180)||(h<-180)||(g>90)||(g<-90)){return}a.label=b||a.label;a.x=h;a.y=g;a.pointData=[{key:f[0].key||"",type:1,name:"some text",value:f[0].value||""}];a.style=d;var e=this.componentBus.getComponentReferences("aw.UserDataManager");if((!e)||(!e.length>0)){return}e=e[0];e.executeAction({action:"save",datatype:"AnnotationLayer",name:j.name,params:{style:Object.toJSON(j.style),type:"user",content:"["+Object.toJSON(a)+"]"}})},updateAnnotationSet:function(d,a){if((!d)||(!d.name)){return}var b=this.componentBus.getComponentReferences("aw.UserDataManager");if((!b)||(!b.length>0)){return}b=b[0];b.executeAction({action:"save",datatype:"AnnotationLayer",name:d.name,params:{style:Object.toJSON(a),type:"user",content:Object.toJSON([])}})},_deleteAnnotation:function(d,b){if((!d)||(!d.name)||(!b)){return}var a=this.componentBus.getComponentReferences("aw.UserDataManager");if((!a)||(!a.length>0)){return}a=a[0];a.executeAction({action:"delete",datatype:"AnnotationLayer",name:d.name,params:{child:b}})},_getActiveAnnotationSet:function(){this.getRecordStore("Maps.ActiveAnnotationSet",function(b){var a;var e;var d=this.annotationSets;if((b)&&(b.length>0)){a=b[0];if(a.content){e=this.getAnnotationSetByName(a.content.name);if(!e&&d&&(d.length>0)){e=d[0]}this.setActiveAnnotationSet(e)}}else{if(!e&&d&&(d.length>0)){e=d[0]}this.setActiveAnnotationSet(e)}}.bind(this))},_initializeAnnotationSets:function(){this.annotationSets=[];this.activeAnnotationSet=null;this._retrieveAnnotationSets()},_onAnnotationDataReceived:function(e,b){if((!b)||(!b.length>0)){return}var a=b[0];var d=a.annotations;if((!d)||(d.length!==1)){return}if(e){e(d[0].data)}},_onAnnotationSetsReceived:function(a){if((!a)||(!a.length>0)){this.annotationSets=[this.defaultSet]}else{this.annotationSets=a}this.triggerEvent("onannotationsetschanged",this.annotationSets);if((!this.activeAnnotationSet)||(this.setActiveAnnotationSetByName(this.activeAnnotationSet.name)!==true)){this._getActiveAnnotationSet()}},_onAnnotationSetDetailsReceived:function(d,b){if((!b)||(!b.length>0)){return}var a=this.getAnnotationSetByName(d);var b=b[0];if(a){a.numberOfAnnotations=b.numberOfAnnotations;a.style=b.style}this.triggerEvent("onannotationsetdetailssreceived",a)},_onAnnotationsReceived:function(d,e,b){var a=this.getAnnotationSetByName(d);if((a)&&(b)&&(b.length>0)){a.annotations=b[0].annotations}if(e){e(a)}this.triggerEvent("onannotationsreceived",a)},_onUserDataActionExecuted:function(k){if(k.datatype!="AnnotationLayer"){return}switch(k.action){case"save":var a=k.name;var h=this.getAnnotationSetByName(a);if(h&&h.hasOwnProperty("key")){this._retrieveAnnotationSetDetails(h);this.triggerEvent("onannotationsetchanged",h)}else{this.activeAnnotationSet={name:a};this._retrieveAnnotationSets()}break;case"delete":var d;var b=this.annotationSets;var e=b.length;var a=k.name;var h=null;var f=[];var j=false;var g=null;if(b&&(e>0)){if(k.hasOwnProperty("params")&&k.params.hasOwnProperty("child")){h=this.getAnnotationSetByName(a);this.triggerEvent("onannotationsetchanged",h)}else{for(d=e;d--;){h=b[d];if(h.name!==a){f.push(h)}else{g=h;j=true}}if(j===true){if(f.length===0){f=[this.defaultSet]}this.annotationSets=f;this.triggerEvent("onannotationsetdeleted",g);if((this.activeAnnotationSet)&&(this.activeAnnotationSet.name===g.name)){this.setActiveAnnotationSet(this.annotationSets[0])}}}}break;case"rename":case"copy":this._initializeAnnotationSets();break;default:return}},_retrieveAnnotationSetDetails:function(a){if(!a){return}var b=this.componentBus.getComponentReferences("aw.UserDataManager");if((b)&&(b.length>0)){b[0].retrieveData("AnnotationLayer",a.name,null,this._onAnnotationSetDetailsReceived.bind(this,a.name))}},_retrieveAnnotationSets:function(){if(this.componentBus){var a=this.componentBus.getComponentReferences("aw.UserDataManager");if((a)&&(a.length>0)){a[0].retrieveData("AnnotationLayer",null,null,this._onAnnotationSetsReceived.bind(this));return}}this.triggerEvent("onannotationsetschanged",this.annotationSets)},EVENTS:["onannotationsreceived","onannotationsetschanged","onannotationsetdetailssreceived","onactiveannotationsetchanged","onannotationsetdeleted","onannotationsetchanged"],VALID_PROPERTIES:["componentBus"],CLASS_NAME:"aw.AnnotationManager"});aw.Color={hexToHSV:function(b){var a=aw.Color.hexToRGB.apply(this,[b]);return aw.Color.rgbToHSV.apply(this,a)},hexToRGB:function(e){if(!e||!e.match(/^#?[0-9a-f]{1,2}[0-9a-f]{1,2}[0-9a-f]{1,2}$/ig)){return null}e=e.replace(/#/ig,"");if((e.length!=3)&&(e.length!=6)){return null}var f=(e.length==3)?1:2;var d=[],a=null;for(var b=0;b<e.length;b=b+f){a=e.substring(b,b+f)+""+((f==1)?e.substring(b,b+f):"");d.push(parseInt(a,16))}return d},hsvToHex:function(e,d,a){var b=aw.Color.hsvToRGB.apply(this,[e,d,a]);return aw.Color.rgbToHex.apply(this,b)},hsvToRGB:function(k,w,o){var j,m,e,d,u,a,l,n;w/=100;o/=100;if(w===0){return[Math.round(o*255),Math.round(o*255),Math.round(o*255)]}k/=60;j=Math.floor(k);m=k-j;e=o*(1-w);d=o*(1-w*m);u=o*(1-w*(1-m));switch(j){case 0:a=o;l=u;n=e;break;case 1:a=d;l=o;n=e;break;case 2:a=e;l=o;n=u;break;case 3:a=e;l=d;n=o;break;case 4:a=u;l=e;n=o;break;default:a=o;l=e;n=d;break}return[Math.round(a*255),Math.round(l*255),Math.round(n*255)]},random:function(){var b=[];for(var a=0;a<3;a++){b.push(Math.floor(Math.random()*256))}return aw.Color.rgbToHex.apply(this,b)},rgbToHex:function(h,f,a){if(typeof h=="undefined"||typeof f=="undefined"||typeof a=="undefined"||(typeof h!="number")||(typeof f!="number")||(typeof a!="number")||(h<0||h>255)||(f<0||f>255)||(a<0||a>255)){throw new TypeError("RGB values must be a number between 0 and 255")}var e=[h||"0",f||"0",a||"0"];for(var d=0;d<e.length;d++){e[d]=parseInt(e[d],10).toString(16).toLowerCase();e[d]=(e[d].length===1)?("0"+e[d]):e[d]}return e.join("")},rgbToHSV:function(a,f,k){a=a/255;f=f/255;k=k/255;var h=Math.min(a,f,k);var m=Math.max(a,f,k);var n=m-h;var j=[0,0,m];if(n===0){j[0]=0;j[1]=0}else{j[1]=n/m;var e=(((m-a)/6)+(n/2))/n;var l=(((m-f)/6)+(n/2))/n;var d=(((m-k)/6)+(n/2))/n;if(a==m){j[0]=d-l}else{if(f==m){j[0]=(1/3)+e-d}else{if(k==m){j[0]=(2/3)+l-e}}}if(j[0]<0){j[0]+=1}if(j[0]>1){j[0]-=1}}j[0]=Math.floor(j[0]*360);j[1]=Math.floor(j[1]*100);j[2]=Math.floor(j[2]*100);return j},CLASS_NAME:"aw.Color"};aw.ComponentBus=Class.create(aw,{sessionLength:720,sessionWarningThreshold:1,_server:null,_serverMethod:null,_componentServer:null,_mapSourcePools:null,_authMethod:null,_callbackRegistry:[],_clearDebugTrackTimeout:null,_debugMode:false,_debugSequence:[38,38,40,40,37,39,37,39,66,65],_debugSequenceTrack:[],_jsonpBuffer:20,_jsonpRegistry:[],_hashEngine:null,_lang:null,_maxQueryLength:500,_appKey:null,_sessionKey:null,_isValidating:false,_userEmail:null,_userPassword:null,_userSalt:null,_user:null,_requestRegistry:[],_sessionTimeout:null,_onKeyDown_fx:null,initialize:function(f,e){aw.prototype.initialize.apply(this,[e]);this.sessionLength=720;this.sessionWarningThreshold=1;this.applyProperties(f);this._authMethod=null;this._callbackRegistry=[];if(!_awServer){throw"No _awServer parameter specified in client configuration file!"}if(!_awHTTPMethod){throw"No _awHTTPMethod specified in client configuration file!"}if(!_awComponentServer){throw"No _awComponentServer specified in client configuration file!"}if(!_awMapSourcePools){throw"No _awMapSourcePools specified in client configuration file!"}this._serverMethod=_awHTTPMethod;this._hashEngine=new aw.Hash.SHA1();this._lang=null;this._maxQueryLength=500;this._appKey=null;this._sessionKey=null;this._userEmail=null;this._userPassword=null;this._userSalt=null;this._user=null;this._requestRegistry=[];this._sessionTimeout=null;this._clearDebugTrackTimeout=null;this._debugMode=false;this._debugSequenceTrack=[];var h=window.location.href.replace(/^(http|https):\/\//gi,"").replace(/(:\d+\/|\/).*$/gi,"");this._server=new Template(_awServer).evaluate({servername:h});this._componentServer=new Template(_awComponentServer).evaluate({servername:h});if(window.location.href.match("https://")){this._server=this._server.replace(/http:\/\//gi,"https://");this._componentServer=this._componentServer.replace(/http:\/\//gi,"https://")}var g={};for(var d in _awMapSourcePools){if(_awMapSourcePools[d]){g[d]=[];if(_awMapSourcePools[d] instanceof Array){var a=null;for(var b=0;a=_awMapSourcePools[d][b];b++){g[d].push(new Template(a).evaluate({servername:h}))}}else{g[d].push(new Template(_awMapSourcePools[d]).evaluate({servername:h}))}}}this._mapSourcePools=g;this._sessionKey="";this._unloadUser(false,false);this._isValidating=false;new aw.RecordStore({componentBus:this});this._onKeyDown_fx=this._onKeyDown.bindAsEventListener(this);aw.EventManager.register(document,"keydown",this._onKeyDown_fx)},applyProperties:function(d){if((this.VALID_PROPERTIES)&&(this.VALID_PROPERTIES.length>0)&&(d)){var b=null;for(var a=0;b=this.VALID_PROPERTIES[a];a++){if(typeof d[b]!=="undefined"){if(b.toLowerCase()=="componentbus"){d[b].registerComponent(this)}else{this[b]=d[b]}}}}},clearRecordStore:function(b){var a=this.getComponentReferences("aw.RecordStore");if((a)&&(a.length>0)){a[0].clearRecordStore(b)}},destroy:function(){var b,a;if(_awComponentRegistry){a=_awComponentRegistry.length;for(b=a;b>0;b--){if(_awComponentRegistry[b-1].destroy){_awComponentRegistry[b-1].destroy()}_awComponentRegistry.splice(b-1,1)}_awComponentRegistry=[]}if(this._onKeyDown_fx){aw.EventManager.unregister(document,"keydown",this._onKeyDown_fx);this._onKeyDown_fx=null}},getApplicationKey:function(){return this._appKey||null},getAuthenticationMethod:function(){return this._authMethod},getComponentById:function(b){for(var a=0;c=_awComponentRegistry[a];a++){if(c.id===b){return c}}return null},getComponentReferences:function(d,g,e){var b=[];var f=null;e=(e===false)?false:true;for(var a=0;f=_awComponentRegistry[a];a++){if(f.CLASS_NAME.toLowerCase()==d.toLowerCase()){b.push(f)}}if(g){g(b);if((!b)||(!b.length>0)||(e===true)){this._callbackRegistry.push({id:this.getId(),type:"componentReference",classname:d,callback:g,maintain:e})}}return b},getComponentRegistry:function(){return _awComponentRegistry},getComponentServer:function(){return this._componentServer||null},getLang:function(a){if(!this._lang){return null}var b=this._lang[this.CLASS_NAME];if((b)&&(b[a])){return b[a]}
