 
 /* Corresponds to the min height of the fx app */
	var mcFxHeight = 562;

// Workaround for IE setting title to fragment
jQuery('div.parent').bind('mouseleave',function(){
      updateTitleInFlex();    
})

/* override the same function in globalnav.js to accomodate FX using homepage div */
	function resizeFlash(){
 		(function($){
 		// orig .com flash height val 588
 		// mcFx min height val is 562

 		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 > mcFxHeight) {
 					$('#FlashContent, #flashcontent').css('height', parseInt(flashheight));
 					return flashheight;
 				}
 			else {
 				$('#FlashContent, #flashcontent').css('height', mcFxHeight);
 				return mcFxHeight;
 			}
 		}
 		//if ($('.fullFlash').size() > 0) {
 		//$('#FlashContent, #flashcontent').css('height', parseInt(flashheight));
 		//return flashheight;
 		//}
 		}
	})(jQuery)
	}

/* override the same function in globalnav.js to accomodate FX using homepage div */
	function moveFooter(){
 		
 		
 		var wrapper = jQuery('#wrapper').height();
 		var footerheight = jQuery('#footer').height() + parseInt(jQuery('#footer').css('paddingTop'),10) + parseInt(jQuery('#footer').css('paddingBottom'),10);
 		var flashHeight = jQuery('#FlashContent, #flashcontent').height() + wrapper;
 		var windowheight = jQuery(window).height();
 		var embeds = jQuery('embed, object');
 		var totalPageHeight = jQuery('#content, #homepage').height() + wrapper + footerheight;

 		function getFooterOffset(){
 		var offset;
 		//grab the headerType hidden field 
 		var useDiscreetHeaderElement = jQuery("#hdn_headerType");
 		//lets determine if we are running the discreet header or normal size
 		var useDiscreetHeader = false;
 		
 		if(useDiscreetHeaderElement != undefined && useDiscreetHeaderElement.val() != "" && useDiscreetHeaderElement.val() != undefined )
 		{
 		    useDiscreetHeader = true;
 	    }
		// for homepage div to work in this case, need to adjust offset if the div is less than the total space neeeded to show the app plus the .com footer
		// if the div size is less than than, return a default for the mcFx app height - otherwise calculate the offset
 		if(useDiscreetHeader)
 		{
 		    if ( jQuery('#homepage').size() > 0 && (jQuery(window).height() < footerheight + mcFxHeight + 30) ){ // basically when the flash stops resizing to be smaller.
			// orig .com was: offset = 613;
			offset = 590;
			//offset = 618;
			//console.log('case1: window height ' + jQuery(window).height());
			//console.log('case 1: offset: ' + offset);
 		    } else {
 			    //console.log('case2: window height ' + jQuery(window).height());
 			    //console.log('case 2: offset: ' + offset);
 			    offset = jQuery(window).height() - footerheight;
 		    }

 		}
 		else
 		{
 		    if ( jQuery('#homepage').size() > 0 && (jQuery(window).height() < footerheight + mcFxHeight + 50) ){ // basically when the flash stops resizing to be smaller.
			    // orig .com was: offset = 613;
			    offset = 613;
			    //offset = 618;
			    //console.log('case1: window height ' + jQuery(window).height());
			    //console.log('case 1: offset: ' + offset);
 		    } else {
 			    //console.log('case2: window height ' + jQuery(window).height());
 			    //console.log('case 2: offset: ' + offset);
 			    offset = jQuery(window).height() - footerheight;
 		    }
 		}
 		return offset + 'px'
 	}
 	
 	function updateFooter(type){
 		switch (type){
 			// 'dynamic' case - get the 'negotiated' footer offset
 			case "abs":
 				jQuery('#footer').css({position: 'absolute',top: getFooterOffset()});
	 		break;

 			case "static":
 				jQuery('#footer').css({position: 'static'});
 			break;
 		}
	}

 	if ((jQuery('#homepage').size() > 0 && embeds.length > 0) || (embeds.length == 0 && jQuery('#content').size > 0 && (jQuery('#content').height() + wrapper + footerheight) < jQuery(window).height()))
 	{
 		//// console.log('scenario 1: embeds ' + embeds.length + "jQuery('#content').height() + wrapper + footerheight" + jQuery('#content').height() + ' ' + wrapper + '' + footerheight + 'window.height: ' + jQuery(window).height())
 		updateFooter("abs");
 	}
 	else if ((jQuery('#homepage').size() > 0 && embeds.length == 0)){
 		updateFooter("static");
 	}
 	else if (embeds.length > 0 && totalPageHeight < windowheight|| embeds.length == 0 && (totalPageHeight < windowheight)){	
 		//// console.log('scenario 2: embeds ' + embeds.length + "jQuery('#content').height() + wrapper + footerheight " + jQuery('#content').height() + ' ' + wrapper + ' ' + footerheight + ' window.height: ' + jQuery(window).height())
 		updateFooter("abs");
 	}
 	else if (embeds.length > 0 && totalPageHeight > windowheight || embeds.length == 0 && totalPageHeight > windowheight){
 		//// console.log('scenario 3: embeds ' + embeds.length + "jQuery('#content').height() + wrapper + footerheight" + jQuery('#content').height() + ' ' + wrapper + '' + footerheight + 'window.height: ' + jQuery(window).height())
 		updateFooter("static");
 	}
	}
