function resizeFlash(){
	(function($){
		var footerheight = $('#footer').height() + parseInt($('#footer').css('paddingTop'), 10) + parseInt($('#footer').css('paddingBottom'), 10);
		var windowheight = $(window).height();
		var wrapper = $('#wrapper').height();
		var flashheight = windowheight - wrapper - footerheight;
	
	if (jQuery('embed, object').size() > 0) {
		if ($("#homepage").size() > 0) {
			//console.log("window height: " +  windowheight +"flash height: " + $('#flashcontent').height()+ "wrapper: " + wrapper + "footer height:" + footerheight);
			if (flashheight > 588) {
				$('#FlashContent, #flashcontent').css('height', parseInt(flashheight));
				return flashheight;
			}
			else {
				$('#FlashContent, #flashcontent').css('height', 588);
				return 588;
			}
		}
		if ($('.fullFlash').size() > 0) {
			if (flashheight > 550) {
				$('#FlashContent, #flashcontent').css('height', parseInt(flashheight));
				return flashheight;
			}
			else {
				$('#FlashContent, #flashcontent').css('height', 550);
				return 550;
			}
		}
	}
	})(jQuery)
}



function resizeFixedFlash(newmaxheight){
	(function($){
		var footerheight = $('#footer').height() + parseInt($('#footer').css('paddingTop'), 10) + parseInt($('#footer').css('paddingBottom'), 10);
		var windowheight = $(window).height();
		var wrapper = $('#wrapper').height();
		var flashheight = windowheight - wrapper - footerheight;
	
	if (jQuery('embed, object').size() > 0) {
		if ($('.fullFlash').size() > 0) {
			if (flashheight > newmaxheight) {
				$('#FlashContent, #flashcontent').css('height', parseInt(flashheight));
				moveFooter();
				return flashheight;
			}
			else {
				$('#FlashContent, #flashcontent').css('height', newmaxheight);
				moveFooter();
				return newmaxheight;
			}
		}
	}
	})(jQuery)
}


jQuery(document).ready(function(){
	(function($){
		
		resizeFlash();
		moveFooter();
	})(jQuery)
});