
function preloadImages ()
{
	var args = preloadImages.arguments;
	var imageArray = new Array(args.length);
	
	for (i = 0; i < args.length; i++)
	{
		imageArray[i] = new Image;
		imageArray[i].src = args[i];
	}
}






function getWidthOfSponsors ()
{
	var width = 0;
	var teller = 1;
	var dim;
	var obj_now;
	
	while (true)
	{
		obj_now = $('tsponsor_'+teller);
		if (obj_now)
		{
			width += (obj_now.getWidth() + 22);
		}
		else
		{
			break;
		}
		
		teller++;
	}
	
	return width;
}





function rotateSponsors (widthSponsors)
{
	var elem = $('sps');
	
	var teller = 60;
	
	
	var steps = (widthSponsors / 4) + 145;
	
	for (i = 0; i <= steps; i++)
	{
		setTimeout("marginleft()",teller);
		teller += 60;
	}
	
	setTimeout("marginleftis('580')",teller+60);
	
	setTimeout("rotateSponsors("+widthSponsors+")",teller+120);
	
}


function marginleftis (margin)
{
	$('sps').style.marginLeft = margin+"px";
}


function marginleft ()
{
	var marLeft = $('sps').style.marginLeft;
	$('sps').style.marginLeft = (marLeft.substr(0,marLeft.length - 2) - 4) + "px";
	
	
}










document.observe("dom:loaded", function () {
	
	if ($('sps'))
	{
		marginleftis('580');
		var widthSponsors = getWidthOfSponsors();
		rotateSponsors(widthSponsors);
	}
	
});


