.*?<\/sup>)+\s*/gi,'');content=content.replace(/\bid=(['"])([^"']+)\1/gi,'id="insitu__$2');dw_page.insituPopup(this,'insitu__fn').html(content).show().attr('aria-hidden','false');},makeToggle:function(handle,content,state){var $handle,$content,$clicky,$child,setClicky;$handle=jQuery(handle);if(!$handle.length)return;$content=jQuery(content);if(!$content.length)return;$child=$content.children();setClicky=function(hiding){if(hiding){$clicky.html('+');$handle.addClass('closed');$handle.removeClass('open');}else{$clicky.html('−');$handle.addClass('open');$handle.removeClass('closed');}};$handle[0].setState=function(state){var hidden;if(!state)state=1;$content.css('min-height',$content.height()).show();$child.stop(true,true);if(state===-1){hidden=false;}else if(state===1){hidden=true;}else{hidden=$child.is(':hidden');}setClicky(!hidden);$child.dw_toggle(hidden,function(){$content.toggle(hidden);$content.attr('aria-expanded',hidden);$content.css('min-height','');},true);};$clicky=jQuery(document.createElement('strong'));$handle.css('cursor','pointer').click($handle[0].setState).prepend($clicky);$handle[0].setState(state);}};jQuery(dw_page.init);function addSbLeftTocToggle(){if(!document.getElementById)return;var header=jQuery('#sb__left__toc__header');if(!header.length)return;var obj=document.createElement('span');obj.id='sb__left__toc__toggle';obj.innerHTML='−';obj.className='toc_close';obj.style.cursor='pointer';jQuery(header).prepend(obj);jQuery(obj.parentNode).bind('click',toggleSbLeftToc);try{obj.parentNode.style.cursor='pointer';obj.parentNode.style.cursor='hand';}catch(e){}}function toggleSbLeftToc(){var toc=jQuery('#sb__left__toc__inside');var obj=jQuery('#sb__left__toc__toggle');if(toc.css('display')=='none'){toc.css('display','block');obj.innerHTML='−';obj.className='toc_close';}else{toc.css('display','none');toc.style.display='none';obj.innerHTML='+';obj.className='toc_open';}}function addSbRightTocToggle(){if(!document.getElementById)return;var header=jQuery('#sb__right__toc__header');if(!header.length)return;var obj=document.createElement('span');obj.id='sb__right__toc__toggle';obj.innerHTML='−';obj.className='toc_close';obj.style.cursor='pointer';jQuery(header).prepend(obj);jQuery(obj.parentNode).bind('click',toggleSbRightToc);try{obj.parentNode.style.cursor='pointer';obj.parentNode.style.cursor='hand';}catch(e){}}function toggleSbRightToc(){var toc=jQuery('#sb__right__toc__inside');var obj=jQuery('#sb__right__toc__toggle');if(toc.css('display')=='none'){toc.css('display','block');obj.innerHTML='−';obj.className='toc_close';}else{toc.css('display','none');obj.innerHTML='+';obj.className='toc_open';}}var left_dw_index=jQuery('#left__index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});var right_dw_index=jQuery('#right__index__tree').dw_tree({deferInit:true,load_data:function(show_sublist,$clicky){jQuery.post(DOKU_BASE+'lib/exe/ajax.php',$clicky[0].search.substr(1)+'&call=index',show_sublist,'html');}});jQuery(function(){var $tree=jQuery('#left__index__tree');left_dw_index.$obj=$tree;left_dw_index.init();var $tree=jQuery('#right__index__tree');right_dw_index.$obj=$tree;right_dw_index.init();jQuery(addSbLeftTocToggle);jQuery(addSbRightTocToggle);});jQuery(function(){var $extmgr=jQuery('#extension__manager');$extmgr.find('button.uninstall').click(function(e){if(!window.confirm(LANG.plugins.extension.reallydel)){e.preventDefault();return false;}return true;});$extmgr.find('a.extension_screenshot').click(function(e){e.preventDefault();var image_href=jQuery(this).attr("href");var $lightbox=jQuery('#plugin__extensionlightbox');if(!$lightbox.length){$lightbox=jQuery('').appendTo(jQuery('body')).hide().click(function(){$lightbox.hide();});}$lightbox .show().find('div').html('
');return false;});$extmgr.find('button.disable, button.enable').click(function(e){e.preventDefault();var $btn=jQuery(this);var extension=$btn.attr('name').split('[')[2];extension=extension.substr(0,extension.length-1);var act=($btn.hasClass('disable'))?'disable':'enable';$btn.attr('disabled','disabled');$btn.css('cursor','wait');jQuery.get(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_extension',ext:extension,act:act},function(data){$btn.css('cursor','').removeAttr('disabled').removeClass('disable').removeClass('enable').val(data.label).addClass(data.reverse).parents('li').removeClass('disabled').removeClass('enabled').addClass(data.state);});});$extmgr.find('a.info').click(function(e){e.preventDefault();var $link=jQuery(this);var $details=$link.parent().find('dl.details');if($details.length){$link.toggleClass('close');$details.toggle();return;}$link.addClass('close');jQuery.get(DOKU_BASE+'lib/exe/ajax.php',{call:'plugin_extension',ext:$link.data('extid'),act:'info'},function(data){$link.parent().append(data);});});if($extmgr.find('.plugins, .templates').hasClass('active')){var $extlist=jQuery('#extension__list');$extlist.addClass('hasDisplayOptions');var $displayOpts=jQuery('',{id:'extension__viewoptions'}).appendTo($extmgr.find('.panelHeader'));$displayOpts.append(LANG.plugins.extension.display_viewoptions);var displayOptionsHandler=function(){$extlist.toggleClass(this.name);};jQuery(['enabled','disabled','updatable']).each(function(index,chkName){var $label=jQuery('').appendTo($displayOpts);jQuery('',{type:'checkbox',name:chkName}).change(displayOptionsHandler).appendTo($label).click();jQuery('').append(' '+LANG.plugins.extension['display_'+chkName]).appendTo($label);});}});var Prototype={Version:"1.6.0.2",Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf("AppleWebKit/")>-1||navigator.userAgent.indexOf("KHTML")>-1,Gecko:navigator.userAgent.indexOf("Gecko")>-1&&navigator.userAgent.indexOf("KHTML")==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement("div").__proto__&&document.createElement("div").__proto__!==document.createElement("form").__proto__},ScriptFragment:"",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x;}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false;}var Class={create:function(){var _2=null,_3=$A(arguments);if(Object.isFunction(_3[0])){_2=_3.shift();}function klass(){this.initialize.apply(this,arguments);}Object.extend(klass,Class.Methods);klass.superclass=_2;klass.subclasses=[];if(_2){var _4=function(){};_4.prototype=_2.prototype;klass.prototype=new _4;_2.subclasses.push(klass);}for(var i=0;i<_3.length;i++){klass.addMethods(_3[i]);}if(!klass.prototype.initialize){klass.prototype.initialize=Prototype.emptyFunction;}klass.prototype.constructor=klass;return klass;}};Class.Methods={addMethods:function(_6){var _7=this.superclass&&this.superclass.prototype;var _8=Object.keys(_6);if(!Object.keys({toString:true}).length){_8.push("toString","valueOf");}for(var i=0,_a=_8.length;i<_a;i++){var _b=_8[i],_c=_6[_b];if(_7&&Object.isFunction(_c)&&_c.argumentNames().first()=="$super"){var _d=_c,_c=Object.extend((function(m){return function(){return _7[m].apply(this,arguments);};})(_b).wrap(_d),{valueOf:function(){return _d;},toString:function(){return _d.toString();}});}this.prototype[_b]=_c;}return this;}};var Abstract={};Object.extend=function(_f,_10){for(var _11 in _10){_f[_11]=_10[_11];}return _f;};Object.extend(Object,{inspect:function(_12){try{if(Object.isUndefined(_12)){return"undefined";}if(_12===null){return"null";}return _12.inspect?_12.inspect():String(_12);}catch(e){if(e instanceof RangeError){return"...";}throw e;}},toJSON:function(_13){var _14=typeof _13;switch(_14){case"undefined":case"function":case"unknown":return;case"boolean":return _13.toString();}if(_13===null){return"null";}if(_13.toJSON){return _13.toJSON();}if(Object.isElement(_13)){return;}var _15=[];for(var _16 in _13){var _17=Object.toJSON(_13[_16]);if(!Object.isUndefined(_17)){_15.push(_16.toJSON()+": "+_17);}}return"{"+_15.join(", ")+"}";},toQueryString:function(_18){return $H(_18).toQueryString();},toHTML:function(_19){return _19&&_19.toHTML?_19.toHTML():String.interpret(_19);},keys:function(_1a){var _1b=[];for(var _1c in _1a){_1b.push(_1c);}return _1b;},values:function(_1d){var _1e=[];for(var _1f in _1d){_1e.push(_1d[_1f]);}return _1e;},clone:function(_20){return Object.extend({},_20);},isElement:function(_21){return _21&&_21.nodeType==1;},isArray:function(_22){return _22!=null&&typeof _22=="object"&&"splice"in _22&&"join"in _22;},isHash:function(_23){return _23 instanceof Hash;},isFunction:function(_24){return typeof _24=="function";},isString:function(_25){return typeof _25=="string";},isNumber:function(_26){return typeof _26=="number";},isUndefined:function(_27){return typeof _27=="undefined";}});Object.extend(Function.prototype,{argumentNames:function(){var _28=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return _28.length==1&&!_28[0]?[]:_28;},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this;}var _29=this,_2a=$A(arguments),_2b=_2a.shift();return function(){return _29.apply(_2b,_2a.concat($A(arguments)));};},bindAsEventListener:function(){var _2c=this,_2d=$A(arguments),_2e=_2d.shift();return function(_2f){return _2c.apply(_2e,[_2f||window.event].concat(_2d));};},curry:function(){if(!arguments.length){return this;}var _30=this,_31=$A(arguments);return function(){return _30.apply(this,_31.concat($A(arguments)));};},delay:function(){var _32=this,_33=$A(arguments),_34=_33.shift()*1000;return window.setTimeout(function(){return _32.apply(_32,_33);},_34);},wrap:function(_35){var _36=this;return function(){return _35.apply(this,[_36.bind(this)].concat($A(arguments)));};},methodize:function(){if(this._methodized){return this._methodized;}var _37=this;return this._methodized=function(){return _37.apply(null,[this].concat($A(arguments)));};}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return"\""+this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z\"";};var Try={these:function(){var _38;for(var i=0,_3a=arguments.length;i<_3a;i++){var _3b=arguments[i];try{_38=_3b();break;}catch(e){}}return _38;}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(str){return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1");};var PeriodicalExecuter=Class.create({initialize:function(_3d,_3e){this.callback=_3d;this.frequency=_3e;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();}finally{this.currentlyExecuting=false;}}}});Object.extend(String,{interpret:function(_3f){return _3f==null?"":String(_3f);},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});Object.extend(String.prototype,{gsub:function(_40,_41){var _42="",_43=this,_44;_41=arguments.callee.prepareReplacement(_41);while(_43.length>0){if(_44=_43.match(_40)){_42+=_43.slice(0,_44.index);_42+=String.interpret(_41(_44));_43=_43.slice(_44.index+_44[0].length);}else{_42+=_43,_43="";}}return _42;},sub:function(_45,_46,_47){_46=this.gsub.prepareReplacement(_46);_47=Object.isUndefined(_47)?1:_47;return this.gsub(_45,function(_48){if(--_47<0){return _48[0];}return _46(_48);});},scan:function(_49,_4a){this.gsub(_49,_4a);return String(this);},truncate:function(_4b,_4c){_4b=_4b||30;_4c=Object.isUndefined(_4c)?"...":_4c;return this.length>_4b?this.slice(0,_4b-_4c.length)+_4c:String(this);},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"");},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"");},extractScripts:function(){var _4d=new RegExp(Prototype.ScriptFragment,"img");var _4e=new RegExp(Prototype.ScriptFragment,"im");return(this.match(_4d)||[]).map(function(_4f){return(_4f.match(_4e)||["",""])[1];});},evalScripts:function(){return this.extractScripts().map(function(_50){return eval(_50);});},escapeHTML:function(){var _51=arguments.callee;_51.text.data=this;return _51.div.innerHTML;},unescapeHTML:function(){var div=new Element("div");div.innerHTML=this.stripTags();return div.childNodes[0]?(div.childNodes.length>1?$A(div.childNodes).inject("",function(_53,_54){return _53+_54.nodeValue;}):div.childNodes[0].nodeValue):"";},toQueryParams:function(_55){var _56=this.strip().match(/([^?#]*)(#.*)?$/);if(!_56){return{};}return _56[1].split(_55||"&").inject({},function(_57,_58){if((_58=_58.split("="))[0]){var key=decodeURIComponent(_58.shift());var _5a=_58.length>1?_58.join("="):_58[0];if(_5a!=undefined){_5a=decodeURIComponent(_5a);}if(key in _57){if(!Object.isArray(_57[key])){_57[key]=[_57[key]];}_57[key].push(_5a);}else{_57[key]=_5a;}}return _57;});},toArray:function(){return this.split("");},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1);},times:function(_5b){return _5b<1?"":new Array(_5b+1).join(this);},camelize:function(){var _5c=this.split("-"),len=_5c.length;if(len==1){return _5c[0];}var _5e=this.charAt(0)=="-"?_5c[0].charAt(0).toUpperCase()+_5c[0].substring(1):_5c[0];for(var i=1;i-1;},startsWith:function(_69){return this.indexOf(_69)===0;},endsWith:function(_6a){var d=this.length-_6a.length;return d>=0&&this.lastIndexOf(_6a)===d;},empty:function(){return this=="";},blank:function(){return/^\s*$/.test(this);},interpolate:function(_6c,_6d){return new Template(this,_6d).evaluate(_6c);}});if(Prototype.Browser.WebKit||Prototype.Browser.IE){Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,"&").replace(//g,">");},unescapeHTML:function(){return this.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");}});}String.prototype.gsub.prepareReplacement=function(_6e){if(Object.isFunction(_6e)){return _6e;}var _6f=new Template(_6e);return function(_70){return _6f.evaluate(_70);};};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement("div"),text:document.createTextNode("")});with(String.prototype.escapeHTML){div.appendChild(text);}var Template=Class.create({initialize:function(_71,_72){this.template=_71.toString();this.pattern=_72||Template.Pattern;},evaluate:function(_73){if(Object.isFunction(_73.toTemplateReplacements)){_73=_73.toTemplateReplacements();}return this.template.gsub(this.pattern,function(_74){if(_73==null){return"";}var _75=_74[1]||"";if(_75=="\\"){return _74[2];}var ctx=_73,_77=_74[3];var _78=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;_74=_78.exec(_77);if(_74==null){return _75;}while(_74!=null){var _79=_74[1].startsWith("[")?_74[2].gsub("\\\\]","]"):_74[1];ctx=ctx[_79];if(null==ctx||""==_74[3]){break;}_77=_77.substring("["==_74[3]?_74[1].length:_74[0].length);_74=_78.exec(_77);}return _75+String.interpret(ctx);});}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(_7a,_7b){var _7c=0;_7a=_7a.bind(_7b);try{this._each(function(_7d){_7a(_7d,_7c++);});}catch(e){if(e!=$break){throw e;}}return this;},eachSlice:function(_7e,_7f,_80){_7f=_7f?_7f.bind(_80):Prototype.K;var _81=-_7e,_82=[],_83=this.toArray();while((_81+=_7e)<_83.length){_82.push(_83.slice(_81,_81+_7e));}return _82.collect(_7f,_80);},all:function(_84,_85){_84=_84?_84.bind(_85):Prototype.K;var _86=true;this.each(function(_87,_88){_86=_86&&!!_84(_87,_88);if(!_86){throw $break;}});return _86;},any:function(_89,_8a){_89=_89?_89.bind(_8a):Prototype.K;var _8b=false;this.each(function(_8c,_8d){if(_8b=!!_89(_8c,_8d)){throw $break;}});return _8b;},collect:function(_8e,_8f){_8e=_8e?_8e.bind(_8f):Prototype.K;var _90=[];this.each(function(_91,_92){_90.push(_8e(_91,_92));});return _90;},detect:function(_93,_94){_93=_93.bind(_94);var _95;this.each(function(_96,_97){if(_93(_96,_97)){_95=_96;throw $break;}});return _95;},findAll:function(_98,_99){_98=_98.bind(_99);var _9a=[];this.each(function(_9b,_9c){if(_98(_9b,_9c)){_9a.push(_9b);}});return _9a;},grep:function(_9d,_9e,_9f){_9e=_9e?_9e.bind(_9f):Prototype.K;var _a0=[];if(Object.isString(_9d)){_9d=new RegExp(_9d);}this.each(function(_a1,_a2){if(_9d.match(_a1)){_a0.push(_9e(_a1,_a2));}});return _a0;},include:function(_a3){if(Object.isFunction(this.indexOf)){if(this.indexOf(_a3)!=-1){return true;}}var _a4=false;this.each(function(_a5){if(_a5==_a3){_a4=true;throw $break;}});return _a4;},inGroupsOf:function(_a6,_a7){_a7=Object.isUndefined(_a7)?null:_a7;return this.eachSlice(_a6,function(_a8){while(_a8.length<_a6){_a8.push(_a7);}return _a8;});},inject:function(_a9,_aa,_ab){_aa=_aa.bind(_ab);this.each(function(_ac,_ad){_a9=_aa(_a9,_ac,_ad);});return _a9;},invoke:function(_ae){var _af=$A(arguments).slice(1);return this.map(function(_b0){return _b0[_ae].apply(_b0,_af);});},max:function(_b1,_b2){_b1=_b1?_b1.bind(_b2):Prototype.K;var _b3;this.each(function(_b4,_b5){_b4=_b1(_b4,_b5);if(_b3==null||_b4>=_b3){_b3=_b4;}});return _b3;},min:function(_b6,_b7){_b6=_b6?_b6.bind(_b7):Prototype.K;var _b8;this.each(function(_b9,_ba){_b9=_b6(_b9,_ba);if(_b8==null||_b9<_b8){_b8=_b9;}});return _b8;},partition:function(_bb,_bc){_bb=_bb?_bb.bind(_bc):Prototype.K;var _bd=[],_be=[];this.each(function(_bf,_c0){(_bb(_bf,_c0)?_bd:_be).push(_bf);});return[_bd,_be];},pluck:function(_c1){var _c2=[];this.each(function(_c3){_c2.push(_c3[_c1]);});return _c2;},reject:function(_c4,_c5){_c4=_c4.bind(_c5);var _c6=[];this.each(function(_c7,_c8){if(!_c4(_c7,_c8)){_c6.push(_c7);}});return _c6;},sortBy:function(_c9,_ca){_c9=_c9.bind(_ca);return this.map(function(_cb,_cc){return{value:_cb,criteria:_c9(_cb,_cc)};}).sort(function(_cd,_ce){var a=_cd.criteria,b=_ce.criteria;return ab?1:0;}).pluck("value");},toArray:function(){return this.map();},zip:function(){var _d1=Prototype.K,_d2=$A(arguments);if(Object.isFunction(_d2.last())){_d1=_d2.pop();}var _d3=[this].concat(_d2).map($A);return this.map(function(_d4,_d5){return _d1(_d3.pluck(_d5));});},size:function(){return this.toArray().length;},inspect:function(){return"#";}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(_d6){if(!_d6){return[];}if(_d6.toArray){return _d6.toArray();}var _d7=_d6.length||0,_d8=new Array(_d7);while(_d7--){_d8[_d7]=_d6[_d7];}return _d8;}if(Prototype.Browser.WebKit){$A=function(_d9){if(!_d9){return[];}if(!(Object.isFunction(_d9)&&_d9=="[object NodeList]")&&_d9.toArray){return _d9.toArray();}var _da=_d9.length||0,_db=new Array(_da);while(_da--){_db[_da]=_d9[_da];}return _db;};}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse){Array.prototype._reverse=Array.prototype.reverse;}Object.extend(Array.prototype,{_each:function(_dc){for(var i=0,_de=this.length;i<_de;i++){_dc(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(_df){return _df!=null;});},flatten:function(){return this.inject([],function(_e0,_e1){return _e0.concat(Object.isArray(_e1)?_e1.flatten():[_e1]);});},without:function(){var _e2=$A(arguments);return this.select(function(_e3){return!_e2.include(_e3);});},reverse:function(_e4){return(_e4!==false?this:this.toArray())._reverse();},reduce:function(){return this.length>1?this:this[0];},uniq:function(_e5){return this.inject([],function(_e6,_e7,_e8){if(0==_e8||(_e5?_e6.last()!=_e7:!_e6.include(_e7))){_e6.push(_e7);}return _e6;});},intersect:function(_e9){return this.uniq().findAll(function(_ea){return _e9.detect(function(_eb){return _ea===_eb;});});},clone:function(){return[].concat(this);},size:function(){return this.length;},inspect:function(){return"["+this.map(Object.inspect).join(", ")+"]";},toJSON:function(){var _ec=[];this.each(function(_ed){var _ee=Object.toJSON(_ed);if(!Object.isUndefined(_ee)){_ec.push(_ee);}});return"["+_ec.join(", ")+"]";}});if(Object.isFunction(Array.prototype.forEach)){Array.prototype._each=Array.prototype.forEach;}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(_ef,i){i||(i=0);var _f1=this.length;if(i<0){i=_f1+i;}for(;i<_f1;i++){if(this[i]===_ef){return i;}}return-1;};}if(!Array.prototype.lastIndexOf){Array.prototype.lastIndexOf=function(_f2,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(_f2);return(n<0)?n:i-n-1;};}Array.prototype.toArray=Array.prototype.clone;function $w(_f5){if(!Object.isString(_f5)){return[];}_f5=_f5.strip();return _f5?_f5.split(/\s+/):[];}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var _f6=[];for(var i=0,_f8=this.length;i<_f8;i++){_f6.push(this[i]);}for(var i=0,_f8=arguments.length;i<_f8;i++){if(Object.isArray(arguments[i])){for(var j=0,_fa=arguments[i].length;j<_fa;j++){_f6.push(arguments[i][j]);}}else{_f6.push(arguments[i]);}}return _f6;};}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16);},succ:function(){return this+1;},times:function(_fb){$R(0,this,true).each(_fb);return this;},toPaddedString:function(_fc,_fd){var _fe=this.toString(_fd||10);return"0".times(_fc-_fe.length)+_fe;},toJSON:function(){return isFinite(this)?this.toString():"null";}});$w("abs round ceil floor").each(function(_ff){Number.prototype[_ff]=Math[_ff].methodize();});function $H(_100){return new Hash(_100);}var Hash=Class.create(Enumerable,(function(){function toQueryPair(key,_102){if(Object.isUndefined(_102)){return key;}return key+"="+encodeURIComponent(String.interpret(_102));}return{initialize:function(_103){this._object=Object.isHash(_103)?_103.toObject():Object.clone(_103);},_each:function(_104){for(var key in this._object){var _106=this._object[key],pair=[key,_106];pair.key=key;pair.value=_106;_104(pair);}},set:function(key,_109){return this._object[key]=_109;},get:function(key){return this._object[key];},unset:function(key){var _10c=this._object[key];delete this._object[key];return _10c;},toObject:function(){return Object.clone(this._object);},keys:function(){return this.pluck("key");},values:function(){return this.pluck("value");},index:function(_10d){var _10e=this.detect(function(pair){return pair.value===_10d;});return _10e&&_10e.key;},merge:function(_110){return this.clone().update(_110);},update:function(_111){return new Hash(_111).inject(this,function(_112,pair){_112.set(pair.key,pair.value);return _112;});},toQueryString:function(){return this.map(function(pair){var key=encodeURIComponent(pair.key),_116=pair.value;if(_116&&typeof _116=="object"){if(Object.isArray(_116)){return _116.map(toQueryPair.curry(key)).join("&");}}return toQueryPair(key,_116);}).join("&");},inspect:function(){return"#";},toJSON:function(){return Object.toJSON(this.toObject());},clone:function(){return new Hash(this);}};})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(_118,end,_11a){this.start=_118;this.end=end;this.exclusive=_11a;},_each:function(_11b){var _11c=this.start;while(this.include(_11c)){_11b(_11c);_11c=_11c.succ();}},include:function(_11d){if(_11d1&&!((_130==4)&&this._complete)){this.respondToReadyState(this.transport.readyState);}},setRequestHeaders:function(){var _131={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,"Accept":"text/javascript, text/html, application/xml, text/xml, */*"};if(this.method=="post"){_131["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){_131["Connection"]="close";}}if(typeof this.options.requestHeaders=="object"){var _132=this.options.requestHeaders;if(Object.isFunction(_132.push)){for(var i=0,_134=_132.length;i<_134;i+=2){_131[_132[i]]=_132[i+1];}}else{$H(_132).each(function(pair){_131[pair.key]=pair.value;});}}for(var name in _131){this.transport.setRequestHeader(name,_131[name]);}},success:function(){var _137=this.getStatus();return!_137||(_137>=200&&_137<300);},getStatus:function(){try{return this.transport.status||0;}catch(e){return 0;}},respondToReadyState:function(_138){var _139=Ajax.Request.Events[_138],_13a=new Ajax.Response(this);if(_139=="Complete"){try{this._complete=true;(this.options["on"+_13a.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(_13a,_13a.headerJSON);}catch(e){this.dispatchException(e);}var _13b=_13a.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&_13b&&_13b.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse();}}try{(this.options["on"+_139]||Prototype.emptyFunction)(_13a,_13a.headerJSON);Ajax.Responders.dispatch("on"+_139,this,_13a,_13a.headerJSON);}catch(e){this.dispatchException(e);}if(_139=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}));},getHeader:function(name){try{return this.transport.getResponseHeader(name)||null;}catch(e){return null;}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON());}catch(e){this.dispatchException(e);}},dispatchException:function(_13e){(this.options.onException||Prototype.emptyFunction)(this,_13e);Ajax.Responders.dispatch("onException",this,_13e);}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Response=Class.create({initialize:function(_13f){this.request=_13f;var _140=this.transport=_13f.transport,_141=this.readyState=_140.readyState;if((_141>2&&!Prototype.Browser.IE)||_141==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(_140.responseText);this.headerJSON=this._getHeaderJSON();}if(_141==4){var xml=_140.responseXML;this.responseXML=Object.isUndefined(xml)?null:xml;this.responseJSON=this._getResponseJSON();}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||"";}catch(e){return"";}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders();}catch(e){return null;}},getResponseHeader:function(name){return this.transport.getResponseHeader(name);},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders();},_getHeaderJSON:function(){var json=this.getHeader("X-JSON");if(!json){return null;}json=decodeURIComponent(escape(json));try{return json.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}},_getResponseJSON:function(){var _145=this.request.options;if(!_145.evalJSON||(_145.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null;}try{return this.responseText.evalJSON(_145.sanitizeJSON||!this.request.isSameOrigin());}catch(e){this.request.dispatchException(e);}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function(_146,_147,url,_149){this.container={success:(_147.success||_147),failure:(_147.failure||(_147.success?null:_147))};_149=Object.clone(_149);var _14a=_149.onComplete;_149.onComplete=(function(_14b,json){this.updateContent(_14b.responseText);if(Object.isFunction(_14a)){_14a(_14b,json);}}).bind(this);_146(url,_149);},updateContent:function(_14d){var _14e=this.container[this.success()?"success":"failure"],_14f=this.options;if(!_14f.evalScripts){_14d=_14d.stripScripts();}if(_14e=$(_14e)){if(_14f.insertion){if(Object.isString(_14f.insertion)){var _150={};_150[_14f.insertion]=_14d;_14e.insert(_150);}else{_14f.insertion(_14e,_14d);}}else{_14e.update(_14d);}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function(_151,_152,url,_154){_151(_154);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=_152;this.url=url;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(_155){if(this.options.decay){this.decay=(_155.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=_155.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 $(_156){if(arguments.length>1){for(var i=0,_158=[],_159=arguments.length;i<_159;i++){_158.push($(arguments[i]));}return _158;}if(Object.isString(_156)){_156=document.getElementById(_156);}return Element.extend(_156);}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(_15a,_15b){var _15c=[];var _15d=document.evaluate(_15a,$(_15b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,_15f=_15d.snapshotLength;i<_15f;i++){_15c.push(Element.extend(_15d.snapshotItem(i)));}return _15c;};}if(!window.Node){var Node={};}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12});}(function(){var _160=this.Element;this.Element=function(_161,_162){_162=_162||{};_161=_161.toLowerCase();var _163=Element.cache;if(Prototype.Browser.IE&&_162.name){_161="<"+_161+" name=\""+_162.name+"\">";delete _162.name;return Element.writeAttribute(document.createElement(_161),_162);}if(!_163[_161]){_163[_161]=Element.extend(document.createElement(_161));}return Element.writeAttribute(_163[_161].cloneNode(false),_162);};Object.extend(this.Element,_160||{});}).call(window);Element.cache={};Element.Methods={visible:function(_164){return $(_164).style.display!="none";},toggle:function(_165){_165=$(_165);Element[Element.visible(_165)?"hide":"show"](_165);return _165;},hide:function(_166){$(_166).style.display="none";return _166;},show:function(_167){$(_167).style.display="";return _167;},remove:function(_168){_168=$(_168);_168.parentNode.removeChild(_168);return _168;},update:function(_169,_16a){_169=$(_169);if(_16a&&_16a.toElement){_16a=_16a.toElement();}if(Object.isElement(_16a)){return _169.update().insert(_16a);}_16a=Object.toHTML(_16a);_169.innerHTML=_16a.stripScripts();_16a.evalScripts.bind(_16a).defer();return _169;},replace:function(_16b,_16c){_16b=$(_16b);if(_16c&&_16c.toElement){_16c=_16c.toElement();}else{if(!Object.isElement(_16c)){_16c=Object.toHTML(_16c);var _16d=_16b.ownerDocument.createRange();_16d.selectNode(_16b);_16c.evalScripts.bind(_16c).defer();_16c=_16d.createContextualFragment(_16c.stripScripts());}}_16b.parentNode.replaceChild(_16c,_16b);return _16b;},insert:function(_16e,_16f){_16e=$(_16e);if(Object.isString(_16f)||Object.isNumber(_16f)||Object.isElement(_16f)||(_16f&&(_16f.toElement||_16f.toHTML))){_16f={bottom:_16f};}var _170,_171,_172,_173;for(var _174 in _16f){_170=_16f[_174];_174=_174.toLowerCase();_171=Element._insertionTranslations[_174];if(_170&&_170.toElement){_170=_170.toElement();}if(Object.isElement(_170)){_171(_16e,_170);continue;}_170=Object.toHTML(_170);_172=((_174=="before"||_174=="after")?_16e.parentNode:_16e).tagName.toUpperCase();_173=Element._getContentFromAnonymousElement(_172,_170.stripScripts());if(_174=="top"||_174=="after"){_173.reverse();}_173.each(_171.curry(_16e));_170.evalScripts.bind(_170).defer();}return _16e;},wrap:function(_175,_176,_177){_175=$(_175);if(Object.isElement(_176)){$(_176).writeAttribute(_177||{});}else{if(Object.isString(_176)){_176=new Element(_176,_177);}else{_176=new Element("div",_176);}}if(_175.parentNode){_175.parentNode.replaceChild(_176,_175);}_176.appendChild(_175);return _176;},inspect:function(_178){_178=$(_178);var _179="<"+_178.tagName.toLowerCase();$H({"id":"id","className":"class"}).each(function(pair){var _17b=pair.first(),_17c=pair.last();var _17d=(_178[_17b]||"").toString();if(_17d){_179+=" "+_17c+"="+_17d.inspect(true);}});return _179+">";},recursivelyCollect:function(_17e,_17f){_17e=$(_17e);var _180=[];while(_17e=_17e[_17f]){if(_17e.nodeType==1){_180.push(Element.extend(_17e));}}return _180;},ancestors:function(_181){return $(_181).recursivelyCollect("parentNode");},descendants:function(_182){return $(_182).select("*");},firstDescendant:function(_183){_183=$(_183).firstChild;while(_183&&_183.nodeType!=1){_183=_183.nextSibling;}return $(_183);},immediateDescendants:function(_184){if(!(_184=$(_184).firstChild)){return[];}while(_184&&_184.nodeType!=1){_184=_184.nextSibling;}if(_184){return[_184].concat($(_184).nextSiblings());}return[];},previousSiblings:function(_185){return $(_185).recursivelyCollect("previousSibling");},nextSiblings:function(_186){return $(_186).recursivelyCollect("nextSibling");},siblings:function(_187){_187=$(_187);return _187.previousSiblings().reverse().concat(_187.nextSiblings());},match:function(_188,_189){if(Object.isString(_189)){_189=new Selector(_189);}return _189.match($(_188));},up:function(_18a,_18b,_18c){_18a=$(_18a);if(arguments.length==1){return $(_18a.parentNode);}var _18d=_18a.ancestors();return Object.isNumber(_18b)?_18d[_18b]:Selector.findElement(_18d,_18b,_18c);},down:function(_18e,_18f,_190){_18e=$(_18e);if(arguments.length==1){return _18e.firstDescendant();}return Object.isNumber(_18f)?_18e.descendants()[_18f]:_18e.select(_18f)[_190||0];},previous:function(_191,_192,_193){_191=$(_191);if(arguments.length==1){return $(Selector.handlers.previousElementSibling(_191));}var _194=_191.previousSiblings();return Object.isNumber(_192)?_194[_192]:Selector.findElement(_194,_192,_193);},next:function(_195,_196,_197){_195=$(_195);if(arguments.length==1){return $(Selector.handlers.nextElementSibling(_195));}var _198=_195.nextSiblings();return Object.isNumber(_196)?_198[_196]:Selector.findElement(_198,_196,_197);},select:function(){var args=$A(arguments),_19a=$(args.shift());return Selector.findChildElements(_19a,args);},adjacent:function(){var args=$A(arguments),_19c=$(args.shift());return Selector.findChildElements(_19c.parentNode,args).without(_19c);},identify:function(_19d){_19d=$(_19d);var id=_19d.readAttribute("id"),self=arguments.callee;if(id){return id;}do{id="anonymous_element_"+self.counter++;}while($(id));_19d.writeAttribute("id",id);return id;},readAttribute:function(_1a0,name){_1a0=$(_1a0);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[name]){return t.values[name](_1a0,name);}if(t.names[name]){name=t.names[name];}if(name.include(":")){return(!_1a0.attributes||!_1a0.attributes[name])?null:_1a0.attributes[name].value;}}return _1a0.getAttribute(name);},writeAttribute:function(_1a3,name,_1a5){_1a3=$(_1a3);var _1a6={},t=Element._attributeTranslations.write;if(typeof name=="object"){_1a6=name;}else{_1a6[name]=Object.isUndefined(_1a5)?true:_1a5;}for(var attr in _1a6){name=t.names[attr]||attr;_1a5=_1a6[attr];if(t.values[attr]){name=t.values[attr](_1a3,_1a5);}if(_1a5===false||_1a5===null){_1a3.removeAttribute(name);}else{if(_1a5===true){_1a3.setAttribute(name,name);}else{_1a3.setAttribute(name,_1a5);}}}return _1a3;},getHeight:function(_1a9){return $(_1a9).getDimensions().height;},getWidth:function(_1aa){return $(_1aa).getDimensions().width;},classNames:function(_1ab){return new Element.ClassNames(_1ab);},hasClassName:function(_1ac,_1ad){if(!(_1ac=$(_1ac))){return;}var _1ae=_1ac.className;return(_1ae.length>0&&(_1ae==_1ad||new RegExp("(^|\\s)"+_1ad+"(\\s|$)").test(_1ae)));},addClassName:function(_1af,_1b0){if(!(_1af=$(_1af))){return;}if(!_1af.hasClassName(_1b0)){_1af.className+=(_1af.className?" ":"")+_1b0;}return _1af;},removeClassName:function(_1b1,_1b2){if(!(_1b1=$(_1b1))){return;}_1b1.className=_1b1.className.replace(new RegExp("(^|\\s+)"+_1b2+"(\\s+|$)")," ").strip();return _1b1;},toggleClassName:function(_1b3,_1b4){if(!(_1b3=$(_1b3))){return;}return _1b3[_1b3.hasClassName(_1b4)?"removeClassName":"addClassName"](_1b4);},cleanWhitespace:function(_1b5){_1b5=$(_1b5);var node=_1b5.firstChild;while(node){var _1b7=node.nextSibling;if(node.nodeType==3&&!/\S/.test(node.nodeValue)){_1b5.removeChild(node);}node=_1b7;}return _1b5;},empty:function(_1b8){return $(_1b8).innerHTML.blank();},descendantOf:function(_1b9,_1ba){_1b9=$(_1b9),_1ba=$(_1ba);var _1bb=_1ba;if(_1b9.compareDocumentPosition){return(_1b9.compareDocumentPosition(_1ba)&8)===8;}if(_1b9.sourceIndex&&!Prototype.Browser.Opera){var e=_1b9.sourceIndex,a=_1ba.sourceIndex,_1be=_1ba.nextSibling;if(!_1be){do{_1ba=_1ba.parentNode;}while(!(_1be=_1ba.nextSibling)&&_1ba.parentNode);}if(_1be&&_1be.sourceIndex){return(e>a&&e<_1be.sourceIndex);}}while(_1b9=_1b9.parentNode){if(_1b9==_1bb){return true;}}return false;},scrollTo:function(_1bf){_1bf=$(_1bf);var pos=_1bf.cumulativeOffset();window.scrollTo(pos[0],pos[1]);return _1bf;},getStyle:function(_1c1,_1c2){_1c1=$(_1c1);_1c2=_1c2=="float"?"cssFloat":_1c2.camelize();var _1c3=_1c1.style[_1c2];if(!_1c3){var css=document.defaultView.getComputedStyle(_1c1,null);_1c3=css?css[_1c2]:null;}if(_1c2=="opacity"){return _1c3?parseFloat(_1c3):1;}return _1c3=="auto"?null:_1c3;},getOpacity:function(_1c5){return $(_1c5).getStyle("opacity");},setStyle:function(_1c6,_1c7){_1c6=$(_1c6);var _1c8=_1c6.style,_1c9;if(Object.isString(_1c7)){_1c6.style.cssText+=";"+_1c7;return _1c7.include("opacity")?_1c6.setOpacity(_1c7.match(/opacity:\s*(\d?\.?\d*)/)[1]):_1c6;}for(var _1ca in _1c7){if(_1ca=="opacity"){_1c6.setOpacity(_1c7[_1ca]);}else{_1c8[(_1ca=="float"||_1ca=="cssFloat")?(Object.isUndefined(_1c8.styleFloat)?"cssFloat":"styleFloat"):_1ca]=_1c7[_1ca];}}return _1c6;},setOpacity:function(_1cb,_1cc){_1cb=$(_1cb);_1cb.style.opacity=(_1cc==1||_1cc==="")?"":(_1cc<0.00001)?0:_1cc;return _1cb;},getDimensions:function(_1cd){_1cd=$(_1cd);var _1ce=$(_1cd).getStyle("display");if(_1ce!="none"&&_1ce!=null){return{width:_1cd.offsetWidth,height:_1cd.offsetHeight};}var els=_1cd.style;var _1d0=els.visibility;var _1d1=els.position;var _1d2=els.display;els.visibility="hidden";els.position="absolute";els.display="block";var _1d3=_1cd.clientWidth;var _1d4=_1cd.clientHeight;els.display=_1d2;els.position=_1d1;els.visibility=_1d0;return{width:_1d3,height:_1d4};},makePositioned:function(_1d5){_1d5=$(_1d5);var pos=Element.getStyle(_1d5,"position");if(pos=="static"||!pos){_1d5._madePositioned=true;_1d5.style.position="relative";if(window.opera){_1d5.style.top=0;_1d5.style.left=0;}}return _1d5;},undoPositioned:function(_1d7){_1d7=$(_1d7);if(_1d7._madePositioned){_1d7._madePositioned=undefined;_1d7.style.position=_1d7.style.top=_1d7.style.left=_1d7.style.bottom=_1d7.style.right="";}return _1d7;},makeClipping:function(_1d8){_1d8=$(_1d8);if(_1d8._overflow){return _1d8;}_1d8._overflow=Element.getStyle(_1d8,"overflow")||"auto";if(_1d8._overflow!=="hidden"){_1d8.style.overflow="hidden";}return _1d8;},undoClipping:function(_1d9){_1d9=$(_1d9);if(!_1d9._overflow){return _1d9;}_1d9.style.overflow=_1d9._overflow=="auto"?"":_1d9._overflow;_1d9._overflow=null;return _1d9;},cumulativeOffset:function(_1da){var _1db=0,_1dc=0;do{_1db+=_1da.offsetTop||0;_1dc+=_1da.offsetLeft||0;_1da=_1da.offsetParent;}while(_1da);return Element._returnOffset(_1dc,_1db);},positionedOffset:function(_1dd){var _1de=0,_1df=0;do{_1de+=_1dd.offsetTop||0;_1df+=_1dd.offsetLeft||0;_1dd=_1dd.offsetParent;if(_1dd){if(_1dd.tagName=="BODY"){break;}var p=Element.getStyle(_1dd,"position");if(p!=="static"){break;}}}while(_1dd);return Element._returnOffset(_1df,_1de);},absolutize:function(_1e1){_1e1=$(_1e1);if(_1e1.getStyle("position")=="absolute"){return;}var _1e2=_1e1.positionedOffset();var top=_1e2[1];var left=_1e2[0];var _1e5=_1e1.clientWidth;var _1e6=_1e1.clientHeight;_1e1._originalLeft=left-parseFloat(_1e1.style.left||0);_1e1._originalTop=top-parseFloat(_1e1.style.top||0);_1e1._originalWidth=_1e1.style.width;_1e1._originalHeight=_1e1.style.height;_1e1.style.position="absolute";_1e1.style.top=top+"px";_1e1.style.left=left+"px";_1e1.style.width=_1e5+"px";_1e1.style.height=_1e6+"px";return _1e1;},relativize:function(_1e7){_1e7=$(_1e7);if(_1e7.getStyle("position")=="relative"){return;}_1e7.style.position="relative";var top=parseFloat(_1e7.style.top||0)-(_1e7._originalTop||0);var left=parseFloat(_1e7.style.left||0)-(_1e7._originalLeft||0);_1e7.style.top=top+"px";_1e7.style.left=left+"px";_1e7.style.height=_1e7._originalHeight;_1e7.style.width=_1e7._originalWidth;return _1e7;},cumulativeScrollOffset:function(_1ea){var _1eb=0,_1ec=0;do{_1eb+=_1ea.scrollTop||0;_1ec+=_1ea.scrollLeft||0;_1ea=_1ea.parentNode;}while(_1ea);return Element._returnOffset(_1ec,_1eb);},getOffsetParent:function(_1ed){if(_1ed.offsetParent){return $(_1ed.offsetParent);}if(_1ed==document.body){return $(_1ed);}while((_1ed=_1ed.parentNode)&&_1ed!=document.body){if(Element.getStyle(_1ed,"position")!="static"){return $(_1ed);}}return $(document.body);},viewportOffset:function(_1ee){var _1ef=0,_1f0=0;var _1f1=_1ee;do{_1ef+=_1f1.offsetTop||0;_1f0+=_1f1.offsetLeft||0;if(_1f1.offsetParent==document.body&&Element.getStyle(_1f1,"position")=="absolute"){break;}}while(_1f1=_1f1.offsetParent);_1f1=_1ee;do{if(!Prototype.Browser.Opera||_1f1.tagName=="BODY"){_1ef-=_1f1.scrollTop||0;_1f0-=_1f1.scrollLeft||0;}}while(_1f1=_1f1.parentNode);return Element._returnOffset(_1f0,_1ef);},clonePosition:function(_1f2,_1f3){var _1f4=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});_1f3=$(_1f3);var p=_1f3.viewportOffset();_1f2=$(_1f2);var _1f6=[0,0];var _1f7=null;if(Element.getStyle(_1f2,"position")=="absolute"){_1f7=_1f2.getOffsetParent();_1f6=_1f7.viewportOffset();}if(_1f7==document.body){_1f6[0]-=document.body.offsetLeft;_1f6[1]-=document.body.offsetTop;}if(_1f4.setLeft){_1f2.style.left=(p[0]-_1f6[0]+_1f4.offsetLeft)+"px";}if(_1f4.setTop){_1f2.style.top=(p[1]-_1f6[1]+_1f4.offsetTop)+"px";}if(_1f4.setWidth){_1f2.style.width=_1f3.offsetWidth+"px";}if(_1f4.setHeight){_1f2.style.height=_1f3.offsetHeight+"px";}return _1f2;}};Element.Methods.identify.counter=1;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(_1f8,_1f9,_1fa){switch(_1fa){case"left":case"top":case"right":case"bottom":if(_1f8(_1f9,"position")==="static"){return null;}case"height":case"width":if(!Element.visible(_1f9)){return null;}var dim=parseInt(_1f8(_1f9,_1fa),10);if(dim!==_1f9["offset"+_1fa.capitalize()]){return dim+"px";}var _1fc;if(_1fa==="height"){_1fc=["border-top-width","padding-top","padding-bottom","border-bottom-width"];}else{_1fc=["border-left-width","padding-left","padding-right","border-right-width"];}return _1fc.inject(dim,function(memo,_1fe){var val=_1f8(_1f9,_1fe);return val===null?memo:memo-parseInt(val,10);})+"px";default:return _1f8(_1f9,_1fa);}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(_200,_201,_202){if(_202==="title"){return _201.title;}return _200(_201,_202);});}else{if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(_203,_204){_204=$(_204);var _205=_204.getStyle("position");if(_205!=="static"){return _203(_204);}_204.setStyle({position:"relative"});var _206=_203(_204);_204.setStyle({position:_205});return _206;});$w("positionedOffset viewportOffset").each(function(_207){Element.Methods[_207]=Element.Methods[_207].wrap(function(_208,_209){_209=$(_209);var _20a=_209.getStyle("position");if(_20a!=="static"){return _208(_209);}var _20b=_209.getOffsetParent();if(_20b&&_20b.getStyle("position")==="fixed"){_20b.setStyle({zoom:1});}_209.setStyle({position:"relative"});var _20c=_208(_209);_209.setStyle({position:_20a});return _20c;});});Element.Methods.getStyle=function(_20d,_20e){_20d=$(_20d);_20e=(_20e=="float"||_20e=="cssFloat")?"styleFloat":_20e.camelize();var _20f=_20d.style[_20e];if(!_20f&&_20d.currentStyle){_20f=_20d.currentStyle[_20e];}if(_20e=="opacity"){if(_20f=(_20d.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(_20f[1]){return parseFloat(_20f[1])/100;}}return 1;}if(_20f=="auto"){if((_20e=="width"||_20e=="height")&&(_20d.getStyle("display")!="none")){return _20d["offset"+_20e.capitalize()]+"px";}return null;}return _20f;};Element.Methods.setOpacity=function(_210,_211){function stripAlpha(_212){return _212.replace(/alpha\([^\)]*\)/gi,"");}_210=$(_210);var _213=_210.currentStyle;if((_213&&!_213.hasLayout)||(!_213&&_210.style.zoom=="normal")){_210.style.zoom=1;}var _214=_210.getStyle("filter"),_215=_210.style;if(_211==1||_211===""){(_214=stripAlpha(_214))?_215.filter=_214:_215.removeAttribute("filter");return _210;}else{if(_211<0.00001){_211=0;}}_215.filter=stripAlpha(_214)+"alpha(opacity="+(_211*100)+")";return _210;};Element._attributeTranslations={read:{names:{"class":"className","for":"htmlFor"},values:{_getAttr:function(_216,_217){return _216.getAttribute(_217,2);},_getAttrNode:function(_218,_219){var node=_218.getAttributeNode(_219);return node?node.value:"";},_getEv:function(_21b,_21c){_21c=_21b.getAttribute(_21c);return _21c?_21c.toString().slice(23,-2):null;},_flag:function(_21d,_21e){return $(_21d).hasAttribute(_21e)?_21e:null;},style:function(_21f){return _21f.style.cssText.toLowerCase();},title:function(_220){return _220.title;}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(_221,_222){_221.checked=!!_222;},style:function(_223,_224){_223.style.cssText=_224?_224:"";}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex "+"encType maxLength readOnly longDesc").each(function(attr){Element._attributeTranslations.write.names[attr.toLowerCase()]=attr;Element._attributeTranslations.has[attr.toLowerCase()]=attr;});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv});})(Element._attributeTranslations.read.values);}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(_227,_228){_227=$(_227);_227.style.opacity=(_228==1)?0.999999:(_228==="")?"":(_228<0.00001)?0:_228;return _227;};}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(_229,_22a){_229=$(_229);_229.style.opacity=(_22a==1||_22a==="")?"":(_22a<0.00001)?0:_22a;if(_22a==1){if(_229.tagName=="IMG"&&_229.width){_229.width++;_229.width--;}else{try{var n=document.createTextNode(" ");_229.appendChild(n);_229.removeChild(n);}catch(e){}}}return _229;};Element.Methods.cumulativeOffset=function(_22c){var _22d=0,_22e=0;do{_22d+=_22c.offsetTop||0;_22e+=_22c.offsetLeft||0;if(_22c.offsetParent==document.body){if(Element.getStyle(_22c,"position")=="absolute"){break;}}_22c=_22c.offsetParent;}while(_22c);return Element._returnOffset(_22e,_22d);};}}}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(_22f,_230){_22f=$(_22f);if(_230&&_230.toElement){_230=_230.toElement();}if(Object.isElement(_230)){return _22f.update().insert(_230);}_230=Object.toHTML(_230);var _231=_22f.tagName.toUpperCase();if(_231 in Element._insertionTranslations.tags){$A(_22f.childNodes).each(function(node){_22f.removeChild(node);});Element._getContentFromAnonymousElement(_231,_230.stripScripts()).each(function(node){_22f.appendChild(node);});}else{_22f.innerHTML=_230.stripScripts();}_230.evalScripts.bind(_230).defer();return _22f;};}if("outerHTML"in document.createElement("div")){Element.Methods.replace=function(_234,_235){_234=$(_234);if(_235&&_235.toElement){_235=_235.toElement();}if(Object.isElement(_235)){_234.parentNode.replaceChild(_235,_234);return _234;}_235=Object.toHTML(_235);var _236=_234.parentNode,_237=_236.tagName.toUpperCase();if(Element._insertionTranslations.tags[_237]){var _238=_234.next();var _239=Element._getContentFromAnonymousElement(_237,_235.stripScripts());_236.removeChild(_234);if(_238){_239.each(function(node){_236.insertBefore(node,_238);});}else{_239.each(function(node){_236.appendChild(node);});}}else{_234.outerHTML=_235.stripScripts();}_235.evalScripts.bind(_235).defer();return _234;};}Element._returnOffset=function(l,t){var _23e=[l,t];_23e.left=l;_23e.top=t;return _23e;};Element._getContentFromAnonymousElement=function(_23f,html){var div=new Element("div"),t=Element._insertionTranslations.tags[_23f];if(t){div.innerHTML=t[0]+html+t[1];t[2].times(function(){div=div.firstChild;});}else{div.innerHTML=html;}return $A(div.childNodes);};Element._insertionTranslations={before:function(_243,node){_243.parentNode.insertBefore(node,_243);},top:function(_245,node){_245.insertBefore(node,_245.firstChild);},bottom:function(_247,node){_247.appendChild(node);},after:function(_249,node){_249.parentNode.insertBefore(node,_249.nextSibling);},tags:{TABLE:["",1],TBODY:["",2],TR:["",3],TD:["",4],SELECT:["",1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD});}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(_24b,_24c){_24c=Element._attributeTranslations.has[_24c]||_24c;var node=$(_24b).getAttributeNode(_24c);return node&&node.specified;}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement("div").__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement("div").__proto__;Prototype.BrowserFeatures.ElementExtensions=true;}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions){return Prototype.K;}var _24e={},_24f=Element.Methods.ByTag;var _250=Object.extend(function(_251){if(!_251||_251._extendedByPrototype||_251.nodeType!=1||_251==window){return _251;}var _252=Object.clone(_24e),_253=_251.tagName,_254,_255;if(_24f[_253]){Object.extend(_252,_24f[_253]);}for(_254 in _252){_255=_252[_254];if(Object.isFunction(_255)&&!(_254 in _251)){_251[_254]=_255.methodize();}}_251._extendedByPrototype=Prototype.emptyFunction;return _251;},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(_24e,Element.Methods);Object.extend(_24e,Element.Methods.Simulated);}}});_250.refresh();return _250;})();Element.hasAttribute=function(_256,_257){if(_256.hasAttribute){return _256.hasAttribute(_257);}return Element.Methods.Simulated.hasAttribute(_256,_257);};Element.addMethods=function(_258){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!_258){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 _25b=_258;_258=arguments[1];}if(!_25b){Object.extend(Element.Methods,_258||{});}else{if(Object.isArray(_25b)){_25b.each(extend);}else{extend(_25b);}}function extend(_25c){_25c=_25c.toUpperCase();if(!Element.Methods.ByTag[_25c]){Element.Methods.ByTag[_25c]={};}Object.extend(Element.Methods.ByTag[_25c],_258);}function copy(_25d,_25e,_25f){_25f=_25f||false;for(var _260 in _25d){var _261=_25d[_260];if(!Object.isFunction(_261)){continue;}if(!_25f||!(_260 in _25e)){_25e[_260]=_261.methodize();}}}function findDOMClass(_262){var _263;var _264={"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(_264[_262]){_263="HTML"+_264[_262]+"Element";}if(window[_263]){return window[_263];}_263="HTML"+_262+"Element";if(window[_263]){return window[_263];}_263="HTML"+_262.capitalize()+"Element";if(window[_263]){return window[_263];}window[_263]={};window[_263].prototype=document.createElement(_262).__proto__;return window[_263];}if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true);}if(F.SpecificElementExtensions){for(var tag in Element.Methods.ByTag){var _266=findDOMClass(tag);if(Object.isUndefined(_266)){continue;}copy(T[tag],_266.prototype);}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh();}Element.cache={};};document.viewport={getDimensions:function(){var _267={};var B=Prototype.Browser;$w("width height").each(function(d){var D=d.capitalize();_267[d]=(B.WebKit&&!document.evaluate)?self["inner"+D]:(B.Opera)?document.body["client"+D]:document.documentElement["client"+D];});return _267;},getWidth:function(){return this.getDimensions().width;},getHeight:function(){return this.getDimensions().height;},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);}};var Selector=Class.create({initialize:function(_26b){this.expression=_26b.strip();this.compileMatcher();},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath){return false;}var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty"))){return false;}if((/(\[[\w-]*?:|:checked)/).test(this.expression)){return false;}return true;},compileMatcher:function(){if(this.shouldUseXPath()){return this.compileXPathMatcher();}var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return;}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],"");break;}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join("\n"));Selector._cache[this.expression]=this.matcher;},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return;}this.matcher=[".//*"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],"");break;}}}this.xpath=this.matcher.join("");Selector._cache[this.expression]=this.xpath;},findElements:function(root){root=root||document;if(this.xpath){return document._getElementsByXPath(this.xpath,root);}return this.matcher(root);},match:function(_27c){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var le,p,m;while(e&&le!==e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],"");}else{return this.findElements(document).include(_27c);}}}}var _284=true,name,_286;for(var i=0,_287;_287=this.tokens[i];i++){name=_287[0],_286=_287[1];if(!Selector.assertions[name](_27c,_286)){_284=false;break;}}return _284;},toString:function(){return this.expression;},inspect:function(){return"#";}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:"/following-sibling::*",tagName:function(m){if(m[1]=="*"){return"";}return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']";},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m);},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m);},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h){return"";}if(Object.isFunction(h)){return h(m);}return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);},operators:{"=":"[@#{1}='#{3}']","!=":"[@#{1}!='#{3}']","^=":"[starts-with(@#{1}, '#{3}')]","$=":"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']","*=":"[contains(@#{1}, '#{3}')]","~=":"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]","|=":"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{"first-child":"[not(preceding-sibling::*)]","last-child":"[not(following-sibling::*)]","only-child":"[not(preceding-sibling::* or following-sibling::*)]","empty":"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]","checked":"[@checked]","disabled":"[@disabled]","enabled":"[not(@disabled)]","not":function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var _293=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);_293.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],"");break;}}}return"[not("+_293.join(" and ")+")]";},"nth-child":function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m);},"nth-last-child":function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m);},"nth-of-type":function(m){return Selector.xpath.pseudos.nth("position() ",m);},"nth-last-of-type":function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m);},"first-of-type":function(m){m[6]="1";return Selector.xpath.pseudos["nth-of-type"](m);},"last-of-type":function(m){m[6]="1";return Selector.xpath.pseudos["nth-last-of-type"](m);},"only-of-type":function(m){var p=Selector.xpath.pseudos;return p["first-of-type"](m)+p["last-of-type"](m);},nth:function(_29d,m){var mm,_2a0=m[6],_2a1;if(_2a0=="even"){_2a0="2n+0";}if(_2a0=="odd"){_2a0="2n+1";}if(mm=_2a0.match(/^(\d+)$/)){return"["+_29d+"= "+mm[1]+"]";}if(mm=_2a0.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(mm[1]=="-"){mm[1]=-1;}var a=mm[1]?Number(mm[1]):1;var b=mm[2]?Number(mm[2]):0;_2a1="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(_2a1).evaluate({fragment:_29d,a:a,b:b});}}}},criteria:{tagName:"n = h.tagName(n, r, \"#{1}\", c); c = false;",className:"n = h.className(n, r, \"#{1}\", c); c = false;",id:"n = h.id(n, r, \"#{1}\", c); c = false;",attrPresence:"n = h.attrPresence(n, r, \"#{1}\", c); c = false;",attr:function(m){m[3]=(m[5]||m[6]);return new Template("n = h.attr(n, r, \"#{1}\", \"#{3}\", \"#{2}\", c); c = false;").evaluate(m);},pseudo:function(m){if(m[6]){m[6]=m[6].replace(/"/g,"\\\"");}return new Template("n = h.pseudo(n, \"#{1}\", \"#{6}\", r, c); c = false;").evaluate(m);},descendant:"c = \"descendant\";",child:"c = \"child\";",adjacent:"c = \"adjacent\";",laterSibling:"c = \"laterSibling\";"},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*(([\x27"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(_2a6,_2a7){return _2a7[1].toUpperCase()==_2a6.tagName.toUpperCase();},className:function(_2a8,_2a9){return Element.hasClassName(_2a8,_2a9[1]);},id:function(_2aa,_2ab){return _2aa.id===_2ab[1];},attrPresence:function(_2ac,_2ad){return Element.hasAttribute(_2ac,_2ad[1]);},attr:function(_2ae,_2af){var _2b0=Element.readAttribute(_2ae,_2af[1]);return _2b0&&Selector.operators[_2af[2]](_2b0,_2af[5]||_2af[6]);}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++){a.push(node);}return a;},mark:function(_2b5){var _2b6=Prototype.emptyFunction;for(var i=0,node;node=_2b5[i];i++){node._countedByPrototype=_2b6;}return _2b5;},unmark:function(_2b9){for(var i=0,node;node=_2b9[i];i++){node._countedByPrototype=undefined;}return _2b9;},index:function(_2bc,_2bd,_2be){_2bc._countedByPrototype=Prototype.emptyFunction;if(_2bd){for(var _2bf=_2bc.childNodes,i=_2bf.length-1,j=1;i>=0;i--){var node=_2bf[i];if(node.nodeType==1&&(!_2be||node._countedByPrototype)){node.nodeIndex=j++;}}}else{for(var i=0,j=1,_2bf=_2bc.childNodes;node=_2bf[i];i++){if(node.nodeType==1&&(!_2be||node._countedByPrototype)){node.nodeIndex=j++;}}}},unique:function(_2c3){if(_2c3.length==0){return _2c3;}var _2c4=[],n;for(var i=0,l=_2c3.length;i0?[b]:[];}return $R(1,_33f).inject([],function(memo,i){if(0==(i-b)%a&&(i-b)/a>=0){memo.push(i);}return memo;});},nth:function(_342,_343,root,_345,_346){if(_342.length==0){return[];}if(_343=="even"){_343="2n+0";}if(_343=="odd"){_343="2n+1";}var h=Selector.handlers,_348=[],_349=[],m;h.mark(_342);for(var i=0,node;node=_342[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,_345,_346);_349.push(node.parentNode);}}if(_343.match(/^\d+$/)){_343=Number(_343);for(var i=0,node;node=_342[i];i++){if(node.nodeIndex==_343){_348.push(node);}}}else{if(m=_343.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-"){m[1]=-1;}var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var _34f=Selector.pseudos.getIndices(a,b,_342.length);for(var i=0,node,l=_34f.length;node=_342[i];i++){for(var j=0;j+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){_383.push(m[1].strip());});return _383;},matchElements:function(_385,_386){var _387=$$(_386),h=Selector.handlers;h.mark(_387);for(var i=0,_38a=[],_38b;_38b=_385[i];i++){if(_38b._countedByPrototype){_38a.push(_38b);}}h.unmark(_387);return _38a;},findElement:function(_38c,_38d,_38e){if(Object.isNumber(_38d)){_38e=_38d;_38d=false;}return Selector.matchElements(_38c,_38d||"*")[_38e||0];},findChildElements:function(_38f,_390){_390=Selector.split(_390.join(","));var _391=[],h=Selector.handlers;for(var i=0,l=_390.length,_395;i1)?h.unique(_391):_391;}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++){if(node.tagName!=="!"){a.push(node);}}return a;},unmark:function(_39a){for(var i=0,node;node=_39a[i];i++){node.removeAttribute("_countedByPrototype");}return _39a;}});}function $$(){return Selector.findChildElements(document,$A(arguments));}var Form={reset:function(form){$(form).reset();return form;},serializeElements:function(_39e,_39f){if(typeof _39f!="object"){_39f={hash:!!_39f};}else{if(Object.isUndefined(_39f.hash)){_39f.hash=true;}}var key,_3a1,_3a2=false,_3a3=_39f.submit;var data=_39e.inject({},function(_3a5,_3a6){if(!_3a6.disabled&&_3a6.name){key=_3a6.name;_3a1=$(_3a6).getValue();if(_3a1!=null&&(_3a6.type!="submit"||(!_3a2&&_3a3!==false&&(!_3a3||key==_3a3)&&(_3a2=true)))){if(key in _3a5){if(!Object.isArray(_3a5[key])){_3a5[key]=[_3a5[key]];}_3a5[key].push(_3a1);}else{_3a5[key]=_3a1;}}}return _3a5;});return _39f.hash?data:Object.toQueryString(data);}};Form.Methods={serialize:function(form,_3a8){return Form.serializeElements(Form.getElements(form),_3a8);},getElements:function(form){return $A($(form).getElementsByTagName("*")).inject([],function(_3aa,_3ab){if(Form.Element.Serializers[_3ab.tagName.toLowerCase()]){_3aa.push(Element.extend(_3ab));}return _3aa;});},getInputs:function(form,_3ad,name){form=$(form);var _3af=form.getElementsByTagName("input");if(!_3ad&&!name){return $A(_3af).map(Element.extend);}for(var i=0,_3b1=[],_3b2=_3af.length;i<_3b2;i++){var _3b3=_3af[i];if((_3ad&&_3b3.type!=_3ad)||(name&&_3b3.name!=name)){continue;}_3b1.push(Element.extend(_3b3));}return _3b1;},disable:function(form){form=$(form);Form.getElements(form).invoke("disable");return form;},enable:function(form){form=$(form);Form.getElements(form).invoke("enable");return form;},findFirstElement:function(form){var _3b7=$(form).getElements().findAll(function(_3b8){return"hidden"!=_3b8.type&&!_3b8.disabled;});var _3b9=_3b7.findAll(function(_3ba){return _3ba.hasAttribute("tabIndex")&&_3ba.tabIndex>=0;}).sortBy(function(_3bb){return _3bb.tabIndex;}).first();return _3b9?_3b9:_3b7.find(function(_3bc){return["input","select","textarea"].include(_3bc.tagName.toLowerCase());});},focusFirstElement:function(form){form=$(form);form.findFirstElement().activate();return form;},request:function(form,_3bf){form=$(form),_3bf=Object.clone(_3bf||{});var _3c0=_3bf.parameters,_3c1=form.readAttribute("action")||"";if(_3c1.blank()){_3c1=window.location.href;}_3bf.parameters=form.serialize(true);if(_3c0){if(Object.isString(_3c0)){_3c0=_3c0.toQueryParams();}Object.extend(_3bf.parameters,_3c0);}if(form.hasAttribute("method")&&!_3bf.method){_3bf.method=form.method;}return new Ajax.Request(_3c1,_3bf);}};Form.Element={focus:function(_3c2){$(_3c2).focus();return _3c2;},select:function(_3c3){$(_3c3).select();return _3c3;}};Form.Element.Methods={serialize:function(_3c4){_3c4=$(_3c4);if(!_3c4.disabled&&_3c4.name){var _3c5=_3c4.getValue();if(_3c5!=undefined){var pair={};pair[_3c4.name]=_3c5;return Object.toQueryString(pair);}}return"";},getValue:function(_3c7){_3c7=$(_3c7);var _3c8=_3c7.tagName.toLowerCase();return Form.Element.Serializers[_3c8](_3c7);},setValue:function(_3c9,_3ca){_3c9=$(_3c9);var _3cb=_3c9.tagName.toLowerCase();Form.Element.Serializers[_3cb](_3c9,_3ca);return _3c9;},clear:function(_3cc){$(_3cc).value="";return _3cc;},present:function(_3cd){return $(_3cd).value!="";},activate:function(_3ce){_3ce=$(_3ce);try{_3ce.focus();if(_3ce.select&&(_3ce.tagName.toLowerCase()!="input"||!["button","reset","submit"].include(_3ce.type))){_3ce.select();}}catch(e){}return _3ce;},disable:function(_3cf){_3cf=$(_3cf);_3cf.blur();_3cf.disabled=true;return _3cf;},enable:function(_3d0){_3d0=$(_3d0);_3d0.disabled=false;return _3d0;}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(_3d1,_3d2){switch(_3d1.type.toLowerCase()){case"checkbox":case"radio":return Form.Element.Serializers.inputSelector(_3d1,_3d2);default:return Form.Element.Serializers.textarea(_3d1,_3d2);}},inputSelector:function(_3d3,_3d4){if(Object.isUndefined(_3d4)){return _3d3.checked?_3d3.value:null;}else{_3d3.checked=!!_3d4;}},textarea:function(_3d5,_3d6){if(Object.isUndefined(_3d6)){return _3d5.value;}else{_3d5.value=_3d6;}},select:function(_3d7,_3d8){if(Object.isUndefined(_3d8)){return this[_3d7.type=="select-one"?"selectOne":"selectMany"](_3d7);}else{var opt,_3da,_3db=!Object.isArray(_3d8);for(var i=0,_3dd=_3d7.length;i<_3dd;i++){opt=_3d7.options[i];_3da=this.optionValue(opt);if(_3db){if(_3da==_3d8){opt.selected=true;return;}}else{opt.selected=_3d8.include(_3da);}}}},selectOne:function(_3de){var _3df=_3de.selectedIndex;return _3df>=0?this.optionValue(_3de.options[_3df]):null;},selectMany:function(_3e0){var _3e1,_3e2=_3e0.length;if(!_3e2){return null;}for(var i=0,_3e1=[];i<_3e2;i++){var opt=_3e0.options[i];if(opt.selected){_3e1.push(this.optionValue(opt));}}return _3e1;},optionValue:function(opt){return Element.extend(opt).hasAttribute("value")?opt.value:opt.text;}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function(_3e6,_3e7,_3e8,_3e9){_3e6(_3e9,_3e8);this.element=$(_3e7);this.lastValue=this.getValue();},execute:function(){var _3ea=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(_3ea)?this.lastValue!=_3ea:String(this.lastValue)!=String(_3ea)){this.callback(this.element,_3ea);this.lastValue=_3ea;}}});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(_3eb,_3ec){this.element=$(_3eb);this.callback=_3ec;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var _3ed=this.getValue();if(this.lastValue!=_3ed){this.callback(this.element,_3ed);this.lastValue=_3ed;}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this);},registerCallback:function(_3ee){if(_3ee.type){switch(_3ee.type.toLowerCase()){case"checkbox":case"radio":Event.observe(_3ee,"click",this.onElementEvent.bind(this));break;default:Event.observe(_3ee,"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);}});if(!window.Event){var Event={};}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,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(_3ef){var _3f0;switch(_3ef.type){case"mouseover":_3f0=_3ef.fromElement;break;case"mouseout":_3f0=_3ef.toElement;break;default:return null;}return Element.extend(_3f0);}});Event.Methods=(function(){var _3f1;if(Prototype.Browser.IE){var _3f2={0:1,1:4,2:2};_3f1=function(_3f3,code){return _3f3.button==_3f2[code];};}else{if(Prototype.Browser.WebKit){_3f1=function(_3f5,code){switch(code){case 0:return _3f5.which==1&&!_3f5.metaKey;case 1:return _3f5.which==1&&_3f5.metaKey;default:return false;}};}else{_3f1=function(_3f7,code){return _3f7.which?(_3f7.which===code+1):(_3f7.button===code);};}}return{isLeftClick:function(_3f9){return _3f1(_3f9,0);},isMiddleClick:function(_3fa){return _3f1(_3fa,1);},isRightClick:function(_3fb){return _3f1(_3fb,2);},element:function(_3fc){var node=Event.extend(_3fc).target;return Element.extend(node.nodeType==Node.TEXT_NODE?node.parentNode:node);},findElement:function(_3fe,_3ff){var _400=Event.element(_3fe);if(!_3ff){return _400;}var _401=[_400].concat(_400.ancestors());return Selector.findElement(_401,_3ff,0);},pointer:function(_402){return{x:_402.pageX||(_402.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:_402.pageY||(_402.clientY+(document.documentElement.scrollTop||document.body.scrollTop))};},pointerX:function(_403){return Event.pointer(_403).x;},pointerY:function(_404){return Event.pointer(_404).y;},stop:function(_405){Event.extend(_405);_405.preventDefault();_405.stopPropagation();_405.stopped=true;}};})();Event.extend=(function(){var _406=Object.keys(Event.Methods).inject({},function(m,name){m[name]=Event.Methods[name].methodize();return m;});if(Prototype.Browser.IE){Object.extend(_406,{stopPropagation:function(){this.cancelBubble=true;},preventDefault:function(){this.returnValue=false;},inspect:function(){return"[object Event]";}});return function(_409){if(!_409){return false;}if(_409._extendedByPrototype){return _409;}_409._extendedByPrototype=Prototype.emptyFunction;var _40a=Event.pointer(_409);Object.extend(_409,{target:_409.srcElement,relatedTarget:Event.relatedTarget(_409),pageX:_40a.x,pageY:_40a.y});return Object.extend(_409,_406);};}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,_406);return Prototype.K;}})();Object.extend(Event,(function(){var _40b=Event.cache;function getEventID(_40c){if(_40c._prototypeEventID){return _40c._prototypeEventID[0];}arguments.callee.id=arguments.callee.id||1;return _40c._prototypeEventID=[++arguments.callee.id];}function getDOMEventName(_40d){if(_40d&&_40d.include(":")){return"dataavailable";}return _40d;}function getCacheForID(id){return _40b[id]=_40b[id]||{};}function getWrappersForEventName(id,_410){var c=getCacheForID(id);return c[_410]=c[_410]||[];}function createWrapper(_412,_413,_414){var id=getEventID(_412);var c=getWrappersForEventName(id,_413);if(c.pluck("handler").include(_414)){return false;}var _417=function(_418){if(!Event||!Event.extend||(_418.eventName&&_418.eventName!=_413)){return false;}Event.extend(_418);_414.call(_412,_418);};_417.handler=_414;c.push(_417);return _417;}function findWrapper(id,_41a,_41b){var c=getWrappersForEventName(id,_41a);return c.find(function(_41d){return _41d.handler==_41b;});}function destroyWrapper(id,_41f,_420){var c=getCacheForID(id);if(!c[_41f]){return false;}c[_41f]=c[_41f].without(findWrapper(id,_41f,_420));}function destroyCache(){for(var id in _40b){for(var _423 in _40b[id]){_40b[id][_423]=null;}}}if(window.attachEvent){window.attachEvent("onunload",destroyCache);}return{observe:function(_424,_425,_426){_424=$(_424);var name=getDOMEventName(_425);var _428=createWrapper(_424,_425,_426);if(!_428){return _424;}if(_424.addEventListener){_424.addEventListener(name,_428,false);}else{_424.attachEvent("on"+name,_428);}return _424;},stopObserving:function(_429,_42a,_42b){_429=$(_429);var id=getEventID(_429),name=getDOMEventName(_42a);if(!_42b&&_42a){getWrappersForEventName(id,_42a).each(function(_42e){_429.stopObserving(_42a,_42e.handler);});return _429;}else{if(!_42a){Object.keys(getCacheForID(id)).each(function(_42f){_429.stopObserving(_42f);});return _429;}}var _430=findWrapper(id,_42a,_42b);if(!_430){return _429;}if(_429.removeEventListener){_429.removeEventListener(name,_430,false);}else{_429.detachEvent("on"+name,_430);}destroyWrapper(id,_42a,_42b);return _429;},fire:function(_431,_432,memo){_431=$(_431);if(_431==document&&document.createEvent&&!_431.dispatchEvent){_431=document.documentElement;}var _434;if(document.createEvent){_434=document.createEvent("HTMLEvents");_434.initEvent("dataavailable",true,true);}else{_434=document.createEventObject();_434.eventType="ondataavailable";}_434.eventName=_432;_434.memo=memo||{};if(document.createEvent){_431.dispatchEvent(_434);}else{_431.fireEvent(_434.eventType,_434);}return Event.extend(_434);}};})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var _435;function fireContentLoadedEvent(){if(document.loaded){return;}if(_435){window.clearInterval(_435);}document.fire("dom:loaded");document.loaded=true;}if(document.addEventListener){if(Prototype.Browser.WebKit){_435=window.setInterval(function(){if(/loaded|complete/.test(document.readyState)){fireContentLoadedEvent();}},0);Event.observe(window,"load",fireContentLoadedEvent);}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false);}}else{document.write("");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent();}};}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(_436,_437){return Element.insert(_436,{before:_437});},Top:function(_438,_439){return Element.insert(_438,{top:_439});},Bottom:function(_43a,_43b){return Element.insert(_43a,{bottom:_43b});},After:function(_43c,_43d){return Element.insert(_43c,{after:_43d});}};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(_43e,x,y){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(_43e,x,y);}this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(_43e);return(y>=this.offset[1]&&y=this.offset[0]&&x=this.offset[1]&&this.ycomp=this.offset[0]&&this.xcomp0;})._each(_45d);},set:function(_45f){this.element.className=_45f;},add:function(_460){if(this.include(_460)){return;}this.set($A(this).concat(_460).join(" "));},remove:function(_461){if(!this.include(_461)){return;}this.set($A(this).without(_461).join(" "));},toString:function(){return $A(this).join(" ");}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();String.prototype.parseColor=function(){var _462="#";if(this.slice(0,4)=="rgb("){var cols=this.slice(4,this.length-1).split(",");var i=0;do{_462+=parseInt(cols[i]).toColorPart();}while(++i<3);}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var i=1;i<4;i++){_462+=(this.charAt(i)+this.charAt(i)).toLowerCase();}}if(this.length==7){_462=this.toLowerCase();}}}return(_462.length==7?_462:(arguments[0]||this));};Element.collectTextNodes=function(_465){return $A($(_465).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:(node.hasChildNodes()?Element.collectTextNodes(node):""));}).flatten().join("");};Element.collectTextNodesIgnoreClass=function(_467,_468){return $A($(_467).childNodes).collect(function(node){return(node.nodeType==3?node.nodeValue:((node.hasChildNodes()&&!Element.hasClassName(node,_468))?Element.collectTextNodesIgnoreClass(node,_468):""));}).flatten().join("");};Element.setContentZoom=function(_46a,_46b){_46a=$(_46a);_46a.setStyle({fontSize:(_46b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0);}return _46a;};Element.getInlineOpacity=function(_46c){return $(_46c).style.opacity||"";};Element.forceRerendering=function(_46d){try{_46d=$(_46d);var n=document.createTextNode(" ");_46d.appendChild(n);_46d.removeChild(n);}catch(e){}};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(pos){return(-Math.cos(pos*Math.PI)/2)+0.5;},reverse:function(pos){return 1-pos;},flicker:function(pos){var pos=((-Math.cos(pos*Math.PI)/4)+0.75)+Math.random()/4;return pos>1?1:pos;},wobble:function(pos){return(-Math.cos(pos*Math.PI*(9*pos))/2)+0.5;},pulse:function(pos,_474){_474=_474||5;return(((pos%(1/_474))*_474).round()==0?((pos*_474*2)-(pos*_474*2).floor()):1-((pos*_474*2)-(pos*_474*2).floor()));},spring:function(pos){return 1-(Math.cos(pos*4.5*Math.PI)*Math.exp(-pos*6));},none:function(pos){return 0;},full:function(pos){return 1;}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(_478){var _479="position:relative";if(Prototype.Browser.IE){_479+=";zoom:1";}_478=$(_478);$A(_478.childNodes).each(function(_47a){if(_47a.nodeType==3){_47a.nodeValue.toArray().each(function(_47b){_478.insertBefore(new Element("span",{style:_479}).update(_47b==" "?String.fromCharCode(160):_47b),_47a);});Element.remove(_47a);}});},multiple:function(_47c,_47d){var _47e;if(((typeof _47c=="object")||Object.isFunction(_47c))&&(_47c.length)){_47e=_47c;}else{_47e=$(_47c).childNodes;}var _47f=Object.extend({speed:0.1,delay:0},arguments[2]||{});var _480=_47f.delay;$A(_47e).each(function(_481,_482){new _47d(_481,Object.extend(_47f,{delay:_482*_47f.speed+_480}));});},PAIRS:{"slide":["SlideDown","SlideUp"],"blind":["BlindDown","BlindUp"],"appear":["Appear","Fade"]},toggle:function(_483,_484){_483=$(_483);_484=(_484||"appear").toLowerCase();var _485=Object.extend({queue:{position:"end",scope:(_483.id||"global"),limit:1}},arguments[2]||{});Effect[_483.visible()?Effect.PAIRS[_484][1]:Effect.PAIRS[_484][0]](_483,_485);}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null;},_each:function(_486){this.effects._each(_486);},add:function(_487){var _488=new Date().getTime();var _489=Object.isString(_487.options.queue)?_487.options.queue:_487.options.queue.position;switch(_489){case"front":this.effects.findAll(function(e){return e.state=="idle";}).each(function(e){e.startOn+=_487.finishOn;e.finishOn+=_487.finishOn;});break;case"with-last":_488=this.effects.pluck("startOn").max()||_488;break;case"end":_488=this.effects.pluck("finishOn").max()||_488;break;}_487.startOn+=_488;_487.finishOn+=_488;if(!_487.options.queue.limit||(this.effects.length<_487.options.queue.limit)){this.effects.push(_487);}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15);}},remove:function(_48c){this.effects=this.effects.reject(function(e){return e==_48c;});if(this.effects.length==0){clearInterval(this.interval);this.interval=null;}},loop:function(){var _48e=new Date().getTime();for(var i=0,len=this.effects.length;i=this.startOn){if(_495>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish();}this.event("afterFinish");return;}var pos=(_495-this.startOn)/this.totalTime,_497=(pos*this.totalFrames).round();if(_497>this.currentFrame){this.render(pos);this.currentFrame=_497;}}},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(_498){if(this.options[_498+"Internal"]){this.options[_498+"Internal"](this);}if(this.options[_498]){this.options[_498](this);}},inspect:function(){var data=$H();for(property in this){if(!Object.isFunction(this[property])){data.set(property,this[property]);}}return"#";}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(_49a){this.effects=_49a||[];this.start(arguments[1]);},update:function(_49b){this.effects.invoke("render",_49b);},finish:function(_49c){this.effects.each(function(_49d){_49d.render(1);_49d.cancel();_49d.event("beforeFinish");if(_49d.finish){_49d.finish(_49c);}_49d.event("afterFinish");});}});Effect.Tween=Class.create(Effect.Base,{initialize:function(_49e,from,to){_49e=Object.isString(_49e)?$(_49e):_49e;var args=$A(arguments),_4a2=args.last(),_4a3=args.length==5?args[3]:null;this.method=Object.isFunction(_4a2)?_4a2.bind(_49e):Object.isFunction(_49e[_4a2])?_49e[_4a2].bind(_49e):function(_4a4){_49e[_4a2]=_4a4;};this.start(Object.extend({from:from,to:to},_4a3||{}));},update:function(_4a5){this.method(_4a5);}});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(_4a6){this.element=$(_4a6);if(!this.element){throw(Effect._elementDoesNotExistError);}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1});}var _4a7=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});this.start(_4a7);},update:function(_4a8){this.element.setOpacity(_4a8);}});Effect.Move=Class.create(Effect.Base,{initialize:function(_4a9){this.element=$(_4a9);if(!this.element){throw(Effect._elementDoesNotExistError);}var _4aa=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(_4aa);},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(_4ab){this.element.setStyle({left:(this.options.x*_4ab+this.originalLeft).round()+"px",top:(this.options.y*_4ab+this.originalTop).round()+"px"});}});Effect.MoveBy=function(_4ac,_4ad,_4ae){return new Effect.Move(_4ac,Object.extend({x:_4ae,y:_4ad},arguments[3]||{}));};Effect.Scale=Class.create(Effect.Base,{initialize:function(_4af,_4b0){this.element=$(_4af);if(!this.element){throw(Effect._elementDoesNotExistError);}var _4b1=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:_4b0},arguments[2]||{});this.start(_4b1);},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 _4b3=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(_4b4){if(_4b3.indexOf(_4b4)>0){this.fontSize=parseFloat(_4b3);this.fontSizeType=_4b4;}}.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(_4b5){var _4b6=(this.options.scaleFrom/100)+(this.factor*_4b5);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*_4b6+this.fontSizeType});}this.setDimensions(this.dims[0]*_4b6,this.dims[1]*_4b6);},finish:function(_4b7){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle);}},setDimensions:function(_4b8,_4b9){var d={};if(this.options.scaleX){d.width=_4b9.round()+"px";}if(this.options.scaleY){d.height=_4b8.round()+"px";}if(this.options.scaleFromCenter){var topd=(_4b8-this.dims[0])/2;var _4bc=(_4b9-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){d.top=this.originalTop-topd+"px";}if(this.options.scaleX){d.left=this.originalLeft-_4bc+"px";}}else{if(this.options.scaleY){d.top=-topd+"px";}if(this.options.scaleX){d.left=-_4bc+"px";}}}this.element.setStyle(d);}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(_4bd){this.element=$(_4bd);if(!this.element){throw(Effect._elementDoesNotExistError);}var _4be=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(_4be);},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(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(_4c1){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(m,v,i){return m+((this._base[i]+(this._delta[i]*_4c1)).round().toColorPart());}.bind(this))});},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}));}});Effect.ScrollTo=function(_4c5){var _4c6=arguments[1]||{},_4c7=document.viewport.getScrollOffsets(),_4c8=$(_4c5).cumulativeOffset(),max=(window.height||document.body.scrollHeight)-document.viewport.getHeight();if(_4c6.offset){_4c8[1]+=_4c6.offset;}return new Effect.Tween(null,_4c7.top,_4c8[1]>max?max:_4c8[1],_4c6,function(p){scrollTo(_4c7.left,p.round());});};Effect.Fade=function(_4cb){_4cb=$(_4cb);var _4cc=_4cb.getInlineOpacity();var _4cd=Object.extend({from:_4cb.getOpacity()||1,to:0,afterFinishInternal:function(_4ce){if(_4ce.options.to!=0){return;}_4ce.element.hide().setStyle({opacity:_4cc});}},arguments[1]||{});return new Effect.Opacity(_4cb,_4cd);};Effect.Appear=function(_4cf){_4cf=$(_4cf);var _4d0=Object.extend({from:(_4cf.getStyle("display")=="none"?0:_4cf.getOpacity()||0),to:1,afterFinishInternal:function(_4d1){_4d1.element.forceRerendering();},beforeSetup:function(_4d2){_4d2.element.setOpacity(_4d2.options.from).show();}},arguments[1]||{});return new Effect.Opacity(_4cf,_4d0);};Effect.Puff=function(_4d3){_4d3=$(_4d3);var _4d4={opacity:_4d3.getInlineOpacity(),position:_4d3.getStyle("position"),top:_4d3.style.top,left:_4d3.style.left,width:_4d3.style.width,height:_4d3.style.height};return new Effect.Parallel([new Effect.Scale(_4d3,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(_4d3,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(_4d5){Position.absolutize(_4d5.effects[0].element);},afterFinishInternal:function(_4d6){_4d6.effects[0].element.hide().setStyle(_4d4);}},arguments[1]||{}));};Effect.BlindUp=function(_4d7){_4d7=$(_4d7);_4d7.makeClipping();return new Effect.Scale(_4d7,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(_4d8){_4d8.element.hide().undoClipping();}},arguments[1]||{}));};Effect.BlindDown=function(_4d9){_4d9=$(_4d9);var _4da=_4d9.getDimensions();return new Effect.Scale(_4d9,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:_4da.height,originalWidth:_4da.width},restoreAfterFinish:true,afterSetup:function(_4db){_4db.element.makeClipping().setStyle({height:"0px"}).show();},afterFinishInternal:function(_4dc){_4dc.element.undoClipping();}},arguments[1]||{}));};Effect.SwitchOff=function(_4dd){_4dd=$(_4dd);var _4de=_4dd.getInlineOpacity();return new Effect.Appear(_4dd,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(_4df){new Effect.Scale(_4df.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(_4e0){_4e0.element.makePositioned().makeClipping();},afterFinishInternal:function(_4e1){_4e1.element.hide().undoClipping().undoPositioned().setStyle({opacity:_4de});}});}},arguments[1]||{}));};Effect.DropOut=function(_4e2){_4e2=$(_4e2);var _4e3={top:_4e2.getStyle("top"),left:_4e2.getStyle("left"),opacity:_4e2.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(_4e2,{x:0,y:100,sync:true}),new Effect.Opacity(_4e2,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(_4e4){_4e4.effects[0].element.makePositioned();},afterFinishInternal:function(_4e5){_4e5.effects[0].element.hide().undoPositioned().setStyle(_4e3);}},arguments[1]||{}));};Effect.Shake=function(_4e6){_4e6=$(_4e6);var _4e7=Object.extend({distance:20,duration:0.5},arguments[1]||{});var _4e8=parseFloat(_4e7.distance);var _4e9=parseFloat(_4e7.duration)/10;var _4ea={top:_4e6.getStyle("top"),left:_4e6.getStyle("left")};return new Effect.Move(_4e6,{x:_4e8,y:0,duration:_4e9,afterFinishInternal:function(_4eb){new Effect.Move(_4eb.element,{x:-_4e8*2,y:0,duration:_4e9*2,afterFinishInternal:function(_4ec){new Effect.Move(_4ec.element,{x:_4e8*2,y:0,duration:_4e9*2,afterFinishInternal:function(_4ed){new Effect.Move(_4ed.element,{x:-_4e8*2,y:0,duration:_4e9*2,afterFinishInternal:function(_4ee){new Effect.Move(_4ee.element,{x:_4e8*2,y:0,duration:_4e9*2,afterFinishInternal:function(_4ef){new Effect.Move(_4ef.element,{x:-_4e8,y:0,duration:_4e9,afterFinishInternal:function(_4f0){_4f0.element.undoPositioned().setStyle(_4ea);}});}});}});}});}});}});};Effect.SlideDown=function(_4f1){_4f1=$(_4f1).cleanWhitespace();var _4f2=_4f1.down().getStyle("bottom");var _4f3=_4f1.getDimensions();return new Effect.Scale(_4f1,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:_4f3.height,originalWidth:_4f3.width},restoreAfterFinish:true,afterSetup:function(_4f4){_4f4.element.makePositioned();_4f4.element.down().makePositioned();if(window.opera){_4f4.element.setStyle({top:""});}_4f4.element.makeClipping().setStyle({height:"0px"}).show();},afterUpdateInternal:function(_4f5){_4f5.element.down().setStyle({bottom:(_4f5.dims[0]-_4f5.element.clientHeight)+"px"});},afterFinishInternal:function(_4f6){_4f6.element.undoClipping().undoPositioned();_4f6.element.down().undoPositioned().setStyle({bottom:_4f2});}},arguments[1]||{}));};Effect.SlideUp=function(_4f7){_4f7=$(_4f7).cleanWhitespace();var _4f8=_4f7.down().getStyle("bottom");var _4f9=_4f7.getDimensions();return new Effect.Scale(_4f7,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:_4f9.height,originalWidth:_4f9.width},restoreAfterFinish:true,afterSetup:function(_4fa){_4fa.element.makePositioned();_4fa.element.down().makePositioned();if(window.opera){_4fa.element.setStyle({top:""});}_4fa.element.makeClipping().show();},afterUpdateInternal:function(_4fb){_4fb.element.down().setStyle({bottom:(_4fb.dims[0]-_4fb.element.clientHeight)+"px"});},afterFinishInternal:function(_4fc){_4fc.element.hide().undoClipping().undoPositioned();_4fc.element.down().undoPositioned().setStyle({bottom:_4f8});}},arguments[1]||{}));};Effect.Squish=function(_4fd){return new Effect.Scale(_4fd,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(_4fe){_4fe.element.makeClipping();},afterFinishInternal:function(_4ff){_4ff.element.hide().undoClipping();}});};Effect.Grow=function(_500){_500=$(_500);var _501=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var _502={top:_500.style.top,left:_500.style.left,height:_500.style.height,width:_500.style.width,opacity:_500.getInlineOpacity()};var dims=_500.getDimensions();var _504,_505;var _506,_507;switch(_501.direction){case"top-left":_504=_505=_506=_507=0;break;case"top-right":_504=dims.width;_505=_507=0;_506=-dims.width;break;case"bottom-left":_504=_506=0;_505=dims.height;_507=-dims.height;break;case"bottom-right":_504=dims.width;_505=dims.height;_506=-dims.width;_507=-dims.height;break;case"center":_504=dims.width/2;_505=dims.height/2;_506=-dims.width/2;_507=-dims.height/2;break;}return new Effect.Move(_500,{x:_504,y:_505,duration:0.01,beforeSetup:function(_508){_508.element.hide().makeClipping().makePositioned();},afterFinishInternal:function(_509){new Effect.Parallel([new Effect.Opacity(_509.element,{sync:true,to:1,from:0,transition:_501.opacityTransition}),new Effect.Move(_509.element,{x:_506,y:_507,sync:true,transition:_501.moveTransition}),new Effect.Scale(_509.element,100,{scaleMode:{originalHeight:dims.height,originalWidth:dims.width},sync:true,scaleFrom:window.opera?1:0,transition:_501.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(_50a){_50a.effects[0].element.setStyle({height:"0px"}).show();},afterFinishInternal:function(_50b){_50b.effects[0].element.undoClipping().undoPositioned().setStyle(_502);}},_501));}});};Effect.Shrink=function(_50c){_50c=$(_50c);var _50d=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var _50e={top:_50c.style.top,left:_50c.style.left,height:_50c.style.height,width:_50c.style.width,opacity:_50c.getInlineOpacity()};var dims=_50c.getDimensions();var _510,_511;switch(_50d.direction){case"top-left":_510=_511=0;break;case"top-right":_510=dims.width;_511=0;break;case"bottom-left":_510=0;_511=dims.height;break;case"bottom-right":_510=dims.width;_511=dims.height;break;case"center":_510=dims.width/2;_511=dims.height/2;break;}return new Effect.Parallel([new Effect.Opacity(_50c,{sync:true,to:0,from:1,transition:_50d.opacityTransition}),new Effect.Scale(_50c,window.opera?1:0,{sync:true,transition:_50d.scaleTransition,restoreAfterFinish:true}),new Effect.Move(_50c,{x:_510,y:_511,sync:true,transition:_50d.moveTransition})],Object.extend({beforeStartInternal:function(_512){_512.effects[0].element.makePositioned().makeClipping();},afterFinishInternal:function(_513){_513.effects[0].element.hide().undoClipping().undoPositioned().setStyle(_50e);}},_50d));};Effect.Pulsate=function(_514){_514=$(_514);var _515=arguments[1]||{};var _516=_514.getInlineOpacity();var _517=_515.transition||Effect.Transitions.sinoidal;var _518=function(pos){return _517(1-Effect.Transitions.pulse(pos,_515.pulses));};_518.bind(_517);return new Effect.Opacity(_514,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(_51a){_51a.element.setStyle({opacity:_516});}},_515),{transition:_518}));};Effect.Fold=function(_51b){_51b=$(_51b);var _51c={top:_51b.style.top,left:_51b.style.left,width:_51b.style.width,height:_51b.style.height};_51b.makeClipping();return new Effect.Scale(_51b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(_51d){new Effect.Scale(_51b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(_51e){_51e.element.hide().undoClipping().setStyle(_51c);}});}},arguments[1]||{}));};Effect.Morph=Class.create(Effect.Base,{initialize:function(_51f){this.element=$(_51f);if(!this.element){throw(Effect._elementDoesNotExistError);}var _520=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(_520.style)){this.style=$H(_520.style);}else{if(_520.style.include(":")){this.style=_520.style.parseStyle();}else{this.element.addClassName(_520.style);this.style=$H(this.element.getStyles());this.element.removeClassName(_520.style);var css=this.element.getStyles();this.style=this.style.reject(function(_522){return _522.value==css[_522.key];});_520.afterFinishInternal=function(_523){_523.element.addClassName(_523.options.style);_523.transforms.each(function(_524){_523.element.style[_524.style]="";});};}}this.start(_520);},setup:function(){function parseColor(_525){if(!_525||["rgba(0, 0, 0, 0)","transparent"].include(_525)){_525="#ffffff";}_525=_525.parseColor();return $R(0,2).map(function(i){return parseInt(_525.slice(i*2+1,i*2+3),16);});}this.transforms=this.style.map(function(pair){var _528=pair[0],_529=pair[1],unit=null;if(_529.parseColor("#zzzzzz")!="#zzzzzz"){_529=_529.parseColor();unit="color";}else{if(_528=="opacity"){_529=parseFloat(_529);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1});}}else{if(Element.CSS_LENGTH.test(_529)){var _52b=_529.match(/^([\+\-]?[0-9\.]+)(.*)$/);_529=parseFloat(_52b[1]);unit=(_52b.length==3)?_52b[2]:null;}}}var _52c=this.element.getStyle(_528);return{style:_528.camelize(),originalValue:unit=="color"?parseColor(_52c):parseFloat(_52c||0),targetValue:unit=="color"?parseColor(_529):_529,unit:unit};}.bind(this)).reject(function(_52d){return((_52d.originalValue==_52d.targetValue)||(_52d.unit!="color"&&(isNaN(_52d.originalValue)||isNaN(_52d.targetValue))));});},update:function(_52e){var _52f={},_530,i=this.transforms.length;while(i--){_52f[(_530=this.transforms[i]).style]=_530.unit=="color"?"#"+(Math.round(_530.originalValue[0]+(_530.targetValue[0]-_530.originalValue[0])*_52e)).toColorPart()+(Math.round(_530.originalValue[1]+(_530.targetValue[1]-_530.originalValue[1])*_52e)).toColorPart()+(Math.round(_530.originalValue[2]+(_530.targetValue[2]-_530.originalValue[2])*_52e)).toColorPart():(_530.originalValue+(_530.targetValue-_530.originalValue)*_52e).toFixed(3)+(_530.unit===null?"":_530.unit);}this.element.setStyle(_52f,true);}});Effect.Transform=Class.create({initialize:function(_532){this.tracks=[];this.options=arguments[1]||{};this.addTracks(_532);},addTracks:function(_533){_533.each(function(_534){_534=$H(_534);var data=_534.values().first();this.tracks.push($H({ids:_534.keys().first(),effect:Effect.Morph,options:{style:data}}));}.bind(this));return this;},play:function(){return new Effect.Parallel(this.tracks.map(function(_536){var ids=_536.get("ids"),_538=_536.get("effect"),_539=_536.get("options");var _53a=[$(ids)||$$(ids)].flatten();return _53a.map(function(e){return new _538(e,Object.extend({sync:true},_539));});}).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 _53c,_53d=$H();if(Prototype.Browser.WebKit){_53c=new Element("div",{style:this}).style;}else{String.__parseStyleElement.innerHTML="";_53c=String.__parseStyleElement.childNodes[0].style;}Element.CSS_PROPERTIES.each(function(_53e){if(_53c[_53e]){_53d.set(_53e,_53c[_53e]);}});if(Prototype.Browser.IE&&this.include("opacity")){_53d.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);}return _53d;};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(_53f){var css=document.defaultView.getComputedStyle($(_53f),null);return Element.CSS_PROPERTIES.inject({},function(_541,_542){_541[_542]=css[_542];return _541;});};}else{Element.getStyles=function(_543){_543=$(_543);var css=_543.currentStyle,_545;_545=Element.CSS_PROPERTIES.inject({},function(_546,_547){_546[_547]=css[_547];return _546;});if(!_545.opacity){_545.opacity=_543.getOpacity();}return _545;};}Effect.Methods={morph:function(_548,_549){_548=$(_548);new Effect.Morph(_548,Object.extend({style:_549},arguments[2]||{}));return _548;},visualEffect:function(_54a,_54b,_54c){_54a=$(_54a);var s=_54b.dasherize().camelize(),_54e=s.charAt(0).toUpperCase()+s.substring(1);new Effect[_54e](_54a,_54c);return _54a;},highlight:function(_54f,_550){_54f=$(_54f);new Effect.Highlight(_54f,_550);return _54f;}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown "+"pulsate shake puff squish switchOff dropOut").each(function(_551){Effect.Methods[_551]=function(_552,_553){_552=$(_552);Effect[_551.charAt(0).toUpperCase()+_551.substring(1)](_552,_553);return _552;};});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(f){Effect.Methods[f]=Element[f];});Element.addMethods(Effect.Methods);var Builder={NODEMAP:{AREA:"map",CAPTION:"table",COL:"table",COLGROUP:"table",LEGEND:"fieldset",OPTGROUP:"select",OPTION:"select",PARAM:"object",TBODY:"table",TD:"table",TFOOT:"table",TH:"table",THEAD:"table",TR:"table"},node:function(_555){_555=_555.toUpperCase();var _556=this.NODEMAP[_555]||"div";var _557=document.createElement(_556);try{_557.innerHTML="<"+_555+">"+_555+">";}catch(e){}var _558=_557.firstChild||null;if(_558&&(_558.tagName.toUpperCase()!=_555)){_558=_558.getElementsByTagName(_555)[0];}if(!_558){_558=document.createElement(_555);}if(!_558){return;}if(arguments[1]){if(this._isStringOrNumber(arguments[1])||(arguments[1]instanceof Array)||arguments[1].tagName){this._children(_558,arguments[1]);}else{var _559=this._attributes(arguments[1]);if(_559.length){try{_557.innerHTML="<"+_555+" "+_559+">"+_555+">";}catch(e){}_558=_557.firstChild||null;if(!_558){_558=document.createElement(_555);for(attr in arguments[1]){_558[attr=="class"?"className":attr]=arguments[1][attr];}}if(_558.tagName.toUpperCase()!=_555){_558=_557.getElementsByTagName(_555)[0];}}}}if(arguments[2]){this._children(_558,arguments[2]);}return _558;},_text:function(text){return document.createTextNode(text);},ATTR_MAP:{"className":"class","htmlFor":"for"},_attributes:function(_55b){var _55c=[];for(attribute in _55b){_55c.push((attribute in this.ATTR_MAP?this.ATTR_MAP[attribute]:attribute)+"=\""+_55b[attribute].toString().escapeHTML().gsub(/"/,""")+"\"");}return _55c.join(" ");},_children:function(_55d,_55e){if(_55e.tagName){_55d.appendChild(_55e);return;}if(typeof _55e=="object"){_55e.flatten().each(function(e){if(typeof e=="object"){_55d.appendChild(e);}else{if(Builder._isStringOrNumber(e)){_55d.appendChild(Builder._text(e));}}});}else{if(Builder._isStringOrNumber(_55e)){_55d.appendChild(Builder._text(_55e));}}},_isStringOrNumber:function(_560){return(typeof _560=="string"||typeof _560=="number");},build:function(html){var _562=this.node("div");$(_562).update(html.strip());return _562.down();},dump:function(_563){if(typeof _563!="object"&&typeof _563!="function"){_563=window;}var tags=("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY "+"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET "+"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);tags.each(function(tag){_563[tag]=function(){return Builder.node.apply(Builder,[tag].concat($A(arguments)));};});}};LightboxOptions=Object.extend({fileLoadingImage:"lib/plugins/lightbox/images/loading.gif",fileBottomNavCloseImage:"lib/plugins/lightbox/images/closelabel.gif",overlayOpacity:0.8,animate:true,resizeSpeed:10,borderSize:10,labelImage:"Image",labelOf:"of"},window.LightboxOptions||{});var Lightbox=Class.create();Lightbox.prototype={imageArray:[],activeImage:undefined,initialize:function(){this.updateImageList();this.keyboardAction=this.keyboardAction.bindAsEventListener(this);if(LightboxOptions.resizeSpeed>10){LightboxOptions.resizeSpeed=10;}if(LightboxOptions.resizeSpeed<1){LightboxOptions.resizeSpeed=1;}this.resizeDuration=LightboxOptions.animate?((11-LightboxOptions.resizeSpeed)*0.15):0;this.overlayDuration=LightboxOptions.animate?0.2:0;var size=(LightboxOptions.animate?250:1)+"px";var _567=$$("body")[0];_567.appendChild(Builder.node("div",{id:"overlay"}));_567.appendChild(Builder.node("div",{id:"lightbox"},[Builder.node("div",{id:"outerImageContainer"},Builder.node("div",{id:"imageContainer"},[Builder.node("img",{id:"lightboxImage"}),Builder.node("div",{id:"hoverNav"},[Builder.node("a",{id:"prevLink",href:"#"}),Builder.node("a",{id:"nextLink",href:"#"})]),Builder.node("div",{id:"loading"},Builder.node("a",{id:"loadingLink",href:"#"},Builder.node("img",{src:LightboxOptions.fileLoadingImage})))])),Builder.node("div",{id:"imageDataContainer"},Builder.node("div",{id:"imageData"},[Builder.node("div",{id:"imageDetails"},[Builder.node("span",{id:"caption"}),Builder.node("span",{id:"numberDisplay"})]),Builder.node("div",{id:"bottomNav"},Builder.node("a",{id:"bottomNavClose",href:"#"},Builder.node("img",{src:LightboxOptions.fileBottomNavCloseImage})))]))]));$("overlay").hide().observe("click",(function(){this.end();}).bind(this));$("lightbox").hide().observe("click",(function(_568){if(_568.element().id=="lightbox"){this.end();}}).bind(this));$("outerImageContainer").setStyle({width:size,height:size});$("prevLink").observe("click",(function(_569){_569.stop();this.changeImage(this.activeImage-1);}).bindAsEventListener(this));$("nextLink").observe("click",(function(_56a){_56a.stop();this.changeImage(this.activeImage+1);}).bindAsEventListener(this));$("loadingLink").observe("click",(function(_56b){_56b.stop();this.end();}).bind(this));$("bottomNavClose").observe("click",(function(_56c){_56c.stop();this.end();}).bind(this));var th=this;(function(){var ids="overlay lightbox outerImageContainer imageContainer lightboxImage hoverNav prevLink nextLink loading loadingLink "+"imageDataContainer imageData imageDetails caption numberDisplay bottomNav bottomNavClose";$w(ids).each(function(id){th[id]=$(id);});}).defer();},updateImageList:function(){this.updateImageList=Prototype.emptyFunction;document.observe("click",(function(_570){var _571=_570.findElement("a[class^=media]:not([class~=mediafile])")||_570.findElement("area[class^=media]:not([class~=mediafile])");if(_571){_570.stop();this.start(_571);}}).bind(this));},start:function(_572){$$("select","object","embed").each(function(node){node.style.visibility="hidden";});var _574=this.getPageSize();$("overlay").setStyle({width:_574[0]+"px",height:_574[1]+"px"});new Effect.Appear(this.overlay,{duration:this.overlayDuration,from:0,to:LightboxOptions.overlayOpacity});this.imageArray=[];var _575=0;this.imageArray=$$(_572.tagName+"[href][class=\"media\"]").collect(function(_576){return[_576.href,_576.firstChild.getAttribute("title")];}).uniq();while(this.imageArray[_575][0]!=_572.href){_575++;}var _577=document.viewport.getScrollOffsets();var _578=_577[1]+(document.viewport.getHeight()/10);var _579=_577[0];this.lightbox.setStyle({top:_578+"px",left:_579+"px"}).show();this.changeImage(_575);},changeImage:function(_57a){this.activeImage=_57a;if(LightboxOptions.animate){this.loading.show();}this.lightboxImage.hide();this.hoverNav.hide();this.prevLink.hide();this.nextLink.hide();this.imageDataContainer.setStyle({opacity:0.0001});this.numberDisplay.hide();var _57b=new Image();_57b.onload=(function(){this.lightboxImage.src=this.imageArray[this.activeImage][0];this.resizeImageContainer(_57b.width,_57b.height);}).bind(this);_57b.src=this.imageArray[this.activeImage][0];},resizeImageContainer:function(_57c,_57d){var _57e=this.outerImageContainer.getWidth();var _57f=this.outerImageContainer.getHeight();var _580=(_57c+LightboxOptions.borderSize*2);var _581=(_57d+LightboxOptions.borderSize*2);var _582=(_580/_57e)*100;var _583=(_581/_57f)*100;var _584=_57e-_580;var _585=_57f-_581;if(_585!=0){new Effect.Scale(this.outerImageContainer,_583,{scaleX:false,duration:this.resizeDuration,queue:"front"});}if(_584!=0){new Effect.Scale(this.outerImageContainer,_582,{scaleY:false,duration:this.resizeDuration,delay:this.resizeDuration});}var _586=0;if((_585==0)&&(_584==0)){_586=100;if(Prototype.Browser.IE){_586=250;}}(function(){this.prevLink.setStyle({height:_57d+"px"});this.nextLink.setStyle({height:_57d+"px"});this.imageDataContainer.setStyle({width:_580+"px"});this.showImage();}).bind(this).delay(_586/1000);},showImage:function(){this.loading.hide();new Effect.Appear(this.lightboxImage,{duration:this.resizeDuration,queue:"end",afterFinish:(function(){this.updateDetails();}).bind(this)});this.preloadNeighborImages();},updateDetails:function(){if(this.imageArray[this.activeImage][1]!=""){this.caption.update(this.imageArray[this.activeImage][1]).show();}if(this.imageArray.length>1){this.numberDisplay.update(LightboxOptions.labelImage+" "+(this.activeImage+1)+" "+LightboxOptions.labelOf+" "+this.imageArray.length).show();}new Effect.Parallel([new Effect.SlideDown(this.imageDataContainer,{sync:true,duration:this.resizeDuration,from:0,to:1}),new Effect.Appear(this.imageDataContainer,{sync:true,duration:this.resizeDuration})],{duration:this.resizeDuration,afterFinish:(function(){var _587=this.getPageSize();this.overlay.setStyle({height:_587[1]+"px"});this.updateNav();}).bind(this)});},updateNav:function(){this.hoverNav.show();if(this.activeImage>0){this.prevLink.show();}if(this.activeImage<(this.imageArray.length-1)){this.nextLink.show();}this.enableKeyboardNav();},enableKeyboardNav:function(){document.observe("keydown",this.keyboardAction);},disableKeyboardNav:function(){document.stopObserving("keydown",this.keyboardAction);},keyboardAction:function(_588){var _589=_588.keyCode;var _58a;if(_588.DOM_VK_ESCAPE){_58a=_588.DOM_VK_ESCAPE;}else{_58a=27;}var key=String.fromCharCode(_589).toLowerCase();if(key.match(/x|o|c/)||(_589==_58a)){this.end();}else{if((key=="p")||(_589==37)){if(this.activeImage!=0){this.disableKeyboardNav();this.changeImage(this.activeImage-1);}}else{if((key=="n")||(_589==39)){if(this.activeImage!=(this.imageArray.length-1)){this.disableKeyboardNav();this.changeImage(this.activeImage+1);}}}}},preloadNeighborImages:function(){var _58c,_58d;if(this.imageArray.length>this.activeImage+1){_58c=new Image();_58c.src=this.imageArray[this.activeImage+1][0];}if(this.activeImage>0){_58d=new Image();_58d.src=this.imageArray[this.activeImage-1][0];}},end:function(){this.disableKeyboardNav();this.lightbox.hide();new Effect.Fade(this.overlay,{duration:this.overlayDuration});$$("select","object","embed").each(function(node){node.style.visibility="visible";});},getPageSize:function(){var _58f,_590;if(window.innerHeight&&window.scrollMaxY){_58f=window.innerWidth+window.scrollMaxX;_590=window.innerHeight+window.scrollMaxY;}else{if(document.body.scrollHeight>document.body.offsetHeight){_58f=document.body.scrollWidth;_590=document.body.scrollHeight;}else{_58f=document.body.offsetWidth;_590=document.body.offsetHeight;}}var _591,_592;if(self.innerHeight){if(document.documentElement.clientWidth){_591=document.documentElement.clientWidth;}else{_591=self.innerWidth;}_592=self.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){_591=document.documentElement.clientWidth;_592=document.documentElement.clientHeight;}else{if(document.body){_591=document.body.clientWidth;_592=document.body.clientHeight;}}}if(_590<_592){pageHeight=_592;}else{pageHeight=_590;}if(_58f<_591){pageWidth=_58f;}else{pageWidth=_591;}return[pageWidth,pageHeight];}};document.observe("dom:loaded",function(){new Lightbox();});(function($,undef){var _html,nonGradientIE,gradientType,vendorPrefixes,_css,Iris,UA,isIE,IEVersion;_html='';_css='.iris-picker{display:block;position:relative}.iris-picker,.iris-picker *{-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input+.iris-picker{margin-top:4px}.iris-error{background-color:#ffafaf}.iris-border{border-radius:3px;border:1px solid #aaa;width:200px;background-color:#fff}.iris-picker-inner{position:absolute;top:0;right:0;left:0;bottom:0}.iris-border .iris-picker-inner{top:10px;right:10px;left:10px;bottom:10px}.iris-picker .iris-square-inner{position:absolute;left:0;right:0;top:0;bottom:0}.iris-picker .iris-square,.iris-picker .iris-slider,.iris-picker .iris-square-inner,.iris-picker .iris-palette{border-radius:3px;box-shadow:inset 0 0 5px rgba(0,0,0,.4);height:100%;width:12.5%;float:left;margin-right:5%}.iris-picker .iris-square{width:76%;margin-right:10%;position:relative}.iris-picker .iris-square-inner{width:auto;margin:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-square-inner,.iris-ie-9 .iris-palette{box-shadow:none;border-radius:0}.iris-ie-9 .iris-square,.iris-ie-9 .iris-slider,.iris-ie-9 .iris-palette{outline:1px solid rgba(0,0,0,.1)}.iris-ie-lt9 .iris-square,.iris-ie-lt9 .iris-slider,.iris-ie-lt9 .iris-square-inner,.iris-ie-lt9 .iris-palette{outline:1px solid #aaa}.iris-ie-lt9 .iris-square .ui-slider-handle{outline:1px solid #aaa;background-color:#fff;-ms-filter:"alpha(Opacity=30)"}.iris-ie-lt9 .iris-square .iris-square-handle{background:0;border:3px solid #fff;-ms-filter:"alpha(Opacity=50)"}.iris-picker .iris-strip{margin-right:0;position:relative}.iris-picker .iris-strip .ui-slider-handle{position:absolute;background:0;margin:0;right:-3px;left:-3px;border:4px solid #aaa;border-width:4px 3px;width:auto;height:6px;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.2);opacity:.9;z-index:5;cursor:ns-resize}.iris-strip .ui-slider-handle:before{content:" ";position:absolute;left:-2px;right:-2px;top:-3px;bottom:-3px;border:2px solid #fff;border-radius:3px}.iris-picker .iris-slider-offset{position:absolute;top:11px;left:0;right:0;bottom:-3px;width:auto;height:auto;background:transparent;border:0;border-radius:0}.iris-picker .iris-square-handle{background:transparent;border:5px solid #aaa;border-radius:50%;border-color:rgba(128,128,128,.5);box-shadow:none;width:12px;height:12px;position:absolute;left:-10px;top:-10px;cursor:move;opacity:1;z-index:10}.iris-picker .ui-state-focus .iris-square-handle{opacity:.8}.iris-picker .iris-square-handle:hover{border-color:#999}.iris-picker .iris-square-value:focus .iris-square-handle{box-shadow:0 0 2px rgba(0,0,0,.75);opacity:.8}.iris-picker .iris-square-handle:hover::after{border-color:#fff}.iris-picker .iris-square-handle::after{position:absolute;bottom:-4px;right:-4px;left:-4px;top:-4px;border:3px solid #f9f9f9;border-color:rgba(255,255,255,.8);border-radius:50%;content:" "}.iris-picker .iris-square-value{width:8px;height:8px;position:absolute}.iris-ie-lt9 .iris-square-value,.iris-mozilla .iris-square-value{width:1px;height:1px}.iris-palette-container{position:absolute;bottom:0;left:0;margin:0;padding:0}.iris-border .iris-palette-container{left:10px;bottom:10px}.iris-picker .iris-palette{margin:0;cursor:pointer}.iris-square-handle,.ui-slider-handle{border:0;outline:0}';UA=navigator.userAgent.toLowerCase();isIE=navigator.appName==='Microsoft Internet Explorer';IEVersion=isIE?parseFloat(UA.match(/msie ([0-9]{1,}[\.0-9]{0,})/)[1]):0;nonGradientIE=(isIE&&IEVersion<10);gradientType=false;vendorPrefixes=['-moz-','-webkit-','-o-','-ms-'];if(nonGradientIE&&IEVersion<=7){$.fn.iris=$.noop;$.support.iris=false;return;}$.support.iris=true;function testGradientType(){var el,base,bgImageString='backgroundImage';if(nonGradientIE){gradientType='filter';}else{el=$('');base='linear-gradient(top,#fff,#000)';$.each(vendorPrefixes,function(i,val){el.css(bgImageString,val+base);if(el.css(bgImageString).match('gradient')){gradientType=i;return false;}});if(gradientType===false){el.css('background','-webkit-gradient(linear,0% 0%,0% 100%,from(#fff),to(#000))');if(el.css(bgImageString).match('gradient')){gradientType='webkit';}}el.remove();}}function createGradient(origin,stops){origin=(origin==='top')?'top':'left';stops=$.isArray(stops)?stops:Array.prototype.slice.call(arguments,1);if(gradientType==='webkit'){return legacyWebkitGradient(origin,stops);}else{return vendorPrefixes[gradientType]+'linear-gradient('+origin+', '+stops.join(', ')+')';}}function stupidIEGradient(origin,stops){var type,self,lastIndex,filter,startPosProp,endPosProp,dimensionProp,template,html;origin=(origin==='top')?'top':'left';stops=$.isArray(stops)?stops:Array.prototype.slice.call(arguments,1);type=(origin==='top')?0:1;self=$(this);lastIndex=stops.length-1;filter='filter';startPosProp=(type===1)?'left':'top';endPosProp=(type===1)?'right':'bottom';dimensionProp=(type===1)?'height':'width';template='';html='';if(self.css('position')==='static'){self.css({position:'relative'});}stops=fillColorStops(stops);$.each(stops,function(i,startColor){var endColor,endStop,filterVal;if(i===lastIndex){return false;}endColor=stops[i+1];if(startColor.stop===endColor.stop){return;}endStop=100-parseFloat(endColor.stop)+'%';startColor.octoHex=new Color(startColor.color).toIEOctoHex();endColor.octoHex=new Color(endColor.color).toIEOctoHex();filterVal='progid:DXImageTransform.Microsoft.Gradient(GradientType='+type+', StartColorStr=\''+startColor.octoHex+'\', EndColorStr=\''+endColor.octoHex+'\')';html+=template.replace('%start%',startColor.stop).replace('%end%',endStop).replace('%filter%',filterVal);});self.find('.iris-ie-gradient-shim').remove();$(html).prependTo(self);}function legacyWebkitGradient(origin,colorList){var stops=[];origin=(origin==='top')?'0% 0%,0% 100%,':'0% 100%,100% 100%,';colorList=fillColorStops(colorList);$.each(colorList,function(i,val){stops.push('color-stop('+(parseFloat(val.stop)/100)+', '+val.color+')');});return'-webkit-gradient(linear,'+origin+stops.join(',')+')';}function fillColorStops(colorList){var colors=[],percs=[],newColorList=[],lastIndex=colorList.length-1;$.each(colorList,function(index,val){var color=val,perc=false,match=val.match(/1?[0-9]{1,2}%$/);if(match){color=val.replace(/\s?1?[0-9]{1,2}%$/,'');perc=match.shift();}colors.push(color);percs.push(perc);});if(percs[0]===false){percs[0]='0%';}if(percs[lastIndex]===false){percs[lastIndex]='100%';}percs=backFillColorStops(percs);$.each(percs,function(i){newColorList[i]={color:colors[i],stop:percs[i]};});return newColorList;}function backFillColorStops(stops){var first=0,last=stops.length-1,i=0,foundFirst=false,incr,steps,step,firstVal;if(stops.length<=2||$.inArray(false,stops)<0){return stops;}while(i'),palette=$(''),colors=$.isArray(this.options.palettes)?this.options.palettes:this._palettes;if(this.picker.find('.iris-palette-container').length){container=this.picker.find('.iris-palette-container').detach().html('');}$.each(colors,function(index,val){palette.clone().data('color',val).css('backgroundColor',val).appendTo(container).height(10).width(10);});this.picker.append(container);},_paint:function(){var self=this;self._paintDimension('top','strip');self._paintDimension('top','vert');self._paintDimension('left','horiz');},_paintDimension:function(origin,control){var self=this,c=self._color,mode=self.options.mode,color=self._getHSpaceColor(),target=self.controls[control],controlOpts=self.options.controls,stops;if(control===self.active||(self.active==='square'&&control!=='strip')){return;}switch(controlOpts[control]){case'h':if(mode==='hsv'){color=c.clone();switch(control){case'horiz':color[controlOpts.vert](100);break;case'vert':color[controlOpts.horiz](100);break;case'strip':color.setHSpace('hsl');break;}stops=color.toHsl();}else{if(control==='strip'){stops={s:color.s,l:color.l};}else{stops={s:100,l:color.l};}}target.raninbowGradient(origin,stops);break;case's':if(mode==='hsv'){if(control==='vert'){stops=[c.clone().a(0).s(0).toCSS('rgba'),c.clone().a(1).s(0).toCSS('rgba')];}else if(control==='strip'){stops=[c.clone().s(100).toCSS('hsl'),c.clone().s(0).toCSS('hsl')];}else if(control==='horiz'){stops=['#fff','hsl('+color.h+',100%,50%)'];}}else{if(control==='vert'&&self.options.controls.horiz==='h'){stops=['hsla(0, 0%, '+color.l+'%, 0)','hsla(0, 0%, '+color.l+'%, 1)'];}else{stops=['hsl('+color.h+',0%,50%)','hsl('+color.h+',100%,50%)'];}}target.gradient(origin,stops);break;case'l':if(control==='strip'){stops=['hsl('+color.h+',100%,100%)','hsl('+color.h+', '+color.s+'%,50%)','hsl('+color.h+',100%,0%)'];}else{stops=['#fff','rgba(255,255,255,0) 50%','rgba(0,0,0,0) 50%','rgba(0,0,0,1)'];}target.gradient(origin,stops);break;case'v':if(control==='strip'){stops=[c.clone().v(100).toCSS(),c.clone().v(0).toCSS()];}else{stops=['rgba(0,0,0,0)','#000'];}target.gradient(origin,stops);break;default:break;}},_getHSpaceColor:function(){return(this.options.mode==='hsv')?this._color.toHsv():this._color.toHsl();},_dimensions:function(reset){var self=this,opts=self.options,controls=self.controls,square=controls.square,strip=self.picker.find('.iris-strip'),squareWidth='77.5%',stripWidth='12%',totalPadding=20,innerWidth=opts.border?opts.width-totalPadding:opts.width,controlsHeight,paletteCount=$.isArray(opts.palettes)?opts.palettes.length:self._palettes.length,paletteMargin,paletteWidth,paletteContainerWidth;if(reset){square.css('width','');strip.css('width','');self.picker.css({width:'',height:''});}squareWidth=innerWidth*(parseFloat(squareWidth)/100);stripWidth=innerWidth*(parseFloat(stripWidth)/100);controlsHeight=opts.border?squareWidth+totalPadding:squareWidth;square.width(squareWidth).height(squareWidth);strip.height(squareWidth).width(stripWidth);self.picker.css({width:opts.width,height:controlsHeight});if(!opts.palettes){return self.picker.css('paddingBottom','');}paletteMargin=squareWidth*2/100;paletteContainerWidth=squareWidth-((paletteCount-1)*paletteMargin);paletteWidth=paletteContainerWidth/paletteCount;self.picker.find('.iris-palette').each(function(i){var margin=i===0?0:paletteMargin;$(this).css({width:paletteWidth,height:paletteWidth,marginLeft:margin});});self.picker.css('paddingBottom',paletteWidth+paletteMargin);strip.height(paletteWidth+paletteMargin+squareWidth);},_addInputListeners:function(input){var self=this,debounceTimeout=100,callback=function(event){var color=new Color(input.val()),val=input.val().replace(/^#/,'');input.removeClass('iris-error');if(color.error){if(val!==''){input.addClass('iris-error');}}else{if(color.toString()!==self._color.toString()){if(!(event.type==='keyup'&&val.match(/^[0-9a-fA-F]{3}$/))){self._setOption('color',color.toString());}}}};input.on('change',callback).on('keyup',self._debounce(callback,debounceTimeout));if(self.options.hide){input.one('focus',function(){self.show();});}},_initControls:function(){var self=this,controls=self.controls,square=controls.square,controlOpts=self.options.controls,stripScale=self._scale[controlOpts.strip];controls.stripSlider.slider({orientation:'vertical',max:stripScale,slide:function(event,ui){self.active='strip';if(controlOpts.strip==='h'){ui.value=stripScale-ui.value;}self._color[controlOpts.strip](ui.value);self._change.apply(self,arguments);}});controls.squareDrag.draggable({containment:controls.square.find('.iris-square-inner'),zIndex:1000,cursor:'move',drag:function(event,ui){self._squareDrag(event,ui);},start:function(){square.addClass('iris-dragging');$(this).addClass('ui-state-focus');},stop:function(){square.removeClass('iris-dragging');$(this).removeClass('ui-state-focus');}}).on('mousedown mouseup',function(event){var focusClass='ui-state-focus';event.preventDefault();if(event.type==='mousedown'){self.picker.find('.'+focusClass).removeClass(focusClass).blur();$(this).addClass(focusClass).focus();}else{$(this).removeClass(focusClass);}}).on('keydown',function(event){var container=controls.square,draggable=controls.squareDrag,position=draggable.position(),distance=self.options.width/100;if(event.altKey){distance*=10;}switch(event.keyCode){case 37:position.left-=distance;break;case 38:position.top-=distance;break;case 39:position.left+=distance;break;case 40:position.top+=distance;break;default:return true;}position.left=Math.max(0,Math.min(position.left,container.width()));position.top=Math.max(0,Math.min(position.top,container.height()));draggable.css(position);self._squareDrag(event,{position:position});event.preventDefault();});square.mousedown(function(event){var squareOffset,pos;if(event.which!==1){return;}if(!$(event.target).is('div')){return;}squareOffset=self.controls.square.offset();pos={top:event.pageY-squareOffset.top,left:event.pageX-squareOffset.left};event.preventDefault();self._squareDrag(event,{position:pos});event.target=self.controls.squareDrag.get(0);self.controls.squareDrag.css(pos).trigger(event);});if(self.options.palettes){self._paletteListeners();}},_paletteListeners:function(){var self=this;self.picker.find('.iris-palette-container').on('click.palette','.iris-palette',function(){self._color.fromCSS($(this).data('color'));self.active='external';self._change();}).on('keydown.palette','.iris-palette',function(event){if(!(event.keyCode===13||event.keyCode===32)){return true;}event.stopPropagation();$(this).click();});},_squareDrag:function(event,ui){var self=this,controlOpts=self.options.controls,dimensions=self._squareDimensions(),vertVal=Math.round((dimensions.h-ui.position.top)/dimensions.h*self._scale[controlOpts.vert]),horizVal=self._scale[controlOpts.horiz]-Math.round((dimensions.w-ui.position.left)/dimensions.w*self._scale[controlOpts.horiz]);self._color[controlOpts.horiz](horizVal)[controlOpts.vert](vertVal);self.active='square';self._change.apply(self,arguments);},_setOption:function(key,value){var self=this,oldValue=self.options[key],doDimensions=false,hexLessColor,newColor,method;self.options[key]=value;switch(key){case'color':value=''+value;hexLessColor=value.replace(/^#/,'');newColor=new Color(value).setHSpace(self.options.mode);if(newColor.error){self.options[key]=oldValue;}else{self._color=newColor;self.options.color=self.options[key]=self._color.toString();self.active='external';self._change();}break;case'palettes':doDimensions=true;if(value){self._addPalettes();}else{self.picker.find('.iris-palette-container').remove();}if(!oldValue){self._paletteListeners();}break;case'width':doDimensions=true;break;case'border':doDimensions=true;method=value?'addClass':'removeClass';self.picker[method]('iris-border');break;case'mode':case'controls':if(oldValue===value){return;}method=self.element;oldValue=self.options;oldValue.hide=!self.picker.is(':visible');self.destroy();self.picker.remove();return $(self.element).iris(oldValue);}if(doDimensions){self._dimensions(true);}},_squareDimensions:function(forceRefresh){var square=this.controls.square,dimensions,control;if(forceRefresh!==undef&&square.data('dimensions')){return square.data('dimensions');}control=this.controls.squareDrag;dimensions={w:square.width(),h:square.height()};square.data('dimensions',dimensions);return dimensions;},_isNonHueControl:function(active,type){if(active==='square'&&this.options.controls.strip==='h'){return true;}else if(type==='external'||(type==='h'&&active==='strip')){return false;}return true;},_change:function(){var self=this,controls=self.controls,color=self._getHSpaceColor(),actions=['square','strip'],controlOpts=self.options.controls,type=controlOpts[self.active]||'external',oldHue=self.hue;if(self.active==='strip'){actions=[];}else if(self.active!=='external'){actions.pop();}$.each(actions,function(index,item){var value,dimensions,cssObj;if(item!==self.active){switch(item){case'strip':value=(controlOpts.strip==='h')?self._scale[controlOpts.strip]-color[controlOpts.strip]:color[controlOpts.strip];controls.stripSlider.slider('value',value);break;case'square':dimensions=self._squareDimensions();cssObj={left:color[controlOpts.horiz]/self._scale[controlOpts.horiz]*dimensions.w,top:dimensions.h-(color[controlOpts.vert]/self._scale[controlOpts.vert]*dimensions.h)};self.controls.squareDrag.css(cssObj);break;}}});if(color.h!==oldHue&&self._isNonHueControl(self.active,type)){self._color.h(oldHue);}self.hue=self._color.h();self.options.color=self._color.toString();if(self._inited){self._trigger('change',{type:self.active},{color:self._color});}if(self.element.is(':input')&&!self._color.error){self.element.removeClass('iris-error');if(self.element.val()!==self._color.toString()){self.element.val(self._color.toString());}}self._paint();self._inited=true;self.active=false;},_debounce:function(func,wait,immediate){var timeout,result;return function(){var context=this,args=arguments,later,callNow;later=function(){timeout=null;if(!immediate){result=func.apply(context,args);}};callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);}return result;};},show:function(){this.picker.show();},hide:function(){this.picker.hide();},toggle:function(){this.picker.toggle();},color:function(newColor){if(newColor===true){return this._color.clone();}else if(newColor===undef){return this._color.toString();}this.option('color',newColor);}};$.widget('a8c.iris',Iris);$('').appendTo('head');}(jQuery));(function(global,undef){var Color=function(color,type){if(!(this instanceof Color))return new Color(color,type);return this._init(color,type);};Color.fn=Color.prototype={_color:0,_alpha:1,error:false,_hsl:{h:0,s:0,l:0},_hsv:{h:0,s:0,v:0},_hSpace:'hsl',_init:function(color){var func='noop';switch(typeof color){case'object':if(color.a!==undef)this.a(color.a);func=(color.r!==undef)?'fromRgb':(color.l!==undef)?'fromHsl':(color.v!==undef)?'fromHsv':func;return this[func](color);case'string':return this.fromCSS(color);case'number':return this.fromInt(parseInt(color,10));}return this;},_error:function(){this.error=true;return this;},clone:function(){var newColor=new Color(this.toInt()),copy=['_alpha','_hSpace','_hsl','_hsv','error'];for(var i=copy.length-1;i>=0;i--){newColor[copy[i]]=this[copy[i]];}return newColor;},setHSpace:function(space){this._hSpace=(space==='hsv')?space:'hsl';return this;},noop:function(){return this;},fromCSS:function(color){var list,leadingRE=/^(rgb|hs(l|v))a?\(/;this.error=false;color=color.replace(/^\s+/,'').replace(/\s+$/,'').replace(/;$/,'');if(color.match(leadingRE)&&color.match(/\)$/)){list=color.replace(/(\s|%)/g,'').replace(leadingRE,'').replace(/,?\);?$/,'').split(',');if(list.length<3)return this._error();if(list.length===4){this.a(parseFloat(list.pop()));if(this.error)return this;}for(var i=list.length-1;i>=0;i--){list[i]=parseInt(list[i],10);if(isNaN(list[i]))return this._error();}if(color.match(/^rgb/)){return this.fromRgb({r:list[0],g:list[1],b:list[2]});}else if(color.match(/^hsv/)){return this.fromHsv({h:list[0],s:list[1],v:list[2]});}else{return this.fromHsl({h:list[0],s:list[1],l:list[2]});}}else{return this.fromHex(color);}},fromRgb:function(rgb,preserve){if(typeof rgb!=='object'||rgb.r===undef||rgb.g===undef||rgb.b===undef)return this._error();this.error=false;return this.fromInt(parseInt((rgb.r<<16)+(rgb.g<<8)+rgb.b,10),preserve);},fromHex:function(color){color=color.replace(/^#/,'').replace(/^0x/,'');if(color.length===3){color=color[0]+color[0]+color[1]+color[1]+color[2]+color[2];}this.error=!/^[0-9A-F]{6}$/i.test(color);return this.fromInt(parseInt(color,16));},fromHsl:function(hsl){var r,g,b,q,p,h,s,l;if(typeof hsl!=='object'||hsl.h===undef||hsl.s===undef||hsl.l===undef)return this._error();this._hsl=hsl;this._hSpace='hsl';h=hsl.h/360;s=hsl.s/100;l=hsl.l/100;if(s===0){r=g=b=l;}else{q=l<0.5?l*(1+s):l+s-l*s;p=2*l-q;r=this.hue2rgb(p,q,h+1/3);g=this.hue2rgb(p,q,h);b=this.hue2rgb(p,q,h-1/3);}return this.fromRgb({r:r*255,g:g*255,b:b*255},true);},fromHsv:function(hsv){var h,s,v,r,g,b,i,f,p,q,t;if(typeof hsv!=='object'||hsv.h===undef||hsv.s===undef||hsv.v===undef)return this._error();this._hsv=hsv;this._hSpace='hsv';h=hsv.h/360;s=hsv.s/100;v=hsv.v/100;i=Math.floor(h*6);f=h*6-i;p=v*(1-s);q=v*(1-f*s);t=v*(1-(1-f)*s);switch(i%6){case 0:r=v;g=t;b=p;break;case 1:r=q;g=v;b=p;break;case 2:r=p;g=v;b=t;break;case 3:r=p;g=q;b=v;break;case 4:r=t;g=p;b=v;break;case 5:r=v;g=p;b=q;break;}return this.fromRgb({r:r*255,g:g*255,b:b*255},true);},fromInt:function(color,preserve){this._color=parseInt(color,10);if(isNaN(this._color))this._color=0;if(this._color>16777215)this._color=16777215;else if(this._color<0)this._color=0;if(preserve===undef){this._hsv.h=this._hsv.s=this._hsl.h=this._hsl.s=0;}return this;},hue2rgb:function(p,q,t){if(t<0){t+=1;}if(t>1){t-=1;}if(t<1/6){return p+(q-p)*6*t;}if(t<1/2){return q;}if(t<2/3){return p+(q-p)*(2/3-t)*6;}return p;},toString:function(){var hex=parseInt(this._color,10).toString(16);if(this.error)return'';if(hex.length<6){for(var i=6-hex.length-1;i>=0;i--){hex='0'+hex;}}return'#'+hex;},toCSS:function(type,alpha){type=type||'hex';alpha=parseFloat(alpha||this._alpha);switch(type){case'rgb':case'rgba':var rgb=this.toRgb();if(alpha<1){return"rgba( "+rgb.r+", "+rgb.g+", "+rgb.b+", "+alpha+" )";}else{return"rgb( "+rgb.r+", "+rgb.g+", "+rgb.b+" )";}break;case'hsl':case'hsla':var hsl=this.toHsl();if(alpha<1){return"hsla( "+hsl.h+", "+hsl.s+"%, "+hsl.l+"%, "+alpha+" )";}else{return"hsl( "+hsl.h+", "+hsl.s+"%, "+hsl.l+"% )";}break;default:return this.toString();}},toRgb:function(){return{r:255&(this._color>>16),g:255&(this._color>>8),b:255&(this._color)};},toHsl:function(){var rgb=this.toRgb();var r=rgb.r/255,g=rgb.g/255,b=rgb.b/255;var max=Math.max(r,g,b),min=Math.min(r,g,b);var h,s,l=(max+min)/2;if(max===min){h=s=0;}else{var d=max-min;s=l>0.5?d/(2-max-min):d/(max+min);switch(max){case r:h=(g-b)/d+(glum2){return(lum1+0.05)/(lum2+0.05);}else{return(lum2+0.05)/(lum1+0.05);}},getMaxContrastColor:function(){var lum=this.toLuminosity();var hex=(lum>=0.5)?'000000':'ffffff';return new Color(hex);},getReadableContrastingColor:function(bgColor,minContrast){if(!bgColor instanceof Color){return this;}var targetContrast=(minContrast===undef)?5:minContrast;var contrast=bgColor.getDistanceLuminosityFrom(this);var maxContrastColor=bgColor.getMaxContrastColor();var maxContrast=maxContrastColor.getDistanceLuminosityFrom(bgColor);if(maxContrast<=targetContrast){return maxContrastColor;}else if(contrast>=targetContrast){return this;}var incr=(0===maxContrastColor.toInt())?-1:1;while(contrastprop.range[1])?prop.range[1]:val;color[key]=val;return this._spaceFunc('from',prop.space,color);};},_spaceFunc:function(dir,s,val){var space=s||this._hSpace,funcName=dir+space.charAt(0).toUpperCase()+space.substr(1);return this[funcName](val);}};var shortProps={h:{mod:360},s:{range:[0,100]},l:{space:'hsl',range:[0,100]},v:{space:'hsv',range:[0,100]},r:{space:'rgb',range:[0,255]},g:{space:'rgb',range:[0,255]},b:{space:'rgb',range:[0,255]}};for(var key in shortProps){if(shortProps.hasOwnProperty(key))Color.fn[key]=Color.fn._partial(key);}if(typeof exports==='object')module.exports=Color;else global.Color=Color;}(this));jQuery(function(){function applyPreview(target){var $style=target.jQuery('link[rel=stylesheet][href*="lib/exe/css.php"]');$style.attr('href','');var $loader=target.jQuery('#plugin__styling_loader');if(!$loader.length){$loader=target.jQuery(''+LANG.plugins.styling.loader+'
');$loader.css({'position':'absolute','width':'100%','height':'100%','top':0,'left':0,'z-index':5000,'background-color':'#fff','opacity':'0.7','color':'#000','font-size':'2.5em','text-align':'center','line-height':1.5,'padding-top':'2em'});target.jQuery('body').append($loader);}setTimeout(function(){var now=new Date().getTime();$style.attr('href',DOKU_BASE+'lib/exe/css.php?preview=1&tseed='+now);},500);}var doreload=1;var $styling_plugin=jQuery('#plugin__styling');if(!$styling_plugin.length){if(DokuCookie.getValue('styling_plugin')==1){applyPreview(window);}return;}$styling_plugin.find('.color').iris({});if(!$styling_plugin.hasClass('ispopup')){var $form=$styling_plugin.find('form.styling').first();var $btn=jQuery('');$form.prepend($btn);$btn.click(function(e){var windowFeatures="menubar=no,location=no,resizable=yes,scrollbars=yes,status=false,width=500,height=500";window.open(DOKU_BASE+'lib/plugins/styling/popup.php','styling_popup',windowFeatures);e.preventDefault();e.stopPropagation();}).wrap('');return;}window.onunload=function(e){if(doreload){window.opener.DokuCookie.setValue('styling_plugin',0);window.opener.document.location.reload();}return null;};jQuery(':button').click(function(e){doreload=false;});applyPreview(window.opener);window.opener.DokuCookie.setValue('styling_plugin',1);});jQuery(function(){jQuery('#usrmgr__del').click(function(){return confirm(LANG.del_confirm);});});var dw_acl={init:function(){var $tree;if(jQuery('#acl_manager').length===0){return;}jQuery('#acl__user select').change(dw_acl.userselhandler);jQuery('#acl__user button').click(dw_acl.loadinfo);$tree=jQuery('#acl__tree');$tree.dw_tree({toggle_selector:'img',load_data:function(show_sublist,$clicky){var $frm=jQuery('#acl__detail form');jQuery.post(DOKU_BASE+'lib/exe/ajax.php',jQuery.extend(dw_acl.parseatt($clicky.parent().find('a')[0].search),{call:'plugin_acl',ajax:'tree',current_ns:$frm.find('input[name=ns]').val(),current_id:$frm.find('input[name=id]').val()}),show_sublist,'html');},toggle_display:function($clicky,opening){$clicky.attr('src',DOKU_BASE+'lib/images/'+(opening?'minus':'plus')+'.gif');}});$tree.delegate('a','click',dw_acl.treehandler);},userselhandler:function(){jQuery('#acl__user input').toggle(this.value==='__g__'||this.value==='__u__');dw_acl.loadinfo();},loadinfo:function(){jQuery('#acl__info').attr('role','alert').html('
').load(DOKU_BASE+'lib/exe/ajax.php',jQuery('#acl__detail form').serialize()+'&call=plugin_acl&ajax=info');return false;},parseatt:function(str){if(str[0]==='?'){str=str.substr(1);}var attributes={};var all=str.split('&');for(var i=0;i