
yume_control_iframe_srcUrl = "/include/skins/none/banner_control.html";

yume_control_div_height = 20;

yume_playback_volume = 0;

function yumeFlashBannerDiv(DivID, WIDTH, HEIGHT, BGCOLOR)
{
 document.write('     <div style="position: relative; width: '+WIDTH+'px; height: '+HEIGHT+'px; background: '+BGCOLOR+';" > ');
 document.write('      <div id="' + DivID + '" style="position: absolute; " > ');
 document.write('       Please install the Flash plugin from Adobe ');
 document.write('      </div> ');
 document.write('     </div> ');
}

function yumeFlashBannerIframeVideo(DivID, WDT, HGT, BGCOLOR, YUME_SWF_LOCATION, playlistUrl, noFlashRedirectUrl)
{
  var WIDTH = "";
  var HEIGHT = "";
  yume_player_swf = YUME_SWF_LOCATION;
  var htmlparam_ix = location.href.indexOf("?");
  var htmlparams = "";
  var enchtmlparams = "";

  if (WDT.length > 0) {
    WIDTH = WDT;
  } else {
    WIDTH = getURLParam("width");
  }

  if (WIDTH.length == 0) {
    WIDTH = getWinWidth();
  }

  if (HGT.length > 0) {
    HEIGHT = HGT;
  } else {
    HEIGHT = getURLParam("height");
  }

  if (HEIGHT.length == 0) {
    HEIGHT = getWinHeight();
  }

  if (htmlparam_ix > 0) {
    htmlparams = location.href.substring(htmlparam_ix, location.href.length);
    //alert(htmlparams);
    enchtmlparams = encodeURIComponent(htmlparams);
    //alert(enchtmlparams);
  }

  yume_flash_playlist = encodeURIComponent(playlistUrl);
  yume_noFlashUrl = noFlashRedirectUrl + htmlparams + '&bt=traditional';
  //alert(yume_noFlashUrl);

  yumeFlashBannerDiv(DivID, WIDTH, HEIGHT, BGCOLOR);
  window.onunload = yumeFlashBannerClose;

  yume_flash_width = WIDTH;
  yume_flash_height = HEIGHT;
  yume_flash_bg_color = BGCOLOR;
  yume_flashplayer_divId = DivID;
  yumeLoadFlashPlayerDiv();
}

function yume_showMoveonButton() {
  //alert("yume_showMoveonButton!");
  var moveonDiv = document.getElementById("yumeMoveonButtonId");
  moveonDiv.style.width = "100%";
  moveonDiv.innerHTML = yume_moveOnHTML;
}

var yume_curDuration = 0;
function yume_showAdProgress() {
  //alert("yume_showAdProgress!");
  var moveonDiv = document.getElementById("yumeMoveonButtonId");
  yume_curDuration += 1;
  var curWidth = ((yume_curDuration/duration)*100);
  //alert("curWidth=" + curWidth);
  if (curWidth >= 100) {
    yume_showMoveonButton();
  } else {
    moveonDiv.style.width = curWidth + "%";
    setTimeout("yume_showAdProgress()", 1000);
  }
}

var yume_prevOnload = window.onload;
var yume_moveOnHTML = "";

window.onload = function() {
 if (yume_prevOnload) {yume_prevOnload();}
 try {
   if (isHTMLAdvertisement == true && duration >= 0 && yumeNextFrameURL.length > 0) {
      var moveonDiv = document.createElement("DIV");
      document.body.appendChild(moveonDiv);
      moveonDiv.id = "yumeMoveonButtonId";
      moveonDiv.style.width = "1%";
      moveonDiv.style.textAlign = "center";
      moveonDiv.style.backgroundColor = "#98AFC7";
      moveonDiv.innerHTML="<small>[skip]</small>";
      yume_moveOnHTML = "<a href=\"" + yumeNextFrameURL + "\"><small>[skip]</small></a>";
      if (duration > 0) {
        setTimeout("yume_showAdProgress()", 1000);
      } else {
        yume_showMoveonButton();
      }
   }
 } catch(e) {}
 try {
   if (isHTMLAdvertisement == true && duration >= 0 && yumeReplayFrameURL.length > 0) {
      var moveonDiv = document.createElement("DIV");
      document.body.appendChild(moveonDiv);
      moveonDiv.id = "yumeMoveonButtonId";
      moveonDiv.style.width = "1%";
      moveonDiv.style.textAlign = "center";
      moveonDiv.style.backgroundColor = "#98AFC7";
      moveonDiv.innerHTML="<small>[replay]</small>";
      yume_moveOnHTML = "<a href=\"" + yumeReplayFrameURL + "\"><small>[replay]</small></a>";
      if (duration > 0) {
        setTimeout("yume_showMoveonButton()", duration*1000);
      } else {
        yume_showMoveonButton();
      }
   }
 } catch(e) {}
}

