var a,Prototype={Version:"1.6.1",Browser:function(){var d=navigator.userAgent,e=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!e,Opera:e,WebKit:d.indexOf("AppleWebKit/")>-1,Gecko:d.indexOf("Gecko")>-1&&d.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(d)}}(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:function(){var c=window.Element||window.HTMLElement;return !!(c&&c.prototype)}(),SpecificElementExtensions:function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var e=document.createElement("div"),g=document.createElement("form"),f=false;if(e.__proto__&&e.__proto__!==g.__proto__){f=true}return f}()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(c){return c}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={},Try={these:function(){for(var g,k=0,j=arguments.length;k<j;k++){var i=arguments[k];try{g=i();break}catch(h){}}return g}},Class=function(){function e(){}function g(){function d(){this.initialize.apply(this,arguments)}var c=null,b=$A(arguments);if(Object.isFunction(b[0])){c=b.shift()}Object.extend(d,Class.Methods);d.superclass=c;d.subclasses=[];if(c){e.prototype=c.prototype;d.prototype=new e;c.subclasses.push(d)}for(c=0;c<b.length;c++){d.addMethods(b[c])}if(!d.prototype.initialize){d.prototype.initialize=Prototype.emptyFunction}return d.prototype.constructor=d}function f(o){var n=this.superclass&&this.superclass.prototype,m=Object.keys(o);if(!Object.keys({toString:true}).length){o.toString!=Object.prototype.toString&&m.push("toString");o.valueOf!=Object.prototype.valueOf&&m.push("valueOf")}for(var d=0,i=m.length;d<i;d++){var b=m[d],k=o[b];if(n&&Object.isFunction(k)&&k.argumentNames().first()=="$super"){var c=k;k=function(h){return function(){return n[h].apply(this,arguments)}}(b).wrap(c);k.valueOf=c.valueOf.bind(c);k.toString=c.toString.bind(c)}this.prototype[b]=k}return this}return{create:g,Methods:{addMethods:f}}}();(function(){function B(d,b){for(var c in b){d[c]=b[c]}return d}function x(c){try{if(m(c)){return"undefined"}if(c===null){return"null"}return c.inspect?c.inspect():String(c)}catch(b){if(b instanceof RangeError){return"..."}throw b}}function w(e){switch(typeof e){case"undefined":case"function":case"unknown":return;case"boolean":return e.toString()}if(e===null){return"null"}if(e.toJSON){return e.toJSON()}if(!n(e)){var c=[];for(var d in e){var b=w(e[d]);m(b)||c.push(d.toJSON()+": "+b)}return"{"+c.join(", ")+"}"}}function t(b){return $H(b).toQueryString()}function s(b){return b&&b.toHTML?b.toHTML():String.interpret(b)}function q(d){var b=[];for(var c in d){b.push(c)}return b}function o(d){var b=[];for(var c in d){b.push(d[c])}return b}function p(b){return B({},b)}function n(b){return !!(b&&b.nodeType==1)}function i(b){return E.call(b)=="[object Array]"}function D(b){return b instanceof Hash}function F(b){return typeof b==="function"}function z(b){return E.call(b)=="[object String]"}function k(b){return E.call(b)=="[object Number]"}function m(b){return typeof b==="undefined"}var E=Object.prototype.toString;B(Object,{extend:B,inspect:x,toJSON:w,toQueryString:t,toHTML:s,keys:q,values:o,clone:p,isElement:n,isArray:i,isHash:D,isFunction:F,isString:z,isNumber:k,isUndefined:m})})();Object.extend(Function.prototype,function(){function u(c,e){for(var d=c.length,b=e.length;b--;){c[d+b]=e[b]}return c}function t(b,c){b=w.call(b,0);return u(b,c)}function s(){var b=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return b.length==1&&!b[0]?[]:b}function q(b){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var d=this,c=w.call(arguments,1);return function(){var e=t(c,arguments);return d.apply(b,e)}}function p(b){var d=this,c=w.call(arguments,1);return function(e){e=u([e||window.event],c);return d.apply(b,e)}}function o(){if(!arguments.length){return this}var b=this,c=w.call(arguments,0);return function(){var d=t(c,arguments);return b.apply(this,d)}}function m(b){var d=this,c=w.call(arguments,1);b*=1000;return window.setTimeout(function(){return d.apply(d,c)},b)}function n(){return this.delay.apply(this,u([0.01],arguments))}function k(b){var c=this;return function(){var d=u([c.bind(this)],arguments);return b.apply(this,d)}}function i(){if(this._methodized){return this._methodized}var b=this;return this._methodized=function(){var c=u([this],arguments);return b.apply(null,c)}}var w=Array.prototype.slice;return{argumentNames:s,bind:q,bindAsEventListener:p,curry:o,delay:m,defer:n,wrap:k,methodize:i}}());Date.prototype.toJSON=function(){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"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(c){return String(c).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(d,e){this.callback=d;this.frequency=e;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){clearInterval(this.timer);this.timer=null}},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(c){this.currentlyExecuting=false;throw c}}}});Object.extend(String,{interpret:function(c){return c==null?"":String(c)},specialChar:{"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,function(){function b(x){if(Object.isFunction(x)){return x}var B=new Template(x);return function(E){return B.evaluate(E)}}function c(x,B){var E="",F=this,K;B=b(B);if(Object.isString(x)){x=RegExp.escape(x)}if(!(x.length||x.source)){B=B("");return B+F.split("").join(B)+B}for(;F.length>0;){if(K=F.match(x)){E+=F.slice(0,K.index);E+=String.interpret(B(K));F=F.slice(K.index+K[0].length)}else{E+=F;F=""}}return E}function d(x,B,E){B=b(B);E=Object.isUndefined(E)?1:E;return this.gsub(x,function(F){if(--E<0){return F[0]}return B(F)})}function e(x,B){this.gsub(x,B);return String(this)}function f(x,B){x=x||30;B=Object.isUndefined(B)?"...":B;return this.length>x?this.slice(0,x-B.length)+B:String(this)}function g(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function j(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function h(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function l(){var x=new RegExp(Prototype.ScriptFragment,"img"),B=new RegExp(Prototype.ScriptFragment,"im");return(this.match(x)||[]).map(function(E){return(E.match(B)||["",""])[1]})}function r(){return this.extractScripts().map(function(x){return eval(x)})}function v(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function u(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function y(x){var B=this.strip().match(/([^?#]*)(#.*)?$/);if(!B){return{}}return B[1].split(x||"&").inject({},function(E,F){if((F=F.split("="))[0]){var K=decodeURIComponent(F.shift());F=F.length>1?F.join("="):F[0];if(F!=undefined){F=decodeURIComponent(F)}if(K in E){Object.isArray(E[K])||(E[K]=[E[K]]);E[K].push(F)}else{E[K]=F}}return E})}function C(){return this.split("")}function A(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function G(x){return x<1?"":(new Array(x+1)).join(this)}function o(){var x=this.split("-"),B=x.length;if(B==1){return x[0]}for(var E=this.charAt(0)=="-"?x[0].charAt(0).toUpperCase()+x[0].substring(1):x[0],F=1;F<B;F++){E+=x[F].charAt(0).toUpperCase()+x[F].substring(1)}return E}function t(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function p(){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 w(){return this.replace(/_/g,"-")}function q(x){var B=this.replace(/[\x00-\x1f\\]/g,function(E){if(E in String.specialChar){return String.specialChar[E]}return"\\u00"+E.charCodeAt().toPaddedString(2,16)});if(x){return'"'+B.replace(/"/g,'\\"')+'"'}return"'"+B.replace(/'/g,"\\'")+"'"}function s(){return this.inspect(true)}function n(x){return this.replace(x||Prototype.JSONFilter,"$1")}function i(){var x=this;if(x.blank()){return false}x=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/.test(x)}function k(x){var B=this.unfilterJSON();try{if(!x||B.isJSON()){return eval("("+B+")")}}catch(E){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function m(x){return this.indexOf(x)>-1}function z(x){return this.indexOf(x)===0}function D(x){var B=this.length-x.length;return B>=0&&this.lastIndexOf(x)===B}function H(){return this==""}function I(){return/^\s*$/.test(this)}function J(x,B){return(new Template(this,B)).evaluate(x)}return{gsub:c,sub:d,scan:e,truncate:f,strip:String.prototype.trim?String.prototype.trim:g,stripTags:j,stripScripts:h,extractScripts:l,evalScripts:r,escapeHTML:v,unescapeHTML:u,toQueryParams:y,parseQuery:y,toArray:C,succ:A,times:G,camelize:o,capitalize:t,underscore:p,dasherize:w,inspect:q,toJSON:s,unfilterJSON:n,isJSON:i,evalJSON:k,include:m,startsWith:z,endsWith:D,empty:H,blank:I,interpolate:J}}());var Template=Class.create({initialize:function(d,e){this.template=d.toString();this.pattern=e||Template.Pattern},evaluate:function(c){if(c&&Object.isFunction(c.toTemplateReplacements)){c=c.toTemplateReplacements()}return this.template.gsub(this.pattern,function(m){if(c==null){return m[1]+""}var l=m[1]||"";if(l=="\\"){return m[2]}var k=c,i=m[3],h=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;m=h.exec(i);if(m==null){return l}for(;m!=null;){var b=m[1].startsWith("[")?m[2].replace(/\\\\]/g,"]"):m[1];k=k[b];if(null==k||""==m[3]){break}i=i.substring("["==m[3]?m[1].length:m[0].length);m=h.exec(i)}return l+String.interpret(k)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={},Enumerable=function(){function S(e,d){var c=0;try{this._each(function(f){e.call(d,f,c++)})}catch(b){if(b!=$break){throw b}}return this}function R(g,d,c){var b=-g,f=[],e=this.toArray();if(g<1){return e}for(;(b+=g)<e.length;){f.push(e.slice(b,b+g))}return f.collect(d,c)}function Q(d,c){d=d||Prototype.K;var b=true;this.each(function(e,f){b=b&&!!d.call(c,e,f);if(!b){throw $break}});return b}function P(d,c){d=d||Prototype.K;var b=false;this.each(function(e,f){if(b=!!d.call(c,e,f)){throw $break}});return b}function O(d,c){d=d||Prototype.K;var b=[];this.each(function(e,f){b.push(d.call(c,e,f))});return b}function N(d,c){var b;this.each(function(e,f){if(d.call(c,e,f)){b=e;throw $break}});return b}function L(d,c){var b=[];this.each(function(e,f){d.call(c,e,f)&&b.push(e)});return b}function M(e,d,c){d=d||Prototype.K;var b=[];if(Object.isString(e)){e=new RegExp(RegExp.escape(e))}this.each(function(g,f){e.match(g)&&b.push(d.call(c,g,f))});return b}function K(c){if(Object.isFunction(this.indexOf)){if(this.indexOf(c)!=-1){return true}}var b=false;this.each(function(d){if(d==c){b=true;throw $break}});return b}function E(c,b){b=Object.isUndefined(b)?null:b;return this.eachSlice(c,function(d){for(;d.length<c;){d.push(b)}return d})}function n(d,c,b){this.each(function(e,f){d=c.call(b,d,e,f)});return d}function x(c){var b=$A(arguments).slice(1);return this.map(function(d){return d[c].apply(d,b)})}function i(d,c){d=d||Prototype.K;var b;this.each(function(e,f){e=d.call(c,e,f);if(b==null||e>=b){b=e}});return b}function D(d,c){d=d||Prototype.K;var b;this.each(function(e,f){e=d.call(c,e,f);if(b==null||e<b){b=e}});return b}function I(e,d){e=e||Prototype.K;var c=[],b=[];this.each(function(g,f){(e.call(d,g,f)?c:b).push(g)});return[c,b]}function m(c){var b=[];this.each(function(d){b.push(d[c])});return b}function J(d,c){var b=[];this.each(function(e,f){d.call(c,e,f)||b.push(e)});return b}function z(c,b){return this.map(function(e,d){return{value:e,criteria:c.call(b,e,d)}}).sort(function(e,d){e=e.criteria;d=d.criteria;return e<d?-1:e>d?1:0}).pluck("value")}function H(){return this.map()}function k(){var d=Prototype.K,c=$A(arguments);if(Object.isFunction(c.last())){d=c.pop()}var b=[this].concat(c).map($A);return this.map(function(e,f){return d(b.pluck(f))})}function F(){return this.toArray().length}function B(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:S,eachSlice:R,all:Q,every:Q,any:P,some:P,collect:O,map:O,detect:N,findAll:L,select:L,filter:L,grep:M,include:K,member:K,inGroupsOf:E,inject:n,invoke:x,max:i,min:D,partition:I,pluck:m,reject:J,sortBy:z,toArray:H,entries:H,zip:k,size:F,inspect:B,find:N}}();function $A(e){if(!e){return[]}if("toArray" in Object(e)){return e.toArray()}for(var g=e.length||0,f=new Array(g);g--;){f[g]=e[g]}return f}function $w(c){if(!Object.isString(c)){return[]}return(c=c.strip())?c.split(/\s+/):[]}Array.from=$A;(function(){function O(c){for(var b=0,d=this.length;b<d;b++){c(this[b])}}function N(){this.length=0;return this}function M(){return this[0]}function L(){return this[this.length-1]}function K(){return this.select(function(b){return b!=null})}function J(){return this.inject([],function(c,b){if(Object.isArray(b)){return c.concat(b.flatten())}c.push(b);return c})}function H(){var b=B.call(arguments,0);return this.select(function(c){return !b.include(c)})}function I(b){return(b!==false?this:this.toArray())._reverse()}function F(b){return this.inject([],function(d,e,c){if(0==c||(b?d.last()!=e:!d.include(e))){d.push(e)}return d})}function z(b){return this.uniq().findAll(function(c){return b.detect(function(d){return c===d})})}function n(){return B.call(this,0)}function q(){return this.length}function i(){return"["+this.map(Object.inspect).join(", ")+"]"}function x(){var b=[];this.each(function(c){c=Object.toJSON(c);Object.isUndefined(c)||b.push(c)});return"["+b.join(", ")+"]"}function D(c,b){b||(b=0);var d=this.length;if(b<0){b=d+b}for(;b<d;b++){if(this[b]===c){return b}}return -1}function m(c,b){b=isNaN(b)?this.length:(b<0?this.length+b:b)+1;c=this.slice(0,b).reverse().indexOf(c);return c<0?c:b-c-1}function E(){for(var f=B.call(this,0),e,g=0,d=arguments.length;g<d;g++){e=arguments[g];if(Object.isArray(e)&&!("callee" in e)){for(var c=0,b=e.length;c<b;c++){f.push(e[c])}}else{f.push(e)}}return f}var s=Array.prototype,B=s.slice,k=s.forEach;k||(k=O);Object.extend(s,Enumerable);if(!s._reverse){s._reverse=s.reverse}Object.extend(s,{_each:k,clear:N,first:M,last:L,compact:K,flatten:J,without:H,reverse:I,uniq:F,intersect:z,clone:n,toArray:n,size:q,inspect:i,toJSON:x});if(function(){return[].concat(arguments)[0][0]!==1}(1,2)){s.concat=E}if(!s.indexOf){s.indexOf=D}if(!s.lastIndexOf){s.lastIndexOf=m}})();function $H(c){return new Hash(c)}var Hash=Class.create(Enumerable,function(){function B(b){this._object=Object.isHash(b)?b.toObject():Object.clone(b)}function x(e){for(var c in this._object){var d=this._object[c],b=[c,d];b.key=c;b.value=d;e(b)}}function w(c,b){return this._object[c]=b}function t(b){if(this._object[b]!==Object.prototype[b]){return this._object[b]}}function s(c){var b=this._object[c];delete this._object[c];return b}function q(){return Object.clone(this._object)}function o(){return this.pluck("key")}function p(){return this.pluck("value")}function n(c){var b=this.detect(function(d){return d.value===c});return b&&b.key}function i(b){return this.clone().update(b)}function D(b){return(new Hash(b)).inject(this,function(c,d){c.set(d.key,d.value);return c})}function F(c,b){if(Object.isUndefined(b)){return c}return c+"="+encodeURIComponent(String.interpret(b))}function z(){return this.inject([],function(d,b){var c=encodeURIComponent(b.key);if((b=b.value)&&typeof b=="object"){if(Object.isArray(b)){return d.concat(b.map(F.curry(c)))}}else{d.push(F(c,b))}return d}).join("&")}function k(){return"#<Hash:{"+this.map(function(b){return b.map(Object.inspect).join(": ")}).join(", ")+"}>"}function m(){return Object.toJSON(this.toObject())}function E(){return new Hash(this)}return{initialize:B,_each:x,set:w,get:t,unset:s,toObject:q,toTemplateReplacements:q,keys:o,values:p,index:n,merge:i,update:D,toQueryString:z,inspect:k,toJSON:m,clone:E}}());Hash.from=$H;Object.extend(Number.prototype,function(){function s(){return this.toPaddedString(2,16)}function r(){return this+1}function q(c,b){$R(0,this,true).each(c,b);return this}function p(c,b){b=this.toString(b||10);return"0".times(c-b.length)+b}function o(){return isFinite(this)?this.toString():"null"}function n(){return Math.abs(this)}function k(){return Math.round(this)}function m(){return Math.ceil(this)}function i(){return Math.floor(this)}return{toColorPart:s,succ:r,times:q,toPaddedString:p,toJSON:o,abs:n,round:k,ceil:m,floor:i}}());function $R(e,g,f){return new ObjectRange(e,g,f)}var ObjectRange=Class.create(Enumerable,function(){function e(d,c,b){this.start=d;this.end=c;this.exclusive=b}function g(c){for(var b=this.start;this.include(b);){c(b);b=b.succ()}}function f(b){if(b<this.start){return false}if(this.exclusive){return b<this.end}return b<=this.end}return{initialize:e,_each:g,include:f}}()),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(c){this.responders._each(c)},register:function(c){this.include(c)||this.responders.push(c)},unregister:function(c){this.responders=this.responders.without(c)},dispatch:function(f,i,h,g){this.each(function(c){if(Object.isFunction(c[f])){try{c[f].apply(c,[i,h,g])}catch(b){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(c){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,c||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,e,b){$super(b);this.transport=Ajax.getTransport();this.request(e)},request:function(e){this.url=e;this.method=this.options.method;e=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){e._method=this.method;this.method="post"}this.parameters=e;if(e=Object.toQueryString(e)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+e}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){e+="&_="}}}try{var g=new Ajax.Response(this);this.options.onCreate&&this.options.onCreate(g);Ajax.Responders.dispatch("onCreate",this,g);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);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||e:null;this.transport.send(this.body);!this.options.asynchronous&&this.transport.overrideMimeType&&this.onStateChange()}catch(f){this.dispatchException(f)}},onStateChange:function(){var c=this.transport.readyState;c>1&&!(c==4&&this._complete)&&this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var g={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){g["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){g.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var k=this.options.requestHeaders;if(Object.isFunction(k.push)){for(var j=0,i=k.length;j<i;j+=2){g[k[j]]=k[j+1]}}else{$H(k).each(function(b){g[b.key]=b.value})}}for(var h in g){this.transport.setRequestHeader(h,g[h])}},success:function(){var c=this.getStatus();return !c||c>=200&&c<300},getStatus:function(){try{return this.transport.status||0}catch(c){return 0}},respondToReadyState:function(g){g=Ajax.Request.Events[g];var k=new Ajax.Response(this);if(g=="Complete"){try{this._complete=true;(this.options["on"+k.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(k,k.headerJSON)}catch(j){this.dispatchException(j)}var i=k.getHeader("Content-type");if(this.options.evalJS=="force"||this.options.evalJS&&this.isSameOrigin()&&i&&i.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)){this.evalResponse()}}try{(this.options["on"+g]||Prototype.emptyFunction)(k,k.headerJSON);Ajax.Responders.dispatch("on"+g,this,k,k.headerJSON)}catch(h){this.dispatchException(h)}if(g=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var c=this.url.match(/^\s*https?:\/\/[^\/]*/);return !c||c[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""})},getHeader:function(d){try{return this.transport.getResponseHeader(d)||null}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(b){this.dispatchException(b)}},dispatchException:function(c){(this.options.onException||Prototype.emptyFunction)(this,c);Ajax.Responders.dispatch("onException",this,c)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(d){this.request=d;d=this.transport=d.transport;var e=this.readyState=d.readyState;if(e>2&&!Prototype.Browser.IE||e==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(e==4){d=d.responseXML;this.responseXML=Object.isUndefined(d)?null:d;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(c){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(c){return null}},getResponseHeader:function(c){return this.transport.getResponseHeader(c)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var d=this.getHeader("X-JSON");if(!d){return null}d=decodeURIComponent(escape(d));try{return d.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(e){this.request.dispatchException(e)}},_getResponseJSON:function(){var d=this.request.options;if(!d.evalJSON||d.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json")||this.responseText.blank()){return null}try{return this.responseText.evalJSON(d.sanitizeJSON||!this.request.isSameOrigin())}catch(e){this.request.dispatchException(e)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,i,h,g){this.container={success:i.success||i,failure:i.failure||(i.success?null:i)};g=Object.clone(g);var b=g.onComplete;g.onComplete=function(d,c){this.updateContent(d.responseText);Object.isFunction(b)&&b(d,c)}.bind(this);$super(h,g)},updateContent:function(f){var i=this.container[this.success()?"success":"failure"],h=this.options;h.evalScripts||(f=f.stripScripts());if(i=$(i)){if(h.insertion){if(Object.isString(h.insertion)){var g={};g[h.insertion]=f;i.insert(g)}else{h.insertion(i,f)}}else{i.update(f)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,g,f,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=this.options.frequency||2;this.decay=this.options.decay||1;this.updater={};this.container=g;this.url=f;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(c){if(this.options.decay){this.decay=c.responseText==this.lastText?this.decay*this.options.decay:1;this.lastText=c.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 $(f){if(arguments.length>1){for(var i=0,h=[],g=arguments.length;i<g;i++){h.push($(arguments[i]))}return h}if(Object.isString(f)){f=document.getElementById(f)}return Element.extend(f)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,i){var h=[];f=document.evaluate(f,$(i)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);i=0;for(var g=f.snapshotLength;i<g;i++){h.push(Element.extend(f.snapshotItem(i)))}return h}}if(!window.Node){var Node={}}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(e){var g=function(){var d=document.createElement("form"),c=document.createElement("input"),b=document.documentElement;c.setAttribute("name","test");d.appendChild(c);b.appendChild(d);c=d.elements?typeof d.elements.test=="undefined":null;b.removeChild(d);return c}(),f=e.Element;e.Element=function(d,c){c=c||{};d=d.toLowerCase();var b=Element.cache;if(g&&c.name){d="<"+d+' name="'+c.name+'">';delete c.name;return Element.writeAttribute(document.createElement(d),c)}b[d]||(b[d]=Element.extend(document.createElement(d)));return Element.writeAttribute(b[d].cloneNode(false),c)};Object.extend(e.Element,f||{});if(f){e.Element.prototype=f.prototype}})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(c){return $(c).style.display!="none"},toggle:function(c){c=$(c);Element[Element.visible(c)?"hide":"show"](c);return c},hide:function(c){c=$(c);c.style.display="none";return c},show:function(c){c=$(c);c.style.display="";return c},remove:function(c){c=$(c);c.parentNode.removeChild(c);return c},update:function(){function f(d,c){d=$(d);if(c&&c.toElement){c=c.toElement()}if(Object.isElement(c)){return d.update().insert(c)}c=Object.toHTML(c);var b=d.tagName.toUpperCase();if(b==="SCRIPT"&&g){d.text=c;return d}if(i||h){if(b in Element._insertionTranslations.tags){for(;d.firstChild;){d.removeChild(d.firstChild)}Element._getContentFromAnonymousElement(b,c.stripScripts()).each(function(e){d.appendChild(e)})}else{d.innerHTML=c.stripScripts()}}else{d.innerHTML=c.stripScripts()}c.evalScripts.bind(c).defer();return d}var i=function(){var c=document.createElement("select"),b=true;c.innerHTML='<option value="test">test</option>';if(c.options&&c.options[0]){b=c.options[0].nodeName.toUpperCase()!=="OPTION"}return b}(),h=function(){try{var c=document.createElement("table");if(c&&c.tBodies){c.innerHTML="<tbody><tr><td>test</td></tr></tbody>";return typeof c.tBodies[0]=="undefined"}}catch(b){return true}}(),g=function(){var d=document.createElement("script"),c=false;try{d.appendChild(document.createTextNode(""));c=!d.firstChild||d.firstChild&&d.firstChild.nodeType!==3}catch(b){c=true}return c}();return f}(),replace:function(e,g){e=$(e);if(g&&g.toElement){g=g.toElement()}else{if(!Object.isElement(g)){g=Object.toHTML(g);var f=e.ownerDocument.createRange();f.selectNode(e);g.evalScripts.bind(g).defer();g=f.createContextualFragment(g.stripScripts())}}e.parentNode.replaceChild(g,e);return e},insert:function(h,m){h=$(h);if(Object.isString(m)||Object.isNumber(m)||Object.isElement(m)||m&&(m.toElement||m.toHTML)){m={bottom:m}}var l,k,j;for(var i in m){l=m[i];i=i.toLowerCase();k=Element._insertionTranslations[i];if(l&&l.toElement){l=l.toElement()}if(Object.isElement(l)){k(h,l)}else{l=Object.toHTML(l);j=(i=="before"||i=="after"?h.parentNode:h).tagName.toUpperCase();j=Element._getContentFromAnonymousElement(j,l.stripScripts());if(i=="top"||i=="after"){j.reverse()}j.each(k.curry(h));l.evalScripts.bind(l).defer()}}return h},wrap:function(e,g,f){e=$(e);if(Object.isElement(g)){$(g).writeAttribute(f||{})}else{g=Object.isString(g)?new Element(g,f):new Element("div",g)}e.parentNode&&e.parentNode.replaceChild(g,e);g.appendChild(e);return g},inspect:function(d){d=$(d);var e="<"+d.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(c){var b=c.first();c=c.last();if(b=(d[b]||"").toString()){e+=" "+c+"="+b.inspect(true)}});return e+">"},recursivelyCollect:function(e,g){e=$(e);for(var f=[];e=e[g];){e.nodeType==1&&f.push(Element.extend(e))}return f},ancestors:function(c){return Element.recursivelyCollect(c,"parentNode")},descendants:function(c){return Element.select(c,"*")},firstDescendant:function(c){for(c=$(c).firstChild;c&&c.nodeType!=1;){c=c.nextSibling}return $(c)},immediateDescendants:function(c){if(!(c=$(c).firstChild)){return[]}for(;c&&c.nodeType!=1;){c=c.nextSibling}if(c){return[c].concat($(c).nextSiblings())}return[]},previousSiblings:function(c){return Element.recursivelyCollect(c,"previousSibling")},nextSiblings:function(c){return Element.recursivelyCollect(c,"nextSibling")},siblings:function(c){c=$(c);return Element.previousSiblings(c).reverse().concat(Element.nextSiblings(c))},match:function(d,e){if(Object.isString(e)){e=new Selector(e)}return e.match($(d))},up:function(f,i,h){f=$(f);if(arguments.length==1){return $(f.parentNode)}var g=Element.ancestors(f);return Object.isNumber(i)?g[i]:Selector.findElement(g,i,h)},down:function(e,g,f){e=$(e);if(arguments.length==1){return Element.firstDescendant(e)}return Object.isNumber(g)?Element.descendants(e)[g]:Element.select(e,g)[f||0]},previous:function(f,i,h){f=$(f);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(f))}var g=Element.previousSiblings(f);return Object.isNumber(i)?g[i]:Selector.findElement(g,i,h)},next:function(f,i,h){f=$(f);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(f))}var g=Element.nextSiblings(f);return Object.isNumber(i)?g[i]:Selector.findElement(g,i,h)},select:function(d){var e=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(d,e)},adjacent:function(d){var e=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(d.parentNode,e).without(d)},identify:function(d){d=$(d);var e=Element.readAttribute(d,"id");if(e){return e}do{e="anonymous_element_"+Element.idCounter++}while($(e));Element.writeAttribute(d,"id",e);return e},readAttribute:function(e,g){e=$(e);if(Prototype.Browser.IE){var f=Element._attributeTranslations.read;if(f.values[g]){return f.values[g](e,g)}if(f.names[g]){g=f.names[g]}if(g.include(":")){return !e.attributes||!e.attributes[g]?null:e.attributes[g].value}}return e.getAttribute(g)},writeAttribute:function(h,m,l){h=$(h);var k={},j=Element._attributeTranslations.write;if(typeof m=="object"){k=m}else{k[m]=Object.isUndefined(l)?true:l}for(var i in k){m=j.names[i]||i;l=k[i];if(j.values[i]){m=j.values[i](h,l)}if(l===false||l===null){h.removeAttribute(m)}else{l===true?h.setAttribute(m,m):h.setAttribute(m,l)}}return h},getHeight:function(c){return Element.getDimensions(c).height},getWidth:function(c){return Element.getDimensions(c).width},classNames:function(c){return new Element.ClassNames(c)},hasClassName:function(d,e){if(d=$(d)){d=d.className;return d.length>0&&(d==e||(new RegExp("(^|\\s)"+e+"(\\s|$)")).test(d))}},addClassName:function(d,e){if(d=$(d)){Element.hasClassName(d,e)||(d.className+=(d.className?" ":"")+e);return d}},removeClassName:function(d,e){if(d=$(d)){d.className=d.className.replace(new RegExp("(^|\\s+)"+e+"(\\s+|$)")," ").strip();return d}},toggleClassName:function(d,e){if(d=$(d)){return Element[Element.hasClassName(d,e)?"removeClassName":"addClassName"](d,e)}},cleanWhitespace:function(e){e=$(e);for(var g=e.firstChild;g;){var f=g.nextSibling;g.nodeType==3&&!/\S/.test(g.nodeValue)&&e.removeChild(g);g=f}return e},empty:function(c){return $(c).innerHTML.blank()},descendantOf:function(d,e){d=$(d);e=$(e);if(d.compareDocumentPosition){return(d.compareDocumentPosition(e)&8)===8}if(e.contains){return e.contains(d)&&e!==d}for(;d=d.parentNode;){if(d==e){return true}}return false},scrollTo:function(d){d=$(d);var e=Element.cumulativeOffset(d);window.scrollTo(e[0],e[1]);return d},getStyle:function(e,g){e=$(e);g=g=="float"?"cssFloat":g.camelize();var f=e.style[g];if(!f||f=="auto"){f=(e=document.defaultView.getComputedStyle(e,null))?e[g]:null}if(g=="opacity"){return f?parseFloat(f):1}return f=="auto"?null:f},getOpacity:function(c){return $(c).getStyle("opacity")},setStyle:function(f,i){f=$(f);var h=f.style;if(Object.isString(i)){f.style.cssText+=";"+i;return i.include("opacity")?f.setOpacity(i.match(/opacity:\s*(\d?\.?\d*)/)[1]):f}for(var g in i){if(g=="opacity"){f.setOpacity(i[g])}else{h[g=="float"||g=="cssFloat"?Object.isUndefined(h.styleFloat)?"cssFloat":"styleFloat":g]=i[g]}}return f},setOpacity:function(d,e){d=$(d);d.style.opacity=e==1||e===""?"":e<0.00001?0:e;return d},getDimensions:function(h){h=$(h);var m=Element.getStyle(h,"display");if(m!="none"&&m!=null){return{width:h.offsetWidth,height:h.offsetHeight}}m=h.style;var l=m.visibility,k=m.position,j=m.display;m.visibility="hidden";if(k!="fixed"){m.position="absolute"}m.display="block";var i=h.clientWidth;h=h.clientHeight;m.display=j;m.position=k;m.visibility=l;return{width:i,height:h}},makePositioned:function(d){d=$(d);var e=Element.getStyle(d,"position");if(e=="static"||!e){d._madePositioned=true;d.style.position="relative";if(Prototype.Browser.Opera){d.style.top=0;d.style.left=0}}return d},undoPositioned:function(c){c=$(c);if(c._madePositioned){c._madePositioned=undefined;c.style.position=c.style.top=c.style.left=c.style.bottom=c.style.right=""}return c},makeClipping:function(c){c=$(c);if(c._overflow){return c}c._overflow=Element.getStyle(c,"overflow")||"auto";if(c._overflow!=="hidden"){c.style.overflow="hidden"}return c},undoClipping:function(c){c=$(c);if(!c._overflow){return c}c.style.overflow=c._overflow=="auto"?"":c._overflow;c._overflow=null;return c},cumulativeOffset:function(e){var g=0,f=0;do{g+=e.offsetTop||0;f+=e.offsetLeft||0;e=e.offsetParent}while(e);return Element._returnOffset(f,g)},positionedOffset:function(e){var g=0,f=0;do{g+=e.offsetTop||0;f+=e.offsetLeft||0;if(e=e.offsetParent){if(e.tagName.toUpperCase()=="BODY"){break}if(Element.getStyle(e,"position")!=="static"){break}}}while(e);return Element._returnOffset(f,g)},absolutize:function(g){g=$(g);if(Element.getStyle(g,"position")=="absolute"){return g}var k=Element.positionedOffset(g),j=k[1];k=k[0];var i=g.clientWidth,h=g.clientHeight;g._originalLeft=k-parseFloat(g.style.left||0);g._originalTop=j-parseFloat(g.style.top||0);g._originalWidth=g.style.width;g._originalHeight=g.style.height;g.style.position="absolute";g.style.top=j+"px";g.style.left=k+"px";g.style.width=i+"px";g.style.height=h+"px";return g},relativize:function(e){e=$(e);if(Element.getStyle(e,"position")=="relative"){return e}e.style.position="relative";var g=parseFloat(e.style.top||0)-(e._originalTop||0),f=parseFloat(e.style.left||0)-(e._originalLeft||0);e.style.top=g+"px";e.style.left=f+"px";e.style.height=e._originalHeight;e.style.width=e._originalWidth;return e},cumulativeScrollOffset:function(e){var g=0,f=0;do{g+=e.scrollTop||0;f+=e.scrollLeft||0;e=e.parentNode}while(e);return Element._returnOffset(f,g)},getOffsetParent:function(c){if(c.offsetParent){return $(c.offsetParent)}if(c==document.body){return $(c)}for(;(c=c.parentNode)&&c!=document.body;){if(Element.getStyle(c,"position")!="static"){return $(c)}}return $(document.body)},viewportOffset:function(f){var i=0,h=0,g=f;do{i+=g.offsetTop||0;h+=g.offsetLeft||0;if(g.offsetParent==document.body&&Element.getStyle(g,"position")=="absolute"){break}}while(g=g.offsetParent);g=f;do{if(!Prototype.Browser.Opera||g.tagName&&g.tagName.toUpperCase()=="BODY"){i-=g.scrollTop||0;h-=g.scrollLeft||0}}while(g=g.parentNode);return Element._returnOffset(h,i)},clonePosition:function(h,m,l){l=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},l||{});m=$(m);var k=Element.viewportOffset(m);h=$(h);var j=[0,0],i=null;if(Element.getStyle(h,"position")=="absolute"){i=Element.getOffsetParent(h);j=Element.viewportOffset(i)}if(i==document.body){j[0]-=document.body.offsetLeft;j[1]-=document.body.offsetTop}if(l.setLeft){h.style.left=k[0]-j[0]+l.offsetLeft+"px"}if(l.setTop){h.style.top=k[1]-j[1]+l.offsetTop+"px"}if(l.setWidth){h.style.width=m.offsetWidth+"px"}if(l.setHeight){h.style.height=m.offsetHeight+"px"}return h}};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(f,i,h){switch(h){case"left":case"top":case"right":case"bottom":if(f(i,"position")==="static"){return null}case"height":case"width":if(!Element.visible(i)){return null}var g=parseInt(f(i,h),10);if(g!==i["offset"+h.capitalize()]){return g+"px"}return(h==="height"?["border-top-width","padding-top","padding-bottom","border-bottom-width"]:["border-left-width","padding-left","padding-right","border-right-width"]).inject(g,function(c,b){b=f(i,b);return b===null?c:c-parseInt(b,10)})+"px";default:return f(i,h)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(e,g,f){if(f==="title"){return g.title}return e(g,f)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(e,g){g=$(g);var f=g.getStyle("position");if(f!=="static"){return e(g)}g.setStyle({position:"relative"});e=e(g);g.setStyle({position:f});return e});$w("positionedOffset viewportOffset").each(function(c){Element.Methods[c]=Element.Methods[c].wrap(function(i,h){h=$(h);var g=h.getStyle("position");if(g!=="static"){return i(h)}var b=h.getOffsetParent();b&&b.getStyle("position")==="fixed"&&b.setStyle({zoom:1});h.setStyle({position:"relative"});i=i(h);h.setStyle({position:g});return i})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(d,e){return d(e)});Element.Methods.getStyle=function(e,g){e=$(e);g=g=="float"||g=="cssFloat"?"styleFloat":g.camelize();var f=e.style[g];if(!f&&e.currentStyle){f=e.currentStyle[g]}if(g=="opacity"){if(f=(e.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(f[1]){return parseFloat(f[1])/100}}return 1}if(f=="auto"){if((g=="width"||g=="height")&&e.getStyle("display")!="none"){return e["offset"+g.capitalize()]+"px"}return null}return f};Element.Methods.setOpacity=function(g,k){function j(b){return b.replace(/alpha\([^\)]*\)/gi,"")}g=$(g);var i=g.currentStyle;if(i&&!i.hasLayout||!i&&g.style.zoom=="normal"){g.style.zoom=1}i=g.getStyle("filter");var h=g.style;if(k==1||k===""){(i=j(i))?(h.filter=i):h.removeAttribute("filter");return g}else{if(k<0.00001){k=0}}h.filter=j(i)+"alpha(opacity="+k*100+")";return g};Element._attributeTranslations=function(){var e="className",g="for",f=document.createElement("div");f.setAttribute(e,"x");if(f.className!=="x"){f.setAttribute("class","x");if(f.className==="x"){e="class"}}f=null;f=document.createElement("label");f.setAttribute(g,"x");if(f.htmlFor!=="x"){f.setAttribute("htmlFor","x");if(f.htmlFor==="x"){g="htmlFor"}}f=null;return{read:{names:{"class":e,className:e,"for":g,htmlFor:g},values:{_getAttr:function(c,b){return c.getAttribute(b)},_getAttr2:function(c,b){return c.getAttribute(b,2)},_getAttrNode:function(c,b){return(c=c.getAttributeNode(b))?c.value:""},_getEv:function(){var c=document.createElement("div");c.onclick=Prototype.emptyFunction;c=c.getAttribute("onclick");var b;if(String(c).indexOf("{")>-1){b=function(h,d){d=h.getAttribute(d);if(!d){return null}d=d.toString();d=d.split("{")[1];d=d.split("}")[0];return d.strip()}}else{if(c===""){b=function(h,d){d=h.getAttribute(d);if(!d){return null}return d.strip()}}}c=null;return b}(),_flag:function(c,b){return $(c).hasAttribute(b)?b:null},style:function(b){return b.style.cssText.toLowerCase()},title:function(b){return b.title}}}}}();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(d,e){d.checked=!!e},style:function(d,e){d.style.cssText=e?e:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(c){Element._attributeTranslations.write.names[c.toLowerCase()]=c;Element._attributeTranslations.has[c.toLowerCase()]=c});(function(c){Object.extend(c,{href:c._getAttr2,src:c._getAttr2,type:c._getAttr,action:c._getAttrNode,disabled:c._flag,checked:c._flag,readonly:c._flag,multiple:c._flag,onload:c._getEv,onunload:c._getEv,onclick:c._getEv,ondblclick:c._getEv,onmousedown:c._getEv,onmouseup:c._getEv,onmouseover:c._getEv,onmousemove:c._getEv,onmouseout:c._getEv,onfocus:c._getEv,onblur:c._getEv,onkeypress:c._getEv,onkeydown:c._getEv,onkeyup:c._getEv,onsubmit:c._getEv,onreset:c._getEv,onselect:c._getEv,onchange:c._getEv})})(Element._attributeTranslations.read.values);Prototype.BrowserFeatures.ElementExtensions&&function(){function c(i){i=i.getElementsByTagName("*");for(var h=[],g=0,b;b=i[g];g++){b.tagName!=="!"&&h.push(b)}return h}Element.Methods.down=function(g,f,b){g=$(g);if(arguments.length==1){return g.firstDescendant()}return Object.isNumber(f)?c(g)[f]:Element.select(g,f)[b||0]}}()}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(d,e){d=$(d);d.style.opacity=e==1?0.999999:e===""?"":e<0.00001?0:e;return d}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(f,i){f=$(f);f.style.opacity=i==1||i===""?"":i<0.00001?0:i;if(i==1){if(f.tagName.toUpperCase()=="IMG"&&f.width){f.width++;f.width--}else{try{var h=document.createTextNode(" ");f.appendChild(h);f.removeChild(h)}catch(g){}}}return f};Element.Methods.cumulativeOffset=function(e){var g=0,f=0;do{g+=e.offsetTop||0;f+=e.offsetLeft||0;if(e.offsetParent==document.body){if(Element.getStyle(e,"position")=="absolute"){break}}e=e.offsetParent}while(e);return Element._returnOffset(f,g)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(g,k){g=$(g);if(k&&k.toElement){k=k.toElement()}if(Object.isElement(k)){g.parentNode.replaceChild(k,g);return g}k=Object.toHTML(k);var j=g.parentNode,i=j.tagName.toUpperCase();if(Element._insertionTranslations.tags[i]){var h=g.next();i=Element._getContentFromAnonymousElement(i,k.stripScripts());j.removeChild(g);h?i.each(function(b){j.insertBefore(b,h)}):i.each(function(b){j.appendChild(b)})}else{g.outerHTML=k.stripScripts()}k.evalScripts.bind(k).defer();return g}}Element._returnOffset=function(e,g){var f=[e,g];f.left=e;f.top=g;return f};Element._getContentFromAnonymousElement=function(e,g){var f=new Element("div");if(e=Element._insertionTranslations.tags[e]){f.innerHTML=e[0]+g+e[1];e[2].times(function(){f=f.firstChild})}else{f.innerHTML=g}return $A(f.childNodes)};Element._insertionTranslations={before:function(d,e){d.parentNode.insertBefore(e,d)},top:function(d,e){d.insertBefore(e,d.firstChild)},bottom:function(d,e){d.appendChild(e)},after:function(d,e){d.parentNode.insertBefore(e,d.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 c=Element._insertionTranslations.tags;Object.extend(c,{THEAD:c.TBODY,TFOOT:c.TBODY,TH:c.TD})})();Element.Methods.Simulated={hasAttribute:function(d,e){e=Element._attributeTranslations.has[e]||e;d=$(d).getAttributeNode(e);return !!(d&&d.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(c){if(!Prototype.BrowserFeatures.ElementExtensions&&c.__proto__){window.HTMLElement={};window.HTMLElement.prototype=c.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}})(document.createElement("div"));Element.extend=function(){function g(d){if(typeof window.Element!="undefined"){var b=window.Element.prototype;if(b){var c="_"+(Math.random()+"").slice(2);d=document.createElement(d);b[c]="x";d=d[c]!=="x";delete b[c];return d}}return false}function k(e,c){for(var d in c){var b=c[d];if(Object.isFunction(b)&&!(d in e)){e[d]=b.methodize()}}}var j=g("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(j){return function(c){if(c&&typeof c._extendedByPrototype=="undefined"){var b=c.tagName;if(b&&/^(?:object|applet|embed)$/i.test(b)){k(c,Element.Methods);k(c,Element.Methods.Simulated);k(c,Element.Methods.ByTag[b.toUpperCase()])}}return c}}return Prototype.K}var i={},h=Element.Methods.ByTag;j=Object.extend(function(d){if(!d||typeof d._extendedByPrototype!="undefined"||d.nodeType!=1||d==window){return d}var b=Object.clone(i),c=d.tagName.toUpperCase();h[c]&&Object.extend(b,h[c]);k(d,b);d._extendedByPrototype=Prototype.emptyFunction;return d},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(i,Element.Methods);Object.extend(i,Element.Methods.Simulated)}}});j.refresh();return j}();Element.hasAttribute=function(d,e){if(d.hasAttribute){return d.hasAttribute(e)}return Element.Methods.Simulated.hasAttribute(d,e)};Element.addMethods=function(i){function q(b){b=b.toUpperCase();Element.Methods.ByTag[b]||(Element.Methods.ByTag[b]={});Object.extend(Element.Methods.ByTag[b],i)}function p(b,e,c){c=c||false;for(var d in b){var f=b[d];if(Object.isFunction(f)){if(!c||!(d in e)){e[d]=f.methodize()}}}}function o(b){var d,c={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(c[b]){d="HTML"+c[b]+"Element"}if(window[d]){return window[d]}d="HTML"+b+"Element";if(window[d]){return window[d]}d="HTML"+b.capitalize()+"Element";if(window[d]){return window[d]}b=document.createElement(b);return b.__proto__||b.constructor.prototype}var n=Prototype.BrowserFeatures,m=Element.Methods.ByTag;if(!i){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)})}if(arguments.length==2){var k=i;i=arguments[1]}if(k){Object.isArray(k)?k.each(q):q(k)}else{Object.extend(Element.Methods,i||{})}k=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(n.ElementExtensions){p(Element.Methods,k);p(Element.Methods.Simulated,k,true)}if(n.SpecificElementExtensions){for(var l in Element.Methods.ByTag){n=o(l);Object.isUndefined(n)||p(m[l],n.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;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(h){function o(){if(m.WebKit&&!l.evaluate){return document}if(m.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function n(b){k||(k=o());i[b]="client"+b;h["get"+b]=function(){return k[i[b]]};return h["get"+b]()}var m=Prototype.Browser,l=document,k,i={};h.getWidth=n.curry("Width");h.getHeight=n.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(c){if(c=$(c)){if(c===window){c=0}else{if(typeof c._prototypeUID==="undefined"){c._prototypeUID=[Element.Storage.UID++]}c=c._prototypeUID[0]}Element.Storage[c]||(Element.Storage[c]=$H());return Element.Storage[c]}},store:function(e,g,f){if(e=$(e)){arguments.length===2?Element.getStorage(e).update(g):Element.getStorage(e).set(g,f);return e}},retrieve:function(f,i,h){if(f=$(f)){f=Element.getStorage(f);var g=f.get(i);if(Object.isUndefined(g)){f.set(i,h);g=h}return g}},clone:function(e,g){if(e=$(e)){e=e.cloneNode(g);e._prototypeUID=void 0;if(g){g=Element.select(e,"*");for(var f=g.length;f--;){g[f]._prototypeUID=void 0}}return Element.extend(e)}}});var Selector=Class.create({initialize:function(c){this.expression=c.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:function(){var c=function(){var b=false;if(document.evaluate&&window.XPathResult){b=document.createElement("div");b.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";b=document.evaluate(".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']",b,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null).snapshotLength!==2}return b}();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var b=this.expression;if(Prototype.Browser.WebKit&&(b.include("-of-type")||b.include(":empty"))){return false}if(/(\[[\w-]*?:|:checked)/.test(b)){return false}if(c){return false}return true}}(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(c){return false}return true},compileMatcher:function(){var b=this.expression,c=Selector.patterns,d=Selector.criteria,e,f,g=c.length,j;if(Selector._cache[b]){this.matcher=Selector._cache[b]}else{for(this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];b&&e!=b&&/\S/.test(b);){e=b;for(var h=0;h<g;h++){f=c[h].re;j=c[h].name;if(f=b.match(f)){this.matcher.push(Object.isFunction(d[j])?d[j](f):(new Template(d[j])).evaluate(f));b=b.replace(f[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher}},compileXPathMatcher:function(){var i=this.expression,q=Selector.patterns,p=Selector.xpath,o,n,m=q.length,k;if(Selector._cache[i]){this.xpath=Selector._cache[i]}else{for(this.matcher=[".//*"];i&&o!=i&&/\S/.test(i);){o=i;for(var l=0;l<m;l++){k=q[l].name;if(n=i.match(q[l].re)){this.matcher.push(Object.isFunction(p[k])?p[k](n):(new Template(p[k])).evaluate(n));i=i.replace(n[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath}},findElements:function(f){f=f||document;var i=this.expression;switch(this.mode){case"selectorsAPI":if(f!==document){var h=f.id,g=$(f).identify();g=g.replace(/([\.:])/g,"\\$1");i="#"+g+" "+i}i=$A(f.querySelectorAll(i)).map(Element.extend);f.id=h;return i;case"xpath":return document._getElementsByXPath(this.xpath,f);default:return this.matcher(f)}},match:function(s){this.tokens=[];for(var r=this.expression,q=Selector.patterns,p=Selector.assertions,o,n,k=q.length,m;r&&o!==r&&/\S/.test(r);){o=r;for(var i=0;i<k;i++){n=q[i].re;m=q[i].name;if(n=r.match(n)){if(p[m]){this.tokens.push([m,Object.clone(n)]);r=r.replace(n[0],"")}else{return this.findElements(document).include(s)}}}}r=true;for(i=0;q=this.tokens[i];i++){m=q[0];q=q[1];if(!Selector.assertions[m](s,q)){r=false;break}}return r},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=function(){var d=document.createElement("div"),e=document.createElement("span");d.id="prototype_test_id";e.className="Test";d.appendChild(e);return d.querySelector("#prototype_test_id .test")!==null}()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(c){if(c[1]=="*"){return""}return"[local-name()='"+c[1].toLowerCase()+"' or local-name()='"+c[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(c){c[1]=c[1].toLowerCase();return(new Template("[@#{1}]")).evaluate(c)},attr:function(c){c[1]=c[1].toLowerCase();c[3]=c[5]||c[6];return(new Template(Selector.xpath.operators[c[2]])).evaluate(c)},pseudo:function(d){var e=Selector.xpath.pseudos[d[1]];if(!e){return""}if(Object.isFunction(e)){return e(d)}return(new Template(Selector.xpath.pseudos[d[1]])).evaluate(d)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(s){for(var r=s[6],q=Selector.patterns,p=Selector.xpath,o,n,k=q.length,m=[];r&&o!=r&&/\S/.test(r);){o=r;for(var i=0;i<k;i++){n=q[i].name;if(s=r.match(q[i].re)){n=Object.isFunction(p[n])?p[n](s):(new Template(p[n])).evaluate(s);m.push("("+n.substring(1,n.length-1)+")");r=r.replace(s[0],"");break}}}return"[not("+m.join(" and ")+")]"},"nth-child":function(c){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",c)},"nth-last-child":function(c){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",c)},"nth-of-type":function(c){return Selector.xpath.pseudos.nth("position() ",c)},"nth-last-of-type":function(c){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",c)},"first-of-type":function(c){c[6]="1";return Selector.xpath.pseudos["nth-of-type"](c)},"last-of-type":function(c){c[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](c)},"only-of-type":function(d){var e=Selector.xpath.pseudos;return e["first-of-type"](d)+e["last-of-type"](d)},nth:function(e,g){var f=g[6];if(f=="even"){f="2n+0"}if(f=="odd"){f="2n+1"}if(g=f.match(/^(\d+)$/)){return"["+e+"= "+g[1]+"]"}if(g=f.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1}f=g[1]?Number(g[1]):1;g=g[2]?Number(g[2]):0;return(new Template("[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]")).evaluate({fragment:e,a:f,b:g})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(c){c[3]=c[5]||c[6];return(new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;')).evaluate(c)},pseudo:function(c){if(c[6]){c[6]=c[6].replace(/"/g,'\\"')}return(new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;')).evaluate(c)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(d,e){return e[1].toUpperCase()==d.tagName.toUpperCase()},className:function(d,e){return Element.hasClassName(d,e[1])},id:function(d,e){return d.id===e[1]},attrPresence:function(d,e){return Element.hasAttribute(d,e[1])},attr:function(d,e){return(d=Element.readAttribute(d,e[1]))&&Selector.operators[e[2]](d,e[5]||e[6])}},handlers:{concat:function(f,i){for(var h=0,g;g=i[h];h++){f.push(g)}return f},mark:function(f){for(var i=Prototype.emptyFunction,h=0,g;g=f[h];h++){g._countedByPrototype=i}return f},unmark:function(){return function(){var d=document.createElement("div"),e=false;d._countedByPrototype="x";return e=d.getAttribute("_countedByPrototype")==="x"}()?function(e){for(var g=0,f;f=e[g];g++){f.removeAttribute("_countedByPrototype")}return e}:function(e){for(var g=0,f;f=e[g];g++){f._countedByPrototype=void 0}return e}}(),index:function(g,k,j){g._countedByPrototype=Prototype.emptyFunction;if(k){g=g.childNodes;k=g.length-1;for(var i=1;k>=0;k--){var h=g[k];if(h.nodeType==1&&(!j||h._countedByPrototype)){h.nodeIndex=i++}}}else{k=0;i=1;for(g=g.childNodes;h=g[k];k++){if(h.nodeType==1&&(!j||h._countedByPrototype)){h.nodeIndex=i++}}}},unique:function(g){if(g.length==0){return g}for(var k=[],j,i=0,h=g.length;i<h;i++){if(typeof(j=g[i])._countedByPrototype=="undefined"){j._countedByPrototype=Prototype.emptyFunction;k.push(Element.extend(j))}}return Selector.handlers.unmark(k)},descendant:function(g){for(var k=Selector.handlers,j=0,i=[],h;h=g[j];j++){k.concat(i,h.getElementsByTagName("*"))}return i},child:function(h){for(var m=0,l=[],k;k=h[m];m++){for(var j=0,i;i=k.childNodes[j];j++){i.nodeType==1&&i.tagName!="!"&&l.push(i)}}return l},adjacent:function(f){for(var i=0,h=[],g;g=f[i];i++){(g=this.nextElementSibling(g))&&h.push(g)}return h},laterSibling:function(g){for(var k=Selector.handlers,j=0,i=[],h;h=g[j];j++){k.concat(i,Element.nextSiblings(h))}return i},nextElementSibling:function(c){for(;c=c.nextSibling;){if(c.nodeType==1){return c}}return null},previousElementSibling:function(c){for(;c=c.previousSibling;){if(c.nodeType==1){return c}}return null},tagName:function(h,o,n,m){var l=n.toUpperCase(),k=[],i=Selector.handlers;if(h){if(m){if(m=="descendant"){for(o=0;m=h[o];o++){i.concat(k,m.getElementsByTagName(n))}return k}else{h=this[m](h)}if(n=="*"){return h}}for(o=0;m=h[o];o++){m.tagName.toUpperCase()===l&&k.push(m)}return k}else{return o.getElementsByTagName(n)}},id:function(i,q,p,o){var n=$(p),m=Selector.handlers;if(q==document){if(!n){return[]}if(!i){return[n]}}else{if(!q.sourceIndex||q.sourceIndex<1){i=q.getElementsByTagName("*");for(var k=0,l;l=i[k];k++){if(l.id===p){return[l]}}}}if(i){if(o){if(o=="child"){for(q=0;l=i[q];q++){if(n.parentNode==l){return[n]}}}else{if(o=="descendant"){for(q=0;l=i[q];q++){if(Element.descendantOf(n,l)){return[n]}}}else{if(o=="adjacent"){for(q=0;l=i[q];q++){if(Selector.handlers.previousElementSibling(n)==l){return[n]}}}else{i=m[o](i)}}}}for(q=0;l=i[q];q++){if(l==n){return[n]}}return[]}return n&&Element.descendantOf(n,q)?[n]:[]},className:function(f,i,h,g){if(f&&g){f=this[g](f)}return Selector.handlers.byClassName(f,i,h)},byClassName:function(h,o,n){h||(h=Selector.handlers.descendant([o]));o=" "+n+" ";for(var m=0,l=[],k,i;k=h[m];m++){i=k.className;if(i.length!=0){if(i==n||(" "+i+" ").include(o)){l.push(k)}}}return l},attrPresence:function(g,k,j,i){g||(g=k.getElementsByTagName("*"));if(g&&i){g=this[i](g)}k=[];i=0;for(var h;h=g[i];i++){Element.hasAttribute(h,j)&&k.push(h)}return k},attr:function(i,q,p,o,n,m){i||(i=q.getElementsByTagName("*"));if(i&&m){i=this[m](i)}q=Selector.operators[n];n=[];m=0;for(var k;k=i[m];m++){var l=Element.readAttribute(k,p);l!==null&&q(l,o)&&n.push(k)}return n},pseudo:function(g,k,j,i,h){if(g&&h){g=this[h](g)}g||(g=i.getElementsByTagName("*"));return Selector.pseudos[k](g,j,i)}},pseudos:{"first-child":function(f){for(var i=0,h=[],g;g=f[i];i++){Selector.handlers.previousElementSibling(g)||h.push(g)}return h},"last-child":function(f){for(var i=0,h=[],g;g=f[i];i++){Selector.handlers.nextElementSibling(g)||h.push(g)}return h},"only-child":function(g){for(var k=Selector.handlers,j=0,i=[],h;h=g[j];j++){!k.previousElementSibling(h)&&!k.nextElementSibling(h)&&i.push(h)}return i},"nth-child":function(e,g,f){return Selector.pseudos.nth(e,g,f)},"nth-last-child":function(e,g,f){return Selector.pseudos.nth(e,g,f,true)},"nth-of-type":function(e,g,f){return Selector.pseudos.nth(e,g,f,false,true)},"nth-last-of-type":function(e,g,f){return Selector.pseudos.nth(e,g,f,true,true)},"first-of-type":function(e,g,f){return Selector.pseudos.nth(e,"1",f,false,true)},"last-of-type":function(e,g,f){return Selector.pseudos.nth(e,"1",f,true,true)},"only-of-type":function(f,i,h){var g=Selector.pseudos;return g["last-of-type"](g["first-of-type"](f,i,h),i,h)},getIndices:function(e,g,f){if(e==0){return g>0?[g]:[]}return $R(1,f).inject([],function(c,b){0==(b-g)%e&&(b-g)/e>=0&&c.push(b);return c})},nth:function(s,r,q,p,o){if(s.length==0){return[]}if(r=="even"){r="2n+0"}if(r=="odd"){r="2n+1"}q=Selector.handlers;var n=[],k=[],m;q.mark(s);for(var i=0;m=s[i];i++){if(!m.parentNode._countedByPrototype){q.index(m.parentNode,p,o);k.push(m.parentNode)}}if(r.match(/^\d+$/)){r=Number(r);for(i=0;m=s[i];i++){m.nodeIndex==r&&n.push(m)}}else{if(m=r.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-"){m[1]=-1}i=m[1]?Number(m[1]):1;m=m[2]?Number(m[2]):0;r=Selector.pseudos.getIndices(i,m,s.length);i=0;for(p=r.length;m=s[i];i++){for(o=0;o<p;o++){m.nodeIndex==r[o]&&n.push(m)}}}}q.unmark(s);q.unmark(k);return n},empty:function(f){for(var i=0,h=[],g;g=f[i];i++){g.tagName=="!"||g.firstChild||h.push(g)}return h},not:function(h,m,l){var k=Selector.handlers;m=(new Selector(m)).findElements(l);k.mark(m);l=0;for(var j=[],i;i=h[l];l++){i._countedByPrototype||j.push(i)}k.unmark(m);return j},enabled:function(f){for(var i=0,h=[],g;g=f[i];i++){if(!g.disabled&&(!g.type||g.type!=="hidden")){h.push(g)}}return h},disabled:function(f){for(var i=0,h=[],g;g=f[i];i++){g.disabled&&h.push(g)}return h},checked:function(f){for(var i=0,h=[],g;g=f[i];i++){g.checked&&h.push(g)}return h}},operators:{"=":function(d,e){return d==e},"!=":function(d,e){return d!=e},"^=":function(d,e){return d==e||d&&d.startsWith(e)},"$=":function(d,e){return d==e||d&&d.endsWith(e)},"*=":function(d,e){return d==e||d&&d.include(e)},"~=":function(d,e){return(" "+d+" ").include(" "+e+" ")},"|=":function(d,e){return("-"+(d||"").toUpperCase()+"-").include("-"+(e||"").toUpperCase()+"-")}},split:function(d){var e=[];d.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(b){e.push(b[1].strip())});return e},matchElements:function(h,m){m=$$(m);var l=Selector.handlers;l.mark(m);for(var k=0,j=[],i;i=h[k];k++){i._countedByPrototype&&j.push(i)}l.unmark(m);return j},findElement:function(e,g,f){if(Object.isNumber(g)){f=g;g=false}return Selector.matchElements(e,g||"*")[f||0]},findChildElements:function(h,o){o=Selector.split(o.join(","));for(var n=[],m=Selector.handlers,l=0,k=o.length,i;l<k;l++){i=new Selector(o[l].strip());m.concat(n,i.findElements(h))}return k>1?m.unique(n):n}});Prototype.Browser.IE&&Object.extend(Selector.handlers,{concat:function(f,i){for(var h=0,g;g=i[h];h++){g.tagName!=="!"&&f.push(g)}return f}});function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(c){c=$(c);c.reset();return c},serializeElements:function(h,m){if(typeof m!="object"){m={hash:!!m}}else{if(Object.isUndefined(m.hash)){m.hash=true}}var l,k,j=false,i=m.submit;h=h.inject({},function(b,c){if(!c.disabled&&c.name){l=c.name;k=$(c).getValue();if(k!=null&&c.type!="file"&&(c.type!="submit"||!j&&i!==false&&(!i||l==i)&&(j=true))){if(l in b){Object.isArray(b[l])||(b[l]=[b[l]]);b[l].push(k)}else{b[l]=k}}}return b});return m.hash?h:Object.toQueryString(h)}};Form.Methods={serialize:function(d,e){return Form.serializeElements(Form.getElements(d),e)},getElements:function(g){g=$(g).getElementsByTagName("*");for(var k,j=[],i=Form.Element.Serializers,h=0;k=g[h];h++){j.push(k)}return j.inject([],function(c,b){i[b.tagName.toLowerCase()]&&c.push(Element.extend(b));return c})},getInputs:function(h,o,n){h=$(h);h=h.getElementsByTagName("input");if(!o&&!n){return $A(h).map(Element.extend)}for(var m=0,l=[],k=h.length;m<k;m++){var i=h[m];o&&i.type!=o||n&&i.name!=n||l.push(Element.extend(i))}return l},disable:function(c){c=$(c);Form.getElements(c).invoke("disable");return c},enable:function(c){c=$(c);Form.getElements(c).invoke("enable");return c},findFirstElement:function(d){d=$(d).getElements().findAll(function(b){return"hidden"!=b.type&&!b.disabled});var e=d.findAll(function(b){return b.hasAttribute("tabIndex")&&b.tabIndex>=0}).sortBy(function(b){return b.tabIndex}).first();return e?e:d.find(function(b){return/^(?:input|select|textarea)$/i.test(b.tagName)})},focusFirstElement:function(c){c=$(c);c.findFirstElement().activate();return c},request:function(f,i){f=$(f);i=Object.clone(i||{});var h=i.parameters,g=f.readAttribute("action")||"";if(g.blank()){g=window.location.href}i.parameters=f.serialize(true);if(h){if(Object.isString(h)){h=h.toQueryParams()}Object.extend(i.parameters,h)}if(f.hasAttribute("method")&&!i.method){i.method=f.method}return new Ajax.Request(g,i)}};Form.Element={focus:function(c){$(c).focus();return c},select:function(c){$(c).select();return c}};Form.Element.Methods={serialize:function(e){e=$(e);if(!e.disabled&&e.name){var g=e.getValue();if(g!=undefined){var f={};f[e.name]=g;return Object.toQueryString(f)}}return""},getValue:function(d){d=$(d);var e=d.tagName.toLowerCase();return Form.Element.Serializers[e](d)},setValue:function(e,g){e=$(e);var f=e.tagName.toLowerCase();Form.Element.Serializers[f](e,g);return e},clear:function(c){$(c).value="";return c},present:function(c){return $(c).value!=""},activate:function(d){d=$(d);try{d.focus();if(d.select&&(d.tagName.toLowerCase()!="input"||!/^(?:button|reset|submit)$/i.test(d.type))){d.select()}}catch(e){}return d},disable:function(c){c=$(c);c.disabled=true;return c},enable:function(c){c=$(c);c.disabled=false;return c}};var Field=Form.Element,$F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(d,e){switch(d.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(d,e);default:return Form.Element.Serializers.textarea(d,e)}},inputSelector:function(d,e){if(Object.isUndefined(e)){return d.checked?d.value:null}else{d.checked=!!e}},textarea:function(d,e){if(Object.isUndefined(e)){return d.value}else{d.value=e}},select:function(h,o){if(Object.isUndefined(o)){return this[h.type=="select-one"?"selectOne":"selectMany"](h)}else{for(var n,m,l=!Object.isArray(o),k=0,i=h.length;k<i;k++){n=h.options[k];m=this.optionValue(n);if(l){if(m==o){n.selected=true;return}}else{n.selected=o.include(m)}}}},selectOne:function(d){var e=d.selectedIndex;return e>=0?this.optionValue(d.options[e]):null},selectMany:function(g){var k,j=g.length;if(!j){return null}var i=0;for(k=[];i<j;i++){var h=g.options[i];h.selected&&k.push(this.optionValue(h))}return k},optionValue:function(c){return Element.extend(c).hasAttribute("value")?c.value:c.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,g,f,b){$super(b,f);this.element=$(g);this.lastValue=this.getValue()},execute:function(){var c=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(c)?this.lastValue!=c:String(this.lastValue)!=String(c)){this.callback(this.element,c);this.lastValue=c}}});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(d,e){this.element=$(d);this.callback=e;this.lastValue=this.getValue();this.element.tagName.toLowerCase()=="form"?this.registerFormCallbacks():this.registerCallback(this.element)},onElementEvent:function(){var c=this.getValue();if(this.lastValue!=c){this.callback(this.element,c);this.lastValue=c}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(c){if(c.type){switch(c.type.toLowerCase()){case"checkbox":case"radio":Event.observe(c,"click",this.onElementEvent.bind(this));break;default:Event.observe(c,"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(){function U(b){return B(b,0)}function T(b){return B(b,1)}function S(b){return B(b,2)}function R(d){d=J.extend(d);var c=d.target,b=d.type;if((d=d.currentTarget)&&d.tagName){if(b==="load"||b==="error"||b==="click"&&d.tagName.toLowerCase()==="input"&&d.type==="radio"){c=d}}if(c.nodeType==Node.TEXT_NODE){c=c.parentNode}return Element.extend(c)}function Q(c,b){c=J.element(c);if(!b){return c}c=[c].concat(c.ancestors());return Selector.findElement(c,b,0)}function P(b){return{x:N(b),y:O(b)}}function N(d){var c=document.documentElement,b=document.body||{scrollLeft:0};return d.pageX||d.clientX+(c.scrollLeft||b.scrollLeft)-(c.clientLeft||0)}function O(d){var c=document.documentElement,b=document.body||{scrollTop:0};return d.pageY||d.clientY+(c.scrollTop||b.scrollTop)-(c.clientTop||0)}function M(b){J.extend(b);b.preventDefault();b.stopPropagation();b.stopped=true}function F(e,c,b){var g=Element.retrieve(e,"prototype_event_registry");if(Object.isUndefined(g)){D.push(e);g=Element.retrieve(e,"prototype_event_registry",$H())}var f=g.get(c);if(Object.isUndefined(f)){f=[];g.set(c,f)}if(f.pluck("handler").include(b)){return false}var d;if(c.include(":")){d=function(h){if(Object.isUndefined(h.eventName)){return false}if(h.eventName!==c){return false}J.extend(h,e);b.call(e,h)}}else{if(!K&&(c==="mouseenter"||c==="mouseleave")){if(c==="mouseenter"||c==="mouseleave"){d=function(l){J.extend(l,e);for(var j=l.relatedTarget;j&&j!==e;){try{j=j.parentNode}catch(h){j=e}}j!==e&&b.call(e,l)}}}else{d=function(h){J.extend(h,e);b.call(e,h)}}}d.handler=b;f.push(d);return d}function x(){for(var c=0,b=D.length;c<b;c++){J.stopObserving(D[c]);D[c]=null}}function z(d,c,b){d=$(d);b=F(d,c,b);if(!b){return d}if(c.include(":")){if(d.addEventListener){d.addEventListener("dataavailable",b,false)}else{d.attachEvent("ondataavailable",b);d.attachEvent("onfilterchange",b)}}else{c=L(c);d.addEventListener?d.addEventListener(c,b,false):d.attachEvent("on"+c,b)}return d}function i(f,c,b){f=$(f);var h=Element.retrieve(f,"prototype_event_registry");if(Object.isUndefined(h)){return f}if(c&&!b){var g=h.get(c);if(Object.isUndefined(g)){return f}g.each(function(j){Element.stopObserving(f,c,j.handler)});return f}else{if(!c){h.each(function(l){var j=l.key;l.value.each(function(n){Element.stopObserving(f,j,n.handler)})});return f}}if(g=h.get(c)){var e=g.find(function(j){return j.handler===b});if(!e){return f}var d=L(c);if(c.include(":")){if(f.removeEventListener){f.removeEventListener("dataavailable",e,false)}else{f.detachEvent("ondataavailable",e);f.detachEvent("onfilterchange",e)}}else{f.removeEventListener?f.removeEventListener(d,e,false):f.detachEvent("on"+d,e)}h.set(c,g.without(e));return f}}function E(d,c,b,f){d=$(d);if(Object.isUndefined(f)){f=true}if(d==document&&document.createEvent&&!d.dispatchEvent){d=document.documentElement}var e;if(document.createEvent){e=document.createEvent("HTMLEvents");e.initEvent("dataavailable",true,true)}else{e=document.createEventObject();e.eventType=f?"ondataavailable":"onfilterchange"}e.eventName=c;e.memo=b||{};document.createEvent?d.dispatchEvent(e):d.fireEvent(e.eventType,e);return J.extend(e)}var J={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:{}},m=document.documentElement,K="onmouseenter" in m&&"onmouseleave" in m,B;if(Prototype.Browser.IE){var I={0:1,1:4,2:2};B=function(c,b){return c.button===I[b]}}else{B=Prototype.Browser.WebKit?function(c,b){switch(b){case 0:return c.which==1&&!c.metaKey;case 1:return c.which==1&&c.metaKey;default:return false}}:function(c,b){return c.which?c.which===b+1:c.button===b}}J.Methods={isLeftClick:U,isMiddleClick:T,isRightClick:S,element:R,findElement:Q,pointer:P,pointerX:N,pointerY:O,stop:M};var k=Object.keys(J.Methods).inject({},function(c,b){c[b]=J.Methods[b].methodize();return c});if(Prototype.Browser.IE){function H(b){switch(b.type){case"mouseover":b=b.fromElement;break;case"mouseout":b=b.toElement;break;default:return null}return Element.extend(b)}Object.extend(k,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});J.extend=function(d,c){if(!d){return false}if(d._extendedByPrototype){return d}d._extendedByPrototype=Prototype.emptyFunction;var b=J.pointer(d);Object.extend(d,{target:d.srcElement||c,relatedTarget:H(d),pageX:b.x,pageY:b.y});return Object.extend(d,k)}}else{J.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(J.prototype,k);J.extend=Prototype.K}var D=[];Prototype.Browser.IE&&window.attachEvent("onunload",x);Prototype.Browser.WebKit&&window.addEventListener("unload",Prototype.emptyFunction,false);var L=Prototype.K;K||(L=function(c){var b={mouseenter:"mouseover",mouseleave:"mouseout"};return c in b?b[c]:c});Object.extend(J,J.Methods);Object.extend(J,{fire:E,observe:z,stopObserving:i});Element.addMethods({fire:E,observe:z,stopObserving:i});Object.extend(document,{fire:E.methodize(),observe:z.methodize(),stopObserving:i.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,J)}else{window.Event=J}})();(function(){function f(){if(!document.loaded){g&&window.clearTimeout(g);document.loaded=true;document.fire("dom:loaded")}}function i(){if(document.readyState==="complete"){document.stopObserving("readystatechange",i);f()}}function h(){try{document.documentElement.doScroll("left")}catch(b){g=h.defer();return}f()}var g;if(document.addEventListener){document.addEventListener("DOMContentLoaded",f,false)}else{document.observe("readystatechange",i);if(window==top){g=h.defer()}}Event.observe(window,"load",f)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(d,e){return Element.insert(d,{before:e})},Top:function(d,e){return Element.insert(d,{top:e})},Bottom:function(d,e){return Element.insert(d,{bottom:e})},After:function(d,e){return Element.insert(d,{after:e})}},$continue=new Error('"throw $continue" is deprecated, use "return" instead'),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(e,g,f){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(e,g,f)}this.xcomp=g;this.ycomp=f;this.offset=Element.cumulativeOffset(e);return f>=this.offset[1]&&f<this.offset[1]+e.offsetHeight&&g>=this.offset[0]&&g<this.offset[0]+e.offsetWidth},withinIncludingScrolloffsets:function(f,i,h){var g=Element.cumulativeScrollOffset(f);this.xcomp=i+g[0]-this.deltaX;this.ycomp=h+g[1]-this.deltaY;this.offset=Element.cumulativeOffset(f);return this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+f.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+f.offsetWidth},overlap:function(d,e){if(!d){return 0}if(d=="vertical"){return(this.offset[1]+e.offsetHeight-this.ycomp)/e.offsetHeight}if(d=="horizontal"){return(this.offset[0]+e.offsetWidth-this.xcomp)/e.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(c){Position.prepare();return Element.absolutize(c)},relativize:function(c){Position.prepare();return Element.relativize(c)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(e,g,f){f=f||{};return Element.clonePosition(g,e,f)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(d){function e(b){return b.blank()?null:"[contains(concat(' ', @class, ' '), ' "+b+" ')]"}d.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,b){b=b.toString().strip();return(b=/\s/.test(b)?$w(b).map(e).join(""):e(b))?document._getElementsByXPath(".//*"+b,c):[]}:function(o,n){n=n.toString().strip();var m=[],k=/\s/.test(n)?$w(n):null;if(!k&&!n){return m}o=$(o).getElementsByTagName("*");n=" "+n+" ";for(var c=0,i,b;i=o[c];c++){if(i.className&&(b=" "+i.className+" ")&&(b.include(n)||k&&k.all(function(f){return !f.toString().blank()&&b.include(" "+f+" ")}))){m.push(Element.extend(i))}}return m};return function(c,b){return $(b||document.body).getElementsByClassName(c)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(c){this.element=$(c)},_each:function(c){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(c)},set:function(c){this.element.className=c},add:function(c){this.include(c)||this.set($A(this).concat(c).join(" "))},remove:function(c){this.include(c)&&this.set($A(this).without(c).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);function toggleDisp(){for(var d=0;d<arguments.length;d++){var e=$(arguments[d]);e.style.display=e.style.display=="none"?"block":"none"}}function toggleTab(h,m,l){if($("tabContent"+h).style.display=="none"){for(var k=1;k<=m;k++){if(l==null||l!=k){var j="tabHeader"+k,i=$(j);if(!i){i=$("tabHeaderActive");i.id=j}j="tabContent"+k;i=$(j);i.style.display!="none"&&toggleDisp(j)}}if(i=$("tabHeader"+h)){i.id="tabHeaderActive"}i.blur();i=$("tabContent"+h);i.style.marginTop="2px";toggleDisp("tabContent"+h)}}function LabeledMarker(d,e){this.opts_=e;this.labelText_=e.labelText||"";this.labelClass_=e.labelClass||"LabeledMarker_markerLabel";this.labelOffset_=e.labelOffset||new GSize(0,0);this.clickable_=e.clickable==false?false:true;this.title_=e.title||"";this.ownVisibility_=this.labelVisibility_=true;if(e.draggable){e.draggable=false}GMarker.apply(this,arguments)}LabeledMarker.prototype=new GMarker(new GLatLng(0,0));a=LabeledMarker.prototype;a.initialize=function(f){GMarker.prototype.initialize.apply(this,arguments);this.map_=f;this.div_=document.createElement("div");this.div_.className=this.labelClass_;this.div_.innerHTML=this.labelText_;this.div_.style.position="absolute";if(this.clickable_){this.div_.style.cursor="pointer"}this.div_.title=this.title_;this.ownVisibility_||this.hide();this.applyLabelVisibility_();f.getPane(G_MAP_MARKER_PANE).appendChild(this.div_);if(this.clickable_){for(var i=["click","dblclick","mousedown","mouseup","mouseover","mouseout"],h=0;h<i.length;h++){var g=i[h];GEvent.addDomListener(this.div_,g,GEvent.callback(GEvent,GEvent.trigger,this,g,this.getLatLng()))}}};a.redraw=function(){GMarker.prototype.redraw.apply(this,arguments);this.redrawLabel_()};a.redrawLabel_=function(){if(this.map_){var d=this.map_.fromLatLngToDivPixel(this.getLatLng()),e=GOverlay.getZIndex(this.getLatLng().lat());if(this.div_){this.div_.style.left=d.x+this.labelOffset_.width+"px";this.div_.style.top=d.y+this.labelOffset_.height+"px";this.div_.style.zIndex=e}}};a.remove=function(){GEvent.clearInstanceListeners(this.div_);if(this.div_.outerHTML){this.div_.outerHTML=""}this.div_.parentNode&&this.div_.parentNode.removeChild(this.div_);this.div_=null;GMarker.prototype.remove.apply(this,arguments)};a.copy=function(){var c=new LabeledMarker(this.getLatLng(),this.opts_);c.labelVisibility_=this.labelVisibility_;c.ownVisibility_=this.ownVisibility_;return c};a.show=function(){GMarker.prototype.show.apply(this,arguments);this.ownVisibility_=true;this.applyLabelVisibility_()};a.hide=function(){GMarker.prototype.hide.apply(this,arguments);this.ownVisibility_=false;this.applyLabelVisibility_()};a.setLabelVisibility=function(c){this.labelVisibility_=c;this.applyLabelVisibility_()};a.getLabelVisibility=function(){return this.labelVisibility_};a.applyLabelVisibility_=function(){if(this.div_){this.div_.style.display=!this.isHidden()&&this.labelVisibility_?"block":"none"}};a.setLabelText=function(c){this.labelText_=c;if(this.div_){this.div_.innerHTML=c}this.opts_.labelText=c};function MarkerClusterer(K,J,I){function H(){if(q.length!==0){var b=[];p=0;for(len=q.length;p<len;p++){F(q[p])?s.addMarker(q[p],true,null,null,true):b.push(q[p])}q=b}}function F(b){return D.getBounds().containsLatLng(b.getLatLng())}function E(d){for(var b=[],c=d.length-1;c>=0;--c){s.addMarker(d[c].marker,true,d[c].isAdded,b,true)}H()}var B=[],D=K,z=null,s=this,m=60,n=[53,56,66,78,90],i=[],q=[];n=null;var w=true;if(ClusterMarker_.instanceOfGOverlay!==true){n=ClusterMarker_.prototype;ClusterMarker_.prototype=new GOverlay;for(var k in n){ClusterMarker_.prototype[k]=n[k]}ClusterMarker_.instanceOfGOverlay=true}var x=function(d){var b=0;for(var c=d=d.length;c!==0;){c=parseInt(c/10,10);b++}c=this.getStyles().length;if(c<b){b=c}return{text:d,index:b}},p=0;for(p=1;p<=5;p++){i.push({url:iconUrl+"icones/cluster/cluster.png",height:65,width:66})}if(typeof I==="object"&&I!==null){if(typeof I.gridSize==="number"&&I.gridSize>0){m=I.gridSize}if(typeof I.maxZoom==="number"){z=I.maxZoom}if(typeof I.styles==="object"&&I.styles!==null&&I.styles.length!==0){i=I.styles}if(typeof I.calculator==="function"){x=I.calculator}if(typeof I.zoomOnClick==="boolean"){w=I.zoomOnClick}}this.setCalculator=function(b){x=b};this.getCalculator=function(){return GEvent.callback(this,x)};this.isZoomOnClick=function(){return w};this.getStyles=function(){return i};this.clearMarkers=function(){for(var c=0,b=B.length;c<b;c++){typeof B[c]!=="undefined"&&B[c]!==null&&B[c].clearMarkers()}B=[];q=[]};this.addMarker=function(h,c,g,f,j){if(j!==true){if(!F(h)){q.push(h);return}}g=g;f=f;j=D.fromLatLngToDivPixel(h.getLatLng());if(typeof g!=="boolean"){g=false}if(typeof f!=="object"||f===null){f=B}for(var e=null,d=f.length-1;d>=0;d--){e=f[d];var b=e.getCenter();if(b!==null){b=D.fromLatLngToDivPixel(b);if(j.x>=b.x-m&&j.x<=b.x+m&&j.y>=b.y-m&&j.y<=b.y+m){e.addMarker({isAdded:g,marker:h});c||e.redraw_();return}}}e=new Cluster(this,K);e.addMarker({isAdded:g,marker:h});c||e.redraw_();f.push(e);f!==B&&B.push(e)};this.removeMarker=function(d){for(var b=0,c=q.length;b<c;b++){if(d===q[b]){q.splice(b,1);return}}b=0;for(c=B.length;b<c;b++){if(B[b]&&B[b].removeMarker(d)){if(B[b].getTotalMarkers()==0){B[b].clearMarkers();B.splice(b,1)}else{B[b].redraw_()}return}}};this.redraw_=function(){for(var d=this.getClustersInViewport_(),b=0,c=d.length;b<c;b++){d[b].redraw_(true)}};this.getClustersInViewport_=function(){for(var e=[],b=D.getBounds(),d=0,c=B.length;d<c;d++){B[d].isInBounds(b)&&e.push(B[d])}return e};this.getNumMarkersInViewport=function(){for(var e=this.getClustersInViewport_(),b=0,d=0,c=e.length;d<c;d++){b+=e[d].getTotalMarkers()}return b};this.isClustered=function(e){for(var b=this.getClustersInViewport_(),d=0,c=b.length;d<c;d++){if(b[d].isClustered(e)){return true}}return false};this.getMaxZoom_=function(){return z};this.getMap_=function(){return D};this.getGridSize_=function(){return m};this.getTotalMarkers=function(){for(var d=0,b=0,c=B.length;b<c;b++){d+=B[b].getTotalMarkers()}return d};this.getTotalClusters=function(){return B.length};this.resetViewport=function(){for(var c=this.getClustersInViewport_(),j=[],b=0,l=0,d=c.length;l<d;l++){var g=c[l],f=g.getCurrentZoom();if(f!==null){if(D.getZoom()!==f){f=g.getMarkers();for(var e=0,h=f.length;e<h;++e){j.push({isAdded:false,marker:f[e].marker})}g.clearMarkers();b++;e=0;for(h=B.length;e<h;++e){g===B[e]&&B.splice(e,1)}}}}E(j);this.redraw_();GEvent.trigger(this,"regroup")};this.addMarkers=function(d){for(var b=0,c=d.length;b<c;b++){this.addMarker(d[b],true)}this.redraw_()};this.getParentCluster=function(b){return b.parentCluster_};typeof J==="object"&&J!==null&&this.addMarkers(J);n=GEvent.addListener(D,"moveend",function(){s.resetViewport()})}function Cluster(h){var o=null,n=[],m=h.getMap_(),l=null,k=m.getZoom(),i=this;this.getMarkers=function(){return n};this.getMarkerClusterer=function(){return h};this.isInBounds=function(e){if(o===null){return false}e||(e=m.getBounds());var b=m.fromLatLngToDivPixel(e.getSouthWest());e=m.fromLatLngToDivPixel(e.getNorthEast());var f=m.fromLatLngToDivPixel(o),c=true,d=h.getGridSize_();if(k!==m.getZoom()){var g=m.getZoom()-k;d=Math.pow(2,g)*d}if(e.x!==b.x&&(f.x+d<b.x||f.x-d>e.x)){c=false}if(c&&(f.y+d<e.y||f.y-d>b.y)){c=false}return c};this.getCenter=function(){return o};this.addMarker=function(b){if(o===null){o=b.marker.getLatLng()}b.marker.parentCluster_=i;n.push(b)};this.removeMarker=function(c){for(var b=0,d=n.length;b<d;b++){if(c===n[b].marker){n[b].isAdded&&m.removeOverlay(n[b].marker);delete n[b].marker.parentCluster_;n.splice(b,1);return true}}return false};this.isClustered=function(c){for(var b=0,d=n.length;b<d;b++){if(c===n[b].marker){return !n[b].isAdded}}return false};this.getCurrentZoom=function(){return k};this.redraw_=function(c){if(c||this.isInBounds()){k=m.getZoom();c=0;c=h.getMaxZoom_();if(c===null){c=m.getCurrentMapType().getMaximumResolution()}if(k>c||this.getTotalMarkers()===1){c=0;for(var b=n.length;c<b;c++){if(n[c].isAdded){n[c].marker.isHidden()&&n[c].marker.show()}else{m.addOverlay(n[c].marker);n[c].isAdded=true}}l!==null&&l.hide()}else{if(this.getTotalMarkers()>1){c=0;for(b=n.length;c<b;c++){n[c].isAdded&&!n[c].marker.isHidden()&&n[c].marker.hide()}c=h.getCalculator()(this.getRealMarkers());if(l===null){l=new ClusterMarker_(o,c,h.getStyles(),h.getGridSize_(),i);m.addOverlay(l)}else{l.isHidden()&&l.show();l.setSums(c);l.redraw(true)}}}}};this.clearMarkers=function(){l!==null&&m.removeOverlay(l);for(var c=0,b=n.length;c<b;c++){n[c].isAdded&&m.removeOverlay(n[c].marker);delete n[c].marker.parentCluster_}n=[]};this.getTotalMarkers=function(){return n.length};this.getRealMarkers=function(){for(var c=[],b=0,d=n.length;b<d;b++){c.push(n[b].marker)}return c}}function ClusterMarker_(h,m,l,k,j){var i=m.index;this.useStyle(l[i-1]);this.styleDirty_=false;this.latlng_=h;this.index_=i;this.styles_=l;this.text_=m.text;this.padding_=k;this.sums_=m;this.cluster_=j}if(typeof window.GOverlay==="function"){ClusterMarker_.prototype=new GOverlay;ClusterMarker_.instanceOfGOverlay=true}a=ClusterMarker_.prototype;a.useStyle=function(c){this.url_=c.url;this.height_=c.height;this.width_=c.width;this.textColor_=c.opt_textColor;this.anchor_=c.opt_anchor;this.textSize_=c.opt_textSize};a.initialize=function(h){this.map_=h;var m=document.createElement("div"),l=this.latlng_,k=this.getPosFromLatLng(l);m.style.cssText=this.createCss(k);m.innerHTML=this.text_;h.getPane(G_MAP_MAP_PANE).appendChild(m);var j=this.padding_,i=this.cluster_;GEvent.addDomListener(m,"click",function(){GEvent.trigger(i.getMarkerClusterer(),"clusterclick",i);if(i.getMarkerClusterer().isZoomOnClick()){var b=h.fromLatLngToDivPixel(l),c=new GPoint(b.x-j,b.y+j);c=h.fromDivPixelToLatLng(c);b=new GPoint(b.x+j,b.y-j);b=h.fromDivPixelToLatLng(b);c=h.getBoundsZoomLevel(new GLatLngBounds(c,b),h.getSize());h.setCenter(l,c)}});this.div_=m};a.getPosFromLatLng=function(c){c=this.map_.fromLatLngToDivPixel(c);c.x-=parseInt(this.width_/2,10);c.y-=parseInt(this.height_/2,10);return c};a.createCss=function(d){var e="";e=document.all?'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="'+this.url_+'");':"background:url("+this.url_+");";if(typeof this.anchor_==="object"){e+=typeof this.anchor_[0]==="number"&&this.anchor_[0]>0&&this.anchor_[0]<this.height_?"height:"+(this.height_-this.anchor_[0])+"px;padding-top:"+this.anchor_[0]+"px;":"height:"+this.height_+"px;line-height:"+this.height_+"px;";e+=typeof this.anchor_[1]==="number"&&this.anchor_[1]>0&&this.anchor_[1]<this.width_?"width:"+(this.width_-this.anchor_[1])+"px;padding-left:"+this.anchor_[1]+"px;":"width:"+this.width_+"px;text-align:center;"}else{e+="height:"+this.height_+"px;line-height:"+this.height_+"px;";e+="width:"+this.width_+"px;text-align:center;"}return e+"cursor:pointer;top:"+d.y+"px;left:"+d.x+"px;color:"+(this.textColor_?this.textColor_:"black")+";position:absolute;font-size:"+(this.textSize_?this.textSize_:24)+"px;font-family:Arial,sans-serif;font-weight:bold"};a.remove=function(){this.div_.parentNode.removeChild(this.div_)};a.copy=function(){return new ClusterMarker_(this.latlng_,this.sums_,this.text_,this.styles_,this.padding_,this.cluster_)};a.redraw=function(c){if(c){c=this.getPosFromLatLng(this.latlng_);if(this.styleDirty_){this.styleDirty_=false;this.useStyle(this.styles_[this.index_-1]);this.div_.style.cssText=this.createCss(c)}else{this.div_.style.top=c.y+"px";this.div_.style.left=c.x+"px"}}};a.hide=function(){this.div_.style.display="none"};a.show=function(){this.div_.style.display=""};a.isHidden=function(){return this.div_.style.display==="none"};a.setSums=function(c){if(c.index!==this.index_){this.styleDirty_=true}this.sums_=c;this.text_=c.text;this.index_=c.index;this.div_.innerHTML=c.text};var month_names=[];month_names[month_names.length]="January";month_names[month_names.length]="February";month_names[month_names.length]="March";month_names[month_names.length]="April";month_names[month_names.length]="May";month_names[month_names.length]="June";month_names[month_names.length]="July";month_names[month_names.length]="August";month_names[month_names.length]="September";month_names[month_names.length]="October";month_names[month_names.length]="November";month_names[month_names.length]="December";var day_names=[];day_names[day_names.length]="Sunday";day_names[day_names.length]="Monday";day_names[day_names.length]="Tuesday";day_names[day_names.length]="Wednesday";day_names[day_names.length]="Thursday";day_names[day_names.length]="Friday";day_names[day_names.length]="Saturday";function getIntegerAsString(c){return c<10?"0"+c:c}function getFullDateAsString(c){return month_names[c.getMonth()]+" "+c.getDate()+", "+c.getFullYear()+" "+c.getHours()+":"+getIntegerAsString(c.getMinutes())+":"+getIntegerAsString(c.getSeconds())+" UTC"}function getShortDateAsString(d){var e=d.getMonth()+1;return getIntegerAsString(e)+"/"+getIntegerAsString(d.getDate())+"/"+d.getFullYear()+" "+d.getHours()+":"+getIntegerAsString(d.getMinutes())+":"+getIntegerAsString(d.getSeconds())+" UTC"}function getTimeAsString(c){return c.getHours()+":"+getIntegerAsString(c.getMinutes())+":"+getIntegerAsString(c.getSeconds())+" UTC"}function isStrValid(c){return !(c=="undefined"||c==null||c=="")}function setCookie(d,e){document.cookie=d+"="+escape(e)}function readCookie(f){f=f+"=";for(var i=document.cookie.split(";"),h=0;h<i.length;h++){for(var g=i[h];g.charAt(0)==" ";){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}}function getVar(f){var i=location.href.substring(location.href.indexOf("?")+1,location.href.length)+"&";if(i.indexOf("#")!=-1){i=i.substring(0,i.indexOf("#"))+"&"}var h=undefined;f+="=";var g=f.length;if(i.indexOf(f)!=-1){h=i.substring(i.indexOf(f)+g,i.length).substring(0,i.substring(i.indexOf(f)+g,i.length).indexOf("&"))}return h}function getEvent(c){if(c==undefined){return window.event}return c}function handleEventObj(d,e){return function(b){b=b||window.event;d[e](b,this)}}function handleEvent(c){return function(b){b=b||window.event;c(b,this)}}var mainUrl="http://www.radarvirtuel.com/",iconUrl="http://radarvirtuel.free.fr/",airportsUrl="http://www.openskymap.com/airports/",jsonFile=mainUrl+"file.json",iconDir=iconUrl+"icones/",airplaneIconPrefixDict={airbus:"airbus/a320_",boeing:"boeing/boeing747_","default":"default/default_",unknown:"unknown/unknown",default_small:"default_small/default_"},selectedAirplaneIconPrefixDict={airbus:"airbus/selected/a320_",boeing:"boeing/selected/boeing747_","default":"default/selected/default_",unknown:"unknown/selected/unknown",default_small:"default_small/selected/default_"},startPosition=new GLatLng(51.971345808851716,0.1318359375),startZoomLevel=7,showProviders=true,showDisconnectedProviders=false,maxZoomClustered=4,defaultRefreshRate=10,retryRefreshRate=5,defaultRefreshRateWeather=600,retryRefreshRateWeather=5,timeoutJSON=10,limitSessionTime=false,sessionTimeDelta=2400,travelPlaces=[{name:"Europe",position:[48.74894534343293,12.83203125],zoomLevel:5,subLinks:[{name:"France",position:[46.8,4.7],zoomLevel:6,subLinks:[{name:"Paris",position:[48.853873,2.3909],zoomLevel:10,subLinks:undefined}]},{name:"United Kingdom",position:[54.380557,-3.273926],zoomLevel:6,subLinks:[{name:"London",position:[51.5104518,-0.111236],zoomLevel:10,subLinks:undefined}]},{name:"Ireland",position:[53.442264,-7.855225],zoomLevel:7,subLinks:undefined},{name:"Spain",position:[39.740986,-3.933105],zoomLevel:6,subLinks:undefined},{name:"Portugal",position:[39.402244,-8.22876],zoomLevel:7,subLinks:undefined},{name:"Switzerland",position:[47.253136,8.596802],zoomLevel:7,subLinks:undefined},{name:"Finland",position:undefined,zoomLevel:undefined,subLinks:[{name:"Helsinki",position:[59.784051,25.455322],zoomLevel:7,subLinks:undefined}]},{name:"Hungary",position:[46.573967,17.314453],zoomLevel:6,subLinks:undefined},{name:"Romania",position:[46.573967,17.314453],zoomLevel:7,subLinks:undefined},{name:"Cyprus",position:[35.871247,33.640137],zoomLevel:6,subLinks:undefined}]},{name:"America",position:undefined,zoomLevel:undefined,subLinks:[{name:"USA",position:[39.3682,-97.6025],zoomLevel:5,subLinks:[{name:"Florida",position:[28.256006,-81.595459],zoomLevel:7,subLinks:undefined},{name:"California",position:[33.92513,-116.916504],zoomLevel:6,subLinks:undefined}]},{name:"Canada",position:undefined,zoomLevel:undefined,subLinks:[{name:"Kingston",position:[44.024422,-76.59668],zoomLevel:7,subLinks:undefined},{name:"Vancouver",position:[48.502048,-122.991943],zoomLevel:7,subLinks:undefined}]},{name:"Brazil",position:undefined,zoomLevel:undefined,subLinks:[{name:"Brasilia",position:[-17.014768,-44.736328],zoomLevel:6,subLinks:undefined}]}]},{name:"Africa",position:undefined,zoomLevel:undefined,subLinks:[{name:"Reunion",position:[-21.204898,55.59082],zoomLevel:9,subLinks:undefined},{name:"South Africa",position:[-27.994401411046145,28.2568359375],zoomLevel:6,subLinks:undefined}]}];function AirPlane(h,m,l,k,j,i){this.id=h;this.point=new GLatLng(m[0],m[1]);this.angle=l;this.labelAttribute=i;this.setInfo(k,j);this.selected=false;this.polyline=this.marker=undefined;this.labelVisible=this.visible=true}a=AirPlane.prototype;a.setName=function(c){this.marker!=undefined&&this.marker.setLabelText(c)};a.getAttributeValue=function(c){if(c==undefined){return""}c=this.info[c];if(c==undefined){return""}return c};a.getNameFromLabelAttribute=function(){var d="";try{d=this.getAttributeValue(this.labelAttribute)}catch(e){}return d};a.setLabelAttribute=function(c){this.labelAttribute=c;this.setName(this.getNameFromLabelAttribute())};a.setPoint=function(c){this.point=new GLatLng(c[0],c[1]);this.marker!=undefined&&this.marker.setLatLng(this.point)};a.getColor=function(){return"#ff0000"};a.setPolyline=function(e,g,f){if(this.marker!=undefined){this.numPolyPoint=e[0];this.polyEncodedStr=e[1];this.polyColor=this.getColor(g);this.polyWidth=f;this.polyline!=undefined&&this.makePolyline()}};a.makePolyline=function(){if(this.marker!=undefined){levels="";for(var c=0;c<this.numPolyPoint;c++){levels+="G"}var e=new GPolyline.fromEncoded({color:this.polyColor,weight:this.polyWidth,opacity:1,points:this.polyEncodedStr,levels:levels,zoomFactor:1,numLevels:18});var g=this.decodePolyline(e);var d=this.filterPolyline(g);var f=this.smoothPolyline(d);this.polyline=new GPolyline(f,"#0000ff",2,1)}};a.smoothPolyline=function(b){var e=4;var d=this.prepareCurve(b);for(var c=0;c<e;c++){var f=this.interpolatePolyline(this.filterPolyline(d));d=f}return d};a.decodePolyline=function(b){var d=new Array();for(var c=0;c<b.getVertexCount();c++){d[c]=b.getVertex(c)}return d};a.filterPolyline=function(c){var b=new Array();var k=c.size();b.push(c[k-1]);b.push(c[k-2]);var d=2;for(var e=k-1;e>1;e--){var h=b[d-2];var g=b[d-1];var f=c[e-2];if(this.validatePreviousPosition(h,g,f)){b[d]=f;d++}}return b};a.validatePreviousPosition=function(h,f,e){var d=this.getBearing(h,f);var c=this.getBearing(f,e);var b=(c-d+360)%360;var g=e.distanceFrom(f);if(g>3000000){return false}if(b<45||b>315){return true}if(b<90||b>270){return g<10000}return g<1000};a.interpolatePolyline=function(h){var e=5;var c=new Array();var b=h.size();c.push(h[0]);for(var d=1;d<b-1;d++){var l=h[d-1];var k=h[d];var j=h[d+1];var g=this.getBearing(l,k);var f=this.getBearing(k,j);if(Math.abs(f-g)>e){var m=this.createPointsBetween(l,k,j);c.push(m[0]);c.push(k);c.push(m[1])}else{c.push(k)}}c.push(h[b-1]);return c};a.createPointsBetween=function(n,m,l){var j=this.getBearing(l,n);var i=this.getBearing(n,l);var h=this.getBearing(m,n);var d=this.getBearing(m,l);if(j-h>180){j-=360}else{if(j-h<-180){h-=360}}if(i-d>180){i-=360}else{if(i-d<-180){d-=360}}var k=n.distanceFrom(m)/3;var g=m.distanceFrom(l)/3;var f=(j+h)/2;var c=(i+d)/2;var e=Math.abs(k/Math.cos(this.toRad(f-h)));var b=Math.abs(g/Math.cos(this.toRad(c-d)));var o=[this.getDestination(m,this.toRad(f),e),this.getDestination(m,this.toRad(c),b)];return o};a.getDestination=function(j,b,i){var c=6371000;var h=this.toRad(j.lat());var f=this.toRad(j.lng());var g=Math.asin(Math.sin(h)*Math.cos(i/c)+Math.cos(h)*Math.sin(i/c)*Math.cos(b));var e=f+Math.atan2(Math.sin(b)*Math.sin(i/c)*Math.cos(h),Math.cos(i/c)-Math.sin(h)*Math.sin(g));return new GLatLng(this.toDeg(g),this.toDeg(e))};a.toRad=function(b){return(b/180)*Math.PI};a.toDeg=function(b){return(b/Math.PI)*180};a.prepareCurve=function(b){var d=new Array();for(var c=0;c<b.size();c++){d.push(b[c]);if(c!=0&&c<b.size()-2){var h=b[c-1];var g=b[c];var f=b[c+1];var e=b[c+2];if(this.directionChanges(h,g,f,e)){d.push(this.getMidPoint(g,f))}}}return d};a.getMidPoint=function(e,d){var c=e.lat()+(d.lat()-e.lat())/2;var b=e.lng()+(d.lng()-e.lng())/2;return new GLatLng(c,b)};a.directionChanges=function(j,i,h,g){var f=this.getBearing(j,i);var e=this.getBearing(i,h);var d=this.getBearing(h,g);var c=this.getTurnDirection(f,e);var b=this.getTurnDirection(e,d);return c!=b};a.getTurnDirection=function(c,b){var d=b-c;if(d<0){d+=360}return d<180};a.getBearing=function(g,e){var f=this.toRad(g.lat());var d=this.toRad(e.lat());var c=this.toRad(e.lng()-g.lng());var h=Math.sin(c)*Math.cos(d);var b=Math.cos(f)*Math.sin(d)-Math.sin(f)*Math.cos(d)*Math.cos(c);return(((Math.atan2(h,b)*180)/Math.PI)+360)%360};a.getPolyline=function(){this.polyline==undefined&&this.makePolyline();return this.polyline};a.setAngle=function(c){this.angle=c;if(this.marker!=undefined){this.marker.getIcon().image=this.getIconFileName()}};a.setInfo=function(e,g){this.info=e;e="?";if(this.info.ar!=undefined){e=this.info.ar;if(g[e]!=undefined){var f=g[e];this.arName=f[0];if(f[1]!=""&&f[2]!=""){this.arPos=new GLatLng(f[1],f[2])}}else{this.arPos=this.arName=undefined}}f="?";if(this.info.de!=undefined){f=this.info.de;if(g[f]!=undefined){g=g[f];this.deName=g[0];if(g[1]!=""&&g[2]!=""){this.dePos=new GLatLng(g[1],g[2])}}else{this.dePos=this.deName=undefined}}this.info.da=f+"->"+e};a.setPolylineVisibility=function(c){if(this.polyline){(this.polylineVisible=c)?this.polyline.show():this.polyline.hide()}};a.setLabelVisibility=function(c){if(this.marker!=undefined){this.labelVisible=c;this.marker.setLabelVisibility(this.labelVisible)}};a.showLabel=function(){this.setLabelVisibility(true)};a.hideLabel=function(){this.setLabelVisibility(false)};a.formatAttribute=function(d,e){if(!isStrValid(e)){return""}return"<b>"+d+"</b> : "+e+"<br/>"};a.formatInfoAsHTML=function(){html="";try{html+='<a href="#" class="simpleLink" onclick="javascript:map.zoomIn(new GLatLng('+this.point.lat()+","+this.point.lng()+'),true,true);">ZOOM</a>';html+=" - ";var B="setAirplaneFilter({'attribute':'ia','attributeType':'str','operator':'equal','str':'"+this.info.ia+"'})";html+='<a href="#" class="simpleLink" onclick="javascript:'+B+'">HIDE OTHERS</a>';html+=" - ";html+='<a href="#" class="simpleLink" onclick="javascript:cancelAirplaneFilter()">SHOW ALL</a>';html+="<hr>";html+=this.formatAttribute("Flight Number",this.info.cs);html+=this.formatAttribute("Company",this.info.co);html+=this.formatAttribute("ICAO Hex Code",this.info.ia);html+=this.formatAttribute("Reg Code",this.info.rc);if(this.info.br!=undefined){fullModelName=this.info.br;if(this.info.mo!=undefined){fullModelName+=" - "+this.info.mo}html+=this.formatAttribute("Model",fullModelName)}if(this.info.de!=undefined){B="setAirplaneFilter({'attribute':'de','attributeType':'str','operator':'equal','str':'"+this.info.de+"'})";var x='<a href="#" class="simpleLink" onclick="javascript:'+B+'">'+this.info.de+"</a>";if(this.deName!=undefined){x+=" - "+this.deName}if(this.dePos!=undefined){var w=this.dePos.distanceFrom(this.point)/1000,t=w*0.621371192;x+="<br/>(Birds Eye Distance : "+w.toFixed(0)+" km - "+t.toFixed(0)+" miles)"}html+=this.formatAttribute("Departure",x)}if(this.info.ar!=undefined){B="setAirplaneFilter({'attribute':'ar','attributeType':'str','operator':'equal','str':'"+this.info.ar+"'})";var s='<a href="#" class="simpleLink" onclick="javascript:'+B+'">'+this.info.ar+"</a>";if(this.arName!=undefined){s+=" - "+this.arName}if(this.arPos!=undefined){w=this.arPos.distanceFrom(this.point)/1000;t=w*0.621371192;s+="<br/>(Birds Eye Distance : "+w.toFixed(0)+" km - "+t.toFixed(0)+" miles)"}html+=this.formatAttribute("Arrival",s)}html+="<hr>";var q=new Date,o=this.info.dt,p=q.getTimezoneOffset();q.setTime(o+p*60000);dateString=getTimeAsString(q);html+=this.formatAttribute("Last Message",dateString);html+=this.formatAttribute("Latitude",this.point.lat());html+=this.formatAttribute("Longitude",this.point.lng());if(isStrValid(this.info.al)){var n=parseFloat(this.info.al);B=n*3.2808399;var i=n.toFixed(0)+" m - "+B.toFixed(0)+" ft";html+=this.formatAttribute("Altitude",i)}if(isStrValid(this.info.gs)){var D=parseFloat(this.info.gs);n=D*0.621371192;i=D/1.852;var F=D.toFixed(0)+" km/h  -  "+n.toFixed(0)+" mph  -  "+i.toFixed(0)+" knots";html+=this.formatAttribute("Ground Speed",F)}if(isStrValid(this.info.vs)){var z=parseFloat(this.info.vs);D=z*3.2808399;verticalStatus="";if(z>0){verticalStatus=" (CLIMB)"}else{if(z<0){verticalStatus=" (DESCENT)"}}var k=z.toFixed(0)+" m/min  -  "+D.toFixed(0)+" ft/min "+verticalStatus;html+=this.formatAttribute("Vertical Speed",k)}html+=this.formatAttribute("Squawk",this.info.sq);if(isStrValid(this.info.tr)){html+=this.formatAttribute("Heading",this.info.tr+"&ordm;")}if(this.info.rc!=undefined){html+="<hr>";html+="More information at : <br/>";html+='<a href="#" class="simpleLink" onclick="'+("window.open('http://www.airliners.net/search/photo.search?distinct_entry=true&regsearch="+this.info.rc+"')")+'">Airliners.net</a>';html+=" - ";html+='<a href="#" class="simpleLink" onclick="'+("window.open('http://www.libhomeradar.org/aircraft/"+this.info.rc+".html')")+'">LibHomeRadar.org</a>';if(this.info.rc[0]=="N"){var m="window.open('http://registry.faa.gov/aircraftinquiry/NNum_Results.aspx?NNumbertxt="+this.info.rc+"')";html+=" - ";html+='<a href="#" class="simpleLink" onclick="'+m+'">FAA</a>'}}html+="<br/>";html+=$("adDiv").innerHTML}catch(E){}return html};a.debugInfo=function(){debugInfo="------------------ Debug Info ------------------<br/>";debugInfo+=this.numPolyPoint+" scanned positions :<br/>";debugInfo+="------------------------------------------------<br/>";return debugInfo};a.updateHTML=function(){html=this.formatInfoAsHTML();$("infowindow").innerHTML=html};a.showHTML=function(){this.updateHTML();toggleTab(1,2)};a.hideHTML=function(){$("infowindow").innerHTML=$("tipContent").innerHTML};a.getIconFileName=function(){iconPrefixDict=airplaneIconPrefixDict;if(this.selected){iconPrefixDict=selectedAirplaneIconPrefixDict}var c=this.angle;if(!c&&this.info.tr){c=(450-this.info.tr)%360}if(c){roundedAngleStr=c=Math.round(c/10)*10%360;if(c<100){roundedAngleStr="0"+roundedAngleStr}if(c<10){roundedAngleStr="0"+roundedAngleStr}return iconDir+iconPrefixDict["default"]+roundedAngleStr+".png"}else{return iconDir+iconPrefixDict.unknown+".png"}};a.createMarker=function(){var c=new GIcon;c.iconSize=new GSize(30,28);c.iconAnchor=new GPoint(15,14);c.image=this.getIconFileName();opts={icon:c,clickable:true,labelText:this.getNameFromLabelAttribute(),labelOffset:new GSize(10,0),zIndexProcess:function(){return 99}};this.marker=new LabeledMarker(this.point,opts);this.marker.setLabelVisibility(this.labelVisible);this.visible?this.marker.show():this.marker.hide()};a.setVisibility=function(c){if(this.visible=c){this.marker.show();this.polyline&&this.polylineVisible&&this.polyline.show()}else{this.marker.hide();this.polyline&&this.polyline.hide()}};a.updateName=function(){this.setName(this.getNameFromLabelAttribute())};a.updateMarker=function(){this.marker.getIcon().image=this.getIconFileName();this.updateName()};a.select=function(){this.selected=true;this.updateMarker();this.showHTML()};a.deselect=function(){this.selected=false;this.updateMarker();this.hideHTML()};function WeatherInfo(h,m,l,k,j,i){this.point=new GLatLng(h[0],h[1]);this.tempDeg=m;this.humidity=l;this.windSpeedKmh=k;this.windDir=j;this.currentConditionCode=i;this.selected=false;this.marker=undefined;this.visible=true;this.labelVisible=false}a=WeatherInfo.prototype;a.setLabelVisibility=function(c){if(this.marker!=undefined){this.labelVisible=c;this.marker.setLabelVisibility(this.labelVisible)}};a.showLabel=function(){this.setLabelVisibility(true)};a.hideLabel=function(){this.setLabelVisibility(false)};a.getFahrenheitTemp=function(){return(parseFloat(this.tempDeg)*1.8+32).toFixed(0)};a.getMphWindSpeed=function(){return(parseFloat(this.windSpeedKmh)*0.621371192).toFixed(0)};a.getLabel=function(){var c="TEMP: "+this.tempDeg+"&deg;C - "+this.getFahrenheitTemp()+"&deg;F<br>";c+="WIND: "+this.windSpeedKmh+" km/h - "+this.getMphWindSpeed()+" mph "+this.windDir+"<br>";c+="HUMIDITY: "+this.humidity+"%";return c};a.getIconFileName=function(){return iconDir+"/weather/"+this.currentConditionCode+".png"};a.createMarker=function(){var c=new GIcon;c.iconSize=new GSize(32,32);c.iconAnchor=new GPoint(16,16);c.image=this.getIconFileName();opts={icon:c,clickable:true,labelText:this.getLabel(),labelOffset:new GSize(18,-16),labelClass:"LabeledMarker_markerLabel_weather"};this.marker=new LabeledMarker(this.point,opts);this.marker.setLabelVisibility(this.labelVisible);GEvent.addListener(this.marker,"mouseover",function(){this.setLabelVisibility(true)});GEvent.addListener(this.marker,"mouseout",function(){this.setLabelVisibility(false)});this.visible?this.marker.show():this.marker.hide()};a.setVisibility=function(c){(this.visible=c)?this.marker.show():this.marker.hide()};a.updateName=function(){this.setName(this.getLabel())};a.updateMarker=function(){this.marker.getIcon().image=this.getIconFileName();this.updateName()};var map,airplaneMarkerClusterer,generalMarkerClusterer,sessionActive=true,sessionSecs,sessionTimerID=null,sessionTimerRunning=false,sessionDelay=1000,airPlaneArray=[],idList=[],infoProviders=[],airportInfo,refreshRate=defaultRefreshRate,secs,timerID=null,timerRunning=false,delay=1000,totalNumAircraftTracked=0,dateString=undefined,labelAttribute=undefined,selectedAirPlane=undefined,polylineWidth=1,airplaneFilter={attribute:undefined,attributeType:undefined,operator:undefined,str:undefined},weatherInfoList=[],weatherInfoVisible=false,lastWeatherInfoRetrieve=undefined,refreshRateWeather=defaultRefreshRateWeather,secsWeather,timerIDWeather=null,timerRunningWeather=false,delayWeather=1000,colorMode={altitude:0,"ground speed":1,"vertical speed":2},currentColorMode=colorMode.altitude,airportTileOverlay;function initialize(){if(GBrowserIsCompatible()){limitSessionTime&&InitializeSessionTimer();if(Prototype.Browser.IE){$("iewarning").style.display="block"}$("infowindow").innerHTML=$("tipContent").innerHTML;initLayerManager();initFilterManager();var e=$("maindiv").getWidth(),g=$("maindiv").getHeight()-$("upbarDiv").getHeight();e={size:new GSize(e,g)};map=new GMap2(document.getElementById("map_canvas"),e);e=getVar("lat");g=getVar("lng");var f=getVar("zoom");if(typeof e!="undefined"&&typeof g!="undefined"&&typeof f!="undefined"){startPosition=new GLatLng(parseFloat(e),parseFloat(g));startZoomLevel=parseFloat(f)}savedPosition=getSavedPosition();savedPosition==undefined?map.setCenter(startPosition,startZoomLevel):map.setCenter(savedPosition[0],savedPosition[1]);fillMapLink();map.addMapType(G_PHYSICAL_MAP);map.setMapType(G_PHYSICAL_MAP);map.addControl(new GSmallMapControl);map.enableScrollWheelZoom();map.addControl(new GMapTypeControl);map.addControl(new GScaleControl);GEvent.addListener(map,"moveend",handleViewChange);GEvent.addListener(map,"zoomend",handleViewChange);preloadImages();printInfo("Loading data...");openJson(jsonFile,parseJson);InitializeTimer()}}function preloadImages(){if(document.images){var e=new Image;e.src=iconDir+"/state/state_0.png";var g=new Image;e.src=iconDir+"/state/state_1.png";for(var f=0;f<=36;f+=1){multipliedAngleStr=multipliedAngle=f*10;if(multipliedAngle<100){multipliedAngleStr="0"+multipliedAngleStr}if(multipliedAngle<10){multipliedAngleStr="0"+multipliedAngleStr}e=new Image;e.src=iconDir+airplaneIconPrefixDict["default"]+multipliedAngleStr+".png";g=new Image;g.src=iconDir+selectedAirplaneIconPrefixDict["default"]+multipliedAngleStr+".png"}}}function fillMapLink(){var f=map.getCenter(),i=map.getZoom(),h=mainUrl+"?lat="+f.lat()+"&lng="+f.lng()+"&zoom="+i;f=$$(".mapLink");i=0;for(var g=f.length;i<g;i++){f[i].value=h}h='<iframe width="800" height="600" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'+h+'"></iframe>';f=$$(".mapHTML");i=0;for(g=f.length;i<g;i++){f[i].value=h}}function handleViewChange(){fillMapLink();updateStatusBar()}function getMapLink(){var d=map.getCenter(),e=map.getZoom();return mainUrl+"?lat="+d.lat()+"&lng="+d.lng()+"&zoom="+e}function refreshAirPlaneMarkerClusterer(f){airplaneMarkerClusterer&&airplaneMarkerClusterer.clearMarkers();var i=[],h=airPlaneArray;if(f){h=f}f=0;for(var g=h.length;f<g;f++){i.push(h[f].marker)}airplaneMarkerClusterer=new MarkerClusterer(map,i,{maxZoom:maxZoomClustered,gridSize:60,styles:[{url:mainUrl+"/icones/cluster/cluster.png",height:65,width:66,opt_textColor:"#000000"}]});GEvent.addListener(airplaneMarkerClusterer,"regroup",handleClusterChange)}function handleClusterChange(){if(selectedAirPlane!=undefined&&selectedAirPlane!=null){airplaneMarkerClusterer.isClustered(selectedAirPlane.marker)?selectedAirPlane.setPolylineVisibility(false):selectedAirPlane.setPolylineVisibility(true)}}function refreshGeneralMarkerClusterer(){typeof generalMarkerClusterer!="undefined"&&generalMarkerClusterer.clearMarkers();for(var e=[],g=0,f=infoProviders.length;g<f;g++){e.push(infoProviders[g])}g=0;for(f=weatherInfoList.length;g<f;g++){e.push(weatherInfoList[g].marker)}generalMarkerClusterer=new MarkerClusterer(map,e,{maxZoom:1,gridSize:100})}function createInfoProvider(e,g){var f=new GIcon;f.iconSize=new GSize(6,6);f.infoWindowAnchor=new GPoint(3,3);f.iconAnchor=new GPoint(3,3);f.image=iconDir+"/state/state_"+g+".png";opts={icon:f,clickable:false,zIndexProcess:function(){return 0}};return new GMarker(new GLatLng(e[0],e[1]),opts)}function openJson(d,e){setLoaderVisibility(true);new Ajax.Request(d+"?tid="+Math.random(),{method:"get",timeout:timeoutJSON,requestHeaders:{Pragma:"no-cache","Cache-Control":"no-store, no-cache, must-revalidate, post-check=0, pre-check=0",Expires:new Date(0),"Last-Modified":new Date(0),"If-Modified-Since":new Date(0)},onComplete:e,onFailure:function(){}})}function toggleWeatherLayer(){if(weatherInfoVisible){weatherInfoList=[];weatherInfoVisible=false;refreshGeneralMarkerClusterer()}else{loadWeatherInfo()}}function loadWeatherInfo(){sessionActive&&lastWeatherInfoRetrieve==undefined&&openJson("weather.json",parseWeatherJson)}function parseWeatherJson(b){var c=undefined;try{c=eval("("+b.responseText+")")}catch(d){refreshRateWeather=retryRefreshRateWeather;InitializeWeatherTimer()}finally{if(c!=undefined){weatherInfoList=[];b=0;for(var e=c.length;b<e;++b){var f=new WeatherInfo(c[b].p,c[b].t,c[b].h,c[b].s,c[b].d,c[b].c);f.createMarker();weatherInfoList.push(f)}refreshGeneralMarkerClusterer();weatherInfoVisible=true}}}function parseJson(b){var c=undefined;try{c=eval("("+b.responseText+")")}catch(d){StopTheClock();refreshRate=retryRefreshRate;InitializeTimer()}finally{if(c!=undefined){StopTheClock();setLoaderVisibility(false);if(showProviders){infoProviders=[];b=0;for(var e=c.prv.length;b<e;b++){if(!(!showDisconnectedProviders&&c.prv[b].st==0)){var f=createInfoProvider(c.prv[b].pt,c.prv[b].st);infoProviders.push(f)}}refreshGeneralMarkerClusterer()}airportInfo=c.arpts;jsonIdList=[];b=0;for(e=c.mrkrs.length;b<e;b++){jsonIdList.push(c.mrkrs[b].id)}f=[];b=[];var g=[];b=0;for(e=idList.length;b<e;b++){for(var j=idList[b],h=airPlaneArray[b],l=0,r=0,v=jsonIdList.length;r<v;r++){if(jsonIdList[r]==j){l=1}}if(l==0){h.selected&&selectAirplane(undefined)(undefined)}else{g.push(j);f.push(h)}}idList=g;airPlaneArray=f;maxDate=undefined;b=0;for(e=c.mrkrs.length;b<e;b++){j=c.mrkrs[b].id;dt=c.mrkrs[b].inf.dt;if(dt!=undefined){if(maxDate==undefined||dt>maxDate){maxDate=dt}}l=0;f=-1;r=0;for(v=idList.length;r<v;r++){if(idList[r]==j){l=1;f=r}}if(l==0){h=new AirPlane(j,c.mrkrs[b].pt,c.mrkrs[b].an,c.mrkrs[b].inf,airportInfo,labelAttribute);h.createMarker();c.mrkrs[b].ln&&h.setPolyline(c.mrkrs[b].ln,currentColorMode,polylineWidth);GEvent.addListener(h.marker,"click",selectAirplane(h));airPlaneArray.push(h);applyAirplaneFilterToSingleAirplane(h);idList.push(j)}else{h=airPlaneArray[f];h.setPoint(c.mrkrs[b].pt);h.setAngle(c.mrkrs[b].an);h.setInfo(c.mrkrs[b].inf,airportInfo);h.updateMarker();applyAirplaneFilterToSingleAirplane(h);if(h.selected){h.updateHTML();h.polyline&&map.removeOverlay(h.polyline)}c.mrkrs[b].ln&&h.setPolyline(c.mrkrs[b].ln,currentColorMode,polylineWidth);h.selected&&h.polyline&&map.addOverlay(h.getPolyline());airPlaneArray[f]=h}}totalNumAircraftTracked=c.num;if(maxDate!=undefined){c=new Date;b=c.getTimezoneOffset();c.setTime(maxDate+b*60000);dateString=getTimeAsString(c)}refreshRate=defaultRefreshRate;InitializeTimer();applyAirplaneFilterToAllAirplanes()}else{StopTheClock();refreshRate=retryRefreshRate;InitializeTimer()}}}function updateStatusBar(){var e="",g=airPlaneArray.length;if(typeof airplaneMarkerClusterer!="undefined"){var f=airplaneMarkerClusterer.getNumMarkersInViewport();e+=dateString!=undefined?dateString+" - "+g+" aircraft tracked ("+f+" in viewport)":"Now tracking"+g+" aircraft ("+f+" in viewport)";printInfo(e)}}function updateStats(){var g=airPlaneArray.length,k=totalNumAircraftTracked-g,j=g*100/totalNumAircraftTracked,i=k*100/totalNumAircraftTracked,h="<b>Total aircraft tracked:</b> "+totalNumAircraftTracked;h+="<br/>";h+="<b>ADS-B:</b> "+g+" ("+j.toFixed(1)+"%)";h+="<br/>";h+="<b>Mode-S:</b> "+k+" ("+i.toFixed(1)+"%)";$("statsManager").innerHTML=h}function printInfo(c){$("statusbarContent").innerHTML=c;$("statusbar").style.display="block"}function setLoaderVisibility(c){if(c){$("loadingIcon").style.display="block"}else{$("loadingIcon").style.display="none"}}function getSavedPosition(){var e=readCookie("lat"),g=readCookie("lon"),f=readCookie("zoom");if(!(e==undefined||g==undefined||f==undefined)){return[new GLatLng(parseFloat(e),parseFloat(g)),parseFloat(f)]}}function saveCurrentPosition(){var d=map.getCenter(),e=map.getZoom();setCookie("lat",d.lat());setCookie("lon",d.lng());setCookie("zoom",e)}function showAllAirplanes(){for(var d=0,e=airPlaneArray.length;d<e;++d){airPlaneArray[d].setVisibility(true)}refreshAirPlaneMarkerClusterer()}function hideAllAirplanes(){for(var d=0,e=airPlaneArray.length;d<e;++d){airPlaneArray[d].setVisibility(false)}refreshAirPlaneMarkerClusterer()}function selectAirplane(c){return function(b){b=b||window.event;if(selectedAirPlane!=undefined&&selectedAirPlane!=null){airplaneMarkerClusterer.removeMarker(selectedAirPlane.marker);selectedAirPlane.deselect();airplaneMarkerClusterer.addMarker(selectedAirPlane.marker);selectedAirPlane.setPolylineVisibility(false);selectedAirPlane.polyline&&map.removeOverlay(selectedAirPlane.polyline)}if(c!=undefined){airplaneMarkerClusterer.removeMarker(c.marker);c.select(b,this);airplaneMarkerClusterer.addMarker(c.marker);map.addOverlay(c.getPolyline());c.setPolylineVisibility(true);typeof pageTracker!="undefined"&&pageTracker._trackEvent("Airplane","select")}selectedAirPlane=c}}function travelTo(f,i,h,g){selectAirplane(undefined)(undefined);map.setCenter(new GLatLng(i,h),g);typeof pageTracker!="undefined"&&pageTracker._trackEvent("DirectMapLink",f)}function changeLabelAttribute(d){labelAttribute=d;d=0;for(var e=airPlaneArray.length;d<e;++d){airPlaneArray[d].setLabelAttribute(labelAttribute);labelAttribute==undefined?airPlaneArray[d].hideLabel():airPlaneArray[d].showLabel()}d=getLabelNameFromCode(labelAttribute);typeof pageTracker!="undefined"&&pageTracker._trackEvent("Airplane","ChangeDisplayLabel",d)}function setAirplaneFilter(c){airplaneFilter.attribute!=undefined&&cancelAirplaneFilter();airplaneFilter=c;$("filterManager").applyFilter(airplaneFilter);applyAirplaneFilterToAllAirplanes();c=getLabelNameFromCode(airplaneFilter.attribute);typeof pageTracker!="undefined"&&pageTracker._trackEvent("Airplane","ApplyFilter",c)}function cancelAirplaneFilter(){$("filterManager").cancelFilter();airplaneFilter={attribute:undefined,attributeType:undefined,operator:undefined,str:undefined};applyAirplaneFilterToAllAirplanes()}function applyAirplaneFilterToSingleAirplane(f){if(airplaneFilter.attribute==undefined||airplaneFilter.str==""){f.setVisibility(true);return false}else{var i=f.getAttributeValue(airplaneFilter.attribute),h=true;if(airplaneFilter.attributeType=="str"){h=(new RegExp(airplaneFilter.str,"gi")).test(i);h=airplaneFilter.operator=="equal"&&h||airplaneFilter.operator=="diff"&&!h}else{i=parseFloat(i);var g=parseFloat(airplaneFilter.str);if(airplaneFilter.operator=="equal"){h=i==g}else{if(airplaneFilter.operator=="diff"){h=i!=g}else{if(airplaneFilter.operator=="inf"){h=i<g}else{if(airplaneFilter.operator=="sup"){h=i>g}}}}}f.setVisibility(h);return h}}function applyAirplaneFilterToAllAirplanes(){if(airplaneFilter.attribute==undefined){showAllAirplanes();$("filterManager").printNumResults(-1);updateStatusBar()}else{for(var g=0,k=[],j=0,i=airPlaneArray.length;j<i;++j){var h=airPlaneArray[j];if(applyAirplaneFilterToSingleAirplane(h)){k.push(h);g++}}refreshAirPlaneMarkerClusterer(k);$("filterManager").printNumResults(g);updateStatusBar();typeof pageTracker!="undefined"&&pageTracker._trackEvent("filter",airplaneFilter.attribute,airplaneFilter.operator+airplaneFilter.str)}}function InitializeTimer(){secs=refreshRate;StopTheClock();StartTheTimer()}function StopTheClock(){timerRunning&&clearTimeout(timerID);timerRunning=false}function StartTheTimer(){if(sessionActive){if(secs==0){StopTheClock();openJson(jsonFile,parseJson);InitializeTimer()}else{self.status=secs;secs-=1;timerRunning=true;timerID=self.setTimeout("StartTheTimer()",delay)}}}function InitializeWeatherTimer(){secsWeather=defaultRefreshRateWeather;StopTheWeatherClock();StartTheWeatherTimer()}function StopTheWeatherClock(){timerRunningWeather&&clearTimeout(timerIDWeather);timerRunningWeather=false}function StartTheWeatherTimer(){if(sessionActive){if(secsWeather==0){StopTheWeatherClock();loadWeatherInfo();InitializeWeatherTimer()}else{self.status=secsWeather;secsWeather-=1;timerRunningWeather=true;timerIDWeather=self.setTimeout("StartTheWeatherTimer()",delayWeather)}}}function InitializeSessionTimer(){sessionSecs=sessionTimeDelta;StopTheSessionClock();StartTheSessionTimer()}function StopTheSessionClock(){sessionTimerRunning&&clearTimeout(sessionTimerID);sessionTimerRunning=false}function StartTheSessionTimer(){if(sessionSecs==0){StopTheSessionClock();sessionActive=false;alert("Your session is over. Please reload the page to keep viewing the website.")}else{self.status=sessionSecs;sessionSecs-=1;sessionTimerRunning=true;sessionTimerID=self.setTimeout("StartTheSessionTimer()",sessionDelay)}}function CustomGetTileUrl(d,e){baseDir=airportsUrl;if(e==0&&d.x>=0&&d.x<=0&&d.y>=0&&d.y<=0){return baseDir+e+"/"+d.y+"/"+d.x+".png"}else{if(e==1&&d.x>=0&&d.x<=1&&d.y>=0&&d.y<=1){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==2&&d.x>=0&&d.x<=3&&d.y>=0&&d.y<=3){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==3&&d.x>=0&&d.x<=7&&d.y>=0&&d.y<=7){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==4&&d.x>=0&&d.x<=15&&d.y>=0&&d.y<=15){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==5&&d.x>=0&&d.x<=31&&d.y>=0&&d.y<=31){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==6&&d.x>=0&&d.x<=63&&d.y>=0&&d.y<=63){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==7&&d.x>=0&&d.x<=127&&d.y>=0&&d.y<=127){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==8&&d.x>=0&&d.x<=255&&d.y>=0&&d.y<=255){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==9&&d.x>=0&&d.x<=511&&d.y>=0&&d.y<=511){return baseDir+e+"/"+d.x+"/"+d.y+".png"}else{if(e==10&&d.x>=0&&d.x<=1023&&d.y>=0&&d.y<=1023){return baseDir+e+"/"+d.x+"/"+d.y+".png"}}}}}}}}}}}return G_NORMAL_MAP.getTileLayers()[0].getTileUrl(d,e)}function toggleAirportLayer(){if(airportTileOverlay==undefined){airportlayer=new GTileLayer(new GCopyrightCollection("Airports"),0,10);airportlayer.getTileUrl=CustomGetTileUrl;airportlayer.getOpacity=function(){return 1};airportlayer.isPng=function(){return true};airportTileOverlay=new GTileLayerOverlay(airportlayer);map.addOverlay(airportTileOverlay,{zPriority:1});airportTileOverlay.show()}else{airportTileOverlay.isHidden()?airportTileOverlay.show():airportTileOverlay.hide()}}volcanolayer=undefined;function toggleVolcanoLayer(){if(volcanolayer==undefined){var c=new GLatLngBounds(new GLatLng(34,-78),new GLatLng(78,56));volcanolayer=new GGroundOverlay(mainUrl+"/ashes.png",c);map.addOverlay(volcanolayer)}else{volcanolayer.isHidden()?volcanolayer.show():volcanolayer.hide()}}var labelName2CodeDict=[{name:"None",type:"str",code:""},{name:"CallSign",type:"str",code:"cs"},{name:"ICAO Code",type:"str",code:"ia"},{name:"Reg Code",type:"str",code:"rc"},{name:"Departure Airport Code",type:"str",code:"de"},{name:"Arrival Airport Code",type:"str",code:"ar"},{name:"All Airport Codes",type:"str",code:"da"},{name:"Company",type:"str",code:"co"},{name:"Model",type:"str",code:"mo"},{name:"Model Brand",type:"str",code:"br"},{name:"Altitude (meters)",type:"num",code:"al"},{name:"Ground Speed (km/hour)",type:"num",code:"gs"},{name:"Vertical Speed (meters/min)",type:"num",code:"vs"},{name:"Squawk",type:"str",code:"sq"},{name:"Heading",type:"num",code:"tr"}];function getLabelNameFromCode(d){if(d!=undefined){for(var e=0;e<labelName2CodeDict.length;e++){if(labelName2CodeDict[e].code==d){return labelName2CodeDict[e].name}}}return"noLabel"}function getSelectElementWithAvailableAttributes(){for(var f=document.createElement("select"),i=0;i<labelName2CodeDict.length;i++){var h=document.createElement("option");h.text=labelName2CodeDict[i].name;h.value=labelName2CodeDict[i].code;h.valueType=labelName2CodeDict[i].type;try{f.add(h,null)}catch(g){f.add(h)}}return f}function initLayerManager(){var d=$("layerManager");d.appendChild(document.createTextNode("Aircrafts label : "));var e=getSelectElementWithAvailableAttributes();e.style.fontSize="12px";e.onchange=function(){changeLabelAttribute(this.options[this.selectedIndex].value)};d.appendChild(e);d.appendChild(document.createElement("br"));d.appendChild(document.createElement("br"));e=document.createElement("input");e.type="checkbox";e.name="";e.defaultChecked=false;e.value="";e.onclick=toggleVolcanoLayer;d.appendChild(e);d.appendChild(document.createTextNode("Volcano Ashes Layer"));d.appendChild(document.createElement("br"));d.appendChild(document.createElement("br"));e=document.createElement("input");e.type="checkbox";e.name="";e.defaultChecked=false;e.value="";e.onclick=toggleAirportLayer;d.appendChild(e);d.appendChild(document.createTextNode("Airports Layer (Zoom in to see more airports)"));d.appendChild(document.createElement("br"));d.appendChild(document.createElement("br"));e=document.createElement("input");e.type="checkbox";e.name="";e.defaultChecked=false;e.value="";e.onclick=toggleWeatherLayer;d.appendChild(e);d.appendChild(document.createTextNode("Weather Layer (Courtesy "));e=document.createElement("a");e.className="simpleLink";e.href="#";e.onclick=function(){window.open("http://weather.weatherbug.com/")};e.appendChild(document.createTextNode("WeatherBug"));d.appendChild(e);d.appendChild(document.createTextNode(")"));d.appendChild(document.createElement("br"));d.appendChild(document.createTextNode("Move the mouse over each weather icon to have temperature and wind speed information."));d.appendChild(document.createElement("br"));d.appendChild(document.createElement("br"))}function initFilterManager(){var u=$("filterManager"),t=getSelectElementWithAvailableAttributes();t.remove(0);t.style.fontSize="12px";u.appendChild(t);for(var s=document.createElement("select"),q=[{name:"=",code:"equal"},{name:"!=",code:"diff"},{name:"<",code:"inf"},{name:">",code:"sup"}],p=0;p<q.length;p++){var o=document.createElement("option");o.text=q[p].name;o.value=q[p].code;try{s.add(o,null)}catch(m){s.add(o)}}s.style.width="45px";u.appendChild(s);var n=document.createElement("input");n.setAttribute("type","text");n.style.width="90px";u.appendChild(n);u.appendChild(document.createElement("br"));var k=document.createElement("input");k.setAttribute("type","button");k.value="Apply";var i=document.createElement("input");i.setAttribute("type","button");i.value="Cancel";i.disabled=true;var w=document.createElement("div");w.innerHTML="No filter set.";u.applyFilter=function(b){for(var c=0;c<t.length;c++){if(t.options[c].value==b.attribute){t.selectedIndex=c}}for(c=0;c<s.length;c++){if(s.options[c].value==b.operator){s.selectedIndex=c}}n.value=b.str;t.disabled=true;s.disabled=true;n.disabled=true;k.disabled=true;i.disabled=false};u.printNumResults=function(b){w.innerHTML=b==-1?"No filter set.":b<2?b+" airplane found.":b+" airplanes found."};u.cancelFilter=function(){t.disabled=false;s.disabled=false;n.disabled=false;k.disabled=false;i.disabled=true};k.onclick=function(){setAirplaneFilter({attribute:t.options[t.selectedIndex].value,attributeType:t.options[t.selectedIndex].valueType,operator:s.options[s.selectedIndex].value,str:n.value})};i.onclick=function(){cancelAirplaneFilter()};u.appendChild(k);u.appendChild(i);u.appendChild(document.createElement("br"));u.appendChild(w);u.appendChild(document.createElement("br"));q=$(document.createElement("b"));q.appendChild(document.createTextNode("Examples :"));u.appendChild(q);u.appendChild(document.createElement("br"));u.appendChild(document.createTextNode("Vertical Speed < 0 (DESCENT) : "));q=document.createElement("a");q.className="simpleLink";q.href="#";q.onclick=function(){setAirplaneFilter({attribute:"vs",attributeType:"num",operator:"inf",str:"0"})};q.appendChild(document.createTextNode("Apply"));u.appendChild(q);u.appendChild(document.createElement("br"));u.appendChild(document.createTextNode("Altitude > 2000 : "));q=document.createElement("a");q.className="simpleLink";q.href="#";q.onclick=function(){setAirplaneFilter({attribute:"al",attributeType:"num",operator:"sup",str:"2000"})};q.appendChild(document.createTextNode("Apply"));u.appendChild(q);u.appendChild(document.createElement("br"));u.appendChild(document.createTextNode("Airplanes from RyanAir (RYR) : "));q=document.createElement("a");q.className="simpleLink";q.href="#";q.onclick=function(){setAirplaneFilter({attribute:"cs",attributeType:"str",operator:"equal",str:"RYR"})};q.appendChild(document.createTextNode("Apply"));u.appendChild(q);u.appendChild(document.createElement("br"));u.appendChild(document.createTextNode("Airplanes from/to London Heathrow Airport (LHR) : "));q=document.createElement("a");q.className="simpleLink";q.href="#";q.onclick=function(){setAirplaneFilter({attribute:"da",attributeType:"str",operator:"equal",str:"LHR"})};q.appendChild(document.createTextNode("Apply"));u.appendChild(q)}if(typeof dd_domreadycheck=="undefined"){var dd_domreadycheck=false}var anylinkmenu={menusmap:{},preloadimages:[],effects:{delayhide:200,shadow:{enabled:true,opacity:0.3,depth:[5,5]},fade:{enabled:false,duration:500}},dimensions:{},getoffset:function(d,e){return d.offsetParent?d[e]+this.getoffset(d.offsetParent,e):d[e]},getoffsetof:function(c){c._offsets={left:this.getoffset(c,"offsetLeft"),top:this.getoffset(c,"offsetTop"),h:c.offsetHeight}},getdimensions:function(c){this.dimensions={anchorw:c.anchorobj.offsetWidth,anchorh:c.anchorobj.offsetHeight,docwidth:(window.innerWidth||this.standardbody.clientWidth)-20,docheight:(window.innerHeight||this.standardbody.clientHeight)-15,docscrollx:window.pageXOffset||this.standardbody.scrollLeft,docscrolly:window.pageYOffset||this.standardbody.scrollTop};if(!this.dimensions.dropmenuw){this.dimensions.dropmenuw=c.dropmenu.offsetWidth;this.dimensions.dropmenuh=c.dropmenu.offsetHeight}},isContained:function(e,g){g=window.event||g;for(g=g.relatedTarget||(g.type=="mouseover"?g.fromElement:g.toElement);g&&g!=e;){try{g=g.parentNode}catch(f){g=e}}return g==e?true:false},setopacity:function(d,e){d.style.opacity=e;if(typeof d.style.opacity!="string"){d.style.MozOpacity=e;if(d.filters){d.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity="+e*100+")"}}},showmenu:function(f){var i=anylinkmenu.menusmap[f];clearTimeout(i.hidetimer);this.getoffsetof(i.anchorobj);this.getdimensions(i);var h=i.anchorobj._offsets.left+(i.orientation=="lr"?this.dimensions.anchorw:0),g=i.anchorobj._offsets.top+this.dimensions.anchorh-(i.orientation=="lr"?this.dimensions.anchorh:0);if(h+this.dimensions.dropmenuw+this.effects.shadow.depth[0]>this.dimensions.docscrollx+this.dimensions.docwidth){h=h-this.dimensions.dropmenuw+(i.orientation=="lr"?-this.dimensions.anchorw:this.dimensions.anchorw)}if(g+this.dimensions.dropmenuh>this.dimensions.docscrolly+this.dimensions.docheight){g=Math.max(g-this.dimensions.dropmenuh-(i.orientation=="lr"?-this.dimensions.anchorh:this.dimensions.anchorh),this.dimensions.docscrolly)}if(this.effects.fade.enabled){this.setopacity(i.dropmenu,0);this.effects.shadow.enabled&&this.setopacity(i.shadow,0)}i.dropmenu.setcss({left:h+"px",top:g+"px",visibility:"visible"});this.effects.shadow.enabled&&i.shadow.setcss({left:h+anylinkmenu.effects.shadow.depth[0]+"px",top:g+anylinkmenu.effects.shadow.depth[1]+"px",visibility:"visible"});if(this.effects.fade.enabled){clearInterval(i.animatetimer);i.curanimatedegree=0;i.starttime=(new Date).getTime();i.animatetimer=setInterval(function(){anylinkmenu.revealmenu(f)},20)}},revealmenu:function(d){d=anylinkmenu.menusmap[d];var e=(new Date).getTime()-d.starttime;if(e<this.effects.fade.duration){this.setopacity(d.dropmenu,d.curanimatedegree);this.effects.shadow.enabled&&this.setopacity(d.shadow,d.curanimatedegree*this.effects.shadow.opacity)}else{clearInterval(d.animatetimer);this.setopacity(d.dropmenu,1);d.dropmenu.style.filter=""}d.curanimatedegree=(1-Math.cos(e/this.effects.fade.duration*Math.PI))/2},setcss:function(c){for(prop in c){this.style[prop]=c[prop]}},setcssclass:function(f,i,h){var g=new RegExp("(^|\\s+)"+i+"($|\\s+)","ig");if(h=="check"){return g.test(f.className)}else{if(h=="remove"){f.className=f.className.replace(g,"")}else{if(h=="add"&&!g.test(f.className)){f.className+=" "+i}}}},hidemenu:function(c){c=anylinkmenu.menusmap[c];clearInterval(c.animatetimer);c.dropmenu.setcss({visibility:"hidden",left:0,top:0});c.shadow.setcss({visibility:"hidden",left:0,top:0})},getElementsByClass:function(f){if(document.querySelectorAll){return document.querySelectorAll("."+f)}else{f=new RegExp("(^|\\s+)"+f+"($|\\s+)","i");for(var i=[],h=document.all?document.all:document.getElementsByTagName("*"),g=0;g<h.length;g++){if(typeof h[g].className=="string"&&h[g].className.search(f)!=-1){i[i.length]=h[g]}}return i}},addDiv:function(f,i,h){var g=document.createElement("div");if(f){g.id=f}g.className=i;if(h!=""&&typeof g.style.cssText=="string"){g.style.cssText=h}else{h!=""&&g.setAttribute("style",h)}document.body.appendChild(g);return g},getmenuHTML:function(f){for(var i=[],h="",g=0;g<f.items.length;g++){h+=f.items[g][1]!=undefined?'<li><a style="padding-left:'+f.items[g][2]+'px;" href="'+f.items[g][1]+'" target="'+f.linktarget+'">'+f.items[g][0]+"</a></li>\n":'<li style="padding-left:'+f.items[g][2]+'px;">'+f.items[g][0]+"</li>\n";if(f.items[g][2]=="efc"||g==f.items.length-1){i.push(h);h=""}}if(typeof f.cols=="undefined"){return"<ul>\n"+i.join("")+"\n</ul>"}else{h="";for(g=0;g<i.length;g++){h+='<div class="'+f.cols.divclass+'" style="'+f.cols.inlinestyle+'">\n<ul>\n'+i[g]+"</ul>\n</div>\n"}return h}},addEvent:function(f,i,h){if(f.length>0){var g=f.shift();if(g.addEventListener){g.addEventListener(h,i,false)}else{g.attachEvent&&g.attachEvent("on"+h,function(){return i.call(g,window.event)})}this.addEvent(f,i,h)}},domready:function(c){if(dd_domreadycheck){c()}else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);c();dd_domreadycheck=true},false)}else{document.attachEvent&&document.documentElement.doScroll&&window==window.top&&function(){if(!dd_domreadycheck){try{document.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,0);return}c();dd_domreadycheck=true}}()}document.attachEvent&&parent.length>0&&this.addEvent(window,function(){c()},"load")}},addState:function(e,g){if(e.getAttribute("data-image")){var f=e.tagName=="IMG"?e:e.getElementsByTagName("img")[0];if(f){f.src=g=="add"?e.getAttribute("data-overimage"):e.getAttribute("data-image")}}else{anylinkmenu.setcssclass(e,"selectedanchor",g)}},addState:function(e,g){if(e.getAttribute("data-image")){var f=e.tagName=="IMG"?e:e.getElementsByTagName("img")[0];if(f){f.src=g=="add"?e.getAttribute("data-overimage"):e.getAttribute("data-image")}}else{anylinkmenu.setcssclass(e,"selectedanchor",g)}},setupmenu:function(h,m,l){this.standardbody=document.compatMode=="CSS1Compat"?document.documentElement:document.body;var k=m.getAttribute("rel");dropmenuid=k.replace(/\[(\w+)\]/,"");var j=window[dropmenuid],i=this.addDiv(null,j.divclass,j.inlinestyle);i.innerHTML=this.getmenuHTML(j);m=this.menusmap[h+l]={id:h+l,anchorobj:m,dropmenu:i,revealtype:k.length!=dropmenuid.length&&RegExp.$1=="click"?"click":"mouseover",orientation:m.getAttribute("rev")=="lr"?"lr":"ud",shadow:this.addDiv(null,"anylinkshadow",null)};m.anchorobj._internalID=h+l;m.anchorobj._isanchor=true;m.dropmenu._internalID=h+l;m.shadow._internalID=h+l;m.dropmenu.setcss=this.setcss;m.shadow.setcss=this.setcss;m.shadow.setcss({width:m.dropmenu.offsetWidth+"px",height:m.dropmenu.offsetHeight+"px"});this.setopacity(m.shadow,this.effects.shadow.opacity);this.addEvent([m.anchorobj,m.dropmenu,m.shadow],function(b){var c=anylinkmenu.menusmap[this._internalID];if(this._isanchor&&c.revealtype=="mouseover"&&!anylinkmenu.isContained(this,b)){anylinkmenu.showmenu(c.id);anylinkmenu.addState(this,"add")}else{typeof this._isanchor=="undefined"&&clearTimeout(c.hidetimer)}},"mouseover");this.addEvent([m.anchorobj,m.dropmenu,m.shadow],function(b){if(!anylinkmenu.isContained(this,b)){var c=anylinkmenu.menusmap[this._internalID];c.hidetimer=setTimeout(function(){anylinkmenu.addState(c.anchorobj,"remove");anylinkmenu.hidemenu(c.id)},anylinkmenu.effects.delayhide)}},"mouseout");this.addEvent([m.anchorobj],function(b){var c=anylinkmenu.menusmap[this._internalID];if(this._isanchor&&c.revealtype=="click"){if(c.dropmenu.style.visibility=="visible"){anylinkmenu.hidemenu(c.id)}else{anylinkmenu.addState(this,"add");anylinkmenu.showmenu(c.id)}b.preventDefault&&b.preventDefault();return false}else{c.hidetimer=setTimeout(function(){anylinkmenu.hidemenu(c.id)},anylinkmenu.effects.delayhide)}},"click")},init:function(c){this.domready(function(){anylinkmenu.trueinit(c)})},trueinit:function(f){for(var i=this.getElementsByClass(f),h=this.preloadimages,g=0;g<i.length;g++){if(i[g].getAttribute("data-image")){h[h.length]=new Image;h[h.length-1].src=i[g].getAttribute("data-image")}if(i[g].getAttribute("data-overimage")){h[h.length]=new Image;h[h.length-1].src=i[g].getAttribute("data-overimage")}this.setupmenu(f,i[g],g)}}};function getItemArrayFromTravelPlaces(u,t,s){for(var q=[],p=t*s,o=0;o<u.length;o++){var m=u[o],n=m.name,k=m.position,i=m.zoomLevel,w=undefined;if(k!=undefined){w="javascript:travelTo('"+n+"',"+k[0]+","+k[1]+","+i+")"}q.push([n,w,p]);if(m.subLinks!=undefined){q=q.concat(getItemArrayFromTravelPlaces(m.subLinks,t,s+1))}}return q}var directLinkMenu={divclass:"anylinkmenu",inlinestyle:"width:150px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};directLinkMenu.items=getItemArrayFromTravelPlaces(travelPlaces,10,0);linkMenu={divclass:"anylinkmenu",inlinestyle:"width:300px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};linkMenu.items=[[$("linkContent").innerHTML]];gettingStartedMenu={divclass:"anylinkmenu",inlinestyle:"width:350px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};gettingStartedMenu.items=[[$("startContent").innerHTML]];newsMenu={divclass:"anylinkmenu",inlinestyle:"width:350px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};newsMenu.items=[[$("newsContent").innerHTML]];contributeMenu={divclass:"anylinkmenu",inlinestyle:"width:350px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};contributeMenu.items=[[$("contributeContent").innerHTML]];shopMenu={divclass:"anylinkmenu",inlinestyle:"width:350px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};shopMenu.items=[[$("shopContent").innerHTML]];aboutMenu={divclass:"anylinkmenu",inlinestyle:"width:350px; background:#F8F8F8; border: 0px solid black; font-size:12px; padding:5px 5px 5px 5px;",linktarget:""};aboutMenu.items=[[$("aboutContent").innerHTML]];anylinkmenu.init("menuanchorclass");
