// JavaScript Document

function Initialise() {

	//call the LoadRandomImage Function...
	LoadRandomImage();

}
//simple random image function. Changes the background image of a Div. 
//images must be saved in a folder called "images"
//images must be named "bkg_0.gif", "bkg_1.gif" and so on. 
//there must be 10 images in the folder. 
//the div that contains the background image must be named "randomImage" 
function LoadRandomImage() {
	//this makes a random number between 1 and 20. change the value to change the range
	var vRandomNumber = Math.floor(Math.random() * 16 );
	
	//this creates the "background-image" property value e.g. url(images/bkg_1.gif) 
	var vImagePath = "url(images/random_images/Bild_"   +   vRandomNumber    +    ".jpg)";   
	
	//this tells the browser to remember the div we want to change
	var vImageDiv = document.getElementById("randomImage");
	
	//this changes the background-image style of the randomImage div to the value in vImagePath
	vImageDiv.style.backgroundImage = vImagePath;

}
