
// -------------------------------------------------------------------------
// --- Dependencies:
// -------------------------------------------------------------------------

// This program requires that the following program files be preloaded before loading this program file:
//     > BrowserDetectLite.js


// -------------------------------------------------------------------------
// Prerequisite Initialization Calls
// -------------------------------------------------------------------------

// -------------------------------------------------------------------------
// Call Browser detection information script and store data into brwser object

  var brwsr = new BrowserDetectLite();


// -------------------------------------------------------------------------
// Define global variables:

// Browser Type and related type-specific variables
  var WC3DOM1 = false;
  var IEDOCALL = false;

// Other
  var lastItemId = "mmspotlighthome";

// -------------------------------------------------------------------------
// FUNCTION DECLARATIONS - 
// For functions activated from user initialized events
// -------------------------------------------------------------------------

// -------------------------------------------------------------------------
// Change the state of the link selected - onclick event handler
// -------------------------------------------------------------------------
  function changeState (thisItemId) {

    if (lastItemId != thisItemId) {
      if (WC3DOM1) {
        document.getElementById(lastItemId).className = "linkinactive";
        document.getElementById(thisItemId).className = "linkactive";
      }
      else {
        if (IEDOCALL) {
          document.all[lastItemId].className = "linkinactive";
          document.all[thisItemId].className = "linkactive";
        }
      }
      lastItemId = thisItemId;
    }
  }


// -------------------------------------------------------------------------
// FUNCTION DECLARATIONS
// Subroutine Functions
// -------------------------------------------------------------------------

// -------------------------------------------------------------------------
// Get Cookie Data Function
// -------------------------------------------------------------------------
  function getCookieData (labelName) {
    var labelLen = labelName.length;
    var cookieData = document.cookie;
    var cLen = cookieData.length;
    var i = 0;
    var cEnd = 0;
    while (i < cLen) {
      var j = i + labelLen;
      if (cookieData.substring(i,j) == labelName) {
        cEnd = cookieData.indexOf(";",j);
        if (cEnd == -1) {
          cEnd = cookieData.length;
        }
        return unescape(cookieData.substring(j+1, cEnd));
      }
      i++;
    }
    return "";
  }


// -------------------------------------------------------------------------
// BEGIN: Main Line Processing - Runs as soon as the script file has been read
// -------------------------------------------------------------------------

  // Determine Element Access Methods (W3C DOM standard method or IE4+ method or both)
  if (brwsr.isDOM1) {  
    WC3DOM1 = true;
  }
  if (document.all) {
    IEDOCALL = true;
  }

  // Get the Video Quality Preference Setting from the cookie record
  videoQPref = getCookieData ("videoQPref");

// -------------------------------------------------------------------------
// END: Main Line Processing
// -------------------------------------------------------------------------






