// define in each page:	getVideo()

var flashvars = {
  flv_path : "flv/",
  player_loaded_handler : "getVideo",
	player_closed_handler : "hideVid"
};

var params = {
  allowFullScreen : "false",
  allowscriptaccess : "sameDomain"
};

var attributes = {
  id : "vid_player",
  name : "vid_player"
};
  
function getMaskSize()
{
  var html = document.getElementsByTagName("HTML")[0];
  var mask = document.getElementById("mask");

  mask.style.height = html.scrollHeight + "px";
  mask.style.width = html.scrollWidth + "px";
}

window.onload = getMaskSize;
window.onresize = getMaskSize;

function showVid()
{
  var html = document.getElementsByTagName("HTML")[0];
  var vid = document.getElementById("player");

  vid.style.top = ((html.clientHeight - vid.scrollHeight) / 2) + html.scrollTop + "px";
  vid.style.left = ((html.clientWidth - vid.scrollWidth) / 2) + html.scrollLeft + "px";

  document.getElementById("mask").style.visibility = "visible";
  vid.style.visibility = "visible";
}

function hideVid()
{
  location.reload();
}

function loadFlashVideo(filename, title)
{
  var timeout = (document.all) ? 500 : 0;

  var code = 'document.getElementById("vid_player").load_video("' +
    filename + '", "' + title + '")';

  try {
    setTimeout(code, timeout);
  }
  catch (e) {}
}
