// JavaScript Document
var TickerBarwidth=850; 	// ´º½º Æ½Ä¿ÀÇ Æø
var setdelay=3000; 	// ´ÙÀ½ ¸Þ½ÃÁö°¡ ³ª¿Ã¶§ ±îÁöÀÇ ½Ã°£ : ´ÜÀ§ ¹Ì¸®ÃÊ
var mouseover_color='#E1FFE1'; // ¸¶¿ì½º°¡ OVER µÇ¾úÀ»¶§ÀÇ »ö»ó
var mouseout_color='#FFFFFF'; // ´º½ºÆ½Ä¿ÀÇ ±âº»»ö
var count=0;
var ns6=document.getElementById&&!document.all;
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1;

if (ie4||ns6){
	document.write('<input type="button" value="<" onclick="MoveTicker(0)" style="font-size:16px; width:20; border-right-width:0px;" name="prev" title="Previous News"><input type="button" name="HomeTickerbar" onclick="goURL();" style="font-size:16px; color:#000000;background:#FFFFFF; width:'+TickerBarwidth+'px; border-width:1; border-color:#000000; cursor:hand" onmouseover="this.style.background=mouseover_color" onmouseout="this.style.background=mouseout_color"><input type="button" value=">" onclick="MoveTicker(1)" style="font-size:16px; width:22;  border-left-width:0px;" name="next" title="Next News">');
}
else{
	document.write('<input type="button" value="Previous" onclick="MoveTicker(0)">');

	if (navigator.userAgent.indexOf("Opera")!=-1)
		document.write('<input type="button" name="HomeTickerbar" onclick="goURL();" style="width:'+TickerBarwidth+'px" border="0">');
	else	document.write('<input type="button" name="HomeTickerbar" onclick="goURL();" width="'+TickerBarwidth+'px" border="0">');
	
	document.write('<input type="button" value="Next" onclick="MoveTicker(1)">');
}

function init_news_bar(){
  document.frmMain.HomeTickerbar.value=TickerMsgs[count];
}

function MoveTicker(how){

	if (how==1){ //cycle foward
		if (count<TickerMsgs.length-1)	count++;
		else	count=0;
	}
	else{
		if (count==0)		count=TickerMsgs.length-1;
		else	count--;
	}
	document.frmMain.HomeTickerbar.value=TickerMsgs[count];
}

setInterval("MoveTicker(1)",setdelay);

function goURL(){
 location.href=TickerMsgURL[count];
}

init_news_bar();

