var clas = null;

function rotateVisual()
{
//	var fram = document.getElementById('mainFrame');
	var item = 0;
	time = timeInterval;
	do
	{
		item = Math.floor(Math.random()*(visuals.length-1));
	} while (lastVisual==visuals[item]);
	//fram.className = prefixVisual + visuals[item];
	clas = prefixVisual + visuals[item];
	
	lastVisual = visuals[item];
	
	//nacteme obrazek
	var img = new Image();
	img.onload = onloadImage;
	img.src = '/img/background/header-image-folder'+(prefixVisual=='visual-hp-'?'-homepage':'')+'-' + visuals[item] + '/main-' + visuals[item] + '.jpg';
}

function onloadImage()
{
	var fram = document.getElementById('mainFrame');
	fram.className = clas;
	setTimeout('rotateVisual()',timeInterval);
}

