/**********************************************************************************************************************************
** Define Variables
**********************************************************************************************************************************/
var sMediaPlayerFunction = "normal";
_d.writeln('<SCR' + 'IPT language=javascript src="shared/browser.js"></SCR' + 'IPT>');
_d.writeln('<SCR' + 'IPT language=javascript src="shared/layer.js"></SCR' + 'IPT>');
_d.writeln('<SCR' + 'IPT language=javascript src="shared/mm.js"></SCR' + 'IPT>');

/**********************************************************************************************************************************
** Skin Window Title
**********************************************************************************************************************************/
_d.title = skin.title;

/**********************************************************************************************************************************
** Load Media Format & Scripting Definition
**********************************************************************************************************************************/
// _d.writeln('<SCR' + 'IPT language=javascript src="/ems/VDO3_Launch.js?' + nocacheTime + '"></SCR' + 'IPT>');
_d.writeln('<SCR' + 'IPT language=javascript src="ems/VDO3_GeneralFunctions.js?' + nocacheTime + '"></SCR' + 'IPT>');
_d.writeln('<SCR' + 'IPT language=javascript src="ems/VDO3_ContentTabs.js?' + nocacheTime + '"></SCR' + 'IPT>');
if (mediaProfile > 0) {
  _d.writeln('<SCR' + 'IPT language=javascript src="ems/VDO3_ProcessScript.js?' + nocacheTime + '"></SCR' + 'IPT>');

  _d.writeln('<SCR' + 'IPT language="javascript" src="ems/VDO3_' + mediaFormat + '_Script.js?' + nocacheTime + '"></SCR' + 'IPT>');
  _d.writeln('<SCR' + 'IPT language="javascript" src="ems/VDO3_' + mediaFormat + '_Detect.js?' + nocacheTime + '"></SCR' + 'IPT>');
  _d.writeln('<SCR' + 'IPT language="javascript" src="ems/VDO3_' + mediaFormat + '_EventHandler.js?' + nocacheTime + '"></SCR' + 'IPT>');
}  

function _ProcessPlayStateChange(NewState, liveContent) {
  window.status = "Status: " + NewState + " (" + liveContent + ")";
  if (NewState == giStatePlaying ) {
    if (liveContent == "no") {
      g_lStatusInterval = window.setInterval("fnMonitorStatus()", 200);
    }
  }
  else if (NewState == giStateStopped ) {
    if (mdGetDuration() >= mdGetCurrentPosition()) {
      finalizePlayState(giStateStopped);
    }
  }
}

// alert(d.documentElement.innerHTML);

function openSlideShow (eventType, eventParameters) {
  var theSlideShowURL = "";
  theSlideShowURL = theSlideShowURL + "/viewerSlideShow_v2.htm";
  theSlideShowURL = theSlideShowURL + "?skinURI=" + skinURI; 
  theSlideShowURL = theSlideShowURL + "&contentURI=" + contentURI;
  theSlideShowURL = theSlideShowURL + "&mediaProfile=" + mediaProfile;  
  theSlideShowURL = theSlideShowURL + "&mediaLanguageCode=" + mediaLanguageCode;  
  theSlideShowURL = theSlideShowURL + "&mediaFormat=" + mediaFormat;
  theSlideShowURL = theSlideShowURL + "&mediaQuality=" + mediaQuality;  
  theSlideShowURL = theSlideShowURL + "&liveContent=" + liveContent;
  theSlideShowURL = theSlideShowURL + "&networkPrefix=" + networkPrefix;
  theSlideShowURL = theSlideShowURL + "&slideSize=" + slideSize;

  if (eventType) {
    theSlideShowURL = theSlideShowURL + "&eventType=" + eventType;
  }
  if (eventParameters) {
    theSlideShowURL = theSlideShowURL + "&eventParameters=" + eventParameters;
  }
  theSlideShowTitle = ""; // window.title + " Slide Show";
  wSlideShow = window.open(theSlideShowURL, theSlideShowTitle, "toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=no, left=0,top=0,width=10,height=10");
}

