/*
	Copyright (C) 2006, Techdynamis - www.techdynamis.com.br
	Techdynamis Maestrum Framework version 0.1, Dynamis.* 
*/
var agt=navigator.userAgent.toLowerCase();var is_ie=(agt.indexOf("msie")!=-1);var is_win=((agt.indexOf("win")!=-1)||(agt.indexOf("16bit")!=-1));var is_mac=(agt.indexOf("mac")!=-1);var Dynamis={ScriptFragment:"(?:<script.*?>)((\n|\r|.)*?)(?:</script>)",emptyFunction:function(){},K:function(x){return x;}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(_2,_3){for(var _4 in _3){_2[_4]=_3[_4];}return _2;};Object.inspect=function(_5){try{if(_5==undefined){return "undefined";}if(_5==null){return "null";}return _5.inspect?_5.inspect():_5.toString();}catch(e){if(e instanceof RangeError){return "...";}throw e;}};Function.prototype.addTo=function(_6,_7){if(_6.addEventListener){_6.addEventListener(_7,this,true);return;}if(_6.attachEvent){_6.attachEvent("on"+_7,this);return;}};Function.prototype.bind=function(){var _8=this,args=$A(arguments),object=args.shift();return function(){return _8.apply(object,args.concat($A(arguments)));};};Function.prototype.bindAsEventListener=function(_9){var _a=this;return function(_b){return _a.call(_9,_b||window.event);};};Object.extend(Number.prototype,{timer:function(_c){return window.setTimeout(_c,this.toString()*1000);},toColorPart:function(){var _d=this.toString(16);if(this<16){return "0"+_d;}return _d;},succ:function(){return this+1;},times:function(_e){$R(0,this,true).each(_e);return this;}});var Try={these:function(){var _f;for(var i=0;i<arguments.length;i++){var _11=arguments[i];try{_f=_11();break;}catch(e){}}return _f;}};var getCode=function(_12){var opt={chars:"abcdf0123456789",start:"",max:8};Object.extend(opt,_12||{});opt.max.times(function($i){opt.start+=opt.chars.substr(Math.floor(Math.random()*opt.chars.length),1);});return opt.start;};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(_15,_16){this.callback=_15;this.frequency=_16;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}};Object.extend(String.prototype,{e:function(){try{return encodeURIComponent(this.toString());}catch(e){try{return encodeURI(this.toString());}catch(js_v1){return escape(this.toString());}}},u:function(){try{return decodeURIComponent(this.toString());}catch(e){try{return decodeURI(this.toString());}catch(js_v1){return unescape(this.toString());}}},ltrim:function(){return this.replace(/^\s+/g,"");},rtrim:function(_17){return this.replace(/(\s+)$/g,"");},trim:function(_18){return this.replace(/^\s*|\s*$/g,"");},getCode:function(){return getCode(Object.extend({chars:this.toString()},arguments[0]?arguments[0]:{}));},timer:function(_19){return window.setTimeout(_19,this.toString()*1000);},gsub:function(_1a,_1b){var _1c="",source=this,match;_1b=arguments.callee.prepareReplacement(_1b);while(source.length>0){if(match=source.match(_1a)){_1c+=source.slice(0,match.index);_1c+=(_1b(match)||"").toString();source=source.slice(match.index+match[0].length);}else{_1c+=source,source="";}}return _1c;},sub:function(_1d,_1e,_1f){_1e=this.gsub.prepareReplacement(_1e);_1f=_1f===undefined?1:_1f;return this.gsub(_1d,function(_20){if(--_1f<0){return _20[0];}return _1e(_20);});},scan:function(_21,_22){this.gsub(_21,_22);return this;},truncate:function(_23,_24){_23=_23||30;_24=_24===undefined?"...":_24;return this.length>_23?this.slice(0,_23-_24.length)+_24:this;},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Dynamis.ScriptFragment,"img"),"");},extractScripts:function(){var _25=new RegExp(Dynamis.ScriptFragment,"img");var _26=new RegExp(Dynamis.ScriptFragment,"im");return (this.match(_25)||[]).map(function(_27){return (_27.match(_26)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(_28){return eval(_28);});},escapeHTML:function(){var div=document.createElement("div");var _2a=document.createTextNode(this);div.appendChild(_2a);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement("div");div.innerHTML=this.stripTags();return div.childNodes[0]?div.childNodes[0].nodeValue:"";},toQueryParams:function(){var _2c=this.match(/^\??(.*)$/)[1].split("&");return _2c.inject({},function(_2d,_2e){var _2f=_2e.split("=");_2d[_2f[0]]=_2f[1];return _2d;});},toArray:function(){return this.split("");},camelize:function(){var _30=this.split("-");if(_30.length==1){return _30[0];}var _31=this.indexOf("-")==0?_30[0].charAt(0).toUpperCase()+_30[0].substring(1):_30[0];for(var i=1,len=_30.length;i<len;i++){var s=_30[i];_31+=s.charAt(0).toUpperCase()+s.substring(1);}return _31;},inspect:function(){return "'"+this.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'";}});String.prototype.gsub.prepareReplacement=function(_34){if(typeof _34=="function"){return _34;}var _35=new Template(_34);return function(_36){return _35.evaluate(_36);};};String.prototype.parseQuery=String.prototype.toQueryParams;var Template=Class.create();Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;Template.prototype={initialize:function(_37,_38){this.template=_37.toString();this.pattern=_38||Template.Pattern;},evaluate:function(_39){return this.template.gsub(this.pattern,function(_3a){var _3b=_3a[1];if(_3b=="\\"){return _3a[2];}return _3b+(_39[_3a[3]]||"").toString();});}};var $break=new Object();var $continue=new Object();var Enumerable={each:function(_3c){var _3d=0;try{this._each(function(_3e){try{_3c(_3e,_3d++);}catch(e){if(e!=$continue){throw e;}}});}catch(e){if(e!=$break){throw e;}}},all:function(_3f){var _40=true;this.each(function(_41,_42){_40=_40&&!!(_3f||Dynamis.K)(_41,_42);if(!_40){throw $break;}});return _40;},any:function(_43){var _44=true;this.each(function(_45,_46){if(_44=!!(_43||Dynamis.K)(_45,_46)){throw $break;}});return _44;},collect:function(_47){var _48=[];this.each(function(_49,_4a){_48.push(_47(_49,_4a));});return _48;},detect:function(_4b){var _4c;this.each(function(_4d,_4e){if(_4b(_4d,_4e)){_4c=_4d;throw $break;}});return _4c;},findAll:function(_4f){var _50=[];this.each(function(_51,_52){if(_4f(_51,_52)){_50.push(_51);}});return _50;},grep:function(_53,_54){var _55=[];this.each(function(_56,_57){var _58=_56.toString();if(_58.match(_53)){_55.push((_54||Dynamis.K)(_56,_57));}});return _55;},include:function(_59){var _5a=false;this.each(function(_5b){if(_5b==_59){_5a=true;throw $break;}});return _5a;},inject:function(_5c,_5d){this.each(function(_5e,_5f){_5c=_5d(_5c,_5e,_5f);});return _5c;},invoke:function(_60){var _61=$A(arguments).slice(1);return this.collect(function(_62){return _62[_60].apply(_62,_61);});},max:function(_63){var _64;this.each(function(_65,_66){_65=(_63||Dynamis.K)(_65,_66);if(_64==undefined||_65>=_64){_64=_65;}});return _64;},min:function(_67){var _68;this.each(function(_69,_6a){_69=(_67||Dynamis.K)(_69,_6a);if(_68==undefined||_69<_68){_68=_69;}});return _68;},partition:function(_6b){var _6c=[],falses=[];this.each(function(_6d,_6e){((_6b||Dynamis.K)(_6d,_6e)?_6c:falses).push(_6d);});return [_6c,falses];},pluck:function(_6f){var _70=[];this.each(function(_71,_72){_70.push(_71[_6f]);});return _70;},reject:function(_73){var _74=[];this.each(function(_75,_76){if(!_73(_75,_76)){_74.push(_75);}});return _74;},sortBy:function(_77){return this.collect(function(_78,_79){return {value:_78,criteria:_77(_78,_79)};}).sort(function(_7a,_7b){var a=_7a.criteria,b=_7b.criteria;return a<b?-1:a>b?1:0;}).pluck("value");},toArray:function(){return this.collect(Dynamis.K);},zip:function(){var _7d=Dynamis.K,args=$A(arguments);if(typeof args.last()=="function"){_7d=args.pop();}var _7e=[this].concat(args).map($A);return this.map(function(_7f,_80){return _7d(_7e.pluck(_80));});},inspect:function(){return "#<Enumerable:"+this.toArray().inspect()+">";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray});var $A=Array.from=function(_81){if(!_81){return [];}if(_81.toArray){return _81.toArray();}else{var _82=[];for(var i=0;i<_81.length;i++){_82.push(_81[i]);}return _82;}};Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(_84){for(var i=0;i<this.length;i++){_84(this[i]);}},clear:function(){this.length=0;return this;},first:function(){return this[0];},last:function(){return this[this.length-1];},compact:function(){return this.select(function(_86){return _86!=undefined||_86!=null;});},flatten:function(){return this.inject([],function(_87,_88){return _87.concat(_88&&_88.constructor==Array?_88.flatten():[_88]);});},without:function(){var _89=$A(arguments);return this.select(function(_8a){return !_89.include(_8a);});},indexOf:function(_8b){for(var i=0;i<this.length;i++){if(this[i]==_8b){return i;}}return -1;},reverse:function(_8d){return (_8d!==false?this:this.toArray())._reverse();},inspect:function(){return "["+this.map(Object.inspect).join(", ")+"]";}});var Hash={_each:function(_8e){for(var key in this){var _90=this[key];if(typeof _90=="function"){continue;}var _91=[key,_90];_91.key=key;_91.value=_90;_8e(_91);}},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},merge:function(_92){return $H(_92).inject($H(this),function(_93,_94){_93[_94.key]=_94.value;return _93;});},toQueryString:function(){return this.map(function(_95){return _95.map(encodeURIComponent).join("=");}).join("&");},inspect:function(){return "#<Hash:{"+this.map(function(_96){return _96.map(Object.inspect).join(": ");}).join(", ")+"}>";}};function $H(_97){var _98=Object.extend({},_97||{});Object.extend(_98,Enumerable);Object.extend(_98,Hash);return _98;}ObjectRange=Class.create();Object.extend(ObjectRange.prototype,Enumerable);Object.extend(ObjectRange.prototype,{initialize:function(_99,end,_9b){this.start=_99;this.end=end;this.exclusive=_9b;},_each:function(_9c){var _9d=this.start;do{_9c(_9d);_9d=_9d.succ();}while(this.include(_9d));},include:function(_9e){if(_9e<this.start){return false;}if(this.exclusive){return _9e<this.end;}return _9e<=this.end;}});var $R=function(_9f,end,_a1){return new ObjectRange(_9f,end,_a1);};var A={getTransport:function(){return Try.these(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");})||false;},activeRequestCount:0};A.Responders={responders:[],_each:function(_a2){this.responders._each(_a2);},register:function(_a3){if(!this.include(_a3)){this.responders.push(_a3);}},unregister:function(_a4){this.responders=this.responders.without(_a4);},dispatch:function(_a5,_a6,_a7,_a8){this.each(function(_a9){if(_a9[_a5]&&typeof _a9[_a5]=="function"){try{_a9[_a5].apply(_a9,[_a6,_a7,_a8]);}catch(e){}}});}};Object.extend(A.Responders,Enumerable);A.Responders.register({onCreate:function(){A.activeRequestCount++;},onComplete:function(){A.activeRequestCount--;}});A.Base=function(){};A.Base.prototype={setOptions:function(_aa){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",parameters:""};Object.extend(this.options,_aa||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return !this.responseIsSuccess();}};A.Request=Class.create();A.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];A.Request.prototype=Object.extend(new A.Base(),{initialize:function(url,_ac){this.transport=A.getTransport();this.setOptions(_ac);this.request(url);},request:function(url){var _ae=this.options.parameters||"";if(_ae.length>0){_ae+="&_=";}try{this.url=url;if(this.options.method=="get"&&_ae.length>0){this.url+=(this.url.match(/\?/)?"&":"?")+_ae;}A.Responders.dispatch("onCreate",this,this.transport);this.transport.open(this.options.method,this.url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1);}).bind(this),10);}this.setRequestHeaders();var _af=this.options.postBody?this.options.postBody:_ae;this.transport.send(this.options.method=="post"?_af:null);}catch(e){this.dispatchException(e);}},setRequestHeaders:function(){var _b0=["Accept","text/javascript, text/html, application/xml, text/xml, */*"];if(this.options.method=="post"){_b0.push("Content-type",this.options.contentType);if(this.transport.overrideMimeType){_b0.push("Connection","close");}}if(this.options.requestHeaders){_b0.push.apply(_b0,this.options.requestHeaders);}for(var i=0;i<_b0.length;i+=2){this.transport.setRequestHeader(_b0[i],_b0[i+1]);}},onStateChange:function(){var _b2=this.transport.readyState;if(_b2!=1){this.respondToReadyState(this.transport.readyState);}},header:function(_b3){try{return this.transport.getResponseHeader(_b3);}catch(e){}},evalJSON:function(){try{return eval("("+this.header("X-JSON")+")");}catch(e){}},evalResponse:function(){try{return eval(this.transport.responseText);}catch(e){this.dispatchException(e);}},respondToReadyState:function(_b4){var _b5=A.Request.Events[_b4];var _b6=this.transport,json=this.evalJSON();if(_b5=="Complete"){try{(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Dynamis.emptyFunction)(_b6,json);}catch(e){this.dispatchException(e);}if((this.header("Content-type")||"").match(/^text\/javascript/i)){this.evalResponse();}}try{(this.options["on"+_b5]||Dynamis.emptyFunction)(_b6,json);A.Responders.dispatch("on"+_b5,this,_b6,json);}catch(e){this.dispatchException(e);}if(_b5=="Complete"){this.transport.onreadystatechange=Dynamis.emptyFunction;}},dispatchException:function(_b7){(this.options.onException||Dynamis.emptyFunction)(this,_b7);A.Responders.dispatch("onException",this,_b7);}});A.Updater=Class.create();Object.extend(Object.extend(A.Updater.prototype,A.Request.prototype),{initialize:function(_b8,url,_ba){this.containers={success:_b8.success?$(_b8.success):$(_b8),failure:_b8.failure?$(_b8.failure):(_b8.success?null:$(_b8))};this.transport=A.getTransport();this.setOptions(_ba);var _bb=this.options.onComplete||Dynamis.emptyFunction;this.options.onComplete=(function(_bc,_bd){this.updateContent();_bb(_bc,_bd);}).bind(this);this.request(url);},updateContent:function(){var _be=this.responseIsSuccess()?this.containers.success:this.containers.failure;var _bf=this.transport.responseText;if(!this.options.evalScripts){_bf=_bf.stripScripts();}if(_be){if(this.options.insertion){new this.options.insertion(_be,_bf);}else{Element.update(_be,_bf);}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout(this.onComplete.bind(this),10);}}}});A.PeriodicalUpdater=Class.create();A.PeriodicalUpdater.prototype=Object.extend(new A.Base(),{initialize:function(_c0,url,_c2){this.setOptions(_c2);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=_c0;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Dynamis.emptyFunction).apply(this,arguments);},updateComplete:function(_c3){if(this.options.decay){this.decay=(_c3.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=_c3.responseText;}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new A.Updater(this.container,this.url,this.options);}});function $(){var _c4=[],element;for(var i=0;i<arguments.length;i++){element=arguments[i];if(typeof element=="string"){element=document.getElementById(element);}_c4.push(Element.extend(element));}return _c4.length<2?_c4[0]:_c4;}document.getElementsByClassName=function(_c6,_c7){var _c8=($(_c7)||document.body).getElementsByTagName("*");return $A(_c8).inject([],function(_c9,_ca){if(_ca.className.match(new RegExp("(^|\\s)"+_c6+"(\\s|$)"))){_c9.push(Element.extend(_ca));}return _c9;});};if(!window.Element){var Element=new Object();}Element.extend=function(_cb){if(!_cb){return;}if(_nativeExtensions){return _cb;}if(!_cb._extended&&_cb.tagName&&_cb!=window){var _cc=Element.Methods,cache=Element.extend.cache;for(property in _cc){var _cd=_cc[property];if(typeof _cd=="function"){_cb[property]=cache.findOrStore(_cd);}}}_cb._extended=true;return _cb;};Element.extend.cache={findOrStore:function(_ce){return this[_ce]=this[_ce]||function(){return _ce.apply(null,[this].concat($A(arguments)));};}};Element.Methods={visible:function(_cf){return $(_cf).style.display!="none";},toggle:function(){for(var i=0;i<arguments.length;i++){var _d1=$(arguments[i]);Element[Element.visible(_d1)?"hide":"show"](_d1);}},hide:function(){for(var i=0;i<arguments.length;i++){var _d3=$(arguments[i]);_d3.style.display="none";}},show:function(){for(var i=0;i<arguments.length;i++){var _d5=$(arguments[i]);_d5.style.display="";}},remove:function(_d6){_d6=$(_d6);_d6.parentNode.removeChild(_d6);},update:function(_d7,_d8){$(_d7).innerHTML=_d8.stripScripts();setTimeout(function(){_d8.evalScripts();},10);},replace:function(_d9,_da){_d9=$(_d9);if(_d9.outerHTML){_d9.outerHTML=_da.stripScripts();}else{var _db=_d9.ownerDocument.createRange();_db.selectNodeContents(_d9);_d9.parentNode.replaceChild(_db.createContextualFragment(_da.stripScripts()),_d9);}setTimeout(function(){_da.evalScripts();},10);},getHeight:function(_dc){_dc=$(_dc);return _dc.offsetHeight;},classNames:function(_dd){return new Element.ClassNames(_dd);},hasClassName:function(_de,_df){if(!(_de=$(_de))){return;}return Element.classNames(_de).include(_df);},addClassName:function(_e0,_e1){if(!(_e0=$(_e0))){return;}return Element.classNames(_e0).add(_e1);},removeClassName:function(_e2,_e3){if(!(_e2=$(_e2))){return;}return Element.classNames(_e2).remove(_e3);},cleanWhitespace:function(_e4){_e4=$(_e4);for(var i=0;i<_e4.childNodes.length;i++){var _e6=_e4.childNodes[i];if(_e6.nodeType==3&&!/\S/.test(_e6.nodeValue)){Element.remove(_e6);}}},empty:function(_e7){return $(_e7).innerHTML.match(/^\s*$/);},childOf:function(_e8,_e9){_e8=$(_e8),_e9=$(_e9);while(_e8=_e8.parentNode){if(_e8==_e9){return true;}}return false;},scrollTo:function(_ea){_ea=$(_ea);var x=_ea.x?_ea.x:_ea.offsetLeft,y=_ea.y?_ea.y:_ea.offsetTop;window.scrollTo(x,y);},getStyle:function(_ec,_ed){_ec=$(_ec);var _ee=_ec.style[_ed.camelize()];if(!_ee){if(document.defaultView&&document.defaultView.getComputedStyle){var css=document.defaultView.getComputedStyle(_ec,null);_ee=css?css.getPropertyValue(_ed):null;}else{if(_ec.currentStyle){_ee=_ec.currentStyle[_ed.camelize()];}}}if(window.opera&&["left","top","right","bottom"].include(_ed)){if(Element.getStyle(_ec,"position")=="static"){_ee="auto";}}return _ee=="auto"?null:_ee;},setStyle:function(_f0,_f1){_f0=$(_f0);for(var _f2 in _f1){_f0.style[_f2.camelize()]=_f1[_f2];}},getDimensions:function(_f3){_f3=$(_f3);if(Element.getStyle(_f3,"display")!="none"){return {width:_f3.offsetWidth,height:_f3.offsetHeight};}var els=_f3.style;var _f5=els.visibility;var _f6=els.position;els.visibility="hidden";els.position="absolute";els.display="";var _f7=_f3.clientWidth;var _f8=_f3.clientHeight;els.display="none";els.position=_f6;els.visibility=_f5;return {width:_f7,height:_f8};},makePositioned:function(_f9){_f9=$(_f9);var pos=Element.getStyle(_f9,"position");if(pos=="static"||!pos){_f9._madePositioned=true;_f9.style.position="relative";if(window.opera){_f9.style.top=0;_f9.style.left=0;}}},undoPositioned:function(_fb){_fb=$(_fb);if(_fb._madePositioned){_fb._madePositioned=undefined;_fb.style.position=_fb.style.top=_fb.style.left=_fb.style.bottom=_fb.style.right="";}},makeClipping:function(_fc){_fc=$(_fc);if(_fc._overflow){return;}_fc._overflow=_fc.style.overflow;if((Element.getStyle(_fc,"overflow")||"visible")!="hidden"){_fc.style.overflow="hidden";}},undoClipping:function(_fd){_fd=$(_fd);if(_fd._overflow){return;}_fd.style.overflow=_fd._overflow;_fd._overflow=undefined;}};Object.extend(Element,Element.Methods);var _nativeExtensions=false;if(!HTMLElement&&/Konqueror|Safari|KHTML/.test(navigator.userAgent)){var HTMLElement={};HTMLElement.prototype=document.createElement("div").__proto__;}Element.addMethods=function(_fe){Object.extend(Element.Methods,_fe||{});if(typeof HTMLElement!="undefined"){var _ff=Element.Methods,cache=Element.extend.cache;for(property in _ff){var _100=_ff[property];if(typeof _100=="function"){HTMLElement.prototype[property]=cache.findOrStore(_100);}}_nativeExtensions=true;}}; Element.addMethods();var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(_1){this.adjacency=_1;};Abstract.Insertion.prototype={initialize:function(_2,_3){this.element=$(_2);this.content=_3.stripScripts();if(this.adjacency&&this.element.insertAdjacentHTML){try{this.element.insertAdjacentHTML(this.adjacency,this.content);}catch(e){var _4=this.element.tagName.toLowerCase();if(_4=="tbody"||_4=="tr"){this.insertContent(this.contentFromAnonymousTable());}else{throw e;}}}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.insertContent([this.range.createContextualFragment(this.content)]);}setTimeout(function(){_3.evalScripts();},10);},contentFromAnonymousTable:function(){var _5=document.createElement("div");_5.innerHTML="<table><tbody>"+this.content+"</tbody></table>";return $A(_5.childNodes[0].childNodes[0].childNodes);}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=Object.extend(new Abstract.Insertion("beforeBegin"),{initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(_6){_6.each((function(_7){this.element.parentNode.insertBefore(_7,this.element);}).bind(this));}});Insertion.Top=Class.create();Insertion.Top.prototype=Object.extend(new Abstract.Insertion("afterBegin"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(_8){_8.reverse(false).each((function(_9){this.element.insertBefore(_9,this.element.firstChild);}).bind(this));}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=Object.extend(new Abstract.Insertion("beforeEnd"),{initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(_a){_a.each((function(_b){this.element.appendChild(_b);}).bind(this));}});Insertion.After=Class.create();Insertion.After.prototype=Object.extend(new Abstract.Insertion("afterEnd"),{initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(_c){_c.each((function(_d){this.element.parentNode.insertBefore(_d,this.element.nextSibling);}).bind(this));}}); Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(_1){this.element=$(_1);},_each:function(_2){this.element.className.split(/\s+/).select(function(_3){return _3.length>0;})._each(_2);},set:function(_4){this.element.className=_4;},add:function(_5){if(this.include(_5)){return;}this.set(this.toArray().concat(_5).join(" "));},remove:function(_6){if(!this.include(_6)){return;}this.set(this.select(function(_7){return _7!=_6;}).join(" "));},toString:function(){return this.toArray().join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);var Selector=Class.create();Selector.prototype={initialize:function(_8){this.params={classNames:[]};this.expression=_8.toString().strip();this.parseExpression();this.compileMatcher();},parseExpression:function(){function abort(_9){throw "Parse error in selector: "+_9;}if(this.expression==""){abort("empty expression");}var _a=this.params,expr=this.expression,match,modifier,clause,rest;while(match=expr.match(/^(.*)\[([a-z0-9_:-]+?)(?:([~\|!]?=)(?:"([^"]*)"|([^\]\s]*)))?\]$/i)){_a.attributes=_a.attributes||[];_a.attributes.push({name:match[2],operator:match[3],value:match[4]||match[5]||""});expr=match[1];}if(expr=="*"){return this.params.wildcard=true;}while(match=expr.match(/^([^a-z0-9_-])?([a-z0-9_-]+)(.*)/i)){modifier=match[1],clause=match[2],rest=match[3];switch(modifier){case "#":_a.id=clause;break;case ".":_a.classNames.push(clause);break;case "":case undefined:_a.tagName=clause.toUpperCase();break;default:abort(expr.inspect());}expr=rest;}if(expr.length>0){abort(expr.inspect());}},buildMatchExpression:function(){var _b=this.params,conditions=[],clause;if(_b.wildcard){conditions.push("true");}if(clause=_b.id){conditions.push("element.id == "+clause.inspect());}if(clause=_b.tagName){conditions.push("element.tagName.toUpperCase() == "+clause.inspect());}if((clause=_b.classNames).length>0){for(var i=0;i<clause.length;i++){conditions.push("Element.hasClassName(element, "+clause[i].inspect()+")");}}if(clause=_b.attributes){clause.each(function(_d){var _e="element.getAttribute("+_d.name.inspect()+")";var _f=function(_10){return _e+" && "+_e+".split("+_10.inspect()+")";};switch(_d.operator){case "=":conditions.push(_e+" == "+_d.value.inspect());break;case "~=":conditions.push(_f(" ")+".include("+_d.value.inspect()+")");break;case "|=":conditions.push(_f("-")+".first().toUpperCase() == "+_d.value.toUpperCase().inspect());break;case "!=":conditions.push(_e+" != "+_d.value.inspect());break;case "":case undefined:conditions.push(_e+" != null");break;default:throw "Unknown operator "+_d.operator+" in selector";}});}return conditions.join(" && ");},compileMatcher:function(){this.match=new Function("element","if (!element.tagName) return false;       return "+this.buildMatchExpression());},findElements:function(_11){var _12;if(_12=$(this.params.id)){if(this.match(_12)){if(!_11||Element.childOf(_12,_11)){return [_12];}}}_11=(_11||document).getElementsByTagName(this.params.tagName||"*");var _13=[];for(var i=0;i<_11.length;i++){if(this.match(_12=_11[i])){_13.push(Element.extend(_12));}}return _13;},toString:function(){return this.expression;}};function $$(){return $A(arguments).map(function(_15){return _15.strip().split(/\s+/).inject([null],function(_16,_17){var _18=new Selector(_17);return _16.map(_18.findElements.bind(_18)).flatten();});}).flatten();}var Field={clear:function(){for(var i=0;i<arguments.length;i++){$(arguments[i]).value="";}},focus:function(_1a){$(_1a).focus();},present:function(){for(var i=0;i<arguments.length;i++){if($(arguments[i]).value==""){return false;}}return true;},select:function(_1c){$(_1c).select();},activate:function(_1d){_1d=$(_1d);_1d.focus();if(_1d.select){_1d.select();}}}; /*--------------------------------------------------------------------------*/
var Form={serialize:function(_1){var _2=Form.getElements($(_1));var _3=new Array();for(var i=0;i<_2.length;i++){var _5=Form.Element.serialize(_2[i]);if(_5){_3.push(_5);}}return _3.join("&");},getElements:function(_6){_6=$(_6);var _7=new Array();for(var _8 in Form.Element.Serializers){var _9=_6.getElementsByTagName(_8);for(var j=0;j<_9.length;j++){_7.push(_9[j]);}}return _7;},getInputs:function(_b,_c,_d){_b=$(_b);var _e=_b.getElementsByTagName("input");if(!_c&&!_d){return _e;}var _f=new Array();for(var i=0;i<_e.length;i++){var _11=_e[i];if((_c&&_11.type!=_c)||(_d&&_11.name!=_d)){continue;}_f.push(_11);}return _f;},disable:function(_12){var _13=Form.getElements(_12);for(var i=0;i<_13.length;i++){var _15=_13[i];_15.blur();_15.disabled="true";}},enable:function(_16){var _17=Form.getElements(_16);for(var i=0;i<_17.length;i++){var _19=_17[i];_19.disabled="";}},findFirstElement:function(_1a){return Form.getElements(_1a).find(function(_1b){return _1b.type!="hidden"&&!_1b.disabled&&["input","select","textarea"].include(_1b.tagName.toLowerCase());});},focusFirstElement:function(_1c){Field.activate(Form.findFirstElement(_1c));},reset:function(_1d){$(_1d).reset();}};Form.Element={serialize:function(_1e){_1e=$(_1e);var _1f=_1e.tagName.toLowerCase();var _20=Form.Element.Serializers[_1f](_1e);if(_20){var key=encodeURIComponent(_20[0]);if(key.length==0){return;}if(_20[1].constructor!=Array){_20[1]=[_20[1]];}return _20[1].map(function(_22){return key+"="+encodeURIComponent(_22);}).join("&");}},getValue:function(_23){_23=$(_23);var _24=_23.tagName.toLowerCase();var _25=Form.Element.Serializers[_24](_23);if(_25){return _25[1];}}};Form.Element.Serializers={input:function(_26){switch(_26.type.toLowerCase()){case "submit":case "hidden":case "password":case "text":return Form.Element.Serializers.textarea(_26);case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(_26);}return false;},inputSelector:function(_27){if(_27.checked){return [_27.name,_27.value];}},textarea:function(_28){return [_28.name,_28.value];},select:function(_29){return Form.Element.Serializers[_29.type=="select-one"?"selectOne":"selectMany"](_29);},selectOne:function(_2a){var _2b="",opt,index=_2a.selectedIndex;if(index>=0){opt=_2a.options[index];_2b=opt.value||opt.text;}return [_2a.name,_2b];},selectMany:function(_2c){var _2d=[];for(var i=0;i<_2c.length;i++){var opt=_2c.options[i];if(opt.selected){_2d.push(opt.value||opt.text);}}return [_2c.name,_2d];}}; /*--------------------------------------------------------------------------*/
var $F = Form.Element.getValue; 
Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(_1,_2,_3){this.frequency=_2;this.element=$(_1);this.callback=_3;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var _4=this.getValue();if(this.lastValue!=_4){this.callback(this.element,_4);this.lastValue=_4;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=Object.extend(new Abstract.TimedObserver(),{getValue:function(){return Form.serialize(this.element);}}); /*--------------------------------------------------------------------------*/
Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(_1,_2){this.element=$(_1);this.callback=_2;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var _3=this.getValue();if(this.lastValue!=_3){this.callback(this.element,_3);this.lastValue=_3;}},registerFormCallbacks:function(){var _4=Form.getElements(this.element);for(var i=0;i<_4.length;i++){this.registerCallback(_4[i]);}},registerCallback:function(_6){if(_6.type){switch(_6.type.toLowerCase()){case "checkbox":case "radio":Event.observe(_6,"click",this.onElementEvent.bind(this));break;case "password":case "text":case "textarea":case "select-one":case "select-multiple":Event.observe(_6,"change",this.onElementEvent.bind(this));break;}}}}; Form.Element.EventObserver = Class.create(); Form.Element.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { getValue: function() { return Form.Element.getValue(this.element); }
}); Form.EventObserver = Class.create(); Form.EventObserver.prototype = Object.extend(new Abstract.EventObserver(), { getValue: function() { return Form.serialize(this.element); }
}); if (!window.Event) { var Event = new Object(); }
Object.extend(Event, { 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, element: function(event) { return event.target || event.srcElement; }, isLeftClick: function(event) { return (((event.which) && (event.which == 1)) ||
((event.button) && (event.button == 1))); }, pointerX: function(event) { return event.pageX || (event.clientX +
(document.documentElement.scrollLeft || document.body.scrollLeft)); }, pointerY: function(event) { return event.pageY || (event.clientY +
(document.documentElement.scrollTop || document.body.scrollTop)); }, stop: function(event) { if (event.preventDefault) { event.preventDefault(); event.stopPropagation(); } else { event.returnValue = false; event.cancelBubble = true; }
}, findElement: function(event, tagName) { var element = Event.element(event); while (element.parentNode && (!element.tagName ||
(element.tagName.toUpperCase() != tagName.toUpperCase())))
element = element.parentNode; return element; }, observers: false, _observeAndCache: function(element, name, observer, useCapture) { if (!this.observers) this.observers = []; if (element.addEventListener) { this.observers.push([element, name, observer, useCapture]); element.addEventListener(name, observer, useCapture); } else if (element.attachEvent) { this.observers.push([element, name, observer, useCapture]); element.attachEvent('on' + name, observer); }
}, unloadCache: function() { if (!Event.observers) return; for (var i = 0; i < Event.observers.length; i++) { Event.stopObserving.apply(this, Event.observers[i]); Event.observers[i][0] = null; }
Event.observers = false; }, observe: function(element, name, observer, useCapture) { var element = $(element); useCapture = useCapture || false; if (name == 'keypress' &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.attachEvent))
name = 'keydown'; this._observeAndCache(element, name, observer, useCapture); }, stopObserving: function(element, name, observer, useCapture) { var element = $(element); useCapture = useCapture || false; if (name == 'keypress' &&
(navigator.appVersion.match(/Konqueror|Safari|KHTML/)
|| element.detachEvent))
name = 'keydown'; if (element.removeEventListener) { element.removeEventListener(name, observer, useCapture); } else if (element.detachEvent) { element.detachEvent('on' + name, observer); }
}
}); if(navigator.appVersion.match(/\bMSIE\b/)){Event.observe(window,"unload",Event.unloadCache,false);}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;},realOffset:function(_1){var _2=0,valueL=0;do{_2+=_1.scrollTop||0;valueL+=_1.scrollLeft||0;_1=_1.parentNode;}while(_1);return [valueL,_2];},cumulativeOffset:function(_3){var _4=0,valueL=0;do{_4+=_3.offsetTop||0;valueL+=_3.offsetLeft||0;_3=_3.offsetParent;}while(_3);return [valueL,_4];},positionedOffset:function(_5){var _6=0,valueL=0;do{_6+=_5.offsetTop||0;valueL+=_5.offsetLeft||0;_5=_5.offsetParent;if(_5){p=Element.getStyle(_5,"position");if(p=="relative"||p=="absolute"){break;}}}while(_5);return [valueL,_6];},offsetParent:function(_7){if(_7.offsetParent){return _7.offsetParent;}if(_7==document.body){return _7;}while((_7=_7.parentNode)&&_7!=document.body){if(Element.getStyle(_7,"position")!="static"){return _7;}}return document.body;},within:function(_8,x,y){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(_8,x,y);}this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(_8);return (y>=this.offset[1]&&y<this.offset[1]+_8.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_8.offsetWidth);},withinIncludingScrolloffsets:function(_b,x,y){var _e=this.realOffset(_b);this.xcomp=x+_e[0]-this.deltaX;this.ycomp=y+_e[1]-this.deltaY;this.offset=this.cumulativeOffset(_b);return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_b.offsetWidth);},overlap:function(_f,_10){if(!_f){return 0;}if(_f=="vertical"){return ((this.offset[1]+_10.offsetHeight)-this.ycomp)/_10.offsetHeight;}if(_f=="horizontal"){return ((this.offset[0]+_10.offsetWidth)-this.xcomp)/_10.offsetWidth;}},clone:function(_11,_12){_11=$(_11);_12=$(_12);_12.style.position="absolute";var _13=this.cumulativeOffset(_11);_12.style.top=_13[1]+"px";_12.style.left=_13[0]+"px";_12.style.width=_11.offsetWidth+"px";_12.style.height=_11.offsetHeight+"px";},page:function(_14){var _15=0,valueL=0;var _16=_14;do{_15+=_16.offsetTop||0;valueL+=_16.offsetLeft||0;if(_16.offsetParent==document.body){if(Element.getStyle(_16,"position")=="absolute"){break;}}}while(_16=_16.offsetParent);_16=_14;do{_15-=_16.scrollTop||0;valueL-=_16.scrollLeft||0;}while(_16=_16.parentNode);return [valueL,_15];},clone:function(_17,_18){var _19=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});_17=$(_17);var p=Position.page(_17);_18=$(_18);var _1b=[0,0];var _1c=null;if(Element.getStyle(_18,"position")=="absolute"){_1c=Position.offsetParent(_18);_1b=Position.page(_1c);}if(_1c==document.body){_1b[0]-=document.body.offsetLeft;_1b[1]-=document.body.offsetTop;}if(_19.setLeft){_18.style.left=(p[0]-_1b[0]+_19.offsetLeft)+"px";}if(_19.setTop){_18.style.top=(p[1]-_1b[1]+_19.offsetTop)+"px";}if(_19.setWidth){_18.style.width=_17.offsetWidth+"px";}if(_19.setHeight){_18.style.height=_17.offsetHeight+"px";}},absolutize:function(_1d){_1d=$(_1d);if(_1d.style.position=="absolute"){return;}Position.prepare();var _1e=Position.positionedOffset(_1d);var top=_1e[1];var _20=_1e[0];var _21=_1d.clientWidth;var _22=_1d.clientHeight;_1d._originalLeft=_20-parseFloat(_1d.style.left||0);_1d._originalTop=top-parseFloat(_1d.style.top||0);_1d._originalWidth=_1d.style.width;_1d._originalHeight=_1d.style.height;_1d.style.position="absolute";_1d.style.top=top+"px";_1d.style.left=_20+"px";_1d.style.width=_21+"px";_1d.style.height=_22+"px";},relativize:function(_23){_23=$(_23);if(_23.style.position=="relative"){return;}Position.prepare();_23.style.position="relative";var top=parseFloat(_23.style.top||0)-(_23._originalTop||0);var _25=parseFloat(_23.style.left||0)-(_23._originalLeft||0);_23.style.top=top+"px";_23.style.left=_25+"px";_23.style.height=_23._originalHeight;_23.style.width=_23._originalWidth;}}; if(/Konqueror|Safari|KHTML/.test(navigator.userAgent)){Position.cumulativeOffset=function(_1){var _2=0,valueL=0;do{_2+=_1.offsetTop||0;valueL+=_1.offsetLeft||0;if(_1.offsetParent==document.body){if(Element.getStyle(_1,"position")=="absolute"){break;}}_1=_1.offsetParent;}while(_1);return [valueL,_2];};}
var loadImages=function(){var _1=0;if(!document._imgs){document._imgs=new Array();}arguments.length.times(function(i){_1=document._imgs.length;document._imgs[_1]=new Image;document._imgs[_1].src=arguments[i];});};var Tags=function(_3,_4){return (_3||document).getElementsByTagName(_4||"*");};var Style=function(_5,_6){Object.extend(_5.style,_6||{});};Object.extend(Dynamis,{Code:{cache:[],open:function(_7){this.rules=_7||{};this.timer=new Array();this._extendRules();this.assign(this.rules);},assign:function(_8){var _9=null;this._unloadCache();_8._each(function(_a){var _b=$A(_a.key.split(","));_b.each(function(_c){var _d=_c.split(":");var _e=_d[1];$$(_d[0]).each(function(_f){if(_d[1]==""||_d.length==1){return _a.value(_f);}if(_e.toLowerCase()=="loaded"){this.timer[_d[0]]=setInterval(this._checkLoaded.bind(this,_f,_d[0],_a),15);}else{_9=function(_10){var _11=Event.element(_10);if(_11.nodeType==3){_11=_11.parentNode;}_a.value($(_11),_10);};this.cache.push([_f,_e,_9]);Event.observe(_f,_e,_9);}}.bind(this));}.bind(this));}.bind(this));},_unloadCache:function(){if(!this.cache){return;}for(var i=0;i<this.cache.length;i++){Event.stopObserving.apply(this,this.cache[i]);this.cache[i][0]=null;}this.cache=[];},_checkLoaded:function(_13,_14,_15){var _16=$(_13);if(_13.tagName!="undefined"){clearInterval(this.timer[_14]);_15.value(_16);}},_extendRules:function(){Object.extend(this.rules,{_each:function(_17){for(key in this){if(key=="_each"){continue;}var _18=this[key];var _19=[key,_18];_19.key=key;_19.value=_18;_17(_19);}}});}},A:A});
String.prototype.parseColor=function(){var _1="#";if(this.slice(0,4)=="rgb("){var _2=this.slice(4,this.length-1).split(",");var i=0;do{_1+=parseInt(_2[i]).toColorPart();}while(++i<3);}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var i=1;i<4;i++){_1+=(this.charAt(i)+this.charAt(i)).toLowerCase();}}if(this.length==7){_1=this.toLowerCase();}}}return (_1.length==7?_1:(arguments[0]||this));};Element.collectTextNodes=function(_5){return $A($(_5).childNodes).collect(function(_6){return (_6.nodeType==3?_6.nodeValue:(_6.hasChildNodes()?Element.collectTextNodes(_6):""));}).flatten().join("");};Element.collectTextNodesIgnoreClass=function(_7,_8){return $A($(_7).childNodes).collect(function(_9){return (_9.nodeType==3?_9.nodeValue:((_9.hasChildNodes()&&!Element.hasClassName(_9,_8))?Element.collectTextNodesIgnoreClass(_9,_8):""));}).flatten().join("");};Element.setContentZoom=function(_a,_b){_a=$(_a);Element.setStyle(_a,{fontSize:(_b/100)+"em"});if(navigator.appVersion.indexOf("AppleWebKit")>0){window.scrollBy(0,0);}};Element.getOpacity=function(_c){var _d;if(_d=Element.getStyle(_c,"opacity")){return parseFloat(_d);}if(_d=(Element.getStyle(_c,"filter")||"").match(/alpha\(opacity=(.*)\)/)){if(_d[1]){return parseFloat(_d[1])/100;}}return 1;};Element.setOpacity=function(_e,_f){_e=$(_e);if(_f==1){Element.setStyle(_e,{opacity:(/Gecko/.test(navigator.userAgent)&&!/Konqueror|Safari|KHTML/.test(navigator.userAgent))?0.999999:null});if(/MSIE/.test(navigator.userAgent)){Element.setStyle(_e,{filter:Element.getStyle(_e,"filter").replace(/alpha\([^\)]*\)/gi,"")});}}else{if(_f<0.00001){_f=0;}Element.setStyle(_e,{opacity:_f});if(/MSIE/.test(navigator.userAgent)){Element.setStyle(_e,{filter:Element.getStyle(_e,"filter").replace(/alpha\([^\)]*\)/gi,"")+"alpha(opacity="+_f*100+")"});}}};Element.getInlineOpacity=function(_10){return $(_10).style.opacity||"";};Element.childrenWithClassName=function(_11,_12,_13){var _14=new RegExp("(^|\\s)"+_12+"(\\s|$)");var _15=$A($(_11).getElementsByTagName("*"))[_13?"detect":"select"](function(c){return (c.className&&c.className.match(_14));});if(!_15){_15=[];}return _15;};Element.forceRerendering=function(_17){try{_17=$(_17);var n=document.createTextNode(" ");_17.appendChild(n);_17.removeChild(n);}catch(e){}};Array.prototype.call=function(){var _19=arguments;this.each(function(f){f.apply(this,_19);});};var E={tagifyText:function(_1b){var _1c="position:relative";if(/MSIE/.test(navigator.userAgent)){_1c+=";zoom:1";}_1b=$(_1b);$A(_1b.childNodes).each(function(_1d){if(_1d.nodeType==3){_1d.nodeValue.toArray().each(function(_1e){_1b.insertBefore(Builder.node("span",{style:_1c},_1e==" "?String.fromCharCode(160):_1e),_1d);});Element.remove(_1d);}});},multiple:function(_1f,_20){var _21;if(((typeof _1f=="object")||(typeof _1f=="function"))&&(_1f.length)){_21=_1f;}else{_21=$(_1f).childNodes;}var _22=Object.extend({speed:0.1,delay:0},arguments[2]||{});var _23=_22.delay;$A(_21).each(function(_24,_25){new _20(_24,Object.extend(_22,{delay:_25*_22.speed+_23}));});},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_26,_27){_26=$(_26);_27=(_27||"appear").toLowerCase();var _28=Object.extend({queue:{position:"end",scope:(_26.id||"global"),limit:1}},arguments[2]||{});E[_26.visible()?E.PAIRS[_27][1]:E.PAIRS[_27][0]](_26,_28);}};var Effect2=E;E.Transitions={};E.Transitions.linear=function(pos){return pos;};E.Transitions.sinoidal=function(pos){return (-Math.cos(pos*Math.PI)/2)+0.5;};E.Transitions.reverse=function(pos){return 1-pos;};E.Transitions.flicker=function(pos){return ((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;};E.Transitions.wobble=function(pos){return (-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;};E.Transitions.pulse=function(pos){return (Math.floor(pos*10)%2==0?(pos*10-Math.floor(pos*10)):1-(pos*10-Math.floor(pos*10)));};E.Transitions.none=function(pos){return 0;};E.Transitions.full=function(pos){return 1;};E.ScopedQueue=Class.create();Object.extend(Object.extend(E.ScopedQueue.prototype,Enumerable),{initialize:function(){this.effects=[];this.interval=null;},_each:function(_31){this.effects._each(_31);},add:function(_32){var _33=new Date().getTime();var _34=(typeof _32.options.queue=="string")?_32.options.queue:_32.options.queue.position;switch(_34){case "front":this.effects.findAll(function(e){return e.state=="idle";}).each(function(e){e.startOn+=_32.finishOn;e.finishOn+=_32.finishOn;});break;case "end":_33=this.effects.pluck("finishOn").max()||_33;break;}_32.startOn+=_33;_32.finishOn+=_33;if(!_32.options.queue.limit||(this.effects.length<_32.options.queue.limit)){this.effects.push(_32);}if(!this.interval){this.interval=setInterval(this.loop.bind(this),40);}},remove:function(_37){this.effects=this.effects.reject(function(e){return e==_37;});if(this.effects.length==0){clearInterval(this.interval);this.interval=null;}},loop:function(){var _39=new Date().getTime();this.effects.invoke("loop",_39);}});E.Queues={instances:$H(),get:function(_3a){if(typeof _3a!="string"){return _3a;}if(!this.instances[_3a]){this.instances[_3a]=new E.ScopedQueue();}return this.instances[_3a];}};E.Queue=E.Queues.get("global");E.DefaultOptions={transition:E.Transitions.sinoidal,duration:1,fps:25,sync:false,from:0,to:1,delay:0,queue:"parallel"};E.Base=function(){};E.Base.prototype={position:null,start:function(_3b){this.options=Object.extend(Object.extend({},E.DefaultOptions),_3b||{});this.currentFrame=0;this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.event("beforeStart");if(!this.options.sync){E.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).add(this);}},loop:function(_3c){if(_3c>=this.startOn){if(_3c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish();}this.event("afterFinish");return;}var pos=(_3c-this.startOn)/(this.finishOn-this.startOn);var _3e=Math.round(pos*this.options.fps*this.options.duration);if(_3e>this.currentFrame){this.render(pos);this.currentFrame=_3e;}}},render:function(pos){if(this.state=="idle"){this.state="running";this.event("beforeSetup");if(this.setup){this.setup();}this.event("afterSetup");}if(this.state=="running"){if(this.options.transition){pos=this.options.transition(pos);}pos*=(this.options.to-this.options.from);pos+=this.options.from;this.position=pos;this.event("beforeUpdate");if(this.update){this.update(pos);}this.event("afterUpdate");}},cancel:function(){if(!this.options.sync){E.Queues.get(typeof this.options.queue=="string"?"global":this.options.queue.scope).remove(this);}this.state="finished";},event:function(_40){if(this.options[_40+"Internal"]){this.options[_40+"Internal"](this);}if(this.options[_40]){this.options[_40](this);}},inspect:function(){return "#<E:"+$H(this).inspect()+",options:"+$H(this.options).inspect()+">";}};E.Parallel=Class.create();Object.extend(Object.extend(E.Parallel.prototype,E.Base.prototype),{initialize:function(_41){this.effects=_41||[];this.start(arguments[1]);},update:function(_42){this.effects.invoke("render",_42);},finish:function(_43){this.effects.each(function(_44){_44.render(1);_44.cancel();_44.event("beforeFinish");if(_44.finish){_44.finish(_43);}_44.event("afterFinish");});}});E.Opacity=Class.create();Object.extend(Object.extend(E.Opacity.prototype,E.Base.prototype),{initialize:function(_45){this.element=$(_45);if(/MSIE/.test(navigator.userAgent)&&(!this.element.hasLayout)){this.element.setStyle({zoom:1});}var _46=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(_46);},update:function(_47){this.element.setOpacity(_47);}});E.Move=Class.create();Object.extend(Object.extend(E.Move.prototype,E.Base.prototype),{initialize:function(_48){this.element=$(_48);var _49=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(_49);},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(_4a){this.element.setStyle({left:this.options.x*_4a+this.originalLeft+"px",top:this.options.y*_4a+this.originalTop+"px"});}});E.MoveBy=function(_4b,_4c,_4d){return new E.Move(_4b,Object.extend({x:_4d,y:_4c},arguments[3]||{}));};E.Scale=Class.create();Object.extend(Object.extend(E.Scale.prototype,E.Base.prototype),{initialize:function(_4e,_4f){this.element=$(_4e);var _50=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_4f},arguments[2]||{});this.start(_50);},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(k){this.originalStyle[k]=this.element.style[k];}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var _52=this.element.getStyle("font-size")||"100%";["em","px","%"].each(function(_53){if(_52.indexOf(_53)>0){this.fontSize=parseFloat(_52);this.fontSizeType=_53;}}.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(_54){var _55=(this.options.scaleFrom/100)+(this.factor*_54);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*_55+this.fontSizeType});}this.setDimensions(this.dims[0]*_55,this.dims[1]*_55);},finish:function(_56){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle);}},setDimensions:function(_57,_58){var d={};if(this.options.scaleX){d.width=_58+"px";}if(this.options.scaleY){d.height=_57+"px";}if(this.options.scaleFromCenter){var _5a=(_57-this.dims[0])/2;var _5b=(_58-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){d.top=this.originalTop-_5a+"px";}if(this.options.scaleX){d.left=this.originalLeft-_5b+"px";}}else{if(this.options.scaleY){d.top=-_5a+"px";}if(this.options.scaleX){d.left=-_5b+"px";}}}this.element.setStyle(d);}});E.Highlight=Class.create();Object.extend(Object.extend(E.Highlight.prototype,E.Base.prototype),{initialize:function(_5c){this.element=$(_5c);var _5d=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(_5d);},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();return;}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(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16);}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i];}.bind(this));},update:function(_60){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){return m+(Math.round(this._base[i]+(this._delta[i]*_60)).toColorPart());}.bind(this))});},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));}});E.ScrollTo=Class.create();Object.extend(Object.extend(E.ScrollTo.prototype,E.Base.prototype),{initialize:function(_64){this.element=$(_64);this.start(arguments[1]||{});},setup:function(){Position.prepare();var _65=Position.cumulativeOffset(this.element);if(this.options.offset){_65[1]+=this.options.offset;}var max=window.innerHeight?window.height-window.innerHeight:document.body.scrollHeight-(document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight);this.scrollStart=Position.deltaY;this.delta=(_65[1]>max?max:_65[1])-this.scrollStart;},update:function(_67){Position.prepare();window.scrollTo(Position.deltaX,this.scrollStart+(_67*this.delta));}});E.Fade=function(_68){_68=$(_68);var _69=_68.getInlineOpacity();var _6a=Object.extend({from:_68.getOpacity()||1,to:0,afterFinishInternal:function(_6b){if(_6b.options.to!=0){return;}_6b.element.hide();_6b.element.setStyle({opacity:_69});}},arguments[1]||{});return new E.Opacity(_68,_6a);};E.Appear=function(_6c){_6c=$(_6c);var _6d=Object.extend({from:(_6c.getStyle("display")=="none"?0:_6c.getOpacity()||0),to:1,afterFinishInternal:function(_6e){_6e.element.forceRerendering();},beforeSetup:function(_6f){_6f.element.setOpacity(_6f.options.from);_6f.element.show();}},arguments[1]||{});return new E.Opacity(_6c,_6d);};E.Puff=function(_70){_70=$(_70);var _71={opacity:_70.getInlineOpacity(),position:_70.getStyle("position")};return new E.Parallel([new E.Scale(_70,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new E.Opacity(_70,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_72){_72.effects[0].element.setStyle({position:"absolute"});},afterFinishInternal:function(_73){_73.effects[0].element.hide();_73.effects[0].element.setStyle(_71);}},arguments[1]||{}));};E.BlindUp=function(_74){_74=$(_74);_74.makeClipping();return new E.Scale(_74,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_75){_75.element.hide();_75.element.undoClipping();}},arguments[1]||{}));};E.BlindDown=function(_76){_76=$(_76);var _77=_76.getDimensions();return new E.Scale(_76,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_77.height,originalWidth:_77.width},restoreAfterFinish:true,afterSetup:function(_78){_78.element.makeClipping();_78.element.setStyle({height:"0px"});_78.element.show();},afterFinishInternal:function(_79){_79.element.undoClipping();}},arguments[1]||{}));};E.SwitchOff=function(_7a){_7a=$(_7a);var _7b=_7a.getInlineOpacity();return new E.Appear(_7a,{duration:0.4,from:0,transition:E.Transitions.flicker,afterFinishInternal:function(_7c){new E.Scale(_7c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_7d){_7d.element.makePositioned();_7d.element.makeClipping();},afterFinishInternal:function(_7e){_7e.element.hide();_7e.element.undoClipping();_7e.element.undoPositioned();_7e.element.setStyle({opacity:_7b});}});}});};E.DropOut=function(_7f){_7f=$(_7f);var _80={top:_7f.getStyle("top"),left:_7f.getStyle("left"),opacity:_7f.getInlineOpacity()};return new E.Parallel([new E.Move(_7f,{x:0,y:100,sync:true}),new E.Opacity(_7f,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_81){_81.effects[0].element.makePositioned();},afterFinishInternal:function(_82){_82.effects[0].element.hide();_82.effects[0].element.undoPositioned();_82.effects[0].element.setStyle(_80);}},arguments[1]||{}));};E.Shake=function(_83){_83=$(_83);var _84={top:_83.getStyle("top"),left:_83.getStyle("left")};return new E.Move(_83,{x:20,y:0,duration:0.05,afterFinishInternal:function(_85){new E.Move(_85.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_86){new E.Move(_86.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_87){new E.Move(_87.element,{x:-40,y:0,duration:0.1,afterFinishInternal:function(_88){new E.Move(_88.element,{x:40,y:0,duration:0.1,afterFinishInternal:function(_89){new E.Move(_89.element,{x:-20,y:0,duration:0.05,afterFinishInternal:function(_8a){_8a.element.undoPositioned();_8a.element.setStyle(_84);}});}});}});}});}});}});};E.SlideDown=function(_8b){_8b=$(_8b);_8b.cleanWhitespace();var _8c=$(_8b.firstChild).getStyle("bottom");var _8d=_8b.getDimensions();return new E.Scale(_8b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_8d.height,originalWidth:_8d.width},restoreAfterFinish:true,afterSetup:function(_8e){_8e.element.makePositioned();_8e.element.firstChild.makePositioned();if(window.opera){_8e.element.setStyle({top:""});}_8e.element.makeClipping();_8e.element.setStyle({height:"0px"});_8e.element.show();},afterUpdateInternal:function(_8f){_8f.element.firstChild.setStyle({bottom:(_8f.dims[0]-_8f.element.clientHeight)+"px"});},afterFinishInternal:function(_90){_90.element.undoClipping();if(/MSIE/.test(navigator.userAgent)){_90.element.undoPositioned();_90.element.firstChild.undoPositioned();}else{_90.element.firstChild.undoPositioned();_90.element.undoPositioned();}_90.element.firstChild.setStyle({bottom:_8c});}},arguments[1]||{}));};E.SlideUp=function(_91){_91=$(_91);_91.cleanWhitespace();var _92=$(_91.firstChild).getStyle("bottom");return new E.Scale(_91,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,restoreAfterFinish:true,beforeStartInternal:function(_93){_93.element.makePositioned();_93.element.firstChild.makePositioned();if(window.opera){_93.element.setStyle({top:""});}_93.element.makeClipping();_93.element.show();},afterUpdateInternal:function(_94){_94.element.firstChild.setStyle({bottom:(_94.dims[0]-_94.element.clientHeight)+"px"});},afterFinishInternal:function(_95){_95.element.hide();_95.element.undoClipping();_95.element.firstChild.undoPositioned();_95.element.undoPositioned();_95.element.setStyle({bottom:_92});}},arguments[1]||{}));};E.Squish=function(_96){return new E.Scale(_96,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_97){_97.element.makeClipping(_97.element);},afterFinishInternal:function(_98){_98.element.hide(_98.element);_98.element.undoClipping(_98.element);}});};E.Grow=function(_99){_99=$(_99);var _9a=Object.extend({direction:"center",moveTransition:E.Transitions.sinoidal,scaleTransition:E.Transitions.sinoidal,opacityTransition:E.Transitions.full},arguments[1]||{});var _9b={top:_99.style.top,left:_99.style.left,height:_99.style.height,width:_99.style.width,opacity:_99.getInlineOpacity()};var _9c=_99.getDimensions();var _9d,initialMoveY;var _9e,moveY;switch(_9a.direction){case "top-left":_9d=initialMoveY=_9e=moveY=0;break;case "top-right":_9d=_9c.width;initialMoveY=moveY=0;_9e=-_9c.width;break;case "bottom-left":_9d=_9e=0;initialMoveY=_9c.height;moveY=-_9c.height;break;case "bottom-right":_9d=_9c.width;initialMoveY=_9c.height;_9e=-_9c.width;moveY=-_9c.height;break;case "center":_9d=_9c.width/2;initialMoveY=_9c.height/2;_9e=-_9c.width/2;moveY=-_9c.height/2;break;}return new E.Move(_99,{x:_9d,y:initialMoveY,duration:0.01,beforeSetup:function(_9f){_9f.element.hide();_9f.element.makeClipping();_9f.element.makePositioned();},afterFinishInternal:function(_a0){new E.Parallel([new E.Opacity(_a0.element,{sync:true,to:1,from:0,transition:_9a.opacityTransition}),new E.Move(_a0.element,{x:_9e,y:moveY,sync:true,transition:_9a.moveTransition}),new E.Scale(_a0.element,100,{scaleMode:{originalHeight:_9c.height,originalWidth:_9c.width},sync:true,scaleFrom:window.opera?1:0,transition:_9a.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_a1){_a1.effects[0].element.setStyle({height:"0px"});_a1.effects[0].element.show();},afterFinishInternal:function(_a2){_a2.effects[0].element.undoClipping();_a2.effects[0].element.undoPositioned();_a2.effects[0].element.setStyle(_9b);}},_9a));}});};E.Shrink=function(_a3){_a3=$(_a3);var _a4=Object.extend({direction:"center",moveTransition:E.Transitions.sinoidal,scaleTransition:E.Transitions.sinoidal,opacityTransition:E.Transitions.none},arguments[1]||{});var _a5={top:_a3.style.top,left:_a3.style.left,height:_a3.style.height,width:_a3.style.width,opacity:_a3.getInlineOpacity()};var _a6=_a3.getDimensions();var _a7,moveY;switch(_a4.direction){case "top-left":_a7=moveY=0;break;case "top-right":_a7=_a6.width;moveY=0;break;case "bottom-left":_a7=0;moveY=_a6.height;break;case "bottom-right":_a7=_a6.width;moveY=_a6.height;break;case "center":_a7=_a6.width/2;moveY=_a6.height/2;break;}return new E.Parallel([new E.Opacity(_a3,{sync:true,to:0,from:1,transition:_a4.opacityTransition}),new E.Scale(_a3,window.opera?1:0,{sync:true,transition:_a4.scaleTransition,restoreAfterFinish:true}),new E.Move(_a3,{x:_a7,y:moveY,sync:true,transition:_a4.moveTransition})],Object.extend({beforeStartInternal:function(_a8){_a8.effects[0].element.makePositioned();_a8.effects[0].element.makeClipping();},afterFinishInternal:function(_a9){_a9.effects[0].element.hide();_a9.effects[0].element.undoClipping();_a9.effects[0].element.undoPositioned();_a9.effects[0].element.setStyle(_a5);}},_a4));};E.Pulsate=function(_aa){_aa=$(_aa);var _ab=arguments[1]||{};var _ac=_aa.getInlineOpacity();var _ad=_ab.transition||E.Transitions.sinoidal;var _ae=function(pos){return _ad(1-E.Transitions.pulse(pos));};_ae.bind(_ad);return new E.Opacity(_aa,Object.extend(Object.extend({duration:3,from:0,afterFinishInternal:function(_b0){_b0.element.setStyle({opacity:_ac});}},_ab),{transition:_ae}));};E.Fold=function(_b1){_b1=$(_b1);var _b2={top:_b1.style.top,left:_b1.style.left,width:_b1.style.width,height:_b1.style.height};Element.makeClipping(_b1);return new E.Scale(_b1,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_b3){new E.Scale(_b1,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_b4){_b4.element.hide();_b4.element.undoClipping();_b4.element.setStyle(_b2);}});}},arguments[1]||{}));};["setOpacity","getOpacity","getInlineOpacity","forceRerendering","setContentZoom","collectTextNodes","collectTextNodesIgnoreClass","childrenWithClassName"].each(function(f){Element.Methods[f]=Element[f];});Element.Methods.visualEffect=function(_b6,_b7,_b8){s=_b7.gsub(/_/,"-").camelize();effect_class=s.charAt(0).toUpperCase()+s.substring(1);new E[effect_class](_b6,_b8);return $(_b6);};Element.addMethods();Dynamis.E=E;