var BGIMAGE = {
	origWidth: 1440,
	origHeight: 960,
	aspectRatio: 1,
	curWidth: 1440,
	curHeight: 960,
	init: function() {
		BGIMAGE.aspectRatio = BGIMAGE.origHeight / BGIMAGE.origWidth;
	},
	resize: function() {		
		BGIMAGE.curWidth = $('#backgrounds').width();
		BGIMAGE.curHeight = $('#backgrounds').width() * BGIMAGE.aspectRatio;
		if(BGIMAGE.curWidth < BGIMAGE.origWidth || BGIMAGE.curHeight < BGIMAGE.origHeight) {
			$('#backgrounds img').width(BGIMAGE.origWidth);
			$('#backgrounds img').height(BGIMAGE.origHeight);
		} else {			
			$('#backgrounds img').width(BGIMAGE.curWidth);
			$('#backgrounds img').height(BGIMAGE.curHeight);
		}
	}
};
function resizeFlash() {
	//Flash Resize
	var w = $( window );
	var width = Math.max(w.width(), 965);
	var height = Math.max(w.height(), 675);
	$('#flashcontent').css({width: width + 'px', height: height + 'px'});	
	BGIMAGE.resize();
}
$(document).ready(function(){		
	BGIMAGE.init();
	$(window).wresize( resizeFlash );
	resizeFlash();
});
