function scroller (speed,to_scroll,h_vis,curs,curs_move) {
	this.speed=speed;
	this.to_scroll=new getObj(to_scroll);
	this.to_scroll_h=getHeight(to_scroll);
	this.dep_scroll=0;
	this.h_vis=getHeight(h_vis);
	this.curs=new getObj(curs);
	this.curs_h=getHeight(curs);
	this.curs_move=new getObj(curs_move);
	this.dep_curs=parseInt(this.curs_move.style.top);
	this.init_scroll();
}

scroller.prototype.init_scroll = function () {
	this.is_scroll=true;
	this.curs_dif=this.curs_h/this.to_scroll_h;
	this.curs_speed=this.speed*this.curs_dif;
	this.curs_new_h=Math.round(this.curs_h*(this.h_vis/this.to_scroll_h));
	(this.curs_new_h<this.curs_h) ?this.curs.style.height=this.curs_new_h+'px' :this.is_scroll=false;
	this.end_scroll=this.h_vis-this.to_scroll_h;
	this.end_curs=Math.round(parseInt(this.curs_move.style.top)+(this.end_scroll*-1)*this.curs_dif);
}

scroller.prototype.scroll_up = function () {
	if(!this.is_scroll) return this.scroll_stop();
	if(parseInt(this.to_scroll.style.top)<this.dep_scroll){
		this.to_scroll.style.top = parseInt(this.to_scroll.style.top)+this.speed+'px';
		this.curs_move.style.top = this.dep_curs+(Math.floor(parseInt(this.to_scroll.style.top)*this.curs_dif)*-1)+'px';
	} else {
		this.to_scroll.style.top = this.dep_scroll+'px';
		this.curs_move.style.top = this.dep_curs+'px';
	}
}

scroller.prototype.scroll_down = function () {
	if(!this.is_scroll) return this.scroll_stop();
	if(parseInt(this.to_scroll.style.top)>this.end_scroll){
		this.to_scroll.style.top = parseInt(this.to_scroll.style.top)-this.speed+'px';
		this.curs_move.style.top = this.dep_curs+(Math.floor(parseInt(this.to_scroll.style.top)*this.curs_dif)*-1)+'px';
	} else {
		this.to_scroll.style.top = this.end_scroll+'px';
		this.curs_move.style.top = this.end_curs+'px';
	}
}

scroller.prototype.scroll_stop = function () {
	clearInterval(this.int_move);
}