function sScroll(id_1, id_2){
	this.scroll_speed = 1;
	this.scroll_rate = 10;
	this.delay = 1000;

	this.direction = "up";
	this.t_id = 0;

	this.objs_1 = document.getElementById(id_1);
	this.objs_2 = document.getElementById(id_2);

	this.scroll = scroll;
	this.set_direction = set_direction;
	this.scroll_up = scroll_up;
	this.scroll_down = scroll_down;
	this.scroll_stop = scroll_stop;
	this.scroll_start = scroll_start;

	this.objs_2.style.pixelTop = -(this.offset_count * this.offset_height);

	this.set_direction(this.direction);
	this.refresh_function = "rload";
}
function set_direction(dir){
	this.direction = dir;
}
function scroll(){
	if(this.offset_count >= 2){
		if(this.direction == "up")
			this.scroll_up();
		else
			this.scroll_down();
		this.scroll_start();
	}
}
function scroll_up(){
	this.objs_1.style.pixelTop-= this.scroll_speed;
	this.objs_2.style.pixelTop-= this.scroll_speed;

	if(this.objs_1.style.pixelTop == -((this.offset_count - 1) * this.offset_height))
		this.objs_2.style.pixelTop = this.offset_height;
	if(this.objs_2.style.pixelTop == -((this.offset_count - 1) * this.offset_height))
		this.objs_1.style.pixelTop = this.offset_height;
}
function scroll_down(){
	this.objs_1.style.pixelTop+= this.scroll_speed;
	this.objs_2.style.pixelTop+= this.scroll_speed;

	if(this.objs_1.style.pixelTop == 0)	this.objs_2.style.pixelTop = -(this.offset_count * this.offset_height);
	if(this.objs_2.style.pixelTop == 0)	this.objs_1.style.pixelTop = -(this.offset_count * this.offset_height);
}
function scroll_stop(){
	clearTimeout(this.t_id);
}
function scroll_start(){
	if(Math.abs(this.objs_1.style.pixelTop % this.offset_height) == 0){
		clearTimeout(this.t_id);
		this.t_id = setTimeout(this.refresh_function + "()", this.delay);
	}
	else{
		this.t_id = setTimeout(this.refresh_function + "()", this.scroll_rate);
	}
}

//function rload(){
//	obj_scr.scroll();
//}
//var obj_scr = new sScroll("id_scroll_1", "id_scroll_2");
//obj_scr.scroll_speed = 5;
//obj_scr.scroll_rate = 10;
//obj_scr.delay = 2000;
//
//obj_scr.offset_height = 255;
//obj_scr.offset_count = parseInt("<?=$loop_cnt / $br_cnt?>", 10);
//
//obj_scr.direction = "up";
//
//
//obj_scr.t_id = setTimeout("rload()", obj_scr.scroll_rate);
