<!--
//rolling script

var htmlstr = '', flag=true, imgflag=true, mouse=1, mouse_img=1, speed=1, wait=3000, temp=0, temp2=0, temp3=0, height=19, amount=19, ctnt_temp=0, ctnt_i_temp=0, ctnt_v_temp=0;
var ctnt=new Array(), ctnt_i=new Array(), ctnt_v=new Array(), startPanel=0, n_panel=0, i=0, j=0, count=1, count2=1, count3=1;



function startText() {
  now = new Date(); ran = now % ctnt.length;
  ctnt_temp = ctnt[ran]; ctnt[ran] = ctnt[0]; ctnt[0] = ctnt_temp;
  for (i=0; i<ctnt.length; i++) insertText(i);
  scroll_area0.style.display='';


  flag=true;
//  imgflag=true;
  window.setTimeout("scroll2()",wait);
}

function startVideo() {
  for (i=0; i<ctnt_v.length; i++) {
  	insertVideo(i);
  }

  videoflag=true;
  window.setTimeout("scroll()",wait);
}

function startImage() {
  now = new Date(); ran = now % ctnt_i.length;
  ctnt_i_temp = ctnt_i[ran]; ctnt_i[ran] = ctnt_i[0]; ctnt_i[0] = ctnt_i_temp;
  for (i=0; i<ctnt_i.length; i++) insertImg(i);
  img_area0.style.display='';


//  flag=true;
  imgflag=true;
//  window.setTimeout("scroll2()",wait);
}


function insertText(i) {
  htmlstr='<div style="left: 0px; width: 290px; display=none;" onMouseover="mouse=0" onMouseout="mouse=1" id="scroll_area'+i+'">';
  htmlstr+=ctnt[i]+''+'</div>';
  document.writeln(htmlstr);
}
function insertVideo(i) {
  htmlstr='<div style="padding:0;border:none;margin:0;left: 0px; width: 390px; position: absolute; top: '+(height*i)+'px;" display=none;" onMouseover="mouse=0" onMouseout="mouse=1" id="video_area'+i+'">';
  htmlstr+=ctnt_v[i]+'</div>';
  document.write(htmlstr);
}
function insertImg(i) {
  htmlstr='<div style="left: 0px; width: 270px; display=none;" onMouseover="mouse=0" onMouseout="mouse=1" id="img_area'+i+'">\n';
  htmlstr+=ctnt_i[i]+'\n'+'</div>\n';
  document.write(htmlstr);
}


function scroll() {
  if (mouse && videoflag) {
    for (j=0;j<ctnt_v.length;j++) {
      temp3++;
	  tmp3 = document.getElementById('video_area'+j).style;
      tmp3.top = parseInt(tmp3.top)-speed;

	  if (parseInt(tmp3.top) <= height*(-1)) {
        tmp3.top = height*(ctnt_v.length - 1);
      }

	  if (temp3>=ctnt_v.length*height) {
        videoflag=false;
        temp3=0;
      }
    }
  }
  window.setTimeout("scroll()",3);
}


function scroll2() {

	videoflag=true;
	flag=true;
	imgflag=true;
	if (mouse && flag) {
			if (temp == 0 && flag) {
				for (j=0;j<ctnt.length;j++) {
					tmp = document.getElementById('scroll_area'+j).style;
					if (count % ctnt.length == j) {
						tmp.display = '';
					} else {
						tmp.display = 'none';
					}
				}
				flag=false;
				count++;
			}


			if (temp2 == 0 && imgflag) {
				for (j=0;j<ctnt_i.length;j++) {
					tmp2 = document.getElementById('img_area'+j).style;
					if (count2 % ctnt_i.length == j) {
						tmp2.display = '';
					} else {
						tmp2.display = 'none';
					}
				}
				imgflag=false;
				count2++;
			}

	}
	now = new Date();
	window.setTimeout("scroll2()",wait);

}




//rollScript(bugs ¹öÀü//)
BE=function(className) {
	document.write("<div id='BEPLayer_"+ className +"'><div id='BELayer_"+ className +"' style='padding-left:5px;'></div></div>");
	this.item = [];
	this.width = this.height = this.speed = this.pixel = this.interval =
	this.size = this.moveCount = this.X = this.Y = 0;
	this.pLayer = document.getElementById("BEPLayer_"+ className);
	this.layer = document.getElementById("BELayer_"+ className);
	this.align = "left";
	this.intervalId = null;
	this.className = className;
	this.isPause = false;
	this.direction = "Z"			//·Ñ¸µ¹æÇâ(±âº» YÃà)
	this.valign = "middle";
}
BE.prototype.init = function() {
	with (this.pLayer.style) {
	    width = this.width+"px";
	    height = this.height+"px";
	    overflow = "hidden";
	    position = "relative";
	}
	with (this.layer.style) {
		if(this.direction=="Y"){
		    width = this.width+"px";
		    height = this.size*(this.item.length+1)+"px";
	   	}else{
		    height = this.height+"px";
		    width = this.size*(this.item.length+1)+"px";		    
		}
	    top = 0;
	    left = 0;
	    position = "relative";
	}
	if(this.direction=="Y"){
		for (var i=0; i<parseInt(this.height / this.size, 10)+1; i++){
		    this.item[this.item.length] = this.item[i];
		}
	}else{
		for (var i=0; i<parseInt(this.width / this.size, 10)+1; i++){
		    this.item[this.item.length] = this.item[i];
		}
	}		
		this.X = this.Y = 0;

	var html = "<div onmouseover='"+this.className+".pause()' onmouseout='"+this.className+".unpause()'>";

	    html += "<table width='"+ this.layer.style.width +"' cellspacing='0' cellpadding='0' border='0'>";
	    if(this.direction=="Y"){
		    for (var i in this.item){
		        html += "<tr><td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='"+this.valign+"'>"+this.item[i]+"</td></tr>";
	        }
	    }else{
		    html += "<tr>";
		    for (var i in this.item){
		        html += "<td width='"+this.size+"' style='overflow:hidden' align='"+this.align+"'>"+this.item[i]+"</td>";
	       }
		    html +="</tr>";
		}		    
	    html += "</table>";

	html += "</div>";
	this.layer.innerHTML = html;
	this.start();
}
BE.prototype.start = function() {
    this.intervalId = setInterval(this.className+".move()", this.speed);
}
BE.prototype.move = function() {
	if (this.isPause) return;
	
	if (this.direction=="Y"){
		this.Y -= this.pixel;
		if (Math.abs(this.Y)%this.size==0) this.stop();
		    this.layer.style.top = this.Y;
	}else{
		this.X -= this.pixel;
		if (Math.abs(this.X)%this.size==0) this.stop();
		    this.layer.style.left = this.X;
	}
}
BE.prototype.stop = function() {
	clearInterval(this.intervalId);
	if(this.direction=="Y"){
		if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0;
	}else{
		if (Math.abs(this.X) >= parseInt(this.layer.style.width,10)-this.size) this.X = this.layer.style.top = 0;
	}		
	setTimeout(this.className+".start()", this.interval);
}

