function Slider(id){this.id = id;}
Slider.prototype.step = 30;
Slider.prototype.delay = 10;
Slider.prototype.procId = null;
Slider.prototype.getHeight = function(){return document.getElementById(this.id).offsetHeight;};
Slider.prototype.getFullHeight = function(){return document.getElementById(this.id).scrollHeight;};
Slider.prototype.setHeight = function(n){document.getElementById(this.id).style.height = n + ( typeof n == 'number' ? "px" : "" );};
Slider.prototype.direction = 1;
Slider.prototype.swapDirection = function(){this.direction *= -1;};
Slider.prototype.stop = function (){clearInterval(this.procId); this.procId=null; this.swapDirection();};
Slider.prototype.proc = function()
{
	var h = this.getHeight() + this.step*this.direction;
	
	if ( this.direction === 1 )
	{
		if ( h >= this.getFullHeight() ) { this.stop(); h = '100%'; }
	}
	else
	{
		if ( h <= 0 ) { this.stop(); h = 0; }
	}
	
	this.setHeight( h );
};
Slider.prototype.run = function(){ if (this.procId) this.stop(); var o = this;	this.procId = setInterval(function(){o.proc();}, this.delay); };
