var Prototype={Version:"1.6.1",Browser:(function(){var c=navigator.userAgent;var b=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!b,Opera:b,WebKit:c.indexOf("AppleWebKit/")>-1,Gecko:c.indexOf("Gecko")>-1&&c.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile.*Safari/.test(c)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var b=window.Element||window.HTMLElement;return !!(b&&b.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var d=document.createElement("div");var c=document.createElement("form");var b=false;if(d.__proto__&&(d.__proto__!==c.__proto__)){b=true}d=c=null;return b})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(b){return b}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var d;for(var c=0,f=arguments.length;c<f;c++){var b=arguments[c];try{d=b();break}catch(g){}}return d}};var Class=(function(){function b(){}function c(){var h=null,g=$A(arguments);if(Object.isFunction(g[0])){h=g.shift()}function e(){this.initialize.apply(this,arguments)}Object.extend(e,Class.Methods);e.superclass=h;e.subclasses=[];if(h){b.prototype=h.prototype;e.prototype=new b;h.subclasses.push(e)}for(var f=0;f<g.length;f++){e.addMethods(g[f])}if(!e.prototype.initialize){e.prototype.initialize=Prototype.emptyFunction}e.prototype.constructor=e;return e}function d(m){var g=this.superclass&&this.superclass.prototype;var f=Object.keys(m);if(!Object.keys({toString:true}).length){if(m.toString!=Object.prototype.toString){f.push("toString")}if(m.valueOf!=Object.prototype.valueOf){f.push("valueOf")}}for(var e=0,h=f.length;e<h;e++){var l=f[e],k=m[l];if(g&&Object.isFunction(k)&&k.argumentNames().first()=="$super"){var n=k;k=(function(o){return function(){return g[o].apply(this,arguments)}})(l).wrap(n);k.valueOf=n.valueOf.bind(n);k.toString=n.toString.bind(n)}this.prototype[l]=k}return this}return{create:c,Methods:{addMethods:d}}})();(function(){var e=Object.prototype.toString;function l(t,v){for(var u in v){t[u]=v[u]}return t}function o(t){try{if(f(t)){return"undefined"}if(t===null){return"null"}return t.inspect?t.inspect():String(t)}catch(u){if(u instanceof RangeError){return"..."}throw u}}function n(t){var v=typeof t;switch(v){case"undefined":case"function":case"unknown":return;case"boolean":return t.toString()}if(t===null){return"null"}if(t.toJSON){return t.toJSON()}if(k(t)){return}var u=[];for(var x in t){var w=n(t[x]);if(!f(w)){u.push(x.toJSON()+": "+w)}}return"{"+u.join(", ")+"}"}function d(t){return $H(t).toQueryString()}function g(t){return t&&t.toHTML?t.toHTML():String.interpret(t)}function r(t){var u=[];for(var v in t){u.push(v)}return u}function p(t){var u=[];for(var v in t){u.push(t[v])}return u}function m(t){return l({},t)}function k(t){return !!(t&&t.nodeType==1)}function h(t){return e.call(t)=="[object Array]"}function s(t){return t instanceof Hash}function c(t){return typeof t==="function"}function b(t){return e.call(t)=="[object String]"}function q(t){return e.call(t)=="[object Number]"}function f(t){return typeof t==="undefined"}l(Object,{extend:l,inspect:o,toJSON:n,toQueryString:d,toHTML:g,keys:r,values:p,clone:m,isElement:k,isArray:h,isHash:s,isFunction:c,isString:b,isNumber:q,isUndefined:f})})();Object.extend(Function.prototype,(function(){var n=Array.prototype.slice;function e(r,o){var q=r.length,p=o.length;while(p--){r[q+p]=o[p]}return r}function l(p,o){p=n.call(p,0);return e(p,o)}function h(){var o=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return o.length==1&&!o[0]?[]:o}function k(q){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var o=this,p=n.call(arguments,1);return function(){var r=l(p,arguments);return o.apply(q,r)}}function g(q){var o=this,p=n.call(arguments,1);return function(s){var r=e([s||window.event],p);return o.apply(q,r)}}function m(){if(!arguments.length){return this}var o=this,p=n.call(arguments,0);return function(){var q=l(p,arguments);return o.apply(this,q)}}function f(q){var o=this,p=n.call(arguments,1);q=q*1000;return window.setTimeout(function(){return o.apply(o,p)},q)}function b(){var o=e([0.01],arguments);return this.delay.apply(this,o)}function d(p){var o=this;return function(){var q=e([o.bind(this)],arguments);return p.apply(this,q)}}function c(){if(this._methodized){return this._methodized}var o=this;return this._methodized=function(){var p=e([this],arguments);return o.apply(null,p)}}return{argumentNames:h,bind:k,bindAsEventListener:g,curry:m,delay:f,defer:b,wrap:d,methodize:c}})());Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+'Z"'};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(b){return String(b).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(c,b){this.callback=c;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(b){this.currentlyExecuting=false;throw b}}}});Object.extend(String,{interpret:function(b){return b==null?"":String(b)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img");var matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift());var value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){var parts=this.split("-"),len=parts.length;if(len==1){return parts[0]}var camelized=this.charAt(0)=="-"?parts[0].charAt(0).toUpperCase()+parts[0].substring(1):parts[0];for(var i=1;i<len;i++){camelized+=parts[i].charAt(0).toUpperCase()+parts[i].substring(1)}return camelized}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function toJSON(){return this.inspect(true)}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=this.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,"");return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON();try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.indexOf(pattern)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.lastIndexOf(pattern)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim?String.prototype.trim:strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,toJSON:toJSON,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(b,c){this.template=b.toString();this.pattern=c||Template.Pattern},evaluate:function(b){if(b&&Object.isFunction(b.toTemplateReplacements)){b=b.toTemplateReplacements()}return this.template.gsub(this.pattern,function(e){if(b==null){return(e[1]+"")}var g=e[1]||"";if(g=="\\"){return e[2]}var c=b,h=e[3];var f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;e=f.exec(h);if(e==null){return g}while(e!=null){var d=e[1].startsWith("[")?e[2].replace(/\\\\]/g,"]"):e[1];c=c[d];if(null==c||""==e[3]){break}h=h.substring("["==e[3]?e[1].length:e[0].length);e=f.exec(h)}return g+String.interpret(c)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function d(B,A){var z=0;try{this._each(function(D){B.call(A,D,z++)})}catch(C){if(C!=$break){throw C}}return this}function u(C,B,A){var z=-C,D=[],E=this.toArray();if(C<1){return E}while((z+=C)<E.length){D.push(E.slice(z,z+C))}return D.collect(B,A)}function c(B,A){B=B||Prototype.K;var z=true;this.each(function(D,C){z=z&&!!B.call(A,D,C);if(!z){throw $break}});return z}function l(B,A){B=B||Prototype.K;var z=false;this.each(function(D,C){if(z=!!B.call(A,D,C)){throw $break}});return z}function m(B,A){B=B||Prototype.K;var z=[];this.each(function(D,C){z.push(B.call(A,D,C))});return z}function w(B,A){var z;this.each(function(D,C){if(B.call(A,D,C)){z=D;throw $break}});return z}function k(B,A){var z=[];this.each(function(D,C){if(B.call(A,D,C)){z.push(D)}});return z}function h(C,B,A){B=B||Prototype.K;var z=[];if(Object.isString(C)){C=new RegExp(RegExp.escape(C))}this.each(function(E,D){if(C.match(E)){z.push(B.call(A,E,D))}});return z}function b(z){if(Object.isFunction(this.indexOf)){if(this.indexOf(z)!=-1){return true}}var A=false;this.each(function(B){if(B==z){A=true;throw $break}});return A}function t(A,z){z=Object.isUndefined(z)?null:z;return this.eachSlice(A,function(B){while(B.length<A){B.push(z)}return B})}function o(z,B,A){this.each(function(D,C){z=B.call(A,z,D,C)});return z}function y(A){var z=$A(arguments).slice(1);return this.map(function(B){return B[A].apply(B,z)})}function s(B,A){B=B||Prototype.K;var z;this.each(function(D,C){D=B.call(A,D,C);if(z==null||D>=z){z=D}});return z}function q(B,A){B=B||Prototype.K;var z;this.each(function(D,C){D=B.call(A,D,C);if(z==null||D<z){z=D}});return z}function f(C,A){C=C||Prototype.K;var B=[],z=[];this.each(function(E,D){(C.call(A,E,D)?B:z).push(E)});return[B,z]}function g(A){var z=[];this.each(function(B){z.push(B[A])});return z}function e(B,A){var z=[];this.each(function(D,C){if(!B.call(A,D,C)){z.push(D)}});return z}function p(A,z){return this.map(function(C,B){return{value:C,criteria:A.call(z,C,B)}}).sort(function(E,D){var C=E.criteria,B=D.criteria;return C<B?-1:C>B?1:0}).pluck("value")}function r(){return this.map()}function v(){var A=Prototype.K,z=$A(arguments);if(Object.isFunction(z.last())){A=z.pop()}var B=[this].concat(z).map($A);return this.map(function(D,C){return A(B.pluck(C))})}function n(){return this.toArray().length}function x(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:d,eachSlice:u,all:c,every:c,any:l,some:l,collect:m,map:m,detect:w,findAll:k,select:k,filter:k,grep:h,include:b,member:b,inGroupsOf:t,inject:o,invoke:y,max:s,min:q,partition:f,pluck:g,reject:e,sortBy:p,toArray:r,entries:r,zip:v,size:n,inspect:x,find:w}})();function $A(d){if(!d){return[]}if("toArray" in Object(d)){return d.toArray()}var c=d.length||0,b=new Array(c);while(c--){b[c]=d[c]}return b}function $w(b){if(!Object.isString(b)){return[]}b=b.strip();return b?b.split(/\s+/):[]}Array.from=$A;(function(){var v=Array.prototype,p=v.slice,r=v.forEach;function c(z){for(var y=0,A=this.length;y<A;y++){z(this[y])}}if(!r){r=c}function o(){this.length=0;return this}function e(){return this[0]}function h(){return this[this.length-1]}function l(){return this.select(function(y){return y!=null})}function x(){return this.inject([],function(z,y){if(Object.isArray(y)){return z.concat(y.flatten())}z.push(y);return z})}function k(){var y=p.call(arguments,0);return this.select(function(z){return !y.include(z)})}function g(y){return(y!==false?this:this.toArray())._reverse()}function n(y){return this.inject([],function(B,A,z){if(0==z||(y?B.last()!=A:!B.include(A))){B.push(A)}return B})}function s(y){return this.uniq().findAll(function(z){return y.detect(function(A){return z===A})})}function t(){return p.call(this,0)}function m(){return this.length}function w(){return"["+this.map(Object.inspect).join(", ")+"]"}function u(){var y=[];this.each(function(z){var A=Object.toJSON(z);if(!Object.isUndefined(A)){y.push(A)}});return"["+y.join(", ")+"]"}function b(A,y){y||(y=0);var z=this.length;if(y<0){y=z+y}for(;y<z;y++){if(this[y]===A){return y}}return -1}function q(z,y){y=isNaN(y)?this.length:(y<0?this.length+y:y)+1;var A=this.slice(0,y).reverse().indexOf(z);return(A<0)?A:y-A-1}function d(){var D=p.call(this,0),B;for(var z=0,A=arguments.length;z<A;z++){B=arguments[z];if(Object.isArray(B)&&!("callee" in B)){for(var y=0,C=B.length;y<C;y++){D.push(B[y])}}else{D.push(B)}}return D}Object.extend(v,Enumerable);if(!v._reverse){v._reverse=v.reverse}Object.extend(v,{_each:r,clear:o,first:e,last:h,compact:l,flatten:x,without:k,reverse:g,uniq:n,intersect:s,clone:t,toArray:t,size:m,inspect:w,toJSON:u});var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){v.concat=d}if(!v.indexOf){v.indexOf=b}if(!v.lastIndexOf){v.lastIndexOf=q}})();function $H(b){return new Hash(b)}var Hash=Class.create(Enumerable,(function(){function f(t){this._object=Object.isHash(t)?t.toObject():Object.clone(t)}function g(u){for(var t in this._object){var v=this._object[t],w=[t,v];w.key=t;w.value=v;u(w)}}function n(t,u){return this._object[t]=u}function d(t){if(this._object[t]!==Object.prototype[t]){return this._object[t]}}function q(t){var u=this._object[t];delete this._object[t];return u}function s(){return Object.clone(this._object)}function r(){return this.pluck("key")}function p(){return this.pluck("value")}function h(u){var t=this.detect(function(v){return v.value===u});return t&&t.key}function l(t){return this.clone().update(t)}function e(t){return new Hash(t).inject(this,function(u,v){u.set(v.key,v.value);return u})}function c(t,u){if(Object.isUndefined(u)){return t}return t+"="+encodeURIComponent(String.interpret(u))}function b(){return this.inject([],function(v,w){var u=encodeURIComponent(w.key),t=w.value;if(t&&typeof t=="object"){if(Object.isArray(t)){return v.concat(t.map(c.curry(u)))}}else{v.push(c(u,t))}return v}).join("&")}function o(){return"#<Hash:{"+this.map(function(t){return t.map(Object.inspect).join(": ")}).join(", ")+"}>"}function m(){return Object.toJSON(this.toObject())}function k(){return new Hash(this)}return{initialize:f,_each:g,set:n,get:d,unset:q,toObject:s,toTemplateReplacements:s,keys:r,values:p,index:h,merge:l,update:e,toQueryString:b,inspect:o,toJSON:m,clone:k}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function e(){return this.toPaddedString(2,16)}function f(){return this+1}function b(n,m){$R(0,this,true).each(n,m);return this}function c(o,n){var m=this.toString(n||10);return"0".times(o-m.length)+m}function g(){return isFinite(this)?this.toString():"null"}function l(){return Math.abs(this)}function k(){return Math.round(this)}function h(){return Math.ceil(this)}function d(){return Math.floor(this)}return{toColorPart:e,succ:f,times:b,toPaddedString:c,toJSON:g,abs:l,round:k,ceil:h,floor:d}})());function $R(d,b,c){return new ObjectRange(d,b,c)}var ObjectRange=Class.create(Enumerable,(function(){function c(g,e,f){this.start=g;this.end=e;this.exclusive=f}function d(e){var f=this.start;while(this.include(f)){e(f);f=f.succ()}}function b(e){if(e<this.start){return false}if(this.exclusive){return e<this.end}return e<=this.end}return{initialize:c,_each:d,include:b}})());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(b){this.responders._each(b)},register:function(b){if(!this.include(b)){this.responders.push(b)}},unregister:function(b){this.responders=this.responders.without(b)},dispatch:function(e,c,d,b){this.each(function(f){if(Object.isFunction(f[e])){try{f[e].apply(f,[c,d,b])}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(b){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,b||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,c,b){$super(b);this.transport=Ajax.getTransport();this.request(c)},request:function(c){this.url=c;this.method=this.options.method;var f=Object.clone(this.options.parameters);if(!["get","post"].include(this.method)){f._method=this.method;this.method="post"}this.parameters=f;if(f=Object.toQueryString(f)){if(this.method=="get"){this.url+=(this.url.include("?")?"&":"?")+f}else{if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){f+="&_="}}}try{var 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||f):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var b=this.transport.readyState;if(b>1&&!((b==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var d=this.options.requestHeaders;if(Object.isFunction(d.push)){for(var c=0,e=d.length;c<e;c+=2){f[d[c]]=d[c+1]}}else{$H(d).each(function(g){f[g.key]=g.value})}}for(var b in f){this.transport.setRequestHeader(b,f[b])}},success:function(){var b=this.getStatus();return !b||(b>=200&&b<300)},getStatus:function(){try{return this.transport.status||0}catch(b){return 0}},respondToReadyState:function(b){var d=Ajax.Request.Events[b],c=new Ajax.Response(this);if(d=="Complete"){try{this._complete=true;(this.options["on"+c.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(c,c.headerJSON)}catch(f){this.dispatchException(f)}var g=c.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&g&&g.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()}}try{(this.options["on"+d]||Prototype.emptyFunction)(c,c.headerJSON);Ajax.Responders.dispatch("on"+d,this,c,c.headerJSON)}catch(f){this.dispatchException(f)}if(d=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var b=this.url.match(/^\s*https?:\/\/[^\/]*/);return !b||(b[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(b){try{return this.transport.getResponseHeader(b)||null}catch(c){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(b){(this.options.onException||Prototype.emptyFunction)(this,b);Ajax.Responders.dispatch("onException",this,b)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(d){this.request=d;var e=this.transport=d.transport,b=this.readyState=e.readyState;if((b>2&&!Prototype.Browser.IE)||b==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(e.responseText);this.headerJSON=this._getHeaderJSON()}if(b==4){var c=e.responseXML;this.responseXML=Object.isUndefined(c)?null:c;this.responseJSON=this._getResponseJSON()}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(b){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(b){return null}},getResponseHeader:function(b){return this.transport.getResponseHeader(b)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var b=this.getHeader("X-JSON");if(!b){return null}b=decodeURIComponent(escape(b));try{return b.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(c){this.request.dispatchException(c)}},_getResponseJSON:function(){var b=this.request.options;if(!b.evalJSON||(b.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(b.sanitizeJSON||!this.request.isSameOrigin())}catch(c){this.request.dispatchException(c)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,b,d,c){this.container={success:(b.success||b),failure:(b.failure||(b.success?null:b))};c=Object.clone(c);var e=c.onComplete;c.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(e)){e(f,g)}}).bind(this);$super(d,c)},updateContent:function(e){var d=this.container[this.success()?"success":"failure"],b=this.options;if(!b.evalScripts){e=e.stripScripts()}if(d=$(d)){if(b.insertion){if(Object.isString(b.insertion)){var c={};c[b.insertion]=e;d.insert(c)}else{b.insertion(d,e)}}else{d.update(e)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,d,c){$super(c);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=b;this.url=d;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(b){if(this.options.decay){this.decay=(b.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=b.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 b=0,e=[],d=arguments.length;b<d;b++){e.push($(arguments[b]))}return e}if(Object.isString(c)){c=document.getElementById(c)}return Element.extend(c)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,b){var d=[];var f=document.evaluate(g,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var c=0,e=f.snapshotLength;c<e;c++){d.push(Element.extend(f.snapshotItem(c)))}return d}}if(!window.Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(d){var c=(function(){var g=document.createElement("form");var f=document.createElement("input");var e=document.documentElement;f.setAttribute("name","test");g.appendChild(f);e.appendChild(g);var h=g.elements?(typeof g.elements.test=="undefined"):null;e.removeChild(g);g=f=null;return h})();var b=d.Element;d.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))}return Element.writeAttribute(e[g].cloneNode(false),f)};Object.extend(d.Element,b||{});if(b){d.Element.prototype=b.prototype}})(this);Element.cache={};Element.idCounter=1;Element.Methods={visible:function(b){return $(b).style.display!="none"},toggle:function(b){b=$(b);Element[Element.visible(b)?"hide":"show"](b);return b},hide:function(b){b=$(b);b.style.display="none";return b},show:function(b){b=$(b);b.style.display="";return b},remove:function(b){b=$(b);b.parentNode.removeChild(b);return b},update:(function(){var c=(function(){var f=document.createElement("select"),g=true;f.innerHTML='<option value="test">test</option>';if(f.options&&f.options[0]){g=f.options[0].nodeName.toUpperCase()!=="OPTION"}f=null;return g})();var b=(function(){try{var f=document.createElement("table");if(f&&f.tBodies){f.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var h=typeof f.tBodies[0]=="undefined";f=null;return h}}catch(g){return true}})();var e=(function(){var f=document.createElement("script"),h=false;try{f.appendChild(document.createTextNode(""));h=!f.firstChild||f.firstChild&&f.firstChild.nodeType!==3}catch(g){h=true}f=null;return h})();function d(g,h){g=$(g);if(h&&h.toElement){h=h.toElement()}if(Object.isElement(h)){return g.update().insert(h)}h=Object.toHTML(h);var f=g.tagName.toUpperCase();if(f==="SCRIPT"&&e){g.text=h;return g}if(c||b){if(f in Element._insertionTranslations.tags){while(g.firstChild){g.removeChild(g.firstChild)}Element._getContentFromAnonymousElement(f,h.stripScripts()).each(function(k){g.appendChild(k)})}else{g.innerHTML=h.stripScripts()}}else{g.innerHTML=h.stripScripts()}h.evalScripts.bind(h).defer();return g}return d})(),replace:function(c,d){c=$(c);if(d&&d.toElement){d=d.toElement()}else{if(!Object.isElement(d)){d=Object.toHTML(d);var b=c.ownerDocument.createRange();b.selectNode(c);d.evalScripts.bind(d).defer();d=b.createContextualFragment(d.stripScripts())}}c.parentNode.replaceChild(d,c);return c},insert:function(d,f){d=$(d);if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}}var e,g,c,h;for(var b in f){e=f[b];b=b.toLowerCase();g=Element._insertionTranslations[b];if(e&&e.toElement){e=e.toElement()}if(Object.isElement(e)){g(d,e);continue}e=Object.toHTML(e);c=((b=="before"||b=="after")?d.parentNode:d).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(c,e.stripScripts());if(b=="top"||b=="after"){h.reverse()}h.each(g.curry(d));e.evalScripts.bind(e).defer()}return d},wrap:function(c,d,b){c=$(c);if(Object.isElement(d)){$(d).writeAttribute(b||{})}else{if(Object.isString(d)){d=new Element(d,b)}else{d=new Element("div",d)}}if(c.parentNode){c.parentNode.replaceChild(d,c)}d.appendChild(c);return d},inspect:function(c){c=$(c);var b="<"+c.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),d=g.last();var e=(c[f]||"").toString();if(e){b+=" "+d+"="+e.inspect(true)}});return b+">"},recursivelyCollect:function(b,d){b=$(b);var c=[];while(b=b[d]){if(b.nodeType==1){c.push(Element.extend(b))}}return c},ancestors:function(b){return Element.recursivelyCollect(b,"parentNode")},descendants:function(b){return Element.select(b,"*")},firstDescendant:function(b){b=$(b).firstChild;while(b&&b.nodeType!=1){b=b.nextSibling}return $(b)},immediateDescendants:function(b){if(!(b=$(b).firstChild)){return[]}while(b&&b.nodeType!=1){b=b.nextSibling}if(b){return[b].concat($(b).nextSiblings())}return[]},previousSiblings:function(b){return Element.recursivelyCollect(b,"previousSibling")},nextSiblings:function(b){return Element.recursivelyCollect(b,"nextSibling")},siblings:function(b){b=$(b);return Element.previousSiblings(b).reverse().concat(Element.nextSiblings(b))},match:function(c,b){if(Object.isString(b)){b=new Selector(b)}return b.match($(c))},up:function(c,e,b){c=$(c);if(arguments.length==1){return $(c.parentNode)}var d=Element.ancestors(c);return Object.isNumber(e)?d[e]:Selector.findElement(d,e,b)},down:function(c,d,b){c=$(c);if(arguments.length==1){return Element.firstDescendant(c)}return Object.isNumber(d)?Element.descendants(c)[d]:Element.select(c,d)[b||0]},previous:function(c,e,b){c=$(c);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(c))}var d=Element.previousSiblings(c);return Object.isNumber(e)?d[e]:Selector.findElement(d,e,b)},next:function(d,e,c){d=$(d);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(d))}var b=Element.nextSiblings(d);return Object.isNumber(e)?b[e]:Selector.findElement(b,e,c)},select:function(c){var b=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(c,b)},adjacent:function(c){var b=Array.prototype.slice.call(arguments,1);return Selector.findChildElements(c.parentNode,b).without(c)},identify:function(b){b=$(b);var c=Element.readAttribute(b,"id");if(c){return c}do{c="anonymous_element_"+Element.idCounter++}while($(c));Element.writeAttribute(b,"id",c);return c},readAttribute:function(d,b){d=$(d);if(Prototype.Browser.IE){var c=Element._attributeTranslations.read;if(c.values[b]){return c.values[b](d,b)}if(c.names[b]){b=c.names[b]}if(b.include(":")){return(!d.attributes||!d.attributes[b])?null:d.attributes[b].value}}return d.getAttribute(b)},writeAttribute:function(f,d,g){f=$(f);var c={},e=Element._attributeTranslations.write;if(typeof d=="object"){c=d}else{c[d]=Object.isUndefined(g)?true:g}for(var b in c){d=e.names[b]||b;g=c[b];if(e.values[b]){d=e.values[b](f,g)}if(g===false||g===null){f.removeAttribute(d)}else{if(g===true){f.setAttribute(d,d)}else{f.setAttribute(d,g)}}}return f},getHeight:function(b){return Element.getDimensions(b).height},getWidth:function(b){return Element.getDimensions(b).width},classNames:function(b){return new Element.ClassNames(b)},hasClassName:function(b,c){if(!(b=$(b))){return}var d=b.className;return(d.length>0&&(d==c||new RegExp("(^|\\s)"+c+"(\\s|$)").test(d)))},addClassName:function(b,c){if(!(b=$(b))){return}if(!Element.hasClassName(b,c)){b.className+=(b.className?" ":"")+c}return b},removeClassName:function(b,c){if(!(b=$(b))){return}b.className=b.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)")," ").strip();return b},toggleClassName:function(b,c){if(!(b=$(b))){return}return Element[Element.hasClassName(b,c)?"removeClassName":"addClassName"](b,c)},cleanWhitespace:function(c){c=$(c);var d=c.firstChild;while(d){var b=d.nextSibling;if(d.nodeType==3&&!/\S/.test(d.nodeValue)){c.removeChild(d)}d=b}return c},empty:function(b){return $(b).innerHTML.blank()},descendantOf:function(c,b){c=$(c),b=$(b);if(c.compareDocumentPosition){return(c.compareDocumentPosition(b)&8)===8}if(b.contains){return b.contains(c)&&b!==c}while(c=c.parentNode){if(c==b){return true}}return false},scrollTo:function(b){b=$(b);var c=Element.cumulativeOffset(b);window.scrollTo(c[0],c[1]);return b},getStyle:function(c,d){c=$(c);d=d=="float"?"cssFloat":d.camelize();var e=c.style[d];if(!e||e=="auto"){var b=document.defaultView.getComputedStyle(c,null);e=b?b[d]:null}if(d=="opacity"){return e?parseFloat(e):1}return e=="auto"?null:e},getOpacity:function(b){return $(b).getStyle("opacity")},setStyle:function(c,d){c=$(c);var f=c.style,b;if(Object.isString(d)){c.style.cssText+=";"+d;return d.include("opacity")?c.setOpacity(d.match(/opacity:\s*(\d?\.?\d*)/)[1]):c}for(var e in d){if(e=="opacity"){c.setOpacity(d[e])}else{f[(e=="float"||e=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):e]=d[e]}}return c},setOpacity:function(b,c){b=$(b);b.style.opacity=(c==1||c==="")?"":(c<0.00001)?0:c;return b},getDimensions:function(d){d=$(d);var h=Element.getStyle(d,"display");if(h!="none"&&h!=null){return{width:d.offsetWidth,height:d.offsetHeight}}var c=d.style;var g=c.visibility;var e=c.position;var b=c.display;c.visibility="hidden";if(e!="fixed"){c.position="absolute"}c.display="block";var k=d.clientWidth;var f=d.clientHeight;c.display=b;c.position=e;c.visibility=g;return{width:k,height:f}},makePositioned:function(b){b=$(b);var c=Element.getStyle(b,"position");if(c=="static"||!c){b._madePositioned=true;b.style.position="relative";if(Prototype.Browser.Opera){b.style.top=0;b.style.left=0}}return b},undoPositioned:function(b){b=$(b);if(b._madePositioned){b._madePositioned=undefined;b.style.position=b.style.top=b.style.left=b.style.bottom=b.style.right=""}return b},makeClipping:function(b){b=$(b);if(b._overflow){return b}b._overflow=Element.getStyle(b,"overflow")||"auto";if(b._overflow!=="hidden"){b.style.overflow="hidden"}return b},undoClipping:function(b){b=$(b);if(!b._overflow){return b}b.style.overflow=b._overflow=="auto"?"":b._overflow;b._overflow=null;return b},cumulativeOffset:function(c){var b=0,d=0;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;c=c.offsetParent}while(c);return Element._returnOffset(d,b)},positionedOffset:function(c){var b=0,e=0;do{b+=c.offsetTop||0;e+=c.offsetLeft||0;c=c.offsetParent;if(c){if(c.tagName.toUpperCase()=="BODY"){break}var d=Element.getStyle(c,"position");if(d!=="static"){break}}}while(c);return Element._returnOffset(e,b)},absolutize:function(c){c=$(c);if(Element.getStyle(c,"position")=="absolute"){return c}var e=Element.positionedOffset(c);var g=e[1];var f=e[0];var d=c.clientWidth;var b=c.clientHeight;c._originalLeft=f-parseFloat(c.style.left||0);c._originalTop=g-parseFloat(c.style.top||0);c._originalWidth=c.style.width;c._originalHeight=c.style.height;c.style.position="absolute";c.style.top=g+"px";c.style.left=f+"px";c.style.width=d+"px";c.style.height=b+"px";return c},relativize:function(b){b=$(b);if(Element.getStyle(b,"position")=="relative"){return b}b.style.position="relative";var d=parseFloat(b.style.top||0)-(b._originalTop||0);var c=parseFloat(b.style.left||0)-(b._originalLeft||0);b.style.top=d+"px";b.style.left=c+"px";b.style.height=b._originalHeight;b.style.width=b._originalWidth;return b},cumulativeScrollOffset:function(c){var b=0,d=0;do{b+=c.scrollTop||0;d+=c.scrollLeft||0;c=c.parentNode}while(c);return Element._returnOffset(d,b)},getOffsetParent:function(b){if(b.offsetParent){return $(b.offsetParent)}if(b==document.body){return $(b)}while((b=b.parentNode)&&b!=document.body){if(Element.getStyle(b,"position")!="static"){return $(b)}}return $(document.body)},viewportOffset:function(e){var b=0,d=0;var c=e;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;if(c.offsetParent==document.body&&Element.getStyle(c,"position")=="absolute"){break}}while(c=c.offsetParent);c=e;do{if(!Prototype.Browser.Opera||(c.tagName&&(c.tagName.toUpperCase()=="BODY"))){b-=c.scrollTop||0;d-=c.scrollLeft||0}}while(c=c.parentNode);return Element._returnOffset(d,b)},clonePosition:function(c,e){var b=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});e=$(e);var f=Element.viewportOffset(e);c=$(c);var g=[0,0];var d=null;if(Element.getStyle(c,"position")=="absolute"){d=Element.getOffsetParent(c);g=Element.viewportOffset(d)}if(d==document.body){g[0]-=document.body.offsetLeft;g[1]-=document.body.offsetTop}if(b.setLeft){c.style.left=(f[0]-g[0]+b.offsetLeft)+"px"}if(b.setTop){c.style.top=(f[1]-g[1]+b.offsetTop)+"px"}if(b.setWidth){c.style.width=e.offsetWidth+"px"}if(b.setHeight){c.style.height=e.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(e,c,d){switch(d){case"left":case"top":case"right":case"bottom":if(e(c,"position")==="static"){return null}case"height":case"width":if(!Element.visible(c)){return null}var f=parseInt(e(c,d),10);if(f!==c["offset"+d.capitalize()]){return f+"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(f,function(g,h){var k=e(c,h);return k===null?g:g-parseInt(k,10)})+"px";default:return e(c,d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(d,b,c){if(c==="title"){return b.title}return d(b,c)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(d,c){c=$(c);try{c.offsetParent}catch(g){return $(document.body)}var b=c.getStyle("position");if(b!=="static"){return d(c)}c.setStyle({position:"relative"});var f=d(c);c.setStyle({position:b});return f});$w("positionedOffset viewportOffset").each(function(b){Element.Methods[b]=Element.Methods[b].wrap(function(g,d){d=$(d);try{d.offsetParent}catch(k){return Element._returnOffset(0,0)}var c=d.getStyle("position");if(c!=="static"){return g(d)}var f=d.getOffsetParent();if(f&&f.getStyle("position")==="fixed"){f.setStyle({zoom:1})}d.setStyle({position:"relative"});var h=g(d);d.setStyle({position:c});return h})});Element.Methods.cumulativeOffset=Element.Methods.cumulativeOffset.wrap(function(c,b){try{b.offsetParent}catch(d){return Element._returnOffset(0,0)}return c(b)});Element.Methods.getStyle=function(b,c){b=$(b);c=(c=="float"||c=="cssFloat")?"styleFloat":c.camelize();var d=b.style[c];if(!d&&b.currentStyle){d=b.currentStyle[c]}if(c=="opacity"){if(d=(b.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(d[1]){return parseFloat(d[1])/100}}return 1}if(d=="auto"){if((c=="width"||c=="height")&&(b.getStyle("display")!="none")){return b["offset"+c.capitalize()]+"px"}return null}return d};Element.Methods.setOpacity=function(c,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"")}c=$(c);var b=c.currentStyle;if((b&&!b.hasLayout)||(!b&&c.style.zoom=="normal")){c.style.zoom=1}var e=c.getStyle("filter"),d=c.style;if(f==1||f===""){(e=g(e))?d.filter=e:d.removeAttribute("filter");return c}else{if(f<0.00001){f=0}}d.filter=g(e)+"alpha(opacity="+(f*100)+")";return c};Element._attributeTranslations=(function(){var c="className";var b="for";var d=document.createElement("div");d.setAttribute(c,"x");if(d.className!=="x"){d.setAttribute("class","x");if(d.className==="x"){c="class"}}d=null;d=document.createElement("label");d.setAttribute(b,"x");if(d.htmlFor!=="x"){d.setAttribute("htmlFor","x");if(d.htmlFor==="x"){b="htmlFor"}}d=null;return{read:{names:{"class":c,className:c,"for":b,htmlFor:b},values:{_getAttr:function(e,f){return e.getAttribute(f)},_getAttr2:function(e,f){return e.getAttribute(f,2)},_getAttrNode:function(e,g){var f=e.getAttributeNode(g);return f?f.value:""},_getEv:(function(){var e=document.createElement("div");e.onclick=Prototype.emptyFunction;var h=e.getAttribute("onclick");var g;if(String(h).indexOf("{")>-1){g=function(f,k){k=f.getAttribute(k);if(!k){return null}k=k.toString();k=k.split("{")[1];k=k.split("}")[0];return k.strip()}}else{if(h===""){g=function(f,k){k=f.getAttribute(k);if(!k){return null}return k.strip()}}}e=null;return g})(),_flag:function(e,f){return $(e).hasAttribute(f)?f:null},style:function(e){return e.style.cssText.toLowerCase()},title:function(e){return e.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(b,c){b.checked=!!c},style:function(b,c){b.style.cssText=c?c:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(b){Element._attributeTranslations.write.names[b.toLowerCase()]=b;Element._attributeTranslations.has[b.toLowerCase()]=b});(function(b){Object.extend(b,{href:b._getAttr2,src:b._getAttr2,type:b._getAttr,action:b._getAttrNode,disabled:b._flag,checked:b._flag,readonly:b._flag,multiple:b._flag,onload:b._getEv,onunload:b._getEv,onclick:b._getEv,ondblclick:b._getEv,onmousedown:b._getEv,onmouseup:b._getEv,onmouseover:b._getEv,onmousemove:b._getEv,onmouseout:b._getEv,onfocus:b._getEv,onblur:b._getEv,onkeypress:b._getEv,onkeydown:b._getEv,onkeyup:b._getEv,onsubmit:b._getEv,onreset:b._getEv,onselect:b._getEv,onchange:b._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function b(f){var c=f.getElementsByTagName("*"),e=[];for(var d=0,g;g=c[d];d++){if(g.tagName!=="!"){e.push(g)}}return e}Element.Methods.down=function(d,e,c){d=$(d);if(arguments.length==1){return d.firstDescendant()}return Object.isNumber(e)?b(d)[e]:Element.select(d,e)[c||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(b,c){b=$(b);b.style.opacity=(c==1)?0.999999:(c==="")?"":(c<0.00001)?0:c;return b}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(b,c){b=$(b);b.style.opacity=(c==1||c==="")?"":(c<0.00001)?0:c;if(c==1){if(b.tagName.toUpperCase()=="IMG"&&b.width){b.width++;b.width--}else{try{var f=document.createTextNode(" ");b.appendChild(f);b.removeChild(f)}catch(d){}}}return b};Element.Methods.cumulativeOffset=function(c){var b=0,d=0;do{b+=c.offsetTop||0;d+=c.offsetLeft||0;if(c.offsetParent==document.body){if(Element.getStyle(c,"position")=="absolute"){break}}c=c.offsetParent}while(c);return Element._returnOffset(d,b)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(d,f){d=$(d);if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){d.parentNode.replaceChild(f,d);return d}f=Object.toHTML(f);var e=d.parentNode,c=e.tagName.toUpperCase();if(Element._insertionTranslations.tags[c]){var g=d.next();var b=Element._getContentFromAnonymousElement(c,f.stripScripts());e.removeChild(d);if(g){b.each(function(h){e.insertBefore(h,g)})}else{b.each(function(h){e.appendChild(h)})}}else{d.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return d}}Element._returnOffset=function(c,d){var b=[c,d];b.left=c;b.top=d;return b};Element._getContentFromAnonymousElement=function(d,c){var e=new Element("div"),b=Element._insertionTranslations.tags[d];if(b){e.innerHTML=b[0]+c+b[1];b[2].times(function(){e=e.firstChild})}else{e.innerHTML=c}return $A(e.childNodes)};Element._insertionTranslations={before:function(b,c){b.parentNode.insertBefore(c,b)},top:function(b,c){b.insertBefore(c,b.firstChild)},bottom:function(b,c){b.appendChild(c)},after:function(b,c){b.parentNode.insertBefore(c,b.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 b=Element._insertionTranslations.tags;Object.extend(b,{THEAD:b.TBODY,TFOOT:b.TBODY,TH:b.TD})})();Element.Methods.Simulated={hasAttribute:function(b,d){d=Element._attributeTranslations.has[d]||d;var c=$(b).getAttributeNode(d);return !!(c&&c.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(b){if(!Prototype.BrowserFeatures.ElementExtensions&&b.__proto__){window.HTMLElement={};window.HTMLElement.prototype=b.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}b=null})(document.createElement("div"));Element.extend=(function(){function d(h){if(typeof window.Element!="undefined"){var l=window.Element.prototype;if(l){var n="_"+(Math.random()+"").slice(2);var k=document.createElement(h);l[n]="x";var m=(k[n]!=="x");delete l[n];k=null;return m}}return false}function c(k,h){for(var m in h){var l=h[m];if(Object.isFunction(l)&&!(m in k)){k[m]=l.methodize()}}}var e=d("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(e){return function(k){if(k&&typeof k._extendedByPrototype=="undefined"){var h=k.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){c(k,Element.Methods);c(k,Element.Methods.Simulated);c(k,Element.Methods.ByTag[h.toUpperCase()])}}return k}}return Prototype.K}var b={},f=Element.Methods.ByTag;var g=Object.extend(function(l){if(!l||typeof l._extendedByPrototype!="undefined"||l.nodeType!=1||l==window){return l}var h=Object.clone(b),k=l.tagName.toUpperCase();if(f[k]){Object.extend(h,f[k])}c(l,h);l._extendedByPrototype=Prototype.emptyFunction;return l},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(b,Element.Methods);Object.extend(b,Element.Methods.Simulated)}}});g.refresh();return g})();Element.hasAttribute=function(b,c){if(b.hasAttribute){return b.hasAttribute(c)}return Element.Methods.Simulated.hasAttribute(b,c)};Element.addMethods=function(d){var l=Prototype.BrowserFeatures,e=Element.Methods.ByTag;if(!d){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods)})}if(arguments.length==2){var c=d;d=arguments[1]}if(!c){Object.extend(Element.Methods,d||{})}else{if(Object.isArray(c)){c.each(h)}else{h(c)}}function h(n){n=n.toUpperCase();if(!Element.Methods.ByTag[n]){Element.Methods.ByTag[n]={}}Object.extend(Element.Methods.ByTag[n],d)}function b(p,o,n){n=n||false;for(var r in p){var q=p[r];if(!Object.isFunction(q)){continue}if(!n||!(r in o)){o[r]=q.methodize()}}}function f(q){var n;var p={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(p[q]){n="HTML"+p[q]+"Element"}if(window[n]){return window[n]}n="HTML"+q+"Element";if(window[n]){return window[n]}n="HTML"+q.capitalize()+"Element";if(window[n]){return window[n]}var o=document.createElement(q);var r=o.__proto__||o.constructor.prototype;o=null;return r}var k=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(l.ElementExtensions){b(Element.Methods,k);b(Element.Methods.Simulated,k,true)}if(l.SpecificElementExtensions){for(var m in Element.Methods.ByTag){var g=f(m);if(Object.isUndefined(g)){continue}b(e[m],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 h=Prototype.Browser,f=document,d,e={};function b(){if(h.WebKit&&!f.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function g(k){if(!d){d=b()}e[k]="client"+k;c["get"+k]=function(){return d[e[k]]};return c["get"+k]()}c.getWidth=g.curry("Width");c.getHeight=g.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(c){if(!(c=$(c))){return}var b;if(c===window){b=0}else{if(typeof c._prototypeUID==="undefined"){c._prototypeUID=[Element.Storage.UID++]}b=c._prototypeUID[0]}if(!Element.Storage[b]){Element.Storage[b]=$H()}return Element.Storage[b]},store:function(c,b,d){if(!(c=$(c))){return}if(arguments.length===2){Element.getStorage(c).update(b)}else{Element.getStorage(c).set(b,d)}return c},retrieve:function(d,c,b){if(!(d=$(d))){return}var f=Element.getStorage(d),e=f.get(c);if(Object.isUndefined(e)){f.set(c,b);e=b}return e},clone:function(d,b){if(!(d=$(d))){return}var f=d.cloneNode(b);f._prototypeUID=void 0;if(b){var e=Element.select(f,"*"),c=e.length;while(c--){e[c]._prototypeUID=void 0}}return Element.extend(f)}});var Selector=Class.create({initialize:function(b){this.expression=b.strip();if(this.shouldUseSelectorsAPI()){this.mode="selectorsAPI"}else{if(this.shouldUseXPath()){this.mode="xpath";this.compileXPathMatcher()}else{this.mode="normal";this.compileMatcher()}}},shouldUseXPath:(function(){var b=(function(){var f=false;if(document.evaluate&&window.XPathResult){var e=document.createElement("div");e.innerHTML="<ul><li></li></ul><div><ul><li></li></ul></div>";var d=".//*[local-name()='ul' or local-name()='UL']//*[local-name()='li' or local-name()='LI']";var c=document.evaluate(d,e,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);f=(c.snapshotLength!==2);e=null}return f})();return function(){if(!Prototype.BrowserFeatures.XPath){return false}var c=this.expression;if(Prototype.Browser.WebKit&&(c.include("-of-type")||c.include(":empty"))){return false}if((/(\[[\w-]*?:|:checked)/).test(c)){return false}if(b){return false}return true}})(),shouldUseSelectorsAPI:function(){if(!Prototype.BrowserFeatures.SelectorsAPI){return false}if(Selector.CASE_INSENSITIVE_CLASS_NAMES){return false}if(!Selector._div){Selector._div=new Element("div")}try{Selector._div.querySelector(this.expression)}catch(b){return false}return true},compileMatcher:function(){var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m,len=ps.length,name;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i=0;i<len;i++){p=ps[i].re;name=ps[i].name;if(m=e.match(p)){this.matcher.push(Object.isFunction(c[name])?c[name](m):new Template(c[name]).evaluate(m));e=e.replace(m[0],"");break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var k=this.expression,l=Selector.patterns,d=Selector.xpath,h,c,b=l.length,f;if(Selector._cache[k]){this.xpath=Selector._cache[k];return}this.matcher=[".//*"];while(k&&h!=k&&(/\S/).test(k)){h=k;for(var g=0;g<b;g++){f=l[g].name;if(c=k.match(l[g].re)){this.matcher.push(Object.isFunction(d[f])?d[f](c):new Template(d[f]).evaluate(c));k=k.replace(c[0],"");break}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath},findElements:function(b){b=b||document;var d=this.expression,c;switch(this.mode){case"selectorsAPI":if(b!==document){var f=b.id,g=$(b).identify();g=g.replace(/([\.:])/g,"\\$1");d="#"+g+" "+d}c=$A(b.querySelectorAll(d)).map(Element.extend);b.id=f;return c;case"xpath":return document._getElementsByXPath(this.xpath,b);default:return this.matcher(b)}},match:function(n){this.tokens=[];var s=this.expression,b=Selector.patterns,g=Selector.assertions;var c,f,h,r=b.length,d;while(s&&c!==s&&(/\S/).test(s)){c=s;for(var l=0;l<r;l++){f=b[l].re;d=b[l].name;if(h=s.match(f)){if(g[d]){this.tokens.push([d,Object.clone(h)]);s=s.replace(h[0],"")}else{return this.findElements(document).include(n)}}}}var q=true,d,o;for(var l=0,k;k=this.tokens[l];l++){d=k[0],o=k[1];if(!Selector.assertions[d](n,o)){q=false;break}}return q},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});if(Prototype.BrowserFeatures.SelectorsAPI&&document.compatMode==="BackCompat"){Selector.CASE_INSENSITIVE_CLASS_NAMES=(function(){var d=document.createElement("div"),b=document.createElement("span");d.id="prototype_test_id";b.className="Test";d.appendChild(b);var c=(d.querySelector("#prototype_test_id .test")!==null);d=b=null;return c})()}Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(b){if(b[1]=="*"){return""}return"[local-name()='"+b[1].toLowerCase()+"' or local-name()='"+b[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(b){b[1]=b[1].toLowerCase();return new Template("[@#{1}]").evaluate(b)},attr:function(b){b[1]=b[1].toLowerCase();b[3]=b[5]||b[6];return new Template(Selector.xpath.operators[b[2]]).evaluate(b)},pseudo:function(b){var c=Selector.xpath.pseudos[b[1]];if(!c){return""}if(Object.isFunction(c)){return c(b)}return new Template(Selector.xpath.pseudos[b[1]]).evaluate(b)},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]",empty:"[count(*) = 0 and (count(text()) = 0)]",checked:"[@checked]",disabled:"[(@disabled) and (@type!='hidden')]",enabled:"[not(@disabled) and (@type!='hidden')]",not:function(g){var l=g[6],d=Selector.patterns,n=Selector.xpath,b,o,k=d.length,c;var f=[];while(l&&b!=l&&(/\S/).test(l)){b=l;for(var h=0;h<k;h++){c=d[h].name;if(g=l.match(d[h].re)){o=Object.isFunction(n[c])?n[c](g):new Template(n[c]).evaluate(g);f.push("("+o.substring(1,o.length-1)+")");l=l.replace(g[0],"");break}}}return"[not("+f.join(" and ")+")]"},"nth-child":function(b){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",b)},"nth-last-child":function(b){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",b)},"nth-of-type":function(b){return Selector.xpath.pseudos.nth("position() ",b)},"nth-last-of-type":function(b){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",b)},"first-of-type":function(b){b[6]="1";return Selector.xpath.pseudos["nth-of-type"](b)},"last-of-type":function(b){b[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](b)},"only-of-type":function(b){var c=Selector.xpath.pseudos;return c["first-of-type"](b)+c["last-of-type"](b)},nth:function(g,e){var h,k=e[6],d;if(k=="even"){k="2n+0"}if(k=="odd"){k="2n+1"}if(h=k.match(/^(\d+)$/)){return"["+g+"= "+h[1]+"]"}if(h=k.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(h[1]=="-"){h[1]=-1}var f=h[1]?Number(h[1]):1;var c=h[2]?Number(h[2]):0;d="[((#{fragment} - #{b}) mod #{a} = 0) and ((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(d).evaluate({fragment:g,a:f,b:c})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(b){b[3]=(b[5]||b[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(b)},pseudo:function(b){if(b[6]){b[6]=b[6].replace(/"/g,'\\"')}return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(b)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:[{name:"laterSibling",re:/^\s*~\s*/},{name:"child",re:/^\s*>\s*/},{name:"adjacent",re:/^\s*\+\s*/},{name:"descendant",re:/^\s/},{name:"tagName",re:/^\s*(\*|[\w\-]+)(\b|$)?/},{name:"id",re:/^#([\w\-\*]+)(\b|$)/},{name:"className",re:/^\.([\w\-\*]+)(\b|$)/},{name:"pseudo",re:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/},{name:"attrPresence",re:/^\[((?:[\w-]+:)?[\w-]+)\]/},{name:"attr",re:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/}],assertions:{tagName:function(b,c){return c[1].toUpperCase()==b.tagName.toUpperCase()},className:function(b,c){return Element.hasClassName(b,c[1])},id:function(b,c){return b.id===c[1]},attrPresence:function(b,c){return Element.hasAttribute(b,c[1])},attr:function(c,d){var b=Element.readAttribute(c,d[1]);return b&&Selector.operators[d[2]](b,d[5]||d[6])}},handlers:{concat:function(d,c){for(var e=0,f;f=c[e];e++){d.push(f)}return d},mark:function(b){var e=Prototype.emptyFunction;for(var c=0,d;d=b[c];c++){d._countedByPrototype=e}return b},unmark:(function(){var b=(function(){var c=document.createElement("div"),f=false,e="_countedByPrototype",d="x";c[e]=d;f=(c.getAttribute(e)===d);c=null;return f})();return b?function(c){for(var d=0,e;e=c[d];d++){e.removeAttribute("_countedByPrototype")}return c}:function(c){for(var d=0,e;e=c[d];d++){e._countedByPrototype=void 0}return c}})(),index:function(b,e,h){b._countedByPrototype=Prototype.emptyFunction;if(e){for(var c=b.childNodes,f=c.length-1,d=1;f>=0;f--){var g=c[f];if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=d++}}}else{for(var f=0,d=1,c=b.childNodes;g=c[f];f++){if(g.nodeType==1&&(!h||g._countedByPrototype)){g.nodeIndex=d++}}}},unique:function(c){if(c.length==0){return c}var e=[],f;for(var d=0,b=c.length;d<b;d++){if(typeof(f=c[d])._countedByPrototype=="undefined"){f._countedByPrototype=Prototype.emptyFunction;e.push(Element.extend(f))}}return Selector.handlers.unmark(e)},descendant:function(b){var e=Selector.handlers;for(var d=0,c=[],f;f=b[d];d++){e.concat(c,f.getElementsByTagName("*"))}return c},child:function(b){var f=Selector.handlers;for(var e=0,d=[],g;g=b[e];e++){for(var c=0,k;k=g.childNodes[c];c++){if(k.nodeType==1&&k.tagName!="!"){d.push(k)}}}return d},adjacent:function(b){for(var d=0,c=[],f;f=b[d];d++){var e=this.nextElementSibling(f);if(e){c.push(e)}}return c},laterSibling:function(b){var e=Selector.handlers;for(var d=0,c=[],f;f=b[d];d++){e.concat(c,Element.nextSiblings(f))}return c},nextElementSibling:function(b){while(b=b.nextSibling){if(b.nodeType==1){return b}}return null},previousElementSibling:function(b){while(b=b.previousSibling){if(b.nodeType==1){return b}}return null},tagName:function(b,l,d,c){var m=d.toUpperCase();var f=[],k=Selector.handlers;if(b){if(c){if(c=="descendant"){for(var g=0,e;e=b[g];g++){k.concat(f,e.getElementsByTagName(d))}return f}else{b=this[c](b)}if(d=="*"){return b}}for(var g=0,e;e=b[g];g++){if(e.tagName.toUpperCase()===m){f.push(e)}}return f}else{return l.getElementsByTagName(d)}},id:function(b,m,c,d){var l=$(c),k=Selector.handlers;if(m==document){if(!l){return[]}if(!b){return[l]}}else{if(!m.sourceIndex||m.sourceIndex<1){var b=m.getElementsByTagName("*");for(var f=0,e;e=b[f];f++){if(e.id===c){return[e]}}}}if(b){if(d){if(d=="child"){for(var g=0,e;e=b[g];g++){if(l.parentNode==e){return[l]}}}else{if(d=="descendant"){for(var g=0,e;e=b[g];g++){if(Element.descendantOf(l,e)){return[l]}}}else{if(d=="adjacent"){for(var g=0,e;e=b[g];g++){if(Selector.handlers.previousElementSibling(l)==e){return[l]}}}else{b=k[d](b)}}}}for(var g=0,e;e=b[g];g++){if(e==l){return[l]}}return[]}return(l&&Element.descendantOf(l,m))?[l]:[]},className:function(c,b,d,e){if(c&&e){c=this[e](c)}return Selector.handlers.byClassName(c,b,d)},byClassName:function(d,c,g){if(!d){d=Selector.handlers.descendant([c])}var k=" "+g+" ";for(var f=0,e=[],h,b;h=d[f];f++){b=h.className;if(b.length==0){continue}if(b==g||(" "+b+" ").include(k)){e.push(h)}}return e},attrPresence:function(d,c,b,h){if(!d){d=c.getElementsByTagName("*")}if(d&&h){d=this[h](d)}var f=[];for(var e=0,g;g=d[e];e++){if(Element.hasAttribute(g,b)){f.push(g)}}return f},attr:function(b,l,k,m,d,c){if(!b){b=l.getElementsByTagName("*")}if(b&&c){b=this[c](b)}var n=Selector.operators[d],g=[];for(var f=0,e;e=b[f];f++){var h=Element.readAttribute(e,k);if(h===null){continue}if(n(h,m)){g.push(e)}}return g},pseudo:function(c,d,f,b,e){if(c&&e){c=this[e](c)}if(!c){c=b.getElementsByTagName("*")}return Selector.pseudos[d](c,f,b)}},pseudos:{"first-child":function(c,g,b){for(var e=0,d=[],f;f=c[e];e++){if(Selector.handlers.previousElementSibling(f)){continue}d.push(f)}return d},"last-child":function(c,g,b){for(var e=0,d=[],f;f=c[e];e++){if(Selector.handlers.nextElementSibling(f)){continue}d.push(f)}return d},"only-child":function(c,k,b){var f=Selector.handlers;for(var e=0,d=[],g;g=c[e];e++){if(!f.previousElementSibling(g)&&!f.nextElementSibling(g)){d.push(g)}}return d},"nth-child":function(c,d,b){return Selector.pseudos.nth(c,d,b)},"nth-last-child":function(c,d,b){return Selector.pseudos.nth(c,d,b,true)},"nth-of-type":function(c,d,b){return Selector.pseudos.nth(c,d,b,false,true)},"nth-last-of-type":function(c,d,b){return Selector.pseudos.nth(c,d,b,true,true)},"first-of-type":function(c,d,b){return Selector.pseudos.nth(c,"1",b,false,true)},"last-of-type":function(c,d,b){return Selector.pseudos.nth(c,"1",b,true,true)},"only-of-type":function(c,e,b){var d=Selector.pseudos;return d["last-of-type"](d["first-of-type"](c,e,b),e,b)},getIndices:function(d,c,e){if(d==0){return c>0?[c]:[]}return $R(1,e).inject([],function(b,f){if(0==(f-c)%d&&(f-c)/d>=0){b.push(f)}return b})},nth:function(c,s,u,r,e){if(c.length==0){return[]}if(s=="even"){s="2n+0"}if(s=="odd"){s="2n+1"}var q=Selector.handlers,p=[],d=[],g;q.mark(c);for(var o=0,f;f=c[o];o++){if(!f.parentNode._countedByPrototype){q.index(f.parentNode,r,e);d.push(f.parentNode)}}if(s.match(/^\d+$/)){s=Number(s);for(var o=0,f;f=c[o];o++){if(f.nodeIndex==s){p.push(f)}}}else{if(g=s.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(g[1]=="-"){g[1]=-1}var v=g[1]?Number(g[1]):1;var t=g[2]?Number(g[2]):0;var w=Selector.pseudos.getIndices(v,t,c.length);for(var o=0,f,k=w.length;f=c[o];o++){for(var n=0;n<k;n++){if(f.nodeIndex==w[n]){p.push(f)}}}}}q.unmark(c);q.unmark(d);return p},empty:function(c,g,b){for(var e=0,d=[],f;f=c[e];e++){if(f.tagName=="!"||f.firstChild){continue}d.push(f)}return d},not:function(b,e,n){var k=Selector.handlers,o,d;var l=new Selector(e).findElements(n);k.mark(l);for(var g=0,f=[],c;c=b[g];g++){if(!c._countedByPrototype){f.push(c)}}k.unmark(l);return f},enabled:function(c,g,b){for(var e=0,d=[],f;f=c[e];e++){if(!f.disabled&&(!f.type||f.type!=="hidden")){d.push(f)}}return d},disabled:function(c,g,b){for(var e=0,d=[],f;f=c[e];e++){if(f.disabled){d.push(f)}}return d},checked:function(c,g,b){for(var e=0,d=[],f;f=c[e];e++){if(f.checked){d.push(f)}}return d}},operators:{"=":function(c,b){return c==b},"!=":function(c,b){return c!=b},"^=":function(c,b){return c==b||c&&c.startsWith(b)},"$=":function(c,b){return c==b||c&&c.endsWith(b)},"*=":function(c,b){return c==b||c&&c.include(b)},"~=":function(c,b){return(" "+c+" ").include(" "+b+" ")},"|=":function(c,b){return("-"+(c||"").toUpperCase()+"-").include("-"+(b||"").toUpperCase()+"-")}},split:function(c){var b=[];c.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(d){b.push(d[1].strip())});return b},matchElements:function(g,k){var f=$$(k),e=Selector.handlers;e.mark(f);for(var d=0,c=[],b;b=g[d];d++){if(b._countedByPrototype){c.push(b)}}e.unmark(f);return c},findElement:function(c,d,b){if(Object.isNumber(d)){b=d;d=false}return Selector.matchElements(c,d||"*")[b||0]},findChildElements:function(f,k){k=Selector.split(k.join(","));var e=[],g=Selector.handlers;for(var d=0,c=k.length,b;d<c;d++){b=new Selector(k[d].strip());g.concat(e,b.findElements(f))}return(c>1)?g.unique(e):e}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(d,c){for(var e=0,f;f=c[e];e++){if(f.tagName!=="!"){d.push(f)}}return d}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(b){b=$(b);b.reset();return b},serializeElements:function(h,c){if(typeof c!="object"){c={hash:!!c}}else{if(Object.isUndefined(c.hash)){c.hash=true}}var d,g,b=false,f=c.submit;var e=h.inject({},function(k,l){if(!l.disabled&&l.name){d=l.name;g=$(l).getValue();if(g!=null&&l.type!="file"&&(l.type!="submit"||(!b&&f!==false&&(!f||d==f)&&(b=true)))){if(d in k){if(!Object.isArray(k[d])){k[d]=[k[d]]}k[d].push(g)}else{k[d]=g}}}return k});return c.hash?e:Object.toQueryString(e)}};Form.Methods={serialize:function(c,b){return Form.serializeElements(Form.getElements(c),b)},getElements:function(f){var g=$(f).getElementsByTagName("*"),e,b=[],d=Form.Element.Serializers;for(var c=0;e=g[c];c++){b.push(e)}return b.inject([],function(h,k){if(d[k.tagName.toLowerCase()]){h.push(Element.extend(k))}return h})},getInputs:function(h,d,e){h=$(h);var b=h.getElementsByTagName("input");if(!d&&!e){return $A(b).map(Element.extend)}for(var f=0,k=[],g=b.length;f<g;f++){var c=b[f];if((d&&c.type!=d)||(e&&c.name!=e)){continue}k.push(Element.extend(c))}return k},disable:function(b){b=$(b);Form.getElements(b).invoke("disable");return b},enable:function(b){b=$(b);Form.getElements(b).invoke("enable");return b},findFirstElement:function(c){var d=$(c).getElements().findAll(function(e){return"hidden"!=e.type&&!e.disabled});var b=d.findAll(function(e){return e.hasAttribute("tabIndex")&&e.tabIndex>=0}).sortBy(function(e){return e.tabIndex}).first();return b?b:d.find(function(e){return/^(?:input|select|textarea)$/i.test(e.tagName)})},focusFirstElement:function(b){b=$(b);b.findFirstElement().activate();return b},request:function(c,b){c=$(c),b=Object.clone(b||{});var e=b.parameters,d=c.readAttribute("action")||"";if(d.blank()){d=window.location.href}b.parameters=c.serialize(true);if(e){if(Object.isString(e)){e=e.toQueryParams()}Object.extend(b.parameters,e)}if(c.hasAttribute("method")&&!b.method){b.method=c.method}return new Ajax.Request(d,b)}};Form.Element={focus:function(b){$(b).focus();return b},select:function(b){$(b).select();return b}};Form.Element.Methods={serialize:function(b){b=$(b);if(!b.disabled&&b.name){var c=b.getValue();if(c!=undefined){var d={};d[b.name]=c;return Object.toQueryString(d)}}return""},getValue:function(b){b=$(b);var c=b.tagName.toLowerCase();return Form.Element.Serializers[c](b)},setValue:function(b,c){b=$(b);var d=b.tagName.toLowerCase();Form.Element.Serializers[d](b,c);return b},clear:function(b){$(b).value="";return b},present:function(b){return $(b).value!=""},activate:function(b){b=$(b);try{b.focus();if(b.select&&(b.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(b.type)))){b.select()}}catch(c){}return b},disable:function(b){b=$(b);b.disabled=true;return b},enable:function(b){b=$(b);b.disabled=false;return b}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(b,c){switch(b.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(b,c);default:return Form.Element.Serializers.textarea(b,c)}},inputSelector:function(b,c){if(Object.isUndefined(c)){return b.checked?b.value:null}else{b.checked=!!c}},textarea:function(b,c){if(Object.isUndefined(c)){return b.value}else{b.value=c}},select:function(d,g){if(Object.isUndefined(g)){return this[d.type=="select-one"?"selectOne":"selectMany"](d)}else{var c,e,h=!Object.isArray(g);for(var b=0,f=d.length;b<f;b++){c=d.options[b];e=this.optionValue(c);if(h){if(e==g){c.selected=true;return}}else{c.selected=g.include(e)}}}},selectOne:function(c){var b=c.selectedIndex;return b>=0?this.optionValue(c.options[b]):null},selectMany:function(e){var b,f=e.length;if(!f){return null}for(var d=0,b=[];d<f;d++){var c=e.options[d];if(c.selected){b.push(this.optionValue(c))}}return b},optionValue:function(b){return Element.extend(b).hasAttribute("value")?b.value:b.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,d){$super(d,c);this.element=$(b);this.lastValue=this.getValue()},execute:function(){var b=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(b)?this.lastValue!=b:String(this.lastValue)!=String(b)){this.callback(this.element,b);this.lastValue=b}}});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(b,c){this.element=$(b);this.callback=c;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var b=this.getValue();if(this.lastValue!=b){this.callback(this.element,b);this.lastValue=b}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(b){if(b.type){switch(b.type.toLowerCase()){case"checkbox":case"radio":Event.observe(b,"click",this.onElementEvent.bind(this));break;default:Event.observe(b,"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 y={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var f=document.documentElement;var z="onmouseenter" in f&&"onmouseleave" in f;var r;if(Prototype.Browser.IE){var k={0:1,1:4,2:2};r=function(B,A){return B.button===k[A]}}else{if(Prototype.Browser.WebKit){r=function(B,A){switch(A){case 0:return B.which==1&&!B.metaKey;case 1:return B.which==1&&B.metaKey;default:return false}}}else{r=function(B,A){return B.which?(B.which===A+1):(B.button===A)}}}function u(A){return r(A,0)}function t(A){return r(A,1)}function n(A){return r(A,2)}function d(C){C=y.extend(C);var B=C.target,A=C.type,D=C.currentTarget;if(D&&D.tagName){if(A==="load"||A==="error"||(A==="click"&&D.tagName.toLowerCase()==="input"&&D.type==="radio")){B=D}}if(B.nodeType==Node.TEXT_NODE){B=B.parentNode}return Element.extend(B)}function p(B,D){var A=y.element(B);if(!D){return A}var C=[A].concat(A.ancestors());return Selector.findElement(C,D,0)}function s(A){return{x:c(A),y:b(A)}}function c(C){var B=document.documentElement,A=document.body||{scrollLeft:0};return C.pageX||(C.clientX+(B.scrollLeft||A.scrollLeft)-(B.clientLeft||0))}function b(C){var B=document.documentElement,A=document.body||{scrollTop:0};return C.pageY||(C.clientY+(B.scrollTop||A.scrollTop)-(B.clientTop||0))}function q(A){y.extend(A);A.preventDefault();A.stopPropagation();A.stopped=true}y.Methods={isLeftClick:u,isMiddleClick:t,isRightClick:n,element:d,findElement:p,pointer:s,pointerX:c,pointerY:b,stop:q};var w=Object.keys(y.Methods).inject({},function(A,B){A[B]=y.Methods[B].methodize();return A});if(Prototype.Browser.IE){function h(B){var A;switch(B.type){case"mouseover":A=B.fromElement;break;case"mouseout":A=B.toElement;break;default:return null}return Element.extend(A)}Object.extend(w,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});y.extend=function(B,A){if(!B){return false}if(B._extendedByPrototype){return B}B._extendedByPrototype=Prototype.emptyFunction;var C=y.pointer(B);Object.extend(B,{target:B.srcElement||A,relatedTarget:h(B),pageX:C.x,pageY:C.y});return Object.extend(B,w)}}else{y.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(y.prototype,w);y.extend=Prototype.K}function o(E,D,F){var C=Element.retrieve(E,"prototype_event_registry");if(Object.isUndefined(C)){e.push(E);C=Element.retrieve(E,"prototype_event_registry",$H())}var A=C.get(D);if(Object.isUndefined(A)){A=[];C.set(D,A)}if(A.pluck("handler").include(F)){return false}var B;if(D.include(":")){B=function(G){if(Object.isUndefined(G.eventName)){return false}if(G.eventName!==D){return false}y.extend(G,E);F.call(E,G)}}else{if(!z&&(D==="mouseenter"||D==="mouseleave")){if(D==="mouseenter"||D==="mouseleave"){B=function(H){y.extend(H,E);var G=H.relatedTarget;while(G&&G!==E){try{G=G.parentNode}catch(I){G=E}}if(G===E){return}F.call(E,H)}}}else{B=function(G){y.extend(G,E);F.call(E,G)}}}B.handler=F;A.push(B);return B}function g(){for(var A=0,B=e.length;A<B;A++){y.stopObserving(e[A]);e[A]=null}}var e=[];if(Prototype.Browser.IE){window.attachEvent("onunload",g)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var m=Prototype.K;if(!z){m=function(B){var A={mouseenter:"mouseover",mouseleave:"mouseout"};return B in A?A[B]:B}}function v(D,C,E){D=$(D);var B=o(D,C,E);if(!B){return D}if(C.include(":")){if(D.addEventListener){D.addEventListener("dataavailable",B,false)}else{D.attachEvent("ondataavailable",B);D.attachEvent("onfilterchange",B)}}else{var A=m(C);if(D.addEventListener){D.addEventListener(A,B,false)}else{D.attachEvent("on"+A,B)}}return D}function l(F,D,G){F=$(F);var C=Element.retrieve(F,"prototype_event_registry");if(Object.isUndefined(C)){return F}if(D&&!G){var E=C.get(D);if(Object.isUndefined(E)){return F}E.each(function(H){Element.stopObserving(F,D,H.handler)});return F}else{if(!D){C.each(function(J){var H=J.key,I=J.value;I.each(function(K){Element.stopObserving(F,H,K.handler)})});return F}}var E=C.get(D);if(!E){return}var B=E.find(function(H){return H.handler===G});if(!B){return F}var A=m(D);if(D.include(":")){if(F.removeEventListener){F.removeEventListener("dataavailable",B,false)}else{F.detachEvent("ondataavailable",B);F.detachEvent("onfilterchange",B)}}else{if(F.removeEventListener){F.removeEventListener(A,B,false)}else{F.detachEvent("on"+A,B)}}C.set(D,E.without(B));return F}function x(D,C,B,A){D=$(D);if(Object.isUndefined(A)){A=true}if(D==document&&document.createEvent&&!D.dispatchEvent){D=document.documentElement}var E;if(document.createEvent){E=document.createEvent("HTMLEvents");E.initEvent("dataavailable",true,true)}else{E=document.createEventObject();E.eventType=A?"ondataavailable":"onfilterchange"}E.eventName=C;E.memo=B||{};if(document.createEvent){D.dispatchEvent(E)}else{D.fireEvent(E.eventType,E)}return y.extend(E)}Object.extend(y,y.Methods);Object.extend(y,{fire:x,observe:v,stopObserving:l});Element.addMethods({fire:x,observe:v,stopObserving:l});Object.extend(document,{fire:x.methodize(),observe:v.methodize(),stopObserving:l.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,y)}else{window.Event=y}})();(function(){var e;function b(){if(document.loaded){return}if(e){window.clearTimeout(e)}document.loaded=true;document.fire("dom:loaded")}function d(){if(document.readyState==="complete"){document.stopObserving("readystatechange",d);b()}}function c(){try{document.documentElement.doScroll("left")}catch(f){e=c.defer();return}b()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",b,false)}else{document.observe("readystatechange",d);if(window==top){e=c.defer()}}Event.observe(window,"load",b)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(b,c){return Element.insert(b,{before:c})},Top:function(b,c){return Element.insert(b,{top:c})},Bottom:function(b,c){return Element.insert(b,{bottom:c})},After:function(b,c){return Element.insert(b,{after:c})}};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(c,b,d){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(c,b,d)}this.xcomp=b;this.ycomp=d;this.offset=Element.cumulativeOffset(c);return(d>=this.offset[1]&&d<this.offset[1]+c.offsetHeight&&b>=this.offset[0]&&b<this.offset[0]+c.offsetWidth)},withinIncludingScrolloffsets:function(c,b,e){var d=Element.cumulativeScrollOffset(c);this.xcomp=b+d[0]-this.deltaX;this.ycomp=e+d[1]-this.deltaY;this.offset=Element.cumulativeOffset(c);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+c.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+c.offsetWidth)},overlap:function(c,b){if(!c){return 0}if(c=="vertical"){return((this.offset[1]+b.offsetHeight)-this.ycomp)/b.offsetHeight}if(c=="horizontal"){return((this.offset[0]+b.offsetWidth)-this.xcomp)/b.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(b){Position.prepare();return Element.absolutize(b)},relativize:function(b){Position.prepare();return Element.relativize(b)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(c,d,b){b=b||{};return Element.clonePosition(d,c,b)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(c){function b(d){return d.blank()?null:"[contains(concat(' ', @class, ' '), ' "+d+" ')]"}c.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(d,f){f=f.toString().strip();var e=/\s/.test(f)?$w(f).map(b).join(""):b(f);return e?document._getElementsByXPath(".//*"+e,d):[]}:function(f,g){g=g.toString().strip();var h=[],k=(/\s/.test(g)?$w(g):null);if(!k&&!g){return h}var d=$(f).getElementsByTagName("*");g=" "+g+" ";for(var e=0,m,l;m=d[e];e++){if(m.className&&(l=" "+m.className+" ")&&(l.include(g)||(k&&k.all(function(n){return !n.toString().blank()&&l.include(" "+n+" ")})))){h.push(Element.extend(m))}}return h};return function(e,d){return $(d||document.body).getElementsByClassName(e)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(b){this.element=$(b)},_each:function(b){this.element.className.split(/\s+/).select(function(c){return c.length>0})._each(b)},set:function(b){this.element.className=b},add:function(b){if(this.include(b)){return}this.set($A(this).concat(b).join(" "))},remove:function(b){if(!this.include(b)){return}this.set($A(this).without(b).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);Object.extend(Element,{getWidth:function(b){b=$(b);return b.offsetWidth},setWidth:function(c,b){c=$(c);c.style.width=b+"px"},setHeight:function(b,c){b=$(b);b.style.height=c+"px"},setTop:function(c,b){c=$(c);c.style.top=b+"px"},setLeft:function(c,b){c=$(c);c.style.left=b+"px"},setSrc:function(b,c){b=$(b);b.src=c},setHref:function(c,b){c=$(c);c.href=b},setInnerHTML:function(b,c){b=$(b);b.innerHTML=c},toggleSlide:function(b){b=$(b);if(b.visible()){new Effect.BlindUp(b)}else{new Effect.BlindDown(b)}}});Array.prototype.removeDuplicates=function(){for(i=0;i<this.length;i++){for(j=this.length-1;j>i;j--){if(this[i][0]==this[j][0]){this.splice(j,1)}}}};Array.prototype.empty=function(){for(i=0;i<=this.length;i++){this.shift()}};Ajax.Queue=Class.create({initialize:function(){this.requests=new Array();this.currentRequest=0},add:function(c,b,d){this.requests.push({name:c,url:b,parameters:d})},start:function(){if(this.currentRequest<this.requests.length){var c=this.requests[this.currentRequest];var b={method:"post",parameters:c.parameters,onSuccess:function(d){this.currentRequest++;this.start()}.bind(this)};new Ajax.Request(c.url,b);Progress.setText(c.name);Progress.setStatus(Math.floor(100*(this.currentRequest/this.requests.length)))}else{Progress.setStatus(100);this.onComplete()}},onComplete:function(){}});String.prototype.parseColor=function(){var b="#";if(this.slice(0,4)=="rgb("){var d=this.slice(4,this.length-1).split(",");var c=0;do{b+=parseInt(d[c]).toColorPart()}while(++c<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var c=1;c<4;c++){b+=(this.charAt(c)+this.charAt(c)).toLowerCase()}}if(this.length==7){b=this.toLowerCase()}}}return(b.length==7?b:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:(c.hasChildNodes()?Element.collectTextNodes(c):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(b,c){return $A($(b).childNodes).collect(function(d){return(d.nodeType==3?d.nodeValue:((d.hasChildNodes()&&!Element.hasClassName(d,c))?Element.collectTextNodesIgnoreClass(d,c):""))}).flatten().join("")};Element.setContentZoom=function(b,c){b=$(b);b.setStyle({fontSize:(c/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return b};Element.getInlineOpacity=function(b){return $(b).style.opacity||""};Element.forceRerendering=function(b){try{b=$(b);var d=document.createTextNode(" ");b.appendChild(d);b.removeChild(d)}catch(c){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(b){return(-Math.cos(b*Math.PI)/2)+0.5},reverse:function(b){return 1-b},flicker:function(b){var b=((-Math.cos(b*Math.PI)/4)+0.75)+Math.random()/4;return b>1?1:b},wobble:function(b){return(-Math.cos(b*Math.PI*(9*b))/2)+0.5},pulse:function(c,b){b=b||5;return(((c%(1/b))*b).round()==0?((c*b*2)-(c*b*2).floor()):1-((c*b*2)-(c*b*2).floor()))},spring:function(b){return 1-(Math.cos(b*4.5*Math.PI)*Math.exp(-b*6))},none:function(b){return 0},full:function(b){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(b){var c="position:relative";if(Prototype.Browser.IE){c+=";zoom:1"}b=$(b);$A(b.childNodes).each(function(d){if(d.nodeType==3){d.nodeValue.toArray().each(function(e){b.insertBefore(new Element("span",{style:c}).update(e==" "?String.fromCharCode(160):e),d)});Element.remove(d)}})},multiple:function(c,d){var f;if(((typeof c=="object")||Object.isFunction(c))&&(c.length)){f=c}else{f=$(c).childNodes}var b=Object.extend({speed:0.1,delay:0},arguments[2]||{});var e=b.delay;$A(f).each(function(h,g){new d(h,Object.extend(b,{delay:g*b.speed+e}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(c,d){c=$(c);d=(d||"appear").toLowerCase();var b=Object.extend({queue:{position:"end",scope:(c.id||"global"),limit:1}},arguments[2]||{});Effect[c.visible()?Effect.PAIRS[d][1]:Effect.PAIRS[d][0]](c,b)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(b){this.effects._each(b)},add:function(c){var d=new Date().getTime();var b=Object.isString(c.options.queue)?c.options.queue:c.options.queue.position;switch(b){case"front":this.effects.findAll(function(f){return f.state=="idle"}).each(function(f){f.startOn+=c.finishOn;f.finishOn+=c.finishOn});break;case"with-last":d=this.effects.pluck("startOn").max()||d;break;case"end":d=this.effects.pluck("finishOn").max()||d;break}c.startOn+=d;c.finishOn+=d;if(!c.options.queue.limit||(this.effects.length<c.options.queue.limit)){this.effects.push(c)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(b){this.effects=this.effects.reject(function(c){return c==b});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var d=new Date().getTime();for(var c=0,b=this.effects.length;c<b;c++){this.effects[c]&&this.effects[c].loop(d)}}});Effect.Queues={instances:$H(),get:function(b){if(!Object.isString(b)){return b}return this.instances.get(b)||this.instances.set(b,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(options){function codeForEvent(options,eventName){return((options[eventName+"Internal"]?"this.options."+eventName+"Internal(this);":"")+(options[eventName]?"this.options."+eventName+"(this);":""))}if(options&&options.transition===false){options.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),options||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,"beforeSetup")+(this.setup?"this.setup();":"")+codeForEvent(this.options,"afterSetup")+'};if (this.state=="running"){pos=this.options.transition(pos)*'+this.fromToDelta+"+"+this.options.from+";this.position=pos;"+codeForEvent(this.options,"beforeUpdate")+(this.update?"this.update(pos);":"")+codeForEvent(this.options,"afterUpdate")+"}}");this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)}},loop:function(d){if(d>=this.startOn){if(d>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var c=(d-this.startOn)/this.totalTime,b=(c*this.totalFrames).round();if(b>this.currentFrame){this.render(c);this.currentFrame=b}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(b){if(this.options[b+"Internal"]){this.options[b+"Internal"](this)}if(this.options[b]){this.options[b](this)}},inspect:function(){var b=$H();for(property in this){if(!Object.isFunction(this[property])){b.set(property,this[property])}}return"#<Effect:"+b.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(b){this.effects=b||[];this.start(arguments[1])},update:function(b){this.effects.invoke("render",b)},finish:function(b){this.effects.each(function(c){c.render(1);c.cancel();c.event("beforeFinish");if(c.finish){c.finish(b)}c.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(d,g,f){d=Object.isString(d)?$(d):d;var c=$A(arguments),e=c.last(),b=c.length==5?c[3]:null;this.method=Object.isFunction(e)?e.bind(d):Object.isFunction(d[e])?d[e].bind(d):function(h){d[e]=h};this.start(Object.extend({from:g,to:f},b||{}))},update:function(b){this.method(b)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var b=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(b)},update:function(b){this.element.setOpacity(b)}});Effect.Move=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(b){this.element.setStyle({left:(this.options.x*b+this.originalLeft).round()+"px",top:(this.options.y*b+this.originalTop).round()+"px"})}});Effect.MoveBy=function(c,b,d){return new Effect.Move(c,Object.extend({x:d,y:b},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(c,d){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:d},arguments[2]||{});this.start(b)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(c){this.originalStyle[c]=this.element.style[c]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(c){if(b.indexOf(c)>0){this.fontSize=parseFloat(b);this.fontSizeType=c}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(b){var c=(this.options.scaleFrom/100)+(this.factor*b);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*c+this.fontSizeType})}this.setDimensions(this.dims[0]*c,this.dims[1]*c)},finish:function(b){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(b,f){var g={};if(this.options.scaleX){g.width=f.round()+"px"}if(this.options.scaleY){g.height=b.round()+"px"}if(this.options.scaleFromCenter){var e=(b-this.dims[0])/2;var c=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-e+"px"}if(this.options.scaleX){g.left=this.originalLeft-c+"px"}}else{if(this.options.scaleY){g.top=-e+"px"}if(this.options.scaleX){g.left=-c+"px"}}}this.element.setStyle(g)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(b){return parseInt(this.options.startcolor.slice(b*2+1,b*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(b){return parseInt(this.options.endcolor.slice(b*2+1,b*2+3),16)-this._base[b]}.bind(this))},update:function(b){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(c,d,e){return c+((this._base[e]+(this._delta[e]*b)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(e){var d=arguments[1]||{},c=document.viewport.getScrollOffsets(),f=$(e).cumulativeOffset(),b=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(d.offset){f[1]+=d.offset}return new Effect.Tween(null,c.top,f[1]>b?b:f[1],d,function(g){scrollTo(c.left,g.round())})};Effect.Fade=function(d){d=$(d);var b=d.getInlineOpacity();var c=Object.extend({from:d.getOpacity()||1,to:0,afterFinishInternal:function(e){if(e.options.to!=0){return}e.element.hide().setStyle({opacity:b})}},arguments[1]||{});return new Effect.Opacity(d,c)};Effect.Appear=function(c){c=$(c);var b=Object.extend({from:(c.getStyle("display")=="none"?0:c.getOpacity()||0),to:1,afterFinishInternal:function(d){d.element.forceRerendering()},beforeSetup:function(d){d.element.setOpacity(d.options.from).show()}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Puff=function(c){c=$(c);var b={opacity:c.getInlineOpacity(),position:c.getStyle("position"),top:c.style.top,left:c.style.left,width:c.style.width,height:c.style.height};return new Effect.Parallel([new Effect.Scale(c,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(c,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(d){Position.absolutize(d.effects[0].element)},afterFinishInternal:function(d){d.effects[0].element.hide().setStyle(b)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(c){c.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(c){c=$(c);var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(d){d.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(c){c=$(c);var b=c.getInlineOpacity();return new Effect.Appear(c,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(d){new Effect.Scale(d.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(e){e.element.makePositioned().makeClipping()},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned().setStyle({opacity:b})}})}},arguments[1]||{}))};Effect.DropOut=function(c){c=$(c);var b={top:c.getStyle("top"),left:c.getStyle("left"),opacity:c.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(c,{x:0,y:100,sync:true}),new Effect.Opacity(c,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(d){d.effects[0].element.makePositioned()},afterFinishInternal:function(d){d.effects[0].element.hide().undoPositioned().setStyle(b)}},arguments[1]||{}))};Effect.Shake=function(e){e=$(e);var c=Object.extend({distance:20,duration:0.5},arguments[1]||{});var f=parseFloat(c.distance);var d=parseFloat(c.duration)/10;var b={top:e.getStyle("top"),left:e.getStyle("left")};return new Effect.Move(e,{x:f,y:0,duration:d,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:d*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:f*2,y:0,duration:d*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:-f*2,y:0,duration:d*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:f*2,y:0,duration:d*2,afterFinishInternal:function(m){new Effect.Move(m.element,{x:-f,y:0,duration:d,afterFinishInternal:function(n){n.element.undoPositioned().setStyle(b)}})}})}})}})}})}})};Effect.SlideDown=function(d){d=$(d).cleanWhitespace();var b=d.down().getStyle("bottom");var c=d.getDimensions();return new Effect.Scale(d,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makePositioned();e.element.down().makePositioned();if(window.opera){e.element.setStyle({top:""})}e.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:(e.dims[0]-e.element.clientHeight)+"px"})},afterFinishInternal:function(e){e.element.undoClipping().undoPositioned();e.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.SlideUp=function(d){d=$(d).cleanWhitespace();var b=d.down().getStyle("bottom");var c=d.getDimensions();return new Effect.Scale(d,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(e){e.element.makePositioned();e.element.down().makePositioned();if(window.opera){e.element.setStyle({top:""})}e.element.makeClipping().show()},afterUpdateInternal:function(e){e.element.down().setStyle({bottom:(e.dims[0]-e.element.clientHeight)+"px"})},afterFinishInternal:function(e){e.element.hide().undoClipping().undoPositioned();e.element.down().undoPositioned().setStyle({bottom:b})}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(c){c.element.makeClipping()},afterFinishInternal:function(c){c.element.hide().undoClipping()}})};Effect.Grow=function(d){d=$(d);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var b={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};var h=d.getDimensions();var k,g;var f,e;switch(c.direction){case"top-left":k=g=f=e=0;break;case"top-right":k=h.width;g=e=0;f=-h.width;break;case"bottom-left":k=f=0;g=h.height;e=-h.height;break;case"bottom-right":k=h.width;g=h.height;f=-h.width;e=-h.height;break;case"center":k=h.width/2;g=h.height/2;f=-h.width/2;e=-h.height/2;break}return new Effect.Move(d,{x:k,y:g,duration:0.01,beforeSetup:function(l){l.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(l){new Effect.Parallel([new Effect.Opacity(l.element,{sync:true,to:1,from:0,transition:c.opacityTransition}),new Effect.Move(l.element,{x:f,y:e,sync:true,transition:c.moveTransition}),new Effect.Scale(l.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:c.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(m){m.effects[0].element.setStyle({height:"0px"}).show()},afterFinishInternal:function(m){m.effects[0].element.undoClipping().undoPositioned().setStyle(b)}},c))}})};Effect.Shrink=function(d){d=$(d);var c=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var b={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};var g=d.getDimensions();var f,e;switch(c.direction){case"top-left":f=e=0;break;case"top-right":f=g.width;e=0;break;case"bottom-left":f=0;e=g.height;break;case"bottom-right":f=g.width;e=g.height;break;case"center":f=g.width/2;e=g.height/2;break}return new Effect.Parallel([new Effect.Opacity(d,{sync:true,to:0,from:1,transition:c.opacityTransition}),new Effect.Scale(d,window.opera?1:0,{sync:true,transition:c.scaleTransition,restoreAfterFinish:true}),new Effect.Move(d,{x:f,y:e,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(h){h.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(h){h.effects[0].element.hide().undoClipping().undoPositioned().setStyle(b)}},c))};Effect.Pulsate=function(d){d=$(d);var c=arguments[1]||{};var b=d.getInlineOpacity();var f=c.transition||Effect.Transitions.sinoidal;var e=function(g){return f(1-Effect.Transitions.pulse(g,c.pulses))};e.bind(f);return new Effect.Opacity(d,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:b})}},c),{transition:e}))};Effect.Fold=function(c){c=$(c);var b={top:c.style.top,left:c.style.left,width:c.style.width,height:c.style.height};c.makeClipping();return new Effect.Scale(c,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(d){new Effect.Scale(c,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(e){e.element.hide().undoClipping().setStyle(b)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var b=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(b.style)){this.style=$H(b.style)}else{if(b.style.include(":")){this.style=b.style.parseStyle()}else{this.element.addClassName(b.style);this.style=$H(this.element.getStyles());this.element.removeClassName(b.style);var c=this.element.getStyles();this.style=this.style.reject(function(e){return e.value==c[e.key]});b.afterFinishInternal=function(e){e.element.addClassName(e.options.style);e.transforms.each(function(f){e.element.style[f.style]=""})}}}this.start(b)},setup:function(){function b(c){if(!c||["rgba(0, 0, 0, 0)","transparent"].include(c)){c="#ffffff"}c=c.parseColor();return $R(0,2).map(function(d){return parseInt(c.slice(d*2+1,d*2+3),16)})}this.transforms=this.style.map(function(h){var g=h[0],f=h[1],e=null;if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();e="color"}else{if(g=="opacity"){f=parseFloat(f);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(f)){var d=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);f=parseFloat(d[1]);e=(d.length==3)?d[2]:null}}}var c=this.element.getStyle(g);return{style:g.camelize(),originalValue:e=="color"?b(c):parseFloat(c||0),targetValue:e=="color"?b(f):f,unit:e}}.bind(this)).reject(function(c){return((c.originalValue==c.targetValue)||(c.unit!="color"&&(isNaN(c.originalValue)||isNaN(c.targetValue))))})},update:function(b){var e={},c,d=this.transforms.length;while(d--){e[(c=this.transforms[d]).style]=c.unit=="color"?"#"+(Math.round(c.originalValue[0]+(c.targetValue[0]-c.originalValue[0])*b)).toColorPart()+(Math.round(c.originalValue[1]+(c.targetValue[1]-c.originalValue[1])*b)).toColorPart()+(Math.round(c.originalValue[2]+(c.targetValue[2]-c.originalValue[2])*b)).toColorPart():(c.originalValue+(c.targetValue-c.originalValue)*b).toFixed(3)+(c.unit===null?"":c.unit)}this.element.setStyle(e,true)}});Effect.Transform=Class.create({initialize:function(b){this.tracks=[];this.options=arguments[1]||{};this.addTracks(b)},addTracks:function(b){b.each(function(c){c=$H(c);var d=c.values().first();this.tracks.push($H({ids:c.keys().first(),effect:Effect.Morph,options:{style:d}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(b){var e=b.get("ids"),d=b.get("effect"),c=b.get("options");var f=[$(e)||$$(e)].flatten();return f.map(function(g){return new d(g,Object.extend({sync:true},c))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var c,b=$H();if(Prototype.Browser.WebKit){c=new Element("div",{style:this}).style}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';c=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(d){if(c[d]){b.set(d,c[d])}});if(Prototype.Browser.IE&&this.include("opacity")){b.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return b};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(c){var b=document.defaultView.getComputedStyle($(c),null);return Element.CSS_PROPERTIES.inject({},function(d,e){d[e]=b[e];return d})}}else{Element.getStyles=function(c){c=$(c);var b=c.currentStyle,d;d=Element.CSS_PROPERTIES.inject({},function(e,f){e[f]=b[f];return e});if(!d.opacity){d.opacity=c.getOpacity()}return d}}Effect.Methods={morph:function(b,c){b=$(b);new Effect.Morph(b,Object.extend({style:c},arguments[2]||{}));return b},visualEffect:function(d,f,c){d=$(d);var e=f.dasherize().camelize(),b=e.charAt(0).toUpperCase()+e.substring(1);new Effect[b](d,c);return d},highlight:function(c,b){c=$(c);new Effect.Highlight(c,b);return c}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(b){Effect.Methods[b]=function(d,c){d=$(d);Effect[b.charAt(0).toUpperCase()+b.substring(1)](d,c);return d}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(b){Effect.Methods[b]=Element[b]});Element.addMethods(Effect.Methods);if(typeof Effect=="undefined"){throw ("controls.js requires including script.aculo.us' effects.js library")}var Autocompleter={};Autocompleter.Base=Class.create({baseInitialize:function(c,d,b){c=$(c);this.element=c;this.update=$(d);this.hasFocus=false;this.changed=false;this.active=false;this.index=0;this.entryCount=0;this.oldElementValue=this.element.value;if(this.setOptions){this.setOptions(b)}else{this.options=b||{}}this.options.paramName=this.options.paramName||this.element.name;this.options.tokens=this.options.tokens||[];this.options.frequency=this.options.frequency||0.4;this.options.minChars=this.options.minChars||1;this.options.onShow=this.options.onShow||function(e,f){if(!f.style.position||f.style.position=="absolute"){f.style.position="absolute";Position.clone(e,f,{setHeight:false,offsetTop:e.offsetHeight})}Effect.Appear(f,{duration:0.15})};this.options.onHide=this.options.onHide||function(e,f){new Effect.Fade(f,{duration:0.15})};if(typeof(this.options.tokens)=="string"){this.options.tokens=new Array(this.options.tokens)}if(!this.options.tokens.include("\n")){this.options.tokens.push("\n")}this.observer=null;this.element.setAttribute("autocomplete","off");Element.hide(this.update);Event.observe(this.element,"blur",this.onBlur.bindAsEventListener(this));Event.observe(this.element,"keydown",this.onKeyPress.bindAsEventListener(this))},show:function(){if(Element.getStyle(this.update,"display")=="none"){this.options.onShow(this.element,this.update)}if(!this.iefix&&(Prototype.Browser.IE)&&(Element.getStyle(this.update,"position")=="absolute")){new Insertion.After(this.update,'<iframe id="'+this.update.id+'_iefix" style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" src="javascript:false;" frameborder="0" scrolling="no"></iframe>');this.iefix=$(this.update.id+"_iefix")}if(this.iefix){setTimeout(this.fixIEOverlapping.bind(this),50)}},fixIEOverlapping:function(){Position.clone(this.update,this.iefix,{setTop:(!this.update.style.height)});this.iefix.style.zIndex=1;this.update.style.zIndex=2;Element.show(this.iefix)},hide:function(){this.stopIndicator();if(Element.getStyle(this.update,"display")!="none"){this.options.onHide(this.element,this.update)}if(this.iefix){Element.hide(this.iefix)}},startIndicator:function(){if(this.options.indicator){Element.show(this.options.indicator)}},stopIndicator:function(){if(this.options.indicator){Element.hide(this.options.indicator)}},onKeyPress:function(b){if(this.active){switch(b.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(b);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(b);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(b);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(b);return}}else{if(b.keyCode==Event.KEY_TAB||b.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&b.keyCode==0)){return}}this.changed=true;this.hasFocus=true;if(this.observer){clearTimeout(this.observer)}this.observer=setTimeout(this.onObserverEvent.bind(this),this.options.frequency*1000)},activate:function(){this.changed=false;this.hasFocus=true;this.getUpdatedChoices()},onHover:function(c){var b=Event.findElement(c,"LI");if(this.index!=b.autocompleteIndex){this.index=b.autocompleteIndex;this.render()}Event.stop(c)},onClick:function(c){var b=Event.findElement(c,"LI");this.index=b.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(b){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var b=0;b<this.entryCount;b++){this.index==b?Element.addClassName(this.getEntry(b),"selected"):Element.removeClassName(this.getEntry(b),"selected")}if(this.hasFocus){this.show();this.active=true}}else{this.active=false;this.hide()}},markPrevious:function(){if(this.index>0){this.index--}else{this.index=this.entryCount-1}this.getEntry(this.index).scrollIntoView(true)},markNext:function(){if(this.index<this.entryCount-1){this.index++}else{this.index=0}this.getEntry(this.index).scrollIntoView(false)},getEntry:function(b){return this.update.firstChild.childNodes[b]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(g){if(this.options.updateElement){this.options.updateElement(g);return}var e="";if(this.options.select){var b=$(g).select("."+this.options.select)||[];if(b.length>0){e=Element.collectTextNodes(b[0],this.options.select)}}else{e=Element.collectTextNodesIgnoreClass(g,"informal")}var d=this.getTokenBounds();if(d[0]!=-1){var f=this.element.value.substr(0,d[0]);var c=this.element.value.substr(d[0]).match(/^\s+/);if(c){f+=c[0]}this.element.value=f+e+this.element.value.substr(d[1])}else{this.element.value=e}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,g)}},updateChoices:function(d){if(!this.changed&&this.hasFocus){this.update.innerHTML=d;Element.cleanWhitespace(this.update);Element.cleanWhitespace(this.update.down());if(this.update.firstChild&&this.update.down().childNodes){this.entryCount=this.update.down().childNodes.length;for(var b=0;b<this.entryCount;b++){var c=this.getEntry(b);c.autocompleteIndex=b;this.addObservers(c)}}else{this.entryCount=0}this.stopIndicator();this.index=0;if(this.entryCount==1&&this.options.autoSelect){this.selectEntry();this.hide()}else{this.render()}}},addObservers:function(b){Event.observe(b,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(b,"click",this.onClick.bindAsEventListener(this))},onObserverEvent:function(){this.changed=false;this.tokenBounds=null;if(this.getToken().length>=this.options.minChars){this.getUpdatedChoices()}else{this.active=false;this.hide()}this.oldElementValue=this.element.value},getToken:function(){var b=this.getTokenBounds();return this.element.value.substring(b[0],b[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var f=this.element.value;if(f.strip().empty()){return[-1,0]}var g=arguments.callee.getFirstDifferencePos(f,this.oldElementValue);var k=(g==this.oldElementValue.length?1:0);var e=-1,d=f.length;var h;for(var c=0,b=this.options.tokens.length;c<b;++c){h=f.lastIndexOf(this.options.tokens[c],g+k-1);if(h>e){e=h}h=f.indexOf(this.options.tokens[c],g+k);if(-1!=h&&h<d){d=h}}return(this.tokenBounds=[e+1,d])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(d,b){var e=Math.min(d.length,b.length);for(var c=0;c<e;++c){if(d[c]!=b[c]){return c}}return e};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(d,e,c,b){this.baseInitialize(d,e,b);this.options.asynchronous=true;this.options.onComplete=this.onComplete.bind(this);this.options.defaultParams=this.options.parameters||null;this.url=c},getUpdatedChoices:function(){this.startIndicator();var b=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,b):b;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(b){this.updateChoices(b.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(c,e,d,b){this.baseInitialize(c,e,b);this.options.array=d},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(b){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(c){var e=[];var d=[];var k=c.getToken();var h=0;for(var f=0;f<c.options.array.length&&e.length<c.options.choices;f++){var g=c.options.array[f];var l=c.options.ignoreCase?g.toLowerCase().indexOf(k.toLowerCase()):g.indexOf(k);while(l!=-1){if(l==0&&g.length!=k.length){e.push("<li><strong>"+g.substr(0,k.length)+"</strong>"+g.substr(k.length)+"</li>");break}else{if(k.length>=c.options.partialChars&&c.options.partialSearch&&l!=-1){if(c.options.fullSearch||/\s/.test(g.substr(l-1,1))){d.push("<li>"+g.substr(0,l)+"<strong>"+g.substr(l,k.length)+"</strong>"+g.substr(l+k.length)+"</li>");break}}}l=c.options.ignoreCase?g.toLowerCase().indexOf(k.toLowerCase(),l+1):g.indexOf(k,l+1)}}if(d.length){e=e.concat(d.slice(0,c.options.choices-e.length))}return"<ul>"+e.join("")+"</ul>"}},b||{})}});Field.scrollFreeActivate=function(b){setTimeout(function(){Field.activate(b)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(d,c,b){this.url=c;this.element=d=$(d);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(b);Object.extend(this.options,b||{});if(!this.options.formId&&this.element.id){this.options.formId=this.element.id+"-inplaceeditor";if($(this.options.formId)){this.options.formId=""}}if(this.options.externalControl){this.options.externalControl=$(this.options.externalControl)}if(!this.options.externalControl){this.options.externalControlOnly=false}this._originalBackground=this.element.getStyle("background-color")||"transparent";this.element.title=this.options.clickToEditText;this._boundCancelHandler=this.handleFormCancellation.bind(this);this._boundComplete=(this.options.onComplete||Prototype.emptyFunction).bind(this);this._boundFailureHandler=this.handleAJAXFailure.bind(this);this._boundSubmitHandler=this.handleFormSubmission.bind(this);this._boundWrapperHandler=this.wrapUp.bind(this);this.registerListeners()},checkForEscapeOrReturn:function(b){if(!this._editing||b.ctrlKey||b.altKey||b.shiftKey){return}if(Event.KEY_ESC==b.keyCode){this.handleFormCancellation(b)}else{if(Event.KEY_RETURN==b.keyCode){this.handleFormSubmission(b)}}},createControl:function(h,d,c){var f=this.options[h+"Control"];var g=this.options[h+"Text"];if("button"==f){var b=document.createElement("input");b.type="submit";b.value=g;b.className="editor_"+h+"_button";if("cancel"==h){b.onclick=this._boundCancelHandler}this._form.appendChild(b);this._controls[h]=b}else{if("link"==f){var e=document.createElement("a");e.href="#";e.appendChild(document.createTextNode(g));e.onclick="cancel"==h?this._boundCancelHandler:this._boundSubmitHandler;e.className="editor_"+h+"_link";if(c){e.className+=" "+c}this._form.appendChild(e);this._controls[h]=e}}},createEditField:function(){var d=(this.options.loadTextURL?this.options.loadingText:this.getText());var c;if(1>=this.options.rows&&!/\r|\n/.test(this.getText())){c=document.createElement("input");c.type="text";var b=this.options.size||this.options.cols||0;if(0<b){c.size=b}}else{c=document.createElement("textarea");c.rows=(1>=this.options.rows?this.options.autoRows:this.options.rows);c.cols=this.options.cols||40}c.name=this.options.paramName;c.value=d;c.className="editor_field";if(this.options.submitOnBlur){c.onblur=this._boundSubmitHandler}this._controls.editor=c;if(this.options.loadTextURL){this.loadExternalText()}this._form.appendChild(this._controls.editor)},createForm:function(){var c=this;function b(e,f){var d=c.options["text"+e+"Controls"];if(!d||f===false){return}c._form.appendChild(document.createTextNode(d))}this._form=$(document.createElement("form"));this._form.id=this.options.formId;this._form.addClassName(this.options.formClassName);this._form.onsubmit=this._boundSubmitHandler;this.createEditField();if("textarea"==this._controls.editor.tagName.toLowerCase()){this._form.appendChild(document.createElement("br"))}if(this.options.onFormCustomization){this.options.onFormCustomization(this,this._form)}b("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);b("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");b("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(b){if(this._saving||this._editing){return}this._editing=true;this.triggerCallback("onEnterEditMode");if(this.options.externalControl){this.options.externalControl.hide()}this.element.hide();this.createForm();this.element.parentNode.insertBefore(this._form,this.element);if(!this.options.loadTextURL){this.postProcessEditField()}if(b){Event.stop(b)}},enterHover:function(b){if(this.options.hoverClassName){this.element.addClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onEnterHover")},getText:function(){return this.element.innerHTML},handleAJAXFailure:function(b){this.triggerCallback("onFailure",b);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(b){this.wrapUp();if(b){Event.stop(b)}},handleFormSubmission:function(f){var c=this._form;var d=$F(this._controls.editor);this.prepareSubmission();var g=this.options.callback(c,d)||"";if(Object.isString(g)){g=g.toQueryParams()}g.editorId=this.element.id;if(this.options.htmlResponse){var b=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(b,{parameters:g,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,b)}else{var b=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(b,{parameters:g,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,b)}if(f){Event.stop(f)}},leaveEditMode:function(){this.element.removeClassName(this.options.savingClassName);this.removeForm();this.leaveHover();this.element.style.backgroundColor=this._originalBackground;this.element.show();if(this.options.externalControl){this.options.externalControl.show()}this._saving=false;this._editing=false;this._oldInnerHTML=null;this.triggerCallback("onLeaveEditMode")},leaveHover:function(b){if(this.options.hoverClassName){this.element.removeClassName(this.options.hoverClassName)}if(this._saving){return}this.triggerCallback("onLeaveHover")},loadExternalText:function(){this._form.addClassName(this.options.loadingClassName);this._controls.editor.disabled=true;var b=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(b,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(d){this._form.removeClassName(this.options.loadingClassName);var c=d.responseText;if(this.options.stripLoadedTextTags){c=c.stripTags()}this._controls.editor.value=c;this._controls.editor.disabled=false;this.postProcessEditField()}.bind(this),onFailure:this._boundFailureHandler});new Ajax.Request(this.options.loadTextURL,b)},postProcessEditField:function(){var b=this.options.fieldPostCreation;if(b){$(this._controls.editor)["focus"==b?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(b){Object.extend(this.options,b)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var b;$H(Ajax.InPlaceEditor.Listeners).each(function(c){b=this[c.value].bind(this);this._listeners[c.key]=b;if(!this.options.externalControlOnly){this.element.observe(c.key,b)}if(this.options.externalControl){this.options.externalControl.observe(c.key,b)}}.bind(this))},removeForm:function(){if(!this._form){return}this._form.remove();this._form=null;this._controls={}},showSaving:function(){this._oldInnerHTML=this.element.innerHTML;this.element.innerHTML=this.options.savingText;this.element.addClassName(this.options.savingClassName);this.element.style.backgroundColor=this._originalBackground;this.element.show()},triggerCallback:function(c,b){if("function"==typeof this.options[c]){this.options[c](this,b)}},unregisterListeners:function(){$H(this._listeners).each(function(b){if(!this.options.externalControlOnly){this.element.stopObserving(b.key,b.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(b.key,b.value)}}.bind(this))},wrapUp:function(b){this.leaveEditMode();this._boundComplete(b,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,d,c,b){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(d,c,b)},createEditField:function(){var b=document.createElement("select");b.name=this.options.paramName;b.size=1;this._controls.editor=b;this._collection=this.options.collection||[];if(this.options.loadCollectionURL){this.loadCollection()}else{this.checkForExternalText()}this._form.appendChild(this._controls.editor)},loadCollection:function(){this._form.addClassName(this.options.loadingClassName);this.showLoadingText(this.options.loadingCollectionText);var options=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(options,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(transport){var js=transport.responseText.strip();if(!/^\[.*\]$/.test(js)){throw"Server returned an invalid collection representation."}this._collection=eval(js);this.checkForExternalText()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadCollectionURL,options)},showLoadingText:function(c){this._controls.editor.disabled=true;var b=this._controls.editor.firstChild;if(!b){b=document.createElement("option");b.value="";this._controls.editor.appendChild(b);b.selected=true}b.update((c||"").stripScripts().stripTags())},checkForExternalText:function(){this._text=this.getText();if(this.options.loadTextURL){this.loadExternalText()}else{this.buildOptionList()}},loadExternalText:function(){this.showLoadingText(this.options.loadingText);var b=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(b,{parameters:"editorId="+encodeURIComponent(this.element.id),onComplete:Prototype.emptyFunction,onSuccess:function(c){this._text=c.responseText.strip();this.buildOptionList()}.bind(this),onFailure:this.onFailure});new Ajax.Request(this.options.loadTextURL,b)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(e){return 2===e.length?e:[e,e].flatten()});var c=("value" in this.options)?this.options.value:this._text;var b=this._collection.any(function(e){return e[0]==c}.bind(this));this._controls.editor.update("");var d;this._collection.each(function(f,e){d=document.createElement("option");d.value=f[0];d.selected=b?f[0]==c:0==e;d.appendChild(document.createTextNode(f[1]));this._controls.editor.appendChild(d)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(b){if(!b){return}function c(d,e){if(d in b||e===undefined){return}b[d]=e}c("cancelControl",(b.cancelLink?"link":(b.cancelButton?"button":b.cancelLink==b.cancelButton==false?false:undefined)));c("okControl",(b.okLink?"link":(b.okButton?"button":b.okLink==b.okButton==false?false:undefined)));c("highlightColor",b.highlightcolor);c("highlightEndColor",b.highlightendcolor)};Object.extend(Ajax.InPlaceEditor,{DefaultOptions:{ajaxOptions:{},autoRows:3,cancelControl:"link",cancelText:"cancel",clickToEditText:"Click to edit",externalControl:null,externalControlOnly:false,fieldPostCreation:"activate",formClassName:"inplaceeditor-form",formId:null,highlightColor:"#ffff99",highlightEndColor:"#ffffff",hoverClassName:"",htmlResponse:true,loadingClassName:"inplaceeditor-loading",loadingText:"Loading...",okControl:"button",okText:"ok",paramName:"value",rows:1,savingClassName:"inplaceeditor-saving",savingText:"Saving...",size:0,stripLoadedTextTags:false,submitOnBlur:false,textAfterControls:"",textBeforeControls:"",textBetweenControls:""},DefaultCallbacks:{callback:function(b){return Form.serialize(b)},onComplete:function(c,b){new Effect.Highlight(b,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(b){b.element.style.backgroundColor=b.options.highlightColor;if(b._effect){b._effect.cancel()}},onFailure:function(c,b){alert("Error communication with the server: "+c.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(b){b._effect=new Effect.Highlight(b.element,{startcolor:b.options.highlightColor,endcolor:b.options.highlightEndColor,restorecolor:b._originalBackground,keepBackgroundImage:true})}},Listeners:{click:"enterEditMode",keydown:"checkForEscapeOrReturn",mouseover:"enterHover",mouseout:"leaveHover"}});Ajax.InPlaceCollectionEditor.DefaultOptions={loadingCollectionText:"Loading options..."};Form.Element.DelayedObserver=Class.create({initialize:function(c,b,d){this.delay=b||0.5;this.element=$(c);this.callback=d;this.timer=null;this.lastValue=$F(this.element);Event.observe(this.element,"keyup",this.delayedListener.bindAsEventListener(this))},delayedListener:function(b){if(this.lastValue==$F(this.element)){return}if(this.timer){clearTimeout(this.timer)}this.timer=setTimeout(this.onTimerEvent.bind(this),this.delay*1000);this.lastValue=$F(this.element)},onTimerEvent:function(){this.timer=null;this.callback(this.element,$F(this.element))}});if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(b){this.drops=this.drops.reject(function(c){return c.element==$(b)})},add:function(c){c=$(c);var b=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(b.containment){b._containers=[];var d=b.containment;if(Object.isArray(d)){d.each(function(e){b._containers.push($(e))})}else{b._containers.push($(d))}}if(b.accept){b.accept=[b.accept].flatten()}Element.makePositioned(c);b.element=c;this.drops.push(b)},findDeepestChild:function(b){deepest=b[0];for(i=1;i<b.length;++i){if(Element.isParent(b[i].element,deepest.element)){deepest=b[i]}}return deepest},isContained:function(c,b){var d;if(b.tree){d=c.treeNode}else{d=c.parentNode}return b._containers.detect(function(e){return d==e})},isAffected:function(b,d,c){return((c.element!=d)&&((!c._containers)||this.isContained(d,c))&&((!c.accept)||(Element.classNames(d).detect(function(e){return c.accept.include(e)})))&&Position.within(c.element,b[0],b[1]))},deactivate:function(b){if(b.hoverclass){Element.removeClassName(b.element,b.hoverclass)}this.last_active=null},activate:function(b){if(b.hoverclass){Element.addClassName(b.element,b.hoverclass)}this.last_active=b},show:function(b,d){if(!this.drops.length){return}var c,e=[];this.drops.each(function(f){if(Droppables.isAffected(b,d,f)){e.push(f)}});if(e.length>0){c=Droppables.findDeepestChild(e)}if(this.last_active&&this.last_active!=c){this.deactivate(this.last_active)}if(c){Position.within(c.element,b[0],b[1]);if(c.onHover){c.onHover(d,c.element,Position.overlap(c.overlap,c.element))}if(c!=this.last_active){Droppables.activate(c)}}},fire:function(c,b){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(c),Event.pointerY(c)],b,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(b,this.last_active.element,c);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(b){if(this.drags.length==0){this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.updateDrag.bindAsEventListener(this);this.eventKeypress=this.keyPress.bindAsEventListener(this);Event.observe(document,"mouseup",this.eventMouseUp);Event.observe(document,"mousemove",this.eventMouseMove);Event.observe(document,"keypress",this.eventKeypress)}this.drags.push(b)},unregister:function(b){this.drags=this.drags.reject(function(c){return c==b});if(this.drags.length==0){Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);Event.stopObserving(document,"keypress",this.eventKeypress)}},activate:function(b){if(b.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=b}.bind(this),b.options.delay)}else{window.focus();this.activeDraggable=b}},deactivate:function(){this.activeDraggable=null},updateDrag:function(b){if(!this.activeDraggable){return}var c=[Event.pointerX(b),Event.pointerY(b)];if(this._lastPointer&&(this._lastPointer.inspect()==c.inspect())){return}this._lastPointer=c;this.activeDraggable.updateDrag(b,c)},endDrag:function(b){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(b);this.activeDraggable=null},keyPress:function(b){if(this.activeDraggable){this.activeDraggable.keyPress(b)}},addObserver:function(b){this.observers.push(b);this._cacheObserverCallbacks()},removeObserver:function(b){this.observers=this.observers.reject(function(c){return c.element==b});this._cacheObserverCallbacks()},notify:function(c,b,d){if(this[c+"Count"]>0){this.observers.each(function(e){if(e[c]){e[c](c,b,d)}})}if(b.options[c]){b.options[c](b,d)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(b){Draggables[b+"Count"]=Draggables.observers.select(function(c){return c[b]}).length})}};var Draggable=Class.create({initialize:function(c){var d={handle:false,reverteffect:function(g,f,e){var h=Math.sqrt(Math.abs(f^2)+Math.abs(e^2))*0.02;new Effect.Move(g,{x:-e,y:-f,duration:h,queue:{scope:"_draggable",position:"end"}})},endeffect:function(f){var e=Object.isNumber(f._opacity)?f._opacity:1;new Effect.Opacity(f,{duration:0.2,from:0.7,to:e,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[f]=false}})},zindex:1000,revert:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,snap:false,delay:0};if(!arguments[1]||Object.isUndefined(arguments[1].endeffect)){Object.extend(d,{starteffect:function(e){e._opacity=Element.getOpacity(e);Draggable._dragging[e]=true;new Effect.Opacity(e,{duration:0.2,from:e._opacity,to:0.7})}})}var b=Object.extend(d,arguments[1]||{});this.element=$(c);if(b.handle&&Object.isString(b.handle)){this.handle=this.element.down("."+b.handle,0)}if(!this.handle){this.handle=$(b.handle)}if(!this.handle){this.handle=this.element}if(b.scroll&&!b.scroll.scrollTo&&!b.scroll.outerHTML){b.scroll=$(b.scroll);this._isScrollChild=Element.childOf(this.element,b.scroll)}Element.makePositioned(this.element);this.options=b;this.dragging=false;this.eventMouseDown=this.initDrag.bindAsEventListener(this);Event.observe(this.handle,"mousedown",this.eventMouseDown);Draggables.register(this)},destroy:function(){Event.stopObserving(this.handle,"mousedown",this.eventMouseDown);Draggables.unregister(this)},currentDelta:function(){return([parseInt(Element.getStyle(this.element,"left")||"0"),parseInt(Element.getStyle(this.element,"top")||"0")])},initDrag:function(b){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(b)){var d=Event.element(b);if((tag_name=d.tagName.toUpperCase())&&(tag_name=="INPUT"||tag_name=="SELECT"||tag_name=="OPTION"||tag_name=="BUTTON"||tag_name=="TEXTAREA")){return}var c=[Event.pointerX(b),Event.pointerY(b)];var e=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(f){return(c[f]-e[f])});Draggables.activate(this);Event.stop(b)}},startDrag:function(c){this.dragging=true;if(!this.delta){this.delta=this.currentDelta()}if(this.options.zindex){this.originalZ=parseInt(Element.getStyle(this.element,"z-index")||0);this.element.style.zIndex=this.options.zindex}if(this.options.ghosting){this._clone=this.element.cloneNode(true);this.element._originallyAbsolute=(this.element.getStyle("position")=="absolute");if(!this.element._originallyAbsolute){Position.absolutize(this.element)}this.element.parentNode.insertBefore(this._clone,this.element)}if(this.options.scroll){if(this.options.scroll==window){var b=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=b.left;this.originalScrollTop=b.top}else{this.originalScrollLeft=this.options.scroll.scrollLeft;this.originalScrollTop=this.options.scroll.scrollTop}}Draggables.notify("onStart",this,c);if(this.options.starteffect){this.options.starteffect(this.element)}},updateDrag:function(event,pointer){if(!this.dragging){this.startDrag(event)}if(!this.options.quiet){Position.prepare();Droppables.show(pointer,this.element)}Draggables.notify("onDrag",this,event);this.draw(pointer);if(this.options.change){this.options.change(this)}if(this.options.scroll){this.stopScrolling();var p;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){p=[left,top,left+width,top+height]}}else{p=Position.page(this.options.scroll);p[0]+=this.options.scroll.scrollLeft+Position.deltaX;p[1]+=this.options.scroll.scrollTop+Position.deltaY;p.push(p[0]+this.options.scroll.offsetWidth);p.push(p[1]+this.options.scroll.offsetHeight)}var speed=[0,0];if(pointer[0]<(p[0]+this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[0]+this.options.scrollSensitivity)}if(pointer[1]<(p[1]+this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[1]+this.options.scrollSensitivity)}if(pointer[0]>(p[2]-this.options.scrollSensitivity)){speed[0]=pointer[0]-(p[2]-this.options.scrollSensitivity)}if(pointer[1]>(p[3]-this.options.scrollSensitivity)){speed[1]=pointer[1]-(p[3]-this.options.scrollSensitivity)}this.startScrolling(speed)}if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(event)},finishDrag:function(c,g){this.dragging=false;if(this.options.quiet){Position.prepare();var f=[Event.pointerX(c),Event.pointerY(c)];Droppables.show(f,this.element)}if(this.options.ghosting){if(!this.element._originallyAbsolute){Position.relativize(this.element)}delete this.element._originallyAbsolute;Element.remove(this._clone);this._clone=null}var h=false;if(g){h=Droppables.fire(c,this.element);if(!h){h=false}}if(h&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,c);var b=this.options.revert;if(b&&Object.isFunction(b)){b=b(this.element)}var e=this.currentDelta();if(b&&this.options.reverteffect){if(h==0||b!="failure"){this.options.reverteffect(this.element,e[1]-this.delta[1],e[0]-this.delta[0])}}else{this.delta=e}if(this.options.zindex){this.element.style.zIndex=this.originalZ}if(this.options.endeffect){this.options.endeffect(this.element)}Draggables.deactivate(this);Droppables.reset()},keyPress:function(b){if(b.keyCode!=Event.KEY_ESC){return}this.finishDrag(b,false);Event.stop(b)},endDrag:function(b){if(!this.dragging){return}this.stopScrolling();this.finishDrag(b,true);Event.stop(b)},draw:function(b){var h=Position.cumulativeOffset(this.element);if(this.options.ghosting){var e=Position.realOffset(this.element);h[0]+=e[0]-Position.deltaX;h[1]+=e[1]-Position.deltaY}var g=this.currentDelta();h[0]-=g[0];h[1]-=g[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){h[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;h[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var f=[0,1].map(function(d){return(b[d]-h[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){f=this.options.snap(f[0],f[1],this)}else{if(Object.isArray(this.options.snap)){f=f.map(function(d,k){return(d/this.options.snap[k]).round()*this.options.snap[k]}.bind(this))}else{f=f.map(function(d){return(d/this.options.snap).round()*this.options.snap}.bind(this))}}}var c=this.element.style;if((!this.options.constraint)||(this.options.constraint=="horizontal")){c.left=f[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){c.top=f[1]+"px"}if(c.visibility=="hidden"){c.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(b){if(!(b[0]||b[1])){return}this.scrollSpeed=[b[0]*this.options.scrollSpeed,b[1]*this.options.scrollSpeed];this.lastScrolled=new Date();this.scrollInterval=setInterval(this.scroll.bind(this),10)},scroll:function(){var current=new Date();var delta=current-this.lastScrolled;this.lastScrolled=current;if(this.options.scroll==window){with(this._getWindowScroll(this.options.scroll)){if(this.scrollSpeed[0]||this.scrollSpeed[1]){var d=delta/1000;this.options.scroll.scrollTo(left+d*this.scrollSpeed[0],top+d*this.scrollSpeed[1])}}}else{this.options.scroll.scrollLeft+=this.scrollSpeed[0]*delta/1000;this.options.scroll.scrollTop+=this.scrollSpeed[1]*delta/1000}Position.prepare();Droppables.show(Draggables._lastPointer,this.element);Draggables.notify("onDrag",this);if(this._isScrollChild){Draggables._lastScrollPointer=Draggables._lastScrollPointer||$A(Draggables._lastPointer);Draggables._lastScrollPointer[0]+=this.scrollSpeed[0]*delta/1000;Draggables._lastScrollPointer[1]+=this.scrollSpeed[1]*delta/1000;if(Draggables._lastScrollPointer[0]<0){Draggables._lastScrollPointer[0]=0}if(Draggables._lastScrollPointer[1]<0){Draggables._lastScrollPointer[1]=0}this.draw(Draggables._lastScrollPointer)}if(this.options.change){this.options.change(this)}},_getWindowScroll:function(w){var T,L,W,H;with(w.document){if(w.document.documentElement&&documentElement.scrollTop){T=documentElement.scrollTop;L=documentElement.scrollLeft}else{if(w.document.body){T=body.scrollTop;L=body.scrollLeft}}if(w.innerWidth){W=w.innerWidth;H=w.innerHeight}else{if(w.document.documentElement&&documentElement.clientWidth){W=documentElement.clientWidth;H=documentElement.clientHeight}else{W=body.offsetWidth;H=body.offsetHeight}}}return{top:T,left:L,width:W,height:H}}});Draggable._dragging={};var SortableObserver=Class.create({initialize:function(c,b){this.element=$(c);this.observer=b;this.lastValue=Sortable.serialize(this.element)},onStart:function(){this.lastValue=Sortable.serialize(this.element)},onEnd:function(){Sortable.unmark();if(this.lastValue!=Sortable.serialize(this.element)){this.observer(this.element)}}});var Sortable={SERIALIZE_RULE:/^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,sortables:{},_findRootElement:function(b){while(b.tagName.toUpperCase()!="BODY"){if(b.id&&Sortable.sortables[b.id]){return b}b=b.parentNode}},options:function(b){b=Sortable._findRootElement($(b));if(!b){return}return Sortable.sortables[b.id]},destroy:function(b){var c=Sortable.options(b);if(c){Draggables.removeObserver(c.element);c.droppables.each(function(e){Droppables.remove(e)});c.draggables.invoke("destroy");delete Sortable.sortables[c.element.id]}},create:function(d){d=$(d);var c=Object.extend({element:d,tag:"li",dropOnEmpty:false,tree:false,treeTag:"ul",overlap:"vertical",constraint:"vertical",containment:d,handle:false,only:false,delay:0,hoverclass:null,ghosting:false,quiet:false,scroll:false,scrollSensitivity:20,scrollSpeed:15,format:this.SERIALIZE_RULE,elements:false,handles:false,onChange:Prototype.emptyFunction,onUpdate:Prototype.emptyFunction},arguments[1]||{});this.destroy(d);var b={revert:true,quiet:c.quiet,scroll:c.scroll,scrollSpeed:c.scrollSpeed,scrollSensitivity:c.scrollSensitivity,delay:c.delay,ghosting:c.ghosting,constraint:c.constraint,handle:c.handle};if(c.starteffect){b.starteffect=c.starteffect}if(c.reverteffect){b.reverteffect=c.reverteffect}else{if(c.ghosting){b.reverteffect=function(g){g.style.top=0;g.style.left=0}}}if(c.endeffect){b.endeffect=c.endeffect}if(c.zindex){b.zindex=c.zindex}var e={overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass,onHover:Sortable.onHover};var f={onHover:Sortable.onEmptyHover,overlap:c.overlap,containment:c.containment,hoverclass:c.hoverclass};Element.cleanWhitespace(d);c.draggables=[];c.droppables=[];if(c.dropOnEmpty||c.tree){Droppables.add(d,f);c.droppables.push(d)}(c.elements||this.findElements(d,c)||[]).each(function(k,g){var h=c.handles?$(c.handles[g]):(c.handle?$(k).select("."+c.handle)[0]:k);c.draggables.push(new Draggable(k,Object.extend(b,{handle:h})));Droppables.add(k,e);if(c.tree){k.treeNode=d}c.droppables.push(k)});if(c.tree){(Sortable.findTreeElements(d,c)||[]).each(function(g){Droppables.add(g,f);g.treeNode=d;c.droppables.push(g)})}this.sortables[d.id]=c;Draggables.addObserver(new SortableObserver(d,c.onUpdate))},findElements:function(c,b){return Element.findChildren(c,b.only,b.tree?true:false,b.tag)},findTreeElements:function(c,b){return Element.findChildren(c,b.only,b.tree?true:false,b.treeTag)},onHover:function(f,e,b){if(Element.isParent(e,f)){return}if(b>0.33&&b<0.66&&Sortable.options(e).tree){return}else{if(b>0.5){Sortable.mark(e,"before");if(e.previousSibling!=f){var c=f.parentNode;f.style.visibility="hidden";e.parentNode.insertBefore(f,e);if(e.parentNode!=c){Sortable.options(c).onChange(f)}Sortable.options(e.parentNode).onChange(f)}}else{Sortable.mark(e,"after");var d=e.nextSibling||null;if(d!=f){var c=f.parentNode;f.style.visibility="hidden";e.parentNode.insertBefore(f,d);if(e.parentNode!=c){Sortable.options(c).onChange(f)}Sortable.options(e.parentNode).onChange(f)}}}},onEmptyHover:function(f,h,k){var l=f.parentNode;var b=Sortable.options(h);if(!Element.isParent(h,f)){var g;var d=Sortable.findElements(h,{tag:b.tag,only:b.only});var c=null;if(d){var e=Element.offsetSize(h,b.overlap)*(1-k);for(g=0;g<d.length;g+=1){if(e-Element.offsetSize(d[g],b.overlap)>=0){e-=Element.offsetSize(d[g],b.overlap)}else{if(e-(Element.offsetSize(d[g],b.overlap)/2)>=0){c=g+1<d.length?d[g+1]:null;break}else{c=d[g];break}}}}h.insertBefore(f,c);Sortable.options(l).onChange(f);b.onChange(f)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(c,b){var e=Sortable.options(c.parentNode);if(e&&!e.ghosting){return}if(!Sortable._marker){Sortable._marker=($("dropmarker")||Element.extend(document.createElement("DIV"))).hide().addClassName("dropmarker").setStyle({position:"absolute"});document.getElementsByTagName("body").item(0).appendChild(Sortable._marker)}var d=Position.cumulativeOffset(c);Sortable._marker.setStyle({left:d[0]+"px",top:d[1]+"px"});if(b=="after"){if(e.overlap=="horizontal"){Sortable._marker.setStyle({left:(d[0]+c.clientWidth)+"px"})}else{Sortable._marker.setStyle({top:(d[1]+c.clientHeight)+"px"})}}Sortable._marker.show()},_tree:function(f,c,g){var e=Sortable.findElements(f,c)||[];for(var d=0;d<e.length;++d){var b=e[d].id.match(c.format);if(!b){continue}var h={id:encodeURIComponent(b?b[1]:null),element:f,parent:g,children:[],position:g.children.length,container:$(e[d]).down(c.treeTag)};if(h.container){this._tree(h.container,c,h)}g.children.push(h)}return g},tree:function(e){e=$(e);var d=this.options(e);var c=Object.extend({tag:d.tag,treeTag:d.treeTag,only:d.only,name:e.id,format:d.format},arguments[1]||{});var b={id:null,parent:null,children:[],container:e,position:0};return Sortable._tree(e,c,b)},_constructIndex:function(c){var b="";do{if(c.id){b="["+c.position+"]"+b}}while((c=c.parent)!=null);return b},sequence:function(c){c=$(c);var b=Object.extend(this.options(c),arguments[1]||{});return $(this.findElements(c,b)||[]).map(function(d){return d.id.match(b.format)?d.id.match(b.format)[1]:""})},setSequence:function(c,d){c=$(c);var b=Object.extend(this.options(c),arguments[2]||{});var e={};this.findElements(c,b).each(function(f){if(f.id.match(b.format)){e[f.id.match(b.format)[1]]=[f,f.parentNode]}f.parentNode.removeChild(f)});d.each(function(f){var g=e[f];if(g){g[1].appendChild(g[0]);delete e[f]}})},serialize:function(d){d=$(d);var c=Object.extend(Sortable.options(d),arguments[1]||{});var b=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:d.id);if(c.tree){return Sortable.tree(d,arguments[1]).children.map(function(e){return[b+Sortable._constructIndex(e)+"[id]="+encodeURIComponent(e.id)].concat(e.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(d,arguments[1]).map(function(e){return b+"[]="+encodeURIComponent(e)}).join("&")}}};Element.isParent=function(c,b){if(!c.parentNode||c==b){return false}if(c.parentNode==b){return true}return Element.isParent(c.parentNode,b)};Element.findChildren=function(e,c,b,d){if(!e.hasChildNodes()){return null}d=d.toUpperCase();if(c){c=[c].flatten()}var f=[];$A(e.childNodes).each(function(h){if(h.tagName&&h.tagName.toUpperCase()==d&&(!c||(Element.classNames(h).detect(function(k){return c.include(k)})))){f.push(h)}if(b){var g=Element.findChildren(h,c,b,d);if(g){f.push(g)}}});return(f.length>0?f.flatten():[])};Element.offsetSize=function(b,c){return b["offset"+((c=="vertical"||c=="height")?"Height":"Width")]};sprintfWrapper={init:function(){if(typeof arguments=="undefined"){return null}if(arguments.length<1){return null}if(typeof arguments[0]!="string"){return null}if(typeof RegExp=="undefined"){return null}var l=arguments[0];var d=new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g);var h=new Array();var n=new Array();var b=0;var k=0;var o=0;var e=0;var m="";var g=null;while(g=d.exec(l)){if(g[9]){b+=1}k=e;o=d.lastIndex-g[0].length;n[n.length]=l.substring(k,o);e=d.lastIndex;h[h.length]={match:g[0],left:g[3]?true:false,sign:g[4]||"",pad:g[5]||" ",min:g[6]||0,precision:g[8],code:g[9]||"%",negative:parseInt(arguments[b])<0?true:false,argument:String(arguments[b])}}n[n.length]=l.substring(e);if(h.length==0){return l}if((arguments.length-1)<b){return null}var c=null;var g=null;var f=null;for(f=0;f<h.length;f++){if(h[f].code=="%"){substitution="%"}else{if(h[f].code=="b"){h[f].argument=String(Math.abs(parseInt(h[f].argument)).toString(2));substitution=sprintfWrapper.convert(h[f],true)}else{if(h[f].code=="c"){h[f].argument=String(String.fromCharCode(parseInt(Math.abs(parseInt(h[f].argument)))));substitution=sprintfWrapper.convert(h[f],true)}else{if(h[f].code=="d"){h[f].argument=String(Math.abs(parseInt(h[f].argument)));substitution=sprintfWrapper.convert(h[f])}else{if(h[f].code=="f"){h[f].argument=String(Math.abs(parseFloat(h[f].argument)).toFixed(h[f].precision?h[f].precision:6));substitution=sprintfWrapper.convert(h[f])}else{if(h[f].code=="o"){h[f].argument=String(Math.abs(parseInt(h[f].argument)).toString(8));substitution=sprintfWrapper.convert(h[f])}else{if(h[f].code=="s"){h[f].argument=h[f].argument.substring(0,h[f].precision?h[f].precision:h[f].argument.length);substitution=sprintfWrapper.convert(h[f],true)}else{if(h[f].code=="x"){h[f].argument=String(Math.abs(parseInt(h[f].argument)).toString(16));substitution=sprintfWrapper.convert(h[f])}else{if(h[f].code=="X"){h[f].argument=String(Math.abs(parseInt(h[f].argument)).toString(16));substitution=sprintfWrapper.convert(h[f]).toUpperCase()}else{substitution=h[f].match}}}}}}}}}m+=n[f];m+=substitution}m+=n[f];return m},convert:function(c,e){if(e){c.sign=""}else{c.sign=c.negative?"-":c.sign}var b=c.min-c.argument.length+1-c.sign.length;var d=new Array(b<0?0:b).join(c.pad);if(!c.left){if(c.pad=="0"||e){return c.sign+d+c.argument}else{return d+c.sign+c.argument}}else{if(c.pad=="0"||e){return c.sign+c.argument+d.replace(/0/g," ")}else{return c.sign+c.argument+d}}}};sprintf=sprintfWrapper.init;var swfobject=function(){var aq="undefined",aD="object",ab="Shockwave Flash",X="ShockwaveFlash.ShockwaveFlash",aE="application/x-shockwave-flash",ac="SWFObjectExprInst",ax="onreadystatechange",af=window,aL=document,aB=navigator,aa=false,Z=[aN],aG=[],ag=[],al=[],aJ,ad,ap,at,ak=false,aU=false,aH,an,aI=true,ah=function(){var b=typeof aL.getElementById!=aq&&typeof aL.getElementsByTagName!=aq&&typeof aL.createElement!=aq,f=aB.userAgent.toLowerCase(),d=aB.platform.toLowerCase(),k=d?/win/.test(d):/win/.test(f),m=d?/mac/.test(d):/mac/.test(f),h=/webkit/.test(f)?parseFloat(f.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,e=!+"\v1",g=[0,0,0],n=null;if(typeof aB.plugins!=aq&&typeof aB.plugins[ab]==aD){n=aB.plugins[ab].description;if(n&&!(typeof aB.mimeTypes!=aq&&aB.mimeTypes[aE]&&!aB.mimeTypes[aE].enabledPlugin)){aa=true;e=false;n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");g[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);g[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);g[2]=/[a-zA-Z]/.test(n)?parseInt(n.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof af.ActiveXObject!=aq){try{var l=new ActiveXObject(X);if(l){n=l.GetVariable("$version");if(n){e=true;n=n.split(" ")[1].split(",");g=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}}catch(c){}}}return{w3:b,pv:g,wk:h,ie:e,win:k,mac:m}}(),aK=function(){if(!ah.w3){return}if((typeof aL.readyState!=aq&&aL.readyState=="complete")||(typeof aL.readyState==aq&&(aL.getElementsByTagName("body")[0]||aL.body))){aP()}if(!ak){if(typeof aL.addEventListener!=aq){aL.addEventListener("DOMContentLoaded",aP,false)}if(ah.ie&&ah.win){aL.attachEvent(ax,function(){if(aL.readyState=="complete"){aL.detachEvent(ax,arguments.callee);aP()}});if(af==top){(function(){if(ak){return}try{aL.documentElement.doScroll("left")}catch(b){setTimeout(arguments.callee,0);return}aP()})()}}if(ah.wk){(function(){if(ak){return}if(!/loaded|complete/.test(aL.readyState)){setTimeout(arguments.callee,0);return}aP()})()}aC(aP)}}();function aP(){if(ak){return}try{var c=aL.getElementsByTagName("body")[0].appendChild(ar("span"));c.parentNode.removeChild(c)}catch(b){return}ak=true;var e=Z.length;for(var d=0;d<e;d++){Z[d]()}}function aj(b){if(ak){b()}else{Z[Z.length]=b}}function aC(b){if(typeof af.addEventListener!=aq){af.addEventListener("load",b,false)}else{if(typeof aL.addEventListener!=aq){aL.addEventListener("load",b,false)}else{if(typeof af.attachEvent!=aq){aM(af,"onload",b)}else{if(typeof af.onload=="function"){var c=af.onload;af.onload=function(){c();b()}}else{af.onload=b}}}}}function aN(){if(aa){Y()}else{am()}}function Y(){var e=aL.getElementsByTagName("body")[0];var c=ar(aD);c.setAttribute("type",aE);var b=e.appendChild(c);if(b){var d=0;(function(){if(typeof b.GetVariable!=aq){var f=b.GetVariable("$version");if(f){f=f.split(" ")[1].split(",");ah.pv=[parseInt(f[0],10),parseInt(f[1],10),parseInt(f[2],10)]}}else{if(d<10){d++;setTimeout(arguments.callee,10);return}}e.removeChild(c);b=null;am()})()}else{am()}}function am(){var h=aG.length;if(h>0){for(var k=0;k<h;k++){var d=aG[k].id;var o=aG[k].callbackFn;var b={success:false,id:d};if(ah.pv[0]>0){var l=aS(d);if(l){if(ao(aG[k].swfVersion)&&!(ah.wk&&ah.wk<312)){ay(d,true);if(o){b.success=true;b.ref=av(d);o(b)}}else{if(aG[k].expressInstall&&au()){var f={};f.data=aG[k].expressInstall;f.width=l.getAttribute("width")||"0";f.height=l.getAttribute("height")||"0";if(l.getAttribute("class")){f.styleclass=l.getAttribute("class")}if(l.getAttribute("align")){f.align=l.getAttribute("align")}var g={};var e=l.getElementsByTagName("param");var n=e.length;for(var m=0;m<n;m++){if(e[m].getAttribute("name").toLowerCase()!="movie"){g[e[m].getAttribute("name")]=e[m].getAttribute("value")}}ae(f,g,d,o)}else{aF(l);if(o){o(b)}}}}}else{ay(d,true);if(o){var c=av(d);if(c&&typeof c.SetVariable!=aq){b.success=true;b.ref=c}o(b)}}}}}function av(c){var e=null;var d=aS(c);if(d&&d.nodeName=="OBJECT"){if(typeof d.SetVariable!=aq){e=d}else{var b=d.getElementsByTagName(aD)[0];if(b){e=b}}}return e}function au(){return !aU&&ao("6.0.65")&&(ah.win||ah.mac)&&!(ah.wk&&ah.wk<312)}function ae(g,e,k,f){aU=true;ap=f||null;at={success:false,id:k};var b=aS(k);if(b){if(b.nodeName=="OBJECT"){aJ=aO(b);ad=null}else{aJ=b;ad=k}g.id=ac;if(typeof g.width==aq||(!/%$/.test(g.width)&&parseInt(g.width,10)<310)){g.width="310"}if(typeof g.height==aq||(!/%$/.test(g.height)&&parseInt(g.height,10)<137)){g.height="137"}aL.title=aL.title.slice(0,47)+" - Flash Player Installation";var c=ah.ie&&ah.win?"ActiveX":"PlugIn",d="MMredirectURL="+af.location.toString().replace(/&/g,"%26")+"&MMplayerType="+c+"&MMdoctitle="+aL.title;if(typeof e.flashvars!=aq){e.flashvars+="&"+d}else{e.flashvars=d}if(ah.ie&&ah.win&&b.readyState!=4){var h=ar("div");k+="SWFObjectNew";h.setAttribute("id",k);b.parentNode.insertBefore(h,b);b.style.display="none";(function(){if(b.readyState==4){b.parentNode.removeChild(b)}else{setTimeout(arguments.callee,10)}})()}aA(g,e,k)}}function aF(b){if(ah.ie&&ah.win&&b.readyState!=4){var c=ar("div");b.parentNode.insertBefore(c,b);c.parentNode.replaceChild(aO(b),c);b.style.display="none";(function(){if(b.readyState==4){b.parentNode.removeChild(b)}else{setTimeout(arguments.callee,10)}})()}else{b.parentNode.replaceChild(aO(b),b)}}function aO(c){var e=ar("div");if(ah.win&&ah.ie){e.innerHTML=c.innerHTML}else{var f=c.getElementsByTagName(aD)[0];if(f){var b=f.childNodes;if(b){var g=b.length;for(var d=0;d<g;d++){if(!(b[d].nodeType==1&&b[d].nodeName=="PARAM")&&!(b[d].nodeType==8)){e.appendChild(b[d].cloneNode(true))}}}}}return e}function aA(f,h,d){var e,b=aS(d);if(ah.wk&&ah.wk<312){return e}if(b){if(typeof f.id==aq){f.id=d}if(ah.ie&&ah.win){var g="";for(var l in f){if(f[l]!=Object.prototype[l]){if(l.toLowerCase()=="data"){h.movie=f[l]}else{if(l.toLowerCase()=="styleclass"){g+=' class="'+f[l]+'"'}else{if(l.toLowerCase()!="classid"){g+=" "+l+'="'+f[l]+'"'}}}}}var k="";for(var m in h){if(h[m]!=Object.prototype[m]){k+='<param name="'+m+'" value="'+h[m]+'" />'}}b.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+g+">"+k+"</object>";ag[ag.length]=f.id;e=aS(f.id)}else{var c=ar(aD);c.setAttribute("type",aE);for(var n in f){if(f[n]!=Object.prototype[n]){if(n.toLowerCase()=="styleclass"){c.setAttribute("class",f[n])}else{if(n.toLowerCase()!="classid"){c.setAttribute(n,f[n])}}}}for(var o in h){if(h[o]!=Object.prototype[o]&&o.toLowerCase()!="movie"){aQ(c,o,h[o])}}b.parentNode.replaceChild(c,b);e=c}}return e}function aQ(c,e,d){var b=ar("param");b.setAttribute("name",e);b.setAttribute("value",d);c.appendChild(b)}function aw(b){var c=aS(b);if(c&&c.nodeName=="OBJECT"){if(ah.ie&&ah.win){c.style.display="none";(function(){if(c.readyState==4){aT(b)}else{setTimeout(arguments.callee,10)}})()}else{c.parentNode.removeChild(c)}}}function aT(b){var c=aS(b);if(c){for(var d in c){if(typeof c[d]=="function"){c[d]=null}}c.parentNode.removeChild(c)}}function aS(b){var d=null;try{d=aL.getElementById(b)}catch(c){}return d}function ar(b){return aL.createElement(b)}function aM(b,d,c){b.attachEvent(d,c);al[al.length]=[b,d,c]}function ao(b){var c=ah.pv,d=b.split(".");d[0]=parseInt(d[0],10);d[1]=parseInt(d[1],10)||0;d[2]=parseInt(d[2],10)||0;return(c[0]>d[0]||(c[0]==d[0]&&c[1]>d[1])||(c[0]==d[0]&&c[1]==d[1]&&c[2]>=d[2]))?true:false}function az(c,g,b,d){if(ah.ie&&ah.mac){return}var f=aL.getElementsByTagName("head")[0];if(!f){return}var h=(b&&typeof b=="string")?b:"screen";if(d){aH=null;an=null}if(!aH||an!=h){var e=ar("style");e.setAttribute("type","text/css");e.setAttribute("media",h);aH=f.appendChild(e);if(ah.ie&&ah.win&&typeof aL.styleSheets!=aq&&aL.styleSheets.length>0){aH=aL.styleSheets[aL.styleSheets.length-1]}an=h}if(ah.ie&&ah.win){if(aH&&typeof aH.addRule==aD){aH.addRule(c,g)}}else{if(aH&&typeof aL.createTextNode!=aq){aH.appendChild(aL.createTextNode(c+" {"+g+"}"))}}}function ay(b,d){if(!aI){return}var c=d?"visible":"hidden";if(ak&&aS(b)){aS(b).style.visibility=c}else{az("#"+b,"visibility:"+c)}}function ai(c){var b=/[\\\"<>\.;]/;var d=b.exec(c)!=null;return d&&typeof encodeURIComponent!=aq?encodeURIComponent(c):c}var aR=function(){if(ah.ie&&ah.win){window.attachEvent("onunload",function(){var b=al.length;for(var c=0;c<b;c++){al[c][0].detachEvent(al[c][1],al[c][2])}var e=ag.length;for(var d=0;d<e;d++){aw(ag[d])}for(var f in ah){ah[f]=null}ah=null;for(var g in swfobject){swfobject[g]=null}swfobject=null})}}();return{registerObject:function(b,f,d,c){if(ah.w3&&b&&f){var e={};e.id=b;e.swfVersion=f;e.expressInstall=d;e.callbackFn=c;aG[aG.length]=e;ay(b,false)}else{if(c){c({success:false,id:b})}}},getObjectById:function(b){if(ah.w3){return av(b)}},embedSWF:function(n,f,k,g,d,b,c,l,h,m){var e={success:false,id:f};if(ah.w3&&!(ah.wk&&ah.wk<312)&&n&&f&&k&&g&&d){ay(f,false);aj(function(){k+="";g+="";var t={};if(h&&typeof h===aD){for(var r in h){t[r]=h[r]}}t.data=n;t.width=k;t.height=g;var q={};if(l&&typeof l===aD){for(var s in l){q[s]=l[s]}}if(c&&typeof c===aD){for(var o in c){if(typeof q.flashvars!=aq){q.flashvars+="&"+o+"="+c[o]}else{q.flashvars=o+"="+c[o]}}}if(ao(d)){var p=aA(t,q,f);if(t.id==f){ay(f,true)}e.success=true;e.ref=p}else{if(b&&au()){t.data=b;ae(t,q,f,m);return}else{ay(f,true)}}if(m){m(e)}})}else{if(m){m(e)}}},switchOffAutoHideShow:function(){aI=false},ua:ah,getFlashPlayerVersion:function(){return{major:ah.pv[0],minor:ah.pv[1],release:ah.pv[2]}},hasFlashPlayerVersion:ao,createSWF:function(b,c,d){if(ah.w3){return aA(b,c,d)}else{return undefined}},showExpressInstall:function(c,b,e,d){if(ah.w3&&au()){ae(c,b,e,d)}},removeSWF:function(b){if(ah.w3){aw(b)}},createCSS:function(c,b,d,e){if(ah.w3){az(c,b,d,e)}},addDomLoadEvent:aj,addLoadEvent:aC,getQueryParamValue:function(c){var b=aL.location.search||aL.location.hash;if(b){if(/\?/.test(b)){b=b.split("?")[1]}if(c==null){return ai(b)}var d=b.split("&");for(var e=0;e<d.length;e++){if(d[e].substring(0,d[e].indexOf("="))==c){return ai(d[e].substring((d[e].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(aU){var b=aS(ac);if(b&&aJ){b.parentNode.replaceChild(aJ,b);if(ad){ay(ad,true);if(ah.ie&&ah.win){aJ.style.display="block"}}if(ap){ap(at)}}aU=false}}}}();var Bookmark=Class.create();Bookmark.prototype={action:null,deleteAction:null,element:null,eventMouseMove:null,initialize:function(d,c){this.setOptions(c);this.element=d;Element.extend(this.element);this.action=this.element.title;this.deleteAction=this.element.readAttribute("rel");new Draggable(d,{revert:false,onStart:function(f,g){this.hideDelete()}.bind(this),onEnd:function(f,h){var g={method:"get",parameters:"id="+this.element.id+"&x="+f.element.style.left+"&y="+f.element.style.top,onSuccess:function(k){}.bind(this)};new Ajax.Request(this.action,g)}.bind(this)});var e=new Element("div",{id:this.element.id+"Icon"});var b=new Element("a",{href:"#"}).update("");e.addClassName("bookmarkIcon");e.appendChild(b);this.element.parentNode.appendChild(e);Element.insert(this.element,{before:e});Element.hide(e);Event.observe(b,"click",function(f){this.doDelete(f)}.bind(this),false);this.element.title="";this.element.rel="";Event.observe(this.element,"mouseover",function(f){this.showDelete(f)}.bind(this),false);this.eventMouseMove=this.move.bindAsEventListener(this)},showDelete:function(c){this.element.addClassName("active");var e=Element.positionedOffset(this.element).left;var d=Element.positionedOffset(this.element).top;var b=Element.getDimensions(this.element).width;$(this.element.id+"Icon").setStyle({top:d+"px",left:(e+b-Element.getDimensions($(this.element.id+"Icon")).width)+"px"});$(this.element.id+"Icon").show();Event.observe(document,"mousemove",this.eventMouseMove,false)},hideDelete:function(b){this.element.removeClassName("active");$(this.element.id+"Icon").hide()},doDelete:function(){var b={method:"get",parameters:"id="+this.element.id,onSuccess:function(c){Event.stopObserving(document,"mousemove",this.eventMouseMove,false);$(this.element.id+"Icon").remove();this.element.remove()}.bind(this)};new Ajax.Request(this.deleteAction,b)},move:function(k){if($(this.element.id+"Icon").visible()){var h=Element.cumulativeOffset(this.element).left;var g=Element.cumulativeOffset(this.element).top;var f=Element.getDimensions(this.element).width;var b=Element.getDimensions(this.element).height;var d=Event.pointerX(k);var c=Event.pointerY(k);if(d<h||d>h+f||c<g||c>g+b){this.hideDelete();Event.stopObserving(document,"mousemove",this.eventMouseMove,false)}}},setOptions:function(b){this.options={};Object.extend(this.options,b||{})}};var Widgets=Class.create();Widgets.prototype={action:null,list:null,initialize:function(b){Element.extend(b);this.action=b.title;this.list=b;this.initItems(this.list);Sortable.create(this.list,{handle:"title",only:"moveable",onUpdate:function(){var c={method:"get",parameters:Sortable.serialize(this.list),onSuccess:function(d){this.showNumbers()}.bind(this)};new Ajax.Request(this.action,c)}.bind(this),onChange:function(c){}.bind(this)});this.list.title=""},initItems:function(d){for(var c=0;c<d.childNodes.length;c++){if(d.childNodes[c].tagName&&d.childNodes[c].tagName.toLowerCase()=="li"){var b=d.childNodes[c];Element.extend(b);b.id=this.list.id+"_"+b.id}}},dispose:function(){}};var Field=Class.create();Field.prototype={field:null,container:null,ispassword:false,mask:null,focusListener:null,blurListener:null,initialize:function(b){Element.extend(b);this.field=b;if(Element.readAttribute(this.field,"alt")){this.container=new Element("div",{"class":this.field.className});this.field.parentNode.insertBefore(this.container,this.field);this.container.appendChild(b);this.focusListener=this.activate.bindAsEventListener(this);this.blurListener=this.desactivate.bindAsEventListener(this);this.mask=new Element("input",{type:"text",value:Element.readAttribute(b,"alt"),"class":"empty"});this.field.parentNode.insertBefore(this.mask,this.field);if(this.field.value!=""){Element.hide(this.mask);Event.observe(this.field,"blur",this.blurListener)}else{Element.hide(this.field);Event.observe(this.mask,"focus",this.focusListener,false)}}},activate:function(b){Event.observe(this.field,"blur",this.blurListener);Event.stopObserving(this.field,"focus",this.focusListener,false);Element.show(this.field);Element.hide(this.mask);this.field.focus()},desactivate:function(b){if(this.field.value==""){Element.show(this.mask);Element.hide(this.field);Event.stopObserving(this.field,"blur",this.blurListener,false);Event.observe(this.mask,"focus",this.focusListener,false)}}};var check=Class.create();check.prototype={initialize:function(c){var d="";var b=c.style?c.style:document.defaultView.getComputedStyle(c,null);if(b){for(a in b){if(typeof b[a]!="function"){d+=a+"="+c.getStyle(a)+", "}}alert(d)}}};var SelectBox=Class.create();SelectBox.prototype={element:null,caption:null,elementId:null,list:null,rolloutHandler:null,initialize:function(c){this.elementId=c.id;this.element=new Element("div",{"class":"customSelect"});c.parentNode.insertBefore(this.element,c);this.caption=new Element("div",{"class":"caption"});this.caption.setAttribute("autocomplete","off");this.caption.setAttribute("readonly","readonly");this.element.appendChild(this.caption);this.list=new Element("div",{"class":"list"});this.element.setStyle({width:Math.max(c.getWidth()+25,50)+"px"});this.element.setStyle({height:c.down("li").getHeight()+"px"});this.list.setStyle({width:this.element.getWidth()+"px"});this.list.setStyle({top:(this.element.getHeight()-1)+"px"});c.removeClassName("select");this.list.appendChild(c);this.element.appendChild(this.list);this.rolloutHandler=this.detectRollout.bind(this);Element.hide(this.list);Event.observe(this.element,"mousedown",function(d){this.open(d)}.bind(this),false);var b=this.list.getElementsByTagName("li");for(i=0;i<b.length;i++){if(b[i].hasClassName("selected")){this.caption.innerHTML=b[i].down("a").innerHTML;b[i].remove();break}}},open:function(b){Element.show(this.list);Event.stopObserving(this.element,"mousedown",function(c){this.open(c)}.bind(this),false);Event.observe(document,"mousemove",this.rolloutHandler,false)},detectRollout:function(k){if(this.list.getStyle("display")!="none"){var h=Element.cumulativeOffset(this.list).left;var g=Element.cumulativeOffset(this.list).top;var f=Element.getDimensions(this.list).width;var b=Element.getDimensions(this.list).height;var d=Event.pointerX(k);var c=Event.pointerY(k);if(d<h-20||d>h+f+20||c<g-20||c>g+b+40){this.close()}}},close:function(b){Event.stopObserving(document,"mousemove",this.rolloutHandler,false);Event.observe(this.element,"mousedown",function(c){this.open(c)}.bind(this),false);Element.hide(this.list)}};var listManager=Class.create();listManager.prototype={action:null,list:null,deleteable:false,initialize:function(b){this.action=b.title;this.list=b;this.initItems(this.list);this.list.title=""},initItems:function(e){for(var c=0;c<e.childNodes.length;c++){if(e.childNodes[c].tagName&&e.childNodes[c].tagName.toLowerCase()=="li"){var b=e.childNodes[c];Element.extend(b);var d=new Element("a",{title:this.list.readAttribute("rel"),href:this.action+b.id}).update("");d.addClassName("icon");b.appendChild(d);Element.insert(b.down(0),{after:d});Element.hide(d);Event.observe(b,"mouseover",function(f){this.showAction(f)}.bindAsEventListener(this),false);Event.observe(b,"mouseout",function(f){this.hideAction(f)}.bindAsEventListener(this),false)}}},showAction:function(c){var b=(Event.element(c).up("li"))?Event.element(c).up("li"):Event.element(c);b.addClassName("active");b.down(".icon").show()},hideAction:function(c){var b=(Event.element(c).up("li"))?Event.element(c).up("li"):Event.element(c);b.removeClassName("active");b.down(".icon").hide()},doAction:function(c){var b=(Event.element(c).up("li"))?Event.element(c).up("li"):Event.element(c);document.location.href=this.action+b.id},dispose:function(){}};var voteBoxes=Class.create();voteBoxes.prototype={action:null,actionAfter:null,list:null,mouseoverHandler:null,mouseoutHandler:null,defaultValue:0,length:0,initialize:function(b){var c=b.title.split("|");this.action=c[0];this.actionAfter=c[1];this.list=b;if(!this.list.hasClassName("inherit")){this.mouseoverHandler=this.rollover.bindAsEventListener(this);this.mouseoutHandler=this.rollout.bindAsEventListener(this);this.mouseclickHandler=this.click.bindAsEventListener(this);this.initItems(this.list)}else{if(this.actionAfter!=""){this.mouseclickHandler=this.clickAfter.bindAsEventListener(this);this.initItems(this.list)}}this.list.title=""},initItems:function(e){var d=1;for(var c=0;c<e.childNodes.length;c++){if(e.childNodes[c].tagName&&e.childNodes[c].tagName.toLowerCase()=="li"){var b=e.childNodes[c];Element.extend(b);b.id=this.list.id+"_"+d;if(!this.list.hasClassName("inherit")){if(b.hasClassName("selected")){defaultValue=d}Event.observe(b.down("a"),"mouseover",this.mouseoverHandler);Event.observe(b.down("a"),"mouseout",this.mouseoutHandler);Event.observe(b.down("a"),"mousedown",this.mouseclickHandler)}else{Event.observe(b.down("a"),"mousedown",this.mouseclickHandler)}d++}}this.length=d-1},rollover:function(e){var d=(Event.element(e).tagName.toLowerCase()=="li")?Event.element(e):Event.element(e).up("li");var b=parseInt(d.id.substr(d.id.indexOf("_")+1,d.id.length));for(var c=1;c<=b;c++){$(this.list.id+"_"+c).isSelected=$(this.list.id+"_"+c).hasClassName("selected");$(this.list.id+"_"+c).addClassName("selected")}},rollout:function(e){var d=(Event.element(e).tagName.toLowerCase()=="li")?Event.element(e):Event.element(e).up("li");var b=parseInt(d.id.substr(d.id.indexOf("_")+1,d.id.length));for(var c=1;c<=b;c++){if(c>this.defaultValue){if(!$(this.list.id+"_"+c).isSelected){$(this.list.id+"_"+c).removeClassName("selected")}}}},click:function(e){var d=(Event.element(e).tagName.toLowerCase()=="li")?Event.element(e):Event.element(e).up("li");var c=parseInt(d.id.substr(d.id.indexOf("_")+1,d.id.length));var b={method:"get",parameters:this.list.id+"="+c,onSuccess:function(k){var h=k.responseText.evalJSON();var g=parseInt(h.NOTE);for(var f=1;f<=this.length;f++){li=$(this.list.id+"_"+f);Event.stopObserving(li.down("a"),"mouseover",this.mouseoverHandler);Event.stopObserving(li.down("a"),"mouseout",this.mouseoutHandler);Event.stopObserving(li.down("a"),"mousedown",this.mouseclickHandler);if(f<=g){li.addClassName("selected")}}this.list.addClassName("inherit");if(this.actionAfter!=""){this.clickAfter()}}.bind(this)};new Ajax.Request(this.action,b);if(e){Event.stop(e)}return false},clickAfter:function(ev){eval(this.actionAfter);if(ev){Event.stop(ev)}return false},dispose:function(){}};var autoCompleter=Class.create();autoCompleter.prototype={action:null,field:null,param:null,afterUpdateHandler:null,initialize:function(c){this.action=c.readAttribute("src");this.param=c.name;this.field=c;this.afterUpdateHandler=this.afterUpdateElement.bind(this);var b=new Element("div",{id:this.field.id+"Completer","class":"autocompleteList"});Element.insert(this.field,{after:b});b.setStyle({width:this.field.getWidth()+"px"});autocomplete=new Ajax.Autocompleter(this.field.id,b.id,this.action,{paramName:this.param,minChars:3,indicator:null,afterUpdateElement:this.afterUpdateHandler})},afterUpdateElement:function(c,b){$("searchForm").q.value=c.value;$("searchForm").submit()},dispose:function(){}};if(Prototype.Browser.IE){Prototype.Browser.IEVersion=parseFloat(navigator.appVersion.split(";")[1].strip().split(" ")[1]);Prototype.Browser.IE6=Prototype.Browser.IEVersion==6;Prototype.Browser.IE7=Prototype.Browser.IEVersion==7}var tabsList=Class.create();tabsList.prototype={field:null,list:null,menu:null,nbitems:null,scroll:false,single:false,nohash:false,tabs:true,selectedIndex:-1,currentElement:null,initialize:function(b){this.list=b;this.scroll=this.list.hasClassName("scroll");this.nohash=this.list.hasClassName("nohash");this.single=this.list.hasClassName("single");this.tabs=!this.list.hasClassName("notabs");if(this.tabs){var m=0;var k=location.hash.substr(1);this.menu=new Element("ul");var f=$w(this.list.className);for(var p=0;p<f.length;p++){this.menu.addClassName(f[p])}Element.insert(this.list,{before:this.menu});var h=0;while(this.list.childNodes[h]){if(this.list.childNodes[h].tagName&&this.list.childNodes[h].tagName.toLowerCase()=="li"){var s=this.list.childNodes[h];Element.extend(s);s.id=this.list.id+m;var o=s.childElements();var t=o[0];var n=o[1];var q=new Element("a",{href:"#"+s.id});s.appendChild(q);Element.insert(s,{top:q});Element.insert(q,{top:t});s.addClassName("tabsLink");n.addClassName("tabsPage");n.addClassName("clearfix");n.id=s.id;if(s.hasClassName("selected")||(k==s.id)){this.selectedIndex=m}s.id="";if(this.list.hasClassName("bottom")){Element.insert(this.menu,{before:n})}else{Element.insert(this.menu,{after:n})}this.menu.appendChild(s);Event.observe(q,"click",function(c){this.click(c)}.bind(this),false);m++}if(!Prototype.Browser.IE){h++}}Element.remove(this.list);this.menu.id=this.list.id;this.selectedIndex=(this.selectedIndex==-1)?0:this.selectedIndex;this.nbitems=m-1;if(this.menu.up("form")){var e=new Element("input",{type:"hidden",name:this.menu.id,id:this.menu.id});this.menu.id="";this.menu.up("form").appendChild(e);this.field=e;this.field.value=(this.selectedIndex>-1)?this.selectedIndex:0}if(this.scroll){var r=new Element("li",{"class":"next"});var g=new Element("a",{href:"#"}).update("&nbsp;");r.appendChild(g);Element.insert(this.menu,{bottom:r});var l=new Element("li",{"class":"previous"});var d=new Element("a",{href:"#"}).update("&nbsp;");l.appendChild(d);Element.insert(this.menu,{top:l});Event.observe(g,"click",function(c){this.next(c)}.bind(this),false);Event.observe(d,"click",function(c){this.prev(c)}.bind(this),false)}this.select(this.menu.down("li",this.selectedIndex+(this.scroll?1:0)));if(this.scroll){this.toggleScroll()}}},click:function(c){Event.stop(c);var b=Event.element(c).up("li");this.select(b)},next:function(b){if(Event.element(b)&&!Event.element(b).up("li").hasClassName("inherit")){this.selectedIndex++;this.toggleScroll();this.select(this.menu.down("li",this.selectedIndex+1))}Event.stop(b)},prev:function(b){if(Event.element(b)&&!Event.element(b).up("li").hasClassName("inherit")){this.selectedIndex--;this.toggleScroll();this.select(this.menu.down("li",this.selectedIndex+1))}Event.stop(b)},select:function(b){var c=b.down("a").getAttribute("href").match(/[-_\w]+$/i)[0];Element.removeClassName(this.currentElement,"selected");$$(".tabsPage[id^="+this.menu.id+"]").each(function(d){Element.hide(d)});if(this.single){$$("#"+this.menu.id+" .tabsLink").each(function(d){Element.hide(d)}.bind(this));Element.show(b)}Element.addClassName(b,"selected");Element.show(c);if(!this.nohash&&location.hash!=""){location.hash="#"+c}if(this.field){this.field.value=c.replace(this.field.id,"")}this.currentElement=b},toggleScroll:function(){if(this.selectedIndex>0){Element.removeClassName(this.menu.down(".previous"),"inherit")}else{Element.addClassName(this.menu.down(".previous"),"inherit")}if(this.selectedIndex<this.nbitems){Element.removeClassName(this.menu.down(".next"),"inherit")}else{Element.addClassName(this.menu.down(".next"),"inherit")}},dispose:function(){}};var Rollover=Class.create();Rollover.prototype={element:null,img:null,defaultSrc:null,rollSrc:null,overListener:null,outListener:null,initialize:function(c){this.element=c;if(this.element.down("img")){if(!this.element.hasClassName("selected")){this.img=this.element.down("img");this.defaultSrc=this.img.src;this.rollSrc=(this.img.src.indexOf("over")>-1)?this.img.src.replace("_over",""):this.img.src.replace(".gif","_over.gif");var b=new Image();b.src=this.rollSrc;this.overListener=this.over.bind(this);this.outListener=this.out.bind(this);this.out()}else{this.img=this.element.down("img");this.rollSrc=(this.img.src.indexOf("over")>-1)?this.img.src.replace("_over",""):this.img.src.replace(".gif","_over.gif");this.img.src=this.rollSrc}}},over:function(b){Event.stopObserving(this.element,"mouseover",this.overListener);this.img.src=this.rollSrc;Event.observe(this.element,"mouseout",this.outListener)},out:function(b){Event.stopObserving(this.element,"mouseout",this.outListener);this.img.src=this.defaultSrc;Event.observe(this.element,"mouseover",this.overListener)}};if(Prototype.Browser.IE){Prototype.Browser.IEVersion=parseFloat(navigator.appVersion.split(";")[1].strip().split(" ")[1]);Prototype.Browser.IE6=Prototype.Browser.IEVersion==6;Prototype.Browser.IE7=Prototype.Browser.IEVersion==7}var tooltipIndex=0;var toolTip=Class.create();toolTip.prototype={element:null,content:null,target:null,unique:null,eventMouseOver:null,eventMouseOut:null,eventMouseMove:null,elementWidth:0,elementHeight:0,initialize:function(b){Element.extend(b);this.options=Object.extend({default_css:false,margin:"0px",padding:"5px",backgroundColor:"#d6d6fc",min_distance_x:5,min_distance_y:5,delta_x:0,delta_y:0,zindex:1000},arguments[2]||{});this.element=b;this.content=b.readAttribute("rel");if(this.content){this.content=this.content.replace(new RegExp("\\+","g")," ");this.content=unescape(this.content);if(b.readAttribute("rev")){this.unique=true;this.target=$(b.readAttribute("rev"))}else{if($("tooltip"+tooltipIndex)){this.target=$("tooltip"+tooltipIndex)}else{this.target=new Element("div",{id:"tooltip"+tooltipIndex});this.target.addClassName("tooltipOverlay");document.body.appendChild(this.target);this.target.innerHTML=this.content;tooltipIndex++;Element.hide(this.target)}}this.eventMouseOver=this.over.bindAsEventListener(this);this.eventMouseOut=this.out.bindAsEventListener(this);this.eventMouseMove=this.move.bindAsEventListener(this);this.registerEvents()}},destroy:function(){Event.stopObserving(this.element,"mouseover",this.eventMouseOver);Event.stopObserving(this.element,"mouseout",this.eventMouseOut);if(!this.unique){Event.stopObserving(this.element,"mousemove",this.eventMouseMove)}},registerEvents:function(){Event.observe(this.element,"mouseover",this.eventMouseOver);Event.observe(this.element,"mouseout",this.eventMouseOut);if(!this.unique){Event.observe(this.element,"mousemove",this.eventMouseMove)}},over:function(c){if(this.unique){this.target.innerHTML=this.content}else{var b=Element.getDimensions(this.target);this.elementWidth=b.width;this.elementHeight=b.height;Event.stop(c);this.move(c);Element.show(this.target)}},out:function(b){if(this.unique){this.target.innerHTML=""}else{Element.hide(this.target)}},move:function(d){Event.stop(d);var c=Event.pointerX(d);var b=Event.pointerY(d);if((this.elementWidth+c)>=(this.getWindowWidth()-this.options.min_distance_x)){c=c-this.elementWidth;c=c-this.options.min_distance_x}else{c=c+this.options.min_distance_x}this.setStyles(c+this.options.min_distance_x,b+this.options.min_distance_y)},setStyles:function(b,c){Element.setStyle(this.target,{position:"absolute",top:c+this.options.delta_y+"px",left:b+this.options.delta_x+"px",zindex:this.options.zindex});if(this.options.default_css){Element.setStyle(this.target,{margin:this.options.margin,padding:this.options.padding,backgroundColor:this.options.backgroundColor,zindex:this.options.zindex})}},getWindowWidth:function(){return Prototype.Browser.IE?document.body.clientWidth:window.innerWidth},getWindowHeight:function(){return Prototype.Browser.IE?document.body.clientHeight:window.innerHeight}};var overlayOpacity=0.3;var animate=true;var resizeSpeed=7;var pageArray=new Array;var activeImage;var borderSize=1;var paddingSize=10;var noClose=false;if(animate==true){overlayDuration=0.2;if(resizeSpeed>10){resizeSpeed=10}if(resizeSpeed<1){resizeSpeed=1}resizeDuration=(11-resizeSpeed)*0.15}else{overlayDuration=0;resizeDuration=0}var Popup={active:true,opened:false,loaded:false,openit:null,defaultWidth:320,defaultHeight:200,initialize:function(){},load:function(){var m=document.getElementsByTagName("body").item(0);var l=new Element("div",{id:"popupOverlay"});l.style.display="none";m.appendChild(l);var k=new Element("div",{id:"popup"});k.style.display="none";m.appendChild(k);var e=new Element("div",{id:"popupContentContainer"});k.appendChild(e);if(animate){Element.setStyle("popupContentContainer",{width:"250px"});Element.setStyle("popupContentContainer",{height:"1px"})}else{Element.setStyle("popupContentContainer",{width:"250px"});Element.setStyle("popupContentContainer",{height:"1px"})}var h=new Element("div",{id:"popupContent",border:0});e.appendChild(h);var g=new Element("iframe",{id:"popupContentPage",scrolling:"no"});if(Prototype.Browser.IE){g.frameBorder=0}h.appendChild(g);var b=new Element("div",{id:"popupHoverNav"});e.appendChild(b);var c=document.createElement("a");c.setAttribute("id","popupPrevLink");c.setAttribute("href","#");b.appendChild(c);var f=document.createElement("a");f.setAttribute("id","popupNextLink");f.setAttribute("href","#");b.appendChild(f);var d=new Element("a",{id:"popupCloseLink",href:"#"});d.onclick=function(){Popup.end();return false};b.appendChild(d);Element.setStyle("popupContent",{padding:paddingSize+"px"});$$("a[rel^=popup]").each(function(n){Event.observe(n,"click",function(o){Popup.open(o)})});this.loaded=true;if(this.openit){this.start(this.openit)}},activate:function(){Popup.active=true},deactivate:function(){Popup.active=false},open:function(c){if(c){Event.stop(c)}if(Popup.active){var b=Event.element(c);b=b.up("a")?b.up("a"):b;Popup.start(b)}},start:function(b,g){if(!this.loaded){this.openit=b}else{noClose=(g)?true:noClose;if(noClose){Element.hide("popupCloseLink");$("popup").onclick=function(m){}}else{Element.show("popupCloseLink");$("popup").onclick=function(n){if(!n){var n=window.event}var m=Event.element(n).id;if(m=="popup"){Popup.end()}}}if($("popupPrevLink")){Element.hide("popupPrevLink")}if($("popupNextLink")){Element.hide("popupNextLink")}$$("select").each(function(m){Element.hide(m)});$$("object").each(function(m){Element.hide(m)});$$("embed").each(function(m){Element.hide(m)});var e=getPageSize();Element.setStyle("popupOverlay",{width:e[0]+"px"});Element.setStyle("popupOverlay",{height:e[1]+"px"});new Effect.Appear("popupOverlay",{duration:0.2,from:0,to:overlayOpacity});pageArray=[];pageNum=0;var f=getPageScroll();var l=f[0];var k=f[1];if((Element.readAttribute(b,"rel")=="popup")){if(Element.readAttribute(b,"rev")){var c=Element.readAttribute(b,"rev").match(/[0-9]+/g);var h=(c&&(parseInt(c[0])>0))?parseInt(c[0]):0;var d=(c&&(parseInt(c[1])>0))?parseInt(c[1]):0;k+=((e[3]-d)/3)}else{var h=Popup.defaultWidth;var d=Popup.defaultHeight;k+=((e[3]-d)/3)}pageArray.push(new Array(Element.readAttribute(b,"href"),Element.readAttribute(b,"title"),h,d))}else{$$(b.tagName).each(function(n){if(Element.readAttribute(n,"href")&&(Element.readAttribute(n,"rel")==Element.readAttribute(b,"rel"))){if(Element.readAttribute(n,"rev")){var p=Element.readAttribute(n,"rev").match(/[0-9]+/g);var m=(p&&(parseInt(p[0])>0))?parseInt(p[0]):0;var o=(p&&(parseInt(p[1])>0))?parseInt(p[1]):0}else{var m=Popup.defaultWidth;var o=Popup.defaultHeight}pageArray.push(new Array(Element.readAttribute(n,"href"),Element.readAttribute(n,"title"),m,o))}});pageArray.removeDuplicates();while(pageArray[pageNum][0]!=Element.readAttribute(b,"href")){pageNum++}k+=((e[3]-pageArray[pageNum][3])/3)}Element.setStyle("popup",{left:l+"px"});Element.setStyle("popup",{top:k+"px"});Element.show("popup");Popup.opened=true;Popup.changePage(pageNum)}},changePage:function(b){Element.hide("popupHoverNav");activePage=b;Popup.resize(pageArray[activePage][2],pageArray[activePage][3])},resize:function(d,e){Element.hide("popupContentPage");Element.writeAttribute("popupContentPage","src","");Popup.widthCurrent=Element.getWidth("popupContentContainer");Popup.heightCurrent=Element.getHeight("popupContentContainer");var b=(d+(paddingSize*2));var c=(e+(paddingSize*2));Popup.xScale=(b/Popup.widthCurrent)*100;Popup.yScale=(c/Popup.heightCurrent)*100;wDiff=Popup.widthCurrent-b-(2*borderSize);hDiff=Popup.heightCurrent-c-(2*borderSize);if(!(hDiff==0)){new Effect.Scale("popupContentContainer",Popup.yScale,{scaleX:false,duration:resizeDuration})}if(!(wDiff==0)){new Effect.Scale("popupContentContainer",Popup.xScale,{scaleY:false,delay:resizeDuration,duration:resizeDuration})}if((hDiff==0)&&(wDiff==0)){}Element.setStyle("popupHoverNav",{width:b+"px"});Element.setStyle("popupHoverNav",{height:c+"px"});new Effect.Appear("popupContentContainer",{delay:resizeDuration,duration:resizeDuration,afterFinish:function(){Popup.setPage(d,e)}})},setSize:function(d,e){Popup.widthCurrent=Element.getWidth("popupContentContainer");Popup.heightCurrent=Element.getHeight("popupContentContainer");var b=(d+(paddingSize*2));var c=(e+(paddingSize*2));Popup.xScale=(b/Popup.widthCurrent)*100;Popup.yScale=(c/Popup.heightCurrent)*100;wDiff=Popup.widthCurrent-b-(2*borderSize);hDiff=Popup.heightCurrent-c-(2*borderSize);if(!(hDiff==0)){new Effect.Scale("popupContentContainer",Popup.yScale,{scaleX:false,duration:resizeDuration})}if(!(wDiff==0)){new Effect.Scale("popupContentContainer",Popup.xScale,{scaleY:false,delay:resizeDuration,duration:resizeDuration})}Element.setStyle("popupHoverNav",{width:b+"px"});Element.setStyle("popupHoverNav",{height:c+"px"});Element.setStyle("popupContentPage",{width:d+"px"});Element.setStyle("popupContentPage",{height:e+"px"})},setPage:function(b,d){Element.show("popupContentPage");Element.setStyle("popupContentPage",{width:b+"px"});Element.setStyle("popupContentPage",{height:d+"px"});var c=(parseUri(pageArray[activePage][0]).query!="")?pageArray[activePage][0]+"&popup=true":pageArray[activePage][0]+"?popup=true";Element.writeAttribute("popupContentPage","src",c);Element.show("popupHoverNav");if(activePage>0){Element.show("popupPrevLink");Event.observe($("popupPrevLink"),"click",function(e){Popup.changePage(activePage-1)})}else{Element.hide("popupPrevLink")}if(activePage<(pageArray.length-1)){Element.show("popupNextLink");Event.observe($("popupNextLink"),"click",function(e){Popup.changePage(activePage+1)})}else{Element.hide("popupNextLink")}this.enableKeyboardNav()},enableKeyboardNav:function(){document.onkeydown=Popup.keyboardAction},disableKeyboardNav:function(){document.onkeydown=""},keyboardAction:function(b){if(b==null){keycode=event.keyCode;escapeKey=27}else{keycode=b.keyCode;escapeKey=b.DOM_VK_ESCAPE}key=String.fromCharCode(keycode).toLowerCase();if((key=="x")||(key=="o")||(key=="c")||(keycode==escapeKey)){Popup.end()}else{if((key=="p")||(keycode==37)){if(activePage!=0){Popup.disableKeyboardNav();Popup.changePage(activePage-1)}}else{if((key=="n")||(keycode==39)){if(activePage!=(pageArray.length-1)){Popup.disableKeyboardNav();Popup.changePage(activePage+1)}}}}},end:function(){Popup.disableKeyboardNav();Popup.opened=false;Element.hide("popup");Element.hide("popupOverlay");$$("select").each(function(b){Element.show(b)});$$("object").each(function(b){Element.show(b)});$$("embed").each(function(b){Element.show(b)})}};function parseUri(f){var e=parseUri.options,b=e.parser[e.strictMode?"strict":"loose"].exec(f),d={},c=14;while(c--){d[e.key[c]]=b[c]||""}d[e.q.name]={};d[e.key[12]].replace(e.q.parser,function(h,g,k){if(g){d[e.q.name][g]=k}});return d}parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function getPageScroll(){var c,b;if(self.pageYOffset){b=self.pageYOffset;c=self.pageXOffset}else{if(document.documentElement&&document.documentElement.scrollTop){b=document.documentElement.scrollTop;c=document.documentElement.scrollLeft}else{if(document.body){b=document.body.scrollTop;c=document.body.scrollLeft}}}arrayPageScroll=new Array(c,b);return arrayPageScroll}function getPageSize(){var d,b;if(window.innerHeight&&window.scrollMaxY){d=window.innerWidth+window.scrollMaxX;b=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){d=document.body.scrollWidth;b=document.body.scrollHeight}else{d=document.body.offsetWidth;b=document.body.offsetHeight}}var c,e;if(self.innerHeight){if(document.documentElement.clientWidth){c=document.documentElement.clientWidth}else{c=self.innerWidth}e=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;e=document.documentElement.clientHeight}else{if(document.body){c=document.body.clientWidth;e=document.body.clientHeight}}}if(b<e){pageHeight=e}else{pageHeight=b}if(d<c){pageWidth=d}else{pageWidth=c}arrayPageSize=new Array(pageWidth,pageHeight,c,e);return arrayPageSize}function getKey(b){if(b==null){keycode=event.keyCode}else{keycode=b.which}key=String.fromCharCode(keycode).toLowerCase();if(key=="x"){}}function listenKey(){document.onkeypress=getKey}var currentTitle="";var currentURL="";var shareLink=Class.create();shareLink.prototype={element:null,title:null,url:null,eventMouseClick:null,eventMouseMove:null,elementWidth:0,elementHeight:0,initialize:function(b){Element.extend(b);if(!b.hasClassName("notip")){this.element=b;this.title=b.readAttribute("rel");this.url=b.readAttribute("href");this.eventMouseClick=this.click.bindAsEventListener(this);this.eventMouseMove=this.move.bindAsEventListener(this);Event.observe(this.element,"mousedown",this.eventMouseClick);Event.observe(this.element,"mouseup",function(c){Event.stop(c)});Event.observe(this.element,"click",function(c){Event.stop(c)})}},click:function(d){Event.stop(d);if(!$("shareTip").visible()){$("shareTip").show();currentTitle=this.title;currentURL=this.url;var f=Element.cumulativeOffset(this.element).left-Element.cumulativeOffset($("page")).left;var e=Element.cumulativeOffset(this.element).top-Element.cumulativeOffset($("page")).top;var c=Element.getDimensions($("shareTip")).width;var b=Element.getDimensions($("shareTip")).height;Element.setStyle($("shareTip"),{left:(f+(Element.getDimensions(this.element).width-c)/2)+"px",top:(e-90)+"px"})}Event.observe(document,"mousemove",this.eventMouseMove,false)},move:function(k){if($("shareTip").visible()){var h=Element.cumulativeOffset($("shareTip")).left;var g=Element.cumulativeOffset($("shareTip")).top;var f=Element.getDimensions($("shareTip")).width;var b=Element.getDimensions($("shareTip")).height;var d=Event.pointerX(k);var c=Event.pointerY(k);if(d<h-20||d>h+f+20||c<g-20||c>g+b+20){$("shareTip").hide();Event.stopObserving(document,"mousemove",this.eventMouseMove,false)}}}};this.doShare=function(b){$("shareTip").hide();url=sprintf(b,encodeURIComponent(currentURL),encodeURIComponent(currentTitle));window.open(url)};var Equalizer=Class.create();Equalizer.prototype={initialize:function(d,e,c,b){this.elements=d.immediateDescendants()},equalize:function(c){if(!c){c="height"}var b=0,d=(typeof document.body.style.maxHeight!="undefined"?"min-":"")+c;offset="offset"+c.capitalize();this.elements.each(function(g,f){var e=g[offset];if(e>b){b=e}},this);this.elements.each(function(f,e){f.setStyle({height:Math.round(b-(f[offset]-f.getStyle(c).replace("px","")))+"px"})});return b}};Object.extend(Event,{wheel:function(b){var c=0;if(b.wheelDelta){c=b.wheelDelta/120;if(window.opera){c=-c}}else{if(b.detail){c=-b.detail/3}}if(navigator.userAgent.indexOf("Mac")!=-1){c=-c}return Math.round(c)}});var Slideshow=Class.create();Slideshow.prototype={initialize:function(d,c,e,b){this.element=d;this.duree=c;this.secExecution=e;this.pagination=b;this.currentIndex=0;this.currentPosition=0;this.mover=$(this.element).down("ul");this.elements=this.mover.getElementsByTagName("li");this.nbElements=this.elements.length;this.baseWidth=$(this.element).getWidth();this.baseHeight=$(this.element).getHeight();var f=this.mover.firstDescendant().cloneNode(true);this.mover.insert({bottom:f});for(i=0;i<=this.nbElements;i++){$(this.elements[i]).setStyle({display:"block","float":"left",width:this.baseWidth+"px",height:this.baseHeight+"px"})}$(this.element).setStyle({overflow:"hidden",position:"relative"});$(this.element).down("ul").setStyle({width:(this.baseWidth*(this.nbElements+1))+"px"});if(this.pagination){this.olPagination=$(this.element).down("ol.pagination");if(!this.olPagination){$(this.element).insert({bottom:'<ol class="pagination"></ol>'});this.olPagination=$(this.element).down("ol.pagination");for(i=0;i<this.nbElements;i++){$(this.olPagination).insert({bottom:'<li><a href="#'+$(this.element).getAttribute("id")+i+'">'+(i+1)+"</a></li>"})}}$(this.olPagination).childElements()[0].addClassName("selected");Event.observe($(this.olPagination),"click",this.click.bind(this))}this.startSlideshow();Event.observe(this.mover,"mouseout",this.startSlideshow.bind(this));Event.observe(this.mover,"mouseover",this.stopSlideshow.bind(this))},startSlideshow:function(){new Effect.Opacity(this.mover.childElements()[this.currentIndex],{from:0.7,to:1,duration:0.5});this.periodik=new PeriodicalExecuter(this.next.bind(this),this.secExecution)},stopSlideshow:function(){new Effect.Opacity(this.mover.childElements()[this.currentIndex],{from:1,to:0.7,duration:0.5});this.periodik.stop()},unselect:function(b){if(this.pagination){$(this.olPagination).childElements()[b].removeClassName("selected")}},select:function(b){if(this.pagination){$(this.olPagination).childElements()[b].addClassName("selected")}},next:function(){this.gotoIndex(this.currentIndex+1)},move:function(){new Effect.Move(this.mover,{x:-this.baseWidth*this.currentIndex,y:0,mode:"absolute",duration:this.duree,transition:Effect.Transitions.sinoidal,afterFinish:function(){this.moveFinish()}.bind(this)})},moveFinish:function(b){if(this.currentIndex==this.nbElements){this.currentIndex=0;this.mover.setStyle({left:0})}this.select(this.currentIndex)},click:function(c){var d=Event.element(c);if(d.up("a")||d.getAttribute("href")){var b=d.up("a")?d.up("a").getAttribute("href").match(/[0-9]+$/i)[0]:d.getAttribute("href").match(/[0-9]+$/i)[0];this.gotoIndex(parseInt(b));this.periodik.stop();this.periodik=new PeriodicalExecuter(this.next.bind(this),this.secExecution)}},gotoIndex:function(b){if(this.currentIndex!=b){this.unselect(this.currentIndex);this.currentIndex=b;this.move()}},stopEvent:function(b){if(!b){if(window.event){b=window.event}else{return}}if(b.cancelBubble!=null){b.cancelBubble=true}if(b.stopPropagation){b.stopPropagation()}if(b.preventDefault){b.preventDefault()}},wheelwheel:function(b){this.event=b;this.stopSlideshow();this.stopEvent(b);if(Event.wheel(this.event)<0){if(this.currentIndex<this.nCell){this.currentPosition=this.currentPosition-this.baseWidth;this.unselect(this.currentIndex);this.currentIndex=this.currentIndex+1;this.move(this.currentPosition)}}else{if(this.currentIndex!=1){this.currentPosition=this.currentPosition+this.baseWidth;this.unselect(this.currentIndex);this.currentIndex=this.currentIndex-1;this.move(this.currentPosition)}}}};
