function StartRotation(rot, speed, dir)
{
	RotObj = document.getElementById(rot);
	if (RotObj)
	{
		RotObj.style.display = 'block';
		RotObj.style.position = 'absolute';
		TextWidth = RotObj.clientWidth;
		RotObj.style.position = 'relative';
		if (dir == 'rtl') // right to left
		{
			RotObj.style.left = TextWidth;
			Speed = -speed;
		}
		else // left to right
		{
			RotObj.style.left = -RotObj.parentElement.clientWidth;
			Speed = speed;
		}
		setTimeout("rotate('" + rot + "', " + Speed + ", " + TextWidth + ")",50);
	}
	else
	{
		alert('No such element in document: ' + rot);
	}
}

function rotate(objid, speed, textwidth)
{
	obj = document.getElementById(objid);
	obj.style.left = parseInt(obj.style.left) + speed;
	if (speed < 0 && parseInt(obj.style.left) < -obj.parentElement.clientWidth) // rtl
		obj.style.left = textwidth;
	else if (speed > 0 && parseInt(obj.style.left) > textwidth) // ltr
		obj.style.left = -obj.parentElement.clientWidth;
	setTimeout("rotate('" + objid + "', " + speed + ", " + textwidth + ")",50);
	document.getElementById('info').innerHTML = 'left: ' + obj.style.left;
	//alert();
}

function Init()
{
	window.resizeTo(1024,740);
	//RotObj = document.getElementById('MsgRotator');
	//RotObj.style.display = 'block';
	
	//StartRotation('MsgRotator', 10, 'rtl');
}

// Image Preload
var IButton = new Image();
IButton.src = 'images/right_button_hover.gif';
var IArchive0 = new Image();
IArchive0.src = 'images/right_archive0_hover.gif';
var ILink = new Image();
IArchive0.src = 'images/right_link_hover.gif';
