var scrollDelay = 20;
var scrollYPosition = 64;
var scrollPos = 0;
var direction = 0;
var pause = 0;
var total = 0;

var isMSIE = /*@cc_on!@*/false;
if (isMSIE) var classStr = "className";
else var classStr = "class";

function scrollText()
{
	var y = 36 + (scrollPos * 72) + (Math.cos( 0 + ((3.1416 * scrollYPosition) / 64)) * 36)
	document.getElementById("scrollContent").style.top = -y + "px";
	if (pause)
	{
		pause --;
	} else {
		if (direction)
		{
			scrollYPosition ++;
			if (scrollYPosition == 64)
			{
				if (scrollPos == 0)
				{
					direction = 0;
				} else {
					scrollYPosition = 0;
					scrollPos--;
				}
				pause = 40;
			}
		} else {
			scrollYPosition --;
			if (scrollYPosition == 0)
			{
				if (scrollPos == total - 2)
				{
					direction = 1;
				} else {
					scrollYPosition = 64;
					scrollPos++;
				}
				pause = 40;
			}
		}
	}
	setTimeout("scrollText()",scrollDelay);
}

function breves_init()
{
	var breveListe = document.getElementsByTagName("div");
	for (var i = 0;li = breveListe[i];i++)
	{
		if (li.getAttribute(classStr) == "breveP") total ++;
	}
	setTimeout("scrollText()",scrollDelay);
}

window.onload = breves_init;