  var playerVersion = swfobject.getFlashPlayerVersion();
  var playerWarning = ( playerVersion.major < 6 );
  var sh = 20;

  function hideOverlay()
  {
      // if the player is not stopped before the element disappears, IE will continue to load the video!
      var player = document.getElementById('mpl');
      if ( player ) {
         player.sendEvent("STOP");
      }

      document.body.scroll="yes";
      document.getElementById('overlay').style.display='none';
      document.getElementById('overlay').innerHTML='';
      document.getElementById('vidBoxHolder').style.display='none';
      document.getElementById('vidBoxHolder').innerHTML='';
      document.title = "the table - the word";
      window.location.hash = "";
  }

  function displayBox(caption, flashvars, vid_width, vid_height, dlString, div_left, div_top, div_width, div_height, winhash) 
  {
      var overlay = document.getElementById('overlay');
      var vidBoxHolder= document.getElementById('vidBoxHolder');
      var win = new windowSize();

      // Set the window hash value
      if ( winhash != undefined )
      {
    	  window.location.hash = "#" + winhash;
      }
      
      var dispCenter = new displayCenter();
      divLeft = (dispCenter.x) - div_left;
      divTop  = (dispCenter.y) - div_top;

      if ( divTop < 40 ) { divTop = 40; } if ( divLeft < 0 ) { divLeft = 0; }

      var vidString = "<div id='vidbox' style='position: absolute; left:" + divLeft + "px; top:" + divTop + "px; width:" + div_width + "px; height:" + div_height + "px;" +
                      "border: 1px solid black; text-align: center; color: #FFD179; background-color: #3A2212; z-index:4'>";

      vidString += "<p style='text-align:right; font-size: 10pt; font-weight: bold; margin:0;'><a href='javascript:hideOverlay()'>" +
                 "<img src='images/close-icon.gif' alt='[close]' border='0'></a></p>" +
                 caption +
                 "<div id='flash'></div>" +
                 dlString +
                 "</div>";
      vidString += "<div id='shadowbox' style='position: absolute; left:" + (divLeft+10) + "px; top:" + (divTop+10) + "px; width:" + div_width + "px; height:" + div_height + "px;" +
                      "border: 0px; color: #FFD179; background-color: #3A2212; z-index:3; filter:alpha(opacity="+sh+");-moz-opacity:."+sh+";opacity:."+sh+";'></div>";

      document.body.scroll="no";

      vidBoxHolder.innerHTML = vidString;
      if ( document.height!=undefined ) {
         var height = document.height;
         if ( win.height > document.height ) { height = win.height; }
         overlay.style.height = height + 20; // Tack on a few pixels for good measure
      } else {
         var scroll = new scrollOffset();
         overlay.style.height = "100%";
         overlay.style.top = scroll.y;
      }
      overlay.style.display='block';
      vidBoxHolder.style.display='block';

      if ( !playerWarning ) {
         var params = {};
            params.allowfullscreen = "true";
            params.allowscriptaccess = "sameDomain";
         var attributes = {};
            attributes.id = "mpl";
         swfobject.embedSWF("/styles/player.swf", "flash", vid_width, vid_height, 
                            "9.0.0", "/styles/expressInstall.swf", 
                            flashvars, params, attributes);
      } else {
         var flashdiv = document.getElementById('flash');
         flashdiv.style.width=vid_width + "px";
         flashdiv.style.height=vid_height + "px";
         flashdiv.style.border="2px solid red";

         flashdiv.innerHTML = 'You must upgrade your flash player to view the videos on this website.  Click below to upgrade.<br>' +
			'<a href="http://www.adobe.com/go/getflashplayer">'+
				'<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" border="0" alt="Get Adobe Flash player" />' +
			'</a>';
      }

   }


