/**
 * DrPepper.Entertainment.SculptorPepper
 *
 * SculptorPepper client-side functionality
 *
 * Author:	Silvan Reinhold
 **/

var DrPepper = DrPepper || {};
DrPepper.Entertainment = DrPepper.Entertainment || {};

DrPepper.Entertainment.SculptorPepper = {};

DrPepper.Entertainment.SculptorPepper.SWF_ID = "sculptorpepper-swf";


/**
 * Initialization of SculptorPepper page. Must be called when full DOM tree is available.
 **/
DrPepper.Entertainment.SculptorPepper.init = function()
{
	// Override the site's default SIGN IN menu link behavior
	//
	var l_xSwf = $("#" + DrPepper.Entertainment.SculptorPepper.SWF_ID).get(0);
	$("#signin-link").attr("href", "javascript:void(0);");
	$("#signin-link").click(function() { l_xSwf.requestSignIn(); });
}


/**
 * Adjust height of the SculptorPepper area. Will push promo footer down, if necessary.
 *
 * @param	p_nHeight	Height to set for the SculptorPepper area
 **/
DrPepper.Entertainment.SculptorPepper.setPageHeight = function(p_nHeight)
{
	$("#header-box").height(p_nHeight);
}


/**
 * Set visual "signed in" status for the page on the fly. For "signed in," this will show the MY ACCOUNT and SIGN OUT
 * links in the main menu. For "signed out", it will show the SIGN IN link in the main menu.
 *
 * @param	p_bIsSignedIn	Flag: signed in (true) or signed out (false)
 **/
DrPepper.Entertainment.SculptorPepper.setSignedIn = function(p_bIsSignedIn)
{
	$("#main-menu-item-my-account").css("display", p_bIsSignedIn ? "block" : "none");
	$("#signin-link").css("display", p_bIsSignedIn ? "none" : "block");
	$("#signout-link").css("display", p_bIsSignedIn ? "block" : "none");
}
