var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var c=document.createElement("div"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=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 b;for(var c=0,a=arguments.length;c<a;c++){var d=arguments[c];try{b=d();break}catch(f){}}return b}};var Class=(function(){var d=(function(){for(var e in {toString:1}){if(e==="toString"){return false}}return true})();function c(){}function b(){var g=null,h=$A(arguments);if(Object.isFunction(h[0])){g=h.shift()}function e(){this.initialize.apply(this,arguments)}Object.extend(e,Class.Methods);e.superclass=g;e.subclasses=[];if(g){c.prototype=g.prototype;e.prototype=new c;g.subclasses.push(e)}for(var j=0,f=h.length;j<f;j++){e.addMethods(h[j])}if(!e.prototype.initialize){e.prototype.initialize=Prototype.emptyFunction}e.prototype.constructor=e;return e}function a(f){var j=this.superclass&&this.superclass.prototype,h=Object.keys(f);if(d){if(f.toString!=Object.prototype.toString){h.push("toString")}if(f.valueOf!=Object.prototype.valueOf){h.push("valueOf")}}for(var k=0,g=h.length;k<g;k++){var e=h[k],l=f[e];if(j&&Object.isFunction(l)&&l.argumentNames()[0]=="$super"){var m=l;l=(function(i){return function(){return j[i].apply(this,arguments)}})(e).wrap(m);l.valueOf=m.valueOf.bind(m);l.toString=m.toString.bind(m)}this.prototype[e]=l}return this}return{create:b,Methods:{addMethods:a}}})();(function(){var w=Object.prototype.toString,x="Null",p="Undefined",v="Boolean",l="Number",r="String",E="Object",H="[object Function]",z="[object Boolean]",g="[object Number]",e="[object String]",h="[object Array]",A="[object Date]",i=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function k(J){switch(J){case null:return x;case (void 0):return p}var I=typeof J;switch(I){case"boolean":return v;case"number":return l;case"string":return r}return E}function y(K,J){for(var I in J){K[I]=J[I]}return K}function F(I){try{if(d(I)){return"undefined"}if(I===null){return"null"}return I.inspect?I.inspect():String(I)}catch(J){if(J instanceof RangeError){return"..."}throw J}}function u(I){return D("",{"":I},[])}function D(Q,S,O){var P=S[Q],N=typeof P;if(k(P)===E&&typeof P.toJSON==="function"){P=P.toJSON(Q)}var J=w.call(P);switch(J){case g:case z:case e:P=P.valueOf()}switch(P){case null:return"null";case true:return"true";case false:return"false"}N=typeof P;switch(N){case"string":return P.inspect(true);case"number":return isFinite(P)?String(P):"null";case"object":for(var K=0,L=O.length;K<L;K++){if(O[K]===P){throw new TypeError()}}O.push(P);var I=[];if(J===h){for(var K=0,L=P.length;K<L;K++){var M=D(K,P,O);I.push(typeof M==="undefined"?"null":M)}I="["+I.join(",")+"]"}else{var R=Object.keys(P);for(var K=0,L=R.length;K<L;K++){var Q=R[K],M=D(Q,P,O);if(typeof M!=="undefined"){I.push(Q.inspect(true)+":"+M)}}I="{"+I.join(",")+"}"}O.pop();return I}}function B(I){return JSON.stringify(I)}function f(I){return $H(I).toQueryString()}function a(I){return I&&I.toHTML?I.toHTML():String.interpret(I)}function q(K){if(k(K)!==E){throw new TypeError()}var J=[];for(var I in K){if(K.hasOwnProperty(I)){J.push(I)}}return J}function m(K){var J=[];for(var I in K){J.push(K[I])}return J}function C(I){return y({},I)}function t(I){return !!(I&&I.nodeType==1)}function n(I){return w.call(I)===h}var o=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(o){n=Array.isArray}function j(I){return I instanceof Hash}function b(I){return w.call(I)===H}function c(I){return w.call(I)===e}function G(I){return w.call(I)===g}function s(I){return w.call(I)===A}function d(I){return typeof I==="undefined"}y(Object,{extend:y,inspect:F,toJSON:i?B:u,toQueryString:f,toHTML:a,keys:Object.keys||q,values:m,clone:C,isElement:t,isArray:n,isHash:j,isFunction:b,isString:c,isNumber:G,isDate:s,isUndefined:d})})();Object.extend(Function.prototype,(function(){var k=Array.prototype.slice;function d(o,m){var n=o.length,l=m.length;while(l--){o[n+l]=m[l]}return o}function j(m,l){m=k.call(m,0);return d(m,l)}function c(){var l=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return l.length==1&&!l[0]?[]:l}function h(m){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var n=this,l=k.call(arguments,1);return function(){var o=j(l,arguments);return n.apply(m,o)}}function f(m){var n=this,l=k.call(arguments,1);return function(p){var o=d([p||window.event],l);return n.apply(m,o)}}function i(){if(!arguments.length){return this}var m=this,l=k.call(arguments,0);return function(){var n=j(l,arguments);return m.apply(this,n)}}function e(l){var n=this,m=k.call(arguments,1);l=l*1000;return window.setTimeout(function(){return n.apply(n,m)},l)}function a(){var l=d([0.01],arguments);return this.delay.apply(this,l)}function b(m){var l=this;return function(){var n=d([l.bind(this)],arguments);return m.apply(this,n)}}function g(){if(this._methodized){return this._methodized}var l=this;return this._methodized=function(){var m=d([this],arguments);return l.apply(null,m)}}return{argumentNames:c,bind:h,bindAsEventListener:f,curry:i,delay:e,defer:a,wrap:b,methodize:g}})());(function(b){function a(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"}function c(){return this.toISOString()}if(!b.toISOString){b.toISOString=a}if(!b.toJSON){b.toJSON=c}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(b,a){this.template=b.toString();this.pattern=a||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(f){if(a==null){return(f[1]+"")}var c=f[1]||"";if(c=="\\"){return f[2]}var d=a,g=f[3],b=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;f=b.exec(g);if(f==null){return c}while(f!=null){var e=f[1].startsWith("[")?f[2].replace(/\\\\]/g,"]"):f[1];d=d[e];if(null==d||""==f[3]){break}g=g.substring("["==f[3]?f[1].length:f[0].length);f=b.exec(g)}return c+String.interpret(d)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function d(y,x){var w=0;try{this._each(function(A){y.call(x,A,w++)})}catch(z){if(z!=$break){throw z}}return this}function o(w,z,y){var x=-w,A=[],B=this.toArray();if(w<1){return B}while((x+=w)<B.length){A.push(B.slice(x,x+w))}return A.collect(z,y)}function c(x,w){x=x||Prototype.K;var y=true;this.each(function(A,z){y=y&&!!x.call(w,A,z);if(!y){throw $break}});return y}function i(x,w){x=x||Prototype.K;var y=false;this.each(function(A,z){if(y=!!x.call(w,A,z)){throw $break}});return y}function j(y,x){y=y||Prototype.K;var w=[];this.each(function(A,z){w.push(y.call(x,A,z))});return w}function m(x,w){var y;this.each(function(A,z){if(x.call(w,A,z)){y=A;throw $break}});return y}function b(y,x){var w=[];this.each(function(A,z){if(y.call(x,A,z)){w.push(A)}});return w}function h(w,z,y){z=z||Prototype.K;var x=[];if(Object.isString(w)){w=new RegExp(RegExp.escape(w))}this.each(function(B,A){if(w.match(B)){x.push(z.call(y,B,A))}});return x}function a(w){if(Object.isFunction(this.indexOf)){if(this.indexOf(w)!=-1){return true}}var x=false;this.each(function(y){if(y==w){x=true;throw $break}});return x}function p(w,x){x=Object.isUndefined(x)?null:x;return this.eachSlice(w,function(y){while(y.length<w){y.push(x)}return y})}function u(w,y,x){this.each(function(A,z){w=y.call(x,w,A,z)});return w}function k(x){var w=$A(arguments).slice(1);return this.map(function(y){return y[x].apply(y,w)})}function q(x,w){x=x||Prototype.K;var y;this.each(function(A,z){A=x.call(w,A,z);if(y==null||A>=y){y=A}});return y}function n(x,w){x=x||Prototype.K;var y;this.each(function(A,z){A=x.call(w,A,z);if(y==null||A<y){y=A}});return y}function e(z,x){z=z||Prototype.K;var y=[],w=[];this.each(function(B,A){(z.call(x,B,A)?y:w).push(B)});return[y,w]}function f(w){var x=[];this.each(function(y){x.push(y[w])});return x}function g(y,x){var w=[];this.each(function(A,z){if(!y.call(x,A,z)){w.push(A)}});return w}function t(x,w){return this.map(function(z,y){return{value:z,criteria:x.call(w,z,y)}}).sort(function(B,A){var z=B.criteria,y=A.criteria;return z<y?-1:z>y?1:0}).pluck("value")}function r(){return this.map()}function s(){var x=Prototype.K,w=$A(arguments);if(Object.isFunction(w.last())){x=w.pop()}var y=[this].concat(w).map($A);return this.map(function(A,z){return x(y.pluck(z))})}function l(){return this.toArray().length}function v(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:d,eachSlice:o,all:c,every:c,any:i,some:i,collect:j,map:j,detect:m,findAll:b,select:b,filter:b,grep:h,include:a,member:a,inGroupsOf:p,inject:u,invoke:k,max:q,min:n,partition:e,pluck:f,reject:g,sortBy:t,toArray:r,entries:r,zip:s,size:l,inspect:v,find:m}})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var a=c.length||0,b=new Array(a);while(a--){b[a]=c[a]}return b}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var m=Array.prototype,o=m.slice,q=m.forEach;function b(x,w){for(var v=0,u=this.length>>>0;v<u;v++){if(v in this){x.call(w,this[v],v,this)}}}if(!q){q=b}function n(){this.length=0;return this}function d(){return this[0]}function g(){return this[this.length-1]}function j(){return this.select(function(u){return u!=null})}function i(){return this.inject([],function(v,u){if(Object.isArray(u)){return v.concat(u.flatten())}v.push(u);return v})}function h(){var u=o.call(arguments,0);return this.select(function(v){return !u.include(v)})}function f(u){return(u===false?this.toArray():this)._reverse()}function l(u){return this.inject([],function(x,w,v){if(0==v||(u?x.last()!=w:!x.include(w))){x.push(w)}return x})}function r(u){return this.uniq().findAll(function(v){return u.detect(function(w){return v===w})})}function s(){return o.call(this,0)}function k(){return this.length}function t(){return"["+this.map(Object.inspect).join(", ")+"]"}function a(w,v){v||(v=0);var u=this.length;if(v<0){v=u+v}for(;v<u;v++){if(this[v]===w){return v}}return -1}function p(v,u){u=isNaN(u)?this.length:(u<0?this.length+u:u)+1;var w=this.slice(0,u).reverse().indexOf(v);return(w<0)?w:u-w-1}function c(){var z=o.call(this,0),x;for(var w=0,u=arguments.length;w<u;w++){x=arguments[w];if(Object.isArray(x)&&!("callee" in x)){for(var v=0,y=x.length;v<y;v++){z.push(x[v])}}else{z.push(x)}}return z}Object.extend(m,Enumerable);if(!m._reverse){m._reverse=m.reverse}Object.extend(m,{_each:q,clear:n,first:d,last:g,compact:j,flatten:i,without:h,reverse:f,uniq:l,intersect:r,clone:s,toArray:s,size:k,inspect:t});var e=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(e){m.concat=c}if(!m.indexOf){m.indexOf=a}if(!m.lastIndexOf){m.lastIndexOf=p}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function d(p){this._object=Object.isHash(p)?p.toObject():Object.clone(p)}function e(q){for(var p in this._object){var r=this._object[p],s=[p,r];s.key=p;s.value=r;q(s)}}function k(p,q){return this._object[p]=q}function b(p){if(this._object[p]!==Object.prototype[p]){return this._object[p]}}function o(p){var q=this._object[p];delete this._object[p];return q}function j(){return Object.clone(this._object)}function n(){return this.pluck("key")}function m(){return this.pluck("value")}function g(q){var p=this.detect(function(r){return r.value===q});return p&&p.key}function i(p){return this.clone().update(p)}function c(p){return new Hash(p).inject(this,function(q,r){q.set(r.key,r.value);return q})}function a(p,q){if(Object.isUndefined(q)){return p}return p+"="+encodeURIComponent(String.interpret(q))}function f(){return this.inject([],function(s,w){var r=encodeURIComponent(w.key),t=w.value;if(t&&typeof t=="object"){if(Object.isArray(t)){var v=[];for(var q=0,p=t.length,u;q<p;q++){u=t[q];v.push(a(r,u))}return s.concat(v)}}else{s.push(a(r,t))}return s}).join("&")}function l(){return"#<Hash:{"+this.map(function(p){return p.map(Object.inspect).join(": ")}).join(", ")+"}>"}function h(){return new Hash(this)}return{initialize:d,_each:e,set:k,get:b,unset:o,toObject:j,toTemplateReplacements:j,keys:n,values:m,index:g,merge:i,update:c,toQueryString:f,inspect:l,toJSON:j,clone:h}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function h(j,i){$R(0,this,true).each(j,i);return this}function g(i,k){var j=this.toString(k||10);return"0".times(i-j.length)+j}function a(){return Math.abs(this)}function c(){return Math.round(this)}function e(){return Math.ceil(this)}function f(){return Math.floor(this)}return{toColorPart:d,succ:b,times:h,toPaddedString:g,abs:a,round:c,ceil:e,floor:f}})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(f,d,e){this.start=f;this.end=d;this.exclusive=e}function c(d){var e=this.start;while(this.include(e)){d(e);e=e.succ()}}function a(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:b,_each:c,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(c,b,d,a){this.each(function(f){if(Object.isFunction(f[c])){try{f[c].apply(f,[b,d,a])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,a,b){$super(b);this.transport=Ajax.getTransport();this.request(a)},request:function(a){this.url=a;this.method=this.options.method;var d=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);if(!["get","post"].include(this.method)){d+=(d?"&":"")+"_method="+this.method;this.method="post"}if(d&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+d}this.parameters=d.toQueryParams();try{var b=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(b)}Ajax.Responders.dispatch("onCreate",this,b);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||d):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var e={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){e["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){e.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var b=this.options.requestHeaders;if(Object.isFunction(b.push)){for(var d=0,a=b.length;d<a;d+=2){e[b[d]]=b[d+1]}}else{$H(b).each(function(f){e[f.key]=f.value})}}for(var c in e){this.transport.setRequestHeader(c,e[c])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="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 d=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&d&&d.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(f){this.dispatchException(f)}if(c=="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(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.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,c,a,b){this.container={success:(c.success||c),failure:(c.failure||(c.success?null:c))};b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(f,e){this.updateContent(f.responseText);if(Object.isFunction(d)){d(f,e)}}).bind(this);$super(a,b)},updateContent:function(d){var b=this.container[this.success()?"success":"failure"],c=this.options;if(!c.evalScripts){d=d.stripScripts()}if(b=$(b)){if(c.insertion){if(Object.isString(c.insertion)){var a={};a[c.insertion]=d;b.insert(a)}else{c.insertion(b,d)}}else{b.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,c,a,b){$super(b);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=c;this.url=a;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 $(c){if(arguments.length>1){for(var d=0,a=[],b=arguments.length;d<b;d++){a.push($(arguments[d]))}return a}if(Object.isString(c)){c=document.getElementById(c)}return Element.extend(c)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(f,d){var c=[];var e=document.evaluate(f,$(d)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,a=e.snapshotLength;b<a;b++){c.push(Element.extend(e.snapshotItem(b)))}return c}}if(!Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(a){function d(f,e){if(f==="select"){return false}if("type" in e){return false}return true}var c=(function(){try{var e=document.createElement('<input name="x">');return e.tagName.toLowerCase()==="input"&&e.name==="x"}catch(f){return false}})();var b=a.Element;a.Element=function(g,f){f=f||{};g=g.toLowerCase();var e=Element.cache;if(c&&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))}var h=d(g,f)?e[g].cloneNode(false):document.createElement(g);return Element.writeAttribute(h,f)};Object.extend(a.Element,b||{});if(b){a.Element.prototype=b.prototype}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(a){var b=a._prototypeUID;if(b){Element.stopObserving(a);a._prototypeUID=void 0;delete Element.Storage[b]}};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 d=(function(){var g=document.createElement("select"),h=true;g.innerHTML='<option value="test">test</option>';if(g.options&&g.options[0]){h=g.options[0].nodeName.toUpperCase()!=="OPTION"}g=null;return h})();var b=(function(){try{var g=document.createElement("table");if(g&&g.tBodies){g.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var i=typeof g.tBodies[0]=="undefined";g=null;return i}}catch(h){return true}})();var c=(function(){try{var g=document.createElement("div");g.innerHTML="<link>";var i=(g.childNodes.length===0);g=null;return i}catch(h){return true}})();var a=d||b||c;var f=(function(){var g=document.createElement("script"),i=false;try{g.appendChild(document.createTextNode(""));i=!g.firstChild||g.firstChild&&g.firstChild.nodeType!==3}catch(h){i=true}g=null;return i})();function e(j,l){j=$(j);var m=Element._purgeElement;var n=j.getElementsByTagName("*"),k=n.length;while(k--){m(n[k])}if(l&&l.toElement){l=l.toElement()}if(Object.isElement(l)){return j.update().insert(l)}l=Object.toHTML(l);var h=j.tagName.toUpperCase();if(h==="SCRIPT"&&f){j.text=l;return j}if(a){if(h in Element._insertionTranslations.tags){while(j.firstChild){j.removeChild(j.firstChild)}Element._getContentFromAnonymousElement(h,l.stripScripts()).each(function(i){j.appendChild(i)})}else{if(c&&Object.isString(l)&&l.indexOf("<link")>-1){while(j.firstChild){j.removeChild(j.firstChild)}var g=Element._getContentFromAnonymousElement(h,l.stripScripts(),true);g.each(function(i){j.appendChild(i)})}else{j.innerHTML=l.stripScripts()}}}else{j.innerHTML=l.stripScripts()}l.evalScripts.bind(l).defer();return j}return e})(),replace:function(b,c){b=$(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,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,b,c,g;for(var a in f){e=f[a];a=a.toLowerCase();b=Element._insertionTranslations[a];if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){b(d,e);continue}e=Object.toHTML(e);c=((a=="before"||a=="after")?d.parentNode:d).tagName.toUpperCase();g=Element._getContentFromAnonymousElement(c,e.stripScripts());if(a=="top"||a=="after"){g.reverse()}g.each(b.curry(d));e.evalScripts.bind(e).defer()}return d},wrap:function(b,c,a){b=$(b);if(Object.isElement(c)){$(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(a){a=$(a);var b="<"+a.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(f){var c=f.first(),d=f.last(),e=(a[c]||"").toString();if(e){b+=" "+d+"="+e.inspect(true)}});return b+">"},recursivelyCollect:function(c,b,d){c=$(c);d=d||-1;var a=[];while(c=c[b]){if(c.nodeType==1){a.push(Element.extend(c))}if(a.length==d){break}}return a},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){var b=[],c=$(a).firstChild;while(c){if(c.nodeType===1){b.push(Element.extend(c))}c=c.nextSibling}return b},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){b=$(b);if(Object.isString(a)){return Prototype.Selector.match(b,a)}return a.match(b)},up:function(c,d,b){c=$(c);if(arguments.length==1){return $(c.parentNode)}var a=Element.ancestors(c);return Object.isNumber(d)?a[d]:Prototype.Selector.find(a,d,b)},down:function(b,c,a){b=$(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,c,a){b=$(b);if(Object.isNumber(c)){a=c,c=false}if(!Object.isNumber(a)){a=0}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,d,a){b=$(b);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.nextSiblings(),d,a)}else{var c=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]}},select:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=$(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=$(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while($(b));Element.writeAttribute(a,"id",b);return b},readAttribute:function(b,a){b=$(b);if(Prototype.Browser.IE){var c=Element._attributeTranslations.read;if(c.values[a]){return c.values[a](b,a)}if(c.names[a]){a=c.names[a]}if(a.include(":")){return(!b.attributes||!b.attributes[a])?null:b.attributes[a].value}}return b.getAttribute(a)},writeAttribute:function(d,c,f){d=$(d);var b={},e=Element._attributeTranslations.write;if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(f)?true:f}for(var a in b){c=e.names[a]||a;f=b[a];if(e.values[a]){c=e.values[a](d,f)}if(f===false||f===null){d.removeAttribute(c)}else{if(f===true){d.setAttribute(c,c)}else{d.setAttribute(c,f)}}}return d},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(b,a){if(!(b=$(b))){return}var c=b.className;return(c.length>0&&(c==a||new RegExp("(^|\\s)"+a+"(\\s|$)").test(c)))},addClassName:function(b,a){if(!(b=$(b))){return}if(!Element.hasClassName(b,a)){b.className+=(b.className?" ":"")+a}return b},removeClassName:function(b,a){if(!(b=$(b))){return}b.className=b.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ").strip();return b},toggleClassName:function(b,a){if(!(b=$(b))){return}return Element[Element.hasClassName(b,a)?"removeClassName":"addClassName"](b,a)},cleanWhitespace:function(b){b=$(b);var c=b.firstChild;while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=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(a,c){a=$(a);c=c=="float"?"cssFloat":c.camelize();var d=a.style[c];if(!d||d=="auto"){var b=document.defaultView.getComputedStyle(a,null);d=b?b[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(e,c){e=$(e);var b=e.style,d;if(Object.isString(c)){e.style.cssText+=";"+c;return c.include("opacity")?e.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):e}for(var a in c){if(a=="opacity"){e.setOpacity(c[a])}else{b[(a=="float"||a=="cssFloat")?(Object.isUndefined(b.styleFloat)?"cssFloat":"styleFloat"):a]=c[a]}}return e},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(c,a){var d=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});a=$(a);var e=Element.viewportOffset(a),f=[0,0],b=null;c=$(c);if(Element.getStyle(c,"position")=="absolute"){b=Element.getOffsetParent(c);f=Element.viewportOffset(b)}if(b==document.body){f[0]-=document.body.offsetLeft;f[1]-=document.body.offsetTop}if(d.setLeft){c.style.left=(e[0]-f[0]+d.offsetLeft)+"px"}if(d.setTop){c.style.top=(e[1]-f[1]+d.offsetTop)+"px"}if(d.setWidth){c.style.width=a.offsetWidth+"px"}if(d.setHeight){c.style.height=a.offsetHeight+"px"}return c}};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(a,c,d){switch(d){case"height":case"width":if(!Element.visible(c)){return null}var e=parseInt(a(c,d),10);if(e!==c["offset"+d.capitalize()]){return e+"px"}var b;if(d==="height"){b=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{b=["border-left-width","padding-left","padding-right","border-right-width"]}return b.inject(e,function(g,f){var h=a(c,f);return h===null?g:g-parseInt(h,10)})+"px";default:return a(c,d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(a,b,c){if(c==="title"){return b.title}return a(b,c)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=$(a);b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(c,e){function f(g){return g.replace(/alpha\([^\)]*\)/gi,"")}c=$(c);var b=c.currentStyle;if((b&&!b.hasLayout)||(!b&&c.style.zoom=="normal")){c.style.zoom=1}var a=c.getStyle("filter"),d=c.style;if(e==1||e===""){(a=f(a))?d.filter=a:d.removeAttribute("filter");return c}else{if(e<0.00001){e=0}}d.filter=f(a)+"alpha(opacity="+(e*100)+")";return c};Element._attributeTranslations=(function(){var c="className",b="for",a=document.createElement("div");a.setAttribute(c,"x");if(a.className!=="x"){a.setAttribute("class","x");if(a.className==="x"){c="class"}}a=null;a=document.createElement("label");a.setAttribute(b,"x");if(a.htmlFor!=="x"){a.setAttribute("htmlFor","x");if(a.htmlFor==="x"){b="htmlFor"}}a=null;return{read:{names:{"class":c,className:c,"for":b,htmlFor:b},values:{_getAttr:function(d,e){return d.getAttribute(e)},_getAttr2:function(d,e){return d.getAttribute(e,2)},_getAttrNode:function(d,f){var e=d.getAttributeNode(f);return e?e.value:""},_getEv:(function(){var d=document.createElement("div"),g;d.onclick=Prototype.emptyFunction;var e=d.getAttribute("onclick");if(String(e).indexOf("{")>-1){g=function(f,h){h=f.getAttribute(h);if(!h){return null}h=h.toString();h=h.split("{")[1];h=h.split("}")[0];return h.strip()}}else{if(e===""){g=function(f,h){h=f.getAttribute(h);if(!h){return null}return h.strip()}}}d=null;return g})(),_flag:function(d,e){return $(d).hasAttribute(e)?e:null},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.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(c){var b=c.getElementsByTagName("*"),e=[];for(var d=0,f;f=b[d];d++){if(f.tagName!=="!"){e.push(f)}}return e}Element.Methods.down=function(c,d,b){c=$(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[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 d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(e,f){e=$(e);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){e.parentNode.replaceChild(f,e);return e}f=Object.toHTML(f);var c=e.parentNode,d=c.tagName.toUpperCase();if(Element._insertionTranslations.tags[d]){var b=e.next(),a=Element._getContentFromAnonymousElement(d,f.stripScripts());c.removeChild(e);if(b){a.each(function(g){c.insertBefore(g,b)})}else{a.each(function(g){c.appendChild(g)})}}else{e.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return e}}Element._returnOffset=function(a,b){var c=[a,b];c.left=a;c.top=b;return c};Element._getContentFromAnonymousElement=function(a,d,f){var g=new Element("div"),c=Element._insertionTranslations.tags[a];var e=false;if(c){e=true}else{if(f){e=true;c=["","",0]}}if(e){g.innerHTML="&nbsp;"+c[0]+d+c[1];g.removeChild(g.firstChild);for(var b=c[2];b--;){g=g.firstChild}}else{g.innerHTML=d}return $A(g.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,c){c=Element._attributeTranslations.has[c]||c;var b=$(a).getAttributeNode(c);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 c(g){if(typeof window.Element!="undefined"){var i=window.Element.prototype;if(i){var k="_"+(Math.random()+"").slice(2),h=document.createElement(g);i[k]="x";var j=(h[k]!=="x");delete i[k];h=null;return j}}return false}function b(i,h){for(var g in h){var j=h[g];if(Object.isFunction(j)&&!(g in i)){i[g]=j.methodize()}}}var a=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(a){return function(g){if(g&&typeof g._extendedByPrototype=="undefined"){var h=g.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(g,Element.Methods);b(g,Element.Methods.Simulated);b(g,Element.Methods.ByTag[h.toUpperCase()])}}return g}}return Prototype.K}var e={},d=Element.Methods.ByTag;var f=Object.extend(function(i){if(!i||typeof i._extendedByPrototype!="undefined"||i.nodeType!=1||i==window){return i}var g=Object.clone(e),h=i.tagName.toUpperCase();if(d[h]){Object.extend(g,d[h])}b(i,g);i._extendedByPrototype=Prototype.emptyFunction;return i},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(e,Element.Methods);Object.extend(e,Element.Methods.Simulated)}}});f.refresh();return f})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(c){var i=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var f=c;c=arguments[1]}if(!f){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(f)){f.each(a)}else{a(f)}}function a(k){k=k.toUpperCase();if(!Element.Methods.ByTag[k]){Element.Methods.ByTag[k]={}}Object.extend(Element.Methods.ByTag[k],c)}function b(l,o,n){n=n||false;for(var k in l){var m=l[k];if(!Object.isFunction(m)){continue}if(!n||!(k in o)){o[k]=m.methodize()}}}function e(m){var k;var n={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(n[m]){k="HTML"+n[m]+"Element"}if(window[k]){return window[k]}k="HTML"+m+"Element";if(window[k]){return window[k]}k="HTML"+m.capitalize()+"Element";if(window[k]){return window[k]}var l=document.createElement(m),o=l.__proto__||l.constructor.prototype;l=null;return o}var h=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(i.ElementExtensions){b(Element.Methods,h);b(Element.Methods.Simulated,h,true)}if(i.SpecificElementExtensions){for(var j in Element.Methods.ByTag){var g=e(j);if(Object.isUndefined(g)){continue}b(d[j],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(c){var g=Prototype.Browser,f=document,d,b={};function a(){if(g.WebKit&&!f.evaluate){return document}if(g.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function e(h){if(!d){d=a()}b[h]="client"+h;c["get"+h]=function(){return d[b[h]]};return c["get"+h]()}c.getWidth=e.curry("Width");c.getHeight=e.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(a){if(!(a=$(a))){return}var b;if(a===window){b=0}else{if(typeof a._prototypeUID==="undefined"){a._prototypeUID=Element.Storage.UID++}b=a._prototypeUID}if(!Element.Storage[b]){Element.Storage[b]=$H()}return Element.Storage[b]},store:function(a,b,c){if(!(a=$(a))){return}if(arguments.length===2){Element.getStorage(a).update(b)}else{Element.getStorage(a).set(b,c)}return a},retrieve:function(a,b,c){if(!(a=$(a))){return}var e=Element.getStorage(a),d=e.get(b);if(Object.isUndefined(d)){e.set(b,c);d=c}return d},clone:function(b,a){if(!(b=$(b))){return}var e=b.cloneNode(a);e._prototypeUID=void 0;if(a){var d=Element.select(e,"*"),c=d.length;while(c--){d[c]._prototypeUID=void 0}}return Element.extend(e)},purge:function(a){if(!(a=$(a))){return}var c=Element._purgeElement;c(a);var d=a.getElementsByTagName("*"),b=d.length;while(b--){c(d[b])}return null}});(function(){function d(u){var v=u.match(/^(\d+)%?$/i);if(!v){return null}return(Number(v[1])/100)}function t(D,E,v){var w=null;if(Object.isElement(D)){w=D;D=w.getStyle(E)}if(D===null){return null}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(D)){return window.parseFloat(D)}var A=D.include("%"),x=(v===document.viewport);if(/\d/.test(D)&&w&&w.runtimeStyle&&!(A&&x)){var u=w.style.left,F=w.runtimeStyle.left;w.runtimeStyle.left=w.currentStyle.left;w.style.left=D||0;D=w.style.pixelLeft;w.style.left=u;w.runtimeStyle.left=F;return D}if(w&&A){v=v||w.parentNode;var y=d(D);var B=null;var z=w.getStyle("position");var G=E.include("left")||E.include("right")||E.include("width");var C=E.include("top")||E.include("bottom")||E.include("height");if(v===document.viewport){if(G){B=document.viewport.getWidth()}else{if(C){B=document.viewport.getHeight()}}}else{if(G){B=$(v).measure("width")}else{if(C){B=$(v).measure("height")}}}return(B===null)?0:B*y}return 0}function f(u){if(Object.isString(u)&&u.endsWith("px")){return u}return u+"px"}function l(u){var v=u;while(u&&u.parentNode){var w=u.getStyle("display");if(w==="none"){return false}u=$(u.parentNode)}return true}var i=Prototype.K;if("currentStyle" in document.documentElement){i=function(u){if(!u.currentStyle.hasLayout){u.style.zoom=1}return u}}function g(u){if(u.include("border")){u=u+"-width"}return u.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,v,u){$super();this.element=$(v);Element.Layout.PROPERTIES.each(function(w){this._set(w,null)},this);if(u){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(u,v){return Hash.prototype.set.call(this,u,v)},set:function(u,v){throw"Properties of Element.Layout are read-only."},get:function($super,u){var v=$super(u);return v===null?this._compute(u):v},_begin:function(){if(this._prepared){return}var x=this.element;if(l(x)){this._prepared=true;return}var B={position:x.style.position||"",width:x.style.width||"",visibility:x.style.visibility||"",display:x.style.display||""};x.store("prototype_original_styles",B);var A=x.getStyle("position"),v=x.getStyle("width");if(v==="0px"||v===null){x.style.display="block";v=x.getStyle("width")}var u=(A==="fixed")?document.viewport:x.parentNode;x.setStyle({position:"absolute",visibility:"hidden",display:"block"});var y=x.getStyle("width");var z;if(v&&(y===v)){z=t(x,"width",u)}else{if(A==="absolute"||A==="fixed"){z=t(x,"width",u)}else{var C=x.parentNode,w=$(C).getLayout();z=w.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}x.setStyle({width:z+"px"});this._prepared=true},_end:function(){var v=this.element;var u=v.retrieve("prototype_original_styles");v.store("prototype_original_styles",null);v.setStyle(u);this._prepared=false},_compute:function(u){var v=Element.Layout.COMPUTATIONS;if(!(u in v)){throw"Property not found."}return this._set(u,v[u].call(this,this.element))},toObject:function(){var u=$A(arguments);var v=(u.length===0)?Element.Layout.PROPERTIES:u.join(" ").split(" ");var w={};v.each(function(x){if(!Element.Layout.PROPERTIES.include(x)){return}var y=this.get(x);if(y!=null){w[x]=y}},this);return w},toHash:function(){var u=this.toObject.apply(this,arguments);return new Hash(u)},toCSS:function(){var u=$A(arguments);var w=(u.length===0)?Element.Layout.PROPERTIES:u.join(" ").split(" ");var v={};w.each(function(x){if(!Element.Layout.PROPERTIES.include(x)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(x)){return}var y=this.get(x);if(y!=null){v[g(x)]=y+"px"}},this);return v},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(u){if(!this._preComputing){this._begin()}var x=this.get("border-box-height");if(x<=0){if(!this._preComputing){this._end()}return 0}var w=this.get("border-top"),v=this.get("border-bottom");var z=this.get("padding-top"),y=this.get("padding-bottom");if(!this._preComputing){this._end()}return x-w-v-z-y},width:function(u){if(!this._preComputing){this._begin()}var v=this.get("border-box-width");if(v<=0){if(!this._preComputing){this._end()}return 0}var z=this.get("border-left"),w=this.get("border-right");var x=this.get("padding-left"),y=this.get("padding-right");if(!this._preComputing){this._end()}return v-z-w-x-y},"padding-box-height":function(u){var v=this.get("height"),x=this.get("padding-top"),w=this.get("padding-bottom");return v+x+w},"padding-box-width":function(u){var v=this.get("width"),w=this.get("padding-left"),x=this.get("padding-right");return v+w+x},"border-box-height":function(u){if(!this._preComputing){this._begin()}var v=u.offsetHeight;if(!this._preComputing){this._end()}return v},"border-box-width":function(u){if(!this._preComputing){this._begin()}var v=u.offsetWidth;if(!this._preComputing){this._end()}return v},"margin-box-height":function(u){var w=this.get("border-box-height"),v=this.get("margin-top"),x=this.get("margin-bottom");if(w<=0){return 0}return w+v+x},"margin-box-width":function(u){var v=this.get("border-box-width"),x=this.get("margin-left"),w=this.get("margin-right");if(v<=0){return 0}return v+x+w},top:function(u){var v=u.positionedOffset();return v.top},bottom:function(w){var x=w.positionedOffset(),v=w.getOffsetParent(),u=v.measure("height");var y=this.get("border-box-height");return u-y-x.top},left:function(u){var v=u.positionedOffset();return v.left},right:function(v){var y=v.positionedOffset(),u=v.getOffsetParent(),x=u.measure("width");var w=this.get("border-box-width");return x-w-y.left},"padding-top":function(u){return t(u,"paddingTop")},"padding-bottom":function(u){return t(u,"paddingBottom")},"padding-left":function(u){return t(u,"paddingLeft")},"padding-right":function(u){return t(u,"paddingRight")},"border-top":function(u){return t(u,"borderTopWidth")},"border-bottom":function(u){return t(u,"borderBottomWidth")},"border-left":function(u){return t(u,"borderLeftWidth")},"border-right":function(u){return t(u,"borderRightWidth")},"margin-top":function(u){return t(u,"marginTop")},"margin-bottom":function(u){return t(u,"marginBottom")},"margin-left":function(u){return t(u,"marginLeft")},"margin-right":function(u){return t(u,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(v){var u=i(v.getOffsetParent());var x=v.getBoundingClientRect(),w=u.getBoundingClientRect();return(w.right-x.right).round()},bottom:function(v){var u=i(v.getOffsetParent());var x=v.getBoundingClientRect(),w=u.getBoundingClientRect();return(w.bottom-x.bottom).round()}})}Element.Offset=Class.create({initialize:function(v,u){this.left=v.round();this.top=u.round();this[0]=this.left;this[1]=this.top},relativeTo:function(u){return new Element.Offset(this.left-u.left,this.top-u.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function q(v,u){return new Element.Layout(v,u)}function h(v,u){return $(v).getLayout().get(u)}function n(w){w=$(w);var z=Element.getStyle(w,"display");if(z&&z!=="none"){return{width:w.offsetWidth,height:w.offsetHeight}}var x=w.style;var v={visibility:x.visibility,position:x.position,display:x.display};var u={visibility:"hidden",display:"block"};if(v.position!=="fixed"){u.position="absolute"}Element.setStyle(w,u);var y={width:w.offsetWidth,height:w.offsetHeight};Element.setStyle(w,v);return y}function m(v){v=$(v);if(k(v)||j(v)||b(v)||a(v)){return $(document.body)}var u=(Element.getStyle(v,"display")==="inline");if(!u&&v.offsetParent){return $(v.offsetParent)}while((v=v.parentNode)&&v!==document.body){if(Element.getStyle(v,"position")!=="static"){return a(v)?$(document.body):$(v)}}return $(document.body)}function o(u){u=$(u);var v=0,w=0;if(u.parentNode){do{v+=u.offsetTop||0;w+=u.offsetLeft||0;u=u.offsetParent}while(u)}return new Element.Offset(w,v)}function p(v){v=$(v);var u=v.getLayout();var w=0,y=0;do{w+=v.offsetTop||0;y+=v.offsetLeft||0;v=v.offsetParent;if(v){if(b(v)){break}var x=Element.getStyle(v,"position");if(x!=="static"){break}}}while(v);y-=u.get("margin-top");w-=u.get("margin-left");return new Element.Offset(y,w)}function e(u){var v=0,w=0;do{v+=u.scrollTop||0;w+=u.scrollLeft||0;u=u.parentNode}while(u);return new Element.Offset(w,v)}function s(x){u=$(u);var w=0,y=0,v=document.body;var u=x;do{w+=u.offsetTop||0;y+=u.offsetLeft||0;if(u.offsetParent==v&&Element.getStyle(u,"position")=="absolute"){break}}while(u=u.offsetParent);u=x;do{if(u!=v){w-=u.scrollTop||0;y-=u.scrollLeft||0}}while(u=u.parentNode);return new Element.Offset(y,w)}function r(w){w=$(w);if(Element.getStyle(w,"position")==="absolute"){return w}var y=m(w);var x=w.viewportOffset(),v=y.viewportOffset();var z=x.relativeTo(v);var u=w.getLayout();w.store("prototype_absolutize_original_styles",{left:w.getStyle("left"),top:w.getStyle("top"),width:w.getStyle("width"),height:w.getStyle("height")});w.setStyle({position:"absolute",top:z.top+"px",left:z.left+"px",width:u.get("width")+"px",height:u.get("height")+"px"});return w}function c(v){v=$(v);if(Element.getStyle(v,"position")==="relative"){return v}var u=v.retrieve("prototype_absolutize_original_styles");if(u){v.setStyle(u)}return v}if(Prototype.Browser.IE){m=m.wrap(function(v,w){w=$(w);if(k(w)||j(w)||b(w)||a(w)){return $(document.body)}var u=w.getStyle("position");if(u!=="static"){return v(w)}w.setStyle({position:"relative"});var x=v(w);w.setStyle({position:u});return x});p=p.wrap(function(v,w){w=$(w);if(!w.parentNode){return new Element.Offset(0,0)}var u=w.getStyle("position");if(u!=="static"){return v(w)}var x=w.getOffsetParent();if(x&&x.getStyle("position")==="fixed"){i(x)}w.setStyle({position:"relative"});var y=v(w);w.setStyle({position:u});return y})}else{if(Prototype.Browser.Webkit){o=function(u){u=$(u);var v=0,w=0;do{v+=u.offsetTop||0;w+=u.offsetLeft||0;if(u.offsetParent==document.body){if(Element.getStyle(u,"position")=="absolute"){break}}u=u.offsetParent}while(u);return new Element.Offset(w,v)}}}Element.addMethods({getLayout:q,measure:h,getDimensions:n,getOffsetParent:m,cumulativeOffset:o,positionedOffset:p,cumulativeScrollOffset:e,viewportOffset:s,absolutize:r,relativize:c});function b(u){return u.nodeName.toUpperCase()==="BODY"}function a(u){return u.nodeName.toUpperCase()==="HTML"}function k(u){return u.nodeType===Node.DOCUMENT_NODE}function j(u){return u!==document.body&&!Element.descendantOf(u,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(u){u=$(u);if(j(u)){return new Element.Offset(0,0)}var v=u.getBoundingClientRect(),w=document.documentElement;return new Element.Offset(v.left-w.clientLeft,v.top-w.clientTop)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function c(){throw new Error('Method "Prototype.Selector.select" must be defined.')}function b(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(g,m,k){k=k||0;var j=Prototype.Selector.match,h=g.length,f=0,l;for(l=0;l<h;l++){if(j(g[l],m)&&k==f++){return Element.extend(g[l])}}}function e(f){for(var h=0,g=f.length;h<g;h++){Element.extend(f[h])}return f}var a=Prototype.K;return{select:c,match:b,find:d,extendElements:(Element.extend===a)?a:e,extendElement:Element.extend}})();Prototype._original_property=window.Sizzle;
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var q=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,f=0,j=Object.prototype.toString,o=false,g=true;[0,0].sort(function(){g=false;return 0});var l=function(E,t,C,w){C=C||[];var y=t=t||document;if(t.nodeType!==1&&t.nodeType!==9){return[]}if(!E||typeof E!=="string"){return C}var B=[],D,A,I,H,z,e,s=true,v=p(t),G=E;while((q.exec(""),D=q.exec(G))!==null){G=D[3];B.push(D[1]);if(D[2]){e=D[3];break}}if(B.length>1&&c.exec(E)){if(B.length===2&&b.relative[B[0]]){A=d(B[0]+B[1],t)}else{A=b.relative[B[0]]?[t]:l(B.shift(),t);while(B.length){E=B.shift();if(b.relative[E]){E+=B.shift()}A=d(E,A)}}}else{if(!w&&B.length>1&&t.nodeType===9&&!v&&b.match.ID.test(B[0])&&!b.match.ID.test(B[B.length-1])){var J=l.find(B.shift(),t,v);t=J.expr?l.filter(J.expr,J.set)[0]:J.set[0]}if(t){var J=w?{expr:B.pop(),set:a(w)}:l.find(B.pop(),B.length===1&&(B[0]==="~"||B[0]==="+")&&t.parentNode?t.parentNode:t,v);A=J.expr?l.filter(J.expr,J.set):J.set;if(B.length>0){I=a(A)}else{s=false}while(B.length){var u=B.pop(),x=u;if(!b.relative[u]){u=""}else{x=B.pop()}if(x==null){x=t}b.relative[u](I,x,v)}}else{I=B=[]}}if(!I){I=A}if(!I){throw"Syntax error, unrecognized expression: "+(u||E)}if(j.call(I)==="[object Array]"){if(!s){C.push.apply(C,I)}else{if(t&&t.nodeType===1){for(var F=0;I[F]!=null;F++){if(I[F]&&(I[F]===true||I[F].nodeType===1&&h(t,I[F]))){C.push(A[F])}}}else{for(var F=0;I[F]!=null;F++){if(I[F]&&I[F].nodeType===1){C.push(A[F])}}}}}else{a(I,C)}if(e){l(e,y,C,w);l.uniqueSort(C)}return C};l.uniqueSort=function(s){if(i){o=g;s.sort(i);if(o){for(var e=1;e<s.length;e++){if(s[e]===s[e-1]){s.splice(e--,1)}}}}return s};l.matches=function(e,s){return l(e,null,null,s)};l.find=function(x,e,z){var y,v;if(!x){return[]}for(var u=0,t=b.order.length;u<t;u++){var w=b.order[u],v;if((v=b.leftMatch[w].exec(x))){var s=v[1];v.splice(1,1);if(s.substr(s.length-1)!=="\\"){v[1]=(v[1]||"").replace(/\\/g,"");y=b.find[w](v,e,z);if(y!=null){x=x.replace(b.match[w],"");break}}}}if(!y){y=e.getElementsByTagName("*")}return{set:y,expr:x}};l.filter=function(B,C,F,s){var e=B,A=[],w=C,u,y,v=C&&C[0]&&p(C[0]);while(B&&C.length){for(var z in b.filter){if((u=b.match[z].exec(B))!=null){var x=b.filter[z],G,E;y=false;if(w==A){A=[]}if(b.preFilter[z]){u=b.preFilter[z](u,w,F,A,s,v);if(!u){y=G=true}else{if(u===true){continue}}}if(u){for(var t=0;(E=w[t])!=null;t++){if(E){G=x(E,u,t,w);var D=s^!!G;if(F&&G!=null){if(D){y=true}else{w[t]=false}}else{if(D){A.push(E);y=true}}}}}if(G!==undefined){if(!F){w=A}B=B.replace(b.match[z],"");if(!y){return[]}break}}}if(B==e){if(y==null){throw"Syntax error, unrecognized expression: "+B}else{break}}e=B}return w};var b=l.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(e){return e.getAttribute("href")}},relative:{"+":function(y,e,z){var s=typeof e==="string",x=s&&!/\W/.test(e),w=s&&!x;if(x&&!z){e=e.toUpperCase()}for(var v=0,u=y.length,t;v<u;v++){if((t=y[v])){while((t=t.previousSibling)&&t.nodeType!==1){}y[v]=w||t&&t.nodeName===e?t||false:t===e}}if(w){l.filter(e,y,true)}},">":function(x,u,y){var t=typeof u==="string";if(t&&!/\W/.test(u)){u=y?u:u.toUpperCase();for(var v=0,e=x.length;v<e;v++){var w=x[v];if(w){var s=w.parentNode;x[v]=s.nodeName===u?s:false}}}else{for(var v=0,e=x.length;v<e;v++){var w=x[v];if(w){x[v]=t?w.parentNode:w.parentNode===u}}if(t){l.filter(u,x,true)}}},"":function(u,s,w){var t=f++,e=r;if(!/\W/.test(s)){var v=s=w?s:s.toUpperCase();e=n}e("parentNode",s,t,u,v,w)},"~":function(u,s,w){var t=f++,e=r;if(typeof s==="string"&&!/\W/.test(s)){var v=s=w?s:s.toUpperCase();e=n}e("previousSibling",s,t,u,v,w)}},find:{ID:function(s,t,u){if(typeof t.getElementById!=="undefined"&&!u){var e=t.getElementById(s[1]);return e?[e]:[]}},NAME:function(t,w,x){if(typeof w.getElementsByName!=="undefined"){var s=[],v=w.getElementsByName(t[1]);for(var u=0,e=v.length;u<e;u++){if(v[u].getAttribute("name")===t[1]){s.push(v[u])}}return s.length===0?null:s}},TAG:function(e,s){return s.getElementsByTagName(e[1])}},preFilter:{CLASS:function(t,e,s,x,w,y){t=" "+t[1].replace(/\\/g,"")+" ";if(y){return t}for(var u=0,v;(v=e[u])!=null;u++){if(v){if(w^(v.className&&(" "+v.className+" ").indexOf(t)>=0)){if(!s){x.push(v)}}else{if(s){e[u]=false}}}}return false},ID:function(e){return e[1].replace(/\\/g,"")},TAG:function(s,e){for(var t=0;e[t]===false;t++){}return e[t]&&p(e[t])?s[1]:s[1].toUpperCase()},CHILD:function(e){if(e[1]=="nth"){var s=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(e[2]=="even"&&"2n"||e[2]=="odd"&&"2n+1"||!/\D/.test(e[2])&&"0n+"+e[2]||e[2]);e[2]=(s[1]+(s[2]||1))-0;e[3]=s[3]-0}e[0]=f++;return e},ATTR:function(u,e,s,w,v,x){var t=u[1].replace(/\\/g,"");if(!x&&b.attrMap[t]){u[1]=b.attrMap[t]}if(u[2]==="~="){u[4]=" "+u[4]+" "}return u},PSEUDO:function(u,e,s,w,v){if(u[1]==="not"){if((q.exec(u[3])||"").length>1||/^\w/.test(u[3])){u[3]=l(u[3],null,null,e)}else{var t=l.filter(u[3],e,s,true^v);if(!s){w.push.apply(w,t)}return false}}else{if(b.match.POS.test(u[0])||b.match.CHILD.test(u[0])){return true}}return u},POS:function(e){e.unshift(true);return e}},filters:{enabled:function(e){return e.disabled===false&&e.type!=="hidden"},disabled:function(e){return e.disabled===true},checked:function(e){return e.checked===true},selected:function(e){e.parentNode.selectedIndex;return e.selected===true},parent:function(e){return !!e.firstChild},empty:function(e){return !e.firstChild},has:function(t,s,e){return !!l(e[3],t).length},header:function(e){return/h\d/i.test(e.nodeName)},text:function(e){return"text"===e.type},radio:function(e){return"radio"===e.type},checkbox:function(e){return"checkbox"===e.type},file:function(e){return"file"===e.type},password:function(e){return"password"===e.type},submit:function(e){return"submit"===e.type},image:function(e){return"image"===e.type},reset:function(e){return"reset"===e.type},button:function(e){return"button"===e.type||e.nodeName.toUpperCase()==="BUTTON"},input:function(e){return/input|select|textarea|button/i.test(e.nodeName)}},setFilters:{first:function(s,e){return e===0},last:function(t,s,e,u){return s===u.length-1},even:function(s,e){return e%2===0},odd:function(s,e){return e%2===1},lt:function(t,s,e){return s<e[3]-0},gt:function(t,s,e){return s>e[3]-0},nth:function(t,s,e){return e[3]-0==s},eq:function(t,s,e){return e[3]-0==s}},filter:{PSEUDO:function(x,u,v,y){var t=u[1],s=b.filters[t];if(s){return s(x,v,u,y)}else{if(t==="contains"){return(x.textContent||x.innerText||"").indexOf(u[3])>=0}else{if(t==="not"){var w=u[3];for(var v=0,e=w.length;v<e;v++){if(w[v]===x){return false}}return true}}}},CHILD:function(s,t){var x=t[1],e=s;switch(x){case"only":case"first":while((e=e.previousSibling)){if(e.nodeType===1){return false}}if(x=="first"){return true}e=s;case"last":while((e=e.nextSibling)){if(e.nodeType===1){return false}}return true;case"nth":var u=t[2],z=t[3];if(u==1&&z==0){return true}var w=t[0],A=s.parentNode;if(A&&(A.sizcache!==w||!s.nodeIndex)){var v=0;for(e=A.firstChild;e;e=e.nextSibling){if(e.nodeType===1){e.nodeIndex=++v}}A.sizcache=w}var y=s.nodeIndex-z;if(u==0){return y==0}else{return(y%u==0&&y/u>=0)}}},ID:function(s,e){return s.nodeType===1&&s.getAttribute("id")===e},TAG:function(s,e){return(e==="*"&&s.nodeType===1)||s.nodeName===e},CLASS:function(s,e){return(" "+(s.className||s.getAttribute("class"))+" ").indexOf(e)>-1},ATTR:function(v,t){var s=t[1],x=b.attrHandle[s]?b.attrHandle[s](v):v[s]!=null?v[s]:v.getAttribute(s),w=x+"",u=t[2],e=t[4];return x==null?u==="!=":u==="="?w===e:u==="*="?w.indexOf(e)>=0:u==="~="?(" "+w+" ").indexOf(e)>=0:!e?w&&x!==false:u==="!="?w!=e:u==="^="?w.indexOf(e)===0:u==="$="?w.substr(w.length-e.length)===e:u==="|="?w===e||w.substr(0,e.length+1)===e+"-":false},POS:function(v,t,u,w){var s=t[2],e=b.setFilters[s];if(e){return e(v,u,t,w)}}}};var c=b.match.POS;for(var m in b.match){b.match[m]=new RegExp(b.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source);b.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+b.match[m].source)}var a=function(s,e){s=Array.prototype.slice.call(s,0);if(e){e.push.apply(e,s);return e}return s};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(k){a=function(v,u){var s=u||[];if(j.call(v)==="[object Array]"){Array.prototype.push.apply(s,v)}else{if(typeof v.length==="number"){for(var t=0,e=v.length;t<e;t++){s.push(v[t])}}else{for(var t=0;v[t];t++){s.push(v[t])}}}return s}}var i;if(document.documentElement.compareDocumentPosition){i=function(s,e){if(!s.compareDocumentPosition||!e.compareDocumentPosition){if(s==e){o=true}return 0}var t=s.compareDocumentPosition(e)&4?-1:s===e?0:1;if(t===0){o=true}return t}}else{if("sourceIndex" in document.documentElement){i=function(s,e){if(!s.sourceIndex||!e.sourceIndex){if(s==e){o=true}return 0}var t=s.sourceIndex-e.sourceIndex;if(t===0){o=true}return t}}else{if(document.createRange){i=function(s,e){if(!s.ownerDocument||!e.ownerDocument){if(s==e){o=true}return 0}var u=s.ownerDocument.createRange(),v=e.ownerDocument.createRange();u.setStart(s,0);u.setEnd(s,0);v.setStart(e,0);v.setEnd(e,0);var t=u.compareBoundaryPoints(Range.START_TO_END,v);if(t===0){o=true}return t}}}}(function(){var s=document.createElement("div"),t="script"+(new Date).getTime();s.innerHTML="<a name='"+t+"'/>";var e=document.documentElement;e.insertBefore(s,e.firstChild);if(!!document.getElementById(t)){b.find.ID=function(v,w,x){if(typeof w.getElementById!=="undefined"&&!x){var u=w.getElementById(v[1]);return u?u.id===v[1]||typeof u.getAttributeNode!=="undefined"&&u.getAttributeNode("id").nodeValue===v[1]?[u]:undefined:[]}};b.filter.ID=function(w,u){var v=typeof w.getAttributeNode!=="undefined"&&w.getAttributeNode("id");return w.nodeType===1&&v&&v.nodeValue===u}}e.removeChild(s);e=s=null})();(function(){var e=document.createElement("div");e.appendChild(document.createComment(""));if(e.getElementsByTagName("*").length>0){b.find.TAG=function(s,w){var v=w.getElementsByTagName(s[1]);if(s[1]==="*"){var u=[];for(var t=0;v[t];t++){if(v[t].nodeType===1){u.push(v[t])}}v=u}return v}}e.innerHTML="<a href='#'></a>";if(e.firstChild&&typeof e.firstChild.getAttribute!=="undefined"&&e.firstChild.getAttribute("href")!=="#"){b.attrHandle.href=function(s){return s.getAttribute("href",2)}}e=null})();if(document.querySelectorAll){(function(){var e=l,t=document.createElement("div");t.innerHTML="<p class='TEST'></p>";if(t.querySelectorAll&&t.querySelectorAll(".TEST").length===0){return}l=function(x,w,u,v){w=w||document;if(!v&&w.nodeType===9&&!p(w)){try{return a(w.querySelectorAll(x),u)}catch(y){}}return e(x,w,u,v)};for(var s in e){l[s]=e[s]}t=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var e=document.createElement("div");e.innerHTML="<div class='test e'></div><div class='test'></div>";if(e.getElementsByClassName("e").length===0){return}e.lastChild.className="e";if(e.getElementsByClassName("e").length===1){return}b.order.splice(1,0,"CLASS");b.find.CLASS=function(s,t,u){if(typeof t.getElementsByClassName!=="undefined"&&!u){return t.getElementsByClassName(s[1])}};e=null})()}function n(s,z,w,A,y,B){var x=s=="previousSibling"&&!B;for(var u=0,t=A.length;u<t;u++){var e=A[u];if(e){if(x&&e.nodeType===1){e.sizcache=w;e.sizset=u}e=e[s];var v=false;while(e){if(e.sizcache===w){v=A[e.sizset];break}if(e.nodeType===1&&!B){e.sizcache=w;e.sizset=u}if(e.nodeName===z){v=e;break}e=e[s]}A[u]=v}}}function r(s,z,w,A,y,B){var x=s=="previousSibling"&&!B;for(var u=0,t=A.length;u<t;u++){var e=A[u];if(e){if(x&&e.nodeType===1){e.sizcache=w;e.sizset=u}e=e[s];var v=false;while(e){if(e.sizcache===w){v=A[e.sizset];break}if(e.nodeType===1){if(!B){e.sizcache=w;e.sizset=u}if(typeof z!=="string"){if(e===z){v=true;break}}else{if(l.filter(z,[e]).length>0){v=e;break}}}e=e[s]}A[u]=v}}}var h=document.compareDocumentPosition?function(s,e){return s.compareDocumentPosition(e)&16}:function(s,e){return s!==e&&(s.contains?s.contains(e):true)};var p=function(e){return e.nodeType===9&&e.documentElement.nodeName!=="HTML"||!!e.ownerDocument&&e.ownerDocument.documentElement.nodeName!=="HTML"};var d=function(e,x){var y=[],u="",v,t=x.nodeType?[x]:x;while((v=b.match.PSEUDO.exec(e))){u+=v[0];e=e.replace(b.match.PSEUDO,"")}e=b.relative[e]?e+"*":e;for(var w=0,s=t.length;w<s;w++){l(e,t[w],y)}return l.filter(u,y)};window.Sizzle=l})();(function(a){var d=Prototype.Selector.extendElements;function c(e,f){return d(a(e,f||document))}function b(f,e){return a.matches(e,[f]).length==1}Prototype.Selector.engine=a;Prototype.Selector.select=c;Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(c,g){if(typeof g!="object"){g={hash:!!g}}else{if(Object.isUndefined(g.hash)){g.hash=true}}var f,h,b=false,a=g.submit,d,e;if(g.hash){e={};d=function(k,i,j){if(i in k){if(!Object.isArray(k[i])){k[i]=[k[i]]}k[i].push(j)}else{k[i]=j}return k}}else{e="";d=function(k,i,j){return k+(k?"&":"")+encodeURIComponent(i)+"="+encodeURIComponent(j)}}return c.inject(e,function(j,i){if(!i.disabled&&i.name){f=i.name;h=$(i).getValue();if(h!=null&&i.type!="file"&&(i.type!="submit"||(!b&&a!==false&&(!a||f==a)&&(b=true)))){j=d(j,f,h)}}return j})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var b=$(f).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;for(var e=0;d=b[e];e++){a.push(d)}return a.inject([],function(g,h){if(c[h.tagName.toLowerCase()]){g.push(Element.extend(h))}return g})},getInputs:function(g,e,c){g=$(g);var f=g.getElementsByTagName("input");if(!e&&!c){return $A(f).map(Element.extend)}for(var d=0,h=[],a=f.length;d<a;d++){var b=f[d];if((e&&b.type!=e)||(c&&b.name!=c)){continue}h.push(Element.extend(b))}return h},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(c){var a=$(c).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled});var b=a.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return b?b:a.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)})},focusFirstElement:function(b){b=$(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(c,b){c=$(c),b=Object.clone(b||{});var d=b.parameters,a=c.readAttribute("action")||"";if(a.blank()){a=window.location.href}b.parameters=c.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(b.parameters,d)}if(c.hasAttribute("method")&&!b.method){b.method=c.method}return new Ajax.Request(a,b)}};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 c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function c(h,i){switch(h.type.toLowerCase()){case"checkbox":case"radio":return g(h,i);default:return f(h,i)}}function g(h,i){if(Object.isUndefined(i)){return h.checked?h.value:null}else{h.checked=!!i}}function f(h,i){if(Object.isUndefined(i)){return h.value}else{h.value=i}}function d(j,n){if(Object.isUndefined(n)){return(j.type==="select-one"?b:a)(j)}var l,m,o=!Object.isArray(n);for(var k=0,h=j.length;k<h;k++){l=j.options[k];m=this.optionValue(l);if(o){if(m==n){l.selected=true;return}}else{l.selected=n.include(m)}}}function b(i){var h=i.selectedIndex;return h>=0?e(i.options[h]):null}function a(j){var m,h=j.length;if(!h){return null}for(var l=0,m=[];l<h;l++){var k=j.options[l];if(k.selected){m.push(e(k))}}return m}function e(h){return Element.hasAttribute(h,"value")?h.value:h.text}return{input:c,inputSelector:g,textarea:f,select:d,selectOne:b,selectMany:a,optionValue:e,button:f}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,c,b){$super(b,c);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 D={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 h=document.documentElement;var o="onmouseenter" in h&&"onmouseleave" in h;var a=function(E){return false};if(window.attachEvent){if(window.addEventListener){a=function(E){return !(E instanceof window.Event)}}else{a=function(E){return true}}}var x;function C(F,E){return F.which?(F.which===E+1):(F.button===E)}var q={0:1,1:4,2:2};function s(F,E){return F.button===q[E]}function p(F,E){switch(E){case 0:return F.which==1&&!F.metaKey;case 1:return F.which==2||(F.which==1&&F.metaKey);case 2:return F.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){x=s}else{x=function(F,E){return a(F)?s(F,E):C(F,E)}}}else{if(Prototype.Browser.WebKit){x=p}else{x=C}}function u(E){return x(E,0)}function w(E){return x(E,1)}function n(E){return x(E,2)}function l(G){G=D.extend(G);var F=G.target,E=G.type,H=G.currentTarget;if(H&&H.tagName){if(E==="load"||E==="error"||(E==="click"&&H.tagName.toLowerCase()==="input"&&H.type==="radio")){F=H}}if(F.nodeType==Node.TEXT_NODE){F=F.parentNode}return Element.extend(F)}function A(F,G){var E=D.element(F);if(!G){return E}while(E){if(Object.isElement(E)&&Prototype.Selector.match(E,G)){return Element.extend(E)}E=E.parentNode}}function y(E){return{x:e(E),y:d(E)}}function e(G){var F=document.documentElement,E=document.body||{scrollLeft:0};return G.pageX||(G.clientX+(F.scrollLeft||E.scrollLeft)-(F.clientLeft||0))}function d(G){var F=document.documentElement,E=document.body||{scrollTop:0};return G.pageY||(G.clientY+(F.scrollTop||E.scrollTop)-(F.clientTop||0))}function t(E){D.extend(E);E.preventDefault();E.stopPropagation();E.stopped=true}D.Methods={isLeftClick:u,isMiddleClick:w,isRightClick:n,element:l,findElement:A,pointer:y,pointerX:e,pointerY:d,stop:t};var z=Object.keys(D.Methods).inject({},function(E,F){E[F]=D.Methods[F].methodize();return E});if(window.attachEvent){function g(F){var E;switch(F.type){case"mouseover":case"mouseenter":E=F.fromElement;break;case"mouseout":case"mouseleave":E=F.toElement;break;default:return null}return Element.extend(E)}var v={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};D.extend=function(F,E){if(!F){return false}if(!a(F)){return F}if(F._extendedByPrototype){return F}F._extendedByPrototype=Prototype.emptyFunction;var G=D.pointer(F);Object.extend(F,{target:F.srcElement||E,relatedTarget:g(F),pageX:G.x,pageY:G.y});Object.extend(F,z);Object.extend(F,v);return F}}else{D.extend=Prototype.K}if(window.addEventListener){D.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(D.prototype,z)}function c(F,E,I){var H=Element.retrieve(F,"prototype_event_registry");if(Object.isUndefined(H)){f.push(F);H=Element.retrieve(F,"prototype_event_registry",$H())}var J=H.get(E);if(Object.isUndefined(J)){J=[];H.set(E,J)}if(J.pluck("handler").include(I)){return false}var G;if(E.include(":")){G=function(K){if(Object.isUndefined(K.eventName)){return false}if(K.eventName!==E){return false}D.extend(K,F);I.call(F,K)}}else{if(!o&&(E==="mouseenter"||E==="mouseleave")){if(E==="mouseenter"||E==="mouseleave"){G=function(L){D.extend(L,F);var K=L.relatedTarget;while(K&&K!==F){try{K=K.parentNode}catch(M){K=F}}if(K===F){return}I.call(F,L)}}}else{G=function(K){D.extend(K,F);I.call(F,K)}}}G.handler=I;J.push(G);return G}function i(){for(var F=0,E=f.length;F<E;F++){D.stopObserving(f[F]);f[F]=null}}var f=[];if(Prototype.Browser.IE){window.attachEvent("onunload",i)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var b=Prototype.K,j={mouseenter:"mouseover",mouseleave:"mouseout"};if(!o){b=function(E){return(j[E]||E)}}function r(F,E,I){F=$(F);var H=c(F,E,I);if(!H){return F}if(E.include(":")){if(F.addEventListener){F.addEventListener("dataavailable",H,false)}else{F.attachEvent("ondataavailable",H);F.attachEvent("onlosecapture",H)}}else{var G=b(E);if(F.addEventListener){F.addEventListener(G,H,false)}else{F.attachEvent("on"+G,H)}}return F}function m(F,E,L){F=$(F);var K=Element.retrieve(F,"prototype_event_registry");if(!K){return F}if(!E){K.each(function(N){var M=N.key;m(F,M)});return F}var H=K.get(E);if(!H){return F}if(!L){H.each(function(M){m(F,E,M.handler)});return F}var G=H.length,J;while(G--){if(H[G].handler===L){J=H[G];break}}if(!J){return F}if(E.include(":")){if(F.removeEventListener){F.removeEventListener("dataavailable",J,false)}else{F.detachEvent("ondataavailable",J);F.detachEvent("onlosecapture",J)}}else{var I=b(E);if(F.removeEventListener){F.removeEventListener(I,J,false)}else{F.detachEvent("on"+I,J)}}K.set(E,H.without(J));return F}function B(G,F,E,I){G=$(G);if(Object.isUndefined(I)){I=true}if(G==document&&document.createEvent&&!G.dispatchEvent){G=document.documentElement}var H;if(document.createEvent){H=document.createEvent("HTMLEvents");H.initEvent("dataavailable",I,true)}else{H=document.createEventObject();H.eventType=I?"ondataavailable":"onlosecapture"}H.eventName=F;H.memo=E||{};if(document.createEvent){G.dispatchEvent(H)}else{G.fireEvent(H.eventType,H)}return D.extend(H)}D.Handler=Class.create({initialize:function(G,F,E,H){this.element=$(G);this.eventName=F;this.selector=E;this.callback=H;this.handler=this.handleEvent.bind(this)},start:function(){D.observe(this.element,this.eventName,this.handler);return this},stop:function(){D.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(F){var E=D.findElement(F,this.selector);if(E){this.callback.call(this.element,F,E)}}});function k(G,F,E,H){G=$(G);if(Object.isFunction(E)&&Object.isUndefined(H)){H=E,E=null}return new D.Handler(G,F,E,H).start()}Object.extend(D,D.Methods);Object.extend(D,{fire:B,observe:r,stopObserving:m,on:k});Element.addMethods({fire:B,observe:r,stopObserving:m,on:k});Object.extend(document,{fire:B.methodize(),observe:r.methodize(),stopObserving:m.methodize(),on:k.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,D)}else{window.Event=D}})();(function(){var d;function a(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){d=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",c);if(window==top){d=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,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[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(a,c,b){b=b||{};return Element.clonePosition(c,a,b)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(d,c){c=c.toString().strip();var e=/\s/.test(c)?$w(c).map(a).join(""):a(c);return e?document._getElementsByXPath(".//*"+e,d):[]}:function(f,e){e=e.toString().strip();var c=[],h=(/\s/.test(e)?$w(e):null);if(!h&&!e){return c}var d=$(f).getElementsByTagName("*");e=" "+e+" ";for(var g=0,k,j;k=d[g];g++){if(k.className&&(j=" "+k.className+" ")&&(j.include(e)||(h&&h.all(function(i){return !i.toString().blank()&&j.include(" "+i+" ")})))){c.push(Element.extend(k))}}return c};return function(c,d){return $(d||document.body).getElementsByClassName(c)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(a,g){var d=Prototype.Selector.match,f=[];for(var e=0,b=a.length;e<b;e++){var c=a[e];if(d(c,g)){f.push(Element.extend(c))}}return f},findElement:function(b,g,e){e=e||0;var a=0,d;for(var f=0,c=b.length;f<c;f++){d=b[f];if(Prototype.Selector.match(d,g)&&e===a++){return Element.extend(d)}}},findChildElements:function(b,c){var a=c.toArray().join(", ");return Prototype.Selector.select(a,b||document)}})})();function KrebsLocalBase(){var b=0;var e=null;var d=null;this.onLoad=function(){this.moveImpressum();this.rubrik=new KrebsLocalBaseRubrik();$$("input.search_input").each(function(f){var g=f.value;Event.observe(f.form,"submit",function(h){if(f.value==g){Event.stop(h);f.value="";f.focus()}});Event.observe(f,"focus",function(){f.removeClassName("blurred");if(f.value==g){f.value=""}});Event.observe(f,"blur",function(){f.addClassName("blurred");if(!f.value){f.value=g}})})};this.moveImpressum=function(j){if(b&&!j){return}var h=document.getElementById("impressum");if(!h){return}h.style.visibility="hidden";var f=document.getElementById("col1");var g=document.getElementById("col2");var i=a(f);var k=a(g);i+=5;if(i>k){h.style.bottom=(k-i)+"px"}h.style.visibility="visible";b=1};var a=function(j){var l=j.style.display;if(l!="none"&&l!=null){return j.offsetHeight}var i=j.style;var f=i.visibility;var g=i.position;var h=i.display;i.visibility="hidden";i.position="absolute";i.display="block";var k=j.clientHeight;i.visibility=f;i.position=g;i.display=h;return k};this.getMediaData=function(g,f){if(typeof(window["KrebsLocal"+g+"Data_"+f])=="object"){return window["KrebsLocal"+g+"Data_"+f]}else{if(typeof(window["KrebsLocal"+g+"Data"])=="object"){return window["KrebsLocal"+g+"Data"][f]}}return};this.getHiddenData=function(f){if(e==null){c()}return e[f]};this.evalHiddenData=function(f){if(e==null){c()}if(typeof(e[f])=="undefined"){return}if(typeof(d[f])=="undefined"){d[f]=e[f].evalJSON()}return d[f]};var c=function(){e=new Object;d=new Object;$$("input.krebs_data").each(function(f){e[f.name]=f.value})};this.setCookie=function(f,h,j){var i="";if(j){var g=new Date();g.setTime(g.getTime()+(Math.floor(j*24*60*60*1000)));i="; expires="+g.toGMTString()}document.cookie=f+"="+h+i+"; path=/"};this.getCookie=function(f){f+="=";var j=document.cookie.split(";");for(var h=0;h<j.length;h++){var g=j[h];while(g.charAt(0)==" "){g=g.substring(1,g.length)}if(g.indexOf(f)==0){return g.substring(f.length,g.length)}}return null};this.removeCookie=function(f){this.setCookie(f,"",-1)};this.fireEvent=function(f,g){if(document.createEventObject){var h=document.createEventObject();return f.fireEvent("on"+g,h)}else{var h=document.createEvent("HTMLEvents");h.initEvent(g,true,true);return !f.dispatchEvent(h)}};this.makeTouchScrollable=function(g){var f=0;var h=0;Event.observe(g,"touchstart",function(i){i.preventDefault();f=0;h=0});Event.observe(g,"touchmove",function(j){j.preventDefault();var i=f;var l=j.touches[0];f=l.pageY;if(!i){return}var k=f-i;g.scrollTop-=k;h+=Math.abs(k)});Event.observe(g,"touchend",function(i){i.preventDefault();if(h<5){KrebsLocalBase.fireEvent(i.target,"click")}})}}function KrebsLocalBaseRubrik(){var d=null;var b=null;$("ntl_filter").setOpacity(0.5);$("ntl_top_content").select("div.rubrik").each(function(h){h.observe("mouseover",function(){f(h)});if(h.hasClassName("rubrik_sel")){d=h;b=h}});var f=function(h){if(!h.hasClassName("rubrik")){h=h.parentNode}if(h===b){return}e(b);a(h);if(h!==d){document.onmousemove=g}b=h};var c=function(){document.onmousemove="";e(b);a(d);b=d};var a=function(i){i.addClassName("rubrik_sel");i.addClassName("bl_red");var h=$(i.id+"_links");if(h){h.show();if(i!==d){$("ntl_filter").show()}}};var e=function(i){i.removeClassName("rubrik_sel");i.removeClassName("bl_red");var h=$(i.id+"_links");if(h){h.hide()}$("ntl_filter").hide()};var g=function(i){if(!i){i=window.event}var n=Event.pointerX(i);var k=Event.pointerY(i);var q=Position.page($("ntl_top_content"));var p=Position.page($("ntl_bot_content"));var l=$("ntl_top_content").getDimensions();var j=q[0]-10;var o=q[1]-10;var h=p[0]+l.width+10;var m=p[1]+l.height+10;if((n<j)||(n>h)||(k<o)||(k>m)){c()}}}function KrebsLocalBaseAnimation(){this.animate=function(){var duration=arguments[0];if(!duration){return}var obj=[];var after=[];var code="";for(var i=1;i<arguments.length;i++){var arg=arguments[i];var pos=i-1;if(arg.call){code+="obj["+pos+"]"+createCode(arg,pos)+"\n";obj.push(arg.call)}else{if(arg.node){code+="obj["+pos+"]"+createCode(arg,pos)+"\n";obj.push(arg.node)}}if(arg.after){after.push(arg.after)}}if(obj.length<1){return}eval("var call = function(obj,v){"+code+"}");var start=(new Date()).getTime();var pe=new PeriodicalExecuter(function(pe){var elapsed=(new Date()).getTime()-start;if(elapsed>duration){pe.stop();call(obj,1);for(var i=0;i<after.length;i++){after[i]()}}else{call(obj,(elapsed/duration))}},0.001);return pe};var createCode=function(_arg,_pos){var dist=_arg.to-_arg.from;var code=_arg.from+" + ("+dist+" * v)";if(_arg.round){code="Math.floor("+code+")"}code="("+code+")";if(_arg.call){return code+";"}if(_arg.prefix){code="'"+_arg.prefix+"' + "+code}if(_arg.postfix){code+=" + '"+_arg.postfix+"'"}return'.style["'+_arg.style+'"] = '+code+";"}}function KrebsLocalBaseOverlay(){var e;var b;var d;this.createOverlay=function(i){if(!e){f()}h(i);b.observe("click",function(){g(i)});c(i)};var f=function(){e=new Element("div",{id:"overlay","class":"overlay"});var i=document.viewport.getScrollOffsets();e.style.height=($("page").getHeight()+30)+"px";e.style.minWidth=$("page").getWidth()+"px";b=new Element("div",{id:"overlay-background","class":"overlay-background"});b.setOpacity(0.75);d=new Element("div",{id:"overlay-container","class":"overlay-container"});e.insert(b);e.insert(d);$("the_body").insert(e)};var h=function(i){d.update();d.style.width=0;d.style.height=0;var j={};if(i.origin){var l=i.origin.viewportOffset();var k=i.origin.getDimensions();j.left=Math.floor(l.left+(k.width/2));j.top=Math.floor(l.top+(k.height/2))}else{var k=document.viewport.getDimensions();j.left=Math.floor(k.width/2);j.top=Math.floor(k.height/2)}d.style.left=j.left+"px";d.style.top=j.top+"px";i.source=j;i.target=a(i)};var a=function(i){var k=document.viewport.getScrollOffsets();var j=document.viewport.getDimensions();var l={};l.left=k.left+Math.floor((j.width-i.width)/2);l.top=k.top+Math.floor((j.height-i.height)/2);return l};var c=function(i){e.setOpacity(1);e.show();KrebsLocalBaseAnimation.animate(400,{from:0,to:i.width,node:d,style:"width",postfix:"px",round:1},{from:0,to:i.height,node:d,style:"height",postfix:"px",round:1},{from:i.source.left,to:i.target.left,node:d,style:"left",postfix:"px",round:1},{from:i.source.top,to:i.target.top,node:d,style:"top",postfix:"px",round:1})};var g=function(i){b.stopObserving("click");KrebsLocalBaseAnimation.animate(200,{from:e.getOpacity(),to:0,node:e,style:"opacity"},{after:function(){e.hide()}})}}var KrebsLocalBaseAnimation=new KrebsLocalBaseAnimation();var KrebsLocalBaseOverlay=new KrebsLocalBaseOverlay();var KrebsLocalBase=new KrebsLocalBase();Event.observe(document,"dom:loaded",function(){KrebsLocalBase.onLoad()});function KrebsLocalAddonsBooking(){var c=new Object;var a=new Object;var b="KrebsLocalAddonsBooking.";this.init=function(g,f,h){if(!f){f=b+g+".arrival"}if(!h){h=b+g+".departure"}a[g]=[f,h];var e=new calendar3(document.forms[b+g].elements[b+g+"._arrival"],function(){KrebsLocalAddonsBooking.refreshArrival(g)});var d=new calendar3(document.forms[b+g].elements[b+g+"._departure"],function(){KrebsLocalAddonsBooking.refreshDeparture(g)});c[g]=[e,d]};this.popupArrival=function(d){if(!c[d]){return}c[d][0].popup()};this.popupDeparture=function(d){if(!c[d]){return}c[d][1].popup()};this.refreshArrival=function(g){if(!a[g]){return}var d=$(b+g+"._arrival").value;var f=d.split("-");var e=f[2]+"."+f[1]+"."+f[0];$(a[g][0]).value=e};this.refreshDeparture=function(g){if(!a[g]){return}var d=$(b+g+"._departure").value;var f=d.split("-");var e=f[2]+"."+f[1]+"."+f[0];$(a[g][1]).value=e}}var KrebsLocalAddonsBooking=new KrebsLocalAddonsBooking();Event.observe(document,"dom:loaded",function(){$$("form.KrebsLocalAddonsBooking").each(function(b){var a=b.name.replace(/KrebsLocalAddonsBooking\./,"");KrebsLocalAddonsBooking.init(a)})});function KrebsLocalVideo(){var z=undefined;var d=[];var v=[];var y=[];var q=[];var f=[];var a=[];var c=0.75;this.onLoad=function(){$$("div.video-player").each(function(A){m(A)});if(s()){$$("div.video-teaser").each(function(A){j(A)})}};var s=function(){return !(/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()))};var o=function(){if(typeof(z)!="undefined"){return z}var A=document.createElement("video");if(!A.canPlayType){z=""}else{z=A.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')}return z};var b=function(A){return"http://"+window.location.hostname+":8080/video/"+A};var t=function(A){return"/.krebs/video/"+A};var m=function(A){var C=A.identify();var B=KrebsLocalBase.getMediaData("Video",C);if(!B){return}B.id=C+"_player";if(o()){return KrebsLocalVideo.insertH264(A,B)}if(KrebsLocalVideo.insertFlashPlayer(C,B)){return}k(A,B)};var j=function(J){var B=J.identify();var F=KrebsLocalBase.getMediaData("Video",B);if(!F){return}var I=B+"_cont";var G=B+"_player";var E=B+"_button";var D=J.select("div.video-teaser-image")[0];var A=new Element("div",{id:I,"class":"video-teaser-video"});J.insert({top:A});var C=new Element("div",{id:E,"class":"video-teaser-button"});C.hide();C.setOpacity(0);J.insert(C);var H=F.cookie||B;d[G]={id:B,cookie:H,teaser:J,image:D,video:A,button:C};if(KrebsLocalBase.getCookie("teaser,"+H)){d[G].hazCookie=1}else{d[G].autoplay=1}F.id=G;if(o()=="probably"){KrebsLocalVideo.insertH264(A,F)}else{KrebsLocalVideo.insertFlashPlayer(I,{id:G,type:"teaser",video:F.video})}};var r=function(B,A){B.player=A;Event.observe(A,"playing",function(){w(B)});Event.observe(A,"ended",function(){n(B)});l(B)};this.teaserReadyFlash=function(C){var B=d[C.id];if(!B){return}var A=window.document[C.id];if(!A){return}B.player=A;A.addModelListener("STATE","KrebsLocalVideo.teaserStateChange");l(B)};var l=function(A){x(A);if(A.autoplay){i(A,1)}};var x=function(A){Event.observe(A.teaser,"mouseover",function(){if(a[A.id]){return}if(v[A.id]){u(A,"stop",1)}else{if(y[A.id]){u(A,"wait",1)}else{u(A,"play",1)}}});Event.observe(A.button,"mouseout",function(){if(!y[A.id]){p(A,1)}});Event.observe(A.button,"click",function(){if(v[A.id]||y[A.id]){e(A)}else{u(A,"wait");i(A)}})};var i=function(B,A){if(v[B.id]){return}y[B.id]=1;if(z){B.player.currentTime=0;B.player.play()}else{B.player.sendEvent("SEEK",0);B.player.sendEvent("PLAY","true")}};var e=function(A){if(z){A.player.pause()}else{A.player.sendEvent("PLAY","false")}g(A);h(A)};var g=function(A){if(A.hazCookie){return}KrebsLocalBase.setCookie("teaser,"+A.cookie,1,90);A.hazCookie=1};this.teaserStateChange=function(B){var A=d[B.id];if(B.newstate=="PLAYING"){w(A)}else{if(B.newstate=="COMPLETED"){n(A)}}};var n=function(A){h(A);if(z){A.player.pause()}g(A);A.completed=1};var u=function(F,C,B){var A=F.button;var E="video-teaser-button-"+C;if(F.bclass){A.removeClassName(F.bclass)}A.addClassName(E);F.bclass=E;if(A.getOpacity()==c){A.show();return}if(B){var D=F.id;if(f[D]){f[D].stop()}A.show();f[D]=KrebsLocalBaseAnimation.animate(200,{from:A.getOpacity(),to:c,call:function(G){A.setOpacity(G)},after:function(){f[D]=0}})}else{A.setOpacity(c);A.show()}};var p=function(D,B){var A=D.button;if((A.getOpacity()==0)){A.hide();return}if(B){var C=D.id;if(f[C]){f[C].stop()}f[C]=KrebsLocalBaseAnimation.animate(200,{from:A.getOpacity(),to:0,call:function(E){A.setOpacity(E)},after:function(){A.hide();f[C]=0}})}else{A.hide();A.setOpacity(0)}};var w=function(B){a[B.id]=1;p(B);if(B.image.getOpacity()==0){return}var A=B.id;if(v[A]){return}v[A]=1;y[A]=0;if(q[A]){q[A].stop()}q[A]=KrebsLocalBaseAnimation.animate(300,{from:B.image.getOpacity(),to:0,call:function(C){B.image.setOpacity(C)},after:function(){B.image.hide();q[A]=0;a[A]=0}})};var h=function(B){a[B.id]=1;p(B,1);if(B.image.getOpacity()==1){return}B.image.show();var A=B.id;if(q[A]){q[A].stop()}q[A]=KrebsLocalBaseAnimation.animate(300,{from:B.image.getOpacity(),to:1,call:function(C){B.image.setOpacity(C)},after:function(){v[A]=0;y[A]=0;q[A]=0;a[A]=0}})};this.insertH264=function(B,D){var A={id:D.id,src:b(D.video)};var C=D.type?D.type:"player";if(C=="teaser"){A.width=500;A.heigth=200}else{A.width=D.width;A.height=D.height;A.controls="controls";if(D.image){A.poster=t(D.image)}if(D.autoplay){A.autoplay="autoplay"}else{A.preload="none"}}var E=new Element("video",A);if(C=="teaser"){Event.observe(E,"canplay",function(){r(d[D.id],E)})}if(E){return B.update(E)}return};this.insertFlashPlayer=function(A,C){if(!$(A)){return}var B=C.type?C.type:"player";if(B=="teaser"){C.width=500;C.height=200}var D=new SWFObject("/.krebs/video/.local/jwp/player.swf",C.id,C.width,C.height,"9");if(!D){return}D.addParam("allowscriptaccess","always");D.addParam("wmode","opaque");D.addVariable("file",b(C.video));D.addVariable("type","lighttpd");D.addVariable("bufferlength","10");if(B=="teaser"){D.addParam("allowfullscreen","false");D.addVariable("controlbar","none");D.addVariable("icons",false);D.addVariable("autostart","false");D.addVariable("playerready","KrebsLocalVideo.teaserReadyFlash")}else{D.addParam("allowfullscreen","true");D.addVariable("controlbar","over");D.addVariable("icons",false);D.addVariable("autostart",C.autoplay?"true":"false");if(C.image){D.addVariable("image",t(C.image))}D.addVariable("backcolor","C40009");D.addVariable("frontcolor","FFFFFF");D.addVariable("lightcolor","e3e3e3");D.addVariable("screencolor","e3e3e3")}return D.write(A)};var k=function(B,C){if(!B.empty()){return}var A=new Element("div",{"class":"video-download"});A.style.width=C.width+"px";A.style.height=C.height+"px";A.insert(new Element("img",{src:t(C.image)}));A.insert(new Element("div",{"class":"video-download-black"}));var E=new Element("div",{"class":"video-download-link"});E.update("<p>Leider kann dieses Video nicht angezeigt werden.</p>");var D=new Element("a",{href:b(C.video)});D.update("direkter Download");E.insert(D);A.insert(E);B.update(A)}}var KrebsLocalVideo=new KrebsLocalVideo();Event.observe(document,"dom:loaded",function(){KrebsLocalVideo.onLoad()});if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(n,b,m,e,j,k,g,f,d,l){if(!document.getElementById){return}this.DETECT_KEY=l?l:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(n){this.setAttribute("swf",n)}if(b){this.setAttribute("id",b)}if(m){this.setAttribute("width",m)}if(e){this.setAttribute("height",e)}if(j){this.setAttribute("version",new deconcept.PlayerVersion(j.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(k){this.addParam("bgcolor",k)}var a=g?g:"high";this.addParam("quality",a);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var i=(f)?f:window.location;this.setAttribute("xiRedirectUrl",i);this.setAttribute("redirectUrl","");if(d){this.setAttribute("redirectUrl",d)}};deconcept.SWFObject.prototype={useExpressInstall:function(a){this.xiSWFPath=!a?"expressinstall.swf":a;this.setAttribute("useExpressInstall",true)},setAttribute:function(a,b){this.attributes[a]=b},getAttribute:function(a){return this.attributes[a]},addParam:function(b,a){this.params[b]=a},getParams:function(){return this.params},addVariable:function(b,a){this.variables[b]=a},getVariable:function(a){return this.variables[a]},getVariables:function(){return this.variables},getVariablePairs:function(){var c=new Array();var b;var a=this.getVariables();for(b in a){c[c.length]=b+"="+a[b]}return c},getSWFHTML:function(){var b="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}b='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';b+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var f=this.getParams();for(var e in f){b+=[e]+'="'+f[e]+'" '}var d=this.getVariablePairs().join("&");if(d.length>0){b+='flashvars="'+d+'"'}b+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}b='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';b+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var c=this.getParams();for(var e in c){b+='<param name="'+e+'" value="'+c[e]+'" />'}var a=this.getVariablePairs().join("&");if(a.length>0){b+='<param name="flashvars" value="'+a+'" />'}b+="</object>"}return b},write:function(b){if(this.getAttribute("useExpressInstall")){var a=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(a)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var c=(typeof b=="string")?document.getElementById(b):b;c.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var f=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var a=navigator.plugins["Shockwave Flash"];if(a&&a.description){f=new deconcept.PlayerVersion(a.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var b=1;var c=3;while(b){try{c++;b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+c);f=new deconcept.PlayerVersion([c,0,0])}catch(d){b=null}}}else{try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(d){try{var b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");f=new deconcept.PlayerVersion([6,0,21]);b.AllowScriptAccess="always"}catch(d){if(f.major==6){return f}}try{b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(d){}}if(b!=null){f=new deconcept.PlayerVersion(b.GetVariable("$version").split(" ")[1].split(","))}}}return f};deconcept.PlayerVersion=function(a){this.major=a[0]!=null?parseInt(a[0]):0;this.minor=a[1]!=null?parseInt(a[1]):0;this.rev=a[2]!=null?parseInt(a[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(a){if(this.major<a.major){return false}if(this.major>a.major){return true}if(this.minor<a.minor){return false}if(this.minor>a.minor){return true}if(this.rev<a.rev){return false}return true};deconcept.util={getRequestParameter:function(c){var d=document.location.search||document.location.hash;if(c==null){return d}if(d){var b=d.substring(1).split("&");for(var a=0;a<b.length;a++){if(b[a].substring(0,b[a].indexOf("="))==c){return b[a].substring((b[a].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var b=document.getElementsByTagName("OBJECT");for(var c=b.length-1;c>=0;c--){b[c].style.display="none";for(var a in b[c]){if(typeof b[c][a]=="function"){b[c][a]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(a){return document.all[a]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;function KrebsLocalPictures(){this.onLoad=function(g){if(!g){g="col3_content"}var e=$$("#"+g+" .popup");for(var c=0;c<e.length;c++){var d=e[c];var b=d.parentNode;var a=b.parentNode;var f=d.cloneNode(true);a.replaceChild(f,b)}};this.openPopup=function(b,d,e,f){var c="width="+d+",height="+e;var a;if(!f){f="www.cottbus.de"}if(b.match(/\.jpg$/)){a=window.open("","popup",c);a.document.open();a.document.write("<html><head><title>"+f+"</title></head>");a.document.write("<body style='margin: 0px; padding: 0px'>");a.document.write("<a href='javascript:window.close();true;'><img src='"+b+"' alt='' border='0'></a>");a.document.write("</body></html>");a.document.close()}else{a=window.open(b,"popup",c)}if(window.focus){a.focus()}return false}}var KrebsLocalPictures=new KrebsLocalPictures();Event.observe(document,"dom:loaded",function(){KrebsLocalPictures.onLoad()});function KrebsLocalPicturesGalleries(){var a=new Array;this.onLoad=function(k){if(!k){k="col3_content"}var b=$$("#"+k+" div.galerie");if(!b){return}for(var d=0;d<b.length;d++){var e=b[d].id;var g=b[d].getElementsBySelector(".gal_pic");if(g.length>1){var h=new Array;for(var c=0;c<g.length;c++){h.push(g[c].id)}var f=new Object;f.pics=h;f.max=h.length;f.pos=0;f.id=e;a.push(f)}}if(a.length){window.setInterval("KrebsLocalPicturesGalleries.switchPics()",7777)}};this.switchPics=function(){for(var d=0;d<a.length;d++){var c=a[d];var e=c.pos;var b=c.pics[e];$(c.pics[e]).hide();var e=e+1;if(e>=c.max){e=0}c.pos=e;$(c.pics[e]).show()}}}var KrebsLocalPicturesGalleries=new KrebsLocalPicturesGalleries();Event.observe(document,"dom:loaded",function(){KrebsLocalPicturesGalleries.onLoad()});
