var tickerWidth="490px"
var tickerHeight="19px"
var tickerSpeed=1
var copySpeed=tickerSpeed
var actualWidth, ticker, ticker2

document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+tickerContent+'</span>')

function fillUp(){
	ticker=document.getElementById? document.getElementById("content") : document.all.content
	ticker2=document.getElementById? document.getElementById("content2") : document.all.content2
	if (getCookie("lastTickerPos")!="" && getCookie("lastTicker2Pos")!="")
		reviveLastPositions()
	ticker.innerHTML=ticker2.innerHTML=tickerContent
	actualWidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
	ticker2.style.left=actualWidth+360+"px"
	lefttime=setInterval("slideLeft()",35)
}

window.onload=fillUp
window.onUnload=savePositions

function slideLeft(){
	if (parseInt(ticker.style.left)>(actualWidth*(-1)+8))
		ticker.style.left=parseInt(ticker.style.left)-copySpeed+"px"
	else
		ticker.style.left=parseInt(ticker2.style.left)+actualWidth+5+"px"

	if (parseInt(ticker2.style.left)>(actualWidth*(-1)+8))
		ticker2.style.left=parseInt(ticker2.style.left)-copySpeed+"px"
	else
		ticker2.style.left=parseInt(ticker.style.left)+actualWidth+5+"px"
}

function getCookie(name) {
	var search = name + "="
	var returnvalue = ""
	if (document.cookie.length > 0) {
		offset = document.cookie.indexOf(search)
		if (offset != -1) {
			offset += search.length
			end = document.cookie.indexOf(";", offset)
			if (end == -1)
				end = document.cookie.length;
				returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;	
}

function savePositions(){	
	document.cookie="lastTickerPos="+ticker.style.left
	document.cookie="lastTicker2Pos="+ticker2.style.left
}

function reviveLastPositions(){
	lastTickerPos=parseInt(getCookie("lastTickerPos"))
	ticker.style.left=parseInt(lastTickerPos)+"px"

	lastTicker2Pos=parseInt(getCookie("lastTicker2Pos"))
	ticker2.style.left=parseInt(lastTicker2Pos)+"px"
}

with (document){
	write('<table border="0" cellspacing="0" cellpadding="0"><td>')
	write('<div style="position:relative;width:'+tickerWidth+';height:'+tickerHeight+';overflow:hidden;">')
	write('<div id="content" style="position:absolute;left:355px;top:0px;padding-top:4px" onMouseover="copySpeed=0" onMouseout="copySpeed=tickerSpeed"></div>')
	write('<div id="content2" style="position:absolute;left:355px;top:0px;padding-top:4px" onMouseover="copySpeed=0" onMouseout="copySpeed=tickerSpeed"></div>')
	write('</div></td></table>')
}