BE.prototype.pause = function() {this.isPause = true;}
BE.prototype.unpause = function() {this.isPause = false;}






//rollScript(bugs ¹öÀü//)
//BE object¿Í µ¿ÀÏ ÇÏÁö¸¸, rolling¿¡ »ç¿ëµÇ´Â div¸¦ innerHTML Ãß°¡ÇÔ.
RO=function(parentID, className) {
	var RO_Div = "<div id='ROPLayer_"+ className +"'><div id='ROLayer_"+ className +"' style='padding-left:5px;'></div></div>"
	//document.write(RO_Div);
	document.getElementById(parentID).innerHTML = RO_Div;
	
	this.item = [];
	this.width = this.height = this.speed = this.pixel = this.interval =
	this.size = this.moveCount = this.X = this.Y = 0;
	this.pLayer = document.getElementById("ROPLayer_"+ className);
	this.layer = document.getElementById("ROLayer_"+ className);
	this.align = "left";
	this.intervalId = null;
	this.className = className;
	this.isPause = false;
	this.direction = "X"			//·Ñ¸µ¹æÇâ(±âº» YÃà)
}
RO.prototype.init = function() {
	with (this.pLayer.style) {
	    width = this.width+"px";
	    height = this.height+"px";
	    overflow = "hidden";
	    position = "relative";
	}
	with (this.layer.style) {
		if(this.direction=="Y"){
		    width = this.width+"px";
		    height = this.size*(this.item.length+1)+"px";
	   	}else{
		    height = this.height+"px";
		    width = this.size*(this.item.length+1)+"px";		    
		}
	    top = 0;
	    left = 0;
	    position = "relative";
	}
	if(this.direction=="Y"){
		for (var i=0; i<parseInt(this.height / this.size, 10)+1; i++){
		    this.item[this.item.length] = this.item[i];
		}
	}else{
		for (var i=0; i<parseInt(this.width / this.size, 10)+1; i++){
		    this.item[this.item.length] = this.item[i];
		}
	}		
		this.X = this.Y = 0;

	var html = "<div onmouseover='"+this.className+".pause()' onmouseout='"+this.className+".unpause()'>";

	    html += "<table width='"+ this.layer.style.width +"' cellspacing='0' cellpadding='0' border='0'>";
	    if(this.direction=="Y"){
		    for (var i in this.item){
		        html += "<tr><td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='top'>"+this.item[i]+"</td></tr>";
	        }
	    }else{
		    html += "<tr>";
		    for (var i in this.item){
		        html += "<td height='"+this.size+"' style='overflow:hidden' align='"+this.align+"' valign='top'>"+this.item[i]+"</td>";
	       }
		    html +="</tr>";
		}		    
	    html += "</table>";

	html += "</div>";
	this.layer.innerHTML = html;
	this.start();
}
RO.prototype.start = function() {
    this.intervalId = setInterval(this.className+".move()", this.speed);
}
RO.prototype.move = function() {
	if (this.isPause) return;
	
	if (this.direction=="Y"){
		this.Y -= this.pixel;
		if (Math.abs(this.Y)%this.size==0) this.stop();
		    this.layer.style.top = this.Y;
	}else{
		this.X -= this.pixel;
		if (Math.abs(this.X)%this.size==0) this.stop();
		    this.layer.style.left = this.X;
	}
}
RO.prototype.stop = function() {
	clearInterval(this.intervalId);
	if(this.direction=="Y"){
		if (Math.abs(this.Y) >= parseInt(this.layer.style.height,10)-this.size) this.Y = this.layer.style.top = 0;
	}else{
		if (Math.abs(this.X) >= parseInt(this.layer.style.width,10)-this.size) this.X = this.layer.style.top = 0;
	}		
	setTimeout(this.className+".start()", this.interval);
}

RO.prototype.pause = function() {this.isPause = true;}
RO.prototype.unpause = function() {this.isPause = false;}

//--

//-->
