var isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false;var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false;var isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false;function ControlVersion(){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");return axo.GetVariable("$version").split(" ")[1].split(",").join(".")}function GetSwfVer(){var j=-1;if(navigator.plugins!=null&&navigator.plugins.length>0){if(navigator.plugins["Shockwave Flash 2.0"]||navigator.plugins["Shockwave Flash"]){var h=navigator.plugins["Shockwave Flash 2.0"]?" 2.0":"";var a=navigator.plugins["Shockwave Flash"+h].description;var g=a.split(" ");var d=g[2].split(".");var k=d[0];var c=d[1];if(g[3]!=""){tempArrayMinor=g[3].split("r")}else{tempArrayMinor=g[4].split("r")}var f=tempArrayMinor[1]>0?tempArrayMinor[1]:0;var j=k+"."+c+"."+f}}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.6")!=-1){j=4}else{if(navigator.userAgent.toLowerCase().indexOf("webtv/2.5")!=-1){j=3}else{if(navigator.userAgent.toLowerCase().indexOf("webtv")!=-1){j=2}else{if(isIE&&isWin&&!isOpera){j=ControlVersion()}}}}}return j}var BasicSubmitButton={};BasicSubmitButton.create=function(f,d){var h=document.getElementById(f);h.style.display="none";var g=document.createElement("span");g.innerHTML=(h.value||h.alt||h.innerHTML);var c=document.createElement("a");c.href="#";c.className="default-button default button";c.appendChild(g);h.parentNode.insertBefore(c,h);var j=this;executeLater.push(function(){return new SubmitButton(f,Object.extend(d,{useExisting:{button:c}}))})};var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);
/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/
return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return}J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return}if(a.ie&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return}}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getElementsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id==Z){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return}var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return}var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return}r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();var Prototype={Version:"1.7_rc1",Browser:(function(){var c=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:c.indexOf("AppleWebKit/")>-1,Gecko:c.indexOf("Gecko")>-1&&c.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(c)}})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true}var d=document.createElement("div"),c=document.createElement("form"),a=false;if(d.__proto__&&(d.__proto__!==c.__proto__)){a=true}d=c=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var d;for(var c=0,f=arguments.length;c<f;c++){var a=arguments[c];try{d=a();break}catch(g){}}return d}};var Class=(function(){var f=(function(){for(var g in {toString:1}){if(g==="toString"){return false}}return true})();function a(){}function c(){var k=null,j=$A(arguments);if(Object.isFunction(j[0])){k=j.shift()}function g(){this.initialize.apply(this,arguments)}Object.extend(g,Class.Methods);g.superclass=k;g.subclasses=[];if(k){a.prototype=k.prototype;g.prototype=new a;k.subclasses.push(g)}for(var h=0,l=j.length;h<l;h++){g.addMethods(j[h])}if(!g.prototype.initialize){g.prototype.initialize=Prototype.emptyFunction}g.prototype.constructor=g;return g}function d(n){var j=this.superclass&&this.superclass.prototype,h=Object.keys(n);if(f){if(n.toString!=Object.prototype.toString){h.push("toString")}if(n.valueOf!=Object.prototype.valueOf){h.push("valueOf")}}for(var g=0,k=h.length;g<k;g++){var m=h[g],l=n[m];if(j&&Object.isFunction(l)&&l.argumentNames()[0]=="$super"){var o=l;l=(function(p){return function(){return j[p].apply(this,arguments)}})(m).wrap(o);l.valueOf=o.valueOf.bind(o);l.toString=o.toString.bind(o)}this.prototype[m]=l}return this}return{create:c,Methods:{addMethods:d}}})();(function(){var D=Object.prototype.toString,C="Null",r="Undefined",x="Boolean",h="Number",v="String",H="Object",z="[object Boolean]",j="[object Number]",o="[object String]",k="[object Array]",l=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";function n(J){switch(J){case null:return C;case (void 0):return r}var I=typeof J;switch(I){case"boolean":return x;case"number":return h;case"string":return v}return H}function A(I,K){for(var J in K){I[J]=K[J]}return I}function F(I){try{if(d(I)){return"undefined"}if(I===null){return"null"}return I.inspect?I.inspect():String(I)}catch(J){if(J instanceof RangeError){return"..."}throw J}}function E(I){return G("",{"":I},[])}function G(R,O,P){var Q=O[R],N=typeof Q;if(n(Q)===H&&typeof Q.toJSON==="function"){Q=Q.toJSON(R)}var K=D.call(Q);switch(K){case j:case z:case o:Q=Q.valueOf()}switch(Q){case null:return"null";case true:return"true";case false:return"false"}N=typeof Q;switch(N){case"string":return Q.inspect(true);case"number":return isFinite(Q)?String(Q):"null";case"object":for(var J=0,I=P.length;J<I;J++){if(P[J]===Q){throw new TypeError()}}P.push(Q);var M=[];if(K===k){for(var J=0,I=Q.length;J<I;J++){var L=G(J,Q,P);M.push(typeof L==="undefined"?"null":L)}M="["+M.join(",")+"]"}else{var S=Object.keys(Q);for(var J=0,I=S.length;J<I;J++){var R=S[J],L=G(R,Q,P);if(typeof L!=="undefined"){M.push(R.inspect(true)+":"+L)}}M="{"+M.join(",")+"}"}P.pop();return M}}function y(I){return JSON.stringify(I)}function m(I){return $H(I).toQueryString()}function s(I){return I&&I.toHTML?I.toHTML():String.interpret(I)}function u(I){if(n(I)!==H){throw new TypeError()}var J=[];for(var K in I){if(I.hasOwnProperty(K)){J.push(K)}}return J}function f(I){var J=[];for(var K in I){J.push(I[K])}return J}function B(I){return A({},I)}function w(I){return !!(I&&I.nodeType==1)}function p(I){return D.call(I)===k}var c=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(c){p=Array.isArray}function g(I){return I instanceof Hash}function a(I){return typeof I==="function"}function q(I){return D.call(I)===o}function t(I){return D.call(I)===j}function d(I){return typeof I==="undefined"}A(Object,{extend:A,inspect:F,toJSON:l?y:E,toQueryString:m,toHTML:s,keys:Object.keys||u,values:f,clone:B,isElement:w,isArray:p,isHash:g,isFunction:a,isString:q,isNumber:t,isUndefined:d})})();Object.extend(Function.prototype,(function(){var n=Array.prototype.slice;function f(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 f(p,o)}function j(){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 h(q){var o=this,p=n.call(arguments,1);return function(s){var r=f([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 g(q){var o=this,p=n.call(arguments,1);q=q*1000;return window.setTimeout(function(){return o.apply(o,p)},q)}function a(){var o=f([0.01],arguments);return this.delay.apply(this,o)}function d(p){var o=this;return function(){var q=f([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=f([this],arguments);return o.apply(null,p)}}return{argumentNames:j,bind:k,bindAsEventListener:h,curry:m,delay:g,defer:a,wrap:d,methodize:c}})());(function(d){function c(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"}function a(){return this.toISOString()}if(!d.toISOString){d.toISOString=c}if(!d.toJSON){d.toJSON=a}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")};var PeriodicalExecuter=Class.create({initialize:function(c,a){this.callback=c;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}})());var Template=Class.create({initialize:function(a,c){this.template=a.toString();this.pattern=c||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()}return this.template.gsub(this.pattern,function(f){if(a==null){return(f[1]+"")}var h=f[1]||"";if(h=="\\"){return f[2]}var c=a,j=f[3],g=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;f=g.exec(j);if(f==null){return h}while(f!=null){var d=f[1].startsWith("[")?f[2].replace(/\\\\]/g,"]"):f[1];c=c[d];if(null==c||""==f[3]){break}j=j.substring("["==f[3]?f[1].length:f[0].length);f=g.exec(j)}return h+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 j(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 a(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 g(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 h(A){var z=[];this.each(function(B){z.push(B[A])});return z}function f(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:j,include:a,member:a,inGroupsOf:t,inject:o,invoke:y,max:s,min:q,partition:g,pluck:h,reject:f,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,a=new Array(c);while(c--){a[c]=d[c]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();return a?a.split(/\s+/):[]}Array.from=$A;(function(){var u=Array.prototype,p=u.slice,r=u.forEach;function c(y){for(var x=0,z=this.length;x<z;x++){y(this[x])}}if(!r){r=c}function o(){this.length=0;return this}function f(){return this[0]}function j(){return this[this.length-1]}function l(){return this.select(function(x){return x!=null})}function w(){return this.inject([],function(y,x){if(Object.isArray(x)){return y.concat(x.flatten())}y.push(x);return y})}function k(){var x=p.call(arguments,0);return this.select(function(y){return !x.include(y)})}function h(x){return(x===false?this.toArray():this)._reverse()}function n(x){return this.inject([],function(A,z,y){if(0==y||(x?A.last()!=z:!A.include(z))){A.push(z)}return A})}function s(x){return this.uniq().findAll(function(y){return x.detect(function(z){return y===z})})}function t(){return p.call(this,0)}function m(){return this.length}function v(){return"["+this.map(Object.inspect).join(", ")+"]"}function a(z,x){x||(x=0);var y=this.length;if(x<0){x=y+x}for(;x<y;x++){if(this[x]===z){return x}}return -1}function q(y,x){x=isNaN(x)?this.length:(x<0?this.length+x:x)+1;var z=this.slice(0,x).reverse().indexOf(y);return(z<0)?z:x-z-1}function d(){var C=p.call(this,0),A;for(var y=0,z=arguments.length;y<z;y++){A=arguments[y];if(Object.isArray(A)&&!("callee" in A)){for(var x=0,B=A.length;x<B;x++){C.push(A[x])}}else{C.push(A)}}return C}Object.extend(u,Enumerable);if(!u._reverse){u._reverse=u.reverse}Object.extend(u,{_each:r,clear:o,first:f,last:j,compact:l,flatten:w,without:k,reverse:h,uniq:n,intersect:s,clone:t,toArray:t,size:m,inspect:v});var g=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(g){u.concat=d}if(!u.indexOf){u.indexOf=a}if(!u.lastIndexOf){u.lastIndexOf=q}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function g(s){this._object=Object.isHash(s)?s.toObject():Object.clone(s)}function h(t){for(var s in this._object){var u=this._object[s],v=[s,u];v.key=s;v.value=u;t(v)}}function m(s,t){return this._object[s]=t}function d(s){if(this._object[s]!==Object.prototype[s]){return this._object[s]}}function p(s){var t=this._object[s];delete this._object[s];return t}function r(){return Object.clone(this._object)}function q(){return this.pluck("key")}function o(){return this.pluck("value")}function j(t){var s=this.detect(function(u){return u.value===t});return s&&s.key}function l(s){return this.clone().update(s)}function f(s){return new Hash(s).inject(this,function(t,u){t.set(u.key,u.value);return t})}function c(s,t){if(Object.isUndefined(t)){return s}return s+"="+encodeURIComponent(String.interpret(t))}function a(){return this.inject([],function(u,v){var t=encodeURIComponent(v.key),s=v.value;if(s&&typeof s=="object"){if(Object.isArray(s)){return u.concat(s.map(c.curry(t)))}}else{u.push(c(t,s))}return u}).join("&")}function n(){return"#<Hash:{"+this.map(function(s){return s.map(Object.inspect).join(": ")}).join(", ")+"}>"}function k(){return new Hash(this)}return{initialize:g,_each:h,set:m,get:d,unset:p,toObject:r,toTemplateReplacements:r,keys:q,values:o,index:j,merge:l,update:f,toQueryString:a,inspect:n,toJSON:r,clone:k}})());Hash.from=$H;Object.extend(Number.prototype,(function(){function f(){return this.toPaddedString(2,16)}function c(){return this+1}function k(m,l){$R(0,this,true).each(m,l);return this}function j(n,m){var l=this.toString(m||10);return"0".times(n-l.length)+l}function a(){return Math.abs(this)}function d(){return Math.round(this)}function g(){return Math.ceil(this)}function h(){return Math.floor(this)}return{toColorPart:f,succ:c,times:k,toPaddedString:j,abs:a,round:d,ceil:g,floor:h}})());function $R(d,a,c){return new ObjectRange(d,a,c)}var ObjectRange=Class.create(Enumerable,(function(){function c(h,f,g){this.start=h;this.end=f;this.exclusive=g}function d(f){var g=this.start;while(this.include(g)){f(g);g=g.succ()}}function a(f){if(f<this.start){return false}if(this.exclusive){return f<this.end}return f<=this.end}return{initialize:c,_each:d,include:a}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(f,c,d,a){this.each(function(g){if(Object.isFunction(g[f])){try{g[f].apply(g,[c,d,a])}catch(h){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters)){this.options.parameters=this.options.parameters.toQueryParams()}else{if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,c,a){$super(a);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 a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||f):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(d){this.dispatchException(d)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var g={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){g["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){g.Connection="close"}}if(typeof this.options.requestHeaders=="object"){var d=this.options.requestHeaders;if(Object.isFunction(d.push)){for(var c=0,f=d.length;c<f;c+=2){g[d[c]]=d[c+1]}}else{$H(d).each(function(h){g[h.key]=h.value})}}for(var a in g){this.transport.setRequestHeader(a,g[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var d=Ajax.Request.Events[a],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 a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(c){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(d){this.request=d;var f=this.transport=d.transport,a=this.readyState=f.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(f.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var c=f.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(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(c){this.request.dispatchException(c)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(c){this.request.dispatchException(c)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,d,c){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};c=Object.clone(c);var f=c.onComplete;c.onComplete=(function(g,h){this.updateContent(g.responseText);if(Object.isFunction(f)){f(g,h)}}).bind(this);$super(d,c)},updateContent:function(f){var d=this.container[this.success()?"success":"failure"],a=this.options;if(!a.evalScripts){f=f.stripScripts()}if(d=$(d)){if(a.insertion){if(Object.isString(a.insertion)){var c={};c[a.insertion]=f;d.insert(c)}else{a.insertion(d,f)}}else{d.update(f)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,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=a;this.url=d;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(c){if(arguments.length>1){for(var a=0,f=[],d=arguments.length;a<d;a++){f.push($(arguments[a]))}return f}if(Object.isString(c)){c=document.getElementById(c)}return Element.extend(c)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(h,a){var d=[];var g=document.evaluate(h,$(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var c=0,f=g.snapshotLength;c<f;c++){d.push(Element.extend(g.snapshotItem(c)))}return d}}if(!Node){var Node={}}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(d){var c=(function(){try{var f=document.createElement('<input name="x">');return f.tagName.toLowerCase()==="input"&&f.name==="x"}catch(g){return false}})();var a=d.Element;d.Element=function(h,g){g=g||{};h=h.toLowerCase();var f=Element.cache;if(c&&g.name){h="<"+h+' name="'+g.name+'">';delete g.name;return Element.writeAttribute(document.createElement(h),g)}if(!f[h]){f[h]=Element.extend(document.createElement(h))}return Element.writeAttribute(f[h].cloneNode(false),g)};Object.extend(d.Element,a||{});if(a){d.Element.prototype=a.prototype}})(this);Element.idCounter=1;Element.cache={};Element.Methods={visible:function(a){return $(a).style.display!="none"},toggle:function(a){a=$(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=$(a);a.style.display="none";return a},show:function(a){a=$(a);a.style.display="";return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:(function(){var c=(function(){var g=document.createElement("select"),h=true;g.innerHTML='<option value="test">test</option>';if(g.options&&g.options[0]){h=g.options[0].nodeName.toUpperCase()!=="OPTION"}g=null;return h})();var a=(function(){try{var g=document.createElement("table");if(g&&g.tBodies){g.innerHTML="<tbody><tr><td>test</td></tr></tbody>";var j=typeof g.tBodies[0]=="undefined";g=null;return j}}catch(h){return true}})();var f=(function(){var g=document.createElement("script"),j=false;try{g.appendChild(document.createTextNode(""));j=!g.firstChild||g.firstChild&&g.firstChild.nodeType!==3}catch(h){j=true}g=null;return j})();function d(h,j){h=$(h);if(j&&j.toElement){j=j.toElement()}if(Object.isElement(j)){return h.update().insert(j)}j=Object.toHTML(j);var g=h.tagName.toUpperCase();if(g==="SCRIPT"&&f){h.text=j;return h}if(c||a){if(g in Element._insertionTranslations.tags){while(h.firstChild){h.removeChild(h.firstChild)}Element._getContentFromAnonymousElement(g,j.stripScripts()).each(function(k){h.appendChild(k)})}else{h.innerHTML=j.stripScripts()}}else{h.innerHTML=j.stripScripts()}j.evalScripts.bind(j).defer();return h}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 a=c.ownerDocument.createRange();a.selectNode(c);d.evalScripts.bind(d).defer();d=a.createContextualFragment(d.stripScripts())}}c.parentNode.replaceChild(d,c);return c},insert:function(d,g){d=$(d);if(Object.isString(g)||Object.isNumber(g)||Object.isElement(g)||(g&&(g.toElement||g.toHTML))){g={bottom:g}}var f,h,c,j;for(var a in g){f=g[a];a=a.toLowerCase();h=Element._insertionTranslations[a];if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){h(d,f);continue}f=Object.toHTML(f);c=((a=="before"||a=="after")?d.parentNode:d).tagName.toUpperCase();j=Element._getContentFromAnonymousElement(c,f.stripScripts());if(a=="top"||a=="after"){j.reverse()}j.each(h.curry(d));f.evalScripts.bind(f).defer()}return d},wrap:function(c,d,a){c=$(c);if(Object.isElement(d)){$(d).writeAttribute(a||{})}else{if(Object.isString(d)){d=new Element(d,a)}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 a="<"+c.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(h){var g=h.first(),d=h.last(),f=(c[g]||"").toString();if(f){a+=" "+d+"="+f.inspect(true)}});return a+">"},recursivelyCollect:function(a,d,f){a=$(a);f=f||-1;var c=[];while(a=a[d]){if(a.nodeType==1){c.push(Element.extend(a))}if(c.length==f){break}}return c},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling}return $(a)},immediateDescendants:function(c){var a=[],d=$(c).firstChild;while(d){if(d.nodeType===1){a.push(Element.extend(d))}d=d.nextSibling}return a},previousSiblings:function(a,c){return Element.recursivelyCollect(a,"previousSibling")},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=$(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(c,a){c=$(c);if(Object.isString(a)){return Prototype.Selector.match(c,a)}return a.match(c)},up:function(c,f,a){c=$(c);if(arguments.length==1){return $(c.parentNode)}var d=Element.ancestors(c);return Object.isNumber(f)?d[f]:Prototype.Selector.find(d,f,a)},down:function(c,d,a){c=$(c);if(arguments.length==1){return Element.firstDescendant(c)}return Object.isNumber(d)?Element.descendants(c)[d]:Element.select(c,d)[a||0]},previous:function(c,d,a){c=$(c);if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(c.previousSiblings(),d,a)}else{return c.recursivelyCollect("previousSibling",a+1)[a]}},next:function(c,f,a){c=$(c);if(Object.isNumber(f)){a=f,f=false}if(!Object.isNumber(a)){a=0}if(f){return Prototype.Selector.find(c.nextSiblings(),f,a)}else{var d=Object.isNumber(a)?a+1:1;return c.recursivelyCollect("nextSibling",a+1)[a]}},select:function(a){a=$(a);var c=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(c,a)},adjacent:function(a){a=$(a);var c=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(c,a.parentNode).without(a)},identify:function(a){a=$(a);var c=Element.readAttribute(a,"id");if(c){return c}do{c="anonymous_element_"+Element.idCounter++}while($(c));Element.writeAttribute(a,"id",c);return c},readAttribute:function(d,a){d=$(d);if(Prototype.Browser.IE){var c=Element._attributeTranslations.read;if(c.values[a]){return c.values[a](d,a)}if(c.names[a]){a=c.names[a]}if(a.include(":")){return(!d.attributes||!d.attributes[a])?null:d.attributes[a].value}}return d.getAttribute(a)},writeAttribute:function(g,d,h){g=$(g);var c={},f=Element._attributeTranslations.write;if(typeof d=="object"){c=d}else{c[d]=Object.isUndefined(h)?true:h}for(var a in c){d=f.names[a]||a;h=c[a];if(f.values[a]){d=f.values[a](g,h)}if(h===false||h===null){g.removeAttribute(d)}else{if(h===true){g.setAttribute(d,d)}else{g.setAttribute(d,h)}}}return g},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,c){if(!(a=$(a))){return}var d=a.className;return(d.length>0&&(d==c||new RegExp("(^|\\s)"+c+"(\\s|$)").test(d)))},addClassName:function(a,c){if(!(a=$(a))){return}if(!Element.hasClassName(a,c)){a.className+=(a.className?" ":"")+c}return a},removeClassName:function(a,c){if(!(a=$(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+c+"(\\s+|$)")," ").strip();return a},toggleClassName:function(a,c){if(!(a=$(a))){return}return Element[Element.hasClassName(a,c)?"removeClassName":"addClassName"](a,c)},cleanWhitespace:function(c){c=$(c);var d=c.firstChild;while(d){var a=d.nextSibling;if(d.nodeType==3&&!/\S/.test(d.nodeValue)){c.removeChild(d)}d=a}return c},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(c,a){c=$(c),a=$(a);if(c.compareDocumentPosition){return(c.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(c)&&a!==c}while(c=c.parentNode){if(c==a){return true}}return false},scrollTo:function(a){a=$(a);var c=Element.cumulativeOffset(a);window.scrollTo(c[0],c[1]);return a},getStyle:function(c,d){c=$(c);d=d=="float"?"cssFloat":d.camelize();var f=c.style[d];if(!f||f=="auto"){var a=document.defaultView.getComputedStyle(c,null);f=a?a[d]:null}if(d=="opacity"){return f?parseFloat(f):1}return f=="auto"?null:f},getOpacity:function(a){return $(a).getStyle("opacity")},setStyle:function(c,d){c=$(c);var g=c.style,a;if(Object.isString(d)){c.style.cssText+=";"+d;return d.include("opacity")?c.setOpacity(d.match(/opacity:\s*(\d?\.?\d*)/)[1]):c}for(var f in d){if(f=="opacity"){c.setOpacity(d[f])}else{g[(f=="float"||f=="cssFloat")?(Object.isUndefined(g.styleFloat)?"cssFloat":"styleFloat"):f]=d[f]}}return c},setOpacity:function(a,c){a=$(a);a.style.opacity=(c==1||c==="")?"":(c<0.00001)?0:c;return a},makePositioned:function(a){a=$(a);var c=Element.getStyle(a,"position");if(c=="static"||!c){a._madePositioned=true;a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""}return a},makeClipping:function(a){a=$(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=$(a);if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},cumulativeOffset:function(c){var a=0,d=0;if(c.parentNode){do{a+=c.offsetTop||0;d+=c.offsetLeft||0;c=c.offsetParent}while(c)}return Element._returnOffset(d,a)},positionedOffset:function(c){var a=0,f=0;do{a+=c.offsetTop||0;f+=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(f,a)},absolutize:function(c){c=$(c);if(Element.getStyle(c,"position")=="absolute"){return c}var f=Element.positionedOffset(c),h=f[1],g=f[0],d=c.clientWidth,a=c.clientHeight;c._originalLeft=g-parseFloat(c.style.left||0);c._originalTop=h-parseFloat(c.style.top||0);c._originalWidth=c.style.width;c._originalHeight=c.style.height;c.style.position="absolute";c.style.top=h+"px";c.style.left=g+"px";c.style.width=d+"px";c.style.height=a+"px";return c},relativize:function(a){a=$(a);if(Element.getStyle(a,"position")=="relative"){return a}a.style.position="relative";var d=parseFloat(a.style.top||0)-(a._originalTop||0),c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=d+"px";a.style.left=c+"px";a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(c){var a=0,d=0;do{a+=c.scrollTop||0;d+=c.scrollLeft||0;c=c.parentNode}while(c);return Element._returnOffset(d,a)},getOffsetParent:function(a){if(a.offsetParent){return $(a.offsetParent)}if(a==document.body){return $(a)}while((a=a.parentNode)&&a!=document.body){if(Element.getStyle(a,"position")!="static"){return $(a)}}return $(document.body)},viewportOffset:function(f){var a=0,d=0,c=f;do{a+=c.offsetTop||0;d+=c.offsetLeft||0;if(c.offsetParent==document.body&&Element.getStyle(c,"position")=="absolute"){break}}while(c=c.offsetParent);c=f;do{if(!Prototype.Browser.Opera||(c.tagName&&(c.tagName.toUpperCase()=="BODY"))){a-=c.scrollTop||0;d-=c.scrollLeft||0}}while(c=c.parentNode);return Element._returnOffset(d,a)},clonePosition:function(c,f){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});f=$(f);var g=Element.viewportOffset(f),h=[0,0],d=null;c=$(c);if(Element.getStyle(c,"position")=="absolute"){d=Element.getOffsetParent(c);h=Element.viewportOffset(d)}if(d==document.body){h[0]-=document.body.offsetLeft;h[1]-=document.body.offsetTop}if(a.setLeft){c.style.left=(g[0]-h[0]+a.offsetLeft)+"px"}if(a.setTop){c.style.top=(g[1]-h[1]+a.offsetTop)+"px"}if(a.setWidth){c.style.width=f.offsetWidth+"px"}if(a.setHeight){c.style.height=f.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(f,c,d){switch(d){case"left":case"top":case"right":case"bottom":if(f(c,"position")==="static"){return null}case"height":case"width":if(!Element.visible(c)){return null}var g=parseInt(f(c,d),10);if(g!==c["offset"+d.capitalize()]){return g+"px"}var a;if(d==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(g,function(h,j){var k=f(c,j);return k===null?h:h-parseInt(k,10)})+"px";default:return f(c,d)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(d,a,c){if(c==="title"){return a.title}return d(a,c)})}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(d,c){c=$(c);if(!c.parentNode){return $(document.body)}var a=c.getStyle("position");if(a!=="static"){return d(c)}c.setStyle({position:"relative"});var f=d(c);c.setStyle({position:a});return f});$w("positionedOffset viewportOffset").each(function(a){Element.Methods[a]=Element.Methods[a].wrap(function(g,d){d=$(d);if(!d.parentNode){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.getStyle=function(a,c){a=$(a);c=(c=="float"||c=="cssFloat")?"styleFloat":c.camelize();var d=a.style[c];if(!d&&a.currentStyle){d=a.currentStyle[c]}if(c=="opacity"){if(d=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(d[1]){return parseFloat(d[1])/100}}return 1}if(d=="auto"){if((c=="width"||c=="height")&&(a.getStyle("display")!="none")){return a["offset"+c.capitalize()]+"px"}return null}return d};Element.Methods.setOpacity=function(c,g){function h(j){return j.replace(/alpha\([^\)]*\)/gi,"")}c=$(c);var a=c.currentStyle;if((a&&!a.hasLayout)||(!a&&c.style.zoom=="normal")){c.style.zoom=1}var f=c.getStyle("filter"),d=c.style;if(g==1||g===""){(f=h(f))?d.filter=f:d.removeAttribute("filter");return c}else{if(g<0.00001){g=0}}d.filter=h(f)+"alpha(opacity="+(g*100)+")";return c};Element._attributeTranslations=(function(){var c="className",a="for",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(a,"x");if(d.htmlFor!=="x"){d.setAttribute("htmlFor","x");if(d.htmlFor==="x"){a="htmlFor"}}d=null;return{read:{names:{"class":c,className:c,"for":a,htmlFor:a},values:{_getAttr:function(f,g){return f.getAttribute(g)},_getAttr2:function(f,g){return f.getAttribute(g,2)},_getAttrNode:function(f,h){var g=f.getAttributeNode(h);return g?g.value:""},_getEv:(function(){var g=document.createElement("div"),j;g.onclick=Prototype.emptyFunction;var h=g.getAttribute("onclick");if(String(h).indexOf("{")>-1){j=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===""){j=function(f,k){k=f.getAttribute(k);if(!k){return null}return k.strip()}}}g=null;return j})(),_flag:function(f,g){return $(f).hasAttribute(g)?g:null},style:function(f){return f.style.cssText.toLowerCase()},title:function(f){return f.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,c){a.checked=!!c},style:function(a,c){a.style.cssText=c?c:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(g){var c=g.getElementsByTagName("*"),f=[];for(var d=0,h;h=c[d];d++){if(h.tagName!=="!"){f.push(h)}}return f}Element.Methods.down=function(d,f,c){d=$(d);if(arguments.length==1){return d.firstDescendant()}return Object.isNumber(f)?a(d)[f]:Element.select(d,f)[c||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,c){a=$(a);a.style.opacity=(c==1)?0.999999:(c==="")?"":(c<0.00001)?0:c;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,c){a=$(a);a.style.opacity=(c==1||c==="")?"":(c<0.00001)?0:c;if(c==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var f=document.createTextNode(" ");a.appendChild(f);a.removeChild(f)}catch(d){}}}return a};Element.Methods.cumulativeOffset=function(c){var a=0,d=0;do{a+=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,a)}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(d,g){d=$(d);if(g&&g.toElement){g=g.toElement()}if(Object.isElement(g)){d.parentNode.replaceChild(g,d);return d}g=Object.toHTML(g);var f=d.parentNode,c=f.tagName.toUpperCase();if(Element._insertionTranslations.tags[c]){var h=d.next(),a=Element._getContentFromAnonymousElement(c,g.stripScripts());f.removeChild(d);if(h){a.each(function(j){f.insertBefore(j,h)})}else{a.each(function(j){f.appendChild(j)})}}else{d.outerHTML=g.stripScripts()}g.evalScripts.bind(g).defer();return d}}Element._returnOffset=function(c,d){var a=[c,d];a.left=c;a.top=d;return a};Element._getContentFromAnonymousElement=function(f,d){var g=new Element("div"),c=Element._insertionTranslations.tags[f];if(c){g.innerHTML=c[0]+d+c[1];for(var a=c[2];a--;){g=g.firstChild}}else{g.innerHTML=d}return $A(g.childNodes)};Element._insertionTranslations={before:function(a,c){a.parentNode.insertBefore(c,a)},top:function(a,c){a.insertBefore(c,a.firstChild)},bottom:function(a,c){a.appendChild(c)},after:function(a,c){a.parentNode.insertBefore(c,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,d){d=Element._attributeTranslations.has[d]||d;var c=$(a).getAttributeNode(d);return !!(c&&c.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function d(j){if(typeof window.Element!="undefined"){var l=window.Element.prototype;if(l){var n="_"+(Math.random()+"").slice(2),k=document.createElement(j);l[n]="x";var m=(k[n]!=="x");delete l[n];k=null;return m}}return false}function c(k,j){for(var m in j){var l=j[m];if(Object.isFunction(l)&&!(m in k)){k[m]=l.methodize()}}}var f=d("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(f){return function(k){if(k&&typeof k._extendedByPrototype=="undefined"){var j=k.tagName;if(j&&(/^(?:object|applet|embed)$/i.test(j))){c(k,Element.Methods);c(k,Element.Methods.Simulated);c(k,Element.Methods.ByTag[j.toUpperCase()])}}return k}}return Prototype.K}var a={},g=Element.Methods.ByTag;var h=Object.extend(function(l){if(!l||typeof l._extendedByPrototype!="undefined"||l.nodeType!=1||l==window){return l}var j=Object.clone(a),k=l.tagName.toUpperCase();if(g[k]){Object.extend(j,g[k])}c(l,j);l._extendedByPrototype=Prototype.emptyFunction;return l},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);Object.extend(a,Element.Methods.Simulated)}}});h.refresh();return h})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,c){return a.hasAttribute(c)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute}Element.addMethods=function(d){var l=Prototype.BrowserFeatures,f=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(j)}else{j(c)}}function j(n){n=n.toUpperCase();if(!Element.Methods.ByTag[n]){Element.Methods.ByTag[n]={}}Object.extend(Element.Methods.ByTag[n],d)}function a(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 g(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),r=o.__proto__||o.constructor.prototype;o=null;return r}var k=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(l.ElementExtensions){a(Element.Methods,k);a(Element.Methods.Simulated,k,true)}if(l.SpecificElementExtensions){for(var m in Element.Methods.ByTag){var h=g(m);if(Object.isUndefined(h)){continue}a(f[m],h.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 j=Prototype.Browser,g=document,d,f={};function a(){if(j.WebKit&&!g.evaluate){return document}if(j.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement}function h(k){if(!d){d=a()}f[k]="client"+k;c["get"+k]=function(){return d[f[k]]};return c["get"+k]()}c.getWidth=h.curry("Width");c.getHeight=h.curry("Height")})(document.viewport);Element.Storage={UID:1};Element.addMethods({getStorage:function(c){if(!(c=$(c))){return}var a;if(c===window){a=0}else{if(typeof c._prototypeUID==="undefined"){c._prototypeUID=[Element.Storage.UID++]}a=c._prototypeUID[0]}if(!Element.Storage[a]){Element.Storage[a]=$H()}return Element.Storage[a]},store:function(c,a,d){if(!(c=$(c))){return}if(arguments.length===2){Element.getStorage(c).update(a)}else{Element.getStorage(c).set(a,d)}return c},retrieve:function(d,c,a){if(!(d=$(d))){return}var g=Element.getStorage(d),f=g.get(c);if(Object.isUndefined(f)){g.set(c,a);f=a}return f},clone:function(d,a){if(!(d=$(d))){return}var g=d.cloneNode(a);g._prototypeUID=void 0;if(a){var f=Element.select(g,"*"),c=f.length;while(c--){f[c]._prototypeUID=void 0}}return Element.extend(g)}});Prototype._original_property=window.Sizzle;
/*
 * Sizzle CSS Selector Engine - v1.0
 *  Copyright 2009, The Dojo Foundation
 *  Released under the MIT, BSD, and GPL Licenses.
 *  More information: http://sizzlejs.com/
 */
(function(){var s=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,l=0,f=Object.prototype.toString,q=false,k=true;[0,0].sort(function(){k=false;return 0});var c=function(H,x,E,z){E=E||[];var u=x=x||document;if(x.nodeType!==1&&x.nodeType!==9){return[]}if(!H||typeof H!=="string"){return E}var F=[],G,C,L,K,D,w,v=true,A=r(x),J=H;while((s.exec(""),G=s.exec(J))!==null){J=G[3];F.push(G[1]);if(G[2]){w=G[3];break}}if(F.length>1&&m.exec(H)){if(F.length===2&&g.relative[F[0]]){C=h(F[0]+F[1],x)}else{C=g.relative[F[0]]?[x]:c(F.shift(),x);while(F.length){H=F.shift();if(g.relative[H]){H+=F.shift()}C=h(H,C)}}}else{if(!z&&F.length>1&&x.nodeType===9&&!A&&g.match.ID.test(F[0])&&!g.match.ID.test(F[F.length-1])){var M=c.find(F.shift(),x,A);x=M.expr?c.filter(M.expr,M.set)[0]:M.set[0]}if(x){var M=z?{expr:F.pop(),set:a(z)}:c.find(F.pop(),F.length===1&&(F[0]==="~"||F[0]==="+")&&x.parentNode?x.parentNode:x,A);C=M.expr?c.filter(M.expr,M.set):M.set;if(F.length>0){L=a(C)}else{v=false}while(F.length){var y=F.pop(),B=y;if(!g.relative[y]){y=""}else{B=F.pop()}if(B==null){B=x}g.relative[y](L,B,A)}}else{L=F=[]}}if(!L){L=C}if(!L){throw"Syntax error, unrecognized expression: "+(y||H)}if(f.call(L)==="[object Array]"){if(!v){E.push.apply(E,L)}else{if(x&&x.nodeType===1){for(var I=0;L[I]!=null;I++){if(L[I]&&(L[I]===true||L[I].nodeType===1&&j(x,L[I]))){E.push(C[I])}}}else{for(var I=0;L[I]!=null;I++){if(L[I]&&L[I].nodeType===1){E.push(C[I])}}}}}else{a(L,E)}if(w){c(w,u,E,z);c.uniqueSort(E)}return E};c.uniqueSort=function(v){if(d){q=k;v.sort(d);if(q){for(var u=1;u<v.length;u++){if(v[u]===v[u-1]){v.splice(u--,1)}}}}return v};c.matches=function(u,v){return c(u,null,null,v)};c.find=function(B,u,C){var A,y;if(!B){return[]}for(var x=0,w=g.order.length;x<w;x++){var z=g.order[x],y;if((y=g.leftMatch[z].exec(B))){var v=y[1];y.splice(1,1);if(v.substr(v.length-1)!=="\\"){y[1]=(y[1]||"").replace(/\\/g,"");A=g.find[z](y,u,C);if(A!=null){B=B.replace(g.match[z],"");break}}}}if(!A){A=u.getElementsByTagName("*")}return{set:A,expr:B}};c.filter=function(E,D,H,x){var w=E,J=[],B=D,z,u,A=D&&D[0]&&r(D[0]);while(E&&D.length){for(var C in g.filter){if((z=g.match[C].exec(E))!=null){var v=g.filter[C],I,G;u=false;if(B==J){J=[]}if(g.preFilter[C]){z=g.preFilter[C](z,B,H,J,x,A);if(!z){u=I=true}else{if(z===true){continue}}}if(z){for(var y=0;(G=B[y])!=null;y++){if(G){I=v(G,z,y,B);var F=x^!!I;if(H&&I!=null){if(F){u=true}else{B[y]=false}}else{if(F){J.push(G);u=true}}}}}if(I!==undefined){if(!H){B=J}E=E.replace(g.match[C],"");if(!u){return[]}break}}}if(E==w){if(u==null){throw"Syntax error, unrecognized expression: "+E}else{break}}w=E}return B};var g=c.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(u){return u.getAttribute("href")}},relative:{"+":function(B,u,A){var y=typeof u==="string",C=y&&!/\W/.test(u),z=y&&!C;if(C&&!A){u=u.toUpperCase()}for(var x=0,w=B.length,v;x<w;x++){if((v=B[x])){while((v=v.previousSibling)&&v.nodeType!==1){}B[x]=z||v&&v.nodeName===u?v||false:v===u}}if(z){c.filter(u,B,true)}},">":function(A,v,B){var y=typeof v==="string";if(y&&!/\W/.test(v)){v=B?v:v.toUpperCase();for(var w=0,u=A.length;w<u;w++){var z=A[w];if(z){var x=z.parentNode;A[w]=x.nodeName===v?x:false}}}else{for(var w=0,u=A.length;w<u;w++){var z=A[w];if(z){A[w]=y?z.parentNode:z.parentNode===v}}if(y){c.filter(v,A,true)}}},"":function(x,v,z){var w=l++,u=t;if(!/\W/.test(v)){var y=v=z?v:v.toUpperCase();u=p}u("parentNode",v,w,x,y,z)},"~":function(x,v,z){var w=l++,u=t;if(typeof v==="string"&&!/\W/.test(v)){var y=v=z?v:v.toUpperCase();u=p}u("previousSibling",v,w,x,y,z)}},find:{ID:function(v,w,x){if(typeof w.getElementById!=="undefined"&&!x){var u=w.getElementById(v[1]);return u?[u]:[]}},NAME:function(w,z,A){if(typeof z.getElementsByName!=="undefined"){var v=[],y=z.getElementsByName(w[1]);for(var x=0,u=y.length;x<u;x++){if(y[x].getAttribute("name")===w[1]){v.push(y[x])}}return v.length===0?null:v}},TAG:function(u,v){return v.getElementsByTagName(u[1])}},preFilter:{CLASS:function(x,v,w,u,A,B){x=" "+x[1].replace(/\\/g,"")+" ";if(B){return x}for(var y=0,z;(z=v[y])!=null;y++){if(z){if(A^(z.className&&(" "+z.className+" ").indexOf(x)>=0)){if(!w){u.push(z)}}else{if(w){v[y]=false}}}}return false},ID:function(u){return u[1].replace(/\\/g,"")},TAG:function(v,u){for(var w=0;u[w]===false;w++){}return u[w]&&r(u[w])?v[1]:v[1].toUpperCase()},CHILD:function(u){if(u[1]=="nth"){var v=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(u[2]=="even"&&"2n"||u[2]=="odd"&&"2n+1"||!/\D/.test(u[2])&&"0n+"+u[2]||u[2]);u[2]=(v[1]+(v[2]||1))-0;u[3]=v[3]-0}u[0]=l++;return u},ATTR:function(y,v,w,u,z,A){var x=y[1].replace(/\\/g,"");if(!A&&g.attrMap[x]){y[1]=g.attrMap[x]}if(y[2]==="~="){y[4]=" "+y[4]+" "}return y},PSEUDO:function(y,v,w,u,z){if(y[1]==="not"){if((s.exec(y[3])||"").length>1||/^\w/.test(y[3])){y[3]=c(y[3],null,null,v)}else{var x=c.filter(y[3],v,w,true^z);if(!w){u.push.apply(u,x)}return false}}else{if(g.match.POS.test(y[0])||g.match.CHILD.test(y[0])){return true}}return y},POS:function(u){u.unshift(true);return u}},filters:{enabled:function(u){return u.disabled===false&&u.type!=="hidden"},disabled:function(u){return u.disabled===true},checked:function(u){return u.checked===true},selected:function(u){u.parentNode.selectedIndex;return u.selected===true},parent:function(u){return !!u.firstChild},empty:function(u){return !u.firstChild},has:function(w,v,u){return !!c(u[3],w).length},header:function(u){return/h\d/i.test(u.nodeName)},text:function(u){return"text"===u.type},radio:function(u){return"radio"===u.type},checkbox:function(u){return"checkbox"===u.type},file:function(u){return"file"===u.type},password:function(u){return"password"===u.type},submit:function(u){return"submit"===u.type},image:function(u){return"image"===u.type},reset:function(u){return"reset"===u.type},button:function(u){return"button"===u.type||u.nodeName.toUpperCase()==="BUTTON"},input:function(u){return/input|select|textarea|button/i.test(u.nodeName)}},setFilters:{first:function(v,u){return u===0},last:function(w,v,u,x){return v===x.length-1},even:function(v,u){return u%2===0},odd:function(v,u){return u%2===1},lt:function(w,v,u){return v<u[3]-0},gt:function(w,v,u){return v>u[3]-0},nth:function(w,v,u){return u[3]-0==v},eq:function(w,v,u){return u[3]-0==v}},filter:{PSEUDO:function(A,w,x,B){var v=w[1],y=g.filters[v];if(y){return y(A,x,w,B)}else{if(v==="contains"){return(A.textContent||A.innerText||"").indexOf(w[3])>=0}else{if(v==="not"){var z=w[3];for(var x=0,u=z.length;x<u;x++){if(z[x]===A){return false}}return true}}}},CHILD:function(u,x){var A=x[1],v=u;switch(A){case"only":case"first":while((v=v.previousSibling)){if(v.nodeType===1){return false}}if(A=="first"){return true}v=u;case"last":while((v=v.nextSibling)){if(v.nodeType===1){return false}}return true;case"nth":var w=x[2],D=x[3];if(w==1&&D==0){return true}var z=x[0],C=u.parentNode;if(C&&(C.sizcache!==z||!u.nodeIndex)){var y=0;for(v=C.firstChild;v;v=v.nextSibling){if(v.nodeType===1){v.nodeIndex=++y}}C.sizcache=z}var B=u.nodeIndex-D;if(w==0){return B==0}else{return(B%w==0&&B/w>=0)}}},ID:function(v,u){return v.nodeType===1&&v.getAttribute("id")===u},TAG:function(v,u){return(u==="*"&&v.nodeType===1)||v.nodeName===u},CLASS:function(v,u){return(" "+(v.className||v.getAttribute("class"))+" ").indexOf(u)>-1},ATTR:function(z,x){var w=x[1],u=g.attrHandle[w]?g.attrHandle[w](z):z[w]!=null?z[w]:z.getAttribute(w),A=u+"",y=x[2],v=x[4];return u==null?y==="!=":y==="="?A===v:y==="*="?A.indexOf(v)>=0:y==="~="?(" "+A+" ").indexOf(v)>=0:!v?A&&u!==false:y==="!="?A!=v:y==="^="?A.indexOf(v)===0:y==="$="?A.substr(A.length-v.length)===v:y==="|="?A===v||A.substr(0,v.length+1)===v+"-":false},POS:function(y,v,w,z){var u=v[2],x=g.setFilters[u];if(x){return x(y,w,v,z)}}}};var m=g.match.POS;for(var o in g.match){g.match[o]=new RegExp(g.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source);g.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+g.match[o].source)}var a=function(v,u){v=Array.prototype.slice.call(v,0);if(u){u.push.apply(u,v);return u}return v};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(n){a=function(y,x){var v=x||[];if(f.call(y)==="[object Array]"){Array.prototype.push.apply(v,y)}else{if(typeof y.length==="number"){for(var w=0,u=y.length;w<u;w++){v.push(y[w])}}else{for(var w=0;y[w];w++){v.push(y[w])}}}return v}}var d;if(document.documentElement.compareDocumentPosition){d=function(v,u){if(!v.compareDocumentPosition||!u.compareDocumentPosition){if(v==u){q=true}return 0}var w=v.compareDocumentPosition(u)&4?-1:v===u?0:1;if(w===0){q=true}return w}}else{if("sourceIndex" in document.documentElement){d=function(v,u){if(!v.sourceIndex||!u.sourceIndex){if(v==u){q=true}return 0}var w=v.sourceIndex-u.sourceIndex;if(w===0){q=true}return w}}else{if(document.createRange){d=function(x,v){if(!x.ownerDocument||!v.ownerDocument){if(x==v){q=true}return 0}var w=x.ownerDocument.createRange(),u=v.ownerDocument.createRange();w.setStart(x,0);w.setEnd(x,0);u.setStart(v,0);u.setEnd(v,0);var y=w.compareBoundaryPoints(Range.START_TO_END,u);if(y===0){q=true}return y}}}}(function(){var v=document.createElement("div"),w="script"+(new Date).getTime();v.innerHTML="<a name='"+w+"'/>";var u=document.documentElement;u.insertBefore(v,u.firstChild);if(!!document.getElementById(w)){g.find.ID=function(y,z,A){if(typeof z.getElementById!=="undefined"&&!A){var x=z.getElementById(y[1]);return x?x.id===y[1]||typeof x.getAttributeNode!=="undefined"&&x.getAttributeNode("id").nodeValue===y[1]?[x]:undefined:[]}};g.filter.ID=function(z,x){var y=typeof z.getAttributeNode!=="undefined"&&z.getAttributeNode("id");return z.nodeType===1&&y&&y.nodeValue===x}}u.removeChild(v);u=v=null})();(function(){var u=document.createElement("div");u.appendChild(document.createComment(""));if(u.getElementsByTagName("*").length>0){g.find.TAG=function(v,z){var y=z.getElementsByTagName(v[1]);if(v[1]==="*"){var x=[];for(var w=0;y[w];w++){if(y[w].nodeType===1){x.push(y[w])}}y=x}return y}}u.innerHTML="<a href='#'></a>";if(u.firstChild&&typeof u.firstChild.getAttribute!=="undefined"&&u.firstChild.getAttribute("href")!=="#"){g.attrHandle.href=function(v){return v.getAttribute("href",2)}}u=null})();if(document.querySelectorAll){(function(){var u=c,w=document.createElement("div");w.innerHTML="<p class='TEST'></p>";if(w.querySelectorAll&&w.querySelectorAll(".TEST").length===0){return}c=function(A,z,x,y){z=z||document;if(!y&&z.nodeType===9&&!r(z)){try{return a(z.querySelectorAll(A),x)}catch(B){}}return u(A,z,x,y)};for(var v in u){c[v]=u[v]}w=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var u=document.createElement("div");u.innerHTML="<div class='test e'></div><div class='test'></div>";if(u.getElementsByClassName("e").length===0){return}u.lastChild.className="e";if(u.getElementsByClassName("e").length===1){return}g.order.splice(1,0,"CLASS");g.find.CLASS=function(v,w,x){if(typeof w.getElementsByClassName!=="undefined"&&!x){return w.getElementsByClassName(v[1])}};u=null})()}function p(v,A,z,E,B,D){var C=v=="previousSibling"&&!D;for(var x=0,w=E.length;x<w;x++){var u=E[x];if(u){if(C&&u.nodeType===1){u.sizcache=z;u.sizset=x}u=u[v];var y=false;while(u){if(u.sizcache===z){y=E[u.sizset];break}if(u.nodeType===1&&!D){u.sizcache=z;u.sizset=x}if(u.nodeName===A){y=u;break}u=u[v]}E[x]=y}}}function t(v,A,z,E,B,D){var C=v=="previousSibling"&&!D;for(var x=0,w=E.length;x<w;x++){var u=E[x];if(u){if(C&&u.nodeType===1){u.sizcache=z;u.sizset=x}u=u[v];var y=false;while(u){if(u.sizcache===z){y=E[u.sizset];break}if(u.nodeType===1){if(!D){u.sizcache=z;u.sizset=x}if(typeof A!=="string"){if(u===A){y=true;break}}else{if(c.filter(A,[u]).length>0){y=u;break}}}u=u[v]}E[x]=y}}}var j=document.compareDocumentPosition?function(v,u){return v.compareDocumentPosition(u)&16}:function(v,u){return v!==u&&(v.contains?v.contains(u):true)};var r=function(u){return u.nodeType===9&&u.documentElement.nodeName!=="HTML"||!!u.ownerDocument&&u.ownerDocument.documentElement.nodeName!=="HTML"};var h=function(u,B){var x=[],y="",z,w=B.nodeType?[B]:B;while((z=g.match.PSEUDO.exec(u))){y+=z[0];u=u.replace(g.match.PSEUDO,"")}u=g.relative[u]?u+"*":u;for(var A=0,v=w.length;A<v;A++){c(u,w[A],x)}return c.filter(y,x)};window.Sizzle=c})();Prototype.Selector=(function(d){function f(j){for(var g=0,h=j.length;g<h;g++){Element.extend(j[g])}return j}function a(g,h){return f(d(g,h||document))}function c(h,g){return d.matches(g,[h]).length==1}return{engine:d,select:a,match:c}})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;(function(){function j(w){var v=w.match(/^(\d+)%?$/i);if(!v){return null}return(Number(v[1])/100)}function p(z,y){if(Object.isElement(z)){element=z;z=element.getStyle(y)}if(z===null){return null}if((/^\d+(\.\d+)?(px)?$/i).test(z)){return window.parseFloat(z)}if(/\d/.test(z)&&element.runtimeStyle){var w=element.style.left,A=element.runtimeStyle.left;element.runtimeStyle.left=element.currentStyle.left;element.style.left=z||0;z=element.style.pixelLeft;element.style.left=w;element.runtimeStyle.left=A;return z}if(z.include("%")){var v=j(z);var x;if(y.include("left")||y.include("right")||y.include("width")){x=$(element.parentNode).measure("width")}else{if(y.include("top")||y.include("bottom")||y.include("height")){x=$(element.parentNode).measure("height")}}return x*v}return 0}function h(v){if(Object.isString(v)&&v.endsWith("px")){return v}return v+"px"}function l(w){var v=w;while(w&&w.parentNode){var x=w.getStyle("display");if(x==="none"){return false}w=$(w.parentNode)}return true}var f=Prototype.K;if("currentStyle" in document.documentElement){f=function(v){if(!v.currentStyle.hasLayout){v.style.zoom=1}return v}}function g(v){if(v.includes("border")){return v+"-width"}return v}Element.Layout=Class.create(Hash,{initialize:function($super,w,v){$super();this.element=$(w);Element.Layout.PROPERTIES.each(function(x){this._set(x,null)},this);if(v){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(w,v){return Hash.prototype.set.call(this,w,v)},set:function(w,v){throw"Properties of Element.Layout are read-only."},get:function($super,w){var v=$super(w);return v===null?this._compute(w):v},_begin:function(){if(this._prepared){return}var y=this.element;if(l(y)){this._prepared=true;return}var x={position:y.style.position||"",width:y.style.width||"",visibility:y.style.visibility||"",display:y.style.display||""};y.store("prototype_original_styles",x);var v=y.getStyle("position"),A=y.getStyle("width");y.setStyle({position:"absolute",visibility:"hidden",display:"block"});var C=y.getStyle("width");var B;if(A&&(C===A)){B=p(A)}else{if(A&&(v==="absolute"||v==="fixed")){B=p(A)}else{var z=y.parentNode,w=$(z).getLayout();B=w.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")}}y.setStyle({width:B+"px"});this._prepared=true},_end:function(){var w=this.element;var v=w.retrieve("prototype_original_styles");w.store("prototype_original_styles",null);w.setStyle(v);this._prepared=false},_compute:function(w){var v=Element.Layout.COMPUTATIONS;if(!(w in v)){throw"Property not found."}return this._set(w,v[w].call(this,this.element))},toCSS:function(){var v=$A(arguments);var x=(v.length===0)?Element.Layout.PROPERTIES:v.join(" ").split(" ");var w={};x.each(function(y){if(!Element.Layout.PROPERTIES.include(y)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(y)){return}var z=this.get(y);if(z){w[g(y)]=z+"px"}});return w},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(x){if(!this._preComputing){this._begin()}var v=this.get("border-box-height");if(v<=0){return 0}var y=this.get("border-top"),w=this.get("border-bottom");var A=this.get("padding-top"),z=this.get("padding-bottom");if(!this._preComputing){this._end()}return v-y-w-A-z},width:function(x){if(!this._preComputing){this._begin()}var w=this.get("border-box-width");if(w<=0){return 0}var A=this.get("border-left"),v=this.get("border-right");var y=this.get("padding-left"),z=this.get("padding-right");if(!this._preComputing){this._end()}return w-A-v-y-z},"padding-box-height":function(w){var v=this.get("height"),y=this.get("padding-top"),x=this.get("padding-bottom");return v+y+x},"padding-box-width":function(v){var w=this.get("width"),x=this.get("padding-left"),y=this.get("padding-right");return w+x+y},"border-box-height":function(v){return v.offsetHeight},"border-box-width":function(v){return v.offsetWidth},"margin-box-height":function(w){var v=this.get("border-box-height"),x=this.get("margin-top"),y=this.get("margin-bottom");if(v<=0){return 0}return v+x+y},"margin-box-width":function(x){var w=this.get("border-box-width"),y=this.get("margin-left"),v=this.get("margin-right");if(w<=0){return 0}return w+y+v},top:function(v){var w=v.positionedOffset();return w.top},bottom:function(v){var y=v.positionedOffset(),w=v.getOffsetParent(),x=w.measure("height");var z=this.get("border-box-height");return x-z-y.top},left:function(v){var w=v.positionedOffset();return w.left},right:function(x){var z=x.positionedOffset(),y=x.getOffsetParent(),v=y.measure("width");var w=this.get("border-box-width");return v-w-z.left},"padding-top":function(v){return p(v,"paddingTop")},"padding-bottom":function(v){return p(v,"paddingBottom")},"padding-left":function(v){return p(v,"paddingLeft")},"padding-right":function(v){return p(v,"paddingRight")},"border-top":function(v){return Object.isNumber(v.clientTop)?v.clientTop:p(v,"borderTopWidth")},"border-bottom":function(v){return Object.isNumber(v.clientBottom)?v.clientBottom:p(v,"borderBottomWidth")},"border-left":function(v){return Object.isNumber(v.clientLeft)?v.clientLeft:p(v,"borderLeftWidth")},"border-right":function(v){return Object.isNumber(v.clientRight)?v.clientRight:p(v,"borderRightWidth")},"margin-top":function(v){return p(v,"marginTop")},"margin-bottom":function(v){return p(v,"marginBottom")},"margin-left":function(v){return p(v,"marginLeft")},"margin-right":function(v){return p(v,"marginRight")}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(w){var x=f(w.getOffsetParent());var y=w.getBoundingClientRect(),v=x.getBoundingClientRect();return(v.right-y.right).round()},bottom:function(w){var x=f(w.getOffsetParent());var y=w.getBoundingClientRect(),v=x.getBoundingClientRect();return(v.bottom-y.bottom).round()}})}Element.Offset=Class.create({initialize:function(w,v){this.left=w.round();this.top=v.round();this[0]=this.left;this[1]=this.top},relativeTo:function(v){return new Element.Offset(this.left-v.left,this.top-v.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function s(w,v){return new Element.Layout(w,v)}function c(v,w){return $(v).getLayout().get(w)}function o(v){var w=$(v).getLayout();return{width:w.get("width"),height:w.get("height")}}function m(v){if(d(v)){return $(document.body)}var w=(Element.getStyle(v,"display")==="inline");if(!w&&v.offsetParent){return $(v.offsetParent)}if(v===document.body){return $(v)}while((v=v.parentNode)&&v!==document.body){if(Element.getStyle(v,"position")!=="static"){return(v.nodeName==="HTML")?$(document.body):$(v)}}return $(document.body)}function u(w){var v=0,x=0;do{v+=w.offsetTop||0;x+=w.offsetLeft||0;w=w.offsetParent}while(w);return new Element.Offset(x,v)}function q(w){var x=w.getLayout();var v=0,z=0;do{v+=w.offsetTop||0;z+=w.offsetLeft||0;w=w.offsetParent;if(w){if(n(w)){break}var y=Element.getStyle(w,"position");if(y!=="static"){break}}}while(w);z-=x.get("margin-top");v-=x.get("margin-left");return new Element.Offset(z,v)}function a(w){var v=0,x=0;do{v+=w.scrollTop||0;x+=w.scrollLeft||0;w=w.parentNode}while(w);return new Element.Offset(x,v)}function t(z){var v=0,y=0,x=document.body;var w=z;do{v+=w.offsetTop||0;y+=w.offsetLeft||0;if(w.offsetParent==x&&Element.getStyle(w,"position")=="absolute"){break}}while(w=w.offsetParent);w=z;do{if(w!=x){v-=w.scrollTop||0;y-=w.scrollLeft||0}}while(w=w.parentNode);return new Element.Offset(y,v)}function r(v){v=$(v);if(Element.getStyle(v,"position")==="absolute"){return v}var z=m(v);var y=v.viewportOffset(),w=z.viewportOffset();var A=y.relativeTo(w);var x=v.get("layout");v.store("prototype_absolutize_original_styles",{left:v.getStyle("left"),top:v.getStyle("top"),width:v.getStyle("width"),height:v.getStyle("height")});v.setStyle({position:"absolute",top:A.top+"px",left:A.left+"px",width:x.get("width")+"px",height:x.get("height")+"px"});return v}function k(w){w=$(w);if(Element.getStyle(w,"position")==="relative"){return w}var v=w.retrieve("prototype_absolutize_original_styles");if(v){w.setStyle(v)}return w}Element.addMethods({getLayout:s,measure:c,getDimensions:o,getOffsetParent:m,cumulativeOffset:u,positionedOffset:q,cumulativeScrollOffset:a,viewportOffset:t,absolutize:r,relativize:k});function n(v){return v.nodeName.toUpperCase()==="BODY"}function d(v){return v!==document.body&&!Element.descendantOf(v,document.body)}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(v){v=$(v);if(d(v)){return new Element.Offset(0,0)}var w=v.getBoundingClientRect(),x=document.documentElement;return new Element.Offset(w.left-x.clientLeft,w.top-x.clientTop)},cumulativeOffset:function(x){x=$(x);if(d(x)){return new Element.Offset(0,0)}var v=$(document.documentElement).viewportOffset(),w=x.viewportOffset();return w.relativeTo(v)},positionedOffset:function(w){w=$(w);var y=w.getOffsetParent();if(d(w)){return new Element.Offset(0,0)}if(w.offsetParent&&w.offsetParent.nodeName.toUpperCase()==="HTML"){return q(w)}var A=w.viewportOffset(),x=n(y)?t(y):y.viewportOffset();var v=A.relativeTo(x);var z=w.getLayout();var C=v.top-z.get("margin-top");var B=v.left-z.get("margin-left");return new Element.Offset(B,C)}})}})();window.$$=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};if(!Prototype.Selector.find){Prototype.Selector.find=function(h,j,d){if(Object.isUndefined(d)){d=0}var c=Prototype.Selector.match,g=h.length,a=0,f;for(f=0;f<g;f++){if(c(h[f],j)&&d==a++){return Element.extend(h[f])}}}}var Form={reset:function(a){a=$(a);a.reset();return a},serializeElements:function(j,c){if(typeof c!="object"){c={hash:!!c}}else{if(Object.isUndefined(c.hash)){c.hash=true}}var d,h,a=false,g=c.submit;var f=j.inject({},function(k,l){if(!l.disabled&&l.name){d=l.name;h=$(l).getValue();if(h!=null&&l.type!="file"&&(l.type!="submit"||(!a&&g!==false&&(!g||d==g)&&(a=true)))){if(d in k){if(!Object.isArray(k[d])){k[d]=[k[d]]}k[d].push(h)}else{k[d]=h}}}return k});return c.hash?f:Object.toQueryString(f)}};Form.Methods={serialize:function(c,a){return Form.serializeElements(Form.getElements(c),a)},getElements:function(g){var h=$(g).getElementsByTagName("*"),f,a=[],d=Form.Element.Serializers;for(var c=0;f=h[c];c++){a.push(f)}return a.inject([],function(j,k){if(d[k.tagName.toLowerCase()]){j.push(Element.extend(k))}return j})},getInputs:function(j,d,f){j=$(j);var a=j.getElementsByTagName("input");if(!d&&!f){return $A(a).map(Element.extend)}for(var g=0,k=[],h=a.length;g<h;g++){var c=a[g];if((d&&c.type!=d)||(f&&c.name!=f)){continue}k.push(Element.extend(c))}return k},disable:function(a){a=$(a);Form.getElements(a).invoke("disable");return a},enable:function(a){a=$(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(c){var d=$(c).getElements().findAll(function(f){return"hidden"!=f.type&&!f.disabled});var a=d.findAll(function(f){return f.hasAttribute("tabIndex")&&f.tabIndex>=0}).sortBy(function(f){return f.tabIndex}).first();return a?a:d.find(function(f){return/^(?:input|select|textarea)$/i.test(f.tagName)})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(c,a){c=$(c),a=Object.clone(a||{});var f=a.parameters,d=c.readAttribute("action")||"";if(d.blank()){d=window.location.href}a.parameters=c.serialize(true);if(f){if(Object.isString(f)){f=f.toQueryParams()}Object.extend(a.parameters,f)}if(c.hasAttribute("method")&&!a.method){a.method=c.method}return new Ajax.Request(d,a)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var c=a.getValue();if(c!=undefined){var d={};d[a.name]=c;return Object.toQueryString(d)}}return""},getValue:function(a){a=$(a);var c=a.tagName.toLowerCase();return Form.Element.Serializers[c](a)},setValue:function(a,c){a=$(a);var d=a.tagName.toLowerCase();Form.Element.Serializers[d](a,c);return a},clear:function(a){$(a).value="";return a},present:function(a){return $(a).value!=""},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(c){}return a},disable:function(a){a=$(a);a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,c){switch(a.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(a,c);default:return Form.Element.Serializers.textarea(a,c)}},inputSelector:function(a,c){if(Object.isUndefined(c)){return a.checked?a.value:null}else{a.checked=!!c}},textarea:function(a,c){if(Object.isUndefined(c)){return a.value}else{a.value=c}},select:function(d,h){if(Object.isUndefined(h)){return this[d.type=="select-one"?"selectOne":"selectMany"](d)}else{var c,f,j=!Object.isArray(h);for(var a=0,g=d.length;a<g;a++){c=d.options[a];f=this.optionValue(c);if(j){if(f==h){c.selected=true;return}}else{c.selected=h.include(f)}}}},selectOne:function(c){var a=c.selectedIndex;return a>=0?this.optionValue(c.options[a]):null},selectMany:function(f){var a,g=f.length;if(!g){return null}for(var d=0,a=[];d<g;d++){var c=f.options[d];if(c.selected){a.push(this.optionValue(c))}}return a},optionValue:function(a){return Element.extend(a).hasAttribute("value")?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,c,d){$super(d,c);this.element=$(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,c){this.element=$(a);this.callback=c;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});(function(){var A={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};var g=document.documentElement;var B="onmouseenter" in g&&"onmouseleave" in g;var t;if(Prototype.Browser.IE){var l={0:1,1:4,2:2};t=function(D,C){return D.button===l[C]}}else{if(Prototype.Browser.WebKit){t=function(D,C){switch(C){case 0:return D.which==1&&!D.metaKey;case 1:return D.which==1&&D.metaKey;default:return false}}}else{t=function(D,C){return D.which?(D.which===C+1):(D.button===C)}}}function w(C){return t(C,0)}function v(C){return t(C,1)}function p(C){return t(C,2)}function d(E){E=A.extend(E);var D=E.target,C=E.type,F=E.currentTarget;if(F&&F.tagName){if(C==="load"||C==="error"||(C==="click"&&F.tagName.toLowerCase()==="input"&&F.type==="radio")){D=F}}if(D.nodeType==Node.TEXT_NODE){D=D.parentNode}return Element.extend(D)}function r(D,E){var C=A.element(D);if(!E){return C}while(C){if(Prototype.Selector.match(C,E)){return Element.extend(C)}C=C.parentNode}}function u(C){return{x:c(C),y:a(C)}}function c(E){var D=document.documentElement,C=document.body||{scrollLeft:0};return E.pageX||(E.clientX+(D.scrollLeft||C.scrollLeft)-(D.clientLeft||0))}function a(E){var D=document.documentElement,C=document.body||{scrollTop:0};return E.pageY||(E.clientY+(D.scrollTop||C.scrollTop)-(D.clientTop||0))}function s(C){A.extend(C);C.preventDefault();C.stopPropagation();C.stopped=true}A.Methods={isLeftClick:w,isMiddleClick:v,isRightClick:p,element:d,findElement:r,pointer:u,pointerX:c,pointerY:a,stop:s};var y=Object.keys(A.Methods).inject({},function(C,D){C[D]=A.Methods[D].methodize();return C});if(Prototype.Browser.IE){function k(D){var C;switch(D.type){case"mouseover":C=D.fromElement;break;case"mouseout":C=D.toElement;break;default:return null}return Element.extend(C)}Object.extend(y,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});A.extend=function(D,C){if(!D){return false}if(D._extendedByPrototype){return D}D._extendedByPrototype=Prototype.emptyFunction;var E=A.pointer(D);Object.extend(D,{target:D.srcElement||C,relatedTarget:k(D),pageX:E.x,pageY:E.y});return Object.extend(D,y)}}else{A.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(A.prototype,y);A.extend=Prototype.K}function q(G,F,H){var E=Element.retrieve(G,"prototype_event_registry");if(Object.isUndefined(E)){f.push(G);E=Element.retrieve(G,"prototype_event_registry",$H())}var C=E.get(F);if(Object.isUndefined(C)){C=[];E.set(F,C)}if(C.pluck("handler").include(H)){return false}var D;if(F.include(":")){D=function(I){if(Object.isUndefined(I.eventName)){return false}if(I.eventName!==F){return false}A.extend(I,G);H.call(G,I)}}else{if(!B&&(F==="mouseenter"||F==="mouseleave")){if(F==="mouseenter"||F==="mouseleave"){D=function(J){A.extend(J,G);var I=J.relatedTarget;while(I&&I!==G){try{I=I.parentNode}catch(K){I=G}}if(I===G){return}H.call(G,J)}}}else{D=function(I){A.extend(I,G);H.call(G,I)}}}D.handler=H;C.push(D);return D}function j(){for(var C=0,D=f.length;C<D;C++){A.stopObserving(f[C]);f[C]=null}}var f=[];if(Prototype.Browser.IE){window.attachEvent("onunload",j)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var o=Prototype.K,h={mouseenter:"mouseover",mouseleave:"mouseout"};if(!B){o=function(C){return(h[C]||C)}}function x(F,E,G){F=$(F);var D=q(F,E,G);if(!D){return F}if(E.include(":")){if(F.addEventListener){F.addEventListener("dataavailable",D,false)}else{F.attachEvent("ondataavailable",D);F.attachEvent("onfilterchange",D)}}else{var C=o(E);if(F.addEventListener){F.addEventListener(C,D,false)}else{F.attachEvent("on"+C,D)}}return F}function n(H,F,I){H=$(H);var E=Element.retrieve(H,"prototype_event_registry");if(!E){return H}if(!F){E.each(function(K){var J=K.key;n(H,J)});return H}var G=E.get(F);if(!G){return H}if(!I){G.each(function(J){n(H,F,J.handler)});return H}var D=G.find(function(J){return J.handler===I});if(!D){return H}if(F.include(":")){if(H.removeEventListener){H.removeEventListener("dataavailable",D,false)}else{H.detachEvent("ondataavailable",D);H.detachEvent("onfilterchange",D)}}else{var C=o(F);if(H.removeEventListener){H.removeEventListener(C,D,false)}else{H.detachEvent("on"+C,D)}}E.set(F,G.without(D));return H}function z(F,E,D,C){F=$(F);if(Object.isUndefined(C)){C=true}if(F==document&&document.createEvent&&!F.dispatchEvent){F=document.documentElement}var G;if(document.createEvent){G=document.createEvent("HTMLEvents");G.initEvent("dataavailable",true,true)}else{G=document.createEventObject();G.eventType=C?"ondataavailable":"onfilterchange"}G.eventName=E;G.memo=D||{};if(document.createEvent){F.dispatchEvent(G)}else{F.fireEvent(G.eventType,G)}return A.extend(G)}A.Handler=Class.create({initialize:function(E,D,C,F){this.element=$(E);this.eventName=D;this.selector=C;this.callback=F;this.handler=this.handleEvent.bind(this)},start:function(){A.observe(this.element,this.eventName,this.handler);return this},stop:function(){A.stopObserving(this.element,this.eventName,this.handler);return this},handleEvent:function(D){var C=this.selector?D.findElement(this.selector):this.element;if(C){this.callback.call(C,D,C)}}});function m(E,D,C,F){E=$(E);if(Object.isFunction(C)&&Object.isUndefined(F)){F=C,C=null}return new A.Handler(E,D,C,F).start()}Object.extend(A,A.Methods);Object.extend(A,{fire:z,observe:x,stopObserving:n,on:m});Element.addMethods({fire:z,observe:x,stopObserving:n,on:m});Object.extend(document,{fire:z.methodize(),observe:x.methodize(),stopObserving:n.methodize(),on:m.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,A)}else{window.Event=A}})();(function(){var f;function a(){if(document.loaded){return}if(f){window.clearTimeout(f)}document.loaded=true;document.fire("dom:loaded")}function d(){if(document.readyState==="complete"){document.stopObserving("readystatechange",d);a()}}function c(){try{document.documentElement.doScroll("left")}catch(g){f=c.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",d);if(window==top){f=c.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,c){return Element.insert(a,{before:c})},Top:function(a,c){return Element.insert(a,{top:c})},Bottom:function(a,c){return Element.insert(a,{bottom:c})},After:function(a,c){return Element.insert(a,{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,a,d){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(c,a,d)}this.xcomp=a;this.ycomp=d;this.offset=Element.cumulativeOffset(c);return(d>=this.offset[1]&&d<this.offset[1]+c.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+c.offsetWidth)},withinIncludingScrolloffsets:function(c,a,f){var d=Element.cumulativeScrollOffset(c);this.xcomp=a+d[0]-this.deltaX;this.ycomp=f+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,a){if(!c){return 0}if(c=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(c=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(c,d,a){a=a||{};return Element.clonePosition(d,c,a)}};if(!document.getElementsByClassName){document.getElementsByClassName=function(c){function a(d){return d.blank()?null:"[contains(concat(' ', @class, ' '), ' "+d+" ')]"}c.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(d,g){g=g.toString().strip();var f=/\s/.test(g)?$w(g).map(a).join(""):a(g);return f?document._getElementsByXPath(".//*"+f,d):[]}:function(g,h){h=h.toString().strip();var j=[],k=(/\s/.test(h)?$w(h):null);if(!k&&!h){return j}var d=$(g).getElementsByTagName("*");h=" "+h+" ";for(var f=0,m,l;m=d[f];f++){if(m.className&&(l=" "+m.className+" ")&&(l.include(h)||(k&&k.all(function(n){return !n.toString().blank()&&l.include(" "+n+" ")})))){j.push(Element.extend(m))}}return j};return function(f,d){return $(d||document.body).getElementsByClassName(f)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(a){this.element.className.split(/\s+/).select(function(c){return c.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"}});Object.extend(Selector,{matchElements:function(h,j){var a=Prototype.Selector.match,f=[];for(var d=0,g=h.length;d<g;d++){var c=h[d];if(a(c,j)){f.push(Element.extend(c))}}return f},findElement:function(h,j,c){c=c||0;var a=0,f;for(var d=0,g=h.length;d<g;d++){f=h[d];if(Prototype.Selector.match(f,j)&&c===a++){return Element.extend(f)}}},findChildElements:function(c,d){var a=d.toArray().join(", ");return Prototype.Selector.select(a,c||document)}})})();Element.addMethods({defaultValueActsAsHint:function(a){a=$(a);a._default=a.value;a.activateDefaultValueActsAsHint();return a.observe("focus",function(){if(!a._defaultValueActsAsHintActive){return}if(a._default!=a.value){return}a.removeClassName("hint").value=""}).observe("blur",function(){if(!a._defaultValueActsAsHintActive){return}if(a.value.strip()!=""){return}a.addClassName("hint").value=a._default}).addClassName("hint")},activateDefaultValueActsAsHint:function(a){a=$(a);a._defaultValueActsAsHintActive=true;return a},deactivateDefaultValueActsAsHint:function(a){a=$(a);a._defaultValueActsAsHintActive=false;return a},refreshDefaultValueActsAsHint:function(a){a=$(a);if(a.value.strip()==""){a.addClassName("hint").value=a._default}return a},isDefaultValue:function(a){a=$(a);return(a._default&&a._default==a.value)},clearDefaultValues:function(a){a=$(a);if(a._default&&a._default==a.value){a.value=""}return a},setDefaultValues:function(a){a=$(a);if(a._default&&a.value==""){a.value=a._default}return a}});String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var d=this.slice(4,this.length-1).split(",");var c=0;do{a+=parseInt(d[c]).toColorPart()}while(++c<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var c=1;c<4;c++){a+=(this.charAt(c)+this.charAt(c)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:(c.hasChildNodes()?Element.collectTextNodes(c):""))}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,c){return $A($(a).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(a,c){a=$(a);a.setStyle({fontSize:(c/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""};Element.forceRerendering=function(a){try{a=$(a);var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(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(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(c,a){a=a||5;return(((c%(1/a))*a).round()==0?((c*a*2)-(c*a*2).floor()):1-((c*a*2)-(c*a*2).floor()))},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var c="position:relative";if(Prototype.Browser.IE){c+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(d){if(d.nodeType==3){d.nodeValue.toArray().each(function(f){a.insertBefore(new Element("span",{style:c}).update(f==" "?String.fromCharCode(160):f),d)});Element.remove(d)}})},multiple:function(c,d){var g;if(((typeof c=="object")||Object.isStringon(c))&&(c.length)){g=c}else{g=$(c).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var f=a.delay;$A(g).each(function(j,h){new d(j,Object.extend(a,{delay:h*a.speed+f}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(c,d){c=$(c);d=(d||"appear").toLowerCase();var a=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,a)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(c){var d=new Date().getTime();var a=Object.isString(c.options.queue)?c.options.queue:c.options.queue.position;switch(a){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(a){this.effects=this.effects.reject(function(c){return c==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var d=new Date().getTime();for(var c=0,a=this.effects.length;c<a;c++){this.effects[c]&&this.effects[c].loop(d)}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");Effect.Base=Class.create({position:null,start:function(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,a=(c*this.totalFrames).round();if(a>this.currentFrame){this.render(c);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)},finish:function(a){this.effects.each(function(c){c.render(1);c.cancel();c.event("beforeFinish");if(c.finish){c.finish(a)}c.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(d,h,g){d=Object.isString(d)?$(d):d;var c=$A(arguments),f=c.last(),a=c.length==5?c[3]:null;this.method=Object.isFunction(f)?f.bind(d):Object.isFunction(d[f])?d[f].bind(d):function(j){d[f]=j};this.start(Object.extend({from:h,to:g},a||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})}});Effect.MoveBy=function(c,a,d){return new Effect.Move(c,Object.extend({x:d,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(c,d){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:d},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(c){this.originalStyle[c]=this.element.style[c]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(c){if(a.indexOf(c)>0){this.fontSize=parseFloat(a);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(a){var c=(this.options.scaleFrom/100)+(this.factor*a);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(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,g){var h={};if(this.options.scaleX){h.width=g.round()+"px"}if(this.options.scaleY){h.height=a.round()+"px"}if(this.options.scaleFromCenter){var f=(a-this.dims[0])/2;var c=(g-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){h.top=this.originalTop-f+"px"}if(this.options.scaleX){h.left=this.originalLeft-c+"px"}}else{if(this.options.scaleY){h.top=-f+"px"}if(this.options.scaleX){h.left=-c+"px"}}}this.element.setStyle(h)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(c,d,f){return c+((this._base[f]+(this._delta[f]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(f){var d=arguments[1]||{},c=document.viewport.getScrollOffsets(),g=$(f).cumulativeOffset(),a=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(d.offset){g[1]+=d.offset}return new Effect.Tween(null,c.top,g[1]>a?a:g[1],d,function(h){scrollTo(c.left,h.round())})};Effect.Fade=function(d){d=$(d);var a=d.getInlineOpacity();var c=Object.extend({from:d.getOpacity()||1,to:0,afterFinishInternal:function(f){if(f.options.to!=0){return}f.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(d,c)};Effect.Appear=function(c){c=$(c);var a=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,a)};Effect.Puff=function(c){c=$(c);var a={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(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(c){c.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(c){c=$(c);var a=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makeClipping().setStyle({height:"0px"}).show()},afterFinishInternal:function(d){d.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(c){c=$(c);var a=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(f){f.element.makePositioned().makeClipping()},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(c){c=$(c);var a={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(a)}},arguments[1]||{}))};Effect.Shake=function(f){f=$(f);var c=Object.extend({distance:20,duration:0.5},arguments[1]||{});var g=parseFloat(c.distance);var d=parseFloat(c.duration)/10;var a={top:f.getStyle("top"),left:f.getStyle("left")};return new Effect.Move(f,{x:g,y:0,duration:d,afterFinishInternal:function(h){new Effect.Move(h.element,{x:-g*2,y:0,duration:d*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:g*2,y:0,duration:d*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:-g*2,y:0,duration:d*2,afterFinishInternal:function(l){new Effect.Move(l.element,{x:g*2,y:0,duration:d*2,afterFinishInternal:function(m){new Effect.Move(m.element,{x:-g,y:0,duration:d,afterFinishInternal:function(n){n.element.undoPositioned().setStyle(a)}})}})}})}})}})}})};Effect.SlideDown=function(d){d=$(d).cleanWhitespace();var a=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(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(d){d=$(d).cleanWhitespace();var a=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(f){f.element.makePositioned();f.element.down().makePositioned();if(window.opera){f.element.setStyle({top:""})}f.element.makeClipping().show()},afterUpdateInternal:function(f){f.element.down().setStyle({bottom:(f.dims[0]-f.element.clientHeight)+"px"})},afterFinishInternal:function(f){f.element.hide().undoClipping().undoPositioned();f.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(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 a={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};var j=d.getDimensions();var k,h;var g,f;switch(c.direction){case"top-left":k=h=g=f=0;break;case"top-right":k=j.width;h=f=0;g=-j.width;break;case"bottom-left":k=g=0;h=j.height;f=-j.height;break;case"bottom-right":k=j.width;h=j.height;g=-j.width;f=-j.height;break;case"center":k=j.width/2;h=j.height/2;g=-j.width/2;f=-j.height/2;break}return new Effect.Move(d,{x:k,y:h,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:g,y:f,sync:true,transition:c.moveTransition}),new Effect.Scale(l.element,100,{scaleMode:{originalHeight:j.height,originalWidth:j.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(a)}},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 a={top:d.style.top,left:d.style.left,height:d.style.height,width:d.style.width,opacity:d.getInlineOpacity()};var h=d.getDimensions();var g,f;switch(c.direction){case"top-left":g=f=0;break;case"top-right":g=h.width;f=0;break;case"bottom-left":g=0;f=h.height;break;case"bottom-right":g=h.width;f=h.height;break;case"center":g=h.width/2;f=h.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:g,y:f,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(j){j.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(j){j.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},c))};Effect.Pulsate=function(d){d=$(d);var c=arguments[1]||{};var a=d.getInlineOpacity();var g=c.transition||Effect.Transitions.sinoidal;var f=function(h){return g(1-Effect.Transitions.pulse(h,c.pulses))};f.bind(g);return new Effect.Opacity(d,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(h){h.element.setStyle({opacity:a})}},c),{transition:f}))};Effect.Fold=function(c){c=$(c);var a={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(f){f.element.hide().undoClipping().setStyle(a)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(d){this.element=$(d);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);var c=this.element.getStyles();this.style=this.style.reject(function(f){return f.value==c[f.key]});a.afterFinishInternal=function(f){f.element.addClassName(f.options.style);f.transforms.each(function(g){f.element.style[g.style]=""})}}}this.start(a)},setup:function(){function a(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(j){var h=j[0],g=j[1],f=null;if(g.parseColor("#zzzzzz")!="#zzzzzz"){g=g.parseColor();f="color"}else{if(h=="opacity"){g=parseFloat(g);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}}else{if(Element.CSS_LENGTH.test(g)){var d=g.match(/^([\+\-]?[0-9\.]+)(.*)$/);g=parseFloat(d[1]);f=(d.length==3)?d[2]:null}}}var c=this.element.getStyle(h);return{style:h.camelize(),originalValue:f=="color"?a(c):parseFloat(c||0),targetValue:f=="color"?a(g):g,unit:f}}.bind(this)).reject(function(c){return((c.originalValue==c.targetValue)||(c.unit!="color"&&(isNaN(c.originalValue)||isNaN(c.targetValue))))})},update:function(a){var f={},c,d=this.transforms.length;while(d--){f[(c=this.transforms[d]).style]=c.unit=="color"?"#"+(Math.round(c.originalValue[0]+(c.targetValue[0]-c.originalValue[0])*a)).toColorPart()+(Math.round(c.originalValue[1]+(c.targetValue[1]-c.originalValue[1])*a)).toColorPart()+(Math.round(c.originalValue[2]+(c.targetValue[2]-c.originalValue[2])*a)).toColorPart():(c.originalValue+(c.targetValue-c.originalValue)*a).toFixed(3)+(c.unit===null?"":c.unit)}this.element.setStyle(f,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.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(a){var f=a.get("ids"),d=a.get("effect"),c=a.get("options");var g=[$(f)||$$(f)].flatten();return g.map(function(h){return new d(h,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,a=$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]){a.set(d,c[d])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(c){var a=document.defaultView.getComputedStyle($(c),null);return Element.CSS_PROPERTIES.inject({},function(d,f){d[f]=a[f];return d})}}else{Element.getStyles=function(c){c=$(c);var a=c.currentStyle,d;d=Element.CSS_PROPERTIES.inject({},function(g,f){g.set(f,a[f]);return g});if(!d.opacity){d.set("opacity",c.getOpacity())}return d}}Effect.Methods={morph:function(a,c){a=$(a);new Effect.Morph(a,Object.extend({style:c},arguments[2]||{}));return a},visualEffect:function(d,g,c){d=$(d);var f=g.dasherize().camelize(),a=f.charAt(0).toUpperCase()+f.substring(1);new Effect[a](d,c);return d},highlight:function(c,a){c=$(c);new Effect.Highlight(c,a);return c}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(d,c){d=$(d);Effect[a.charAt(0).toUpperCase()+a.substring(1)](d,c);return d}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]});Element.addMethods(Effect.Methods);if(Object.isUndefined(Effect)){throw ("dragdrop.js requires including script.aculo.us' effects.js library")}var Droppables={drops:[],remove:function(a){this.drops=this.drops.reject(function(c){return c.element==$(a)})},add:function(c){c=$(c);var a=Object.extend({greedy:true,hoverclass:null,tree:false},arguments[1]||{});if(a.containment){a._containers=[];var d=a.containment;if(Object.isArray(d)){d.each(function(f){a._containers.push($(f))})}else{a._containers.push($(d))}}if(a.accept){a.accept=[a.accept].flatten()}Element.makePositioned(c);a.element=c;this.drops.push(a)},findDeepestChild:function(a){deepest=a[0];for(i=1;i<a.length;++i){if(Element.isParent(a[i].element,deepest.element)){deepest=a[i]}}return deepest},isContained:function(c,a){var d;if(a.tree){d=c.treeNode}else{d=c.parentNode}return a._containers.detect(function(f){return d==f})},isAffected:function(a,d,c){return((c.element!=d)&&((!c._containers)||this.isContained(d,c))&&((!c.accept)||(Element.classNames(d).detect(function(f){return c.accept.include(f)})))&&Position.within(c.element,a[0],a[1]))},deactivate:function(a){if(a.hoverclass){Element.removeClassName(a.element,a.hoverclass)}this.last_active=null},activate:function(a){if(a.hoverclass){Element.addClassName(a.element,a.hoverclass)}this.last_active=a},show:function(a,d){if(!this.drops.length){return}var c,f=[];this.drops.each(function(g){if(Droppables.isAffected(a,d,g)){f.push(g)}});if(f.length>0){c=Droppables.findDeepestChild(f)}if(this.last_active&&this.last_active!=c){this.deactivate(this.last_active)}if(c){Position.within(c.element,a[0],a[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,a){if(!this.last_active){return}Position.prepare();if(this.isAffected([Event.pointerX(c),Event.pointerY(c)],a,this.last_active)){if(this.last_active.onDrop){this.last_active.onDrop(a,this.last_active.element,c);return true}}},reset:function(){if(this.last_active){this.deactivate(this.last_active)}}};var Draggables={drags:[],observers:[],register:function(a){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(a)},unregister:function(a){this.drags=this.drags.reject(function(c){return c==a});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(a){if(a.options.delay){this._timeout=setTimeout(function(){Draggables._timeout=null;window.focus();Draggables.activeDraggable=a}.bind(this),a.options.delay)}else{window.focus();this.activeDraggable=a}},deactivate:function(){this.activeDraggable=null},updateDrag:function(a){if(!this.activeDraggable){return}var c=[Event.pointerX(a),Event.pointerY(a)];if(this._lastPointer&&(this._lastPointer.inspect()==c.inspect())){return}this._lastPointer=c;this.activeDraggable.updateDrag(a,c)},endDrag:function(a){if(this._timeout){clearTimeout(this._timeout);this._timeout=null}if(!this.activeDraggable){return}this._lastPointer=null;this.activeDraggable.endDrag(a);this.activeDraggable=null},keyPress:function(a){if(this.activeDraggable){this.activeDraggable.keyPress(a)}},addObserver:function(a){this.observers.push(a);this._cacheObserverCallbacks()},removeObserver:function(a){this.observers=this.observers.reject(function(c){return c.element==a});this._cacheObserverCallbacks()},notify:function(c,a,d){if(this[c+"Count"]>0){this.observers.each(function(f){if(f[c]){f[c](c,a,d)}})}if(a.options[c]){a.options[c](a,d)}},_cacheObserverCallbacks:function(){["onStart","onEnd","onDrag"].each(function(a){Draggables[a+"Count"]=Draggables.observers.select(function(c){return c[a]}).length})}};var Draggable=Class.create({initialize:function(c){var d={handle:false,reverteffect:function(h,g,f){var j=Math.sqrt(Math.abs(g^2)+Math.abs(f^2))*0.02;new Effect.Move(h,{x:-f,y:-g,duration:j,queue:{scope:"_draggable",position:"end"}})},endeffect:function(g){var f=Object.isNumber(g._opacity)?g._opacity:1;new Effect.Opacity(g,{duration:0.2,from:0.7,to:f,queue:{scope:"_draggable",position:"end"},afterFinish:function(){Draggable._dragging[g]=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(f){f._opacity=Element.getOpacity(f);Draggable._dragging[f]=true;new Effect.Opacity(f,{duration:0.2,from:f._opacity,to:0.7})}})}var a=Object.extend(d,arguments[1]||{});this.element=$(c);if(a.handle&&Object.isString(a.handle)){this.handle=this.element.down("."+a.handle,0)}if(!this.handle){this.handle=$(a.handle)}if(!this.handle){this.handle=this.element}if(a.scroll&&!a.scroll.scrollTo&&!a.scroll.outerHTML){a.scroll=$(a.scroll);this._isScrollChild=Element.childOf(this.element,a.scroll)}Element.makePositioned(this.element);this.options=a;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(a){if(!Object.isUndefined(Draggable._dragging[this.element])&&Draggable._dragging[this.element]){return}if(Event.isLeftClick(a)){var d=Event.element(a);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(a),Event.pointerY(a)];var f=Position.cumulativeOffset(this.element);this.offset=[0,1].map(function(g){return(c[g]-f[g])});Draggables.activate(this);Event.stop(a)}},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 a=this._getWindowScroll(this.options.scroll);this.originalScrollLeft=a.left;this.originalScrollTop=a.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,h){this.dragging=false;if(this.options.quiet){Position.prepare();var g=[Event.pointerX(c),Event.pointerY(c)];Droppables.show(g,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 j=false;if(h){j=Droppables.fire(c,this.element);if(!j){j=false}}if(j&&this.options.onDropped){this.options.onDropped(this.element)}Draggables.notify("onEnd",this,c);var a=this.options.revert;if(a&&Object.isFunction(a)){a=a(this.element)}var f=this.currentDelta();if(a&&this.options.reverteffect){if(j==0||a!="failure"){this.options.reverteffect(this.element,f[1]-this.delta[1],f[0]-this.delta[0])}}else{this.delta=f}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(a){if(a.keyCode!=Event.KEY_ESC){return}this.finishDrag(a,false);Event.stop(a)},endDrag:function(a){if(!this.dragging){return}this.stopScrolling();this.finishDrag(a,true);Event.stop(a)},draw:function(a){var j=Position.cumulativeOffset(this.element);if(this.options.ghosting){var f=Position.realOffset(this.element);j[0]+=f[0]-Position.deltaX;j[1]+=f[1]-Position.deltaY}var h=this.currentDelta();j[0]-=h[0];j[1]-=h[1];if(this.options.scroll&&(this.options.scroll!=window&&this._isScrollChild)){j[0]-=this.options.scroll.scrollLeft-this.originalScrollLeft;j[1]-=this.options.scroll.scrollTop-this.originalScrollTop}var g=[0,1].map(function(d){return(a[d]-j[d]-this.offset[d])}.bind(this));if(this.options.snap){if(Object.isFunction(this.options.snap)){g=this.options.snap(g[0],g[1],this)}else{if(Object.isArray(this.options.snap)){g=g.map(function(d,k){return(d/this.options.snap[k]).round()*this.options.snap[k]}.bind(this))}else{g=g.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=g[0]+"px"}if((!this.options.constraint)||(this.options.constraint=="vertical")){c.top=g[1]+"px"}if(c.visibility=="hidden"){c.visibility=""}},stopScrolling:function(){if(this.scrollInterval){clearInterval(this.scrollInterval);this.scrollInterval=null;Draggables._lastScrollPointer=null}},startScrolling:function(a){if(!(a[0]||a[1])){return}this.scrollSpeed=[a[0]*this.options.scrollSpeed,a[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,a){this.element=$(c);this.observer=a;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(a){while(a.tagName.toUpperCase()!="BODY"){if(a.id&&Sortable.sortables[a.id]){return a}a=a.parentNode}},options:function(a){a=Sortable._findRootElement($(a));if(!a){return}return Sortable.sortables[a.id]},destroy:function(a){var c=Sortable.options(a);if(c){Draggables.removeObserver(c.element);c.droppables.each(function(f){Droppables.remove(f)});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 a={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){a.starteffect=c.starteffect}if(c.reverteffect){a.reverteffect=c.reverteffect}else{if(c.ghosting){a.reverteffect=function(h){h.style.top=0;h.style.left=0}}}if(c.endeffect){a.endeffect=c.endeffect}if(c.zindex){a.zindex=c.zindex}var f={overlap:c.overlap,containment:c.containment,tree:c.tree,hoverclass:c.hoverclass,onHover:Sortable.onHover};var g={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,g);c.droppables.push(d)}(c.elements||this.findElements(d,c)||[]).each(function(k,h){var j=c.handles?$(c.handles[h]):(c.handle?$(k).select("."+c.handle)[0]:k);c.draggables.push(new Draggable(k,Object.extend(a,{handle:j})));Droppables.add(k,f);if(c.tree){k.treeNode=d}c.droppables.push(k)});if(c.tree){(Sortable.findTreeElements(d,c)||[]).each(function(h){Droppables.add(h,g);h.treeNode=d;c.droppables.push(h)})}this.sortables[d.id]=c;Draggables.addObserver(new SortableObserver(d,c.onUpdate))},findElements:function(c,a){return Element.findChildren(c,a.only,a.tree?true:false,a.tag)},findTreeElements:function(c,a){return Element.findChildren(c,a.only,a.tree?true:false,a.treeTag)},onHover:function(g,f,a){if(Element.isParent(f,g)){return}if(a>0.33&&a<0.66&&Sortable.options(f).tree){return}else{if(a>0.5){Sortable.mark(f,"before");if(f.previousSibling!=g){var c=g.parentNode;g.style.visibility="hidden";f.parentNode.insertBefore(g,f);if(f.parentNode!=c){Sortable.options(c).onChange(g)}Sortable.options(f.parentNode).onChange(g)}}else{Sortable.mark(f,"after");var d=f.nextSibling||null;if(d!=g){var c=g.parentNode;g.style.visibility="hidden";f.parentNode.insertBefore(g,d);if(f.parentNode!=c){Sortable.options(c).onChange(g)}Sortable.options(f.parentNode).onChange(g)}}}},onEmptyHover:function(g,j,k){var l=g.parentNode;var a=Sortable.options(j);if(!Element.isParent(j,g)){var h;var d=Sortable.findElements(j,{tag:a.tag,only:a.only});var c=null;if(d){var f=Element.offsetSize(j,a.overlap)*(1-k);for(h=0;h<d.length;h+=1){if(f-Element.offsetSize(d[h],a.overlap)>=0){f-=Element.offsetSize(d[h],a.overlap)}else{if(f-(Element.offsetSize(d[h],a.overlap)/2)>=0){c=h+1<d.length?d[h+1]:null;break}else{c=d[h];break}}}}j.insertBefore(g,c);Sortable.options(l).onChange(g);a.onChange(g)}},unmark:function(){if(Sortable._marker){Sortable._marker.hide()}},mark:function(c,a){var f=Sortable.options(c.parentNode);if(f&&!f.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(a=="after"){if(f.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(g,c,h){var f=Sortable.findElements(g,c)||[];for(var d=0;d<f.length;++d){var a=f[d].id.match(c.format);if(!a){continue}var j={id:encodeURIComponent(a?a[1]:null),element:g,parent:h,children:[],position:h.children.length,container:$(f[d]).down(c.treeTag)};if(j.container){this._tree(j.container,c,j)}h.children.push(j)}return h},tree:function(f){f=$(f);var d=this.options(f);var c=Object.extend({tag:d.tag,treeTag:d.treeTag,only:d.only,name:f.id,format:d.format},arguments[1]||{});var a={id:null,parent:null,children:[],container:f,position:0};return Sortable._tree(f,c,a)},_constructIndex:function(c){var a="";do{if(c.id){a="["+c.position+"]"+a}}while((c=c.parent)!=null);return a},sequence:function(c){c=$(c);var a=Object.extend(this.options(c),arguments[1]||{});return $(this.findElements(c,a)||[]).map(function(d){return d.id.match(a.format)?d.id.match(a.format)[1]:""})},setSequence:function(c,d){c=$(c);var a=Object.extend(this.options(c),arguments[2]||{});var f={};this.findElements(c,a).each(function(g){if(g.id.match(a.format)){f[g.id.match(a.format)[1]]=[g,g.parentNode]}g.parentNode.removeChild(g)});d.each(function(g){var h=f[g];if(h){h[1].appendChild(h[0]);delete f[g]}})},serialize:function(d){d=$(d);var c=Object.extend(Sortable.options(d),arguments[1]||{});var a=encodeURIComponent((arguments[1]&&arguments[1].name)?arguments[1].name:d.id);if(c.tree){return Sortable.tree(d,arguments[1]).children.map(function(f){return[a+Sortable._constructIndex(f)+"[id]="+encodeURIComponent(f.id)].concat(f.children.map(arguments.callee))}).flatten().join("&")}else{return Sortable.sequence(d,arguments[1]).map(function(f){return a+"[]="+encodeURIComponent(f)}).join("&")}}};Element.isParent=function(c,a){if(!c.parentNode||c==a){return false}if(c.parentNode==a){return true}return Element.isParent(c.parentNode,a)};Element.findChildren=function(f,c,a,d){if(!f.hasChildNodes()){return null}d=d.toUpperCase();if(c){c=[c].flatten()}var g=[];$A(f.childNodes).each(function(j){if(j.tagName&&j.tagName.toUpperCase()==d&&(!c||(Element.classNames(j).detect(function(k){return c.include(k)})))){g.push(j)}if(a){var h=Element.findChildren(j,c,a,d);if(h){g.push(h)}}});return(g.length>0?g.flatten():[])};Element.offsetSize=function(a,c){return a["offset"+((c=="vertical"||c=="height")?"Height":"Width")]};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,a){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(a)}else{this.options=a||{}}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(f,g){if(!g.style.position||g.style.position=="absolute"){g.style.position="absolute";Position.clone(f,g,{setHeight:false,offsetTop:f.offsetHeight})}Effect.Appear(g,{duration:0.15})};this.options.onHide=this.options.onHide||function(f,g){new Effect.Fade(g,{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(a){if(this.active){switch(a.keyCode){case Event.KEY_TAB:case Event.KEY_RETURN:this.selectEntry();Event.stop(a);case Event.KEY_ESC:this.hide();this.active=false;Event.stop(a);return;case Event.KEY_LEFT:case Event.KEY_RIGHT:return;case Event.KEY_UP:this.markPrevious();this.render();Event.stop(a);return;case Event.KEY_DOWN:this.markNext();this.render();Event.stop(a);return}}else{if(a.keyCode==Event.KEY_TAB||a.keyCode==Event.KEY_RETURN||(Prototype.Browser.WebKit>0&&a.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 a=Event.findElement(c,"LI");if(this.index!=a.autocompleteIndex){this.index=a.autocompleteIndex;this.render()}Event.stop(c)},onClick:function(c){var a=Event.findElement(c,"LI");this.index=a.autocompleteIndex;this.selectEntry();this.hide()},onBlur:function(a){setTimeout(this.hide.bind(this),250);this.hasFocus=false;this.active=false},render:function(){if(this.entryCount>0){for(var a=0;a<this.entryCount;a++){this.index==a?Element.addClassName(this.getEntry(a),"selected"):Element.removeClassName(this.getEntry(a),"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(a){return this.update.firstChild.childNodes[a]},getCurrentEntry:function(){return this.getEntry(this.index)},selectEntry:function(){this.active=false;this.updateElement(this.getCurrentEntry())},updateElement:function(h){if(this.options.updateElement){this.options.updateElement(h);return}var f="";if(this.options.select){var a=$(h).select("."+this.options.select)||[];if(a.length>0){f=Element.collectTextNodes(a[0],this.options.select)}}else{f=Element.collectTextNodesIgnoreClass(h,"informal")}var d=this.getTokenBounds();if(d[0]!=-1){var g=this.element.value.substr(0,d[0]);var c=this.element.value.substr(d[0]).match(/^\s+/);if(c){g+=c[0]}this.element.value=g+f+this.element.value.substr(d[1])}else{this.element.value=f}this.oldElementValue=this.element.value;this.element.focus();if(this.options.afterUpdateElement){this.options.afterUpdateElement(this.element,h)}},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 a=0;a<this.entryCount;a++){var c=this.getEntry(a);c.autocompleteIndex=a;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(a){Event.observe(a,"mouseover",this.onHover.bindAsEventListener(this));Event.observe(a,"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 a=this.getTokenBounds();return this.element.value.substring(a[0],a[1]).strip()},getTokenBounds:function(){if(null!=this.tokenBounds){return this.tokenBounds}var g=this.element.value;if(g.strip().empty()){return[-1,0]}var h=arguments.callee.getFirstDifferencePos(g,this.oldElementValue);var k=(h==this.oldElementValue.length?1:0);var f=-1,d=g.length;var j;for(var c=0,a=this.options.tokens.length;c<a;++c){j=g.lastIndexOf(this.options.tokens[c],h+k-1);if(j>f){f=j}j=g.indexOf(this.options.tokens[c],h+k);if(-1!=j&&j<d){d=j}}return(this.tokenBounds=[f+1,d])}});Autocompleter.Base.prototype.getTokenBounds.getFirstDifferencePos=function(d,a){var f=Math.min(d.length,a.length);for(var c=0;c<f;++c){if(d[c]!=a[c]){return c}}return f};Ajax.Autocompleter=Class.create(Autocompleter.Base,{initialize:function(d,f,c,a){this.baseInitialize(d,f,a);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 a=encodeURIComponent(this.options.paramName)+"="+encodeURIComponent(this.getToken());this.options.parameters=this.options.callback?this.options.callback(this.element,a):a;if(this.options.defaultParams){this.options.parameters+="&"+this.options.defaultParams}new Ajax.Request(this.url,this.options)},onComplete:function(a){this.updateChoices(a.responseText)}});Autocompleter.Local=Class.create(Autocompleter.Base,{initialize:function(c,f,d,a){this.baseInitialize(c,f,a);this.options.array=d},getUpdatedChoices:function(){this.updateChoices(this.options.selector(this))},setOptions:function(a){this.options=Object.extend({choices:10,partialSearch:true,partialChars:2,ignoreCase:true,fullSearch:false,selector:function(c){var f=[];var d=[];var k=c.getToken();var j=0;for(var g=0;g<c.options.array.length&&f.length<c.options.choices;g++){var h=c.options.array[g];var l=c.options.ignoreCase?h.toLowerCase().indexOf(k.toLowerCase()):h.indexOf(k);while(l!=-1){if(l==0&&h.length!=k.length){f.push("<li><strong>"+h.substr(0,k.length)+"</strong>"+h.substr(k.length)+"</li>");break}else{if(k.length>=c.options.partialChars&&c.options.partialSearch&&l!=-1){if(c.options.fullSearch||/\s/.test(h.substr(l-1,1))){d.push("<li>"+h.substr(0,l)+"<strong>"+h.substr(l,k.length)+"</strong>"+h.substr(l+k.length)+"</li>");break}}}l=c.options.ignoreCase?h.toLowerCase().indexOf(k.toLowerCase(),l+1):h.indexOf(k,l+1)}}if(d.length){f=f.concat(d.slice(0,c.options.choices-f.length))}return"<ul>"+f.join("")+"</ul>"}},a||{})}});Field.scrollFreeActivate=function(a){setTimeout(function(){Field.activate(a)},1)};Ajax.InPlaceEditor=Class.create({initialize:function(d,c,a){this.url=c;this.element=d=$(d);this.prepareOptions();this._controls={};arguments.callee.dealWithDeprecatedOptions(a);Object.extend(this.options,a||{});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(a){if(!this._editing||a.ctrlKey||a.altKey||a.shiftKey){return}if(Event.KEY_ESC==a.keyCode){this.handleFormCancellation(a)}else{if(Event.KEY_RETURN==a.keyCode){this.handleFormSubmission(a)}}},createControl:function(j,d,c){var g=this.options[j+"Control"];var h=this.options[j+"Text"];if("button"==g){var a=document.createElement("input");a.type="submit";a.value=h;a.className="editor_"+j+"_button";if("cancel"==j){a.onclick=this._boundCancelHandler}this._form.appendChild(a);this._controls[j]=a}else{if("link"==g){var f=document.createElement("a");f.href="#";f.appendChild(document.createTextNode(h));f.onclick="cancel"==j?this._boundCancelHandler:this._boundSubmitHandler;f.className="editor_"+j+"_link";if(c){f.className+=" "+c}this._form.appendChild(f);this._controls[j]=f}}},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 a=this.options.size||this.options.cols||0;if(0<a){c.size=a}}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 a(f,g){var d=c.options["text"+f+"Controls"];if(!d||g===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)}a("Before",this.options.okControl||this.options.cancelControl);this.createControl("ok",this._boundSubmitHandler);a("Between",this.options.okControl&&this.options.cancelControl);this.createControl("cancel",this._boundCancelHandler,"editor_cancel");a("After",this.options.okControl||this.options.cancelControl)},destroy:function(){if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML}this.leaveEditMode();this.unregisterListeners()},enterEditMode:function(a){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(a){Event.stop(a)}},enterHover:function(a){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(a){this.triggerCallback("onFailure",a);if(this._oldInnerHTML){this.element.innerHTML=this._oldInnerHTML;this._oldInnerHTML=null}},handleFormCancellation:function(a){this.wrapUp();if(a){Event.stop(a)}},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 a=Object.extend({evalScripts:true},this.options.ajaxOptions);Object.extend(a,{parameters:g,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Updater({success:this.element},this.url,a)}else{var a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{parameters:g,onComplete:this._boundWrapperHandler,onFailure:this._boundFailureHandler});new Ajax.Request(this.url,a)}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(a){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 a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{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,a)},postProcessEditField:function(){var a=this.options.fieldPostCreation;if(a){$(this._controls.editor)["focus"==a?"focus":"activate"]()}},prepareOptions:function(){this.options=Object.clone(Ajax.InPlaceEditor.DefaultOptions);Object.extend(this.options,Ajax.InPlaceEditor.DefaultCallbacks);[this._extraDefaultOptions].flatten().compact().each(function(a){Object.extend(this.options,a)}.bind(this))},prepareSubmission:function(){this._saving=true;this.removeForm();this.leaveHover();this.showSaving()},registerListeners:function(){this._listeners={};var a;$H(Ajax.InPlaceEditor.Listeners).each(function(c){a=this[c.value].bind(this);this._listeners[c.key]=a;if(!this.options.externalControlOnly){this.element.observe(c.key,a)}if(this.options.externalControl){this.options.externalControl.observe(c.key,a)}}.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,a){if("function"==typeof this.options[c]){this.options[c](this,a)}},unregisterListeners:function(){$H(this._listeners).each(function(a){if(!this.options.externalControlOnly){this.element.stopObserving(a.key,a.value)}if(this.options.externalControl){this.options.externalControl.stopObserving(a.key,a.value)}}.bind(this))},wrapUp:function(a){this.leaveEditMode();this._boundComplete(a,this.element)}});Object.extend(Ajax.InPlaceEditor.prototype,{dispose:Ajax.InPlaceEditor.prototype.destroy});Ajax.InPlaceCollectionEditor=Class.create(Ajax.InPlaceEditor,{initialize:function($super,d,c,a){this._extraDefaultOptions=Ajax.InPlaceCollectionEditor.DefaultOptions;$super(d,c,a)},createEditField:function(){var a=document.createElement("select");a.name=this.options.paramName;a.size=1;this._controls.editor=a;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 a=this._controls.editor.firstChild;if(!a){a=document.createElement("option");a.value="";this._controls.editor.appendChild(a);a.selected=true}a.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 a=Object.extend({method:"get"},this.options.ajaxOptions);Object.extend(a,{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,a)},buildOptionList:function(){this._form.removeClassName(this.options.loadingClassName);this._collection=this._collection.map(function(f){return 2===f.length?f:[f,f].flatten()});var c=("value" in this.options)?this.options.value:this._text;var a=this._collection.any(function(f){return f[0]==c}.bind(this));this._controls.editor.update("");var d;this._collection.each(function(g,f){d=document.createElement("option");d.value=g[0];d.selected=a?g[0]==c:0==f;d.appendChild(document.createTextNode(g[1]));this._controls.editor.appendChild(d)}.bind(this));this._controls.editor.disabled=false;Field.scrollFreeActivate(this._controls.editor)}});Ajax.InPlaceEditor.prototype.initialize.dealWithDeprecatedOptions=function(a){if(!a){return}function c(d,f){if(d in a||f===undefined){return}a[d]=f}c("cancelControl",(a.cancelLink?"link":(a.cancelButton?"button":a.cancelLink==a.cancelButton==false?false:undefined)));c("okControl",(a.okLink?"link":(a.okButton?"button":a.okLink==a.okButton==false?false:undefined)));c("highlightColor",a.highlightcolor);c("highlightEndColor",a.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(a){return Form.serialize(a)},onComplete:function(c,a){new Effect.Highlight(a,{startcolor:this.options.highlightColor,keepBackgroundImage:true})},onEnterEditMode:null,onEnterHover:function(a){a.element.style.backgroundColor=a.options.highlightColor;if(a._effect){a._effect.cancel()}},onFailure:function(c,a){alert("Error communication with the server: "+c.responseText.stripTags())},onFormCustomization:null,onLeaveEditMode:null,onLeaveHover:function(a){a._effect=new Effect.Highlight(a.element,{startcolor:a.options.highlightColor,endcolor:a.options.highlightEndColor,restorecolor:a._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,a,d){this.delay=a||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(a){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(!Control){var Control={}}Control.Slider=Class.create({initialize:function(f,a,c){var d=this;if(Object.isArray(f)){this.handles=f.collect(function(g){return $(g)})}else{this.handles=[$(f)]}this.track=$(a);this.options=c||{};this.axis=this.options.axis||"horizontal";this.increment=this.options.increment||1;this.step=parseInt(this.options.step||"1");this.range=this.options.range||$R(0,1);this.value=0;this.values=this.handles.map(function(){return 0});this.spans=this.options.spans?this.options.spans.map(function(g){return $(g)}):false;this.options.startSpan=$(this.options.startSpan||null);this.options.endSpan=$(this.options.endSpan||null);this.restricted=this.options.restricted||false;this.maximum=this.options.maximum||this.range.end;this.minimum=this.options.minimum||this.range.start;this.alignX=parseInt(this.options.alignX||"0");this.alignY=parseInt(this.options.alignY||"0");this.trackLength=this.maximumOffset()-this.minimumOffset();this.handleLength=this.isVertical()?(this.handles[0].offsetHeight!=0?this.handles[0].offsetHeight:this.handles[0].style.height.replace(/px$/,"")):(this.handles[0].offsetWidth!=0?this.handles[0].offsetWidth:this.handles[0].style.width.replace(/px$/,""));this.active=false;this.dragging=false;this.disabled=false;if(this.options.disabled){this.setDisabled()}this.allowedValues=this.options.values?this.options.values.sortBy(Prototype.K):false;if(this.allowedValues){this.minimum=this.allowedValues.min();this.maximum=this.allowedValues.max()}this.eventMouseDown=this.startDrag.bindAsEventListener(this);this.eventMouseUp=this.endDrag.bindAsEventListener(this);this.eventMouseMove=this.update.bindAsEventListener(this);this.handles.each(function(j,g){g=d.handles.length-1-g;d.setValue(parseFloat((Object.isArray(d.options.sliderValue)?d.options.sliderValue[g]:d.options.sliderValue)||d.range.start),g);j.makePositioned().observe("mousedown",d.eventMouseDown)});this.track.observe("mousedown",this.eventMouseDown);document.observe("mouseup",this.eventMouseUp);document.observe("mousemove",this.eventMouseMove);this.initialized=true},dispose:function(){var a=this;Event.stopObserving(this.track,"mousedown",this.eventMouseDown);Event.stopObserving(document,"mouseup",this.eventMouseUp);Event.stopObserving(document,"mousemove",this.eventMouseMove);this.handles.each(function(c){Event.stopObserving(c,"mousedown",a.eventMouseDown)})},setDisabled:function(){this.disabled=true},setEnabled:function(){this.disabled=false},getNearestValue:function(a){if(this.allowedValues){if(a>=this.allowedValues.max()){return(this.allowedValues.max())}if(a<=this.allowedValues.min()){return(this.allowedValues.min())}var d=Math.abs(this.allowedValues[0]-a);var c=this.allowedValues[0];this.allowedValues.each(function(f){var g=Math.abs(f-a);if(g<=d){c=f;d=g}});return c}if(a>this.range.end){return this.range.end}if(a<this.range.start){return this.range.start}return a},setValue:function(c,a){if(!this.active){this.activeHandleIdx=a||0;this.activeHandle=this.handles[this.activeHandleIdx];this.updateStyles()}a=a||this.activeHandleIdx||0;if(this.initialized&&this.restricted){if((a>0)&&(c<this.values[a-1])){c=this.values[a-1]}if((a<(this.handles.length-1))&&(c>this.values[a+1])){c=this.values[a+1]}}c=this.getNearestValue(c);this.values[a]=c;this.value=this.values[0];this.handles[a].style[this.isVertical()?"top":"left"]=this.translateToPx(c);this.drawSpans();if(!this.dragging||!this.event){this.updateFinished()}},setValueBy:function(c,a){this.setValue(this.values[a||this.activeHandleIdx||0]+c,a||this.activeHandleIdx||0)},translateToPx:function(a){return Math.round(((this.trackLength-this.handleLength)/(this.range.end-this.range.start))*(a-this.range.start))+"px"},translateToValue:function(a){return((a/(this.trackLength-this.handleLength)*(this.range.end-this.range.start))+this.range.start)},getRange:function(c){var a=this.values.sortBy(Prototype.K);c=c||0;return $R(a[c],a[c+1])},minimumOffset:function(){return(this.isVertical()?this.alignY:this.alignX)},maximumOffset:function(){return(this.isVertical()?(this.track.offsetHeight!=0?this.track.offsetHeight:this.track.style.height.replace(/px$/,""))-this.alignY:(this.track.offsetWidth!=0?this.track.offsetWidth:this.track.style.width.replace(/px$/,""))-this.alignX)},isVertical:function(){return(this.axis=="vertical")},drawSpans:function(){var a=this;if(this.spans){$R(0,this.spans.length-1).each(function(c){a.setSpan(a.spans[c],a.getRange(c))})}if(this.options.startSpan){this.setSpan(this.options.startSpan,$R(0,this.values.length>1?this.getRange(0).min():this.value))}if(this.options.endSpan){this.setSpan(this.options.endSpan,$R(this.values.length>1?this.getRange(this.spans.length-1).max():this.value,this.maximum))}},setSpan:function(c,a){if(this.isVertical()){c.style.top=this.translateToPx(a.start);c.style.height=this.translateToPx(a.end-a.start+this.range.start)}else{c.style.left=this.translateToPx(a.start);c.style.width=this.translateToPx(a.end-a.start+this.range.start)}},updateStyles:function(){this.handles.each(function(a){Element.removeClassName(a,"selected")});Element.addClassName(this.activeHandle,"selected")},startDrag:function(d){if(Event.isLeftClick(d)){if(!this.disabled){this.active=true;var f=Event.element(d);var g=[Event.pointerX(d),Event.pointerY(d)];var a=f;if(a==this.track){var c=Position.cumulativeOffset(this.track);this.event=d;this.setValue(this.translateToValue((this.isVertical()?g[1]-c[1]:g[0]-c[0])-(this.handleLength/2)));var c=Position.cumulativeOffset(this.activeHandle);this.offsetX=(g[0]-c[0]);this.offsetY=(g[1]-c[1])}else{while((this.handles.indexOf(f)==-1)&&f.parentNode){f=f.parentNode}if(this.handles.indexOf(f)!=-1){this.activeHandle=f;this.activeHandleIdx=this.handles.indexOf(this.activeHandle);this.updateStyles();var c=Position.cumulativeOffset(this.activeHandle);this.offsetX=(g[0]-c[0]);this.offsetY=(g[1]-c[1])}}}Event.stop(d)}},update:function(a){if(this.active){if(!this.dragging){this.dragging=true}this.draw(a);if(Prototype.Browser.WebKit){window.scrollBy(0,0)}Event.stop(a)}},draw:function(c){var d=[Event.pointerX(c),Event.pointerY(c)];var a=Position.cumulativeOffset(this.track);d[0]-=this.offsetX+a[0];d[1]-=this.offsetY+a[1];this.event=c;this.setValue(this.translateToValue(this.isVertical()?d[1]:d[0]));if(this.initialized&&this.options.onSlide){this.options.onSlide(this.values.length>1?this.values:this.value,this)}},endDrag:function(a){if(this.active&&this.dragging){this.finishDrag(a,true);Event.stop(a)}this.active=false;this.dragging=false},finishDrag:function(a,c){this.active=false;this.dragging=false;this.updateFinished()},updateFinished:function(){if(this.initialized&&this.options.onChange){this.options.onChange(this.values.length>1?this.values:this.value,this)}this.event=null}});var Images={"default":["/images/ontop_login_background.png","/images/button_default_left.png","/images/button_default_right.png","/images/button_big_left.png","/images/button_big_right.png"],IE6:["/images/ie6/ontop_login_background.gif","/images/ie6/button_default_left.gif","/images/ie6/button_default_right.gif","/images/ie6/button_big_left.gif","/images/ie6/button_big_left.gif"]};Images[Prototype.Browser.IE6?"IE6":"default"].each(function(a){});(function(){function v(a){console.log("$f.fireEvent",[].slice.call(a))}function r(a){if(!a||typeof a!="object"){return a}var d=new a.constructor();for(var c in a){if(a.hasOwnProperty(c)){d[c]=r(a[c])}}return d}function p(a,f){if(!a){return}var h,g=0,d=a.length;if(d===undefined){for(h in a){if(f.call(a[h],h,a[h])===false){break}}}else{for(var c=a[0];g<d&&f.call(c,g,c)!==false;c=a[++g]){}}return a}function z(a){return document.getElementById(a)}function t(a,c,d){if(typeof c!="object"){return a}if(a&&c){p(c,function(g,f){if(!d||typeof f!="function"){a[g]=f}})}return a}function o(a){var d=a.indexOf(".");if(d!=-1){var f=a.substring(0,d)||"*";var g=a.substring(d+1,a.length);var c=[];p(document.getElementsByTagName(f),function(){if(this.className&&this.className.indexOf(g)!=-1){c.push(this)}});return c}}function w(a){a=a||window.event;if(a.preventDefault){a.stopPropagation();a.preventDefault()}else{a.returnValue=false;a.cancelBubble=true}return false}function s(a,d,c){a[d]=a[d]||[];a[d].push(c)}function x(){return"_"+(""+Math.random()).substring(2,10)}var u=function(c,f,d){var g=this;var h={};var a={};g.index=f;if(typeof c=="string"){c={url:c}}t(this,c,true);p(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var l="on"+this;if(l.indexOf("*")!=-1){l=l.substring(0,l.length-1);var k="onBefore"+l.substring(2);g[k]=function(m){s(a,k,m);return g}}g[l]=function(m){s(a,l,m);return g};if(f==-1){if(g[k]){d[k]=g[k]}if(g[l]){d[l]=g[l]}}});t(this,{onCuepoint:function(k,l){if(arguments.length==1){h.embedded=[null,k];return g}if(typeof k=="number"){k=[k]}var m=x();h[m]=[k,l];if(d.isLoaded()){d._api().fp_addCuepoints(k,f,m)}return g},update:function(l){t(g,l);if(d.isLoaded()){d._api().fp_updateClip(l,f)}var m=d.getConfig();var k=(f==-1)?m.clip:m.playlist[f];t(k,l,true)},_fireEvent:function(n,D,m,l){if(n=="onLoad"){p(h,function(F,E){if(E[0]){d._api().fp_addCuepoints(E[0],f,F)}});return false}l=l||g;if(n=="onCuepoint"){var C=h[D];if(C){return C[1].call(d,l,m)}}if(D&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(n)!=-1){t(l,D);if(D.metaData){if(!l.duration){l.duration=D.metaData.duration}else{l.fullDuration=D.metaData.duration}}}var k=true;p(a[n],function(){k=this.call(d,l,D,m)});return k}});if(c.onCuepoint){var j=c.onCuepoint;g.onCuepoint.apply(g,typeof j=="function"?[j]:j);delete c.onCuepoint}p(c,function(l,k){if(typeof k=="function"){s(a,l,k);delete c[l]}});if(f==-1){d.onCuepoint=this.onCuepoint}};var q=function(h,f,g,c){var d={};var j=this;var a=false;if(c){t(d,c)}p(f,function(l,k){if(typeof k=="function"){d[l]=k;delete f[l]}});t(this,{animate:function(C,n,k){if(!C){return j}if(typeof n=="function"){k=n;n=500}if(typeof C=="string"){var l=C;C={};C[l]=n;n=500}if(k){var m=x();d[m]=k}if(n===undefined){n=500}f=g._api().fp_animate(h,C,n,m);return j},css:function(l,k){if(k!==undefined){var m={};m[l]=k;l=m}f=g._api().fp_css(h,l);t(j,f);return j},show:function(){this.display="block";g._api().fp_showPlugin(h);return j},hide:function(){this.display="none";g._api().fp_hidePlugin(h);return j},toggle:function(){this.display=g._api().fp_togglePlugin(h);return j},fadeTo:function(n,k,l){if(typeof k=="function"){l=k;k=500}if(l){var m=x();d[m]=l}this.display=g._api().fp_fadeTo(h,n,k,m);this.opacity=n;return j},fadeIn:function(k,l){return j.fadeTo(1,k,l)},fadeOut:function(k,l){return j.fadeTo(0,k,l)},getName:function(){return h},getPlayer:function(){return g},_fireEvent:function(l,m,k){if(l=="onUpdate"){var C=g._api().fp_getPlugin(h);if(!C){return}t(j,C);delete j.methods;if(!a){p(C.methods,function(){var D=""+this;j[D]=function(){var F=[].slice.call(arguments);var E=g._api().fp_invoke(h,D,F);return E==="undefined"||E===undefined?j:E}});a=true}}var n=d[l];if(n){n.apply(j,m);if(l.substring(0,1)=="_"){delete d[l]}}}})};function A(k,I,l){var K=this,m=null,n,H,h=[],J={},g={},c,G,F,a,j,f;t(K,{id:function(){return c},isLoaded:function(){return(m!==null)},getParent:function(){return k},hide:function(C){if(C){k.style.height="0px"}if(m){m.style.height="0px"}return K},show:function(){k.style.height=f+"px";if(m){m.style.height=j+"px"}return K},isHidden:function(){return m&&parseInt(m.style.height,10)===0},load:function(C){if(!m&&K._fireEvent("onBeforeLoad")!==false){p(B,function(){this.unload()});n=k.innerHTML;if(n&&!flashembed.isSupported(I.version)){k.innerHTML=""}flashembed(k,I,{config:l});if(C){C.cached=true;s(g,"onLoad",C)}}return K},unload:function(){if(n.replace(/\s/g,"")!==""){if(K._fireEvent("onBeforeUnload")===false){return K}try{if(m){m.fp_close();K._fireEvent("onUnload")}}catch(C){}m=null;k.innerHTML=n}return K},getClip:function(C){if(C===undefined){C=a}return h[C]},getCommonClip:function(){return H},getPlaylist:function(){return h},getPlugin:function(E){var C=J[E];if(!C&&K.isLoaded()){var D=K._api().fp_getPlugin(E);if(D){C=new q(E,D,K);J[E]=C}}return C},getScreen:function(){return K.getPlugin("screen")},getControls:function(){return K.getPlugin("controls")},getConfig:function(C){return C?r(l):l},getFlashParams:function(){return I},loadPlugin:function(M,N,D,E){if(typeof D=="function"){E=D;D={}}var O=E?x():"_";K._api().fp_loadPlugin(M,N,D,O);var P={};P[O]=E;var C=new q(M,null,K,P);J[M]=C;return C},getState:function(){return m?m.fp_getState():-1},play:function(D,E){function C(){if(D!==undefined){K._api().fp_play(D,E)}else{K._api().fp_play()}}if(m){C()}else{K.load(function(){C()})}return K},getVersion:function(){var C="flowplayer.js 3.1.4";if(m){var D=m.fp_getVersion();D.push(C);return D}return C},_api:function(){if(!m){throw"Flowplayer "+K.id()+" not loaded when calling an API method"}return m},setClip:function(C){K.setPlaylist([C]);return K},getIndex:function(){return F}});p(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var D="on"+this;if(D.indexOf("*")!=-1){D=D.substring(0,D.length-1);var C="onBefore"+D.substring(2);K[C]=function(E){s(g,C,E);return K}}K[D]=function(E){s(g,D,E);return K}});p(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed").split(","),function(){var C=this;K[C]=function(E,L){if(!m){return K}var D=null;if(E!==undefined&&L!==undefined){D=m["fp_"+C](E,L)}else{D=(E===undefined)?m["fp_"+C]():m["fp_"+C](E)}return D==="undefined"||D===undefined?K:D}});K._fireEvent=function(D){if(typeof D=="string"){D=[D]}var C=D[0],Q=D[1],S=D[2],T=D[3],U=0;if(l.debug){v(D)}if(!m&&C=="onLoad"&&Q=="player"){m=m||z(G);j=m.clientHeight;p(h,function(){this._fireEvent("onLoad")});p(J,function(M,L){L._fireEvent("onUpdate")});H._fireEvent("onLoad")}if(C=="onLoad"&&Q!="player"){return}if(C=="onError"){if(typeof Q=="string"||(typeof Q=="number"&&typeof S=="number")){Q=S;S=T}}if(C=="onContextMenu"){p(l.contextMenu[Q],function(M,L){L.call(K)});return}if(C=="onPluginEvent"){var X=Q.name||Q;var W=J[X];if(W){W._fireEvent("onUpdate",Q);W._fireEvent(S,D.slice(3))}return}if(C=="onPlaylistReplace"){h=[];var R=0;p(Q,function(){h.push(new u(this,R++,K))})}if(C=="onClipAdd"){if(Q.isInStream){return}Q=new u(Q,S,K);h.splice(S,0,Q);for(U=S+1;U<h.length;U++){h[U].index++}}var E=true;if(typeof Q=="number"&&Q<h.length){a=Q;var V=h[Q];if(V){E=V._fireEvent(C,S,T)}if(!V||E!==false){E=H._fireEvent(C,S,T,V)}}p(g[C],function(){E=this.call(K,Q,S);if(this.cached){g[C].splice(U,1)}if(E===false){return false}U++});return E};function d(){if($f(k)){$f(k).getParent().innerHTML="";F=$f(k).getIndex();B[F]=K}else{B.push(K);F=B.length-1}f=parseInt(k.style.height,10)||k.clientHeight;if(typeof I=="string"){I={src:I}}c=k.id||"fp"+x();G=I.id||c+"_api";I.id=G;l.playerId=c;if(typeof l=="string"){l={clip:{url:l}}}if(typeof l.clip=="string"){l.clip={url:l.clip}}l.clip=l.clip||{};if(k.getAttribute("href",2)&&!l.clip.url){l.clip.url=k.getAttribute("href",2)}H=new u(l.clip,-1,K);l.playlist=l.playlist||[l.clip];var D=0;p(l.playlist,function(){var E=this;if(typeof E=="object"&&E.length){E={url:""+E}}p(l.clip,function(M,L){if(L!==undefined&&E[M]===undefined&&typeof L!="function"){E[M]=L}});l.playlist[D]=E;E=new u(E,D,K);h.push(E);D++});p(l,function(L,E){if(typeof E=="function"){if(H[L]){H[L](E)}else{s(g,L,E)}delete l[L]}});p(l.plugins,function(L,E){if(E){J[L]=new q(L,E,K)}});if(!l.plugins||l.plugins.controls===undefined){J.controls=new q("controls",null,K)}J.canvas=new q("canvas",null,K);I.bgcolor=I.bgcolor||"#000000";I.version=I.version||[9,0];I.expressInstall="http://www.flowplayer.org/swf/expressinstall.swf";function C(E){if(!K.isLoaded()&&K._fireEvent("onBeforeClick")!==false){K.load()}return w(E)}n=k.innerHTML;if(n.replace(/\s/g,"")!==""){if(k.addEventListener){k.addEventListener("click",C,false)}else{if(k.attachEvent){k.attachEvent("onclick",C)}}}else{if(k.addEventListener){k.addEventListener("click",w,false)}K.load()}}if(typeof k=="string"){flashembed.domReady(function(){var C=z(k);if(!C){throw"Flowplayer cannot access element: "+k}else{k=C;d()}})}else{d()}}var B=[];function y(a){this.length=a.length;this.each=function(c){p(a,c)};this.size=function(){return a.length}}window.flowplayer=window.$f=function(){var g=null;var h=arguments[0];if(!arguments.length){p(B,function(){if(this.isLoaded()){g=this;return false}});return g||B[0]}if(arguments.length==1){if(typeof h=="number"){return B[h]}else{if(h=="*"){return new y(B)}p(B,function(){if(this.id()==h.id||this.id()==h||this.getParent()==h){g=this;return false}});return g}}if(arguments.length>1){var d=arguments[1];var f=(arguments.length==3)?arguments[2]:{};if(typeof h=="string"){if(h.indexOf(".")!=-1){var a=[];p(o(h),function(){a.push(new A(this,r(d),r(f)))});return new y(a)}else{var c=z(h);return new A(c!==null?c:h,d,f)}}else{if(h){return new A(h,d,f)}}}return null};t(window.$f,{fireEvent:function(){var c=[].slice.call(arguments);var a=$f(c[0]);return a?a._fireEvent(c.slice(1)):null},addPlugin:function(c,a){A.prototype[c]=a;return $f},each:p,extend:t});if(typeof jQuery=="function"){jQuery.prototype.flowplayer=function(a,c){if(!arguments.length||typeof arguments[0]=="number"){var d=[];this.each(function(){var f=$f(this);if(f){d.push(f)}});return arguments.length?d[arguments[0]]:new y(d)}return this.each(function(){$f(this,r(a),c?r(c):{})})}}})();(function(){var p=typeof jQuery=="function";var l={width:"100%",height:"100%",allowfullscreen:true,allowscriptaccess:"always",quality:"high",version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(p){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:"1.0.4",conf:l}}function k(){if(r.done){return false}var a=document;if(a&&a.getElementsByTagName&&a.getElementById&&a.body){clearInterval(r.timer);r.timer=null;for(var c=0;c<r.ready.length;c++){r.ready[c].call()}r.ready=null;r.done=true}}var r=p?jQuery:function(a){if(r.done){return a()}if(r.timer){r.ready.push(a)}else{r.ready=[a];r.timer=setInterval(k,13)}};function o(a,c){if(c){for(key in c){if(c.hasOwnProperty(key)){a[key]=c[key]}}}return a}function n(d){switch(m(d)){case"string":d=d.replace(new RegExp('(["\\\\])',"g"),"\\$1");d=d.replace(/^\s?(\d+)%/,"$1pct");return'"'+d+'"';case"array":return"["+s(d,function(f){return n(f)}).join(",")+"]";case"function":return'"function()"';case"object":var c=[];for(var a in d){if(d.hasOwnProperty(a)){c.push('"'+a+'":'+n(d[a]))}}return"{"+c.join(",")+"}"}return String(d).replace(/\s/g," ").replace(/\'/g,'"')}function m(a){if(a===null||a===undefined){return false}var c=typeof a;return(c=="object"&&a.push)?"array":c}if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){}})}function s(d,f){var a=[];for(var c in d){if(d.hasOwnProperty(c)){a[c]=f(d[c])}}return a}function t(g,d){var h=o({},g);var f=document.all;var u='<object width="'+h.width+'" height="'+h.height+'"';if(f&&!h.id){h.id="_"+(""+Math.random()).substring(9)}if(h.id){u+=' id="'+h.id+'"'}if(h.cachebusting){h.src+=((h.src.indexOf("?")!=-1?"&":"?")+Math.random())}if(h.w3c||!f){u+=' data="'+h.src+'" type="application/x-shockwave-flash"'}else{u+=' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'}u+=">";if(h.w3c||f){u+='<param name="movie" value="'+h.src+'" />'}h.width=h.height=h.id=h.w3c=h.src=null;for(var c in h){if(h[c]!==null){u+='<param name="'+c+'" value="'+h[c]+'" />'}}var j="";if(d){for(var a in d){if(d[a]!==null){j+=a+"="+(typeof d[a]=="object"?n(d[a]):d[a])+"&"}}j=j.substring(0,j.length-1);u+='<param name="flashvars" value=\''+j+"' />"}u+="</object>";return u}function q(a,h,c){var d=flashembed.getVersion();o(this,{getContainer:function(){return a},getConf:function(){return h},getVersion:function(){return d},getFlashvars:function(){return c},getApi:function(){return a.firstChild},getHTML:function(){return t(h,c)}});var g=h.version;var f=h.expressInstall;var j=!g||flashembed.isSupported(g);if(j){h.onFail=h.version=h.expressInstall=null;a.innerHTML=t(h,c)}else{if(g&&f&&flashembed.isSupported([6,65])){o(h,{src:f});c={MMredirectURL:location.href,MMplayerType:"PlugIn",MMdoctitle:document.title};a.innerHTML=t(h,c)}else{if(a.innerHTML.replace(/\s/g,"")!==""){}else{a.innerHTML="<h2>Flash version "+g+" or greater is required</h2><h3>"+(d[0]>0?"Your version is "+d:"You have no flash plugin installed")+"</h3>"+(a.tagName=="A"?"<p>Click here to download latest version</p>":"<p>Download latest version from <a href='http://www.adobe.com/go/getflashplayer'>here</a></p>");if(a.tagName=="A"){a.onclick=function(){location.href="http://www.adobe.com/go/getflashplayer"}}}}}if(!j&&h.onFail){var u=h.onFail.call(this);if(typeof u=="string"){a.innerHTML=u}}if(document.all){window[h.id]=document.getElementById(h.id)}}window.flashembed=function(c,a,d){if(typeof c=="string"){var g=document.getElementById(c);if(g){c=g}else{r(function(){flashembed(c,a,d)});return}}if(!c){return}if(typeof a=="string"){a={src:a}}var f=o({},l);o(f,a);return new q(c,f,d)};o(window.flashembed,{getVersion:function(){var a=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var c=navigator.plugins["Shockwave Flash"].description;if(typeof c!="undefined"){c=c.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var u=parseInt(c.replace(/^(.*)\..*$/,"$1"),10);var f=/r/.test(c)?parseInt(c.replace(/^.*r(.*)$/,"$1"),10):0;a=[u,f]}}else{if(window.ActiveXObject){try{var h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(g){try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");a=[6,0];h.AllowScriptAccess="always"}catch(d){if(a[0]==6){return a}}try{h=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(j){}}if(typeof h=="object"){c=h.GetVariable("$version");if(typeof c!="undefined"){c=c.replace(/^\S+\s+(.*)$/,"$1").split(",");a=[parseInt(c[0],10),parseInt(c[2],10)]}}}}return a},isSupported:function(d){var a=flashembed.getVersion();var c=(a[0]>d[0])||(a[0]==d[0]&&a[1]>=d[1]);return c},domReady:r,asString:n,getHTML:t});if(p){jQuery.fn.flashembed=function(c,d){var a=null;this.each(function(){a=flashembed(this,c,d)});return c.api===false?this:a}}})();var ZeroClipboard={version:"1.0.4",clients:{},moviePath:"/ZeroClipboard.swf",nextId:1,$:function(a){if(typeof(a)=="string"){a=document.getElementById(a)}if(!a.addClass){a.hide=function(){this.style.display="none"};a.show=function(){this.style.display=""};a.addClass=function(c){this.removeClass(c);this.className+=" "+c};a.removeClass=function(c){this.className=this.className.replace(new RegExp("\\s*"+c+"\\s*")," ").replace(/^\s+/,"").replace(/\s+$/,"")};a.hasClass=function(c){return !!this.className.match(new RegExp("\\s*"+c+"\\s*"))}}return a},setMoviePath:function(a){this.moviePath=a},dispatch:function(f,c,d){var a=this.clients[f];if(a){a.receiveEvent(c,d)}},register:function(c,a){this.clients[c]=a},getDOMObjectPosition:function(c){var a={left:0,top:0,width:c.width?c.width:c.offsetWidth,height:c.height?c.height:c.offsetHeight};while(c){a.left+=c.offsetLeft;a.top+=c.offsetTop;c=c.offsetParent}return a},Client:function(a){this.handlers={};this.id=ZeroClipboard.nextId++;this.movieId="ZeroClipboardMovie_"+this.id;ZeroClipboard.register(this.id,this);if(a){this.glue(a)}}};ZeroClipboard.Client.prototype={id:0,ready:false,movie:null,clipText:"",handCursorEnabled:true,cssEffects:true,handlers:null,glue:function(d){this.domElement=ZeroClipboard.$(d);var g=99;if(this.domElement.style.zIndex){g=parseInt(this.domElement.style.zIndex)+1}var f=$(this.domElement).getDimensions();var c=$(this.domElement).cumulativeOffset();this.div=new Element("div").setStyle({position:"absolute",left:c[0]+"px",top:c[1]+"px",width:f.width+"px",height:f.height+"px",zIndex:g});var a=document.getElementsByTagName("body")[0];a.insert(this.div);this.div.innerHTML=this.getHTML(f.width,f.height)},getHTML:function(f,a){var d="";var c="id="+this.id+"&width="+f+"&height="+a;if(navigator.userAgent.match(/MSIE/)){var g=location.href.match(/^https/i)?"https://":"http://";d+='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="'+g+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+f+'" height="'+a+'" id="'+this.movieId+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="false" /><param name="movie" value="'+ZeroClipboard.moviePath+'" /><param name="loop" value="false" /><param name="menu" value="false" /><param name="quality" value="best" /><param name="bgcolor" value="#ffffff" /><param name="flashvars" value="'+c+'"/><param name="wmode" value="transparent"/></object>'}else{d+='<embed id="'+this.movieId+'" src="'+ZeroClipboard.moviePath+'" loop="false" menu="false" quality="best" bgcolor="#ffffff" width="'+f+'" height="'+a+'" name="'+this.movieId+'" align="middle" allowScriptAccess="always" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="'+c+'" wmode="transparent" />'}return d},hide:function(){if(this.div){this.div.style.left="-2000px"}},show:function(){this.reposition()},destroy:function(){if(this.domElement&&this.div){this.hide();this.div.innerHTML="";var a=document.getElementsByTagName("body")[0];try{a.removeChild(this.div)}catch(c){}this.domElement=null;this.div=null}},reposition:function(d){if(d){this.domElement=ZeroClipboard.$(d);if(!this.domElement){this.hide()}}if(this.domElement&&this.div){var c=ZeroClipboard.getDOMObjectPosition(this.domElement);var a=this.div.style;a.left=""+c.left+"px";a.top=""+c.top+"px"}},setText:function(a){this.clipText=a;if(this.ready){this.movie.setText(a)}},addEventListener:function(a,c){a=a.toString().toLowerCase().replace(/^on/,"");if(!this.handlers[a]){this.handlers[a]=[]}this.handlers[a].push(c)},setHandCursor:function(a){this.handCursorEnabled=a;if(this.ready){this.movie.setHandCursor(a)}},setCSSEffects:function(a){this.cssEffects=!!a},receiveEvent:function(f,g){f=f.toString().toLowerCase().replace(/^on/,"");switch(f){case"load":this.movie=document.getElementById(this.movieId);if(!this.movie){var d=this;setTimeout(function(){d.receiveEvent("load",null)},1);return}if(!this.ready&&navigator.userAgent.match(/Firefox/)&&navigator.userAgent.match(/Windows/)){var d=this;setTimeout(function(){d.receiveEvent("load",null)},100);this.ready=true;return}this.ready=true;this.movie.setText(this.clipText);this.movie.setHandCursor(this.handCursorEnabled);break;case"mouseover":if(this.domElement&&this.cssEffects){this.domElement.addClass("hover");if(this.recoverActive){this.domElement.addClass("active")}}break;case"mouseout":if(this.domElement&&this.cssEffects){this.recoverActive=false;if(this.domElement.hasClass("active")){this.domElement.removeClass("active");this.recoverActive=true}this.domElement.removeClass("hover")}break;case"mousedown":if(this.domElement&&this.cssEffects){this.domElement.addClass("active")}break;case"mouseup":if(this.domElement&&this.cssEffects){this.domElement.removeClass("active");this.recoverActive=false}break}if(this.handlers[f]){for(var c=0,a=this.handlers[f].length;c<a;c++){var h=this.handlers[f][c];if(typeof(h)=="function"){h(this,g)}else{if((typeof(h)=="object")&&(h.length==2)){h[0][h[1]](this,g)}else{if(typeof(h)=="string"){window[h](this,g)}}}}}}};var ZoomBox={initialize:function(a){this.options=a;this.box=new Element("div",{id:"zoombox"}).hide();this.close=new Element("div",{id:"zoombox_close"}).hide();this.loader=new Element("div",{id:"zoombox_loader"}).hide();$(document.body).insert(this.box);$(document.body).insert(this.loader);this.box.insert(this.close);document.observe("click",this.dispatchClick.bind(this));this.loadedImages=[];this.initialized=true},dispatchClick:function(a){if(!a){return}var c=a.element();if(c.hasClassName("no-zoom")||c.up().hasClassName("no-zoom")){return}if(c.hasClassName("image-zoom-actuator")){a.stop();if(this.actuator&&(c==this.actuator||c.descendantOf(this.actuator))){this.hide()}else{this.show(c)}}if(c==this.box||c==this.close||c==this.currentImage){this.hide(c)}},show:function(a){this.actuator=a.tagName=="IMG"?a.up("a"):a;if(!this.loadedImages.include(this.actuator.href)){this.loader.appear({from:0,to:0.7,duration:0.3})}Asset.load(this.actuator.href,function(c){this.loader.fade({from:0.7,to:0,duration:0.2});this.currentImage=new Element("img",{src:c});if(this.box.down("img")){this.box.down("img").remove()}this.box.insert(this.currentImage);this.loadedImages.push(c);this.zoom()}.bind(this))},zoom:function(){this.startOffsets=this.actuator.cumulativeOffset();if(Prototype.Browser.IE){this.currentImage.getDimensionsFromInvisible()}this.dims={width:{from:this.currentImage.width/100,to:this.currentImage.width},height:{from:this.currentImage.height/100,to:this.currentImage.height}};var a=Position.getPageSize().window,c=$(document.body).cumulativeScrollOffset();this.targetOffsets={left:(a.width/2)-(this.dims.width.to/2),top:c.top+(a.height/2)-(this.dims.height.to/2)};this.box.setStyle({width:this.dims.width.from+"px",height:this.dims.height.from+"px"});this.box.setOpacity(0).setStyle({left:(this.startOffsets.left+this.actuator.getWidth()/2)+"px",top:(this.startOffsets.top+this.actuator.getHeight()/2)+"px",display:""});new Effect.Parallel([new Effect.Opacity(this.box,{from:0,to:1,sync:true}),new Effect.Scale(this.box,10000,{scaleMode:{originalHeight:this.dims.height.from,originalWidth:this.dims.width.from},scaleFromCenter:true,sync:true}),new Effect.Morph(this.box,{style:"left:"+this.targetOffsets.left+"px;top:"+this.targetOffsets.top+"px;",sync:true}),new Effect.Tween(this.currentImage,this.dims.height.from,this.dims.height.to,{sync:true},this.setHeight.bind(this)),new Effect.Tween(this.currentImage,this.dims.width.from,this.dims.width.to,{sync:true},this.setWidth.bind(this))],{duration:0.6,beforeStart:this.options.beforeOpen.bind(this),afterFinish:function(){this.close.appear({duration:0.3});this.options.afterOpen()}.bind(this)})},hide:function(){var a="top:"+this.startOffsets.top+"px;left:"+(this.startOffsets.left+this.actuator.getWidth()/2)+"px;";new Effect.Parallel([new Effect.Opacity(this.box,{from:1,to:0,sync:true}),new Effect.Scale(this.box,0.01,{scaleMode:{originalHeight:this.dims.height.to,originalWidth:this.dims.width.to},scaleFromCenter:true,sync:true}),new Effect.Morph(this.box,{style:a,sync:true}),new Effect.Tween(this.currentImage,this.dims.height.to,this.dims.height.from,{sync:true},this.setHeight.bind(this)),new Effect.Tween(this.currentImage,this.dims.width.to,this.dims.width.from,{sync:true},this.setWidth.bind(this))],{duration:0.5,beforeStart:function(){this.close.fade({duration:0.3});this.options.beforeClose()}.bind(this),afterFinish:function(){this.actuator=null;this.options.afterClose()}.bind(this)})},setHeight:function(a){this.currentImage.height=a},setWidth:function(a){this.currentImage.width=a}};var ImageZoom=Class.create();ImageZoom.Options={beforeOpen:Prototype.emptyFunction,afterOpen:Prototype.emptyFunction,beforeClose:Prototype.emptyFunction,afterClose:Prototype.emptyFunction};Object.extend(ImageZoom.prototype,{initialize:function(a){var a=Object.extend(ImageZoom.Options,a||{});if(!ZoomBox.initialized){ZoomBox.initialize(a)}var c=new RegExp(/\.jpg|\.png|\.gif\?\d*\Z/i);$$("a").each(function(d){if(d.href&&c.match(d.href)&&!d.hasClassName("no-zoom")){d.addClassName("image-zoom-actuator");if(d.down("img")){d.down("img").addClassName("image-zoom-actuator")}}})}});var Asset={assets:[],load:function(a,c){var d=new Image();d.src=a;this.assets.push({image:d,load:c||Prototype.emptyFunction});this.wait()},wait:function(){if(this.interval){return}this.interval=setInterval(this.check.bind(this),10)},check:function(){this.assets=this.assets.map(function(a){if(a.image.complete){if(a.load){a.load(a.image.src)}return null}else{return a}}).compact();if(this.assets.length==0){clearInterval(this.interval);this.interval=null}}};if(typeof Prototype=="undefined"){alert("CalendarDateSelect Error: Prototype could not be found. Please make sure that your application's layout includes prototype.js (.g. javascript_include_tag :defaults) *before* it includes calendar_date_select.js (.g. calendar_date_select_includes).")}if(Prototype.Version<"1.6"){alert("Prototype 1.6.0 is required.  If using earlier version of prototype, please use calendar_date_select version 1.8.3")}Element.addMethods({purgeChildren:function(a){$A(a.childNodes).each(function(c){$(c).remove()})},build:function(c,f,a,d){var g=Element.buildAndAppend(f,a,d);c.appendChild(g);return g}});Element.buildAndAppend=function(d,a,c){var f=$(document.createElement(d));$H(a).each(function(g){f[g.key]=g.value});if(c){f.setStyle(c)}return f};nil=null;Date.one_day=24*60*60*1000;Date.weekdays=$w("S M T W T F S");Date.first_day_of_week=0;Date.months=$w("January February March April May June July August September October November December");Date.padded2=function(a){var c=parseInt(a,10);if(a<10){c="0"+c}return c};Date.prototype.getPaddedMinutes=function(){return Date.padded2(this.getMinutes())};Date.prototype.getAMPMHour=function(){var a=this.getHours();return(a==0)?12:(a>12?a-12:a)};Date.prototype.getAMPM=function(){return(this.getHours()<12)?"AM":"PM"};Date.prototype.stripTime=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate())};Date.prototype.daysDistance=function(a){return Math.round((a-this)/Date.one_day)};Date.prototype.toFormattedString=function(c){var a,d;d=Date.months[this.getMonth()]+" "+this.getDate()+", "+this.getFullYear();if(c){a=this.getHours();d+=" "+this.getAMPMHour()+":"+this.getPaddedMinutes()+" "+this.getAMPM()}return d};Date.parseFormattedString=function(a){return new Date(a)};Math.floor_to_interval=function(c,a){return Math.floor(c/a)*a};window.f_height=function(){return([window.innerHeight?window.innerHeight:null,document.documentElement?document.documentElement.clientHeight:null,document.body?document.body.clientHeight:null].select(function(a){return a>0}).first()||0)};window.f_scrollTop=function(){return([window.pageYOffset?window.pageYOffset:null,document.documentElement?document.documentElement.scrollTop:null,document.body?document.body.scrollTop:null].select(function(a){return a>0}).first()||0)};_translations={OK:"OK",Now:"Now",Today:"Today",Clear:"Clear"};SelectBox=Class.create();SelectBox.prototype={initialize:function(f,c,d,a){this.element=$(f).build("select",d,a);this.populate(c)},populate:function(a){this.element.purgeChildren();var c=this;$A(a).each(function(d){if(typeof(d)!="object"){d=[d,d]}c.element.build("option",{value:d[1],innerHTML:d[0]})})},setValue:function(c){var d=this.element;var a=false;$R(0,d.options.length-1).each(function(f){if(d.options[f].value==c.toString()){d.selectedIndex=f;a=true}});return a},getValue:function(){return $F(this.element)}};CalendarDateSelect=Class.create();CalendarDateSelect.prototype={initialize:function(c,a){this.target_element=$(c);if(!this.target_element){alert("Target element "+c+" not found!");return false}if(this.target_element.tagName!="INPUT"){this.target_element=this.target_element.down("INPUT")}this.target_element.calendar_date_select=this;this.last_click_at=0;this.options=$H({embedded:false,popup:nil,time:false,buttons:true,clear_button:true,year_range:10,close_on_click:nil,minute_interval:5,popup_by:this.target_element,month_year:"dropdowns",onchange:this.target_element.onchange,valid_date_check:nil}).merge(a||{});this.use_time=this.options.get("time");this.parseDate();this.callback("before_show");this.initCalendarDiv();if(!this.options.get("embedded")){this.positionCalendarDiv();Event.observe(document,"mousedown",this.closeIfClickedOut_handler=this.closeIfClickedOut.bindAsEventListener(this));Event.observe(document,"keypress",this.keyPress_handler=this.keyPress.bindAsEventListener(this))}this.callback("after_show")},positionCalendarDiv:function(){var p=false;var l=this.calendar_div.cumulativeOffset(),n=l[0],k=l[1],d=this.calendar_div.getDimensions(),q=d.height,c=d.width;var o=window.f_scrollTop(),f=window.f_height();var r=$(this.options.get("popup_by")).cumulativeOffset(),h=r[1],s=r[0],j=$(this.options.get("popup_by")).getDimensions().height,m=h+j;if(((m+q)>(o+f))&&(m-q>o)){p=true}var a=s.toString()+"px",g=(p?(h-q):(h+j)).toString()+"px";this.calendar_div.style.left=a;this.calendar_div.style.top=g;this.calendar_div.setStyle({visibility:""});if(navigator.appName=="Microsoft Internet Explorer"){this.iframe=$(document.body).build("iframe",{src:"javascript:false",className:"ie6_blocker"},{left:a,top:g,height:q.toString()+"px",width:c.toString()+"px",border:"0px"})}},initCalendarDiv:function(){if(this.options.get("embedded")){var parent=this.target_element.parentNode;var style={}}else{var parent=document.body;var style={position:"absolute",visibility:"hidden",left:0,top:0}}this.calendar_div=$(parent).build("div",{className:"calendar_date_select"},style);var that=this;$w("top header body buttons footer bottom").each(function(name){eval("var "+name+"_div = that."+name+"_div = that.calendar_div.build('div', { className: 'cds_"+name+"' }, { clear: 'left'} ); ")});this.initHeaderDiv();this.initButtonsDiv();this.initCalendarGrid();this.updateFooter("&#160;");this.refresh();this.setUseTime(this.use_time)},initHeaderDiv:function(){var a=this.header_div;this.close_button=a.build("a",{innerHTML:"x",href:"#",onclick:function(){this.close();return false}.bindAsEventListener(this),className:"close"});this.next_month_button=a.build("a",{innerHTML:"&gt;",href:"#",onclick:function(){this.navMonth(this.date.getMonth()+1);return false}.bindAsEventListener(this),className:"next"});this.prev_month_button=a.build("a",{innerHTML:"&lt;",href:"#",onclick:function(){this.navMonth(this.date.getMonth()-1);return false}.bindAsEventListener(this),className:"prev"});if(this.options.get("month_year")=="dropdowns"){this.month_select=new SelectBox(a,$R(0,11).map(function(c){return[Date.months[c],c]}),{className:"month",onchange:function(){this.navMonth(this.month_select.getValue())}.bindAsEventListener(this)});this.year_select=new SelectBox(a,[],{className:"year",onchange:function(){this.navYear(this.year_select.getValue())}.bindAsEventListener(this)});this.populateYearRange()}else{this.month_year_label=a.build("span")}},initCalendarGrid:function(){var a=this.body_div;this.calendar_day_grid=[];var j=a.build("table",{cellPadding:"0px",cellSpacing:"0px",width:"100%"});var c=j.build("thead").build("tr");Date.weekdays.each(function(k){c.build("th",{innerHTML:k})});var g=j.build("tbody");var d=0,f;for(var h=0;h<42;h++){f=(h+Date.first_day_of_week)%7;if(h%7==0){days_row=g.build("tr",{className:"row_"+d++})}(this.calendar_day_grid[h]=days_row.build("td",{calendar_date_select:this,onmouseover:function(){this.calendar_date_select.dayHover(this)},onmouseout:function(){this.calendar_date_select.dayHoverOut(this)},onclick:function(){this.calendar_date_select.updateSelectedDate(this,true)},className:(f==0)||(f==6)?" weekend":""},{cursor:"pointer"})).build("div");this.calendar_day_grid[h]}},initButtonsDiv:function(){var f=this.buttons_div;if(this.options.get("time")){var c=$A(this.options.get("time")=="mixed"?[[" - ",""]]:[]);f.build("span",{innerHTML:"@",className:"at_sign"});var a=new Date();this.hour_select=new SelectBox(f,c.concat($R(0,23).map(function(g){a.setHours(g);return $A([a.getAMPMHour()+" "+a.getAMPM(),g])})),{calendar_date_select:this,onchange:function(){this.calendar_date_select.updateSelectedDate({hour:this.value})},className:"hour"});f.build("span",{innerHTML:":",className:"seperator"});var d=this;this.minute_select=new SelectBox(f,c.concat($R(0,59).select(function(g){return(g%d.options.get("minute_interval")==0)}).map(function(g){return $A([Date.padded2(g),g])})),{calendar_date_select:this,onchange:function(){this.calendar_date_select.updateSelectedDate({minute:this.value})},className:"minute"})}else{if(!this.options.get("buttons")){f.remove()}}if(this.options.get("buttons")){f.build("span",{innerHTML:"&#160;"});if(this.options.get("time")=="mixed"||!this.options.get("time")){b=f.build("a",{innerHTML:_translations.Today,href:"#",onclick:function(){this.today(false);return false}.bindAsEventListener(this)})}if(this.options.get("time")=="mixed"){f.build("span",{innerHTML:"&#160;|&#160;",className:"button_seperator"})}if(this.options.get("time")){b=f.build("a",{innerHTML:_translations.Now,href:"#",onclick:function(){this.today(true);return false}.bindAsEventListener(this)})}if(!this.options.get("embedded")&&!this.closeOnClick()){f.build("span",{innerHTML:"&#160;|&#160;",className:"button_seperator"});f.build("a",{innerHTML:_translations.OK,href:"#",onclick:function(){this.close();return false}.bindAsEventListener(this)})}if(this.options.get("clear_button")){f.build("span",{innerHTML:"&#160;|&#160;",className:"button_seperator"});f.build("a",{innerHTML:_translations.Clear,href:"#",onclick:function(){this.clearDate();if(!this.options.get("embedded")){this.close()}return false}.bindAsEventListener(this)})}}},refresh:function(){this.refreshMonthYear();this.refreshCalendarGrid();this.setSelectedClass();this.updateFooter()},refreshCalendarGrid:function(){this.beginning_date=new Date(this.date).stripTime();this.beginning_date.setDate(1);this.beginning_date.setHours(12);var c=this.beginning_date.getDay();if(c<3){c+=7}this.beginning_date.setDate(1-c+Date.first_day_of_week);var f=new Date(this.beginning_date);var a=new Date().stripTime();var d=this.date.getMonth();vdc=this.options.get("valid_date_check");for(var g=0;g<42;g++){day=f.getDate();month=f.getMonth();cell=this.calendar_day_grid[g];Element.remove(cell.childNodes[0]);div=cell.build("div",{innerHTML:day});if(month!=d){div.className="other"}cell.day=day;cell.month=month;cell.year=f.getFullYear();if(vdc){if(vdc(f.stripTime())){cell.removeClassName("disabled")}else{cell.addClassName("disabled")}}f.setDate(day+1)}if(this.today_cell){this.today_cell.removeClassName("today")}if($R(0,41).include(days_until=this.beginning_date.stripTime().daysDistance(a))){this.today_cell=this.calendar_day_grid[days_until];this.today_cell.addClassName("today")}},refreshMonthYear:function(){var a=this.date.getMonth();var d=this.date.getFullYear();if(this.options.get("month_year")=="dropdowns"){this.month_select.setValue(a,false);var c=this.year_select.element;if(this.flexibleYearRange()&&(!(this.year_select.setValue(d,false))||c.selectedIndex<=1||c.selectedIndex>=c.options.length-2)){this.populateYearRange()}this.year_select.setValue(d)}else{this.month_year_label.update(Date.months[a]+" "+d.toString())}},populateYearRange:function(){this.year_select.populate(this.yearRange().toArray())},yearRange:function(){if(!this.flexibleYearRange()){return $R(this.options.get("year_range")[0],this.options.get("year_range")[1])}var a=this.date.getFullYear();return $R(a-this.options.get("year_range"),a+this.options.get("year_range"))},flexibleYearRange:function(){return(typeof(this.options.get("year_range"))=="number")},validYear:function(a){if(this.flexibleYearRange()){return true}else{return this.yearRange().include(a)}},dayHover:function(a){var c=new Date(this.selected_date);c.setYear(a.year);c.setMonth(a.month);c.setDate(a.day);this.updateFooter(c.toFormattedString(this.use_time))},dayHoverOut:function(a){this.updateFooter()},clearSelectedClass:function(){if(this.selected_cell){this.selected_cell.removeClassName("selected")}},setSelectedClass:function(){if(!this.selection_made){return}this.clearSelectedClass();if($R(0,42).include(days_until=this.beginning_date.stripTime().daysDistance(this.selected_date.stripTime()))){this.selected_cell=this.calendar_day_grid[days_until];this.selected_cell.addClassName("selected")}},reparse:function(){this.parseDate();this.refresh()},dateString:function(){return(this.selection_made)?this.selected_date.toFormattedString(this.use_time):"&#160;"},parseDate:function(){var a=$F(this.target_element).strip();this.selection_made=(a!="");this.date=a==""?NaN:Date.parseFormattedString(this.options.get("date")||a);if(isNaN(this.date)){this.date=new Date()}if(!this.validYear(this.date.getFullYear())){this.date.setYear((this.date.getFullYear()<this.yearRange().start)?this.yearRange().start:this.yearRange().end)}this.selected_date=new Date(this.date);this.use_time=/[0-9]:[0-9]{2}/.exec(a)?true:false;this.date.setDate(1)},updateFooter:function(a){if(!a){a=this.dateString()}this.footer_div.purgeChildren();this.footer_div.build("span",{innerHTML:a})},clearDate:function(){if((this.target_element.disabled||this.target_element.readOnly)&&this.options.get("popup")!="force"){return false}var a=this.target_element.value;this.target_element.value="";this.clearSelectedClass();this.updateFooter("&#160;");if(a!=this.target_element.value){this.callback("onchange")}},updateSelectedDate:function(d,c){var h=$H(d);if((this.target_element.disabled||this.target_element.readOnly)&&this.options.get("popup")!="force"){return false}if(h.get("day")){var g=this.selected_date,f=this.options.get("valid_date_check");for(var a=0;a<=3;a++){g.setDate(h.get("day"))}g.setYear(h.get("year"));g.setMonth(h.get("month"));if(f&&!f(g.stripTime())){return false}this.selected_date=g;this.selection_made=true}if(!isNaN(h.get("hour"))){this.selected_date.setHours(h.get("hour"))}if(!isNaN(h.get("minute"))){this.selected_date.setMinutes(Math.floor_to_interval(h.get("minute"),this.options.get("minute_interval")))}if(h.get("hour")===""||h.get("minute")===""){this.setUseTime(false)}else{if(!isNaN(h.get("hour"))||!isNaN(h.get("minute"))){this.setUseTime(true)}}this.updateFooter();this.setSelectedClass();if(this.selection_made){this.updateValue()}if(this.closeOnClick()){this.close()}if(c&&!this.options.get("embedded")){if((new Date()-this.last_click_at)<333){this.close()}this.last_click_at=new Date()}},closeOnClick:function(){if(this.options.get("embedded")){return false}if(this.options.get("close_on_click")===nil){return(this.options.get("time"))?false:true}else{return(this.options.get("close_on_click"))}},navMonth:function(a){(target_date=new Date(this.date)).setMonth(a);return(this.navTo(target_date))},navYear:function(a){(target_date=new Date(this.date)).setYear(a);return(this.navTo(target_date))},navTo:function(a){if(!this.validYear(a.getFullYear())){return false}this.date=a;this.date.setDate(1);this.refresh();this.callback("after_navigate",this.date);return true},setUseTime:function(c){this.use_time=this.options.get("time")&&(this.options.get("time")=="mixed"?c:true);if(this.use_time&&this.selected_date){var d=Math.floor_to_interval(this.selected_date.getMinutes(),this.options.get("minute_interval"));var a=this.selected_date.getHours();this.hour_select.setValue(a);this.minute_select.setValue(d)}else{if(this.options.get("time")=="mixed"){this.hour_select.setValue("");this.minute_select.setValue("")}}},updateValue:function(){var a=this.target_element.value;this.target_element.value=this.dateString();if(a!=this.target_element.value){this.callback("onchange")}},today:function(a){var f=new Date();this.date=new Date();var c=$H({day:f.getDate(),month:f.getMonth(),year:f.getFullYear(),hour:f.getHours(),minute:f.getMinutes()});if(!a){c=c.merge({hour:"",minute:""})}this.updateSelectedDate(c,true);this.refresh()},close:function(){if(this.closed){return false}this.callback("before_close");this.target_element.calendar_date_select=nil;Event.stopObserving(document,"mousedown",this.closeIfClickedOut_handler);Event.stopObserving(document,"keypress",this.keyPress_handler);this.calendar_div.remove();this.closed=true;if(this.iframe){this.iframe.remove()}if(this.target_element.type!="hidden"&&!this.target_element.disabled){this.target_element.focus()}this.callback("after_close")},closeIfClickedOut:function(a){if(!$(Event.element(a)).descendantOf(this.calendar_div)){this.close()}},keyPress:function(a){if(a.keyCode==Event.KEY_ESC){this.close()}},callback:function(a,c){if(this.options.get(a)){this.options.get(a).bind(this.target_element)(c)}}};Date.weekdays=$w("Mo Di Mi Do Fr Sa So");Date.months=$w("Januar Februar März April Mai Juni Juli August September Oktober November Dezember");Date.first_day_of_week=1;_translations={OK:"OK",Now:"Jetzt",Today:"Heute",Clear:"Löschen"};Date.prototype.toFormattedString=function(a){str=Date.padded2(this.getDate())+". "+Date.months[this.getMonth()]+" "+this.getFullYear();if(a){str+=", um "+this.getHours()+":"+this.getPaddedMinutes()}return str};Date.parseFormattedString=function(g){var c=g.match(/([0-9]{1,2})[\.\s]*([^\.\s]*)[\.\s]*([0-9]{4}|[0-9]{2})/i);if(c==null){return Date.parse(g)}var a=g.match(/([0-9]{1,2}):([0-5][0-9]):?([1-5][0-9])?/i);if(c[3].length==2){c[3]=(parseFloat(c[3][0])>5?"19":"20")+c[3]}var k=parseFloat(c[3]);var j=parseFloat(c[2]);if(isNaN(j)){j=Date.months.indexOf(c[2])+1}var l=parseFloat(c[1]);if(a!=null){var d=(a[1]==undefined?0:parseFloat(a[1]));var f=(a[2]==undefined?0:parseFloat(a[2]));var h=(a[3]==undefined?0:parseFloat(a[3]));return new Date(k,j-1,l,d,f,h)}return new Date(k,j-1,l)};if(Prototype.Browser.IE){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}if(window.ActiveXObject){Prototype.Browser[window.XMLHttpRequest?"IE7":"IE6"]=true;try{Prototype.Browser.IE8=(typeof(window.external.AddToFavoritesBar)!="undefined")}catch(e){}}Prototype.Browser.Chrome=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;var SelfLabeledInput=Class.create({initialize:function(a){this.input=$(a).addClassName("labeled");this.label=this.input.previous("label").innerHTML.stripTags();(function(){if($F(this.input).blank()){this.input.value=this.label}}).bind(this).delay(0.5);this.input.observe("focus",this.focus.bind(this));this.input.observe("blur",this.blur.bind(this))},focus:function(){if($F(this.input)!=this.label){return}this.input.removeClassName("labeled");this.input.value=""},blur:function(){if($F(this.input).empty()){this.input.addClassName("labeled");this.input.value=this.label}}});var Login={initialize:function(){this.loginFlip=$("login_flip");this.usernameInput=new SelfLabeledInput("ontop_login");this.passwordInput=new SelfLabeledInput("ontop_password");this.loginButton=new SubmitButton("ontop_submit_button",{disableAfterClick:1});this.registerEvents()},registerEvents:function(){this.passwordInput.input.observe("return:pressed",this.submit.bind(this.passwordInput.input));new DelayedHover(this.loginFlip,{containerClassName:"login-flip",regionClassName:"login-flip",targetClassName:"login-flip",activeClassName:"active",activationDelay:0.5})},submit:function(){this.up("form").submit()}};var GameMenu={initialize:function(){this.link=$("navigation_game_link");if(this.link.hasClassName("loggedout")){return}this.menu=$("game_navigation");this.link.observe("mouseover",this.showMenu.bind(this)).observe("mouseout",this.hideMenu.bind(this));this.menu.observe("mouseover",this.showMenu.bind(this)).observe("mouseout",this.hideMenu.bind(this));Event.observe(window,"resize",this.reposition.bind(this));this.reposition();this.initialized=true},reposition:function(){this.menu.setStyle({top:this.link.cumulativeOffset().top+25+"px",left:this.link.cumulativeOffset().left+"px"})},showMenu:function(a){this.menu.show();this.link.addClassName("active")},hideMenu:function(a){this.menu.hide();this.link.removeClassName("active")}};var Popup=Class.create({initialize:function(a){this.options=Object.extend({url:"#",target:"",width:970,height:Prototype.Browser.Chrome?742:690},a||{});this._popup=window.open(this.options.url,this.options.target,"width="+this.options.width+",height="+this.options.height+",location=no,resizable=yes,menubar=no,toolbar=no,scrolling=yes,status=no");return this._popup},moveToCenter:function(){if(!this._popup){return}var a=Position.getPageSize().window;this._popup.moveTo(screen.availWidth/2-this.options.width/2,screen.availHeight/2-this.options.height/2)}});var ResizableTextarea=Class.create({initialize:function(a){this.textarea=$(a);this.originalHeight=this.textarea.getHeight();Event.observe(window,"load",function(){this.shadowTextField=new Element("div");$(document.body).insert(this.shadowTextField);this.textarea.observe("keyup",this.checkForResize.bind(this));this.checkForResize()}.bind(this))},checkForResize:function(){this.shadowTextField.setStyle({position:"absolute",left:"-10000px",top:"-10000px",width:this.textarea.getWidth()+"px",fontSize:this.textarea.getStyle("fontSize"),fontFamily:this.textarea.getStyle("fontFamily"),lineHeight:this.textarea.getStyle("lineHeight"),resize:"none"});this.shadowTextField.update(this.textarea.value.gsub(/\n/,"<br/>"));var a=this.shadowTextField.getHeight();if(Prototype.Browser.IE){a=a<7?this.originalHeight:a+60}else{a=a<28?this.originalHeight:a+36}this.textarea.setStyle({height:a+"px"})}});var GameLinks={initialize:function(){if(swfobject.hasFlashPlayerVersion("10.0.32")===true){$$("a.playgame").invoke("observe","click",this.openPopup.bind(this))}else{$$("a.playgame").each(function(a){a=a.tagName=="A"?a:a.up("a.playgame");a.href="/hilfe/flash-player-installation"})}},openPopup:function(d){d.stop();var c=d.element();c=c.tagName=="A"?c:c.up("a.playgame");var a=new Popup({url:c.href,target:"gameWindow"});a.moveToCenter()}};var Transition=Class.create({initialize:function(d,c,a){this.from=$(d);this.to=$(c);this.options=Object.extend({actuator:null,queue:null},a||{});if(this.options.actuator){$(this.options.actuator).observe("click",this.start.bind(this))}else{this.start()}},start:function(g){if(g){g.stop()}var j=this.from.wrap("div");j.insert(this.to);var h=this.from.getDimensionsIncludingMargins().height,a=this.to.getDimensionsIncludingMargins().height;j.setStyle({height:h+"px",width:this.from.getWidth()+"px",overflow:"hidden"});this.to.setStyle({position:"absolute",opacity:"0",display:""});[this.from,this.to].invoke("setStyle",{position:"absolute"});this.to.setStyle({opacity:0,display:""});var f=[new Effect.Opacity(this.from,{from:1,to:0,sync:true}),new Effect.Opacity(this.to,{from:0,to:1,sync:true}),new Effect.Tween(j,h,a,{sync:true},function(k){j.setStyle({height:k+"px"})})];var d=function(){[this.from,this.to].invoke("setStyle",{position:"relative"});this.from.hide();j.insert({before:this.from});j.insert({before:this.to});j.remove()};var c={duration:1,afterFinish:d.bind(this)};if(this.options.queue){Object.extend(c,{queue:this.options.queue})}new Effect.Parallel(f,c)}});var Expandable=Class.create({initialize:function(c,f,d,a){this.element=$(c);this.actuator=$(f);if(!this.element){return}if(!this.actuator){return}this.options=Object.extend({replacementText:null},a||{});this.collapsedHeight=d;this.expandedHeight=this.element.getHeight();this.actuatorText=this.actuator.innerHTML.stripTags();if(this.expandedHeight>this.collapsedHeight){this.element.setStyle({overflow:"hidden",height:this.collapsedHeight+"px"})}else{this.actuator.hide();return}[this.actuator,this.element].invoke("observe","click",this.toggle.bind(this))},toggle:function(c){if(c){c.stop()}var a=this.element.getHeight(),d=a>this.collapsedHeight;this.element.morph("height:"+(d?this.collapsedHeight:this.expandedHeight)+"px",{duration:0.4});if(this.options.replacementText){this.actuator.update(d?this.actuatorText:this.options.replacementText)}}});var OpenBar={initialize:function(){this.bar=$("openbar");this.normalizeListWidths();this.registerEvents()},normalizeListWidths:function(){this.bar.select("ul li ul").each(function(c){var a=c.up("li");if(c){c.setStyle({width:c.offsetWidth>a.offsetWidth?c.offsetWidth:a.offsetWidth+"px"});if(Prototype.Browser.IE&&!Prototype.Browser.IE8&&a.up().getStyle("margin-left")!==null){var d=$("announcement")&&$("announcement").visible()?$("announcement").getHeight():0;c.setStyle({left:a.offsetLeft+parseInt(a.up().getStyle("margin-left"))+"px",top:this.bar.offsetHeight-22+d+"px"})}}}.bind(this))},registerEvents:function(){new DelayedHover("openbar",{containerClassName:"component",regionClassName:"component",targetClassName:"dropdown",activeClassName:"over",activationDelay:0})}};var LoginPage={initialize:function(){this.form=$("login_form");this.signupButton=new SubmitButton("inline_login_button",{disableAfterClick:1});$("password_input").observe("return:pressed",function(a){this.form.submit()}.bind(this));$("username_input").focus()}};var Topics={initialize:function(){this.tabs=$("topics").select("ul.tabs li a");this.active=$("topics").select("ul.tabs li a.active").first().rel;this.tabs.each(function(a){a.observe("click",this.tabClicked.bind(this))}.bind(this))},tabClicked:function(c){c.stop();var a=c.element();if(a.rel==(this.active)){return}var f=Prototype.Browser.IE6?0:0.5;$(this.active).fade({duration:f});this.tabs.invoke("removeClassName","active");a.addClassName("active");this.active=a.rel;$(this.active).appear({duration:f})}};var Pullquotes={initialize:function(){this.pullquotes=$("pullquotes");this.quotes=this.pullquotes.select("blockquote");this.currentQuote=this.quotes.first();this.pullquotes.observe("mouseover",this.stop.bind(this));this.pullquotes.observe("mouseout",this.start.bind(this));this.start()},start:function(){if(!this.pe){this.pe=new PeriodicalExecuter(this.changeQuote.bind(this),5)}},changeQuote:function(){this.currentQuote.fade();var a=this.quotes.indexOf(this.currentQuote),c=a==this.quotes.length-1?0:a+1;this.currentQuote=this.quotes[c].appear()},stop:function(){if(this.pe){this.pe.stop();this.pe=null}}};var Validation=Class.create({initialize:function(a,d,c){this.type=d;this.input=$(a);this.options=Object.extend({local:false,onValid:Prototype.emptyFunction,onInvalid:Prototype.emptyFunction,onLoading:Prototype.emptyFunction,onValidated:Prototype.emptyFunction},c||{});this.input.observe("change",this.validate.bindAsEventListener(this))},validate:function(c){if(!this.options.local){this.validateRemote()}else{var a=this.options.local();if(a===true){this.options.onValid()}else{this.options.onInvalid(a)}}},validateRemote:function(){var a={field:this.type};a["user["+this.type+"]"]=$F(this.input);new Ajax.Request("/users/validate",{parameters:a,onLoading:this.options.onLoading,onSuccess:function(c){if(c.responseText.blank()){this.options.onValid()}else{this.options.onInvalid(c.responseText)}}.bind(this)})}});var FlashCookie={initialize:function(a){this.cookieId=a||"CBCookie";this.cookie=Prototype.Browser.IE?window[this.cookieId]:document[this.cookieId];this.initialized=this.cookie&&this.cookie.f_cookie_able();(this.flashLoaded||Prototype.emptyFunction)()},remove:function(a){if(!this.initialized){return}this.cookie.f_delete_cookie(a)},get:function(a){if(!this.initialized){return}var c=this.cookie.f_get_cookie(a);return c=="null"?null:c},set:function(a,c){if(!this.initialized){return}this.cookie.f_set_cookie(a,c)}};FlashCookie.embedFlash=function(){if(this.flashEmbeded){return}swfobject.embedSWF("/CB_Cookie.swf","cbcookie","1","1","8.0","/playerProductInstall.swf",{},{allowscriptaccess:"always"},{name:"CBCookie",id:"CBCookie"});this.flashEmbeded=true};var Cookie={domain:location.hostname.replace(/^www\./,""),set:function(c,d,g){var a=new Date(),f=new Date(0).getTime();if(f>0){a.setTime(a.getTime()-f)}a.setTime(a.getTime()+(g||365)*24*60*60*1000);document.cookie=c+"="+escape(d)+";expires="+a.toGMTString()+";path=/;domain="+this.domain},get:function(c){var f=c+"=",a=document.cookie.indexOf(f);if(a==-1){return null}var d=document.cookie.indexOf(";",a+f.length);if(d==-1){d=document.cookie.length}return unescape(document.cookie.substring(a+f.length,d))},remove:function(a){document.cookie=a+"=;expires=Thu, 01-Jan-70 00:00:01 GMT;path=/;domain="+this.domain}};var Signup={initialize:function(){this.inputs=[];this.submitButton=new SubmitButton("signup_button",{onclick:function(){}});this.submitButton.disable();var a=[{id:"user_login",type:"login"},{id:"user_email",type:"email"},{id:"user_password",type:"password"}];a.each(function(d){Signup.inputs.push($(d.id));var f=new Validation(d.id,d.type);f.options.onLoading=Signup._showSpinner.bind(f);f.options.onInvalid=Signup._showError.bind(f);f.options.onValid=Signup._showOK.bind(f)});var c=new Validation("user_password_confirmation","password_confirmation",{local:function(){if($F("user_password_confirmation")!=$F("user_password")){return"stimmt nicht überein"}else{return true}}});c.options.onInvalid=Signup._showError.bind(c);c.options.onValid=Signup._showOK.bind(c);$("user").observe("click",Signup.checkForm.bind(Signup));this.inputs.push($("user_password_confirmation"))},checkForm:function(){var c=true;Signup.inputs.each(function(d){if($F(d).blank()||d.hasClassName("error")){c=false;throw $break}});var a=$("user").checked;this.submitButton[c&&a?"enable":"disable"]()},_showError:function(a){$(this.type+"Spinner",this.type+"OK").invoke("hide");$(this.type+"Message").update(a).show();$(this.type+"Failed").show();$(this.input).addClassName("error");Signup.checkForm()},_showOK:function(){$(this.type+"Spinner",this.type+"Message",this.type+"Failed").invoke("hide");$(this.input).removeClassName("error");$(this.type+"OK").show();Signup.checkForm()},_showSpinner:function(){$(this.type+"OK",this.type+"Failed",this.type+"Message").invoke("hide");$(this.type+"Spinner").show()}};var Button=Class.create({initialize:function(c,a){this.options=Object.extend({disableAfterClick:true,className:"default-button default button",onclick:Prototype.emptyFunction},a||{});if(this.options.useExisting){this.element=$(c);this.button=this.options.useExisting.button;this.label=this.button.down("span")}else{this.element=$(c).hide();this.button=new Element("a",{className:this.options.className,href:"#"}).addClassName("button");this.label=new Element("span");this.button.insert({bottom:this.label});this.element.insert({after:this.button});this.label.update(this.element.value||this.element.alt||this.element.innerHTML)}this.button.observe("click",this.onclick.bindAsEventListener(this))},onclick:function(a){a.stop();if(this.disabled){return}if(this.options.disableAfterClick){this.disable();window.setTimeout(this.enable.bind(this),2*1000)}this.options.onclick(a)},disable:function(){this.disabled=true;this.button.addClassName("disabled")},enable:function(){this.disabled=false;this.button.removeClassName("disabled")}});var SubmitButton=Class.create(Button,{onclick:function($super,a){a.stop();if(this.disabled){return}$super(a);this.element.up("form").submit()}});var LinkButton=Class.create(Button,{onclick:function($super,a){$super(a);window.location=this.element.href||"/"}});var Shoutbox={initialize:function(a){this.shoutbox=$("chitchat");this.textarea=$("shoutbox_textarea").update("");this.olderLink=$("tratsch_older");this.newerLink=$("tratsch_newer");this.recentlyLink=$("tratsch_recently");this.editBox=this.textarea.up("blockquote.chitchat");this.createUrl=a;this.registerEvents()},registerEvents:function(){$w("recently newer older").each(function(a){if(this[a+"Link"]){this[a+"Link"].observe("click",this["show"+a.capitalize()].bind(this))}}.bind(this))},currentPage:1,showNewer:function(a){a.stop();[this.newerLink,this.recentlyLink].invoke("show");if(this.currentPage==1){return}else{if(this.currentPage==2){this.showRecently(a);return}else{this.loadShoutsForPage(this.currentPage-1)}}},showOlder:function(a){a.stop();[this.newerLink,this.recentlyLink,this.olderLink].invoke("show");if(this.editBox.visible()){this.editBox.slideUp({duration:0.5,afterFinish:function(){this.loadShoutsForPage(this.currentPage+1)}.bind(this)})}else{this.loadShoutsForPage(this.currentPage+1)}},showRecently:function(a){a.stop();[this.newerLink,this.recentlyLink].invoke("hide");this.olderLink.show();if(!this.editBox.visible()){this.editBox.slideDown({duration:0.5,afterFinish:function(){this.loadShoutsForPage(1)}.bind(this)})}else{this.loadShoutsForPage(1)}},loadShoutsForPage:function(c){var a=function(d){this.shoutbox.morph("opacity:0;",{duration:0.3,afterFinish:function(f){f.element.update(d.responseText);f.element.morph("opacity:1;",{duration:0.3})}});this.currentPage=c};new Ajax.Request("/welcome/shouts",{parameters:{page:c},onSuccess:a.bind(this)})},SUCCESS_COLOR:"#e1f6e4",ERROR_COLOR:"#f2caca",submitClicked:function(a){if(a&&("stop" in a)){a.stop()}if($F(this.textarea).blank()){new Effect.Highlight(this.textarea,{startcolor:this.ERROR_COLOR});this.textarea.focus();return}var c=function(f){new Effect.Highlight(this.textarea,{startcolor:this.SUCCESS_COLOR,endcolor:"#ffffff",beforeStart:function(){this.textarea.value="";this.textarea.focus()}.bind(this)});this.shoutbox.insert({top:f});var d=this.shoutbox.down("blockquote.chitchat").setOpacity(0);new Effect.SlideDown(d,{duration:0.4,afterFinish:function(g){delay:0.2,g.element.morph("opacity:1;",{duration:0.6})}})}.bind(this);new Ajax.Request(this.createUrl,{parameters:{"shout[comment]":$F(this.textarea)},onSuccess:function(d){c(d.responseText)}})},animateDelete:function(a){$(a).morph("opacity:0;",{duration:0.3,afterFinish:function(c){new Effect.SlideUp(c.element,{duration:0.5,afterFinish:function(d){d.element.remove()}})}})}};var Grandstand={MOVIE:"/avatar/grandstand.swf",initialize:function(){this.links=$$("ul#rankings li a");this.links.each(function(a){a.observe("click",function(c){c.stop();this.showRanking(a)}.bind(this))}.bind(this));this.initializeFlash();this.activateDateRangeSelector()},initializeFlash:function(){this.createFlash();this.__recentlyInitialized=true},createFlash:function(){var a={id:"grandstand_flash"},d={wmode:"opaque",allowscriptaccess:"always"};var c=this.MOVIE+"?v=1";swfobject.embedSWF(c,"grandstand_flash","390","423","9.0.0","/expressinstall.swf",{},d,a)},onLoad:function(){if(!this.__recentlyInitialized){return}this.showRanking($("games_played"));this.__recentlyInitialized=false},activateDateRangeSelector:function(){$("grandstand_date_ranges").observe("change",function(a){window.location="/ehrentribuene/"+a.element().value})},reloadMoviesFrom:function(c){if(Prototype.Browser.IE&&!this.__recentlyInitialized){$("grandstand_flash").remove();$("grandstand_flash_wrapper").insert(new Element("div",{id:"grandstand_flash"}));this.createFlash()}var a=Prototype.Browser.IE?window.grandstand_flash:document.grandstand_flash;a.reloadAvatars(this.getFlashVarsFrom(c))},getFlashVarsFrom:function(c){var a={};$w("first second third").each(function(f,d){a["config"+(d+1)]=$("overview_"+c).down("tr."+f+"-place").readAttribute("rel").evalJSON()});return a},showRanking:function(c){if(this.activeCategory&&c.id==this.activeCategory){return}var a=function(){this.links.invoke("removeClassName","active");c.addClassName("active");this.activeCategory=c.id}.bind(this);if(this.roll){this.roll.showMyRankFor(c.id,c.rel)}this.reloadMoviesFrom(c.id);a()},roll:{showMyRankFor:function(k,f){var c=$("roll"),a=$("myrank_label"),d=$("myrank_"+k);function j(){if(!c){return}var l=c.offsetHeight-(c.offsetHeight-d.offsetTop);c.morph("top:-"+l+"px",{afterFinish:function(){g()}});$("rank_roll").morph("height:"+d.getHeight()+"px")}function h(){a.fadeInOut({duration:0.4,onInbetween:function(){a.update(f)}})}function g(){var l=Prototype.Browser.IE&&!Prototype.Browser.IE8?0:65;$("scroll_indicator").morph({top:d.down(".me").offsetTop+l+"px",height:d.down(".me").getHeight()+"px"},{duration:0.5})}j();h()}},content:{setContentFrom:function(c){var a=$("ranking_content");a.fadeInOut({duration:0.6,onInbetween:function(){a.update(c.responseText)}})},setHeadline:function(c){var a=$("ranking_headline");a.fadeInOut({duration:0.6,onInbetween:function(){a.update(c)}})}}};var SegmentedControl=Class.create({initialize:function(c,a){this.element=$(c);this.activeTab=this.element.down(".active");this.activeSheet=$(this.activeTab.id.gsub("_tab","_content"));this.registerEvents()},registerEvents:function(){this.element.select("a").each(function(a){a.observe("click",this.onclick.bind(this))}.bind(this))},onclick:function(d){d.stop();var c=d.findElement("a"),a=$(c.id.gsub("_tab","_content"));this.activeTab.removeClassName("active");c.addClassName("active");this.activeSheet.hide();a.show();this.activeTab=c;this.activeSheet=a}});PopularGames={vote:function(a){Event.extend(a);if(a.element().up("td").hasClassName("voted")){a.stop()}}};var Knob=Class.create({initialize:function(c,a){if(!c){return}this.options=Object.extend({onClick:Prototype.emptyFunction});this.x=c.x;this.y=c.y;this.label=c.label||"";this.image=$(c.attachedTo);this.responder=$(c.respondsTo);this.drawKnob()},drawKnob:function(){this.knob=new Element("a",{href:"#",className:"knob"}).update(this.label);$(document.body).insert(this.knob);this.registerEvents();this.positionKnob();Knob.availableKnobs.push(this)},positionKnob:function(){this.imageCoords=this.image.cumulativeOffset();this.coords={x:this.imageCoords.left+this.x,y:this.imageCoords.top+this.y};this.knob.setStyle({left:this.coords.x+"px",top:this.coords.y+"px"})},registerEvents:function(){if(!this.responder){return}$w("over out").each(function(a){this.responder.observe("mouse"+a,this["onResponder"+a.capitalize()].bind(this));this.knob.observe("mouse"+a,this["onResponder"+a.capitalize()].bind(this))}.bind(this));this.knob.observe("click",this.onKnobClicked.bind(this))},onResponderOver:function(a){this.responder.addClassName("active");this.knob.addClassName("active")},onResponderOut:function(a){this.responder.removeClassName("active");this.knob.removeClassName("active")},onKnobClicked:function(a){a.stop();this.options.onClick(a)}});Knob.availableKnobs=[];Knob.updatePositions=function(){Knob.availableKnobs.invoke("positionKnob")};var VoteFloater={initialize:function(){this.floater=$("vote_floater");this.label=$("floater_label");this.glow=$("vote_glow");this.disable=$("disable_voting");if(!this.disable){return}this.disable.setOpacity(0.8);this.executer=new PeriodicalExecuter(this.checkForActivation.bind(this),0.3);this.lastTrick=$$("div.trick-container").last();if(this.lastTrick!=undefined){this.target=this.lastTrick.cumulativeOffset().top-this.lastTrick.getHeight()}},checkForActivation:function(){var a=document.body.cumulativeScrollOffset().top;if(Prototype.Browser.IE6){this.glow.setStyle({top:a+176+"px"});this.floater.setStyle({top:a+180+"px"})}if(this.activated){return}this.disable.setOpacity(0.8-(0.8/this.target)*a);if(this.lastTrick!=undefined&&this.lastTrick.withinViewport()){this.disable.hide();this.glow.appear({duration:0.2,afterFinish:function(c){c.element.pulsate({duration:3,afterFinish:function(d){d.element.fade({duration:0.2})}})}});this.activated=true}}};var Announcement={initialize:function(){this.announcement=$("announcement");this.announcement.highlight({startcolor:"#ffffff",duration:2});this.announcement.select("a.close").invoke("observe","click",this.close.bind(this))},close:function(a){a.stop();new Ajax.Request(a.element().href,{onSuccess:function(){this.announcement.morph("height:0px",{duration:0.5,afterFinish:function(){if(GameMenu.initialized){GameMenu.reposition()}}})}.bind(this)})}};var Rating=Class.create({initialize:function(c,a){this.element=$(c);this.rating=parseFloat(this.element.innerHTML);this.options=Object.extend({className:"rating-display",imagePrefix:"/images/sauspiel/rating-",imageSuffix:".png"},a||{});if(!Object.isNumber(this.rating)){return}else{this.draw()}},draw:function(){this.element.hide();this.display=new Element("div",{className:this.options.className});(2*this.rating).times(function(a){this.display.insert(new Element("img",{src:this.options.imagePrefix+(a%2==0?"left":"right")+this.options.imageSuffix}))}.bind(this));this.element.insert({after:this.display})}});var DelayedHover=Class.create({initialize:function(c,a){this.element=$(c);this.options=Object.extend({activationDelay:0,deactivationDelay:0.5,targetClassName:"hover-target",containerClassName:"hover-container",activeClassName:"hover",onMouseover:Prototype.emptyFunction,onMouseout:Prototype.emptyFunction},a||{});this.registerEvents()},registerEvents:function(){if(!this.observers){this.observers=$w("mouseover mouseout").map(function(a){var c=this["on"+a.capitalize()].bind(this);this.element.observe(a,c);return{observer:a,handler:c}}.bind(this))}},stopObserving:function(){if(this.observers){this.observers.each(function(a){this.element.stopObserving(a.observer,a.handler)}.bind(this));delete this.observers}},onMouseover:function(d){var c=this.activeHoverElement=d.element(),a=this.getContainerForElement(c);if(a){if(this.activeContainer){this.activateContainer(a)}else{this.startDelayedActivation(a)}}else{this.startDelayedDeactivation()}},onMouseout:function(a){delete this.activeHoverElement;this.startDelayedDeactivation()},activateContainer:function(a){this.stopDelayedDeactivation();if(this.activeContainer){if(this.activeContainer==a){return}this.deactivateContainer()}this.activeContainer=a;this.activeContainer.addClassName(this.options.activeClassName);this.options.onMouseover()},deactivateContainer:function(){if(this.activeContainer){this.activeContainer.removeClassName(this.options.activeClassName);this.options.onMouseout();delete this.activeContainer}},startDelayedActivation:function(a){if(this.options.activationDelay){(function(){if(a==this.getContainerForElement(this.activeHoverElement)){this.activateContainer(a)}}).bind(this).delay(this.options.activationDelay)}else{this.activateContainer(a)}},startDelayedDeactivation:function(){if(this.options.deactivationDelay){this.deactivationTimeout=this.deactivationTimeout||function(){var a=this.getContainerForElement(this.activeHoverElement);if(!a||a!=this.activeContainer){this.deactivateContainer()}}.bind(this).delay(this.options.deactivationDelay)}else{this.deactivateContainer()}},stopDelayedDeactivation:function(){if(this.deactivationTimeout){window.clearTimeout(this.deactivationTimeout);delete this.deactivationTimeout}},getContainerForElement:function(c){if(!c){return}if(c.hasAttribute&&!c.hasAttribute("hover_container")){var d=this.getTargetForElement(c),a=this.getContainerForTarget(d);this.cacheContainerFromElementToTarget(a,c,d)}return $(c.readAttribute("hover_container"))},getTargetForElement:function(c){if(!c){return}var a=this.options.targetClassName;return c.upwards(function(d){if(d.hasClassName){return d.hasClassName(a)}})},getContainerForTarget:function(c){if(!c){return}var a=this.options.containerClassName;return c.upwards(function(d){if(d.hasClassName){return d.hasClassName(a)}})},cacheContainerFromElementToTarget:function(a,c,d){if(a&&d){if(!a.id){a.id="hover_container_"+new Date().getTime()}c.upwards(function(f){f.writeAttribute("hover_container",a.id);if(f==d){return true}})}}});var Deprecator={initialize:function(){if(Cookie.get("deprecator")){return}Cookie.set("deprecator","deprecator",14);this.container=$("deprecator");new Ajax.Request("/deprecation-notice.html",{method:"get",onSuccess:this.render.bind(this)})},render:function(a){this.container.setStyle("height:"+Position.getPageSize().page.height+"px").insert(a.responseText);$("deprecator_close").observe("click",this.hide.bind(this));this.show()},show:function(){this.container.setOpacity(0).show().morph("opacity:1",{duration:1});$("deprecator_overlay").setStyle("height:"+Position.getPageSize().page.height+"px").setOpacity(0.7)},hide:function(){this.container.morph("opacity:0",{duration:0.4,afterFinish:function(a){a.element.hide()}})}};Element.addMethods({fadeInOut:function(c,a){a=Object.extend({duration:1,onInbetween:Prototype.emptyFunction,afterFinish:Prototype.emptyFunction},a||{});return c.morph("opacity:0;",{duration:a.duration,afterFinish:function(d){a.onInbetween.defer();d.element.morph("opacity:1;",{duration:a.duration,afterFinish:a.afterFinish})}})},upwards:function(a,c){while(a=$(a)){if(c(a)){return a}a=a.parentNode}},getMargins:function(a){return{vertical:parseInt(a.getStyle("margin-top"))+parseInt(a.getStyle("margin-bottom")),horizontal:parseInt(a.getStyle("margin-left"))+parseInt(a.getStyle("margin-right"))}},getDimensionsIncludingMargins:function(a){var d=$(a).getDimensions(),c=$(a).getMargins();return{height:d.height+c.vertical,width:d.width+c.horizontal}},getDimensionsFromInvisible:function(c){c=$(c);var a=c.ancestors(),d=[],g=[];a.push(c);a.each(function(j,h){if(j.visible()){return}d.push(j);g.push({display:j.getStyle("display"),position:j.getStyle("position"),visibility:j.getStyle("visibility")});j.setStyle({display:"block",position:"absolute",visibility:"visible"})});var f={width:c.clientWidth,height:c.clientHeight};d.each(function(j,h){j.setStyle(g[h])});return f},withinViewport:function(d){d=$(d);var g=d.cumulativeOffset(),f=document.viewport.getScrollOffsets(),a=d.getDimensions(),c=document.viewport.getDimensions();if(g[1]+a.height<f[1]||g[1]>f[1]+c.height||g[0]+a.width<f[0]||g[0]>f[0]+c.width){return false}return true}});Position.getPageSize=function(){var d,a;if(window.scrollMaxX){d=window.innerWidth+window.scrollMaxX;a=window.innerHeight+window.scrollMaxY}else{d=document.body.scrollWidth;a=document.body.scrollHeight}var c,f;if(self.innerHeight){c=self.innerWidth;f=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){c=document.documentElement.clientWidth;f=document.documentElement.clientHeight}else{if(document.body){c=document.body.clientWidth;f=document.body.clientHeight}}}pageHeight=Math.max(f,a);pageWidth=Math.max(c,d);return{page:{width:pageWidth,height:pageHeight},window:{width:c,height:f}}};Event.capture=function(c){var a=c.relatedTarget,f=c.currentTarget;if(Prototype.Browser.IE){return true}try{if(a&&a.nodeType==Node.TEXT_NODE){a=a.parentNode}if(a&&a!=f&&!a.descendantOf(f)){return true}}catch(d){}return false};(function(){function a(d){if(d.keyCode==Event.KEY_RETURN){var c=d.element().fire("return:pressed");if(c.stopped){d.stop()}}}document.observe("keypress",a)})();var Sauspiel={normalizeIE6:function(){if(!$("logo")){return}$("logo").observe("click",this.goHome.bind(this));this.renderPNG($$("img.big-profile-picture"))},renderPNG:function(a){a.each(function(c){c._src=c.src;c.setStyle({width:c.width+"px",height:c.height+"px"});c.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+c._src+'", sizingMethod="scale");';c.src="/images/empty.gif"})},goHome:function(){window.location.href="/"},setupZoom:function(){var a={beforeOpen:function(){$$(".swf").invoke("hide")},afterClose:function(){$$(".swf").invoke("show")}};new ImageZoom(/Win/.match(navigator.platform)?a:{})}};var Libs={require:function(a){$(document.body).insert(new Element("script",{src:a,type:"text/javascript"}))},execute:function(a){(a||Prototype.emptyFunction)()}};var BrowserDetect={init:function(){this.OS=this.searchString(this.dataOS)||"an unknown OS";switch(this.OS){case"Windows":$(document.body).addClassName("windows");break;case"Mac":$(document.body).addClassName("mac");break;case"Linux":$(document.body).addClassName("linux");break}},searchString:function(f){for(var a=0;a<f.length;a++){var c=f[a].string;var d=f[a].prop;this.versionSearchString=f[a].versionSearch||f[a].identity;if(c){if(c.indexOf(f[a].subString)!=-1){return f[a].identity}}else{if(d){return f[a].identity}}}},dataOS:[{string:navigator.platform,subString:"Win",identity:"Windows"},{string:navigator.platform,subString:"Mac",identity:"Mac"},{string:navigator.userAgent,subString:"iPhone",identity:"iPhone/iPod"},{string:navigator.platform,subString:"Linux",identity:"Linux"}]};Event.observe(document,"dom:loaded",function(){BrowserDetect.init();if($("openbar")){OpenBar.initialize()}if(Prototype.Browser.IE6){Sauspiel.normalizeIE6()}GameLinks.initialize();if($("game_navigation")){GameMenu.initialize()}if(Prototype.Browser.WebKit){$(document.body).forceRerendering()}if(Cookie.get("ucid")=="-1"){FlashCookie.embedFlash();FlashCookie.flashLoaded=function(){flashVal=FlashCookie.get("ucid");if(flashVal){Cookie.set("ucid",flashVal,365*20)}}}});if(Prototype.Browser.IE){Event.observe(window,"load",Sauspiel.setupZoom.bind(Sauspiel))}else{Event.observe(document,"dom:loaded",Sauspiel.setupZoom.bind(Sauspiel))}var Help={initialize:function(){if(!$("help_search")){return}this.views=$$(".view");this.sidebars=$$(".sidebar");$w("Start Search").each(function(a){Help[a].initialize()}.bind(this));document.observe("click",this.dispatchClick.bind(this));if(window.location.hash.empty()){Help.Start.show()}else{this.hashHasChanged()}if("onhashchange" in window){window.onhashchange=this.hashHasChanged.bind(this)}else{new PeriodicalExecuter(this.hashHasChanged.bind(this),0.2)}},dispatchClick:function(c){var a=c.element();if(a.hasClassName("question")||a.hasClassName("category")){this.showContentForAnchor(a)}else{if(a.hasClassName("reset")){this.reset(c)}}},hashHasChanged:function(){if(window.location.hash.empty()){return}var a=window.location.hash.substr(1);if(a!=this.activeHash){this.openHash(a)}},setHash:function(a){window.location.hash=a;this.activeHash=a},openHash:function(a){a=a.split(":");if(a.length>1){this.openQuestion(a[0],a[1])}else{if(a[0]=="start"){Help.Start.show()}else{this.openCategory(a[0])}}},showContentForAnchor:function(c){var a=c.getAttribute("href").gsub("#","");this.setHash(a);this.openHash(a)},setActive:function(a,c){this.hideActive();[a,c].invoke("show");this.activeView=a;this.activeSidebar=c},hideActive:function(){this.views.concat(this.sidebars).invoke("hide")},openQuestion:function(c,a){this.activeQuestion=a;this.activeCategory=c;this.setActive($("question_"+a),$("sidebar_"+c));this.setHash(c+":"+a)},openCategory:function(a){this.activeQuestion=a;this.activeCategory="help_contact";this.setActive($("category_"+this.activeQuestion),$("sidebar_help_contact"));this.setHash(a)},reset:function(a){if(a){a.stop()}Help.Start.show();Help.Search.reset();this.resetActive()},resetActive:function(){this.activeQuestion=null;this.activeCategory=null},restoreActiveView:function(){if(this.activeQuestion&&this.activeCategory){if(this.activeCategory=="help_contact"){this.openCategory(this.activeQuestion)}else{this.openQuestion(this.activeCategory,this.activeQuestion)}}else{Help.Start.show()}}};Help.Start={initialize:function(){this.view=$("help_start");this.sidebar=$("sidebar_help_contact")},show:function(a){if(a){a.stop()}Help.hideActive();Help.setActive(this.view,this.sidebar);Help.resetActive();Help.setHash("start")}};Help.Search={initialize:function(){this.input=$("help_search");this.view=$("search_results");this.results=$("search_results_list");this.noResults=$("help_no_results");this.sidebar=$("sidebar_help_contact");this.headline=$("search_keyword");this.answers=$$(".answer");this.submitButton=$("help_search_submit");this.minLength=3;this.input.observe("keyup",this.search.bind(this));this.input.observe("return:pressed",this.submit.bind(this));this.submitButton.observe("click",this.submit.bind(this))},search:function(a){Help.setActive(this.view,this.sidebar);if($F(this.input).length<this.minLength){Help.restoreActiveView()}else{this.update()}},update:function(){this.headline.update($F(this.input));var c=$w($F(this.input)),a=$H({});c.each(function(g){this.answers.each(function(h){if(new RegExp(g,"i").test(h.down("h2").innerHTML)){a.set(h.id,1)}if(new RegExp(g,"i").test(h.down(".content").innerHTML)){a.set(h.id,a.get(h.id)?a.get(h.id)+1:1)}if($w(h.down(".tags").innerHTML.toLowerCase()).include(g.toLowerCase())){a.set(h.id,a.get(h.id)?a.get(h.id)+1:1)}}.bind(this))}.bind(this));if(a.keys().length==0){this.results.hide();this.noResults.show();this.headline.update('Keine Ergebnisse für "'+$F(this.input)+'".')}else{this.noResults.hide();this.results.update("").show();this.headline.update('Suchergebnisse für "'+$F(this.input)+'":');var f=a.keys(),d=a.values();a=f.map(function(h,g){return[h,d[g]]}).sortBy(function(g){return g[1]}).reverse().each(function(g){var h='<li class="weight-'+g[1]+'"><a href="#'+$(g[0]).down(".slug").innerHTML.strip()+'">'+$(g[0]).down("h2").innerHTML+"</a></li>";this.results.insert(h)}.bind(this))}},submit:function(a){if(a){a.stop()}this.search();this.results.highlight()},reset:function(){this.input.value="";this.input.refreshDefaultValueActsAsHint();this.input.blur()}};document.observe("dom:loaded",Help.initialize.bind(Help));var Contact={initialize:function(){this.contact=$("contact_overlay");if(!this.contact){return}this.shade=$("shade");this.cancelButton=$("contact_overlay_cancel");this.submitButton=$("contact_form_submit");this.subject=$("contact_form_subject");this.message=$("contact_form_message");$$('a[href="#kontakt"]').invoke("observe","click",this.onActuatorClicked.bind(this));if(Prototype.Browser.IE6){this.contact.setStyle({position:"absolute"});this.shade.setStyle({position:"absolute",height:Position.getPageSize().page.height+"px"})}this.contact.setStyle({top:-(this.contact.getDimensions().height+30)+"px"}).show();this.cancelButton.observe("click",this.cancel.bind(this));this.submitButton.observe("click",this.submit.bind(this))},onActuatorClicked:function(a){a.stop();var c=a.element();if(c.title&&!c.title.blank()){this.subject.update(c.title)}this.show()},show:function(){this.shade.setOpacity(0).show().morph("opacity:0.8",{duration:0.3});this.contact.morph("top:0px",{duration:0.4,delay:0.2,afterFinish:function(){this.message.focus();if(Prototype.Browser.IE6){window.scrollTo(0,0)}}.bind(this)})},hide:function(){this.contact.morph("top:-"+(this.contact.getDimensions().height+30)+"px",{duration:0.4});this.shade.morph("opacity:0.8",{duration:0.3,delay:0.2,afterFinish:function(a){a.element.hide();this.reset()}.bind(this)})},cancel:function(a){a.stop();this.hide()},reset:function(){this.subject.update("Anfrage");this.message.value="";this.contact.down(".done").hide();this.contact.down(".loading").hide();this.contact.down(".options").show()},submit:function(a){a.stop();if($F(this.message).blank()){return}this.contact.down(".options").hide();this.contact.down(".loading").show();new Ajax.Request("/help/contact",{parameters:this.contact.down("form").serialize()+"&subject="+this.subject.innerHTML,onSuccess:function(){(function(){this.contact.down(".loading").hide();this.contact.down(".done").show();(function(){this.hide()}).bind(this).delay(0.5)}).bind(this).delay(1)}.bind(this)})}};document.observe("dom:loaded",Contact.initialize.bind(Contact));var ProgressBar=Class.create({initialize:function(c,a){this.element=$(c);this.options=Object.extend({width:this.element.getWidth()},a||{});this.setup()},setup:function(){this.track=new Element("div",{className:"progress-track loading"}).setStyle({width:this.options.width+"px"});this.value=new Element("div",{className:"progress-value"}).setStyle({width:"0px"});this.track.insert(this.value);this.element.insert(this.track)},update:function(c,a){if(this.track.hasClassName("loading")){this.track.removeClassName("loading")}this.value.morph("width:"+((c*this.options.width/a)>>0)+"px",{duration:0.3})}});var Uploader=Class.create({initialize:function(a,d,c){this.input=$(a);this.url=d;this.options=Object.extend({name:this.input.getAttribute("name"),onStart:Prototype.emptyFunction,onComplete:Prototype.emptyFunction,onError:Prototype.emptyFunction,onProgress:Prototype.emptyFunction,onFilesSelected:Prototype.emptyFunction},c||{});if(!this.options.name){return}this.input.observe("change",this.onFilesSelected.bind(this));if(this.options.dropTargets){this.dropTargets=this.options.dropTargets.map(function(f){return $(f)}).compact();$(document.body).observe("dragover",function(f){f.stop()}).observe("dragenter",this.onDragEnter.bind(this)).observe("dragleave",this.onDragLeave.bind(this)).observe("drop",this.onDrop.bind(this))}},onFilesSelected:function(){if(this.options.fileList){this.createFileList(this.input.files)}this.options.onFilesSelected()},onDragEnter:function(a){a.stop();this.dropTargets.each(function(c){if(a.element()==c||a.element().descendantOf(c)){c.addClassName("drag-over")}else{c.removeClassName("drag-over")}})},onDragLeave:function(a){a.stop()},onDrop:function(a){a.stop();if(!a.dataTransfer){return}if(this.options.fileList){this.createFileList(a.dataTransfer.files)}if(a.dataTransfer.files){this.start(a,a.dataTransfer.files)}this.dropTargets.invoke("removeClassName","drag-over")},start:function(c,a){if(c){c.stop()}this.files=a?$A(a):$A(this.input.files);if(!this.files||this.files.length<1){this.input.up("form").submit();return}this.total=this.files.map(function(d){return d.size||d.fileSize}).inject(0,function(d,f){return d+f});this.sent=0;this.files.each(this.sendFile.bind(this));this.options.onStart(this)},sendFile:function(a){var d=a.type?{"X-XHR-File-Upload-Content-Type":a.type}:{},c=this.fileList?this.fileList.get(a.name||a.fileName):null;if(c){c.addClassName("loading")}new Ajax.Request(this.url,{method:"POST",requestHeaders:Object.extend({"X-File-Name":a.name||a.fileName,"X-File-Size":a.size,"Content-Type":"multipart/form-data","X-XHR-File-Upload":"1","X-XHR-File-Upload-Name":this.options.name},d),postBody:a,onComplete:function(f,g){this.sent+=a.size||a.fileSize;if(c){c.removeClassName("loading").addClassName("done")}this.options.onProgress(this);if(Ajax.activeRequestCount==1){this.options.onComplete(this)}}.bind(this)})},createFileList:function(a){this.fileList=$H({});var c=$(this.options.fileList).update("");$A(a).each(function(d){var f=new Element("li",{className:"file"}).update(d.name||d.fileName);this.fileList.set(d.name||d.fileName,f);c.insert(f)}.bind(this))}});var Tooltips={};Tooltips.Base=Class.create({initialize:function(c,a){this.anchor=$(c);this.options=Object.extend({width:180,height:100,onShow:Prototype.emptyFunction,onHide:Prototype.emptyFunction},a||{})},create:function(){this.container=new Element("div",{className:"tooltip"});this.content=new Element("div",{className:"content"});this.stem=new Element("div",{className:"stem"});this.container.insert(this.content);this.container.insert(this.stem);$(document.body).insert(this.container)},show:function(){this.create();var a=this.anchor.cumulativeOffset();a={top:a.top+this.anchor.cumulativeScrollOffset().top,left:a.left};this.container.setStyle({width:this.options.width+6+"px",height:this.options.height+6+13+"px",left:a.left+this.anchor.getWidth()/2-this.options.width/2+"px",top:a.top-this.options.height-6-13+"px"});this.content.setStyle({width:this.options.width+"px",height:this.options.height+"px"});this.container.show();this.options.onShow()},hide:function(){this.container.remove();this.container=null;this.options.onHide()}});Tooltips.Maps=Class.create(Tooltips.Base,{initialize:function($super,c,a){$super(c,a);Object.extend(this.options,{width:180,height:100});this.anchor.observe("mouseenter",this.show.bind(this));this.anchor.observe("mouseleave",this.hide.bind(this))},create:function($super){$super();this.content.insert(new Element("img",{src:this.anchor.getAttribute("rel")}))}});