/* Stairwoo */
function Stairwoo() {
	var Stairwoo = $$('.stairwoo');
	Stairwoo.each(function(el, i) {
		/* init tags */
		var typeEl = el.getFirst().get('tag');
		if(el.hasClass('reassort') == false) {
			var elBottom = new Element(typeEl, { 'class': 'bottom', 'styles': {'background-color': '#d7d7d7'}} );
			var elBottomLink = new Element('a', { 'href': el.getElement('a').get('href'), 'text': el.getElement('a').get('html'), 'styles': {'color': '#000'} });
			elBottom.inject(el ,'bottom');
			elBottomLink.inject(el.getElement('.bottom') , 'bottom')
			/* init fx on TOP element */
			var elHeight = parseInt(el.getStyle('height'))
			var elFX = new Fx.Morph(el.getFirst(), { duration: 300, wait: false, transition: Fx.Transitions.Pow.easeOut });
			elFX.set({ 'margin-top': 0 });
			/* set fx */
			el.getElement('.content').addEvents({
				'mouseenter': function(){ elFX.start({ 'margin-top': -elHeight }); },
				'mouseout': function(){ elFX.start({ 'margin-top': 0 }); }
			});
			el.getElement('.bottom').addEvents({
				'mouseenter': function(){ elFX.start({ 'margin-top': -elHeight }); },
				'mouseout': function(){ elFX.start({ 'margin-top': 0 }); }
			});
		}
	});
}
/* toggling content */
Fx.Tween.Toggle=new Class({
	Extends:Fx.Tween,options:{
	  property:'opacity',
	  from:0,to:1
	},
	toggle:function(event){
		if(event)event.stop();
		(this.toggled)?this.toggleOut():this.toggleIn();
		this.fireEvent('onToggle');
		return this;},
	toggleIn:function(){
		this.toggled=true;
		this.start(this.options.to);
		this.fireEvent('onToggleIn');
		return this;
	},
	toggleOut:function(){
		this.toggled=false;
		this.start(this.options.from);
		this.fireEvent('onToggleOut');
		return this;
	},
	setIn:function(){
		this.toggled=true;
		this.set(this.options.to);
		return this;
	},
	setOut:function(){
		this.toggled=false;
		this.set(this.options.from);
		return this;
	}
});	
