<!--
var scrollTool = {
	prev_img : '' ,
	prev2_img : '' ,
	next_img : '' ,
	next2_img : '' ,
	name_id : '' ,
	act_txt : '' ,
	act_time : 0 ,
	total_cnt : 0,
	start_cnt : 0,
	end_cnt : 0,
	term_cnt : 0,
	set_time : '',

	init : function ()
	{

		this.name_id = (arguments.length>0)?arguments[0]:'';
		this.total_cnt = (arguments.length>1)?arguments[1]:0;
		this.term_cnt = (arguments.length>2)?arguments[2]:0;
		this.end_cnt = (arguments.length>3)?arguments[3]:this.term_cnt;
		this.prev_img = (arguments.length>4)?arguments[4]:'';
		this.prev2_img = (arguments.length>5)?arguments[5]:'';
		this.next_img = (arguments.length>6)?arguments[6]:'';
		this.next2_img = (arguments.length>7)?arguments[7]:'';
		this.act_txt = (arguments.length>8)?arguments[8]:'';
		this.act_time = (arguments.length>9)?arguments[9]:0;

		this.start_cnt = 0;
		this.action();
		this.btn_action();
		this.page();
		if( this.act_txt == "auto" ) { 
			this.auto_wait();
		}
	},
	prev : function ()
	{
			this.name_id = (arguments.length>0)?arguments[0]:this.name_id;
			if( this.start_cnt > 0 ) { 
				this.start_cnt = this.start_cnt-this.term_cnt; 
				this.end_cnt = this.end_cnt-this.term_cnt; 
				this.action(); 
			} else if( this.act_txt == "auto" || this.act_txt == "loop" ) {
				this.start_cnt = this.start_cnt-this.term_cnt; 
				this.end_cnt = this.end_cnt-this.term_cnt; 
				this.action(); 
			}
	},
	next : function ()
	{
			if( this.end_cnt < this.total_cnt ) { 
				this.start_cnt = this.start_cnt+this.term_cnt; 
				this.end_cnt= this.end_cnt+this.term_cnt; 
				this.action();
			} else if( this.act_txt == "auto" || this.act_txt == "loop" ) {
				this.start_cnt = this.start_cnt+this.term_cnt; 
				this.end_cnt= this.end_cnt+this.term_cnt; 
				this.action(); 
			}
	},
	page : function ()
	{
			var tcnt = Math.ceil(this.total_cnt/this.term_cnt);
			var scnt = Math.ceil( this.start_cnt / this.term_cnt ) + 1;
			try{ document.getElementById(this.name_id + "_page").innerHTML= scnt+'/' + tcnt; } catch(e) {}
	},
	action : function ()
	{
			if( this.act_txt == "auto" || this.act_txt == "loop" ) {
				if ( this.start_cnt < 0 ) {
						this.start_cnt = this.start_cnt - (this.end_cnt - this.total_cnt);
						this.end_cnt = this.total_cnt;
				} 
				if ( this.end_cnt > this.total_cnt ) {
						this.end_cnt = this.end_cnt - this.start_cnt ;
						this.start_cnt = 0;
				}
			} else {
				if ( this.start_cnt <= 0 ) {
						this.end_cnt = this.end_cnt - this.start_cnt ;
						this.start_cnt = 0;
				} 
				if ( this.end_cnt >= this.total_cnt ) {
						this.start_cnt = this.start_cnt - (this.end_cnt - this.total_cnt);
						this.end_cnt = this.total_cnt;
				}
			}
			this.btn_action();
			this.page();
			for(var x=0;x<this.total_cnt;x++){
				if( x >= this.start_cnt && x < this.end_cnt ) {
					try{ document.getElementById(this.name_id + "_" + x).style.display = 'block'; } catch(e) {}
				} else {
					try{ document.getElementById(this.name_id + "_" + x).style.display = 'none'; } catch(e) {}
				}
			}
	},
	auto_wait : function ()
	{
		if( this.act_time>0 ) {
			var time = this.act_time*1000;
			this.set_time = setTimeout("scrollTool.auto()", time);
		}
	},
	auto : function ()
	{
		try{ clearTimeout(this.set_time); } catch(e) {}
		this.next();
		this.auto_wait();
	},

	btn_action : function ()
	{

			if( this.start_cnt > 0 ) {

				// ±âº» Prev¹öÆ° Å¬¸¯ °¡´É
				if( this.prev_img != '' ) {
					try{ document.getElementById(this.name_id  + "_prev").src = this.prev_img; } catch(e) {}
				}
				try{ document.getElementById(this.name_id  + "_prev").style.cursor = "pointer"; } catch(e) {}
				try{ document.getElementById(this.name_id  + "_prev").style.filter = "alpha(opacity=100)"; } catch(e) {}
				try{ document.getElementById(this.name_id  + "_prev").disabled = false; } catch(e) {}

			} else {
				if( this.act_txt != "auto" && this.act_txt != "loop" ) {
					// ±âº» Prev¹öÆ° Å¬¸¯ ÇÒ¼ö ¾øÀ½
					if( this.prev2_img != '' ) {
						try{ document.getElementById(this.name_id  + "_prev").src = this.prev2_img; } catch(e) {}
					} else {
						try{ document.getElementById(this.name_id  + "_prev").style.filter = "alpha(opacity=35) gray()"; } catch(e) {}
					}
					try{ document.getElementById(this.name_id  + "_prev").style.cursor = "default"; } catch(e) {}
					try{ document.getElementById(this.name_id  + "_prev").disabled = true; } catch(e) {}
				}
			}

			if( this.end_cnt < this.total_cnt ) {

				// ±âº» Next¹öÆ° Å¬¸¯ °¡´É
				if( this.next_img != '' ) {
					try{ document.getElementById(this.name_id  + "_next").src = this.next_img; } catch(e) {}
				}
				try{ document.getElementById(this.name_id  + "_next").style.cursor = "pointer"; } catch(e) {}
				try{ document.getElementById(this.name_id  + "_next").style.filter = "alpha(opacity=100)"; } catch(e) {}
				try{ document.getElementById(this.name_id  + "_next").disabled = false; } catch(e) {}

			} else {

				if( this.act_txt != "auto" && this.act_txt != "loop" ) {
					// ±âº» Next¹öÆ° Å¬¸¯ ÇÒ¼ö ¾øÀ½
					if( this.next2_img != '' ) {
						try{ document.getElementById(this.name_id  + "_next").src = this.next2_img; } catch(e) {}
					} else {
						try{ document.getElementById(this.name_id  + "_next").style.filter = "alpha(opacity=35) gray()"; } catch(e) {}
					}
					try{ document.getElementById(this.name_id  + "_next").style.cursor = "default"; } catch(e) {}
					try{ document.getElementById(this.name_id  + "_next").disabled = true; } catch(e) {}
				}
			}

	}
}
//-->
