function getBox() {
  return(document.getElementById("videoContentDiv"));
}

function windowResized() {
  var height;
  var width;
  if (typeof(window.innerWidth) == 'number') { 
    height = window.innerHeight;
    width = window.innerWidth;
  } 
  else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {  
    height  = document.documentElement.clientHeight;
    width  = document.documentElement.clientWidth;
  } 
  else if (document.body && (document.body.clientWidth || document.body.clientHeight)) { 
    height  = document.body.clientHeight;
    width  = document.body.clientWidth;
  }

  if (typeof(window['centerOnWidth']) != "undefined") {
    getBox().style.left = ((width / 2) - (getBox().offsetWidth / 2)) + "px";
  }
  if (typeof(window['centerOnHeight']) != "undefined") {
    getBox().style.bottom = ((height / 2) - (getBox().offsetHeight / 2)) + "px";
  }
  if (typeof(window['pixelsFromTop']) != "undefined")
    if (pixelsFromTop == -1)
      getBox().style.bottom = "0px";
    else
      getBox().style.bottom = (height - (pixelsFromTop + getBox().offsetHeight)) + "px";

  if (typeof(window['pixelsFromLeft']) != "undefined")
    getBox().style.left = pixelsFromLeft + "px";
  
}

function initBox() {
  windowResized();
  if (window.addEventListener)
    window.addEventListener('resize',windowResized,false);
  else if (window.attachEvent)
    window.attachEvent('onresize',windowResized);
  else
    window.onresize = windowResized;
}

function showVideoDiv () {
  d = document.getElementById("videoContentDiv");
  d.style.display='block';
}

function hideVideoDiv () {
  d = document.getElementById("videoContentDiv");
  d.style.display='none';
}

if (window.addEventListener)
  window.addEventListener("load", initBox, false);
else if (window.attachEvent)
  window.attachEvent("onload", initBox);
else if (document.getElementById)
  window.onload=initBox;
