/*
 * Compressed by JSA(www.xidea.org)
 */
Object.extend(Element,{getStyle:function(_,B){_=$(_);if(!_||!_.style)return null;var A=_.style[B.camelize()];if(!A)if(document.defaultView&&document.defaultView.getComputedStyle){var C=document.defaultView.getComputedStyle(_,null);A=C?C.getPropertyValue(B):null}else if(_.currentStyle)A=_.currentStyle[B.camelize()];if(window.opera&&["left","top","right","bottom"].include(B))if(Element.getStyle(_,"position")=="static")A="auto";return A=="auto"?null:A}});Object.extend(Array.prototype,{remove:function(_){if(isNaN(_)||_<0||_>this.length)return false;for(var $=0,A=0;$<this.length;$++)if($!=_)this[A++]=this[$];this.length-=1},removeItem:function($){this.remove(this.indexOf($))}});Array.prototype.contains=Array.prototype.include;Object.extend(Position,{getViewportWidth:function(){var $=0;if(window.innerWidth)$=window.innerWidth;if(document.documentElement&&document.documentElement.clientWidth){var _=document.documentElement.clientWidth;if(!$||_&&_<$)$=_;return $}if(document.body)return document.body.clientWidth;return 0},getViewportHeight:function(){if(window.innerHeight)return window.innerHeight;if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight;if(document.body)return document.body.clientHeight;return 0},getViewportSize:function(){var $=[Position.getViewportWidth(),Position.getViewportHeight()];$.w=$[0];$.h=$[1];return $},toCoordinateArray:function(C,B){if(C instanceof Array||typeof C=="array"){while(C.length<4)C.push(0);while(C.length>4)C.pop();var A=C}else var _=$(C),A=[this.getAbsoluteX(_,B),this.getAbsoluteY(_,B),_.offsetWidth,_.offsetHeight];A.x=A[0];A.y=A[1];A.w=A[2];A.h=A[3];return A},getAbsoluteX:function($,_){return this.getTotalOffset($,"left",_)},getAbsoluteY:function($,_){return this.getTotalOffset($,"top",_)},getTotalOffset:function(B,A,E){var $=(A=="top")?"offsetTop":"offsetLeft",_=(A=="top")?"scrollTop":"scrollLeft",D=(A=="top")?"y":"x",C=0;if(B["offsetParent"]){if(E&&B.parentNode!=document.body)C-=this.sumAncestorProperties(B,_);do{C+=B[$];B=B.offsetParent}while(B!=document.getElementsByTagName("body")[0].parentNode&&B!=null)}else if(B[D])C+=B[D];return C},sumAncestorProperties:function(B,A){if(!B)return 0;var _=0;while(B){var $=B[A];if($)_+=$-0;B=B.parentNode}return _},getAbsolutePosition:function(_,A){var $=[this.getAbsoluteX(_,A),this.getAbsoluteY(_,A)];$.x=$[0];$.y=$[1];return $},getViewportPosition:function($){return this._toAbsolute($,true)},getDocumentPosition:function($){return this._toAbsolute($,false)},_toAbsolute:function(_,C){if(navigator.userAgent.toLowerCase().indexOf("msie")==-1)return this._toAbsoluteMozilla(_,C);var E=0,B=0,D=_;while(D){var A=0,$=0;if(D!=_){A=parseInt(Element.getStyle(D,"borderLeftWidth")),$=parseInt(Element.getStyle(D,"borderTopWidth"));A=isNaN(A)?0:A;$=isNaN($)?0:$}E+=D.offsetLeft+A;B+=D.offsetTop+$;if(D&&D!=document.body&&D!=document.documentElement){if(D.scrollLeft)E-=D.scrollLeft;if(D.scrollTop)B-=D.scrollTop}D=D.offsetParent}if(C){E-=this.docScrollLeft();B-=this.docScrollTop()}return{x:E,y:B}},_toAbsoluteMozilla:function($,A){var C=0,_=0,B=$;while(B){C+=B.offsetLeft;_+=B.offsetTop;B=B.offsetParent}B=$;while(B&&B!=document.body&&B!=document.documentElement){if(B.scrollLeft)C-=B.scrollLeft;if(B.scrollTop)_-=B.scrollTop;B=B.parentNode}if(A){C-=this.docScrollLeft();_-=this.docScrollTop()}return{x:C,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},getScrollOffset:function(){var $=[0,0];if(window.pageYOffset)$=[window.pageXOffset,window.pageYOffset];else if(document.documentElement&&document.documentElement.scrollTop)$=[document.documentElement.scrollLeft,document.documentElement.scrollTop];else if(document.body)$=[document.body.scrollLeft,document.body.scrollTop];$.x=$[0];$.y=$[1];return $}});if(!window.Color)var Color=Class.create();Color.prototype={initialize:function(_,$,A){this.rgb={r:_,g:$,b:A}},setRed:function($){this.rgb.r=$},setGreen:function($){this.rgb.g=$},setBlue:function($){this.rgb.b=$},setHue:function(_){var $=this.asHSB();$.h=_;this.rgb=Color.HSBtoRGB($.h,$.s,$.b)},setSaturation:function(_){var $=this.asHSB();$.s=_;this.rgb=Color.HSBtoRGB($.h,$.s,$.b)},setBrightness:function(_){var $=this.asHSB();$.b=_;this.rgb=Color.HSBtoRGB($.h,$.s,$.b)},darken:function(_){var $=this.asHSB();this.rgb=Color.HSBtoRGB($.h,$.s,Math.max($.b-_,0))},brighten:function(_){var $=this.asHSB();this.rgb=Color.HSBtoRGB($.h,$.s,Math.min($.b+_,1))},blend:function($){this.rgb.r=Math.floor((this.rgb.r+$.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+$.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+$.rgb.b)/2)},isBright:function(){var $=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 Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}};Color.createFromHex=function(B){if(B.length==4){var C=B,B="#";for(var A=1;A<4;A++)B+=(C.charAt(A)+C.charAt(A))}if(B.indexOf("#")==0)B=B.substring(1);var _=B.substring(0,2),$=B.substring(2,4),D=B.substring(4,6);return new Color(parseInt(_,16),parseInt($,16),parseInt(D,16))};Color.createColorFromBackground=function(_){var B=Element.getStyle($(_),"background-color");if(B=="transparent"&&_.parentNode)return Color.createColorFromBackground(_.parentNode);if(B==null)return new Color(255,255,255);if(B.indexOf("rgb(")==0){var C=B.substring(4,B.length-1),A=C.split(",");return new Color(parseInt(A[0]),parseInt(A[1]),parseInt(A[2]))}else if(B.indexOf("#")==0)return Color.createFromHex(B);else return new Color(255,255,255)};Color.HSBtoRGB=function(A,C,E){var _=0,$=0,G=0;if(C==0){_=parseInt(E*255+0.5);$=_;G=_}else{var B=(A-Math.floor(A))*6,D=B-Math.floor(B),H=E*(1-C),I=E*(1-C*D),F=E*(1-(C*(1-D)));switch(parseInt(B)){case 0:_=(E*255+0.5);$=(F*255+0.5);G=(H*255+0.5);break;case 1:_=(I*255+0.5);$=(E*255+0.5);G=(H*255+0.5);break;case 2:_=(H*255+0.5);$=(E*255+0.5);G=(F*255+0.5);break;case 3:_=(H*255+0.5);$=(I*255+0.5);G=(E*255+0.5);break;case 4:_=(F*255+0.5);$=(H*255+0.5);G=(E*255+0.5);break;case 5:_=(E*255+0.5);$=(H*255+0.5);G=(I*255+0.5);break}}return{r:parseInt(_),g:parseInt($),b:parseInt(G)}};Color.RGBtoHSB=function(B,G,H){var _,C,D,F=(B>G)?B:G;if(H>F)F=H;var E=(B<G)?B:G;if(H<E)E=H;D=F/255;if(F!=0)C=(F-E)/F;else C=0;if(C==0)_=0;else{var A=(F-B)/(F-E),I=(F-G)/(F-E),$=(F-H)/(F-E);if(B==F)_=$-I;else if(G==F)_=2+A-$;else _=4+I-A;_=_/6;if(_<0)_=_+1}return{h:_,s:C,b:D}}