/*Copyright (c) 2005 Valerio Proietti, http://www.mad4milk.net*/
var x=new Object();
x.b=function(){};
x.b.prototype={seto:function(o){this.o={duration:500,onComplete:'',transition:x.s};Object.extend(this.o,o ||{});},step:function(){var t=(new Date).getTime();if(t>=this.o.duration+this.st){this.now=this.to;clearInterval(this.timer);this.timer=null;if(this.o.onComplete)setTimeout(this.o.onComplete.bind(this),10);}else{var Tp=(t-this.st)/(this.o.duration);this.now=this.o.transition(Tp)*(this.to-this.from)+this.from;}this.increase();},custom:function(from,to){if(this.timer!=null)return;this.from=from;this.to=to;this.st=(new Date).getTime();this.timer=setInterval(this.step.bind(this),13);},hide:function(){this.now=0;this.increase();},clearTimer:function(){clearInterval(this.timer);this.timer=null;}};x.Layout=Class.create();x.Layout.prototype=Object.extend(new x.b(),{initialize:function(el,o){this.el=$(el);this.el.style.overflow="hidden";this.iniWidth=this.el.offsetWidth;this.iniHeight=this.el.offsetHeight;this.seto(o);}});x.H=Class.create();Object.extend(Object.extend(x.H.prototype,x.Layout.prototype),{increase:function(){this.el.style.height=this.now+"em";},toggle:function(){if(this.el.offsetHeight > 0)this.custom(this.el.offsetHeight,0);else this.custom(0,this.el.scrollHeight);}});x.s=function(p){return((-Math.cos(p*Math.PI)/2)+0.5)};