<!--

	attachEventListener(window, "load", switchImg, false);
	attachEventListener(window, "load", setFooter, false);
	attachEventListener(window, "resize", setFooter, false);


	function randomImg()
	{
		var l = bgImage.length;
		var rnd_no = Math.round((l-1)*Math.random());
		return bgImage[rnd_no];
	}

	function theImg()
	{
		var newImg = randomImg();
		text = newImg[1];
		tags = newImg[2];
		return '/gimgs/' + newImg[0];
	}
	
	// heh, call me old skool
	function switchText(arr1,arr2)
	{
		var html = "<span class='title bgwhite'><strong>Titre:</strong> " + arr1 + "</span> <span class='keyword bgwhite'><strong>Tags:</strong> " + arr2 + "</strong></span>";
		
		x = document.getElementById('thetext');
		x.innerHTML = html;
	}
	
	function processing()
	{
		return "<img src='/imgs/scroller.gif' />";
		//return "<span class='theloader'>Randomizing...</span>";
	}

	function timeOut()
	{
		x = document.getElementById('preloader');
		x.innerHTML = ''; // reset blank
		newImage = "<img src='" + preloadImagea.src  + "' width='100%' />";
		switchText(text,tags);
		z = document.getElementById('picture');
		z.innerHTML = newImage;
	}
	
	function preloadImages(image)
	{
		preloadImagea = new Image();
		preloadImagea.src = image;

		// we don't like this, but there it is
		if (preloadImagea.complete == true) setTimeout("timeOut()", 1000);
		preloadImagea.onload = function() {
			setTimeout("timeOut()", 1000);
		}
	}

	function switchImg()
	{
		x = document.getElementById('preloader');
		x.innerHTML = processing();
		var html = theImg();
		preloadImages(html);
	}

	function getWindowHeight()
	{
		var windowHeight = 0;
		if (typeof(window.innerHeight) == 'number') {
			windowHeight = window.innerHeight;
		}
		else {
			if (document.documentElement && document.documentElement.clientHeight) {
				windowHeight = document.documentElement.clientHeight;
			} else {
				if (document.body && document.body.clientHeight) {
					windowHeight = document.body.clientHeight;
				}
			}
		}
		return windowHeight;
	}
	
	function getWindowWidth()
	{
		var windowWidth = 0;
		if (typeof(window.innerWidth) == 'number') {
			windowWidth = window.innerWidth;
		}
		else {
			if (document.documentElement && document.documentElement.clientWidth) {
				windowWidth = document.documentElement.clientWidth;
			} else {
				if (document.body && document.body.clientWidth) {
					windowWidth = document.body.clientWidth;
				}
			}
		}
		return windowWidth;
	}
	
	function setFooter()
	{
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				var contentHeight = document.getElementById('picture').offsetHeight;
				var contentHeight = contentHeight + 18; // adjust for top
				var barElement = document.getElementById('innerbar');
				var botElement = document.getElementById('belowinner');
				var innerElement = barElement.offsetHeight; // because of IE wonkiness
				
				// yeah, i know...i know...
				// this means we don't have a height basically
				if (contentHeight <= 18) {
					contentHeight = ((getWindowWidth() * 0.667) + 18);
				}	
				
				if (windowHeight > contentHeight) {
					barElement.style.height = (contentHeight - 18) + 'px';
				} else {
					if (contentHeight >= windowHeight) {
						barElement.style.height = (windowHeight - 27) + 'px';
						botElement.style.height = (contentHeight - innerElement) + 'px';
					} else {
						barElement.style.height = (windowHeight - 27) + 'px';
					}
				}
			}
		}
	}

	function pause(numberMillis) {
		var now = new Date();
		var exitTime = now.getTime() + numberMillis;
		while (true) {
			now = new Date();
			if (now.getTime() > exitTime)
				return;
		}
	}

//-->