/*

	Wyndham Hotel Group - JS Functions

*/
var ie6 = false /*@cc_on || @_jscript_version <= 5.7 @*/;

// Enable all the required sIFR font substitutions
if(typeof sIFR == "function"){
	sIFR.replaceElement("h1", named({sFlashSrc: "/js/sifr/gotham-medium.swf", sColor: "#0073be", sWmode: "transparent"}));
	sIFR.replaceElement("h2", named({sFlashSrc: "/js/sifr/gotham-medium.swf", sColor: "#686868", sWmode: "transparent"}));
}; 


// Correct IE 6 absolute positioning errors by reloading page upon window resize
jQuery( function( $ ) { 
	function content_resize() { 
		// If we find an IE 6 browser, reload the window content to fix the absolute positioning layout issue.
		if ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)) {
			// window.location.reload(true);
		}
	} 
	
	$( window ).wresize( content_resize ); 

	//Left Navigation Initialization
	if ($("ul.sf-menu").length > 0) {
		$("ul.sf-menu").superfish({
			autoArrows: false,
			animation: {
				opacity: 'show'
			},
			delay: 75,
			dropShadows: false,
			speed: 'fast'
		});
	}

	// Dynamically place footer position for IE 6 layout issue correction	
	//positionFooter(0);
	
}); 

function positionFooter(offset){	
	/*if (ie6) {
		// Calculate the current required position based on the height of the content div
		if ($('.ui-tabs').length > 0) {
			var newTop = $('#tabs').height() + 380 + offset;
		}
		else {
			if ($('div.content').height() > 350) {
				var newTop = 102 + 26 + $('div.content').height() + 26 + 10;
			}
			else {
				if ($('.homepage #page').length > 0) {
					var newTop = $('.homepage #page').height() - 380 + offset;
				}
				else {
					var newTop = 500 + offset;
				}
			}
		}
		
		$('#footer').css('position', 'absolute');
		$('#footer').css('top', newTop + 'px');
	}*/
}

function hideMenus() {
	$('#portfolioMenuLayerTabBack').hide();
/*
	$('#portfolioMenuLayer').stop(true,false);
*/
	$('#portfolioMenuLayer').fadeOut(200);
	
	$('#supportMenuLayerTabBack').hide();
/*
	$('#supportMenuLayer').stop(true,false);
*/
	$('#supportMenuLayer').fadeOut(200);
	
	/*
	$('#brandMenuLayerTabBack').hide();
	$('#brandMenuLayer').fadeOut(600);
	
	$('#businessMenuLayerTabBack').hide();
	$('#businessMenuLayer').fadeOut(600);
	*/
	$('#mainnavCatch').hide();
} 

function showMenu(menuElement) {
	hideMenus();

	$('#mainnavCatch').show();	
	
	if (menuElement == 'portfolio') {
		$('#portfolioMenuLayerTabBack').show();
/*
		$('#portfolioMenuLayer').stop(true,true);
*/
		$('#portfolioMenuLayer').fadeIn(300);
	} else if (menuElement == 'support') {
		$('#supportMenuLayerTabBack').show();
/*
		$('#supportMenuLayer').stop(true,true);
*/
		$('#supportMenuLayer').fadeIn(300);
	} /*else if (menuElement == 'brand') {
		$('#brandMenuLayerTabBack').show();
		$('#brandMenuLayer').fadeIn(600);
	} else if (menuElement == 'business') {
		$('#businessMenuLayerTabBack').show();
		$('#businessMenuLayer').fadeIn(600);
	} 	*/	
}
