var Rico={Version:"1.1.2",prototypeVersion:parseFloat(Prototype.Version.split(".")[0]+"."+Prototype.Version.split(".")[1])};if((typeof Prototype=="undefined")||Rico.prototypeVersion<1.3){throw ("Rico requires the Prototype JavaScript framework >= 1.3");}Rico.ArrayExtensions=new Array();if(Object.prototype.extend){Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Object.prototype.extend;}else{Object.prototype.extend=function(_1){return Object.extend.apply(this,[this,_1]);};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(_4){for(var i=0;i<this.length;i++){if(this[i]==_4){this.remove(i);break;}}};Rico.ArrayExtensions[Rico.ArrayExtensions.length]=Array.prototype.removeItem;}if(!Array.prototype.indices){Array.prototype.indices=function(){var _6=new Array();for(index in this){var _7=false;for(var i=0;i<Rico.ArrayExtensions.length;i++){if(this[index]==Rico.ArrayExtensions[i]){_7=true;break;}}if(!_7){_6[_6.length]=index;}}return _6;};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 _a=(new DOMParser()).parseFromString(s,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild);}for(var i=0;i<_a.childNodes.length;i++){this.appendChild(this.importNode(_a.childNodes[i],true));}};}Document.prototype.__defineGetter__("xml",function(){return (new XMLSerializer()).serializeToString(this);});}document.getElementsByTagAndClassName=function(_c,_d){if(_c==null){_c="*";}var _e=document.getElementsByTagName(_c)||document.all;var _f=new Array();if(_d==null){return _e;}for(var i=0;i<_e.length;i++){var _11=_e[i];var _12=_11.className.split(" ");for(var j=0;j<_12.length;j++){if(_12[j]==_d){_f.push(_11);break;}}}return _f;};Rico.Color=Class.create();Rico.Color.prototype={initialize:function(red,_15,_16){this.rgb={r:red,g:_15,b:_16};},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(_20){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.max(hsb.b-_20,0));},brighten:function(_22){var hsb=this.asHSB();this.rgb=Rico.Color.HSBtoRGB(hsb.h,hsb.s,Math.min(hsb.b+_22,1));},blend:function(_24){this.rgb.r=Math.floor((this.rgb.r+_24.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+_24.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+_24.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(_26){if(_26.length==4){var _27=_26;_26="#";for(var i=1;i<4;i++){_26+=(_27.charAt(i)+_27.charAt(i));}}if(_26.indexOf("#")==0){_26=_26.substring(1);}var red=_26.substring(0,2);var _2a=_26.substring(2,4);var _2b=_26.substring(4,6);return new Rico.Color(parseInt(red,16),parseInt(_2a,16),parseInt(_2b,16));};Rico.Color.createColorFromBackground=function(_2c){var _2d=RicoUtil.getElementsComputedStyle($(_2c),"backgroundColor","background-color");if(_2d=="transparent"&&_2c.parentNode){return Rico.Color.createColorFromBackground(_2c.parentNode);}if(_2d==null){return new Rico.Color(255,255,255);}if(_2d.indexOf("rgb(")==0){var _2e=_2d.substring(4,_2d.length-1);var _2f=_2e.split(",");return new Rico.Color(parseInt(_2f[0]),parseInt(_2f[1]),parseInt(_2f[2]));}else{if(_2d.indexOf("#")==0){return Rico.Color.createFromHex(_2d);}else{return new Rico.Color(255,255,255);}}};Rico.Color.HSBtoRGB=function(hue,_31,_32){var red=0;var _34=0;var _35=0;if(_31==0){red=parseInt(_32*255+0.5);_34=red;_35=red;}else{var h=(hue-Math.floor(hue))*6;var f=h-Math.floor(h);var p=_32*(1-_31);var q=_32*(1-_31*f);var t=_32*(1-(_31*(1-f)));switch(parseInt(h)){case 0:red=(_32*255+0.5);_34=(t*255+0.5);_35=(p*255+0.5);break;case 1:red=(q*255+0.5);_34=(_32*255+0.5);_35=(p*255+0.5);break;case 2:red=(p*255+0.5);_34=(_32*255+0.5);_35=(t*255+0.5);break;case 3:red=(p*255+0.5);_34=(q*255+0.5);_35=(_32*255+0.5);break;case 4:red=(t*255+0.5);_34=(p*255+0.5);_35=(_32*255+0.5);break;case 5:red=(_32*255+0.5);_34=(p*255+0.5);_35=(q*255+0.5);break;}}return {r:parseInt(red),g:parseInt(_34),b:parseInt(_35)};};Rico.Color.RGBtoHSB=function(r,g,b){var hue;var _3f;var _40;var _41=(r>g)?r:g;if(b>_41){_41=b;}var _42=(r<g)?r:g;if(b<_42){_42=b;}_40=_41/255;if(_41!=0){_3f=(_41-_42)/_41;}else{_3f=0;}if(_3f==0){hue=0;}else{var _43=(_41-r)/(_41-_42);var _44=(_41-g)/(_41-_42);var _45=(_41-b)/(_41-_42);if(r==_41){hue=_45-_44;}else{if(g==_41){hue=2+_43-_45;}else{hue=4+_44-_43;}}hue=hue/6;if(hue<0){hue=hue+1;}}return {h:hue,s:_3f,b:_40};};Rico.Corner={round:function(e,_47){var e=$(e);this._setOptions(_47);var _49=this.options.color;if(this.options.color=="fromElement"){_49=this._background(e);}var _4a=this.options.bgColor;if(this.options.bgColor=="fromParent"){_4a=this._background(e.offsetParent);}this._roundCornersImpl(e,_49,_4a);},_roundCornersImpl:function(e,_4c,_4d){if(this.options.border){this._renderBorder(e,_4d);}if(this._isTopRounded()){this._roundTopCorners(e,_4c,_4d);}if(this._isBottomRounded()){this._roundBottomCorners(e,_4c,_4d);}},_renderBorder:function(el,_4f){var _50="1px solid "+this._borderColor(_4f);var _51="border-left: "+_50;var _52="border-right: "+_50;var _53="style='"+_51+";"+_52+"'";el.innerHTML="<div "+_53+">"+el.innerHTML+"</div>";},_roundTopCorners:function(el,_55,_56){var _57=this._createCorner(_56);for(var i=0;i<this.options.numSlices;i++){_57.appendChild(this._createCornerSlice(_55,_56,i,"top"));}el.style.paddingTop=0;el.insertBefore(_57,el.firstChild);},_roundBottomCorners:function(el,_5a,_5b){var _5c=this._createCorner(_5b);for(var i=(this.options.numSlices-1);i>=0;i--){_5c.appendChild(this._createCornerSlice(_5a,_5b,i,"bottom"));}el.style.paddingBottom=0;el.appendChild(_5c);},_createCorner:function(_5e){var _5f=document.createElement("div");_5f.style.backgroundColor=(this._isTransparent()?"transparent":_5e);return _5f;},_createCornerSlice:function(_60,_61,n,_63){var _64=document.createElement("span");var _65=_64.style;_65.backgroundColor=_60;_65.display="block";_65.height="1px";_65.overflow="hidden";_65.fontSize="1px";var _66=this._borderColor(_60,_61);if(this.options.border&&n==0){_65.borderTopStyle="solid";_65.borderTopWidth="1px";_65.borderLeftWidth="0px";_65.borderRightWidth="0px";_65.borderBottomWidth="0px";_65.height="0px";_65.borderColor=_66;}else{if(_66){_65.borderColor=_66;_65.borderStyle="solid";_65.borderWidth="0px 1px";}}if(!this.options.compact&&(n==(this.options.numSlices-1))){_65.height="2px";}this._setMargin(_64,n,_63);this._setBorder(_64,n,_63);return _64;},_setOptions:function(_67){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:true,border:false,compact:false};Object.extend(this.options,_67||{});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(_68,_69){if(_68=="transparent"){return _69;}else{if(this.options.border){return this.options.border;}else{if(this.options.blend){return this._blend(_69,_68);}else{return "";}}}},_setMargin:function(el,n,_6c){var _6d=this._marginSize(n);var _6e=_6c=="top"?this._whichSideTop():this._whichSideBottom();if(_6e=="left"){el.style.marginLeft=_6d+"px";el.style.marginRight="0px";}else{if(_6e=="right"){el.style.marginRight=_6d+"px";el.style.marginLeft="0px";}else{el.style.marginLeft=_6d+"px";el.style.marginRight=_6d+"px";}}},_setBorder:function(el,n,_71){var _72=this._borderSize(n);var _73=_71=="top"?this._whichSideTop():this._whichSideBottom();if(_73=="left"){el.style.borderLeftWidth=_72+"px";el.style.borderRightWidth="0px";}else{if(_73=="right"){el.style.borderRightWidth=_72+"px";el.style.borderLeftWidth="0px";}else{el.style.borderLeftWidth=_72+"px";el.style.borderRightWidth=_72+"px";}}if(this.options.border!=false){el.style.borderLeftWidth=_72+"px";}el.style.borderRightWidth=_72+"px";},_marginSize:function(n){if(this._isTransparent()){return 0;}var _75=[5,3,2,1];var _76=[3,2,1,0];var _77=[2,1];var _78=[1,0];if(this.options.compact&&this.options.blend){return _78[n];}else{if(this.options.compact){return _77[n];}else{if(this.options.blend){return _76[n];}else{return _75[n];}}}},_borderSize:function(n){var _7a=[5,3,2,1];var _7b=[2,1,1,1];var _7c=[1,0];var _7d=[0,2,0,0];if(this.options.compact&&(this.options.blend||this._isTransparent())){return 1;}else{if(this.options.compact){return _7c[n];}else{if(this.options.blend){return _7b[n];}else{if(this.options.border){return _7d[n];}else{if(this._isTransparent()){return _7a[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;}};var RicoUtil={getElementsComputedStyle:function(_85,_86,_87){if(arguments.length==2){_87=_86;}var el=$(_85);if(el.currentStyle){return el.currentStyle[_86];}else{return document.defaultView.getComputedStyle(el,null).getPropertyValue(_87);}},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(_8a){return _8a.xml!=undefined?this._getContentAsStringIE(_8a):this._getContentAsStringMozilla(_8a);},_getContentAsStringIE:function(_8b){var _8c="";for(var i=0;i<_8b.childNodes.length;i++){var n=_8b.childNodes[i];if(n.nodeType==4){_8c+=n.nodeValue;}else{_8c+=n.xml;}}return _8c;},_getContentAsStringMozilla:function(_8f){var _90=new XMLSerializer();var _91="";for(var i=0;i<_8f.childNodes.length;i++){var n=_8f.childNodes[i];if(n.nodeType==4){_91+=n.nodeValue;}else{_91+=_90.serializeToString(n);}}return _91;},toViewportPosition:function(_94){return this._toAbsolute(_94,true);},toDocumentPosition:function(_95){return this._toAbsolute(_95,false);},_toAbsolute:function(_96,_97){if(navigator.userAgent.toLowerCase().indexOf("msie")==-1){return this._toAbsoluteMozilla(_96,_97);}var x=0;var y=0;var _9a=_96;while(_9a){var _9b=0;var _9c=0;if(_9a!=_96){var _9d=parseInt(this.getElementsComputedStyle(_9a,"borderLeftWidth"));var _9e=parseInt(this.getElementsComputedStyle(_9a,"borderTopWidth"));_9d=isNaN(_9d)?0:_9d;_9e=isNaN(_9e)?0:_9e;}x+=_9a.offsetLeft-_9a.scrollLeft+_9d;y+=_9a.offsetTop-_9a.scrollTop+_9e;_9a=_9a.offsetParent;}if(_97){x-=this.docScrollLeft();y-=this.docScrollTop();}return {x:x,y:y};},_toAbsoluteMozilla:function(_9f,_a0){var x=0;var y=0;var _a3=_9f;while(_a3){x+=_a3.offsetLeft;y+=_a3.offsetTop;_a3=_a3.offsetParent;}_a3=_9f;while(_a3&&_a3!=document.body&&_a3!=document.documentElement){if(_a3.scrollLeft){x-=_a3.scrollLeft;}if(_a3.scrollTop){y-=_a3.scrollTop;}_a3=_a3.parentNode;}if(_a0){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;}}}}};