

var scList=Array();
var scCurrent = 0;


window.addEvent('domready', function()
{
	if (scList.length > 0)
	{
		scCurrent = Math.round(Math.random()*(scList.length-1));
		scSet();
	}
});

function scSet()
{
	var NewImage ='<img src="files/'+scList[scCurrent][1]+'" id="background" />';
	$('backgroundcontainer').set('html', NewImage);
}

function scPrev()
{
	scCurrent--;

	if (scCurrent < 0)
	{
		scCurrent=(scList.length-1);
	}
	
	scSet();
}

function scNext()
{
	scCurrent++;

	if (scCurrent >= scList.length)
	{
		scCurrent=0;
	}

	scSet();
}

function scGo()
{
	window.location.href=scList[scCurrent][0];
}
