var tickspeed = 100;
var tickspeedpx = 0;
var tickspeedfast = 10;
var tickin;
var tickpos = 0;
var temppos = 0;

function loadTicker() {
	tickin = document.getElementById('contentscroll');
	if (!tickin || !tickin.offsetHeight)
		return;
	document.getElementById('contentouter').className = 'scroll';
	document.getElementById('contentinner').className = 'scroll';
	document.getElementById('scroll').className = 'scroll';

	var ticku = document.getElementById('scrolldown');
	var tickd = document.getElementById('scrollup');
	ticku.onclick = tickd.onclick = function () { return false; };
	ticku.onmousedown = function () { tickerPos(tickspeedfast * -1); startTicking(); };
	tickd.onmousedown = function () { tickerPos(tickspeedfast); startTicking(); };
	ticku.onmouseup = tickd.onmouseup = function () { tickerPos(); };
	ticku.onmouseout = tickd.onmouseout = function () { tickerPos(); };
}

function startTicking() {
	temppos = tickpos+tickspeedpx;
	if (tickspeedpx < 0 && temppos < -tickin.offsetHeight+tickin.parentNode.offsetHeight-20) return;
	else if (tickspeedpx > 0 && temppos > 0) return;
	if (!tickspeedpx) return;
	tickpos = temppos;
	tickin.style.top = temppos+'px';
	setTimeout('startTicking();', tickspeed);
}

function tickerPos(newtickspeed) {
	if (!newtickspeed)
		tickspeedpx = 0;
	else
		tickspeedpx = newtickspeed;
}

loadTicker();