// JavaScript Document

//--- THE WINDOW RESIZE FUNCTIONS ---//
	window.onresize = updateSize;
	window.onload = initalize;
	
	var image, holder, orgwidth, orgheight;
	var myWidth, myWidth, height_conv, width_conv;

	function initalize(){	
		image 		= document.getElementById("fullscreen_image");
		holder		= document.getElementById("background_holder");
		
		orgwidth	= (1800);
		orgheight	= (1400);
	
		updateSize();
	}
		
	function updateSize() {
		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";

		
	}
