	// load image gallery

	var j = 0
	var len = backImage.length;
	var preBuffer = new Array()
	for (i = 0; i < len; i++)
	{
	   preBuffer[i] = new Image();
	   preBuffer[i].src = backImage[i];
	}

	function showImage()
	{
		document.write('<img src="'+backImage[Math.round(Math.random()*(len-1))]+'">');
		resizeMe();
	};
		
	
	function MsgBox (textstring) {
		alert (textstring); 
	};

//Adjust image size	
	function resizeMe() {
		var ratio = 10/16;
		var browserwidth = $(window).width();
		var browserheight = $(window).height();
		$('#loading').hide();
		link = document.getElementsByTagName( "link" )[ 0 ];
		if ((browserheight/browserwidth) > ratio){
		    link.href = "wide.css";
		} else {
		    link.href = "tall.css";
		}
					
	};
	
	
	$(document).ready(function() {
		resizeMe();
	});
	$(window).bind("load",function(){
		resizeMe();
	});
	$(window).bind("resize", function(){
		resizeMe();
	});			
	function MsgBox (textstring) {
		alert (textstring); 
	};
