var Onetime = Fx.Elements.extend({

	initialize: function(togglers, elements, options){
		this.parent(elements, options);
		togglers.each(function(tog, i){
			$(tog).addEvent('focus', function(){this.showAll()}.bind(this));
			$(tog).addEvent('click', function(){this.showAll()}.bind(this));
		}, this);
		this.togglers = togglers;
		this.h = {}; this.w = {}; this.o = {};
		this.elements.each(function(el, i){
			// this.now[i] = {};
			$(el).setStyles({'height': 0, 'overflow': 'hidden'});
		}, this);
	},

	showThis: function(i){
		this.h = {'height': [this.elements[i].offsetHeight, this.elements[i].scrollHeight]};
		// this.o = {'opacity': [this.now[i]['opacity'] || 0, 1]};
	},

	showAll: function(){
		var objObjs = {};
		var madeInactive = false;
		this.elements.each(function(el, i){
			// this.now[i] = this.now[i] || {};
			this.showThis(i);
			objObjs[i] = Object.extend(this.h, Object.extend(this.o, this.w));
		}, this);
		 // Hide one time options trigger link
		this.options.remove.each(function(el,i){
			// new fx.Height(el, 5).toggle();
			el.setStyles({'overflow': 'hidden'});
			new Fx.Style(el, 'height').custom(el.scrollHeight,0).chain(function(){el.setStyles({'display' :'none'})});
		}.bind(this));
		// remove onclicks
		this.togglers.each(function(tog, i){
			tog.onclick = function(){};
		}, this);
		return this.custom(objObjs);
	}

});
