var tTR, tLeft, tLi, tMax, tSpeed;
function initTicker() {
	tLi = $("#ticker li");
	tTR = $("#ticker table tr");
	tLeft = 0;
	tSpeed = 39;
	
	tMax = 0 - parseInt($("#ticker td").eq(0).css("width"));
	tTimer = setInterval("loop();", tSpeed);
	
	loop();
	$("#ticker").hover(function() {
		clearTimeout(tTimer);
	}, function() {
		tTimer = setInterval("loop();", tSpeed);
	})
}

function loop() {
	tLeft = tLeft - 3;
	if(tLeft < tMax) {
		tTR.append($("#ticker td").eq(0));
		tLeft = tLeft - tMax;
		tMax = 0 - parseInt($("#ticker td").eq(0).css("width"));
	}
	$(tLi).css("left", tLeft + "px");
	
}
