// alert(o);
function scroll(divid, height, rolling_num, arrContents)
{
	// º¯¼öÀÇ ÇÒ´ç
	this.ie = navigator.userAgent.indexOf('MSIE')>=0; // ie
	this.div = document.all[divid]; 
	// this.to=this.j=0;
	// this.po=1;
	this.scrollStop=false;  
    this.arrContents=arrContents; 
	this.rolling=rolling_num; // ³ôÀÌ°¡ È¦¼öÀÌ¸é 3 Â¦¼öÀÌ¸é 2  // %¿¬»êÀÚ - ³ª¸ÓÁö°è»ê
	// this.up = height; 
	this.height = height; 
	// this.down = 0-height;
	// alert(this.height);

	// ÇÔ¼ö¸¦ ÇöÀç °´Ã¼¿¡ ÇØ´çµÇµµ·Ï ÇÒ´ç
	this.start = scroll_start;
	this.go = scroll_go;

	this.gt = scroll_gt; // IE¸é pixelTop NE¸é top
	this.chgdata = scroll_chgdata; 
	this.chog = scroll_chog; 
	return this; 
}
function scroll_start(objName)
{
	// alert(objName); // objName=Notice
	this.chgdata(1);
	this.chog(1,objName);
	this.scrollStop = true; // false=¸ØÃã
}
function scroll_go(o) // div[e1]À» °¡¸£Å°±â À§ÇÔ
{
	// alert(this.div.all['e'+o].value);
	return this.div.all['e'+o];
}
function scroll_gt()
{
	// alert(this.ie);
	return this.ie?"pixelTop":"top"; // ÀÍ½ºÇÁ·Ñ·¯ÀÎ°¡ ¾Æ´Ñ°¡...
}
function scroll_chgdata(o) 
{ 
	// alert(o);
	var szhtml = ""; 
	for(var idx=0; idx< this.arrContents.length; idx++)
		szhtml += "<div style='height:"+this.height+"'>"+this.arrContents[idx]+"</div>";  
	this.go(o).innerHTML = szhtml; 	
}
function scroll_chog(o,objName)
{
	// alert(o+'---'+objName);
	if (this.arrContents.length==0) 
		return;
        if (this.scrollStop) 
			// alert(this.gt());
              eval("this.go(o).style."+this.gt()+"=parseInt(this.go(o).style."+this.gt()+")-"+this.rolling+";"); 
        if (parseInt(eval("this.go(o).style."+this.gt())%this.height) == 0) 
		{
		if( parseInt(eval("this.go(o).style."+this.gt())) == this.height*this.arrContents.length*-1) 
			eval("this.go(o).style."+this.gt()+"=0;");
		setTimeout("scroll_settimeout("+o+",'"+objName+"')",4000);
		}	
	else
		setTimeout("scroll_settimeout("+o+",'"+objName+"')",1);
}
function scroll_settimeout(o,objName)
{
	obj = eval(objName); obj.chog(o,objName);
}