/**
 * This file is included in the series landing page and series title page and includes 
 * functions which are specific to these pages.  
 * 
 * @author Jesse Streb
 */

/************************************************************************************
 * Global variables and player configurations.
 ************************************************************************************/
var BC_PLAYER_ID = "14034162001"; //The player id for the player which contains all of the shows.

/**
 * Here we show the selected season and then make the call to link up the most popular and most recent
 * videos with the correct show and title.  (out titles do not know what playlists and players they are 
 * associated with).
 */
function bc_onLoadExtended() {
	try {
		document.getElementById("bc_" + bc_gSelectedSeasonId + "_container").style.display = "block";
	} catch (e) {}
	
	if(bc_isIE) {
	   try {
	       document.getElementById('bc_relatedSlider').style.left = "-3px";
	   } catch(e) {}
	}
	
	bc_getPlaylists(BC_PLAYER_ID);
}

function setGetLink(pId) {
    
    social.setLink(location.href.split("?")[0] + "?bcpid=" + bc_gPlayerId + "&bclid=" + bc_gPlaylistId + "&bctid=" + pId); 
}


/**
 * Expands the season in the left hand navigation and hides the previous season.
 * @param {Object} pId - The id of this season used to find the correct div.
 */
function bc_showSeasonLineups(pId) {
	document.getElementById("bc_" + bc_gSelectedSeasonId + "_container").style.display = "none";
	document.getElementById("bc_" + pId + "_container").style.display = "block";
	document.getElementById("bc_seasonHeader_" + bc_gSelectedSeasonId).style.color = "#656768";
	document.getElementById("bc_seasonHeader_" + pId).style.color = "#9c0000";
	bc_gSelectedSeasonId = pId;
}

/**
 * Onclick event fired by the bc_seeAllSeries element.  This will expand the rest of the shows and also handle the css values for
 * the element itself, including switching the onclick event.
 */
function bc_showMoreSeries() {
	document.getElementById("bc_seeAllContainer").style.display = "block";
	document.getElementById("bc_seeAllSeries").innerHTML = "hide series...";
	document.getElementById("bc_seeAllSeries").style.color = "#656768";
	document.getElementById("bc_seeAllSeries").onclick = function () {bc_hideMoreSeries()}
	bc_checkHeight();
}

/**
 * Onclick event fired by the bc_seeAllSeries element.  This will hide the rest of the shows and also handle the css values for
 * the element itself, including switching the onclick event.
 */
function bc_hideMoreSeries() {
	document.getElementById("bc_seeAllContainer").style.display = "none";
	document.getElementById("bc_seeAllSeries").innerHTML = "more series...";
	document.getElementById("bc_seeAllSeries").style.color = "#656768";
	document.getElementById("bc_seeAllSeries").onclick = function () {bc_showMoreSeries();}
	bc_checkHeight();
}

/**
 * Onclick event fired by the bc_seeAllSpan element that appears on the series title page.  This will expand the rest of the 
 * shows and also handle the css values for the element itself, including switching the onclick event.
 */
function bc_showMoreTitleSeries() {
	document.getElementById("bc_seeAllContainer").style.display = "block";
	document.getElementById("bc_seeAllSpan").innerHTML = 'hide series...';
	document.getElementById("bc_seeAllSpan").style.color = "#656768";
	document.getElementById("bc_seeAllSpan").style.borderColor = "#656768";
	document.getElementById("bc_seeAllSeries").onclick = function () {bc_hideMoreTitleSeries();}
	bc_checkHeight();
}

/**
 * Onclick event fired by the bc_seeAllSpan element that appears on the series title page.  This will hide the rest of the 
 * shows and also handle the css values for the element itself, including switching the onclick event.
 */
function bc_hideMoreTitleSeries() {
	document.getElementById("bc_seeAllContainer").style.display = "none";
	document.getElementById("bc_seeAllSpan").innerHTML = "more series...";
	document.getElementById("bc_seeAllSpan").style.color = "#656768";
	document.getElementById("bc_seeAllSpan").style.borderColor = "#656768";
	document.getElementById("bc_seeAllSeries").onclick = function () {bc_showMoreTitleSeries();}
	bc_checkHeight();
}

/**
 * Handle the mouseover event for the element that will expand to see the list of retired elements.
 * @param {Object} pElem
 */
function bc_seeAllMouseOver(pElem) {
	pElem.style.color = "#9c0000";
	pElem.style.borderColor = "#9c0000";
}

/**
 * Handle the mouseout event for the element that will expand to see the list of retired elements.
 * @param {Object} pElem
 */
function bc_seeAllMouseOut(pElem) {
	pElem.style.color = "#656768";
	pElem.style.borderColor = "#656768";
}
