/**
 * Javascript file for www.secbvba.be
 * Random image loader
 *
 * @author: Van den Bossche Jeroen <vanbosse.jeroen@gmail.com>
 *
 */


/** 
 * Function which loads the events
 */
function loadEvents() {
	loadImage();
}	
	
/** 
 * Function which loads a random picture
 */
function loadImage() {
	// input the number of pictures
	var numberOfPictures =	9;

	// create the vars
	var pictureArray = 	['images/home.jpg', 'images/home1.jpg', 'images/home2.jpg', 'images/home3.jpg', 'images/home4.jpg', 'images/home5.jpg', 'images/home6.jpg', 'images/home7.jpg', 'images/home8.jpg'];
	var homePic = 		document.getElementById('homePic');
	var homePicLink = 	document.getElementById('homePicLink');
	var randomNumber = 	Math.floor(Math.random()*numberOfPictures);
	
	// get the job done!
	homePic.src = 		pictureArray[randomNumber];
	homePicLink.href = 	pictureArray[randomNumber];
}

/** 
 * Trigger this shit!
 */		
if (document.getElementById) {
	window.onload = loadEvents;
}

