// Helper functions for displaying videos in a popup window
// using the JW FLV Media Player and the "Stylish" skin. 

// Determine web browser type
function WebBrowserType()
{
  var b = navigator.appName

  if (b=="Netscape")
    this.b = "ns"
  else if (b=="Microsoft Internet Explorer")
    this.b = "ie"
  else this.b = b

  this.version = navigator.appVersion
  this.v = parseInt(this.version)
  this.ns = (this.b=="ns" && this.v>=4)
  this.ns4 = (this.b=="ns" && this.v==4)
  this.ns5 = (this.b=="ns" && this.v==5)
  this.ie = (this.b=="ie" && this.v>=4)
  this.ie4 = (this.version.indexOf('MSIE 4')>0)
  this.ie5 = (this.version.indexOf('MSIE 5')>0)
  this.min = (this.ns||this.ie)
  this.pc = (this.version.indexOf('Win')>0)
  this.mac = (this.version.indexOf('PPC')>0)
  this.ns408=(parseFloat(this.version)==4.08);
}

// Instantiate web browser type object for popWindow function
var is = new WebBrowserType()

// Function that pops up a window of a specific size on all target browsers.
// Pass the window URL, the width and the height.
function PopWindow(urlVal,windowName,widthVal,heightVal,scrollBars,menuBar,reSizeable)
{
  var paraString
  var wt
  var ht

  // Expand window to minimum size required to show entire JW FLV Media Player with "stylish" skin
  widthVal += 34;
  heightVal += 52;

  // Now adjust size for browser type        
  if ((is.ie) && (is.mac))
  {
    wt = widthVal - 20;
    ht = heightVal - 20;
  }
  else if (is.ns)
  {
    wt = widthVal - 14;
    ht = heightVal - 14;
  }
  else
  {
    wt = widthVal;
    ht = heightVal;
  }

  paraString = "width=" + wt + ",height=" + ht;

  if (scrollBars == 1)
    paraString = paraString + ",scrollbars=yes";
  else
    paraString = paraString + ",scrollbars=no";

  if (menuBar == 1)
    paraString = paraString + ",menubar=yes";
  else
    paraString = paraString + ",menubar=no";

  if (reSizeable == 1)	
    paraString = paraString + ",resizable=yes";
  else  
    paraString = paraString + ",resizable=no";

  poppedWindow = window.open(urlVal,windowName,paraString);
  poppedWindow.focus();
}