function $(id){
	return document.getElementById ? document.getElementById(id) : document.all[id];
}
function SlideEffect(node, trigger, steps, interval){
	var me = this;
	this.node = node;
	this.node.style.overflow = 'hidden';
	this.node.style.display = 'block';
	this.height = this.node.offsetHeight;
	this.node.style.display = 'none';
	this.trigger = trigger;
	this.steps = steps;
	this.currStep = 0;
	this.open = false;
	this.interval = interval;
	this.timeout = null;
	for(var i = 0; i < nodes.length; i++){
		this.trigger.onmouseover = function(e){me.toggle(e, true)}
		this.trigger.onmouseout = function(e){me.toggle(e, false)}
	}
	me.toggle = function(e, openIt){
		if(openIt == this.open)
			return;
		if(!openIt){
			var rTg = e && e.relatedTarget ? e.relatedTarget : window.event.toElement;
			while(rTg && rTg != this.trigger)
				rTg = rTg.parentNode;
			if(rTg == this.trigger)
				return;
		}
		else if(!this.trigger.className){
			this.trigger.className = 'open';
		}
		this.open = openIt;
		if(!this.timeout){
			if(!openIt && this.trigger.className == 'open')
				this.trigger.className = '';
			me.step();
		}
	}
	me.step = function(){
		this.timeout = null;
		var me = this;
		if(this.currStep > 0 && !this.open || this.currStep < this.steps - 1 && this.open){
			this.node.style.display = 'block';
			this.currStep += this.open ? 1 : -1;
			this.node.style.height = parseInt(this.currStep/this.steps*this.height)+'px';
			this.timeout = window.setTimeout(function(){me.step()}, me.interval);
		}
		else{
			if(!this.open && this.trigger.className == 'open')
				this.trigger.className = '';
			this.node.style.display = this.open ? 'block' : 'none';
			this.node.style.height = 'auto';
		}
	}
}
