var Class={create:function(){return function(){this.initialize.apply(this,arguments)}}};Object.extend=function(a,b){for(property in b){a[property]=b[property]}return a};Function.prototype.bind=function(b){var a=this;return function(){return a.apply(b,arguments)}};function $(){var c=new Array();for(var b=0;b<arguments.length;b++){var a=arguments[b];if(typeof a=="string"){a=std_getElementById(a)}if(arguments.length==1){return a}c.push(a)}return c}var fx=new Object();fx.Base=function(){};fx.Base.prototype={setOptions:function(a){this.options={duration:500,onComplete:""};Object.extend(this.options,a||{})},go:function(){this.duration=this.options.duration;this.startTime=(new Date).getTime();this.timer=setInterval(this.step.bind(this),13)},step:function(){var b=(new Date).getTime();var a=(b-this.startTime)/(this.duration);if(b>=this.duration+this.startTime){this.now=this.to;clearInterval(this.timer);this.timer=null;if(this.options.onComplete){setTimeout(this.options.onComplete.bind(this),10)}}else{this.now=((-Math.cos(a*Math.PI)/2)+0.5)*(this.to-this.from)+this.from}this.increase()},custom:function(b,a){if(this.timer!=null){return}this.from=b;this.to=a;this.go()},hide:function(){this.now=0;this.increase()},clearTimer:function(){clearInterval(this.timer);this.timer=null}};fx.Layout=Class.create();fx.Layout.prototype=Object.extend(new fx.Base(),{initialize:function(b,a){this.el=$(b);this.el.style.overflow="hidden";this.el.iniWidth=this.el.offsetWidth;this.el.iniHeight=this.el.offsetHeight;this.setOptions(a)}});fx.Height=Class.create();Object.extend(Object.extend(fx.Height.prototype,fx.Layout.prototype),{increase:function(){this.el.style.height=this.now+"px"},toggle:function(){if(this.el.offsetHeight>0){this.custom(this.el.offsetHeight,0)}else{this.custom(0,this.el.scrollHeight)}},toggle_custom:function(c,b,d,a){if(this.el.offsetHeight>a+20){this.custom(this.el.offsetHeight,a);std_getElementById(c).innerHTML=d}else{this.custom(a,this.el.scrollHeight);std_getElementById(c).innerHTML=b}}});fx.Width=Class.create();Object.extend(Object.extend(fx.Width.prototype,fx.Layout.prototype),{increase:function(){this.el.style.width=this.now+"px"},toggle:function(){if(this.el.offsetWidth>0){this.custom(this.el.offsetWidth,0)}else{this.custom(0,this.el.scrollWidth)}},toggleMinMax:function(c,a,b){if(this.el.offsetWidth>c+b){this.custom(a,c)}else{this.custom(c,a)}}});
