var tWidth = 240;
var tHeight = 70;
var tPadding = 5;
var bWidth = 2;
var font = "±¼¸²";
var fontSize = 9;
var fontsizelastletter = 11;
var fontColor = "008800";
var fontColorlastletter = "066807";
var fontweight = 3;
var bgColor = "#FEFFF0";
var standstill = 2000;
var speed = 40;
var xdistance = 50;
var ydistance = 20;
var timer
var topposition = 0;
var leftposition = 0;
var x,y;
var i_substring = 0;
var i_presubstring = 0;
var i_msg = 0;
var msg
var msgcontent = "";
var msgbackground = "";
var msgpresubstring = "";
var msgaftersubstring = "";
fontweight = fontweight*100;

function getmsgbackground() {
	msgbackground="<table border="+bWidth+" width="+tWidth+" height="+tHeight+" cellspacing=0 cellpadding=0><tr><td valign=top bgcolor='"+bgColor+"'>";
	msgbackground+="&nbsp;</td></tr></table>";
}

function getmsgcontent() {
	msgcontent="<table border=0 cellspacing=0 cellpadding="+tPadding+" width="+tWidth+" height="+tHeight+"><tr><td valign=top>"
	msgcontent+="<span style='position:relative; font-family:"+font+";color:"+fontColor+";font-size:"+fontSize+"pt;font-weight:"+fontweight+"'>"
	msgcontent+="<font color='"+fontColor+"'>"
	msgcontent+=msgpresubstring
	msgcontent+=""
	msgcontent+="</span>"
	msgcontent+="<span style='position:relative; font-family:"+font+";color:"+fontColor+";font-size:"+fontsizelastletter+"pt;font-weight:900'>"
	msgcontent+="<font color='"+fontColorlastletter+"'>"
	msgcontent+=msgaftersubstring
	msgcontent+=""
	msgcontent+="</span>"
	msgcontent+="</td></tr></table>"
}

function showticker() {
	if (i_substring<=msg.length-1) {
		i_substring++
		i_presubstring=i_substring-1
		if (i_presubstring<0) {i_presubstring=0}
		msgpresubstring=msg.substring(0,i_presubstring)
		msgaftersubstring=msg.substring(i_presubstring,i_substring)
		getmsgcontent()
		if (document.all) {
			ticker.innerHTML=msgcontent
			timer=setTimeout("showticker()", speed)
		}
		if (document.layers) {
			document.ticker.document.write(msgcontent)
			document.ticker.document.close()
			timer=setTimeout("showticker()", speed)
		}
	} else {
		clearTimeout(timer)
	}
}

function hideticker() {
	clearTimeout(timer)
	i_substring=0
	i_presubstring=0
	if (document.all) {
		document.all.ticker.style.visibility="hidden"
		document.all.tickerbg.style.visibility="hidden"
	}
	if (document.layers) {
		document.ticker.visibility="hidden"
		document.tickerbg.visibility="hidden"
	}
}

function showmsg(linkmsg) {
	getmsgbackground()
	msg=linkmsg

	i_substring=0
	i_presubstring=0
	leftposition=x+xdistance
	topposition=y+ydistance
	if (document.all) {
		document.all.ticker.style.posLeft=leftposition
		document.all.ticker.style.posTop=topposition
		document.all.tickerbg.style.posLeft=leftposition
		document.all.tickerbg.style.posTop=topposition
		tickerbg.innerHTML=msgbackground
		document.all.ticker.style.visibility="visible"
		document.all.tickerbg.style.visibility="visible"
		showticker()
	}
	if (document.layers) {
		document.ticker.left=leftposition
		document.ticker.top=topposition
		document.tickerbg.left=leftposition
		document.tickerbg.top=topposition
		document.tickerbg.document.write(msgbackground)
		document.tickerbg.document.close()
		document.ticker.visibility="visible"
		document.tickerbg.visibility="visible"
		showticker()
	}
}

function handlerMM(e){
	x = (document.layers) ? e.pageX : document.body.scrollLeft+event.clientX
	y = (document.layers) ? e.pageY : document.body.scrollTop+event.clientY
}

if (document.layers) document.captureEvents(Event.MOUSEMOVE);

document.onmousemove = handlerMM;