//j=jQuery.noConflict();

// OPTIONS
var sH = 3;
var sW = 4;

// PUBLIC VARS
var location;
var page;
var ratio;
var newPage;
ratio = sH / sW;
var url;
var txtB;

// JavaScript Document
j(document).ready(function() {
	
	var browserwidth = j(window).width();
		var browserheight = j(window).height();
		
		//Resize image to proper ratio
		if ((browserheight/browserwidth) > ratio){
			j("#background img").height(browserheight);
			j("#background img").width(browserheight / ratio);
			
		} else {
			j("#background img").width(browserwidth);
			j("#background img").height(browserwidth * ratio);
			
		}

	window.onresize = function() {
		// GRAB DIMENSIONS					   
		var browserwidth = j(window).width();
		var browserheight = j(window).height();
		
		//Resize image to proper ratio
		if ((browserheight/browserwidth) > ratio){
			j("#background img").height(browserheight);
			j("#background img").width(browserheight / ratio);
			
		} else {
			j("#background img").width(browserwidth);
			j("#background img").height(browserwidth * ratio);
			
		}
	
	};
	
	setInterval('getSize()',1);
						   
});

function getSize() {
		// GRAB DIMENSIONS					   
		var browserwidth = j(window).width();
		var browserheight = j(window).height();
		
		//Resize image to proper ratio
		if ((browserheight/browserwidth) > ratio){
			j("#background img").height(browserheight);
			j("#background img").width(browserheight / ratio);
			
		} else {
			j("#background img").width(browserwidth);
			j("#background img").height(browserwidth * ratio);
			
		}
	
}
