var Prototype={Version:"1.6.1",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;
return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var d=document.createElement("div");var b=document.createElement("form");var a=false;if(d.__proto__&&(d.__proto__!==b.__proto__)){a=true}d=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a
}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var d;for(var b=0,f=arguments.length;b<f;b++){var a=arguments[b];try{d=a();break}catch(g){}}return d}};var Class=(function(){function a(){}function b(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function e(){this.initialize.apply(this,arguments)
}Object.extend(e,Class.Methods);e.superclass=h;e.subclasses=[];if(h){a.prototype=h.prototype;e.prototype=new a;h.subclasses.push(e)}for(var f=0;f<g.length;f++){e.addMethods(g[f])}if(!e.prototype.initialize){e.prototype.initialize=Prototype.emptyFunction}e.prototype.constructor=e;return e}function d(l){var g=this.superclass&&this.superclass.prototype;var f=Object.keys(l);if(!Object.keys({toString:true}).length){if(l.toString!=Object.prototype.toString){f.push("toString")
}if(l.valueOf!=Object.prototype.valueOf){f.push("valueOf")}}for(var e=0,h=f.length;e<h;e++){var k=f[e],j=l[k];if(g&&Object.isFunction(j)&&j.argumentNames().first()=="$super"){var m=j;j=(function(n){return function(){return g[n].apply(this,arguments)}})(k).wrap(m);j.valueOf=m.valueOf.bind(m);j.toString=m.toString.bind(m)}this.prototype[k]=j}return this}return{create:b,Methods:{addMethods:d}}})();(function(){var e=Object.prototype.toString;
function k(s,u){for(var t in u){s[t]=u[t]}return s}function n(s){try{if(f(s)){return"undefined"}if(s===null){return"null"}return s.inspect?s.inspect():String(s)}catch(t){if(t instanceof RangeError){return"..."}throw t}}function m(s){var u=typeof s;switch(u){case"undefined":case"function":case"unknown":return;case"boolean":return s.toString()}if(s===null){return"null"}if(s.toJSON){return s.toJSON()}if(j(s)){return
}var t=[];for(var w in s){var v=m(s[w]);if(!f(v)){t.push(w.toJSON()+": "+v)}}return"{"+t.join(", ")+"}"}function d(s){return $H(s).toQueryString()}function g(s){return s&&s.toHTML?s.toHTML():String.interpret(s)}function q(s){var t=[];for(var u in s){t.push(u)}return t}function o(s){var t=[];for(var u in s){t.push(s[u])}return t}function l(s){return k({},s)}function j(s){return !!(s&&s.nodeType==1)}function h(s){return e.call(s)=="[object Array]"
}function r(s){return s instanceof Hash}function b(s){return typeof s==="function"}function a(s){return e.call(s)=="[object String]"}function p(s){return e.call(s)=="[object Number]"}function f(s){return typeof s==="undefined"}k(Object,{extend:k,inspect:n,toJSON:m,toQueryString:d,toHTML:g,keys:q,values:o,clone:l,isElement:j,isArray:h,isHash:r,isFunction:b,isString:a,isNumber:p,isUndefined:f})})();Object.extend(Function.prototype,(function(){var m=Array.prototype.slice;
function e(q,n){var p=q.length,o=n.length;while(o--){q[p+o]=n[o]}return q}function k(o,n){o=m.call(o,0);return e(o,n)}function h(){var n=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return n.length==1&&!n[0]?[]:n}function j(p){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var n=this,o=m.call(arguments,1);
return function(){var q=k(o,arguments);return n.apply(p,q)}}function g(p){var n=this,o=m.call(arguments,1);return function(r){var q=e([r||window.event],o);return n.apply(p,q)}}function l(){if(!arguments.length){return this}var n=this,o=m.call(arguments,0);return function(){var p=k(o,arguments);return n.apply(this,p)}}function f(p){var n=this,o=m.call(arguments,1);p=p*1000;return window.setTimeout(function(){return n.apply(n,o)
},p)}function a(){var n=e([0.01],arguments);return this.delay.apply(this,n)}function d(o){var n=this;return function(){var p=e([n.bind(this)],arguments);return o.apply(this,p)}}function b(){if(this._methodized){return this._methodized}var n=this;return this._methodized=function(){var o=e([this],arguments);return n.apply(null,o)}}return{argumentNames:h,bind:j,bindAsEventListener:g,curry:l,delay:f,defer:a,wrap:d,methodize:b}
})());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(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")
};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);
return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);
result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);
return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")
}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")
}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];
if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;
if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()
}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"
}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")
}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)
}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}
})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(e){if(a==null){return(e[1]+"")}var g=e[1]||"";if(g=="\\"){return e[2]}var b=a,h=e[3];var f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;e=f.exec(h);
if(e==null){return g}while(e!=null){var d=e[1].startsWith("[")?e[2].replace(/\\\\]/g,"]"):e[1];b=b[d];if(null==b||""==e[3]){break}h=h.substring("["==e[3]?e[1].length:e[0].length);e=f.exec(h)}return g+String.interpret(b)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function d(A,z){var y=0;try{this._each(function(C){A.call(z,C,y++)})}catch(B){if(B!=$break){throw B
}}return this}function t(B,A,z){var y=-B,C=[],D=this.toArray();if(B<1){return D}while((y+=B)<D.length){C.push(D.slice(y,y+B))}return C.collect(A,z)}function b(A,z){A=A||Prototype.K;var y=true;this.each(function(C,B){y=y&&!!A.call(z,C,B);if(!y){throw $break}});return y}function k(A,z){A=A||Prototype.K;var y=false;this.each(function(C,B){if(y=!!A.call(z,C,B)){throw $break}});return y}function l(A,z){A=A||Prototype.K;
var y=[];this.each(function(C,B){y.push(A.call(z,C,B))});return y}function v(A,z){var y;this.each(function(C,B){if(A.call(z,C,B)){y=C;throw $break}});return y}function j(A,z){var y=[];this.each(function(C,B){if(A.call(z,C,B)){y.push(C)}});return y}function h(B,A,z){A=A||Prototype.K;var y=[];if(Object.isString(B)){B=new RegExp(RegExp.escape(B))}this.each(function(D,C){if(B.match(D)){y.push(A.call(z,D,C))
}});return y}function a(y){if(Object.isFunction(this.indexOf)){if(this.indexOf(y)!=-1){return true}}var z=false;this.each(function(A){if(A==y){z=true;throw $break}});return z}function s(z,y){y=Object.isUndefined(y)?null:y;return this.eachSlice(z,function(A){while(A.length<z){A.push(y)}return A})}function n(y,A,z){this.each(function(C,B){y=A.call(z,y,C,B)});return y}function x(z){var y=$A(arguments).slice(1);
return this.map(function(A){return A[z].apply(A,y)})}function r(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C>=y){y=C}});return y}function p(A,z){A=A||Prototype.K;var y;this.each(function(C,B){C=A.call(z,C,B);if(y==null||C<y){y=C}});return y}function f(B,z){B=B||Prototype.K;var A=[],y=[];this.each(function(D,C){(B.call(z,D,C)?A:y).push(D)});return[A,y]}function g(z){var y=[];
this.each(function(A){y.push(A[z])});return y}function e(A,z){var y=[];this.each(function(C,B){if(!A.call(z,C,B)){y.push(C)}});return y}function o(z,y){return this.map(function(B,A){return{value:B,criteria:z.call(y,B,A)}}).sort(function(D,C){var B=D.criteria,A=C.criteria;return B<A?-1:B>A?1:0}).pluck("value")}function q(){return this.map()}function u(){var z=Prototype.K,y=$A(arguments);if(Object.isFunction(y.last())){z=y.pop()
}var A=[this].concat(y).map($A);return this.map(function(C,B){return z(A.pluck(B))})}function m(){return this.toArray().length}function w(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:d,eachSlice:t,all:b,every:b,any:k,some:k,collect:l,map:l,detect:v,findAll:j,select:j,filter:j,grep:h,include:a,member:a,inGroupsOf:s,inject:n,invoke:x,max:r,min:p,partition:f,pluck:g,reject:e,sortBy:o,toArray:q,entries:q,zip:u,size:m,inspect:w,find:v}
})();function $A(d){if(!d){return[]}if("toArray" in Object(d)){return d.toArray()}var b=d.length||0,a=new Array(b);while(b--){a[b]=d[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var u=Array.prototype,o=u.slice,q=u.forEach;function b(y){for(var x=0,z=this.length;x<z;x++){y(this[x])}}if(!q){q=b}function n(){this.length=0;
return this}function e(){return this[0]}function h(){return this[this.length-1]}function k(){return this.select(function(x){return x!=null})}function w(){return this.inject([],function(y,x){if(Object.isArray(x)){return y.concat(x.flatten())}y.push(x);return y})}function j(){var x=o.call(arguments,0);return this.select(function(y){return !x.include(y)})}function g(x){return(x!==false?this:this.toArray())._reverse()
}function m(x){return this.inject([],function(A,z,y){if(0==y||(x?A.last()!=z:!A.include(z))){A.push(z)}return A})}function r(x){return this.uniq().findAll(function(y){return x.detect(function(z){return y===z})})}function s(){return o.call(this,0)}function l(){return this.length}function v(){return"["+this.map(Object.inspect).join(", ")+"]"}function t(){var x=[];this.each(function(y){var z=Object.toJSON(y);
if(!Object.isUndefined(z)){x.push(z)}});return"["+x.join(", ")+"]"}function a(z,x){x||(x=0);var y=this.length;if(x<0){x=y+x}for(;x<y;x++){if(this[x]===z){return x}}return -1}function p(y,x){x=isNaN(x)?this.length:(x<0?this.length+x:x)+1;var z=this.slice(0,x).reverse().indexOf(y);return(z<0)?z:x-z-1}function d(){var C=o.call(this,0),A;for(var y=0,z=arguments.length;y<z;y++){A=arguments[y];if(Object.isArray(A)&&!("callee" in A)){for(var x=0,B=A.length;
x<B;x++){C.push(A[x])}}else{C.push(A)}}return C}Object.extend(u,Enumerable);if(!u._reverse){u._reverse=u.reverse}Object.extend(u,{_each:q,clear:n,first:e,last:h,compact:k,flatten:w,without:j,reverse:g,uniq:m,intersect:r,clone:s,toArray:s,size:l,inspect:v,toJSON:t});var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){u.concat=d}if(!u.indexOf){u.indexOf=a}if(!u.lastIndexOf){u.lastIndexOf=p
}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function f(s){this._object=Object.isHash(s)?s.toObject():Object.clone(s)}function g(t){for(var s in this._object){var u=this._object[s],v=[s,u];v.key=s;v.value=u;t(v)}}function m(s,t){return this._object[s]=t}function d(s){if(this._object[s]!==Object.prototype[s]){return this._object[s]}}function p(s){var t=this._object[s];
delete this._object[s];return t}function r(){return Object.clone(this._object)}function q(){return this.pluck("key")}function o(){return this.pluck("value")}function h(t){var s=this.detect(function(u){return u.value===t});return s&&s.key}function k(s){return this.clone().update(s)}function e(s){return new Hash(s).inject(this,function(t,u){t.set(u.key,u.value);return t})}function b(s,t){if(Object.isUndefined(t)){return s
}return s+"="+encodeURIComponent(String.interpret(t))}function a(){return this.inject([],function(u,v){var t=encodeURIComponent(v.key),s=v.value;if(s&&typeof s=="object"){if(Object.isArray(s)){return u.concat(s.map(b.curry(t)))}}else{u.push(b(t,s))}return u}).join("&")}function n(){return"#<Hash:{"+this.map(function(s){return s.map(Object.inspect).join(": ")}).join(", ")+"}>"}function l(){return Object.toJSON(this.toObject())
}function j(){return new Hash(this)}return{initialize:f,_each:g,set:m,get:d,unset:p,toObject:r,toTemplateReplacements:r,keys:q,values:o,index:h,merge:k,update:e,toQueryString:a,inspect:n,toJSON:l,clone:j}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function e(){return this.toPaddedString(2,16)}function f(){return this+1}function a(m,l){$R(0,this,true).each(m,l);return this}function b(n,m){var l=this.toString(m||10);
return"0".times(n-l.length)+l}function g(){return isFinite(this)?this.toString():"null"}function k(){return Math.abs(this)}function j(){return Math.round(this)}function h(){return Math.ceil(this)}function d(){return Math.floor(this)}return{toColorPart:e,succ:f,times:a,toPaddedString:b,toJSON:g,abs:k,round:j,ceil:h,floor:d}})());function $R(d,a,b){return new ObjectRange(d,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,e,f){this.start=g;
this.end=e;this.exclusive=f}function d(e){var f=this.start;while(this.include(f)){e(f);f=f.succ()}}function a(e){if(e<this.start){return false}if(this.exclusive){return e<this.end}return e<=this.end}return{initialize:b,_each:d,include:a}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")
})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(e,b,d,a){this.each(function(f){if(Object.isFunction(f[e])){try{f[e].apply(f,[b,d,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);
Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();
if(Object.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,b,a){$super(a);this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;
var f=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){f._method=this.method;this.method="post"}this.parameters=f;if(f=Object.toQueryString(f)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+f}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){f+="&_="}}}try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);
this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||f):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()
}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");
if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var d=this.options.requestHeaders;if(Object.isFunction(d.push)){for(var b=0,e=d.length;b<e;b+=2){f[d[b]]=d[b+1]}}else{$H(d).each(function(g){f[g.key]=g.value})}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();
return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var d=Ajax.Request.Events[a],b=new Ajax.Response(this);if(d=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)}catch(f){this.dispatchException(f)}var g=b.getHeader("Content-type");
if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&g&&g.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+d]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+d,this,b,b.headerJSON)}catch(f){this.dispatchException(f)}if(d=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction
}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())
}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(d){this.request=d;var e=this.transport=d.transport,a=this.readyState=e.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();
this.statusText=this.getStatusText();this.responseText=String.interpret(e.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=e.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()
}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)
}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,d,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};
b=Object.clone(b);var e=b.onComplete;b.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(e)){e(f,g)}}).bind(this);$super(d,b)},updateContent:function(e){var d=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){e=e.stripScripts()}if(d=$(d)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=e;d.insert(b)}else{a.insertion(d,e)
}}else{d.update(e)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,d,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=d;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;
clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)
}});function $(b){if(arguments.length>1){for(var a=0,e=[],d=arguments.length;a<d;a++){e.push($(arguments[a]))}return e}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var d=[];var f=document.evaluate(g,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,e=f.snapshotLength;
b<e;b++){d.push(Element.extend(f.snapshotItem(b)))}return d}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(d){var b=(function(){var g=document.createElement("form");
var f=document.createElement("input");var e=document.documentElement;f.setAttribute("name","test");g.appendChild(f);e.appendChild(g);var h=g.elements?(typeof g.elements.test=="undefined"):null;e.removeChild(g);g=f=null;return h})();var a=d.Element;d.Element=function(g,f){f=f||{};g=g.toLowerCase();var e=Element.cache;if(b&&f.name){g="<"+g+' name="'+f.name+'">';delete f.name;return Element.writeAttribute(document.createElement(g),f)
}if(!e[g]){e[g]=Element.extend(document.createElement(g))}return Element.writeAttribute(e[g].cloneNode(false),f)};Object.extend(d.Element,a||{});if(a){d.Element.prototype=a.prototype}})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);
a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var b=(function(){var f=document.createElement("select"),g=true;f.innerHTML='<option value="test">test</option>';if(f.options&&f.options[0]){g=f.options[0].nodeName.toUpperCase()!=="OPTION"}f=null;return g})();var a=(function(){try{var f=document.createElement("table");
if(f&&f.tBodies){f.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var h=typeof f.tBodies[0]=="undefined";f=null;return h}}catch(g){return true}})();var e=(function(){var f=document.createElement("script"),h=false;try{f.appendChild(document.createTextNode(""));h=!f.firstChild||f.firstChild&&f.firstChild.nodeType!==3}catch(g){h=true}f=null;return h})();function d(g,h){g=$(g);if(h&&h.toElement){h=h.toElement()
}if(Object.isElement(h)){return g.update().insert(h)}h=Object.toHTML(h);var f=g.tagName.toUpperCase();if(f==="SCRIPT"&&e){g.text=h;return g}if(b||a){if(f in Element._insertionTranslations.tags){while(g.firstChild){g.removeChild(g.firstChild)}Element._getContentFromAnonymousElement(f,h.stripScripts()).each(function(j){g.appendChild(j)})}else{g.innerHTML=h.stripScripts()}}else{g.innerHTML=h.stripScripts()
}h.evalScripts.bind(h).defer();return g}return d})(),replace:function(b,d){b=$(b);if(d&&d.toElement){d=d.toElement()}else{if(!Object.isElement(d)){d=Object.toHTML(d);var a=b.ownerDocument.createRange();a.selectNode(b);d.evalScripts.bind(d).defer();d=a.createContextualFragment(d.stripScripts())}}b.parentNode.replaceChild(d,b);return b},insert:function(d,f){d=$(d);if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}
}var e,g,b,h;for(var a in f){e=f[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){g(d,e);continue}e=Object.toHTML(e);b=((a=="before"||a=="after")?d.parentNode:d).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,e.stripScripts());if(a=="top"||a=="after"){h.reverse()}h.each(g.curry(d));e.evalScripts.bind(e).defer()}return d
},wrap:function(b,d,a){b=$(b);if(Object.isElement(d)){$(d).writeAttribute(a||{})}else{if(Object.isString(d)){d=new Element(d,a)}else{d=new Element("div",d)}}if(b.parentNode){b.parentNode.replaceChild(d,b)}d.appendChild(b);return d},inspect:function(b){b=$(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),d=g.last();var e=(b[f]||"").toString();if(e){a+=" "+d+"="+e.inspect(true)
}});return a+">"},recursivelyCollect:function(a,d){a=$(a);var b=[];while(a=a[d]){if(a.nodeType==1){b.push(Element.extend(a))}}return b},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild)){return[]
}while(a&&a.nodeType!=1){a=a.nextSibling}if(a){return[a].concat($(a).nextSiblings())}return[]},previousSiblings:function(a){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){if(Object.isString(a)){a=new Selector(a)
}return a.match($(b))},up:function(b,e,a){b=$(b);if(arguments.length==1){return $(b.parentNode)}var d=Element.ancestors(b);return Object.isNumber(e)?d[e]:Selector.findElement(d,e,a)},down:function(b,d,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(d)?Element.descendants(b)[d]:Element.select(b,d)[a||0]},previous:function(b,e,a){b=$(b);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(b))
}var d=Element.previousSiblings(b);return Object.isNumber(e)?d[e]:Selector.findElement(d,e,a)},next:function(d,e,b){d=$(d);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(d))}var a=Element.nextSiblings(d);return Object.isNumber(e)?a[e]:Selector.findElement(a,e,b)},select:function(b){var a=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(b,a)},adjacent:function(b){var a=Array.prototype.slice.call(arguments,1);
return Selector.findChildElements(b.parentNode,a).without(b)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(d,a){d=$(d);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](d,a)}if(b.names[a]){a=b.names[a]
}if(a.include(":")){return(!d.attributes||!d.attributes[a])?null:d.attributes[a].value}}return d.getAttribute(a)},writeAttribute:function(f,d,g){f=$(f);var b={},e=Element._attributeTranslations.write;if(typeof d=="object"){b=d}else{b[d]=Object.isUndefined(g)?true:g}for(var a in b){d=e.names[a]||a;g=b[a];if(e.values[a]){d=e.values[a](f,g)}if(g===false||g===null){f.removeAttribute(d)}else{if(g===true){f.setAttribute(d,d)
}else{f.setAttribute(d,g)}}}return f},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a))){return}var d=a.className;return(d.length>0&&(d==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(d)))},addClassName:function(a,b){if(!(a=$(a))){return
}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,b){if(!(a=$(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=$(b);var d=b.firstChild;
while(d){var a=d.nextSibling;if(d.nodeType==3&&!/\S/.test(d.nodeValue)){b.removeChild(d)}d=a}return b},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,a){b=$(b),a=$(a);if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=$(a);var b=Element.cumulativeOffset(a);
window.scrollTo(b[0],b[1]);return a},getStyle:function(b,d){b=$(b);d=d=="float"?"cssFloat":d.camelize();var e=b.style[d];if(!e||e=="auto"){var a=document.defaultView.getComputedStyle(b,null);e=a?a[d]:null}if(d=="opacity"){return e?parseFloat(e):1}return e=="auto"?null:e},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(b,d){b=$(b);var f=b.style,a;if(Object.isString(d)){b.style.cssText+=";"+d;
return d.include("opacity")?b.setOpacity(d.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var e in d){if(e=="opacity"){b.setOpacity(d[e])}else{f[(e=="float"||e=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):e]=d[e]}}return b},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},getDimensions:function(d){d=$(d);var h=Element.getStyle(d,"display");
if(h!="none"&&h!=null){return{width:d.offsetWidth,height:d.offsetHeight}}var b=d.style;var g=b.visibility;var e=b.position;var a=b.display;b.visibility="hidden";if(e!="fixed"){b.position="absolute"}b.display="block";var j=d.clientWidth;var f=d.clientHeight;b.display=a;b.position=e;b.visibility=g;return{width:j,height:f}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;
a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"
}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},cumulativeOffset:function(b){var a=0,d=0;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;b=b.offsetParent}while(b);return Element._returnOffset(d,a)},positionedOffset:function(b){var a=0,e=0;do{a+=b.offsetTop||0;e+=b.offsetLeft||0;b=b.offsetParent;if(b){if(b.tagName.toUpperCase()=="BODY"){break
}var d=Element.getStyle(b,"position");if(d!=="static"){break}}}while(b);return Element._returnOffset(e,a)},absolutize:function(b){b=$(b);if(Element.getStyle(b,"position")=="absolute"){return b}var e=Element.positionedOffset(b);var g=e[1];var f=e[0];var d=b.clientWidth;var a=b.clientHeight;b._originalLeft=f-parseFloat(b.style.left||0);b._originalTop=g-parseFloat(b.style.top||0);b._originalWidth=b.style.width;
b._originalHeight=b.style.height;b.style.position="absolute";b.style.top=g+"px";b.style.left=f+"px";b.style.width=d+"px";b.style.height=a+"px";return b},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative"){return a}a.style.position="relative";var d=parseFloat(a.style.top||0)-(a._originalTop||0);var b=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=d+"px";a.style.left=b+"px";
a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(b){var a=0,d=0;do{a+=b.scrollTop||0;d+=b.scrollLeft||0;b=b.parentNode}while(b);return Element._returnOffset(d,a)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return $(a)
}}return $(document.body)},viewportOffset:function(e){var a=0,d=0;var b=e;do{a+=b.offsetTop||0;d+=b.offsetLeft||0;if(b.offsetParent==document.body&&Element.getStyle(b,"position")=="absolute"){break}}while(b=b.offsetParent);b=e;do{if(!Prototype.Browser.Opera||(b.tagName&&(b.tagName.toUpperCase()=="BODY"))){a-=b.scrollTop||0;d-=b.scrollLeft||0}}while(b=b.parentNode);return Element._returnOffset(d,a)},clonePosition:function(b,e){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
e=$(e);var f=Element.viewportOffset(e);b=$(b);var g=[0,0];var d=null;if(Element.getStyle(b,"position")=="absolute"){d=Element.getOffsetParent(b);g=Element.viewportOffset(d)}if(d==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=e.offsetWidth+"px"
}if(a.setHeight){b.style.height=e.offsetHeight+"px"}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(e,b,d){switch(d){case"left":case"top":case"right":case"bottom":if(e(b,"position")==="static"){return null
}case"height":case"width":if(!Element.visible(b)){return null}var f=parseInt(e(b,d),10);if(f!==b["offset"+d.capitalize()]){return f+"px"}var a;if(d==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(f,function(g,h){var j=e(b,h);return j===null?g:g-parseInt(j,10)})+"px";
default:return e(b,d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(d,a,b){if(b==="title"){return a.title}return d(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(d,b){b=$(b);try{b.offsetParent}catch(g){return $(document.body)}var a=b.getStyle("position");if(a!=="static"){return d(b)}b.setStyle({position:"relative"});
var f=d(b);b.setStyle({position:a});return f});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(g,d){d=$(d);try{d.offsetParent}catch(j){return Element._returnOffset(0,0)}var b=d.getStyle("position");if(b!=="static"){return g(d)}var f=d.getOffsetParent();if(f.nodeName!="#document"){if(f&&f.getStyle("position")==="fixed"){f.setStyle({zoom:1})}d.setStyle({position:"relative"});
var h=g(d);d.setStyle({position:b});return h}else{return Element._returnOffset(0,0)}})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(b,a){try{a.offsetParent}catch(d){return Element._returnOffset(0,0)}return b(a)});Element.Methods.getStyle=function(a,b){a=$(a);if(a.nodeName!="#document"){b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var d=a.style[b];if(!d&&a.currentStyle){d=a.currentStyle[b]
}if(b=="opacity"){if((d=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/))){if(d[1]){return parseFloat(d[1])/100}}return 1}if(d=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return d}return null};Element.Methods.setOpacity=function(b,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"")}b=$(b);var a=b.currentStyle;
if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var e=b.getStyle("filter"),d=b.style;if(f==1||f===""){(e=g(e))?d.filter=e:d.removeAttribute("filter");return b}else{if(f<0.00001){f=0}}d.filter=g(e)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var b="className";var a="for";var d=document.createElement("div");d.setAttribute(b,"x");if(d.className!=="x"){d.setAttribute("class","x");
if(d.className==="x"){b="class"}}d=null;d=document.createElement("label");d.setAttribute(a,"x");if(d.htmlFor!=="x"){d.setAttribute("htmlFor","x");if(d.htmlFor==="x"){a="htmlFor"}}d=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(e,f){return e.getAttribute(f)},_getAttr2:function(e,f){return e.getAttribute(f,2)},_getAttrNode:function(e,g){var f=e.getAttributeNode(g);
return f?f.value:""},_getEv:(function(){var e=document.createElement("div");e.onclick=Prototype.emptyFunction;var h=e.getAttribute("onclick");var g;if(String(h).indexOf("{")>-1){g=function(f,j){j=f.getAttribute(j);if(!j){return null}j=j.toString();j=j.split("{")[1];j=j.split("}")[0];return j.strip()}}else{if(h===""){g=function(f,j){j=f.getAttribute(j);if(!j){return null}return j.strip()}}}e=null;return g
})(),_flag:function(e,f){return $(e).hasAttribute(f)?f:null},style:function(e){return e.style.cssText.toLowerCase()},title:function(e){return e.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:""}}};
Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})
})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),e=[];for(var d=0,g;g=b[d];d++){if(g.tagName!=="!"){e.push(g)}}return e}Element.Methods.down=function(d,e,b){d=$(d);if(arguments.length==1){return d.firstDescendant()}return Object.isNumber(e)?a(d)[e]:Element.select(d,e)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);
a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var f=document.createTextNode(" ");a.appendChild(f);a.removeChild(f)}catch(d){}}}return a};Element.Methods.cumulativeOffset=function(b){var a=0,d=0;
do{a+=b.offsetTop||0;d+=b.offsetLeft||0;if(b.offsetParent==document.body){if(Element.getStyle(b,"position")=="absolute"){break}}b=b.offsetParent}while(b);return Element._returnOffset(d,a)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(d,f){d=$(d);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){d.parentNode.replaceChild(f,d);return d}f=Object.toHTML(f);var e=d.parentNode,b=e.tagName.toUpperCase();
if(Element._insertionTranslations.tags[b]){var g=d.next();var a=Element._getContentFromAnonymousElement(b,f.stripScripts());e.removeChild(d);if(g){a.each(function(h){e.insertBefore(h,g)})}else{a.each(function(h){e.appendChild(h)})}}else{d.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return d}}Element._returnOffset=function(b,d){var a=[b,d];a.left=b;a.top=d;return a};Element._getContentFromAnonymousElement=function(d,b){var e=new Element("div"),a=Element._insertionTranslations.tags[d];
if(a){e.innerHTML=a[0]+b+a[1];a[2].times(function(){e=e.firstChild})}else{e.innerHTML=b}return $A(e.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,d){d=Element._attributeTranslations.has[d]||d;var b=$(a).getAttributeNode(d);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};
window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function d(h){if(typeof window.Element!="undefined"){var k=window.Element.prototype;if(k){var m="_"+(Math.random()+"").slice(2);var j=document.createElement(h);k[m]="x";var l=(j[m]!=="x");delete k[m];j=null;return l}}return false}function b(j,h){for(var l in h){var k=h[l];
if(Object.isFunction(k)&&!(l in j)){j[l]=k.methodize()}}}var e=d("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(e){return function(j){if(j&&typeof j._extendedByPrototype=="undefined"){var h=j.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(j,Element.Methods);b(j,Element.Methods.Simulated);b(j,Element.Methods.ByTag[h.toUpperCase()])}}return j}}return Prototype.K}var a={},f=Element.Methods.ByTag;
var g=Object.extend(function(k){if(!k||typeof k._extendedByPrototype!="undefined"||k.nodeType!=1||k==window){return k}var h=Object.clone(a),j=k.tagName.toUpperCase();if(f[j]){Object.extend(h,f[j])}b(k,h);k._extendedByPrototype=Prototype.emptyFunction;return k},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)
}}});g.refresh();return g})();Element.hasAttribute=function(a,b){if(a.hasAttribute){return a.hasAttribute(b)}return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(d){var k=Prototype.BrowserFeatures,e=Element.Methods.ByTag;if(!d){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})
}if(arguments.length==2){var b=d;d=arguments[1]}if(!b){Object.extend(Element.Methods,d||{})}else{if(Object.isArray(b)){b.each(h)}else{h(b)}}function h(m){m=m.toUpperCase();if(!Element.Methods.ByTag[m]){Element.Methods.ByTag[m]={}}Object.extend(Element.Methods.ByTag[m],d)}function a(o,n,m){m=m||false;for(var q in o){var p=o[q];if(!Object.isFunction(p)){continue}if(!m||!(q in n)){n[q]=p.methodize()}}}function f(p){var m;
var o={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};
if(o[p]){m="HTML"+o[p]+"Element"}if(window[m]){return window[m]}m="HTML"+p+"Element";if(window[m]){return window[m]}m="HTML"+p.capitalize()+"Element";if(window[m]){return window[m]}var n=document.createElement(p);var q=n.__proto__||n.constructor.prototype;n=null;return q}var j=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(k.ElementExtensions){a(Element.Methods,j);a(Element.Methods.Simulated,j,true)
}if(k.SpecificElementExtensions){for(var l in Element.Methods.ByTag){var g=f(l);if(Object.isUndefined(g)){continue}a(e[l],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)
}};(function(b){var h=Prototype.Browser,f=document,d,e={};function a(){if(h.WebKit&&!f.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(j){if(!d){d=a()}e[j]="client"+j;b["get"+j]=function(){return d[e[j]]};return b["get"+j]()}b.getWidth=g.curry("Width");b.getHeight=g.curry("Height")})(document.viewport);
Element.Storage={UID:1};Element.addMethods({getStorage:function(b){if(!(b=$(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=[Element.Storage.UID++]}a=b._prototypeUID[0]}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(b,a,d){if(!(b=$(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,d)
}return b},retrieve:function(d,b,a){if(!(d=$(d))){return}var f=Element.getStorage(d),e=f.get(b);if(Object.isUndefined(e)){f.set(b,a);e=a}return e},clone:function(d,a){if(!(d=$(d))){return}var f=d.cloneNode(a);f._prototypeUID=void 0;if(a){var e=Element.select(f,"*"),b=e.length;while(b--){e[b]._prototypeUID=void 0}}return Element.extend(f)}});var Selector=Class.create({initialize:function(a){this.expression=a.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 a=(function(){var f=false;if(document.evaluate&&window.XPathResult){var e=document.createElement("div");e.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var d=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";
var b=document.evaluate(d,e,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);f=(b.snapshotLength!==2);e=null}return f})();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(a){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(a){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];
while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var j=this.expression,k=Selector.patterns,d=Selector.xpath,h,b,a=k.length,f;
if(Selector._cache[j]){this.xpath=Selector._cache[j];return}this.matcher=[".//*"];while(j&&h!=j&&(/\S/).test(j)){h=j;for(var g=0;g<a;g++){f=k[g].name;if(b=j.match(k[g].re)){this.matcher.push(Object.isFunction(d[f])?d[f](b):new Template(d[f]).evaluate(b));j=j.replace(b[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;
var d=this.expression,b;switch(this.mode){case"selectorsAPI":if(a!==document){var f=a.id,g=$(a).identify();g=g.replace(/([\.:])/g,"\\$1");d="#"+g+" "+d}b=$A(a.querySelectorAll(d)).map(Element.extend);a.id=f;return b;case"xpath":return document._getElementsByXPath(this.xpath,a);default:return this.matcher(a)}},match:function(l){this.tokens=[];var r=this.expression,a=Selector.patterns,g=Selector.assertions;
var b,f,h,q=a.length,d;while(r&&b!==r&&(/\S/).test(r)){b=r;for(var k=0;k<q;k++){f=a[k].re;d=a[k].name;if(h=r.match(f)){if(g[d]){this.tokens.push([d,Object.clone(h)]);r=r.replace(h[0],"")}else{return this.findElements(document).include(l)}}}}var o=true,d,n;for(var k=0,j;j=this.tokens[k];k++){d=j[0],n=j[1];if(!Selector.assertions[d](l,n)){o=false;break}}return o},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"),a=document.createElement("span");d.id="prototype_test_id";a.className="Test";d.appendChild(a);var b=(d.querySelector("#prototype_test_id .test")!==null);d=a=null;
return b})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(a){if(a[1]=="*"){return""}return"[local-name()='"+a[1].toLowerCase()+"' or local-name()='"+a[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(a){a[1]=a[1].toLowerCase();
return new Template("[@#{1}]").evaluate(a)},attr:function(a){a[1]=a[1].toLowerCase();a[3]=a[5]||a[6];return new Template(Selector.xpath.operators[a[2]]).evaluate(a)},pseudo:function(a){var b=Selector.xpath.pseudos[a[1]];if(!b){return""}if(Object.isFunction(b)){return b(a)}return new Template(Selector.xpath.pseudos[a[1]]).evaluate(a)},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(g){var k=g[6],d=Selector.patterns,l=Selector.xpath,a,n,j=d.length,b;
var f=[];while(k&&a!=k&&(/\S/).test(k)){a=k;for(var h=0;h<j;h++){b=d[h].name;if(g=k.match(d[h].re)){n=Object.isFunction(l[b])?l[b](g):new Template(l[b]).evaluate(g);f.push("("+n.substring(1,n.length-1)+")");k=k.replace(g[0],"");break}}}return"[not("+f.join(" and ")+")]"},"nth-child":function(a){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",a)},"nth-last-child":function(a){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",a)
},"nth-of-type":function(a){return Selector.xpath.pseudos.nth("position() ",a)},"nth-last-of-type":function(a){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",a)},"first-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-of-type"](a)},"last-of-type":function(a){a[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](a)},"only-of-type":function(a){var b=Selector.xpath.pseudos;
return b["first-of-type"](a)+b["last-of-type"](a)},nth:function(h,f){var j,k=f[6],e;if(k=="even"){k="2n+0"}if(k=="odd"){k="2n+1"}if(j=k.match(/^(\d+)$/)){return"["+h+"= "+j[1]+"]"}if(j=k.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(j[1]=="-"){j[1]=-1}var g=j[1]?Number(j[1]):1;var d=j[2]?Number(j[2]):0;e="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(e).evaluate({fragment:h,a:g,b:d})
}}}},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(a){a[3]=(a[5]||a[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(a)},pseudo:function(a){if(a[6]){a[6]=a[6].replace(/"/g,'\\"')
}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(a)},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(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()
},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(b,d){var a=Element.readAttribute(b,d[1]);return a&&Selector.operators[d[2]](a,d[5]||d[6])}},handlers:{concat:function(e,d){for(var f=0,g;g=d[f];f++){e.push(g)}return e},mark:function(a){var e=Prototype.emptyFunction;for(var b=0,d;
d=a[b];b++){d._countedByPrototype=e}return a},unmark:(function(){var a=(function(){var b=document.createElement("div"),f=false,e="_countedByPrototype",d="x";b[e]=d;f=(b.getAttribute(e)===d);b=null;return f})();return a?function(b){for(var d=0,e;e=b[d];d++){e.removeAttribute("_countedByPrototype")}return b}:function(b){for(var d=0,e;e=b[d];d++){e._countedByPrototype=void 0}return b}})(),index:function(a,e,h){a._countedByPrototype=Prototype.emptyFunction;
if(e){for(var b=a.childNodes,f=b.length-1,d=1;f>=0;f--){var g=b[f];if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=d++}}}else{for(var f=0,d=1,b=a.childNodes;g=b[f];f++){if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=d++}}}},unique:function(b){if(b.length==0){return b}var e=[],f;for(var d=0,a=b.length;d<a;d++){if(typeof(f=b[d])._countedByPrototype=="undefined"){f._countedByPrototype=Prototype.emptyFunction;
e.push(Element.extend(f))}}return Selector.handlers.unmark(e)},descendant:function(a){var e=Selector.handlers;for(var d=0,b=[],f;f=a[d];d++){e.concat(b,f.getElementsByTagName("*"))}return b},child:function(a){var f=Selector.handlers;for(var e=0,d=[],g;g=a[e];e++){for(var b=0,k;k=g.childNodes[b];b++){if(k.nodeType==1&&k.tagName!="!"){d.push(k)}}}return d},adjacent:function(a){for(var d=0,b=[],f;f=a[d];
d++){var e=this.nextElementSibling(f);if(e){b.push(e)}}return b},laterSibling:function(a){var e=Selector.handlers;for(var d=0,b=[],f;f=a[d];d++){e.concat(b,Element.nextSiblings(f))}return b},nextElementSibling:function(a){while(a=a.nextSibling){if(a.nodeType==1){return a}}return null},previousElementSibling:function(a){while(a=a.previousSibling){if(a.nodeType==1){return a}}return null},tagName:function(a,k,d,b){var l=d.toUpperCase();
var f=[],j=Selector.handlers;if(a){if(b){if(b=="descendant"){for(var g=0,e;e=a[g];g++){j.concat(f,e.getElementsByTagName(d))}return f}else{a=this[b](a)}if(d=="*"){return a}}for(var g=0,e;e=a[g];g++){if(e.tagName.toUpperCase()===l){f.push(e)}}return f}else{return k.getElementsByTagName(d)}},id:function(a,m,b,d){var l=$(b),k=Selector.handlers;if(m==document){if(!l){return[]}if(!a){return[l]}}else{if(!m.sourceIndex||m.sourceIndex<1){var a=m.getElementsByTagName("*");
for(var f=0,e;e=a[f];f++){if(e.id===b){return[e]}}}}if(a){if(d){if(d=="child"){for(var g=0,e;e=a[g];g++){if(l.parentNode==e){return[l]}}}else{if(d=="descendant"){for(var g=0,e;e=a[g];g++){if(Element.descendantOf(l,e)){return[l]}}}else{if(d=="adjacent"){for(var g=0,e;e=a[g];g++){if(Selector.handlers.previousElementSibling(l)==e){return[l]}}}else{a=k[d](a)}}}}for(var g=0,e;e=a[g];g++){if(e==l){return[l]
}}return[]}return(l&&Element.descendantOf(l,m))?[l]:[]},className:function(b,a,d,e){if(b&&e){b=this[e](b)}return Selector.handlers.byClassName(b,a,d)},byClassName:function(d,b,g){if(!d){d=Selector.handlers.descendant([b])}var j=" "+g+" ";for(var f=0,e=[],h,a;h=d[f];f++){a=h.className;if(a.length==0){continue}if(a==g||(" "+a+" ").include(j)){e.push(h)}}return e},attrPresence:function(d,b,a,h){if(!d){d=b.getElementsByTagName("*")
}if(d&&h){d=this[h](d)}var f=[];for(var e=0,g;g=d[e];e++){if(Element.hasAttribute(g,a)){f.push(g)}}return f},attr:function(a,k,j,l,d,b){if(!a){a=k.getElementsByTagName("*")}if(a&&b){a=this[b](a)}var m=Selector.operators[d],g=[];for(var f=0,e;e=a[f];f++){var h=Element.readAttribute(e,j);if(h===null){continue}if(m(h,l)){g.push(e)}}return g},pseudo:function(b,d,f,a,e){if(b&&e){b=this[e](b)}if(!b){b=a.getElementsByTagName("*")
}return Selector.pseudos[d](b,f,a)}},pseudos:{"first-child":function(b,g,a){for(var e=0,d=[],f;f=b[e];e++){if(Selector.handlers.previousElementSibling(f)){continue}d.push(f)}return d},"last-child":function(b,g,a){for(var e=0,d=[],f;f=b[e];e++){if(Selector.handlers.nextElementSibling(f)){continue}d.push(f)}return d},"only-child":function(b,j,a){var f=Selector.handlers;for(var e=0,d=[],g;g=b[e];e++){if(!f.previousElementSibling(g)&&!f.nextElementSibling(g)){d.push(g)
}}return d},"nth-child":function(b,d,a){return Selector.pseudos.nth(b,d,a)},"nth-last-child":function(b,d,a){return Selector.pseudos.nth(b,d,a,true)},"nth-of-type":function(b,d,a){return Selector.pseudos.nth(b,d,a,false,true)},"nth-last-of-type":function(b,d,a){return Selector.pseudos.nth(b,d,a,true,true)},"first-of-type":function(b,d,a){return Selector.pseudos.nth(b,"1",a,false,true)},"last-of-type":function(b,d,a){return Selector.pseudos.nth(b,"1",a,true,true)
},"only-of-type":function(b,e,a){var d=Selector.pseudos;return d["last-of-type"](d["first-of-type"](b,e,a),e,a)},getIndices:function(e,d,f){if(e==0){return d>0?[d]:[]}return $R(1,f).inject([],function(a,b){if(0==(b-d)%e&&(b-d)/e>=0){a.push(b)}return a})},nth:function(d,t,v,s,f){if(d.length==0){return[]}if(t=="even"){t="2n+0"}if(t=="odd"){t="2n+1"}var r=Selector.handlers,q=[],e=[],k;r.mark(d);for(var p=0,g;
g=d[p];p++){if(!g.parentNode._countedByPrototype){r.index(g.parentNode,s,f);e.push(g.parentNode)}}if(t.match(/^\d+$/)){t=Number(t);for(var p=0,g;g=d[p];p++){if(g.nodeIndex==t){q.push(g)}}}else{if(k=t.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(k[1]=="-"){k[1]=-1}var w=k[1]?Number(k[1]):1;var u=k[2]?Number(k[2]):0;var x=Selector.pseudos.getIndices(w,u,d.length);for(var p=0,g,n=x.length;g=d[p];p++){for(var o=0;
o<n;o++){if(g.nodeIndex==x[o]){q.push(g)}}}}}r.unmark(d);r.unmark(e);return q},empty:function(b,g,a){for(var e=0,d=[],f;f=b[e];e++){if(f.tagName=="!"||f.firstChild){continue}d.push(f)}return d},not:function(a,e,l){var j=Selector.handlers,n,d;var k=new Selector(e).findElements(l);j.mark(k);for(var g=0,f=[],b;b=a[g];g++){if(!b._countedByPrototype){f.push(b)}}j.unmark(k);return f},enabled:function(b,g,a){for(var e=0,d=[],f;
f=b[e];e++){if(!f.disabled&&(!f.type||f.type!=="hidden")){d.push(f)}}return d},disabled:function(b,g,a){for(var e=0,d=[],f;f=b[e];e++){if(f.disabled){d.push(f)}}return d},checked:function(b,g,a){for(var e=0,d=[],f;f=b[e];e++){if(f.checked){d.push(f)}}return d}},operators:{"=":function(b,a){return b==a},"!=":function(b,a){return b!=a},"^=":function(b,a){return b==a||b&&b.startsWith(a)},"$=":function(b,a){return b==a||b&&b.endsWith(a)
},"*=":function(b,a){return b==a||b&&b.include(a)},"~=":function(b,a){return(" "+b+" ").include(" "+a+" ")},"|=":function(b,a){return("-"+(b||"").toUpperCase()+"-").include("-"+(a||"").toUpperCase()+"-")}},split:function(b){var a=[];b.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(d){a.push(d[1].strip())});return a},matchElements:function(g,j){var f=$$(j),e=Selector.handlers;e.mark(f);for(var d=0,b=[],a;
a=g[d];d++){if(a._countedByPrototype){b.push(a)}}e.unmark(f);return b},findElement:function(b,d,a){if(Object.isNumber(d)){a=d;d=false}return Selector.matchElements(b,d||"*")[a||0]},findChildElements:function(f,j){j=Selector.split(j.join(","));var e=[],g=Selector.handlers;for(var d=0,b=j.length,a;d<b;d++){a=new Selector(j[d].strip());g.concat(e,a.findElements(f))}return(b>1)?g.unique(e):e}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(e,d){for(var f=0,g;
g=d[f];f++){if(g.tagName!=="!"){e.push(g)}}return e}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(h,b){if(typeof b!="object"){b={hash:!!b}}else{if(Object.isUndefined(b.hash)){b.hash=true}}var d,g,a=false,f=b.submit;var e=h.inject({},function(j,k){if(!k.disabled&&k.name){d=k.name;g=$(k).getValue();
if(g!=null&&k.type!="file"&&(k.type!="submit"||(!a&&f!==false&&(!f||d==f)&&(a=true)))){if(d in j){if(!Object.isArray(j[d])){j[d]=[j[d]]}j[d].push(g)}else{j[d]=g}}}return j});return b.hash?e:Object.toQueryString(e)}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var g=$(f).getElementsByTagName("*"),e,a=[],d=Form.Element.Serializers;
for(var b=0;e=g[b];b++){a.push(e)}return a.inject([],function(h,j){if(d[j.tagName.toLowerCase()]){h.push(Element.extend(j))}return h})},getInputs:function(h,d,e){h=$(h);var a=h.getElementsByTagName("input");if(!d&&!e){return $A(a).map(Element.extend)}for(var f=0,j=[],g=a.length;f<g;f++){var b=a[f];if((d&&b.type!=d)||(e&&b.name!=e)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=$(a);
Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var d=$(b).getElements().findAll(function(e){return"hidden"!=e.type&&!e.disabled});var a=d.findAll(function(e){return e.hasAttribute("tabIndex")&&e.tabIndex>=0}).sortBy(function(e){return e.tabIndex}).first();return a?a:d.find(function(e){return/^(?:input|select|textarea)$/i.test(e.tagName)
})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(b,a){b=$(b),a=Object.clone(a||{});var e=a.parameters,d=b.readAttribute("action")||"";if(d.blank()){d=window.location.href}a.parameters=b.serialize(true);if(e){if(Object.isString(e)){e=e.toQueryParams()}Object.extend(a.parameters,e)}if(b.hasAttribute("method")&&!a.method){a.method=b.method}return new Ajax.Request(d,a)
}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var d={};d[a.name]=b;return Object.toQueryString(d)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);
var d=a.tagName.toLowerCase();Form.Element.Serializers[d](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);
a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b)){return a.checked?a.value:null}else{a.checked=!!b}},textarea:function(a,b){if(Object.isUndefined(b)){return a.value
}else{a.value=b}},select:function(d,g){if(Object.isUndefined(g)){return this[d.type=="select-one"?"selectOne":"selectMany"](d)}else{var b,e,h=!Object.isArray(g);for(var a=0,f=d.length;a<f;a++){b=d.options[a];e=this.optionValue(b);if(h){if(e==g){b.selected=true;return}}else{b.selected=g.include(e)}}}},selectOne:function(b){var a=b.selectedIndex;return a>=0?this.optionValue(b.options[a]):null},selectMany:function(e){var a,f=e.length;
if(!f){return null}for(var d=0,a=[];d<f;d++){var b=e.options[d];if(b.selected){a.push(this.optionValue(b))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,d){$super(d,b);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);
this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()
}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));
break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var x={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};
var f=document.documentElement;var y="onmouseenter" in f&&"onmouseleave" in f;var q;if(Prototype.Browser.IE){var j={0:1,1:4,2:2};q=function(A,z){return A.button===j[z]}}else{if(Prototype.Browser.WebKit){q=function(A,z){switch(z){case 0:return A.which==1&&!A.metaKey;case 1:return A.which==1&&A.metaKey;default:return false}}}else{q=function(A,z){return A.which?(A.which===z+1):(A.button===z)}}}function t(z){return q(z,0)
}function s(z){return q(z,1)}function m(z){return q(z,2)}function d(B){B=x.extend(B);var A=B.target,z=B.type,C=B.currentTarget;if(C&&C.tagName){if(z==="load"||z==="error"||(z==="click"&&C.tagName.toLowerCase()==="input"&&C.type==="radio")){A=C}}if(A.nodeType==Node.TEXT_NODE){A=A.parentNode}return Element.extend(A)}function o(A,C){var z=x.element(A);if(!C){return z}var B=[z].concat(z.ancestors());return Selector.findElement(B,C,0)
}function r(z){return{x:b(z),y:a(z)}}function b(B){var A=document.documentElement,z=document.body||{scrollLeft:0};return B.pageX||(B.clientX+(A.scrollLeft||z.scrollLeft)-(A.clientLeft||0))}function a(B){var A=document.documentElement,z=document.body||{scrollTop:0};return B.pageY||(B.clientY+(A.scrollTop||z.scrollTop)-(A.clientTop||0))}function p(z){x.extend(z);z.preventDefault();z.stopPropagation();
z.stopped=true}x.Methods={isLeftClick:t,isMiddleClick:s,isRightClick:m,element:d,findElement:o,pointer:r,pointerX:b,pointerY:a,stop:p};var v=Object.keys(x.Methods).inject({},function(z,A){z[A]=x.Methods[A].methodize();return z});if(Prototype.Browser.IE){function h(A){var z;switch(A.type){case"mouseover":z=A.fromElement;break;case"mouseout":z=A.toElement;break;default:return null}return Element.extend(z)
}Object.extend(v,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});x.extend=function(A,z){if(!A){return false}if(A._extendedByPrototype){return A}A._extendedByPrototype=Prototype.emptyFunction;var B=x.pointer(A);Object.extend(A,{target:A.srcElement||z,relatedTarget:h(A),pageX:B.x,pageY:B.y});return Object.extend(A,v)
}}else{x.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(x.prototype,v);x.extend=Prototype.K}function n(D,C,E){var B=Element.retrieve(D,"prototype_event_registry");if(Object.isUndefined(B)){e.push(D);B=Element.retrieve(D,"prototype_event_registry",$H())}var z=B.get(C);if(Object.isUndefined(z)){z=[];B.set(C,z)}if(z.pluck("handler").include(E)){return false
}var A;if(C.include(":")){A=function(F){if(Object.isUndefined(F.eventName)){return false}if(F.eventName!==C){return false}x.extend(F,D);E.call(D,F)}}else{if(!y&&(C==="mouseenter"||C==="mouseleave")){if(C==="mouseenter"||C==="mouseleave"){A=function(G){x.extend(G,D);var F=G.relatedTarget;while(F&&F!==D){try{F=F.parentNode}catch(H){F=D}}if(F===D){return}E.call(D,G)}}}else{A=function(F){x.extend(F,D);
E.call(D,F)}}}A.handler=E;z.push(A);return A}function g(){for(var z=0,A=e.length;z<A;z++){x.stopObserving(e[z]);e[z]=null}}var e=[];if(Prototype.Browser.IE){window.attachEvent("onunload",g)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var l=Prototype.K;if(!y){l=function(A){var z={mouseenter:"mouseover",mouseleave:"mouseout"};return A in z?z[A]:A}}function u(C,B,D){C=$(C);
var A=n(C,B,D);if(!A){return C}if(B.include(":")){if(C.addEventListener){C.addEventListener("dataavailable",A,false)}else{C.attachEvent("ondataavailable",A);C.attachEvent("onfilterchange",A)}}else{var z=l(B);if(C.addEventListener){C.addEventListener(z,A,false)}else{C.attachEvent("on"+z,A)}}return C}function k(E,C,F){E=$(E);var B=Element.retrieve(E,"prototype_event_registry");if(Object.isUndefined(B)){return E
}if(C&&!F){var D=B.get(C);if(Object.isUndefined(D)){return E}D.each(function(G){Element.stopObserving(E,C,G.handler)});return E}else{if(!C){B.each(function(I){var G=I.key,H=I.value;H.each(function(J){Element.stopObserving(E,G,J.handler)})});return E}}var D=B.get(C);if(!D){return}var A=D.find(function(G){return G.handler===F});if(!A){return E}var z=l(C);if(C.include(":")){if(E.removeEventListener){E.removeEventListener("dataavailable",A,false)
}else{E.detachEvent("ondataavailable",A);E.detachEvent("onfilterchange",A)}}else{if(E.removeEventListener){E.removeEventListener(z,A,false)}else{E.detachEvent("on"+z,A)}}B.set(C,D.without(A));return E}function w(C,B,A,z){C=$(C);if(Object.isUndefined(z)){z=true}if(C==document&&document.createEvent&&!C.dispatchEvent){C=document.documentElement}var D;if(document.createEvent){D=document.createEvent("HTMLEvents");
D.initEvent("dataavailable",true,true)}else{D=document.createEventObject();D.eventType=z?"ondataavailable":"onfilterchange"}D.eventName=B;D.memo=A||{};if(document.createEvent){C.dispatchEvent(D)}else{C.fireEvent(D.eventType,D)}return x.extend(D)}Object.extend(x,x.Methods);Object.extend(x,{fire:w,observe:u,stopObserving:k});Element.addMethods({fire:w,observe:u,stopObserving:k});Object.extend(document,{fire:w.methodize(),observe:u.methodize(),stopObserving:k.methodize(),loaded:false});
if(window.Event){Object.extend(window.Event,x)}else{window.Event=x}})();(function(){var e;function a(){if(document.loaded){return}if(e){window.clearTimeout(e)}document.loaded=true;document.fire("dom:loaded")}function d(){if(document.readyState==="complete"){document.stopObserving("readystatechange",d);a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){e=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)
}else{document.observe("readystatechange",d);if(window==top){e=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})
},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,d){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,d)
}this.xcomp=a;this.ycomp=d;this.offset=Element.cumulativeOffset(b);return(d>=this.offset[1]&&d<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,e){var d=Element.cumulativeScrollOffset(b);this.xcomp=a+d[0]-this.deltaX;this.ycomp=e+d[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)
},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();
return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,d,a){a=a||{};return Element.clonePosition(d,b,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(d){return d.blank()?null:"[contains(concat(' ', @class, ' '), ' "+d+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(d,f){f=f.toString().strip();
var e=/\s/.test(f)?$w(f).map(a).join(""):a(f);return e?document._getElementsByXPath(".//*"+e,d):[]}:function(f,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&&!g){return h}var d=$(f).getElementsByTagName("*");g=" "+g+" ";for(var e=0,l,k;l=d[e];e++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(m){return !m.toString().blank()&&k.include(" "+m+" ")})))){h.push(Element.extend(l))
}}return h};return function(e,d){return $(d||document.body).getElementsByClassName(e)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))
},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var d=this.slice(4,this.length-1).split(",");var b=0;do{a+=parseInt(d[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;
b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(d){return(d.nodeType==3?d.nodeValue:((d.hasChildNodes()&&!Element.hasClassName(d,b))?Element.collectTextNodesIgnoreClass(d,b):""))
}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5
},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";
if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(d){if(d.nodeType==3){d.nodeValue.toArray().each(function(e){a.insertBefore(new Element("span",{style:b}).update(e==" "?String.fromCharCode(160):e),d)});Element.remove(d)}})},multiple:function(b,d){var f;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){f=b}else{f=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});
var e=a.delay;$A(f).each(function(h,g){new d(h,Object.extend(a,{delay:g*a.speed+e}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,d){b=$(b);d=(d||"appear").toLowerCase();var a=Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},arguments[2]||{});Effect[b.visible()?Effect.PAIRS[d][1]:Effect.PAIRS[d][0]](b,a)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;
Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var d=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(f){return f.state=="idle"}).each(function(f){f.startOn+=b.finishOn;f.finishOn+=b.finishOn
});break;case"with-last":d=this.effects.pluck("startOn").max()||d;break;case"end":d=this.effects.pluck("finishOn").max()||d;break}b.startOn+=d;b.finishOn+=d;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a});if(this.effects.length==0){clearInterval(this.interval);
this.interval=null}},loop:function(){var d=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(d)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(a){function b(e,d){return((e[d+"Internal"]?"this.options."+d+"Internal(this);":"")+(e[d]?"this.options."+d+"(this);":""))
}if(a&&a.transition===false){a.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;
this.render=(function(){function d(f,e){if(f.options[e+"Internal"]){f.options[e+"Internal"](f)}if(f.options[e]){f.options[e](f)}}return function(e){if(this.state==="idle"){this.state="running";d(this,"beforeSetup");if(this.setup){this.setup()}d(this,"afterSetup")}if(this.state==="running"){e=(this.options.transition(e)*this.fromToDelta)+this.options.from;this.position=e;d(this,"beforeUpdate");if(this.update){this.update(e)
}d(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(d){if(d>=this.startOn){if(d>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(d-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();
if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])
}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(d,g,f){d=Object.isString(d)?$(d):d;
var b=$A(arguments),e=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(e)?e.bind(d):Object.isFunction(d[e])?d[e].bind(d):function(h){d[e]=h};this.start(Object.extend({from:g,to:f},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})
}});Effect.MoveBy=function(b,a,d){return new Effect.Move(b,Object.extend({x:d,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,d){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:d},arguments[2]||{});this.start(a)
},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";
["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]
}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,f){var g={};if(this.options.scaleX){g.width=f.round()+"px"
}if(this.options.scaleY){g.height=a.round()+"px"}if(this.options.scaleFromCenter){var e=(a-this.dims[0])/2;var b=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-e+"px"}if(this.options.scaleX){g.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){g.top=-e+"px"}if(this.options.scaleX){g.left=-b+"px"}}}this.element.setStyle(g)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,d,e){return b+((this._base[e]+(this._delta[e]*a)).round().toColorPart())
}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(d){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),e=$(d).cumulativeOffset();if(b.offset){e[1]+=b.offset}return new Effect.Tween(null,a.top,e[1],b,function(f){scrollTo(a.left,f.round())})};Effect.Fade=function(d){d=$(d);var a=d.getInlineOpacity();
var b=Object.extend({from:d.getOpacity()||1,to:0,afterFinishInternal:function(e){if(e.options.to!=0){return}e.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(d,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(d){d.element.forceRerendering()},beforeSetup:function(d){d.element.setOpacity(d.options.from).show()
}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(d){Position.absolutize(d.effects[0].element)
},afterFinishInternal:function(d){d.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(d){d.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(d){new Effect.Scale(d.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(e){e.element.makePositioned().makeClipping()
},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(d){d.effects[0].element.makePositioned()
},afterFinishInternal:function(d){d.effects[0].element.hide().undoPositioned().setStyle(a)}},arguments[1]||{}))};Effect.Shake=function(e){e=$(e);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});var f=parseFloat(b.distance);var d=parseFloat(b.duration)/10;var a={top:e.getStyle("top"),left:e.getStyle("left")};return new Effect.Move(e,{x:f,y:0,duration:d,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:d*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:f*2,y:0,duration:d*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:-f*2,y:0,duration:d*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:f*2,y:0,duration:d*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:-f,y:0,duration:d,afterFinishInternal:function(m){m.element.undoPositioned().setStyle(a)
}})}})}})}})}})}})};Effect.SlideDown=function(d){d=$(d).cleanWhitespace();var a=d.down().getStyle("bottom");var b=d.getDimensions();return new Effect.Scale(d,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makePositioned();e.element.down().makePositioned();
if(window.opera){e.element.setStyle({top:""})}e.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:(e.dims[0]-e.element.clientHeight)+"px"})},afterFinishInternal:function(e){e.element.undoClipping().undoPositioned();e.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(d){d=$(d).cleanWhitespace();
var a=d.down().getStyle("bottom");var b=d.getDimensions();return new Effect.Scale(d,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makePositioned();e.element.down().makePositioned();if(window.opera){e.element.setStyle({top:""})}e.element.makeClipping().show()
},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:(e.dims[0]-e.element.clientHeight)+"px"})},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned();e.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(d){d=$(d);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var a={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};
var h=d.getDimensions();var j,g;var f,e;switch(b.direction){case"top-left":j=g=f=e=0;break;case"top-right":j=h.width;g=e=0;f=-h.width;break;case"bottom-left":j=f=0;g=h.height;e=-h.height;break;case"bottom-right":j=h.width;g=h.height;f=-h.width;e=-h.height;break;case"center":j=h.width/2;g=h.height/2;f=-h.width/2;e=-h.height/2;break}return new Effect.Move(d,{x:j,y:g,duration:0.01,beforeSetup:function(k){k.element.hide().makeClipping().makePositioned()
},afterFinishInternal:function(k){new Effect.Parallel([new Effect.Opacity(k.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(k.element,{x:f,y:e,sync:true,transition:b.moveTransition}),new Effect.Scale(k.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(l){l.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(l){l.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(d){d=$(d);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var a={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};
var g=d.getDimensions();var f,e;switch(b.direction){case"top-left":f=e=0;break;case"top-right":f=g.width;e=0;break;case"bottom-left":f=0;e=g.height;break;case"bottom-right":f=g.width;e=g.height;break;case"center":f=g.width/2;e=g.height/2;break}return new Effect.Parallel([new Effect.Opacity(d,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(d,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(d,{x:f,y:e,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(h){h.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(h){h.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(d){d=$(d);var b=arguments[1]||{},a=d.getInlineOpacity(),f=b.transition||Effect.Transitions.linear,e=function(g){return 1-f((-Math.cos((g*(b.pulses||5)*2)*Math.PI)/2)+0.5)};return new Effect.Opacity(d,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a})
}},b),{transition:e}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(d){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(e){e.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))
};Effect.Morph=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);
var b=this.element.getStyles();this.style=this.style.reject(function(e){return e.value==b[e.key]});a.afterFinishInternal=function(e){e.element.addClassName(e.options.style);e.transforms.each(function(f){e.element.style[f.style]=""})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(d){return parseInt(b.slice(d*2+1,d*2+3),16)
})}this.transforms=this.style.map(function(h){var g=h[0],f=h[1],e=null;if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();e="color"}else{if(g=="opacity"){f=parseFloat(f);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(f)){var d=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);f=parseFloat(d[1]);e=(d.length==3)?d[2]:null}}}var b=this.element.getStyle(g);
return{style:g.camelize(),originalValue:e=="color"?a(b):parseFloat(b||0),targetValue:e=="color"?a(f):f,unit:e}}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var e={},b,d=this.transforms.length;while(d--){e[(b=this.transforms[d]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)
}this.element.setStyle(e,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);var d=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:d}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var e=a.get("ids"),d=a.get("effect"),b=a.get("options");
var f=[$(e)||$$(e)].flatten();return f.map(function(g){return new d(g,Object.extend({sync:true},b))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(d){if(b[d]){a.set(d,b[d])
}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=a[e];return d})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,d;
d=Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=a[f];return e});if(!d.opacity){d.opacity=b.getOpacity()}return d}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(d,f,b){d=$(d);var e=f.dasherize().camelize(),a=e.charAt(0).toUpperCase()+e.substring(1);new Effect[a](d,b);return d},highlight:function(b,a){b=$(b);
new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(d,b){d=$(d);Effect[a.charAt(0).toUpperCase()+a.substring(1)](d,b);return d}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]
});Element.addMethods(Effect.Methods);if(typeof Prototype=="undefined"||!Prototype.Version.match("1.6")){throw ("Prototype-UI library require Prototype library >= 1.6.0")}if(Prototype.Browser.WebKit){Prototype.Browser.WebKitVersion=parseFloat(navigator.userAgent.match(/AppleWebKit\/([\d\.\+]*)/)[1]);Prototype.Browser.Safari2=(Prototype.Browser.WebKitVersion<420)}if(Prototype.Browser.IE){Prototype.Browser.IEVersion=parseFloat(navigator.appVersion.split(";")[1].strip().split(" ")[1]);
Prototype.Browser.IE6=Prototype.Browser.IEVersion==6;Prototype.Browser.IE7=Prototype.Browser.IEVersion==7}Prototype.falseFunction=function(){return false};Prototype.trueFunction=function(){return true};var UI={Abstract:{},Ajax:{}};Object.extend(Class.Methods,{extend:Object.extend.methodize(),addMethods:Class.Methods.addMethods.wrap(function(a,b){if(!b){return this}if(!b.hasOwnProperty("methodsAdded")){return a(b)
}var d=b.methodsAdded;delete b.methodsAdded;a(b);d.call(b,this);b.methodsAdded=d;return this}),addMethod:function(d,b){var a={};a[d]=b;return this.addMethods(a)},method:function(a){return this.prototype[a].valueOf()},classMethod:function(){$A(arguments).flatten().each(function(a){this[a]=(function(){return this[a].apply(this,arguments)}).bind(this.prototype)},this);return this},undefMethod:function(a){this.prototype[a]=undefined;
return this},removeMethod:function(a){delete this.prototype[a];return this},aliasMethod:function(a,b){this.prototype[a]=this.prototype[b];return this},aliasMethodChain:function(b,a){a=a.camelcase();this.aliasMethod(b+"Without"+a,b);this.aliasMethod(b,b+"With"+a);return this}});Object.extend(Number.prototype,{snap:function(a){return parseInt(a==1?this:(this/a).floor()*a)}});Object.extend(String.prototype,{camelcase:function(){var a=this.dasherize().camelize();
return a.charAt(0).toUpperCase()+a.slice(1)},makeElement:function(){var a=new Element("div");a.innerHTML=this;return a.down()}});Object.extend(Array.prototype,{empty:function(){return !this.length},extractOptions:function(){return this.last().constructor===Object?this.pop():{}},removeAt:function(b){var a=this[b];this.splice(b,1);return a},remove:function(b){var a;while((a=this.indexOf(b))!=-1){this.removeAt(a)
}return b},insert:function(b){var a=$A(arguments);a.shift();this.splice.apply(this,[b,0].concat(a));return this}});Element.addMethods({getScrollDimensions:function(a){return{width:a.scrollWidth,height:a.scrollHeight}},getScrollOffset:function(a){return Element._returnOffset(a.scrollLeft,a.scrollTop)},setScrollOffset:function(a,b){a=$(a);if(arguments.length==3){b={left:b,top:arguments[2]}}a.scrollLeft=b.left;
a.scrollTop=b.top;return a},getNumStyle:function(a,b){var d=parseFloat($(a).getStyle(b));return isNaN(d)?null:d},appendText:function(a,b){a=$(a);b=String.interpret(b);a.appendChild(document.createTextNode(b));return a}});document.whenReady=function(a){if(document.loaded){a.call(document)}else{document.observe("dom:loaded",a)}};Object.extend(document.viewport,{getScrollOffset:document.viewport.getScrollOffsets,setScrollOffset:function(a){Element.setScrollOffset(Prototype.Browser.WebKit?document.body:document.documentElement,a)
},getScrollDimensions:function(){return Element.getScrollDimensions(Prototype.Browser.WebKit?document.body:document.documentElement)}});(function(){UI.Options={methodsAdded:function(b){b.classMethod($w(" setOptions allOptions optionsGetter optionsSetter optionsAccessor "))},setOptions:function(b){if(!this.hasOwnProperty("options")){this.options=this.allOptions()}this.options=Object.extend(this.options,b||{})
},allOptions:function(){var d=this.constructor.superclass,b=d&&d.prototype;return(b&&b.allOptions)?Object.extend(b.allOptions(),this.options):Object.clone(this.options)},optionsGetter:function(){a(this,arguments,false)},optionsSetter:function(){a(this,arguments,true)},optionsAccessor:function(){this.optionsGetter.apply(this,arguments);this.optionsSetter.apply(this,arguments)}};function a(d,e,b){e=$A(e).flatten();
if(e.empty()){e=Object.keys(d.allOptions())}e.each(function(g){var f=(b?"set":"get")+g.camelcase();d[f]=d[f]||(b?function(h){return this.options[g]=h}:function(){return this.options[g]})})}})();UI.Carousel=Class.create(UI.Options,{options:{direction:"horizontal",previousButton:".previous_button",nextButton:".next_button",container:".container",scrollInc:"auto",disabledButtonSuffix:"_disabled",overButtonSuffix:"_over"},initialize:function(b,a){this.setOptions(a);
this.element=$(b);this.id=this.element.id;this.container=this.element.down(this.options.container).firstDescendant();this.elements=this.container.childElements();this.previousButton=this.options.previousButton==false?null:this.element.down(this.options.previousButton);this.nextButton=this.options.nextButton==false?null:this.element.down(this.options.nextButton);this.posAttribute=(this.options.direction=="horizontal"?"left":"top");
this.dimAttribute=(this.options.direction=="horizontal"?"width":"height");this.elementSize=this.computeElementSize();this.nbVisible=this.currentSize()/this.elementSize;var d=this.options.scrollInc;if(d=="auto"){d=Math.floor(this.nbVisible)}[this.previousButton,this.nextButton].each(function(e){if(!e){return}var f=(e==this.nextButton?"next_button":"previous_button")+this.options.overButtonSuffix;e.clickHandler=this.scroll.bind(this,(e==this.nextButton?-1:1)*d*this.elementSize);
e.observe("click",e.clickHandler).observe("mouseover",function(){e.addClassName(f)}.bind(this)).observe("mouseout",function(){e.removeClassName(f)}.bind(this))},this);this.updateButtons()},destroy:function($super){[this.previousButton,this.nextButton].each(function(a){if(!a){return}a.stopObserving("click",a.clickHandler)},this);this.element.remove();this.fire("destroyed")},fire:function(b,a){a=a||{};
a.carousel=this;return this.element.fire("carousel:"+b,a)},observe:function(a,b){this.element.observe("carousel:"+a,b.bind(this));return this},stopObserving:function(a,b){this.element.stopObserving("carousel:"+a,b);return this},checkScroll:function(a,e){if(a>0){a=0}else{var b=this.elements.last().positionedOffset()[this.posAttribute]+this.elementSize;var d=this.currentSize();if(a+b<d){a+=d-(a+b)}a=Math.min(a,0)
}if(e){this.container.style[this.posAttribute]=a+"px"}return a},scroll:function(b){if(this.animating){return this}var a=this.currentPosition()+b;a=this.checkScroll(a,false);b=a-this.currentPosition();if(b!=0){this.animating=true;this.fire("scroll:started");var d=this;this.container.morph("opacity:0.5",{duration:0.2,afterFinish:function(){d.container.morph(d.posAttribute+": "+a+"px",{duration:0.4,delay:0.2,afterFinish:function(){d.container.morph("opacity:1",{duration:0.2,afterFinish:function(){d.animating=false;
d.updateButtons().fire("scroll:ended",{shift:b/d.currentSize()})}})}})}})}return this},scrollTo:function(a){if(this.animating||a<0||a>this.elements.length||a==this.currentIndex()||isNaN(parseInt(a))){return this}return this.scroll((this.currentIndex()-a)*this.elementSize)},updateButtons:function(){this.updatePreviousButton();this.updateNextButton();return this},updatePreviousButton:function(){var a=this.currentPosition();
var b="previous_button"+this.options.disabledButtonSuffix;if(this.previousButton.hasClassName(b)&&a!=0){this.previousButton.removeClassName(b);this.fire("previousButton:enabled")}if(!this.previousButton.hasClassName(b)&&a==0){this.previousButton.addClassName(b);this.fire("previousButton:disabled")}},updateNextButton:function(){var a=this.currentLastPosition();var b=this.currentSize();var d="next_button"+this.options.disabledButtonSuffix;
if(this.nextButton.hasClassName(d)&&a!=b){this.nextButton.removeClassName(d);this.fire("nextButton:enabled")}if(!this.nextButton.hasClassName(d)&&a<=b){this.nextButton.addClassName(d);this.fire("nextButton:disabled")}},computeElementSize:function(){return this.elements.first().getDimensions()[this.dimAttribute]},currentIndex:function(){return -this.currentPosition()/this.elementSize},currentLastPosition:function(){if(this.container.childElements().empty()){return 0
}return this.currentPosition()+this.elements.last().positionedOffset()[this.posAttribute]+this.elementSize},currentPosition:function(){return this.container.getNumStyle(this.posAttribute)},currentSize:function(){return this.container.parentNode.getDimensions()[this.dimAttribute]},updateSize:function(){this.nbVisible=this.currentSize()/this.elementSize;var a=this.options.scrollInc;if(a=="auto"){a=Math.floor(this.nbVisible)
}[this.previousButton,this.nextButton].each(function(b){if(!b){return}b.stopObserving("click",b.clickHandler);b.clickHandler=this.scroll.bind(this,(b==this.nextButton?-1:1)*a*this.elementSize);b.observe("click",b.clickHandler)},this);this.checkScroll(this.currentPosition(),true);this.updateButtons().fire("sizeUpdated");return this}});UI.Ajax.Carousel=Class.create(UI.Carousel,{options:{elementSize:-1,url:null},initialize:function($super,b,a){if(!a.url){throw ("url option is required for UI.Ajax.Carousel")
}if(!a.elementSize){throw ("elementSize option is required for UI.Ajax.Carousel")}$super(b,a);this.endIndex=0;this.hasMore=true;this.updateHandler=this.update.bind(this);this.updateAndScrollHandler=function(f,e,d){this.update(e,d);this.scroll(f)}.bind(this);this.runRequest.bind(this).defer({parameters:{from:0,to:Math.ceil(this.nbVisible)-1},onSuccess:this.updateHandler})},runRequest:function(a){this.requestRunning=true;
new Ajax.Request(this.options.url,Object.extend({method:"GET"},a));this.fire("request:started");return this},scroll:function($super,a){if(this.animating||this.requestRunning){return this}var e=(-a)/this.elementSize;if(this.hasMore&&e>0&&this.currentIndex()+this.nbVisible+e-1>this.endIndex){var d=this.endIndex+1;var b=Math.ceil(d+this.nbVisible-1);this.runRequest({parameters:{from:d,to:b},onSuccess:this.updateAndScrollHandler.curry(a).bind(this)});
return this}else{$super(a)}},update:function(b,a){this.requestRunning=false;this.fire("request:ended");if(!a){a=b.responseJSON}this.hasMore=a.more;this.endIndex=Math.max(this.endIndex,a.to);this.elements=this.container.insert({bottom:a.html}).childElements();return this.updateButtons()},computeElementSize:function(){return this.options.elementSize},updateSize:function($super){var a=this.nbVisible;$super();
if(Math.floor(this.nbVisible)-Math.floor(a)>=1&&this.hasMore){if(this.currentIndex()+Math.floor(this.nbVisible)>=this.endIndex){var b=Math.floor(this.currentIndex()+Math.floor(this.nbVisible)-this.endIndex);this.runRequest({parameters:{from:this.endIndex+1,to:this.endIndex+b},onSuccess:this.updateHandler})}}return this},updateNextButton:function($super){var a=this.currentLastPosition();var b=this.currentSize();
var d="next_button"+this.options.disabledButtonSuffix;if(this.nextButton.hasClassName(d)&&a!=b){this.nextButton.removeClassName(d);this.fire("nextButton:enabled")}if(!this.nextButton.hasClassName(d)&&a==b&&!this.hasMore){this.nextButton.addClassName(d);this.fire("nextButton:disabled")}}});window.dhtmlHistory={isIE:false,isOpera:false,isSafari:false,isKonquerer:false,isGecko:false,isSupported:false,create:function(e){var h=this;
var g=navigator.userAgent.toLowerCase();var a=navigator.platform.toLowerCase();var j=navigator.vendor||"";if(j==="KDE"){this.isKonqueror=true;this.isSupported=false}else{if(typeof window.opera!=="undefined"){this.isOpera=true;this.isSupported=true}else{if(typeof document.all!=="undefined"){this.isIE=true;this.isSupported=true}else{if(j.indexOf("Apple Computer, Inc.")>-1){this.isSafari=true;this.isSupported=(a.indexOf("mac")>-1)
}else{if(g.indexOf("gecko")!=-1){this.isGecko=true;this.isSupported=true}}}}}window.historyStorage.setup(e);if(this.isSafari){this.createSafari()}else{if(this.isOpera){this.createOpera()}}var b=this.getCurrentLocation();this.currentLocation=b;if(this.isIE){this.createIE(b)}var f=function(){h.firstLoad=null};this.addEventListener(window,"unload",f);if(this.isIE){this.ignoreLocationChange=true}else{if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.ignoreLocationChange=true;
this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.ignoreLocationChange=false;this.fireOnNewListener=true}}var d=function(){h.checkLocation()};setInterval(d,100)},initialize:function(){if(this.isIE){if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.fireOnNewListener=false;this.firstLoad=true;historyStorage.put(this.PAGELOADEDSTRING,true)}else{this.fireOnNewListener=true;
this.firstLoad=false}}},addListener:function(a){this.listener=a;if(this.fireOnNewListener){this.fireHistoryEvent(this.currentLocation);this.fireOnNewListener=false}},addEventListener:function(d,b,a){if(d.addEventListener){d.addEventListener(b,a,false)}else{if(d.attachEvent){d.attachEvent("on"+b,function(){a(window.event)})}}},add:function(d,e){if(this.isSafari){d=this.removeHash(d);historyStorage.put(d,e);
this.currentLocation=d;window.location.hash=d;this.putSafariState(d)}else{var b=this;var a=function(){if(b.currentWaitTime>0){b.currentWaitTime=b.currentWaitTime-b.waitTime}d=b.removeHash(d);if(document.getElementById(d)&&b.debugMode){var f="Exception: History locations can not have the same value as _any_ IDs that might be in the document, due to a bug in IE; please ask the developer to choose a history location that does not match any HTML IDs in this document. The following ID is already taken and cannot be a location: "+d;
throw new Error(f)}historyStorage.put(d,e);b.ignoreLocationChange=true;b.ieAtomicLocationChange=true;b.currentLocation=d;window.location.hash=d;if(b.isIE){b.iframe.src="blank.html?"+d}b.ieAtomicLocationChange=false};window.setTimeout(a,this.currentWaitTime);this.currentWaitTime=this.currentWaitTime+this.waitTime}},isFirstLoad:function(){return this.firstLoad},getVersion:function(){return"0.6"},getCurrentLocation:function(){var a=(this.isSafari?this.getSafariState():this.getCurrentHash());
return a},getCurrentHash:function(){var b=window.location.href;var a=b.indexOf("#");return(a>=0?b.substr(a+1):"")},PAGELOADEDSTRING:"DhtmlHistory_pageLoaded",listener:null,waitTime:200,currentWaitTime:0,currentLocation:null,iframe:null,safariHistoryStartPoint:null,safariStack:null,safariLength:null,ignoreLocationChange:null,fireOnNewListener:null,firstLoad:null,ieAtomicLocationChange:null,createIE:function(a){this.waitTime=400;
var b=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var e="rshHistoryFrame";var d='<iframe frameborder="0" id="'+e+'" style="'+b+'" src="blank.html?'+a+'"></iframe>';document.write(d);this.iframe=document.getElementById(e)},createOpera:function(){this.waitTime=400;var a='<img src="javascript:location.href=\'javascript:dhtmlHistory.checkLocation();\';" style="'+historyStorage.hideStyles+'" />';
document.write(a)},createSafari:function(){var f="rshSafariForm";var e="rshSafariStack";var d="rshSafariLength";var b=historyStorage.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var a=(historyStorage.debugMode?"width:800px;height:20px;border:1px solid black;margin:0;padding:0;":historyStorage.hideStyles);var g='<form id="'+f+'" style="'+b+'"><input type="text" style="'+a+'" id="'+e+'" value="[]"/><input type="text" style="'+a+'" id="'+d+'" value=""/></form>';
document.write(g);this.safariStack=document.getElementById(e);this.safariLength=document.getElementById(d);if(!historyStorage.hasKey(this.PAGELOADEDSTRING)){this.safariHistoryStartPoint=history.length;this.safariLength.value=this.safariHistoryStartPoint}else{this.safariHistoryStartPoint=this.safariLength.value}},getSafariStack:function(){var a=this.safariStack.value;return historyStorage.fromJSON(a)
},getSafariState:function(){var a=this.getSafariStack();var b=a[history.length-this.safariHistoryStartPoint-1];return b},putSafariState:function(b){var a=this.getSafariStack();a[history.length-this.safariHistoryStartPoint]=b;this.safariStack.value=historyStorage.toJSON(a)},fireHistoryEvent:function(a){var b=historyStorage.get(a);this.listener.call(null,a,b)},checkLocation:function(){if(!this.isIE&&this.ignoreLocationChange){this.ignoreLocationChange=false;
return}if(!this.isIE&&this.ieAtomicLocationChange){return}var a=this.getCurrentLocation();if(a==this.currentLocation){return}this.ieAtomicLocationChange=true;if(this.isIE&&this.getIframeHash()!=a){this.iframe.src="blank.html?"+a}else{if(this.isIE){return}}this.currentLocation=a;this.ieAtomicLocationChange=false;this.fireHistoryEvent(a)},getIframeHash:function(){var b=this.iframe.contentWindow.document;
var a=String(b.location.search);if(a.length==1&&a.charAt(0)=="?"){a=""}else{if(a.length>=2&&a.charAt(0)=="?"){a=a.substring(1)}}return a},removeHash:function(b){var a;if(b===null||b===undefined){a=null}else{if(b===""){a=""}else{if(b.length==1&&b.charAt(0)=="#"){a=""}else{if(b.length>1&&b.charAt(0)=="#"){a=b.substring(1)}else{a=b}}}}return a},iframeLoaded:function(a){if(this.ignoreLocationChange){this.ignoreLocationChange=false;
return}var b=String(a.search);if(b.length==1&&b.charAt(0)=="?"){b=""}else{if(b.length>=2&&b.charAt(0)=="?"){b=b.substring(1)}}window.location.hash=b;this.fireHistoryEvent(b)}};window.historyStorage={setup:function(b){if(typeof b!=="undefined"){if(b.debugMode){this.debugMode=b.debugMode}if(b.toJSON){this.toJSON=b.toJSON}if(b.fromJSON){this.fromJSON=b.fromJSON}}var e="rshStorageForm";var g="rshStorageField";
var a=this.debugMode?historyStorage.showStyles:historyStorage.hideStyles;var f=(historyStorage.debugMode?"width: 800px;height:80px;border:1px solid black;":historyStorage.hideStyles);var d='<form id="'+e+'" style="'+a+'"><textarea id="'+g+'" style="'+f+'"></textarea></form>';document.write(d);this.storageField=document.getElementById(g);if(typeof window.opera!=="undefined"){this.storageField.focus()
}},put:function(a,b){this.assertValidKey(a);if(this.hasKey(a)){this.remove(a)}this.storageHash[a]=b;this.saveHashTable()},get:function(a){this.assertValidKey(a);this.loadHashTable();var b=this.storageHash[a];if(b===undefined){b=null}return b},remove:function(a){this.assertValidKey(a);this.loadHashTable();delete this.storageHash[a];this.saveHashTable()},reset:function(){this.storageField.value="";this.storageHash={}
},hasKey:function(a){this.assertValidKey(a);this.loadHashTable();return(typeof this.storageHash[a]!=="undefined")},isValidKey:function(a){return(typeof a==="string")},showStyles:"border:0;margin:0;padding:0;",hideStyles:"left:-1000px;top:-1000px;width:1px;height:1px;border:0;position:absolute;",debugMode:false,storageHash:{},hashLoaded:false,storageField:null,assertValidKey:function(a){var b=this.isValidKey(a);
if(!b&&this.debugMode){throw new Error("Please provide a valid key for window.historyStorage. Invalid key = "+a+".")}},loadHashTable:function(){if(!this.hashLoaded){var a=this.storageField.value;if(a!==""&&a!==null){this.storageHash=this.fromJSON(a);this.hashLoaded=true}}},saveHashTable:function(){this.loadHashTable();var a=this.toJSON(this.storageHash);this.storageField.value=a},toJSON:function(a){return a.toJSONString()
},fromJSON:function(a){return a.parseJSON()}};function getCities(a){new Ajax.Updater("nearest_city","/search/index/towns.ajax?country="+a)}function changeCountry(){var a=$("countryBox").options[$("countryBox").selectedIndex].value;$("countryBox").hide();$("changeCountry").show();getCities(a)}function changeCityWithCountry(){$("countryBox").show();$("changeCountry").hide()}function registerSubmit(){}if($("todayUsers")&&$("messages")){var now=new Date();
var time0=now.getHours()*3600+now.getMinutes()*60+now.getSeconds();var todayUsers=$("todayUsers").innerHTML.replace(/\s/g,"");var todayPhotos=$("todayPhotos").innerHTML.replace(/\s/g,"");var todayMessages=$("messages").innerHTML.replace(/\s/g,"");var todayInstant=$("instant").innerHTML.replace(/\s/g,"")}function updateCarousel(){Carousel=new UI.Carousel("horizontal_carousel");currentPosition=Carousel.currentIndex();
total=Carousel.elements.length-1;nextPosition=currentPosition<total?currentPosition+1:0;Carousel.scrollTo(nextPosition)}Event.observe(window,"load",function(){Event.observe($("countryBox"),"change",changeCountry);Event.observe($("changeCountry"),"click",changeCityWithCountry);var a=new PeriodicalExecuter(updateCarousel,7);var b=new UI.Carousel("horizontal_carousel");if(clickHeatSite){initClickHeat()
}});function toggleFeedbackForm(){if($("feedbackForm")){if($("feedbackForm").getWidth()<200){$("feedbackForm").morph("width:407px;");$("feedbackFormContainer").morph("width:450px;");$("submitFeedbackForm").show();$("feedbackButton").morph("right:398px;");$("feedbackButtonLink").addClassName("buttonOff")}else{$("feedbackForm").morph("width:0px;");$("feedbackFormContainer").morph("width:50px;");$("submitFeedbackForm").hide();
$("feedbackButton").morph("right:-9px;");$("feedbackButtonLink").removeClassName("buttonOff")}}return false}var clickHeatGroup="";var clickHeatSite="";var clickHeatServer="";var clickHeatLastIframe=-1;var clickHeatTime=0;var clickHeatQuota=-1;var clickHeatBrowser="";var clickHeatDocument="";var clickHeatWait=500;var clickHeatLocalWait=0;var clickHeatDebug=(window.location.href.search(/debugclickheat/)!==-1);
function showClickHeatDebug(b){if(clickHeatDebug===true){document.getElementById("clickHeatDebuggerSpan").innerHTML=b;document.getElementById("clickHeatDebuggerDiv").style.display="block"}}function catchClickHeat(w){try{showClickHeatDebug("Gathering click data...");if(clickHeatQuota===0){showClickHeatDebug("Click not logged: quota reached");return true}if(clickHeatGroup===""){showClickHeatDebug("Click not logged: group name empty (clickHeatGroup)");
return true}if(w===undefined){w=window.event;c=w.button;element=w.srcElement}else{c=w.which;element=null}if(c===0){showClickHeatDebug("Click not logged: no button pressed");return true}if(element!==null&&element.tagName.toLowerCase()==="iframe"){if(element.sourceIndex===clickHeatLastIframe){showClickHeatDebug("Click not logged: same iframe (a click on iframe opens a popup and popup is closed => iframe gets the focus again)");
return true}clickHeatLastIframe=element.sourceIndex}else{clickHeatLastIframe=-1}var t=w.clientX;var u=w.clientY;var s=clickHeatDocument.clientWidth!==undefined?clickHeatDocument.clientWidth:window.innerWidth;var x=clickHeatDocument.clientHeight!==undefined?clickHeatDocument.clientHeight:window.innerHeight;var y=window.pageXOffset===undefined?clickHeatDocument.scrollLeft:window.pageXOffset;var z=window.pageYOffset===undefined?clickHeatDocument.scrollTop:window.pageYOffset;
if(t>s||u>x){showClickHeatDebug("Click not logged: out of document (should be a click on scrollbars)");return true}clickTime=new Date();if(clickTime.getTime()-clickHeatTime<1000){showClickHeatDebug("Click not logged: at least 1 second between clicks");return true}clickHeatTime=clickTime.getTime();if(clickHeatQuota>0){clickHeatQuota=clickHeatQuota-1}params="s="+clickHeatSite+"&g="+clickHeatGroup+"&x="+(t+y)+"&y="+(u+z)+"&w="+s+"&b="+clickHeatBrowser+"&c="+c+"&random="+Date();
showClickHeatDebug("Ready to send click data...");var v=false;if(clickHeatServer.substring(0,4)!=="http"){var B=false;try{B=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{B=new ActiveXObject("Microsoft.XMLHTTP")}catch(D){B=null}}if(!B&&typeof XMLHttpRequest!==undefined){B=new XMLHttpRequest()}if(B){if(clickHeatDebug===true){B.onreadystatechange=function(){if(B.readyState===4){if(B.status===200){showClickHeatDebug("Click recorded at "+clickHeatServer+" with the following parameters:<br />x = "+(t+y)+" ("+t+"px from left + "+y+"px of horizontal scrolling)<br />y = "+(u+z)+" ("+u+"px from top + "+z+"px of vertical scrolling)<br />width = "+s+"<br />browser = "+clickHeatBrowser+"<br />click = "+c+"<br />site = "+clickHeatSite+"<br />group = "+clickHeatGroup+"<br /><br />Server answer: "+B.responseText)
}else{if(B.status===404){showClickHeatDebug("click.php was not found at: "+(clickHeatServer!==""?clickHeatServer:"/clickheat/click.php")+" please set clickHeatServer value")}else{showClickHeatDebug("click.php returned a status code "+B.status+" with the following error: "+B.responseText)}}clickHeatLocalWait=0}}}B.open("GET",clickHeatServer+"?"+params,true);B.setRequestHeader("Connection","close");B.send(null);
v=true}}if(v===false){if(clickHeatDebug===true){showClickHeatDebug("Click recorded at "+clickHeatServer+" with the following parameters:<br />x = "+(t+y)+" ("+t+"px from left + "+y+"px of horizontal scrolling)<br />y = "+(u+z)+" ("+u+"px from top + "+z+"px of vertical scrolling)<br />width = "+s+"<br />browser = "+clickHeatBrowser+"<br />click = "+c+"<br />site = "+clickHeatSite+"<br />group = "+clickHeatGroup+'<br /><br />Server answer:<br /><iframe src="'+clickHeatServer+"?"+params+'" width="700" height="60"></iframe>')
}else{var h=new Image();h.src=clickHeatServer+"?"+params}}var C=new Date();clickHeatLocalWait=C.getTime()+clickHeatWait;while(clickHeatLocalWait>C.getTime()){C=new Date()}}catch(A){showClickHeatDebug("An error occurred while processing click (Javascript error): "+w.message)}return true}function initClickHeat(){if(clickHeatDebug===true){document.write('<div id="clickHeatDebuggerDiv" style="padding:5px; display:none; position:absolute; top:10px; left:10px; border:1px solid #888; background-color:#eee; z-index:99;"><strong>ClickHeat debug: <a href="#" onmouseover="document.getElementById(\'clickHeatDebuggerDiv\').style.display = \'none\'; return false">Rollover to close</a></strong><br /><br /><span id="clickHeatDebuggerSpan"></span></div>')
}if(clickHeatGroup===""||clickHeatServer===""){showClickHeatDebug("ClickHeat NOT initialised: either clickHeatGroup or clickHeatServer is empty");return false}domain=window.location.href.match(/http:\/\/[^/]+\//);if(domain!==null&&clickHeatServer.substring(0,domain[0].length)===domain[0]){clickHeatServer=clickHeatServer.substring(domain[0].length-1,clickHeatServer.length)}if(document.addEventListener){document.addEventListener("mousedown",catchClickHeat,false)
}else{if(document.attachEvent){document.attachEvent("onmousedown",catchClickHeat)}}iFrames=document.getElementsByTagName("iframe");for(i=0;i<iFrames.length;i++){if(document.addEventListener){iFrames[i].addEventListener("focus",catchClickHeat,false)}else{if(document.attachEvent){iFrames[i].attachEvent("onfocus",catchClickHeat)}}}clickHeatDocument=(document.documentElement!==undefined&&document.documentElement.clientHeight!==0)?document.documentElement:document.body;
var b=navigator.userAgent!==undefined?navigator.userAgent.toLowerCase().replace(/-/g,""):"";clickHeatBrowser=b.replace(/iceweasel/,"firefox").replace(/^.*(firefox|kmeleon|safari|msie|opera).*$/,"$1");if(b===clickHeatBrowser||clickHeatBrowser===""){clickHeatBrowser="unknown"}showClickHeatDebug("ClickHeat initialised with:<br />site = "+clickHeatSite+"<br />group = "+clickHeatGroup+"<br />server = "+clickHeatServer+"<br />quota = "+(clickHeatQuota===-1?"unlimited":clickHeatQuota)+"<br /><br />browser = "+clickHeatBrowser)
};