function loadVideoPopup(id) {
  // vp_closeVideo();
  
  var container = Builder.node('div', {id:'vodpod_widget_popup'});
  var iframe = Builder.node('iframe');
  iframe.src = '/hosted/video_popup/' + id;
  container.appendChild(iframe);
  
  var scrollTop = 0;

  if (document.body.scrollTop) {
    // Some browsers (WebKit) do this the web-standards way.
    scrollTop = document.body.scrollTop;
  } else {
    // And some just mimic IE 6 (everyone else).
    scrollTop = document.documentElement.scrollTop;
  }
  
  var top = Math.max(((document.documentElement.clientHeight / 2) + (scrollTop)), 292);
  container.style.top = top + 'px';
  
  iframe.style.border = '0';
  iframe.frameBorder = 0;
  iframe.allowTransparency = true;
  iframe.style.width = '100%';
  iframe.style.height = '100%';
  iframe.style.overflow = 'hidden';
  iframe.scrolling = 'no';
  
  var close_img = Builder.node('img', {id:'close', src:'/images/widget/close.gif'});

  // vp_EmbedSwapper.run(top - 292, top + 292);
  
  close_img.onclick = function() {
    closeVideoPopup();
  }
  
  if (/MSIE (6|7)/.test(navigator.userAgent)) {
    // We can't attach to the iframe.
    setTimeout(function() {
      container.appendChild(close_img);
    }, 1000);
  } else  {
    iframe.onload = function() {
      container.appendChild(close_img);
    }
  }

  document.body.appendChild(container);
}

function closeVideoPopup() {
  el = document.getElementById('vodpod_widget_popup');
  if (el) {
    el.parentNode.removeChild(el);
  } else {
    embed_holder = document.getElementById('vodpod_player_container');
    if (embed_holder != null)
      embed_holder.parentNode.removeChild(embed_holder);
  }
}