// ***********************************************************************
// File: jslib.js
// Author: Karen Van Boom (karen@hgcareers.com)
// Edited By: Shawn M. Kubik (shawn@hgcareers.com)
// Date: July 4, 2005
//
// This file contains Javascript library functions for use throughout the
// Hire Ground Software Website.
// ***********************************************************************

// ++++ GLOBAL VARIABLE DECLARATIONS ++++ //
var newwin;

// =======================================================================
// Function: openWindow
// Arguments: winurl - URL to display in the external window.
//            winname - Name of the external window.
//            winfeatures - Any additional features of the external window.
// Returns: None
// Description: This function is responsible for opening an external
//              'pop-up' window using Javascript.
// =======================================================================
function openWindow(winurl,winname,winfeatures)
{
  // Detect the browser application name being used.
  var theBrowser = (navigator.appName == "Netscape") ? "ns" : "ie";

  // If the screen width is greater than 800 pixels, then set the window
  // positioning values for the window accordingly.
  if (screen.width > 800)
  {
    if (theBrowser == "ns")
      wndPos = "screenX=100,screenY=100";
    else
      wndPos = "top=100,left=100";
  } 

  // Else, If the screen is less than 800 pixels, then offset the window
  // positioning accordingly.
  else 
  {
    if (theBrowser == "ns")
      wndPos = "screenX=5,screenY=5";
    else
      wndPos = "top=5,left=5";
  }

  // Create a new instance of the static Window class and assign it to
  // the global handle 'newwin'.
  newwin = window.open(winurl,winname,winfeatures + "," + wndPos);
}
