var Prototype={Version:"1.3.1",emptyFunction:function(){}};var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};var Abstract=new Object();Object.extend=function(_1,_2){for(property in _2){_1[property]=_2[property];}return _1;};Object.prototype.extend=function(_3){return Object.extend.apply(this,[this,_3]);};Function.prototype.bind=function(_4){var _5=this;return function(){_5.apply(_4,arguments);};};Function.prototype.bindAsEventListener=function(_6){var _7=this;return function(_8){_7.call(_6,_8||window.event);};};Number.prototype.toColorPart=function(){var _9=this.toString(16);if(this<16){return "0"+_9;}return _9;};var Try={these:function(){var _10;for(var i=0;i<arguments.length;i++){var _12=arguments[i];try{_10=_12();break;}catch(e){}}return _10;}};var PeriodicalExecuter=Class.create();PeriodicalExecuter.prototype={initialize:function(_13,_14){this.callback=_13;this.frequency=_14;this.currentlyExecuting=false;this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.callback();}finally{this.currentlyExecuting=false;}}}};function $(){var _15=new Array();for(var i=0;i<arguments.length;i++){var _16=arguments[i];if(typeof _16=="string"){_16=document.getElementById(_16);}if(arguments.length==1){return _16;}_15.push(_16);}return _15;}if(!Array.prototype.push){Array.prototype.push=function(){var _17=this.length;for(var i=0;i<arguments.length;i++){this[_17+i]=arguments[i];}return this.length;};}if(!Function.prototype.apply){Function.prototype.apply=function(_18,_19){var _20=new Array();if(!_18){_18=window;}if(!_19){_19=new Array();}for(var i=0;i<_19.length;i++){_20[i]="parameters["+i+"]";}_18.__apply__=this;var _21=eval("object.__apply__("+_20.join(", ")+")");_18.__apply__=null;return _21;};}String.prototype.extend({stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"");},escapeHTML:function(){var div=document.createElement("div");var _23=document.createTextNode(this);div.appendChild(_23);return div.innerHTML;},unescapeHTML:function(){var div=document.createElement("div");div.innerHTML=this.stripTags();return div.childNodes[0].nodeValue;}});var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject("Msxml2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");},function(){return new XMLHttpRequest();})||false;}};Ajax.Base=function(){};Ajax.Base.prototype={setOptions:function(_24){this.options={method:"post",asynchronous:true,parameters:""}.extend(_24||{});},responseIsSuccess:function(){return this.transport.status==undefined||this.transport.status==0||(this.transport.status>=200&&this.transport.status<300);},responseIsFailure:function(){return !this.responseIsSuccess();}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];Ajax.Request.prototype=(new Ajax.Base()).extend({initialize:function(url,_26){this.transport=Ajax.getTransport();this.setOptions(_26);this.request(url);},request:function(url){var _27=this.options.parameters||"";if(_27.length>0){_27+="&_=";}try{if(this.options.method=="get"){url+="?"+_27;}this.transport.open(this.options.method,url,this.options.asynchronous);if(this.options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);setTimeout((function(){this.respondToReadyState(1);}).bind(this),10);}this.setRequestHeaders();var _28=this.options.postBody?this.options.postBody:_27;this.transport.send(this.options.method=="post"?_28:null);}catch(e){}},setRequestHeaders:function(){var _29=["X-Requested-With","XMLHttpRequest","X-Prototype-Version",Prototype.Version];if(this.options.method=="post"){_29.push("Content-type","application/x-www-form-urlencoded");if(this.transport.overrideMimeType){_29.push("Connection","close");}}if(this.options.requestHeaders){_29.push.apply(_29,this.options.requestHeaders);}for(var i=0;i<_29.length;i+=2){this.transport.setRequestHeader(_29[i],_29[i+1]);}},onStateChange:function(){var _30=this.transport.readyState;if(_30!=1){this.respondToReadyState(this.transport.readyState);}},respondToReadyState:function(_31){var _32=Ajax.Request.Events[_31];if(_32=="Complete"){(this.options["on"+this.transport.status]||this.options["on"+(this.responseIsSuccess()?"Success":"Failure")]||Prototype.emptyFunction)(this.transport);}(this.options["on"+_32]||Prototype.emptyFunction)(this.transport);if(_32=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction;}}});Ajax.Updater=Class.create();Ajax.Updater.ScriptFragment="(?:<script.*?>)((\n|.)*?)(?:</script>)";Ajax.Updater.prototype.extend(Ajax.Request.prototype).extend({initialize:function(_33,url,_34){this.containers={success:_33.success?$(_33.success):$(_33),failure:_33.failure?$(_33.failure):(_33.success?null:$(_33))};this.transport=Ajax.getTransport();this.setOptions(_34);var _35=this.options.onComplete||Prototype.emptyFunction;this.options.onComplete=(function(){this.updateContent();_35(this.transport);}).bind(this);this.request(url);},updateContent:function(){var _36=this.responseIsSuccess()?this.containers.success:this.containers.failure;var _37=new RegExp(Ajax.Updater.ScriptFragment,"img");var _38=this.transport.responseText.replace(_37,"");var _39=this.transport.responseText.match(_37);if(_36){if(this.options.insertion){new this.options.insertion(_36,_38);}else{_36.innerHTML=_38;}}if(this.responseIsSuccess()){if(this.onComplete){setTimeout((function(){this.onComplete(this.transport);}).bind(this),10);}}if(this.options.evalScripts&&_39){_37=new RegExp(Ajax.Updater.ScriptFragment,"im");setTimeout((function(){for(var i=0;i<_39.length;i++){eval(_39[i].match(_37)[1]);}}).bind(this),10);}}});Ajax.PeriodicalUpdater=Class.create();Ajax.PeriodicalUpdater.prototype=(new Ajax.Base()).extend({initialize:function(_40,url,_41){this.setOptions(_41);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=1;this.updater={};this.container=_40;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Ajax.emptyFunction).apply(this,arguments);},updateComplete:function(_42){if(this.options.decay){this.decay=(_42.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=_42.responseText;}this.timer=setTimeout(this.onTimerEvent.bind(this),this.decay*this.frequency*1000);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});document.getElementsByClassName=function(_43){var _44=document.getElementsByTagName("*")||document.all;var _45=new Array();for(var i=0;i<_44.length;i++){var _46=_44[i];var _47=_46.className.split(" ");for(var j=0;j<_47.length;j++){if(_47[j]==_43){_45.push(_46);break;}}}return _45;};if(!window.Element){var Element=new Object();}Object.extend(Element,{toggle:function(){for(var i=0;i<arguments.length;i++){var _49=$(arguments[i]);_49.style.display=(_49.style.display=="none"?"":"none");}},hide:function(){for(var i=0;i<arguments.length;i++){var _50=$(arguments[i]);_50.style.display="none";}},show:function(){for(var i=0;i<arguments.length;i++){var _51=$(arguments[i]);_51.style.display="";}},remove:function(_52){_52=$(_52);_52.parentNode.removeChild(_52);},getHeight:function(_53){_53=$(_53);return _53.offsetHeight;},hasClassName:function(_54,_55){_54=$(_54);if(!_54){return;}var a=_54.className.split(" ");for(var i=0;i<a.length;i++){if(a[i]==_55){return true;}}return false;},addClassName:function(_57,_58){_57=$(_57);Element.removeClassName(_57,_58);_57.className+=" "+_58;},removeClassName:function(_59,_60){_59=$(_59);if(!_59){return;}var _61="";var a=_59.className.split(" ");for(var i=0;i<a.length;i++){if(a[i]!=_60){if(i>0){_61+=" ";}_61+=a[i];}}_59.className=_61;},cleanWhitespace:function(_62){var _62=$(_62);for(var i=0;i<_62.childNodes.length;i++){var _63=_62.childNodes[i];if(_63.nodeType==3&&!/\S/.test(_63.nodeValue)){Element.remove(_63);}}}});var Toggle=new Object();Toggle.display=Element.toggle;Abstract.Insertion=function(_64){this.adjacency=_64;};Abstract.Insertion.prototype={initialize:function(_65,_66){this.element=$(_65);this.content=_66;if(this.adjacency&&this.element.insertAdjacentHTML){this.element.insertAdjacentHTML(this.adjacency,this.content);}else{this.range=this.element.ownerDocument.createRange();if(this.initializeRange){this.initializeRange();}this.fragment=this.range.createContextualFragment(this.content);this.insertContent();}}};var Insertion=new Object();Insertion.Before=Class.create();Insertion.Before.prototype=(new Abstract.Insertion("beforeBegin")).extend({initializeRange:function(){this.range.setStartBefore(this.element);},insertContent:function(){this.element.parentNode.insertBefore(this.fragment,this.element);}});Insertion.Top=Class.create();Insertion.Top.prototype=(new Abstract.Insertion("afterBegin")).extend({initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(true);},insertContent:function(){this.element.insertBefore(this.fragment,this.element.firstChild);}});Insertion.Bottom=Class.create();Insertion.Bottom.prototype=(new Abstract.Insertion("beforeEnd")).extend({initializeRange:function(){this.range.selectNodeContents(this.element);this.range.collapse(this.element);},insertContent:function(){this.element.appendChild(this.fragment);}});Insertion.After=Class.create();Insertion.After.prototype=(new Abstract.Insertion("afterEnd")).extend({initializeRange:function(){this.range.setStartAfter(this.element);},insertContent:function(){this.element.parentNode.insertBefore(this.fragment,this.element.nextSibling);}});var Field={clear:function(){for(var i=0;i<arguments.length;i++){$(arguments[i]).value="";}},focus:function(_67){$(_67).focus();},present:function(){for(var i=0;i<arguments.length;i++){if($(arguments[i]).value==""){return false;}}return true;},select:function(_68){$(_68).select();},activate:function(_69){$(_69).focus();$(_69).select();}};var Form={serialize:function(_70){var _71=Form.getElements($(_70));var _72=new Array();for(var i=0;i<_71.length;i++){var _73=Form.Element.serialize(_71[i]);if(_73){_72.push(_73);}}return _72.join("&");},getElements:function(_74){var _74=$(_74);var _75=new Array();for(tagName in Form.Element.Serializers){var _76=_74.getElementsByTagName(tagName);for(var j=0;j<_76.length;j++){_75.push(_76[j]);}}return _75;},getInputs:function(_77,_78,_79){var _77=$(_77);var _80=_77.getElementsByTagName("input");if(!_78&&!_79){return _80;}var _81=new Array();for(var i=0;i<_80.length;i++){var _82=_80[i];if((_78&&_82.type!=_78)||(_79&&_82.name!=_79)){continue;}_81.push(_82);}return _81;},disable:function(_83){var _84=Form.getElements(_83);for(var i=0;i<_84.length;i++){var _85=_84[i];_85.blur();_85.disabled="true";}},enable:function(_86){var _87=Form.getElements(_86);for(var i=0;i<_87.length;i++){var _88=_87[i];_88.disabled="";}},focusFirstElement:function(_89){var _89=$(_89);var _90=Form.getElements(_89);for(var i=0;i<_90.length;i++){var _91=_90[i];if(_91.type!="hidden"&&!_91.disabled){Field.activate(_91);break;}}},reset:function(_92){$(_92).reset();}};Form.Element={serialize:function(_93){var _93=$(_93);var _94=_93.tagName.toLowerCase();var _95=Form.Element.Serializers[_94](_93);if(_95){return encodeURIComponent(_95[0])+"="+encodeURIComponent(_95[1]);}},getValue:function(_96){var _96=$(_96);var _97=_96.tagName.toLowerCase();var _98=Form.Element.Serializers[_97](_96);if(_98){return _98[1];}}};Form.Element.Serializers={input:function(_99){switch(_99.type.toLowerCase()){case "submit":case "hidden":case "password":case "text":return Form.Element.Serializers.textarea(_99);case "checkbox":case "radio":return Form.Element.Serializers.inputSelector(_99);}return false;},inputSelector:function(_100){if(_100.checked){return [_100.name,_100.value];}},textarea:function(_101){return [_101.name,_101.value];},select:function(_102){var _103="";if(_102.type=="select-one"){var _104=_102.selectedIndex;if(_104>=0){_103=_102.options[_104].value||_102.options[_104].text;}}else{_103=new Array();for(var i=0;i<_102.length;i++){var opt=_102.options[i];if(opt.selected){_103.push(opt.value||opt.text);}}}return [_102.name,_103];}};var $F=Form.Element.getValue;Abstract.TimedObserver=function(){};Abstract.TimedObserver.prototype={initialize:function(_106,_107,_108){this.frequency=_107;this.element=$(_106);this.callback=_108;this.lastValue=this.getValue();this.registerCallback();},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1000);},onTimerEvent:function(){var _109=this.getValue();if(this.lastValue!=_109){this.callback(this.element,_109);this.lastValue=_109;}}};Form.Element.Observer=Class.create();Form.Element.Observer.prototype=(new Abstract.TimedObserver()).extend({getValue:function(){return Form.Element.getValue(this.element);}});Form.Observer=Class.create();Form.Observer.prototype=(new Abstract.TimedObserver()).extend({getValue:function(){return Form.serialize(this.element);}});Abstract.EventObserver=function(){};Abstract.EventObserver.prototype={initialize:function(_110,_111){this.element=$(_110);this.callback=_111;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks();}else{this.registerCallback(this.element);}},onElementEvent:function(){var _112=this.getValue();if(this.lastValue!=_112){this.callback(this.element,_112);this.lastValue=_112;}},registerFormCallbacks:function(){var _113=Form.getElements(this.element);for(var i=0;i<_113.length;i++){this.registerCallback(_113[i]);}},registerCallback:function(_114){if(_114.type){switch(_114.type.toLowerCase()){case "checkbox":case "radio":_114.target=this;_114.prev_onclick=_114.onclick||Prototype.emptyFunction;_114.onclick=function(){this.prev_onclick();this.target.onElementEvent();};break;case "password":case "text":case "textarea":case "select-one":case "select-multiple":_114.target=this;_114.prev_onchange=_114.onchange||Prototype.emptyFunction;_114.onchange=function(){this.prev_onchange();this.target.onElementEvent();};break;}}}};Form.Element.EventObserver=Class.create();Form.Element.EventObserver.prototype=(new Abstract.EventObserver()).extend({getValue:function(){return Form.Element.getValue(this.element);}});Form.EventObserver=Class.create();Form.EventObserver.prototype=(new Abstract.EventObserver()).extend({getValue:function(){return Form.serialize(this.element);}});if(!window.Event){var Event=new Object();}Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(_115){return _115.target||_115.srcElement;},isLeftClick:function(_116){return (((_116.which)&&(_116.which==1))||((_116.button)&&(_116.button==1)));},pointerX:function(_117){return _117.pageX||(_117.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft));},pointerY:function(_118){return _118.pageY||(_118.clientY+(document.documentElement.scrollTop||document.body.scrollTop));},stop:function(_119){if(_119.preventDefault){_119.preventDefault();_119.stopPropagation();}else{_119.returnValue=false;}},findElement:function(_120,_121){var _122=Event.element(_120);while(_122.parentNode&&(!_122.tagName||(_122.tagName.toUpperCase()!=_121.toUpperCase()))){_122=_122.parentNode;}return _122;},observers:false,_observeAndCache:function(_123,name,_125,_126){if(!this.observers){this.observers=[];}if(_123.addEventListener){this.observers.push([_123,name,_125,_126]);_123.addEventListener(name,_125,_126);}else{if(_123.attachEvent){this.observers.push([_123,name,_125,_126]);_123.attachEvent("on"+name,_125);}}},unloadCache:function(){if(!Event.observers){return;}for(var i=0;i<Event.observers.length;i++){Event.stopObserving.apply(this,Event.observers[i]);Event.observers[i][0]=null;}Event.observers=false;},observe:function(_127,name,_128,_129){var _127=$(_127);_129=_129||false;if(name=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_127.attachEvent)){name="keydown";}this._observeAndCache(_127,name,_128,_129);},stopObserving:function(_130,name,_131,_132){var _130=$(_130);_132=_132||false;if(name=="keypress"&&((navigator.appVersion.indexOf("AppleWebKit")>0)||_130.detachEvent)){name="keydown";}if(_130.removeEventListener){_130.removeEventListener(name,_131,_132);}else{if(_130.detachEvent){_130.detachEvent("on"+name,_131);}}}});Event.observe(window,"unload",Event.unloadCache,false);var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0;},realOffset:function(_133){var _134=0,valueL=0;do{_134+=_133.scrollTop||0;valueL+=_133.scrollLeft||0;_133=_133.parentNode;}while(_133);return [valueL,_134];},cumulativeOffset:function(_135){var _136=0,valueL=0;do{_136+=_135.offsetTop||0;valueL+=_135.offsetLeft||0;_135=_135.offsetParent;}while(_135);return [valueL,_136];},within:function(_137,x,y){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(_137,x,y);}this.xcomp=x;this.ycomp=y;this.offset=this.cumulativeOffset(_137);return (y>=this.offset[1]&&y<this.offset[1]+_137.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+_137.offsetWidth);},withinIncludingScrolloffsets:function(_140,x,y){var _141=this.realOffset(_140);this.xcomp=x+_141[0]-this.deltaX;this.ycomp=y+_141[1]-this.deltaY;this.offset=this.cumulativeOffset(_140);return (this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+_140.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+_140.offsetWidth);},overlap:function(mode,_143){if(!mode){return 0;}if(mode=="vertical"){return ((this.offset[1]+_143.offsetHeight)-this.ycomp)/_143.offsetHeight;}if(mode=="horizontal"){return ((this.offset[0]+_143.offsetWidth)-this.xcomp)/_143.offsetWidth;}},clone:function(_144,_145){_144=$(_144);_145=$(_145);_145.style.position="absolute";var _146=this.cumulativeOffset(_144);_145.style.top=_146[1]+"px";_145.style.left=_146[0]+"px";_145.style.width=_144.offsetWidth+"px";_145.style.height=_144.offsetHeight+"px";}};var Rico={Version:"1.1-beta2"};Rico.ArrayExtensions=new Array();if(Object.prototype.extend){Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Object.prototype.extend;}if(Array.prototype.push){Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.push;}if(!Array.prototype.remove){Array.prototype.remove=function(dx){if(isNaN(dx)||dx>this.length){return false;}for(var i=0,n=0;i<this.length;i++){if(i!=dx){this[n++]=this[i];}}this.length-=1;};Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.remove;}if(!Array.prototype.removeItem){Array.prototype.removeItem=function(_3){for(var i=0;i<this.length;i++){if(this[i]==_3){this.remove(i);break;}}};Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.removeItem;}if(!Array.prototype.indices){Array.prototype.indices=function(){var _4=new Array();for(index in this){var _5=false;for(var i=0;i<Rico.ArrayExtensions.length;i++){if(this[index]==Rico.ArrayExtensions[i]){_5=true;break;}}if(!_5){_4[_4.length]=index;}}return _4;};Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.indices;}if(window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){if(!Document.prototype.loadXML){Document.prototype.loadXML=function(s){var _7=(new DOMParser()).parseFromString(s,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild);}for(var i=0;i<_7.childNodes.length;i++){this.appendChild(this.importNode(_7.childNodes[i],true));}};}Document.prototype.__defineGetter__("xml",function(){return (new XMLSerializer()).serializeToString(this);});}document.getElementsByTagAndClassName=function(_8,_9){if(_8==null){_8="*";}var _10=document.getElementsByTagName(_8)||document.all;var _11=new Array();if(_9==null){return _10;}for(var i=0;i<_10.length;i++){var _12=_10[i];var _13=_12.className.split(" ");for(var j=0;j<_13.length;j++){if(_13[j]==_9){_11.push(_12);break;}}}return _11;};Rico.Accordion=Class.create();Rico.Accordion.prototype={initialize:function(_15,_16){this.container=$(_15);this.lastExpandedTab=null;this.accordionTabs=new Array();this.setOptions(_16);this._attachBehaviors();this.container.style.borderBottom="1px solid "+this.options.borderColor;for(var i=1;i<this.accordionTabs.length;i++){this.accordionTabs[i].collapse();this.accordionTabs[i].content.style.display="none";}this.lastExpandedTab=this.accordionTabs[0];this.lastExpandedTab.content.style.height=this.options.panelHeight+"px";this.lastExpandedTab.showExpanded();this.lastExpandedTab.titleBar.style.fontWeight=this.options.expandedFontWeight;},setOptions:function(_17){this.options={expandedBg:"#666666",hoverBg:"#999999",collapsedBg:"#666666",expandedTextColor:"#ffffff",expandedFontWeight:"bold",hoverTextColor:"#ffffff",collapsedTextColor:"#ffcc00",collapsedFontWeight:"normal",hoverTextColor:"#ffffff",borderColor:"#999999",panelHeight:200,onHideTab:null,onShowTab:null}.extend(_17||{});},showTabByIndex:function(_18,_19){var _20=arguments.length==1?true:_19;this.showTab(this.accordionTabs[_18],_20);},showTab:function(_21,_22){var _23=arguments.length==1?true:_22;if(this.options.onHideTab){this.options.onHideTab(this.lastExpandedTab);}this.lastExpandedTab.showCollapsed();var _24=this;var _25=this.lastExpandedTab;this.lastExpandedTab.content.style.height=(this.options.panelHeight-1)+"px";_21.content.style.display="";_21.titleBar.style.fontWeight=this.options.expandedFontWeight;if(_23){new Effect.AccordionSize(this.lastExpandedTab.content,_21.content,1,this.options.panelHeight,100,10,{complete:function(){_24.showTabDone(_25);}});this.lastExpandedTab=_21;}else{this.lastExpandedTab.content.style.height="1px";_21.content.style.height=this.options.panelHeight+"px";this.lastExpandedTab=_21;this.showTabDone(_25);}},showTabDone:function(_26){_26.content.style.display="none";this.lastExpandedTab.showExpanded();if(this.options.onShowTab){this.options.onShowTab(this.lastExpandedTab);}},_attachBehaviors:function(){var _27=this._getDirectChildrenByTag(this.container,"DIV");for(var i=0;i<_27.length;i++){var _28=this._getDirectChildrenByTag(_27[i],"DIV");if(_28.length!=2){continue;}var _29=_28[0];var _30=_28[1];this.accordionTabs.push(new Rico.Accordion.Tab(this,_29,_30));}},_getDirectChildrenByTag:function(e,_32){var _33=new Array();var _34=e.childNodes;for(var i=0;i<_34.length;i++){if(_34[i]&&_34[i].tagName&&_34[i].tagName==_32){_33.push(_34[i]);}}return _33;}};Rico.Accordion.Tab=Class.create();Rico.Accordion.Tab.prototype={initialize:function(_35,_36,_37){this.accordion=_35;this.titleBar=_36;this.content=_37;this._attachBehaviors();},collapse:function(){this.showCollapsed();this.content.style.height="1px";},showCollapsed:function(){this.expanded=false;this.titleBar.style.backgroundColor=this.accordion.options.collapsedBg;this.titleBar.style.color=this.accordion.options.collapsedTextColor;this.titleBar.style.fontWeight=this.accordion.options.collapsedFontWeight;this.content.style.overflow="hidden";},showExpanded:function(){this.expanded=true;this.titleBar.style.backgroundColor=this.accordion.options.expandedBg;this.titleBar.style.color=this.accordion.options.expandedTextColor;this.content.style.overflow="visible";},titleBarClicked:function(e){if(this.accordion.lastExpandedTab==this){return;}this.accordion.showTab(this);},hover:function(e){this.titleBar.style.backgroundColor=this.accordion.options.hoverBg;this.titleBar.style.color=this.accordion.options.hoverTextColor;},unhover:function(e){if(this.expanded){this.titleBar.style.backgroundColor=this.accordion.options.expandedBg;this.titleBar.style.color=this.accordion.options.expandedTextColor;}else{this.titleBar.style.backgroundColor=this.accordion.options.collapsedBg;this.titleBar.style.color=this.accordion.options.collapsedTextColor;}},_attachBehaviors:function(){this.content.style.border="1px solid "+this.accordion.options.borderColor;this.content.style.borderTopWidth="0px";this.content.style.borderBottomWidth="0px";this.content.style.margin="0px";this.titleBar.onclick=this.titleBarClicked.bindAsEventListener(this);this.titleBar.onmouseover=this.hover.bindAsEventListener(this);this.titleBar.onmouseout=this.unhover.bindAsEventListener(this);}};Rico.AjaxEngine=Class.create();Rico.AjaxEngine.prototype={initialize:function(){this.ajaxElements=new Array();this.ajaxObjects=new Array();this.requestURLS=new Array();},registerAjaxElement:function(_38,_39){if(arguments.length==1){_39=$(_38);}this.ajaxElements[_38]=_39;},registerAjaxObject:function(_40,_41){this.ajaxObjects[_40]=_41;},registerRequest:function(_42,_43){this.requestURLS[_42]=_43;},sendRequest:function(_44){var _45=this.requestURLS[_44];if(_45==null){return;}var _46="";if(arguments.length>1){_46=this._createQueryString(arguments,1);}new Ajax.Request(_45,this._requestOptions(_46));},sendRequestWithData:function(_47,_48){var _49=this.requestURLS[_47];if(_49==null){return;}var _50="";if(arguments.length>2){_50=this._createQueryString(arguments,2);}new Ajax.Request(_49+"?"+_50,this._requestOptions(null,_48));},sendRequestAndUpdate:function(_51,_52,_53){var _54=this.requestURLS[_51];if(_54==null){return;}var _55="";if(arguments.length>3){_55=this._createQueryString(arguments,3);}var _56=this._requestOptions(_55);_56.onComplete=null;_56.extend(_53);new Ajax.Updater(_52,_54,_56);},sendRequestWithDataAndUpdate:function(_57,_58,_59,_60){var _61=this.requestURLS[_57];if(_61==null){return;}var _62="";if(arguments.length>4){_62=this._createQueryString(arguments,4);}var _63=this._requestOptions(_62,_58);_63.onComplete=null;_63.extend(_60);new Ajax.Updater(_59,_61+"?"+_62,_63);},_requestOptions:function(_64,_65){var _66=this;var _67=["X-Rico-Version",Rico.Version];var _68="post";if(arguments[1]){_67.push("Content-type","text/xml");}else{_68="get";}return {requestHeaders:_67,parameters:_64,postBody:arguments[1]?_65:null,method:_68,onComplete:_66._onRequestComplete.bind(_66)};},_createQueryString:function(_69,_70){var _71="";for(var i=_70;i<_69.length;i++){if(i!=_70){_71+="&";}var _72=_69[i];if(_72.name!=undefined&&_72.value!=undefined){_71+=_72.name+"="+escape(_72.value);}else{var _73=_72.indexOf("=");var _74=_72.substring(0,_73);var _75=_72.substring(_73+1);_71+=_74+"="+escape(_75);}}return _71;},_onRequestComplete:function(_76){if(_76.status!=200){return;}var _77=_76.responseXML.getElementsByTagName("ajax-response");if(_77==null||_77.length!=1){return;}this._processAjaxResponse(_77[0].childNodes);},_processAjaxResponse:function(_78){for(var i=0;i<_78.length;i++){var _79=_78[i];if(_79.nodeType!=1){continue;}var _80=_79.getAttribute("type");var _81=_79.getAttribute("id");if(_80=="object"){this._processAjaxObjectUpdate(this.ajaxObjects[_81],_79);}else{if(_80=="element"){this._processAjaxElementUpdate(this.ajaxElements[_81],_79);}else{alert("unrecognized AjaxResponse type : "+_80);}}}},_processAjaxObjectUpdate:function(_82,_83){_82.ajaxUpdate(_83);},_processAjaxElementUpdate:function(_84,_85){_84.innerHTML=RicoUtil.getContentAsString(_85);}};var ajaxEngine=new Rico.AjaxEngine();Rico.Color=Class.create();Rico.Color.prototype={initialize:function(red,_87,_88){this.rgb={r:red,g:_87,b:_88};},setRed:function(r){this.rgb.r=r;},setGreen:function(g){this.rgb.g=g;},setBlue:function(b){this.rgb.b=b;},setHue:function(h){var hsb=this.asHSB();hsb.h=h;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setSaturation:function(s){var hsb=this.asHSB();hsb.s=s;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},setBrightness:function(b){var hsb=this.asHSB();hsb.b=b;this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,hsb.b);},darken:function(_94){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-_94,0));},brighten:function(_95){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+_95,1));},blend:function(_96){this.rgb.r=Math.floor((this.rgb.r+_96.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+_96.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+_96.rgb.b)/2);},isBright:function(){var hsb=this.asHSB();return this.asHSB().b>0.5;},isDark:function(){return !this.isBright();},asRGB:function(){return "rgb("+this.rgb.r+","+this.rgb.g+","+this.rgb.b+")";},asHex:function(){return "#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart();},asHSB:function(){return Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b);},toString:function(){return this.asHex();}};Rico.Color.createFromHex=function(_97){if(_97.indexOf("#")==0){_97=_97.substring(1);}var red=_97.substring(0,2);var _98=_97.substring(2,4);var _99=_97.substring(4,6);return new Rico.Color(parseInt(red,16),parseInt(_98,16),parseInt(_99,16));};Rico.Color.createColorFromBackground=function(elem){var _101=RicoUtil.getElementsComputedStyle($(elem),"backgroundColor","background-color");if(_101=="transparent"&&elem.parent){return Rico.Color.createColorFromBackground(elem.parent);}if(_101==null){return new Rico.Color(255,255,255);}if(_101.indexOf("rgb(")==0){var _102=_101.substring(4,_101.length-1);var _103=_102.split(",");return new Rico.Color(parseInt(_103[0]),parseInt(_103[1]),parseInt(_103[2]));}else{if(_101.indexOf("#")==0){var _104=parseInt(_101.substring(1,3),16);var _105=parseInt(_101.substring(3,5),16);var _106=parseInt(_101.substring(5),16);return new Rico.Color(_104,_105,_106);}else{return new Rico.Color(255,255,255);}}};Rico.Color.HSBtoRGB=function(hue,_108,_109){var red=0;var _110=0;var blue=0;if(_108==0){red=parseInt(_109*255+0.5);_110=red;blue=red;}else{var h=(hue-Math.floor(hue))*6;var f=h-Math.floor(h);var p=_109*(1-_108);var q=_109*(1-_108*f);var t=_109*(1-(_108*(1-f)));switch(parseInt(h)){case 0:red=(_109*255+0.5);_110=(t*255+0.5);blue=(p*255+0.5);break;case 1:red=(q*255+0.5);_110=(_109*255+0.5);blue=(p*255+0.5);break;case 2:red=(p*255+0.5);_110=(_109*255+0.5);blue=(t*255+0.5);break;case 3:red=(p*255+0.5);_110=(q*255+0.5);blue=(_109*255+0.5);break;case 4:red=(t*255+0.5);_110=(p*255+0.5);blue=(_109*255+0.5);break;case 5:red=(_109*255+0.5);_110=(p*255+0.5);blue=(q*255+0.5);break;}}return {r:parseInt(red),g:parseInt(_110),b:parseInt(blue)};};Rico.Color.RGBtoHSB=function(r,g,b){var hue;var _116;var _117;var cmax=(r>g)?r:g;if(b>cmax){cmax=b;}var cmin=(r<g)?r:g;if(b<cmin){cmin=b;}_117=cmax/255;if(cmax!=0){saturation=(cmax-cmin)/cmax;}else{saturation=0;}if(saturation==0){hue=0;}else{var redc=(cmax-r)/(cmax-cmin);var _121=(cmax-g)/(cmax-cmin);var _122=(cmax-b)/(cmax-cmin);if(r==cmax){hue=_122-_121;}else{if(g==cmax){hue=2+redc-_122;}else{hue=4+_121-redc;}}hue=hue/6;if(hue<0){hue=hue+1;}}return {h:hue,s:saturation,b:_117};};Rico.Corner={round:function(e,_123){var e=$(e);this._setOptions(_123);var _124=this.options.color;if(this.options.color=="fromElement"){_124=this._background(e);}var _125=this.options.bgColor;if(this.options.bgColor=="fromParent"){_125=this._background(e.offsetParent);}this._roundCornersImpl(e,_124,_125);},_roundCornersImpl:function(e,_126,_127){if(this.options.border){this._renderBorder(e,_127);}if(this._isTopRounded()){this._roundTopCorners(e,_126,_127);}if(this._isBottomRounded()){this._roundBottomCorners(e,_126,_127);}},_renderBorder:function(el,_129){var _130="1px solid "+this._borderColor(_129);var _131="border-left: "+_130;var _132="border-right: "+_130;var _133="style='"+_131+";"+_132+"'";el.innerHTML="<div "+_133+">"+el.innerHTML+"</div>";},_roundTopCorners:function(el,_134,_135){var _136=this._createCorner(_135);for(var i=0;i<this.options.numSlices;i++){_136.appendChild(this._createCornerSlice(_134,_135,i,"top"));}el.style.paddingTop=0;el.insertBefore(_136,el.firstChild);},_roundBottomCorners:function(el,_137,_138){var _139=this._createCorner(_138);for(var i=(this.options.numSlices-1);i>=0;i--){_139.appendChild(this._createCornerSlice(_137,_138,i,"bottom"));}el.style.paddingBottom=0;el.appendChild(_139);},_createCorner:function(_140){var _141=document.createElement("div");_141.style.backgroundColor=(this._isTransparent()?"transparent":_140);return _141;},_createCornerSlice:function(_142,_143,n,_145){var _146=document.createElement("span");var _147=_146.style;_147.backgroundColor=_142;_147.display="block";_147.height="1px";_147.overflow="hidden";_147.fontSize="1px";var _148=this._borderColor(_142,_143);if(this.options.border&&n==0){_147.borderTopStyle="solid";_147.borderTopWidth="1px";_147.borderLeftWidth="0px";_147.borderRightWidth="0px";_147.borderBottomWidth="0px";_147.height="0px";_147.borderColor=_148;}else{if(_148){_147.borderColor=_148;_147.borderStyle="solid";_147.borderWidth="0px 1px";}}if(!this.options.compact&&(n==(this.options.numSlices-1))){_147.height="2px";}this._setMargin(_146,n,_145);this._setBorder(_146,n,_145);return _146;},_setOptions:function(_149){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false}.extend(_149||{});this.options.numSlices=this.options.compact?2:4;if(this._isTransparent()){this.options.blend=false;}},_whichSideTop:function(){if(this._hasString(this.options.corners,"all","top")){return "";}if(this.options.corners.indexOf("tl")>=0&&this.options.corners.indexOf("tr")>=0){return "";}if(this.options.corners.indexOf("tl")>=0){return "left";}else{if(this.options.corners.indexOf("tr")>=0){return "right";}}return "";},_whichSideBottom:function(){if(this._hasString(this.options.corners,"all","bottom")){return "";}if(this.options.corners.indexOf("bl")>=0&&this.options.corners.indexOf("br")>=0){return "";}if(this.options.corners.indexOf("bl")>=0){return "left";}else{if(this.options.corners.indexOf("br")>=0){return "right";}}return "";},_borderColor:function(_150,_151){if(_150=="transparent"){return _151;}else{if(this.options.border){return this.options.border;}else{if(this.options.blend){return this._blend(_151,_150);}else{return "";}}}},_setMargin:function(el,n,_152){var _153=this._marginSize(n);var _154=_152=="top"?this._whichSideTop():this._whichSideBottom();if(_154=="left"){el.style.marginLeft=_153+"px";el.style.marginRight="0px";}else{if(_154=="right"){el.style.marginRight=_153+"px";el.style.marginLeft="0px";}else{el.style.marginLeft=_153+"px";el.style.marginRight=_153+"px";}}},_setBorder:function(el,n,_155){var _156=this._borderSize(n);var _157=_155=="top"?this._whichSideTop():this._whichSideBottom();if(_157=="left"){el.style.borderLeftWidth=_156+"px";el.style.borderRightWidth="0px";}else{if(_157=="right"){el.style.borderRightWidth=_156+"px";el.style.borderLeftWidth="0px";}else{el.style.borderLeftWidth=_156+"px";el.style.borderRightWidth=_156+"px";}}},_marginSize:function(n){if(this._isTransparent()){return 0;}var _158=[5,3,2,1];var _159=[3,2,1,0];var _160=[2,1];var _161=[1,0];if(this.options.compact&&this.options.blend){return _161[n];}else{if(this.options.compact){return _160[n];}else{if(this.options.blend){return _159[n];}else{return _158[n];}}}},_borderSize:function(n){var _162=[5,3,2,1];var _163=[2,1,1,1];var _164=[1,0];var _165=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1;}else{if(this.options.compact){return _164[n];}else{if(this.options.blend){return _163[n];}else{if(this.options.border){return _165[n];}else{if(this._isTransparent()){return _162[n];}}}}}return 0;},_hasString:function(str){for(var i=1;i<arguments.length;i++){if(str.indexOf(arguments[i])>=0){return true;}}return false;},_blend:function(c1,c2){var cc1=Rico.Color.createFromHex(c1);cc1.blend(Rico.Color.createFromHex(c2));return cc1;},_background:function(el){try{return Rico.Color.createColorFromBackground(el).asHex();}catch(err){return "#ffffff";}},_isTransparent:function(){return this.options.color=="transparent";},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr");},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br");},_hasSingleTextChild:function(el){return el.childNodes.length==1&&el.childNodes[0].nodeType==3;}};Rico.DragAndDrop=Class.create();Rico.DragAndDrop.prototype={initialize:function(){this.dropZones=new Array();this.draggables=new Array();this.currentDragObjects=new Array();this.dragElement=null;this.lastSelectedDraggable=null;this.currentDragObjectVisible=false;this.interestedInMotionEvents=false;},registerDropZone:function(_170){this.dropZones[this.dropZones.length]=_170;},deregisterDropZone:function(_171){var _172=new Array();var j=0;for(var i=0;i<this.dropZones.length;i++){if(this.dropZones[i]!=_171){_172[j++]=this.dropZones[i];}}this.dropZones=_172;},clearDropZones:function(){this.dropZones=new Array();},registerDraggable:function(_173){this.draggables[this.draggables.length]=_173;this._addMouseDownHandler(_173);},clearSelection:function(){for(var i=0;i<this.currentDragObjects.length;i++){this.currentDragObjects[i].deselect();}this.currentDragObjects=new Array();this.lastSelectedDraggable=null;},hasSelection:function(){return this.currentDragObjects.length>0;},setStartDragFromElement:function(e,_174){this.origPos=RicoUtil.toDocumentPosition(_174);this.startx=e.screenX-this.origPos.x;this.starty=e.screenY-this.origPos.y;this.interestedInMotionEvents=this.hasSelection();this._terminateEvent(e);},updateSelection:function(_175,_176){if(!_176){this.clearSelection();}if(_175.isSelected()){this.currentDragObjects.removeItem(_175);_175.deselect();if(_175==this.lastSelectedDraggable){this.lastSelectedDraggable=null;}}else{this.currentDragObjects[this.currentDragObjects.length]=_175;_175.select();this.lastSelectedDraggable=_175;}},_mouseDownHandler:function(e){if(arguments.length==0){e=event;}var _177=e.which!=undefined;if((_177&&e.which!=1)||(!_177&&e.button!=1)){return;}var _178=e.target?e.target:e.srcElement;var _179=_178.draggable;var _180=_178;while(_179==null&&_180.parentNode){_180=_180.parentNode;_179=_180.draggable;}if(_179==null){return;}this.updateSelection(_179,e.ctrlKey);if(this.hasSelection()){for(var i=0;i<this.dropZones.length;i++){this.dropZones[i].clearPositionCache();}}this.setStartDragFromElement(e,_179.getMouseDownHTMLElement());},_mouseMoveHandler:function(e){var _181=e.which!=undefined;if(!this.interestedInMotionEvents){this._terminateEvent(e);return;}if(!this.hasSelection()){return;}if(!this.currentDragObjectVisible){this._startDrag(e);}if(!this.activatedDropZones){this._activateRegisteredDropZones();}this._updateDraggableLocation(e);this._updateDropZonesHover(e);this._terminateEvent(e);},_makeDraggableObjectVisible:function(e){if(!this.hasSelection()){return;}var _182;if(this.currentDragObjects.length>1){_182=this.currentDragObjects[0].getMultiObjectDragGUI(this.currentDragObjects);}else{_182=this.currentDragObjects[0].getSingleObjectDragGUI();}if(RicoUtil.getElementsComputedStyle(_182,"position")!="absolute"){_182.style.position="absolute";}if(_182.parentNode==null||_182.parentNode.nodeType==11){document.body.appendChild(_182);}this.dragElement=_182;this._updateDraggableLocation(e);this.currentDragObjectVisible=true;},_updateDraggableLocation:function(e){var _183=this.dragElement.style;_183.left=(e.screenX-this.startx)+"px";_183.top=(e.screenY-this.starty)+"px";},_updateDropZonesHover:function(e){var n=this.dropZones.length;for(var i=0;i<n;i++){if(!this._mousePointInDropZone(e,this.dropZones[i])){this.dropZones[i].hideHover();}}for(var i=0;i<n;i++){if(this._mousePointInDropZone(e,this.dropZones[i])){if(this.dropZones[i].canAccept(this.currentDragObjects)){this.dropZones[i].showHover();}}}},_startDrag:function(e){for(var i=0;i<this.currentDragObjects.length;i++){this.currentDragObjects[i].startDrag();}this._makeDraggableObjectVisible(e);},_mouseUpHandler:function(e){if(!this.hasSelection()){return;}var _184=e.which!=undefined;if((_184&&e.which!=1)||(!_184&&e.button!=1)){return;}this.interestedInMotionEvents=false;if(this.dragElement==null){this._terminateEvent(e);return;}if(this._placeDraggableInDropZone(e)){this._completeDropOperation(e);}else{this._terminateEvent(e);new Effect.Position(this.dragElement,this.origPos.x,this.origPos.y,200,20,{complete:this._doCancelDragProcessing.bind(this)});}},_completeDropOperation:function(e){if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()){if(this.dragElement.parentNode!=null){this.dragElement.parentNode.removeChild(this.dragElement);}}this._deactivateRegisteredDropZones();this._endDrag();this.clearSelection();this.dragElement=null;this.currentDragObjectVisible=false;this._terminateEvent(e);},_doCancelDragProcessing:function(){this._cancelDrag();if(this.dragElement!=this.currentDragObjects[0].getMouseDownHTMLElement()){if(this.dragElement.parentNode!=null){this.dragElement.parentNode.removeChild(this.dragElement);}}this._deactivateRegisteredDropZones();this.dragElement=null;this.currentDragObjectVisible=false;},_placeDraggableInDropZone:function(e){var _185=false;var n=this.dropZones.length;for(var i=0;i<n;i++){if(this._mousePointInDropZone(e,this.dropZones[i])){if(this.dropZones[i].canAccept(this.currentDragObjects)){this.dropZones[i].hideHover();this.dropZones[i].accept(this.currentDragObjects);_185=true;break;}}}return _185;},_cancelDrag:function(){for(var i=0;i<this.currentDragObjects.length;i++){this.currentDragObjects[i].cancelDrag();}},_endDrag:function(){for(var i=0;i<this.currentDragObjects.length;i++){this.currentDragObjects[i].endDrag();}},_mousePointInDropZone:function(e,_186){var _187=_186.getAbsoluteRect();return e.clientX>_187.left&&e.clientX<_187.right&&e.clientY>_187.top&&e.clientY<_187.bottom;},_addMouseDownHandler:function(_188){var _189=_188.getMouseDownHTMLElement();if(_189!=null){_189.draggable=_188;this._addMouseDownEvent(_189);}},_activateRegisteredDropZones:function(){var n=this.dropZones.length;for(var i=0;i<n;i++){var _190=this.dropZones[i];if(_190.canAccept(this.currentDragObjects)){_190.activate();}}this.activatedDropZones=true;},_deactivateRegisteredDropZones:function(){var n=this.dropZones.length;for(var i=0;i<n;i++){this.dropZones[i].deactivate();}this.activatedDropZones=false;},_addMouseDownEvent:function(_191){if(typeof document.implementation!="undefined"&&document.implementation.hasFeature("HTML","1.0")&&document.implementation.hasFeature("Events","2.0")&&document.implementation.hasFeature("CSS","2.0")){_191.addEventListener("mousedown",this._mouseDownHandler.bindAsEventListener(this),false);}else{_191.attachEvent("onmousedown",this._mouseDownHandler.bindAsEventListener(this));}},_terminateEvent:function(e){if(e.stopPropagation!=undefined){e.stopPropagation();}else{if(e.cancelBubble!=undefined){e.cancelBubble=true;}}if(e.preventDefault!=undefined){e.preventDefault();}else{e.returnValue=false;}},initializeEventHandlers:function(){if(typeof document.implementation!="undefined"&&document.implementation.hasFeature("HTML","1.0")&&document.implementation.hasFeature("Events","2.0")&&document.implementation.hasFeature("CSS","2.0")){document.addEventListener("mouseup",this._mouseUpHandler.bindAsEventListener(this),false);document.addEventListener("mousemove",this._mouseMoveHandler.bindAsEventListener(this),false);}else{document.attachEvent("onmouseup",this._mouseUpHandler.bindAsEventListener(this));document.attachEvent("onmousemove",this._mouseMoveHandler.bindAsEventListener(this));}}};var dndMgr=new Rico.DragAndDrop();dndMgr.initializeEventHandlers();Rico.Draggable=Class.create();Rico.Draggable.prototype={initialize:function(type,_193){this.type=type;this.htmlElement=$(_193);this.selected=false;},getMouseDownHTMLElement:function(){return this.htmlElement;},select:function(){this.selected=true;if(this.showingSelected){return;}var _194=this.getMouseDownHTMLElement();var _195=Rico.Color.createColorFromBackground(_194);_195.isBright()?_195.darken(0.033):_195.brighten(0.033);this.saveBackground=RicoUtil.getElementsComputedStyle(_194,"backgroundColor","background-color");_194.style.backgroundColor=_195.asHex();this.showingSelected=true;},deselect:function(){this.selected=false;if(!this.showingSelected){return;}var _196=this.getMouseDownHTMLElement();_196.style.backgroundColor=this.saveBackground;this.showingSelected=false;},isSelected:function(){return this.selected;},startDrag:function(){},cancelDrag:function(){},endDrag:function(){},getSingleObjectDragGUI:function(){return this.htmlElement;},getMultiObjectDragGUI:function(_197){return this.htmlElement;},getDroppedGUI:function(){return this.htmlElement;},toString:function(){return this.type+":"+this.htmlElement+":";}};Rico.Dropzone=Class.create();Rico.Dropzone.prototype={initialize:function(_198){this.htmlElement=$(_198);this.absoluteRect=null;},getHTMLElement:function(){return this.htmlElement;},clearPositionCache:function(){this.absoluteRect=null;},getAbsoluteRect:function(){if(this.absoluteRect==null){var _199=this.getHTMLElement();var pos=RicoUtil.toViewportPosition(_199);this.absoluteRect={top:pos.y,left:pos.x,bottom:pos.y+_199.offsetHeight,right:pos.x+_199.offsetWidth};}return this.absoluteRect;},activate:function(){var _201=this.getHTMLElement();if(_201==null||this.showingActive){return;}this.showingActive=true;this.saveBackgroundColor=_201.style.backgroundColor;var _202="#ffea84";var _203=Rico.Color.createColorFromBackground(_201);if(_203==null){_201.style.backgroundColor=_202;}else{_203.isBright()?_203.darken(0.2):_203.brighten(0.2);_201.style.backgroundColor=_203.asHex();}},deactivate:function(){var _204=this.getHTMLElement();if(_204==null||!this.showingActive){return;}_204.style.backgroundColor=this.saveBackgroundColor;this.showingActive=false;this.saveBackgroundColor=null;},showHover:function(){var _205=this.getHTMLElement();if(_205==null||this.showingHover){return;}this.saveBorderWidth=_205.style.borderWidth;this.saveBorderStyle=_205.style.borderStyle;this.saveBorderColor=_205.style.borderColor;this.showingHover=true;_205.style.borderWidth="1px";_205.style.borderStyle="solid";_205.style.borderColor="#ffff00";},hideHover:function(){var _206=this.getHTMLElement();if(_206==null||!this.showingHover){return;}_206.style.borderWidth=this.saveBorderWidth;_206.style.borderStyle=this.saveBorderStyle;_206.style.borderColor=this.saveBorderColor;this.showingHover=false;},canAccept:function(_207){return true;},accept:function(_208){var _209=this.getHTMLElement();if(_209==null){return;}n=_208.length;for(var i=0;i<n;i++){var _210=_208[i].getDroppedGUI();if(RicoUtil.getElementsComputedStyle(_210,"position")=="absolute"){_210.style.position="static";_210.style.top="";_210.style.top="";}_209.appendChild(_210);}}};if(window.Effect==undefined){Effect={};}Effect.SizeAndPosition=Class.create();Effect.SizeAndPosition.prototype={initialize:function(_211,x,y,w,h,_215,_216,_217){this.element=$(_211);this.x=x;this.y=y;this.w=w;this.h=h;this.duration=_215;this.steps=_216;this.options=arguments[7]||{};this.sizeAndPosition();},sizeAndPosition:function(){if(this.isFinished()){if(this.options.complete){this.options.complete(this);}return;}if(this.timer){clearTimeout(this.timer);}var _218=Math.round(this.duration/this.steps);var _219=this.element.offsetLeft;var _220=this.element.offsetTop;var _221=this.element.offsetWidth;var _222=this.element.offsetHeight;this.x=(this.x)?this.x:_219;this.y=(this.y)?this.y:_220;this.w=(this.w)?this.w:_221;this.h=(this.h)?this.h:_222;var difX=this.steps>0?(this.x-_219)/this.steps:0;var difY=this.steps>0?(this.y-_220)/this.steps:0;var difW=this.steps>0?(this.w-_221)/this.steps:0;var difH=this.steps>0?(this.h-_222)/this.steps:0;this.moveBy(difX,difY);this.resizeBy(difW,difH);this.duration-=_218;this.steps--;this.timer=setTimeout(this.sizeAndPosition.bind(this),_218);},isFinished:function(){return this.steps<=0;},moveBy:function(difX,difY){var _227=this.element.offsetLeft;var _228=this.element.offsetTop;var _229=parseInt(difX);var _230=parseInt(difY);var _231=this.element.style;if(_229!=0){_231.left=(_227+_229)+"px";}if(_230!=0){_231.top=(_228+_230)+"px";}},resizeBy:function(difW,difH){var _232=this.element.offsetWidth;var _233=this.element.offsetHeight;var _234=parseInt(difW);var _235=parseInt(difH);var _236=this.element.style;if(_234!=0){_236.width=(_232+_234)+"px";}if(_235!=0){_236.height=(_233+_235)+"px";}}};Effect.Size=Class.create();Effect.Size.prototype={initialize:function(_237,w,h,_238,_239,_240){new Effect.SizeAndPosition(_237,null,null,w,h,_238,_239,_240);}};Effect.Position=Class.create();Effect.Position.prototype={initialize:function(_241,x,y,_242,_243,_244){new Effect.SizeAndPosition(_241,x,y,null,null,_242,_243,_244);}};Effect.Round=Class.create();Effect.Round.prototype={initialize:function(_245,_246,_247){var _248=document.getElementsByTagAndClassName(_245,_246);for(var i=0;i<_248.length;i++){Rico.Corner.round(_248[i],_247);}}};Effect.FadeTo=Class.create();Effect.FadeTo.prototype={initialize:function(_249,_250,_251,_252,_253){this.element=$(_249);this.opacity=_250;this.duration=_251;this.steps=_252;this.options=arguments[4]||{};this.fadeTo();},fadeTo:function(){if(this.isFinished()){if(this.options.complete){this.options.complete(this);}return;}if(this.timer){clearTimeout(this.timer);}var _254=Math.round(this.duration/this.steps);var _255=this.getElementOpacity();var _256=this.steps>0?(this.opacity-_255)/this.steps:0;this.changeOpacityBy(_256);this.duration-=_254;this.steps--;this.timer=setTimeout(this.fadeTo.bind(this),_254);},changeOpacityBy:function(v){var _258=this.getElementOpacity();var _259=Math.max(0,Math.min(_258+v,1));this.element.ricoOpacity=_259;this.element.style.filter="alpha(opacity:"+Math.round(_259*100)+")";this.element.style.opacity=_259;},isFinished:function(){return this.steps<=0;},getElementOpacity:function(){if(this.element.ricoOpacity==undefined){var _260;if(this.element.currentStyle){_260=this.element.currentStyle.opacity;}else{if(document.defaultView.getComputedStyle!=undefined){var _261=document.defaultView.getComputedStyle;_260=_261(this.element,null).getPropertyValue("opacity");}}this.element.ricoOpacity=_260!=undefined?_260:1;}return parseFloat(this.element.ricoOpacity);}};Effect.AccordionSize=Class.create();Effect.AccordionSize.prototype={initialize:function(e1,e2,_264,end,_266,_267,_268){this.e1=$(e1);this.e2=$(e2);this.start=_264;this.end=end;this.duration=_266;this.steps=_267;this.options=arguments[6]||{};this.accordionSize();},accordionSize:function(){if(this.isFinished()){this.e1.style.height=this.start+"px";this.e2.style.height=this.end+"px";if(this.options.complete){this.options.complete(this);}return;}if(this.timer){clearTimeout(this.timer);}var _269=Math.round(this.duration/this.steps);var diff=this.steps>0?(parseInt(this.e1.offsetHeight)-this.start)/this.steps:0;this.resizeBy(diff);this.duration-=_269;this.steps--;this.timer=setTimeout(this.accordionSize.bind(this),_269);},isFinished:function(){return this.steps<=0;},resizeBy:function(diff){var _271=this.e1.offsetHeight;var _272=this.e2.offsetHeight;var _273=parseInt(diff);if(diff!=0){this.e1.style.height=(_271-_273)+"px";this.e2.style.height=(_272+_273)+"px";}}};Rico.LiveGridMetaData=Class.create();Rico.LiveGridMetaData.prototype={initialize:function(_274,_275,_276,_277){this.pageSize=_274;this.totalRows=_275;this.setOptions(_277);this.scrollArrowHeight=16;this.columnCount=_276;},setOptions:function(_278){this.options={largeBufferSize:7,nearLimitFactor:0.2}.extend(_278||{});},getPageSize:function(){return this.pageSize;},getTotalRows:function(){return this.totalRows;},setTotalRows:function(n){this.totalRows=n;},getLargeBufferSize:function(){return parseInt(this.options.largeBufferSize*this.pageSize);},getLimitTolerance:function(){return parseInt(this.getLargeBufferSize()*this.options.nearLimitFactor);}};Rico.LiveGridScroller=Class.create();Rico.LiveGridScroller.prototype={initialize:function(_279,_280){this.isIE=navigator.userAgent.toLowerCase().indexOf("msie")>=0;this.liveGrid=_279;this.metaData=_279.metaData;this.createScrollBar();this.scrollTimeout=null;this.lastScrollPos=0;this.viewPort=_280;this.rows=new Array();},isUnPlugged:function(){return this.scrollerDiv.onscroll==null;},plugin:function(){this.scrollerDiv.onscroll=this.handleScroll.bindAsEventListener(this);},unplug:function(){this.scrollerDiv.onscroll=null;},sizeIEHeaderHack:function(){if(!this.isIE){return;}var _281=$(this.liveGrid.tableId+"_header");if(_281){_281.rows[0].cells[0].style.width=(_281.rows[0].cells[0].offsetWidth+1)+"px";}},createScrollBar:function(){var _282=this.liveGrid.viewPort.visibleHeight();this.scrollerDiv=document.createElement("div");var _283=this.scrollerDiv.style;_283.borderRight="1px solid #ababab";_283.position="relative";_283.left=this.isIE?"-6px":"-3px";_283.width="19px";_283.height=_282+"px";_283.overflow="auto";this.heightDiv=document.createElement("div");this.heightDiv.style.width="1px";this.heightDiv.style.height=parseInt(_282*this.metaData.getTotalRows()/this.metaData.getPageSize())+"px";this.scrollerDiv.appendChild(this.heightDiv);this.scrollerDiv.onscroll=this.handleScroll.bindAsEventListener(this);var _284=this.liveGrid.table;_284.parentNode.parentNode.insertBefore(this.scrollerDiv,_284.parentNode.nextSibling);},updateSize:function(){var _285=this.liveGrid.table;var _286=this.viewPort.visibleHeight();this.heightDiv.style.height=parseInt(_286*this.metaData.getTotalRows()/this.metaData.getPageSize())+"px";},rowToPixel:function(_287){return (_287/this.metaData.getTotalRows())*this.heightDiv.offsetHeight;},moveScroll:function(_288){this.scrollerDiv.scrollTop=this.rowToPixel(_288);if(this.metaData.options.onscroll){this.metaData.options.onscroll(this.liveGrid,_288);}},handleScroll:function(){if(this.scrollTimeout){clearTimeout(this.scrollTimeout);}var _289=parseInt(this.scrollerDiv.scrollTop/this.viewPort.rowHeight);this.liveGrid.requestContentRefresh(_289);this.viewPort.scrollTo(this.scrollerDiv.scrollTop);if(this.metaData.options.onscroll){this.metaData.options.onscroll(this.liveGrid,_289);}this.scrollTimeout=setTimeout(this.scrollIdle.bind(this),1200);},scrollIdle:function(){if(this.metaData.options.onscrollidle){this.metaData.options.onscrollidle();}}};Rico.LiveGridBuffer=Class.create();Rico.LiveGridBuffer.prototype={initialize:function(_290,_291){this.startPos=0;this.size=0;this.metaData=_290;this.rows=new Array();this.updateInProgress=false;this.viewPort=_291;this.maxBufferSize=_290.getLargeBufferSize()*2;this.maxFetchSize=_290.getLargeBufferSize();this.lastOffset=0;},getBlankRow:function(){if(!this.blankRow){this.blankRow=new Array();for(var i=0;i<this.metaData.columnCount;i++){this.blankRow[i]="&nbsp;";}}return this.blankRow;},loadRows:function(_292){var _293=_292.getElementsByTagName("rows")[0];this.updateUI=_293.getAttribute("update_ui")=="true";var _294=new Array();var trs=_293.getElementsByTagName("tr");for(var i=0;i<trs.length;i++){var row=_294[i]=new Array();var _297=trs[i].getElementsByTagName("td");for(var j=0;j<_297.length;j++){var cell=_297[j];var _299=cell.getAttribute("convert_spaces")=="true";var _300=RicoUtil.getContentAsString(cell);row[j]=_299?this.convertSpaces(_300):_300;if(!row[j]){row[j]="&nbsp;";}}}return _294;},update:function(_301,_302){var _303=this.loadRows(_301);if(this.rows.length==0){this.rows=_303;this.size=this.rows.length;this.startPos=_302;return;}if(_302>this.startPos){if(this.startPos+this.rows.length<_302){this.rows=_303;this.startPos=_302;}else{this.rows=this.rows.concat(_303.slice(0,_303.length));if(this.rows.length>this.maxBufferSize){var _304=this.rows.length;this.rows=this.rows.slice(this.rows.length-this.maxBufferSize,this.rows.length);this.startPos=this.startPos+(_304-this.rows.length);}}}else{if(_302+_303.length<this.startPos){this.rows=_303;}else{this.rows=_303.slice(0,this.startPos).concat(this.rows);if(this.rows.length>this.maxBufferSize){this.rows=this.rows.slice(0,this.maxBufferSize);}}this.startPos=_302;}this.size=this.rows.length;},clear:function(){this.rows=new Array();this.startPos=0;this.size=0;},isOverlapping:function(_305,size){return ((_305<this.endPos())&&(this.startPos<_305+size))||(this.endPos()==0);},isInRange:function(_307){return (_307>=this.startPos)&&(_307+this.metaData.getPageSize()<=this.endPos());},isNearingTopLimit:function(_308){return _308-this.startPos<this.metaData.getLimitTolerance();},endPos:function(){return this.startPos+this.rows.length;},isNearingBottomLimit:function(_309){return this.endPos()-(_309+this.metaData.getPageSize())<this.metaData.getLimitTolerance();},isAtTop:function(){return this.startPos==0;},isAtBottom:function(){return this.endPos()==this.metaData.getTotalRows();},isNearingLimit:function(_310){return (!this.isAtTop()&&this.isNearingTopLimit(_310))||(!this.isAtBottom()&&this.isNearingBottomLimit(_310));},getFetchSize:function(_311){var _312=this.getFetchOffset(_311);var _313=0;if(_312>=this.startPos){var _314=this.maxFetchSize+_312;if(_314>this.metaData.totalRows){_314=this.metaData.totalRows;}_313=_314-_312;}else{var _313=this.startPos-_312;if(_313>this.maxFetchSize){_313=this.maxFetchSize;}}return _313;},getFetchOffset:function(_315){var _316=_315;if(_315>this.startPos){_316=(_315>this.endPos())?_315:this.endPos();}else{if(_315+this.maxFetchSize>=this.startPos){var _316=this.startPos-this.maxFetchSize;if(_316<0){_316=0;}}}this.lastOffset=_316;return _316;},getRows:function(_317,_318){var _319=_317-this.startPos;var _320=_319+_318;if(_320>this.size){_320=this.size;}var _321=new Array();var _322=0;for(var i=_319;i<_320;i++){_321[_322++]=this.rows[i];}return _321;},convertSpaces:function(s){return s.split(" ").join("&nbsp;");}};Rico.GridViewPort=Class.create();Rico.GridViewPort.prototype={initialize:function(_323,_324,_325,_326,_327){this.lastDisplayedStartPos=0;this.div=_323.parentNode;this.table=_323;this.rowHeight=_324;this.div.style.height=this.rowHeight*_325;this.div.style.overflow="hidden";this.buffer=_326;this.liveGrid=_327;this.visibleRows=_325+1;this.lastPixelOffset=0;this.startPos=0;},populateRow:function(_328,row){for(var j=0;j<row.length;j++){_328.cells[j].innerHTML=row[j];}},bufferChanged:function(){this.refreshContents(parseInt(this.lastPixelOffset/this.rowHeight));},clearRows:function(){if(!this.isBlank){for(var i=0;i<this.visibleRows;i++){this.populateRow(this.table.rows[i],this.buffer.getBlankRow());}this.isBlank=true;}},clearContents:function(){this.clearRows();this.scrollTo(0);this.startPos=0;this.lastStartPos=-1;},refreshContents:function(_329){if(_329==this.lastRowPos&&!this.isPartialBlank&&!this.isBlank){return;}if((_329+this.visibleRows<this.buffer.startPos)||(this.buffer.startPos+this.buffer.size<_329)||(this.buffer.size==0)){this.clearRows();return;}this.isBlank=false;var _330=this.buffer.startPos>_329;var _331=_330?this.buffer.startPos:_329;var _332=(this.buffer.startPos+this.buffer.size<_329+this.visibleRows)?this.buffer.startPos+this.buffer.size:_329+this.visibleRows;var _333=_332-_331;var rows=this.buffer.getRows(_331,_333);var _335=this.visibleRows-_333;var _336=_330?0:_333;var _337=_330?_335:0;for(var i=0;i<rows.length;i++){this.populateRow(this.table.rows[i+_337],rows[i]);}for(var i=0;i<_335;i++){this.populateRow(this.table.rows[i+_336],this.buffer.getBlankRow());}this.isPartialBlank=_335>0;this.lastRowPos=_329;},scrollTo:function(_338){if(this.lastPixelOffset==_338){return;}this.refreshContents(parseInt(_338/this.rowHeight));this.div.scrollTop=_338%this.rowHeight;this.lastPixelOffset=_338;},visibleHeight:function(){return parseInt(this.div.style.height);}};Rico.LiveGridRequest=Class.create();Rico.LiveGridRequest.prototype={initialize:function(_339,_340){this.requestOffset=_339;}};Rico.LiveGrid=Class.create();Rico.LiveGrid.prototype={initialize:function(_341,_342,_343,url,_345){if(_345==null){_345={};}this.tableId=_341;this.table=$(_341);var _346=this.table.rows[0].cells.length;this.metaData=new Rico.LiveGridMetaData(_342,_343,_346,_345);this.buffer=new Rico.LiveGridBuffer(this.metaData);var _347=this.table.rows.length;this.viewPort=new Rico.GridViewPort(this.table,this.table.offsetHeight/_347,_342,this.buffer,this);this.scroller=new Rico.LiveGridScroller(this,this.viewPort);this.additionalParms=_345.requestParameters||[];_345.sortHandler=this.sortHandler.bind(this);if($(_341+"_header")){this.sort=new Rico.LiveGridSort(_341+"_header",_345);}this.processingRequest=null;this.unprocessedRequest=null;this.initAjax(url);if(_345.prefetchBuffer||_345.prefetchOffset>0){var _348=0;if(_345.offset){_348=_345.offset;this.scroller.moveScroll(_348);this.viewPort.scrollTo(this.scroller.rowToPixel(_348));}if(_345.sortCol){this.sortCol=_345.sortCol;this.sortDir=_345.sortDir;}this.requestContentRefresh(_348);}},resetContents:function(){this.scroller.moveScroll(0);this.buffer.clear();this.viewPort.clearContents();},sortHandler:function(_349){this.sortCol=_349.name;this.sortDir=_349.currentSort;this.resetContents();this.requestContentRefresh(0);},setRequestParams:function(){this.additionalParms=[];for(var i=0;i<arguments.length;i++){this.additionalParms[i]=arguments[i];}},setTotalRows:function(_350){this.resetContents();this.metaData.setTotalRows(_350);this.scroller.updateSize();},initAjax:function(url){ajaxEngine.registerRequest(this.tableId+"_request",url);ajaxEngine.registerAjaxObject(this.tableId+"_updater",this);},invokeAjax:function(){},handleTimedOut:function(){this.processingRequest=null;this.processQueuedRequest();},fetchBuffer:function(_351){if(this.buffer.isInRange(_351)&&!this.buffer.isNearingLimit(_351)){return;}if(this.processingRequest){this.unprocessedRequest=new Rico.LiveGridRequest(_351);return;}var _352=this.buffer.getFetchOffset(_351);this.processingRequest=new Rico.LiveGridRequest(_351);this.processingRequest.bufferOffset=_352;var _353=this.buffer.getFetchSize(_351);var _354=false;var _355=[];_355.push(this.tableId+"_request");_355.push("id="+this.tableId);_355.push("page_size="+_353);_355.push("offset="+_352);if(this.sortCol){_355.push("sort_col="+this.sortCol);_355.push("sort_dir="+this.sortDir);}for(var i=0;i<this.additionalParms.length;i++){_355.push(this.additionalParms[i]);}ajaxEngine.sendRequest.apply(ajaxEngine,_355);this.timeoutHandler=setTimeout(this.handleTimedOut.bind(this),20000);},requestContentRefresh:function(_356){this.fetchBuffer(_356);},ajaxUpdate:function(_357){try{clearTimeout(this.timeoutHandler);this.buffer.update(_357,this.processingRequest.bufferOffset);this.viewPort.bufferChanged();}catch(err){}finally{this.processingRequest=null;}this.processQueuedRequest();},processQueuedRequest:function(){if(this.unprocessedRequest!=null){this.requestContentRefresh(this.unprocessedRequest.requestOffset);this.unprocessedRequest=null;}}};Rico.LiveGridSort=Class.create();Rico.LiveGridSort.prototype={initialize:function(_358,_359){this.headerTableId=_358;this.headerTable=$(_358);this.setOptions(_359);this.applySortBehavior();if(this.options.sortCol){this.setSortUI(this.options.sortCol,this.options.sortDir);}},setSortUI:function(_360,_361){var cols=this.options.columns;for(var i=0;i<cols.length;i++){if(cols[i].name==_360){this.setColumnSort(i,_361);break;}}},setOptions:function(_363){this.options={sortAscendImg:"images/sort_asc.gif",sortDescendImg:"images/sort_desc.gif",imageWidth:9,imageHeight:5,ajaxSortURLParms:[]}.extend(_363);new Image().src=this.options.sortAscendImg;new Image().src=this.options.sortDescendImg;this.sort=_363.sortHandler;if(!this.options.columns){this.options.columns=this.introspectForColumnInfo();}else{this.options.columns=this.convertToTableColumns(this.options.columns);}},applySortBehavior:function(){var _364=this.headerTable.rows[0];var _365=_364.cells;for(var i=0;i<_365.length;i++){this.addSortBehaviorToColumn(i,_365[i]);}},addSortBehaviorToColumn:function(n,cell){if(this.options.columns[n].isSortable()){cell.id=this.headerTableId+"_"+n;cell.style.cursor="pointer";cell.onclick=this.headerCellClicked.bindAsEventListener(this);cell.innerHTML=cell.innerHTML+"<span id=\""+this.headerTableId+"_img_"+n+"\">"+"&nbsp;&nbsp;&nbsp;</span>";}},headerCellClicked:function(evt){var _367=evt.target?evt.target:evt.srcElement;var _368=_367.id;var _369=parseInt(_368.substring(_368.lastIndexOf("_")+1));var _370=this.getSortedColumnIndex();if(_370!=-1){if(_370!=_369){this.removeColumnSort(_370);this.setColumnSort(_369,Rico.TableColumn.SORT_ASC);}else{this.toggleColumnSort(_370);}}else{this.setColumnSort(_369,Rico.TableColumn.SORT_ASC);}if(this.options.sortHandler){this.options.sortHandler(this.options.columns[_369]);}},removeColumnSort:function(n){this.options.columns[n].setUnsorted();this.setSortImage(n);},setColumnSort:function(n,_371){this.options.columns[n].setSorted(_371);this.setSortImage(n);},toggleColumnSort:function(n){this.options.columns[n].toggleSort();this.setSortImage(n);},setSortImage:function(n){var _372=this.options.columns[n].getSortDirection();var _373=$(this.headerTableId+"_img_"+n);if(_372==Rico.TableColumn.UNSORTED){_373.innerHTML="&nbsp;&nbsp;";}else{if(_372==Rico.TableColumn.SORT_ASC){_373.innerHTML="&nbsp;&nbsp;<img width=\""+this.options.imageWidth+"\" "+"height=\""+this.options.imageHeight+"\" "+"src=\""+this.options.sortAscendImg+"\"/>";}else{if(_372==Rico.TableColumn.SORT_DESC){_373.innerHTML="&nbsp;&nbsp;<img width=\""+this.options.imageWidth+"\" "+"height=\""+this.options.imageHeight+"\" "+"src=\""+this.options.sortDescendImg+"\"/>";}}}},getSortedColumnIndex:function(){var cols=this.options.columns;for(var i=0;i<cols.length;i++){if(cols[i].isSorted()){return i;}}return -1;},introspectForColumnInfo:function(){var _374=new Array();var _375=this.headerTable.rows[0];var _376=_375.cells;for(var i=0;i<_376.length;i++){_374.push(new Rico.TableColumn(this.deriveColumnNameFromCell(_376[i],i),true));}return _374;},convertToTableColumns:function(cols){var _377=new Array();for(var i=0;i<cols.length;i++){_377.push(new Rico.TableColumn(cols[i][0],cols[i][1]));}},deriveColumnNameFromCell:function(cell,_378){var _379=cell.innerText!=undefined?cell.innerText:cell.textContent;return _379?_379.toLowerCase().split(" ").join("_"):"col_"+_378;}};Rico.TableColumn=Class.create();Rico.TableColumn.UNSORTED=0;Rico.TableColumn.SORT_ASC="ASC";Rico.TableColumn.SORT_DESC="DESC";Rico.TableColumn.prototype={initialize:function(name,_381){this.name=name;this.sortable=_381;this.currentSort=Rico.TableColumn.UNSORTED;},isSortable:function(){return this.sortable;},isSorted:function(){return this.currentSort!=Rico.TableColumn.UNSORTED;},getSortDirection:function(){return this.currentSort;},toggleSort:function(){if(this.currentSort==Rico.TableColumn.UNSORTED||this.currentSort==Rico.TableColumn.SORT_DESC){this.currentSort=Rico.TableColumn.SORT_ASC;}else{if(this.currentSort==Rico.TableColumn.SORT_ASC){this.currentSort=Rico.TableColumn.SORT_DESC;}}},setUnsorted:function(_382){this.setSorted(Rico.TableColumn.UNSORTED);},setSorted:function(_383){this.currentSort=_383;}};var RicoUtil={getElementsComputedStyle:function(_384,_385,_386){if(arguments.length==2){_386=_385;}var el=$(_384);if(el.currentStyle){return el.currentStyle[_385];}else{return document.defaultView.getComputedStyle(el,null).getPropertyValue(_386);}},createXmlDocument:function(){if(document.implementation&&document.implementation.createDocument){var doc=document.implementation.createDocument("","",null);if(doc.readyState==null){doc.readyState=1;doc.addEventListener("load",function(){doc.readyState=4;if(typeof doc.onreadystatechange=="function"){doc.onreadystatechange();}},false);}return doc;}if(window.ActiveXObject){return Try.these(function(){return new ActiveXObject("MSXML2.DomDocument");},function(){return new ActiveXObject("Microsoft.DomDocument");},function(){return new ActiveXObject("MSXML.DomDocument");},function(){return new ActiveXObject("MSXML3.DomDocument");})||false;}return null;},getContentAsString:function(_388){return _388.xml!=undefined?this._getContentAsStringIE(_388):this._getContentAsStringMozilla(_388);},_getContentAsStringIE:function(_389){var _390="";for(var i=0;i<_389.childNodes.length;i++){_390+=_389.childNodes[i].xml;}return _390;},_getContentAsStringMozilla:function(_391){var _392=new XMLSerializer();var _393="";for(var i=0;i<_391.childNodes.length;i++){_393+=_392.serializeToString(_391.childNodes[i]);}return _393;},toViewportPosition:function(_394){return this._toAbsolute(_394,true);},toDocumentPosition:function(_395){return this._toAbsolute(_395,false);},_toAbsolute:function(_396,_397){if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){return this._toAbsoluteMozilla(_396,_397);}var x=0;var y=0;var _398=_396;while(_398){var _399=0;var _400=0;if(_398!=_396){var _399=parseInt(this.getElementsComputedStyle(_398,"borderLeftWidth"));var _400=parseInt(this.getElementsComputedStyle(_398,"borderTopWidth"));_399=isNaN(_399)?0:_399;_400=isNaN(_400)?0:_400;}x+=_398.offsetLeft-_398.scrollLeft+_399;y+=_398.offsetTop-_398.scrollTop+_400;_398=_398.offsetParent;}if(_397){x-=this.docScrollLeft();y-=this.docScrollTop();}return {x:x,y:y};},_toAbsoluteMozilla:function(_401,_402){var x=0;var y=0;var _403=_401;while(_403){x+=_403.offsetLeft;y+=_403.offsetTop;_403=_403.offsetParent;}_403=_401;while(_403&&_403!=document.body&&_403!=document.documentElement){if(_403.scrollLeft){x-=_403.scrollLeft;}if(_403.scrollTop){y-=_403.scrollTop;}_403=_403.parentNode;}if(_402){x-=this.docScrollLeft();y-=this.docScrollTop();}return {x:x,y:y};},docScrollLeft:function(){if(window.pageXOffset){return window.pageXOffset;}else{if(document.documentElement&&document.documentElement.scrollLeft){return document.documentElement.scrollLeft;}else{if(document.body){return document.body.scrollLeft;}else{return 0;}}}},docScrollTop:function(){if(window.pageYOffset){return window.pageYOffset;}else{if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop;}else{if(document.body){return document.body.scrollTop;}else{return 0;}}}}};