

	$(document).ready(function() {
	
	//	##############
	//	### RESIZE ###
	//	##############
	
		var imgwidth = $("img.background").width();		//	Image Width
		var imgheight = $("img.background").height();	//	Image Height
		var ratio = imgwidth/imgheight;					//	Image Ratio
		
		var tempwidth;		//	Temporary Image Width
		var tempheight;		//	Temporary Image Height
		var tempx = 0;		//	Temporary Image X
		var tempy = 0;		//	Temporary Image Y
		
		$(window).bind("resize", function(){
		
			var winwidth = $(window).width();		//	Browser Width
			var winheight = $(window).height();		//	Browser Height
		
		//	Browser = Landscape Format
		
			if(winwidth > winheight)
			{
				tempwidth = winwidth;
				tempheight = tempwidth/ratio;
				tempx = 0;
				tempy = -((tempheight-winheight)/2);
			
				if(tempheight < winheight)	//	Image Height < Browser Height
				{
					tempheight = winheight;
					tempwidth = winheight*ratio;
					tempx = -((tempwidth-winwidth)/2);
					tempy = 0;
				}
			
				$("img.background").attr({
					"width": tempwidth,
					"height": tempheight
				});
				
				$("img.background").css({
					"left": tempx,
					"top": tempy
				});
		
		//	Browser = Portrait, Square Format
		
			} else {
				
				tempheight = winheight;
				tempwidth = winheight*ratio;
				
				$("img.background").attr({
					"width": tempwidth,
					"height": tempheight
				});
			}
			
		//	Content Height
/*
			$("#content").css({
				"height": $("#content").height(),
				"margin-top": -($("#content").height()/2)
			});
		
			if($("#content").height() > winheight)
			{
				$("#content").css({
					"top": "0px",
					"margin-top": "0px"
				});
				
			} else {
			
				$("#content").css({
					"top": "50%",
					"margin-top": -($("#content").height()/2)
				});
			}
*/	
		});
	
		$(window).resize();		//	Fire Function
		
	//	----------------------------------------------------------------------
	
	//	###############
	//	### CONSOLE ###
	//	###############
		
		function trace(variable)
		{
			console.log(variable);
		}
		
	});



