/* CMSdragon 2008, powered by Alexander Shatalov http://cmsdragon.com 
	CMSDRAGON Resizer effect with opacity, all rigths reserved
*/
RZ = {
	o:[],h:[],i:[],t:[],total:0,e:[],p:[],l:0,speed:15,ease:10,add:35, // ease - opacity diff
	objects:function(i,o,l) {
		//this.e[i]=[];
		//this.e[i][0]=o.parentNode.childNodes[1]; // element 1 to do smth while on/off
		//this.e[i][1]=o.childNodes[1].childNodes[1]; // element 2 to do smth while on/off
		this.o[i]=$('rz_me_'+i); // object to resize
		this.h[i]=parseInt($('rz_img_'+i).height)+this.add; // object origin height
		if((l||l==0)&&!this.l&&i!=l){
			this.l=true;
			var s=$('rz_'+l); // element which is selected,
			//this.e[l]=[];this.e[l][0]=s;this.e[l][1]=s.childNodes[1].childNodes[1];
			this.o[l]=$('rz_me_'+l);
			this.h[l]=parseInt($('rz_img_'+l).height)+this.add;
			this.i[l]=this.h[l];
		}
	},
	slide:function(t,o,total,l){
		if(total){this.total=total}
		this.objects(t,o,l);
		if (!this.i[t]) this.i[t] = 0;
		for (i=this.total-1;i>=0;i--) {
			if (i!=t&&this.o[i]&&this.i[i]) {
				clearTimeout(this.t[i]);this.collapse(i);
				//this.off(i);
			}
		}
		if (this.i[t]<this.h[t]&&(t!=l||this.l)) {
			clearTimeout(this.t[t]);this.expand(t);
			//this.on(t);
		}
	},
	expand:function(i){
		if (this.i[i]>=this.h[i]-Math.floor(this.speed-(this.i[i]/10))){
			this.o[i].style.height=this.h[i]+'px';this.i[i]=this.h[i];return false
		}
		this.i[i]+=Math.floor(this.speed-(this.i[i]/10));
		this.o[i].style.height=Math.abs(this.i[i])+'px';
		//this.op(this.o[i],100+this.ease-this.h[i]+this.i[i]); // opacity
		this.t[i]=setTimeout("RZ.expand("+i+")",25);
	},
	collapse:function(i){
		if (this.i[i]<=this.speed-Math.floor((this.h[i]-this.i[i])/10)){
			this.o[i].style.height='0px';this.i[i]=0;return false
		}
		this.i[i]-=Math.floor(this.speed-((this.h[i]-this.i[i])/10));
		if(this.i[i]<this.speed){this.i[i]-=1}
		this.o[i].style.height=Math.abs(this.i[i])+'px';
		//this.op(this.o[i],100+this.ease-this.h[i]+this.i[i]);
		this.t[i]=setTimeout("RZ.collapse("+i+")",25);
	},
	on:function(i){this.e[i][0].style.background='#eaeaea';this.e[i][1].className='ard'}, // make elements on
	off:function(i){this.e[i][0].style.background='#fbfbfb';this.e[i][1].className='arw'}, // elements to off
	op:function(o,p){if(window.sidebar){o.style.opacity=Math.abs(p)/100}else if(document.all){o.style.filter='alpha(opacity='+Math.abs(p)+')'}}
}












