// JavaScript Document

var basePath = "./";
var bgArray = new Array();
bgArray[0]  = "pics/frontpage/main-bg-25.jpg";
bgArray[1]  = "pics/frontpage/main-bg-25-2.jpg";
bgArray[2]  = "pics/frontpage/main-bg-25-3.jpg";
bgArray[3]  = "pics/frontpage/main-bg-25-4.jpg";
var arrayMax = 4;

function changeBg(bgIndex)
{
	document.body.style.backgroundImage = "url(" + basePath + bgArray[bgIndex] + ")";
}

function randomBg(pathIndex)
{
	if( pathIndex == 0) {
		basePath = "./";
	}
	else if( pathIndex == 1) {
		basePath = "../";
	}
	else if( pathIndex == 2) {
		basePath = "../../";
	}

	
	var rand_no = Math.random();
	rand_no = rand_no * arrayMax;
	rand_no = Math.floor(rand_no);
	changeBg(rand_no);
} 
