function resizeFlash(){
	(function($){
		//alert("resizenormal" + document.location.toString());
		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 > 638) {
					$('#FlashContent, #flashcontent').css('height', parseInt(flashheight) + 'px');
					$('embed, object').attr('height', parseInt(flashheight));
					moveFooter();
					return flashheight;
				}
				else {
					$('#FlashContent, #flashcontent').css('height', 638 + 'px');
					$('embed, object').attr('height', 638);
					moveFooter();
					return 638;
				}
			}
			if ($('.fullFlash').size() > 0) {	
				if (flashheight > 638) {		
					$('#FlashContent, #flashcontent').css('height', parseInt(flashheight) + 'px');
					$('embed, object').attr('height', parseInt(flashheight));
					
					moveFooter();
					return flashheight;
				}
				else {
					$('#FlashContent, #flashcontent').css('height', 638 + 'px');
					$('embed, object').attr('height', 638);
					moveFooter();
					return 638;
				}
			}


		}
	})(jQuery)
}

function spawn(url, nameW, w, h, showScroll) 
{
	var scrollbars
	
	if ((typeof(showScroll) == "undefined") || (!showScroll))
	{
		scrollbars = 0
	}
	else
	{
		scrollbars = 1
	}
	if (navigator.appVersion.indexOf('4') != -1) 
	{
		// Vars for centering the new window on Version 4 Browsers
		x4 = screen.width/2-(w/2);
		y4 = screen.height/2-(h/2);
		//remove spaces from window name (for IE6)
		nameW = nameW.replace(/ /g, "");
		nameW = nameW.replace(/&/g, "");
		popwin = window.open(url, nameW, 'height='+h+',width='+w+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left='+x4+',top='+y4+'');
		
	} 
	else 
	{
		popwin = window.open(url, nameW, 'height='+h+',width='+w+',scrollbars='+scrollbars+',resizable=0,menubar=0,toolbar=0,status=0,location=0,directories=0,left=150,top=200');
	}
	if (popwin) {
		popwin.remote = self;
	}
}


jQuery(document).ready(function(){
	(function($){
		
		resizeFlash();
		moveFooter();
	})(jQuery)
});