// JavaScript Document

//--- THE WINDOW RESIZE FUNCTIONS ---//
	window.onresize = updateSize;
	//window.onload = updateSize;
	
	function updateSize() {
		var image 		= document.getElementById("fullscreen_image");
		var holder		= document.getElementById("background_holder");
		var orgwidth	= (1280/2);
		var orgheight	= (1024/2);
		
		if( typeof(window.innerWidth) == 'number' ) {
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)){
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if(document.body && (document.body.clientWidth || document.body.clientHeight)){
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}
		
		height_conv = (myHeight/orgheight);
		width_conv	= (myWidth/orgwidth);
		
		if(height_conv < width_conv){
			conv = width_conv;
		}else{
			conv = height_conv;
		}
		
		if(conv >= 1){
			image.width 			= (orgwidth*conv);
			image.height 			= (orgheight*conv);
			image.style.marginLeft 	= "-"+((orgwidth*conv)/2)+"px";
			image.style.marginTop 	= "-"+((orgheight*conv)/2)+"px";
		}else{
			image.width 			= (orgwidth);
			image.height 			= (orgheight);
			image.style.marginLeft 	= "-"+(orgwidth/2)+"px";
			image.style.marginTop 	= "-"+(orgheight/2)+"px";
		}
		
		holder.style.width 	= (myWidth)+"px";
		holder.style.height = (myHeight)+"px";
		image.style.left 	= "50%";
		image.style.top 	= "50%";

		
	}
