/*
	Moving Background Javascript
	by Victor Zuydweg
	19 oktober 2006
*/

var m = 0;
var d;
var id;

function init()
{
	d = -1;
	id = "_body_ID";
	document.getElementsByTagName('body')[0].id = id;
	setActiveStyleSheet("test");
	start();
}

function change()
{
	d *= -100;
}

function move()
{
	m += d;
	document.getElementById(id).style.backgroundPosition = m + "px center";
}

function start()
{
	intervalID = setInterval(move,35);
}
	
function stop()
{
	clearInterval(intervalID);
}

function setActiveStyleSheet(title)
{
	var i, a, main;
	for(i=0; (a = document.getElementsByTagName("link")[i]); i++)
	{
		if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title"))
		{
			a.disabled = true;
			if(a.getAttribute("title") == title)
			{
				a.disabled = false;
			}
		}
	}
}

if(window.addEventListener)
	window.addEventListener("load", init, false);
else if (window.attachEvent)
	window.attachEvent("onload", init);
else
	window.onload=init;