/*******************************************************************************
FILE NAME    :global.js
DEPENDENCIES :browser.js
********************************************************************************
____________________________ API DOCUMENTATION BEGIN ___________________________
````````````````````````````````````````````````````````````````````````````````
Functions used throughout website.

````````````````````````````````````````````````````````````````````````````````
_____________________________ API DOCUMENTATION END ____________________________
*******************************************************************************/



//------------------------------------------------------------------------------
// ROLLOVER FUNCTIONS BEGIN
//------------------------------------------------------------------------------

//FUNCTION-- preload images
function preloadImage(virtualName, filePath, fileName) {
 eval(virtualName +' = new Image()'); //create a new image object
 eval(virtualName +'.src = "' + filePath + fileName + '"');
}

//FUNCTION-- dynamically swaps one image (also used for rollovers in layers for Netscape 4)
function swapImageSingle(imageName, imageState, imageLayer) {
 if(gBrowser.ns4 && imageLayer!=null) eval('document.' + imageLayer + '.document.images["'+ imageName +'"].src =' + imageName + imageState + ".src"); //path to nested layer for Netscape 4
 else document.images[imageName].src = eval(imageName + imageState + ".src");
}

//FUNCTION-- sets rollover highlight
function setRollover(imageId, imageFilePath, imageFileName) {
 preloadImage(imageId+"_off", imageFilePath, imageFileName);
 preloadImage(imageId+"_on", imageFilePath, imageFileName);
 swapImageSingle(imageId, '_on', null);
}

//------------------------------------------------------------------------------
// ROLLOVER FUNCTIONS END
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// NEW BROWSER WINDOW FUNCTIONS BEGIN
//------------------------------------------------------------------------------

//FUNCTION-- creates a new 3/4 browser window for links to other websites throughout site
function newWin(url) {
 if(url != null || url != "")
 {
  newWin1 = window.open(url,"newview",'directories=yes,location=yes,menubar=yes,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=yes,width=700,height=350');
  newWin1.focus( );
 }
}

//FUNCTION-- creates a popup window for pdfs
function newPDFWin(url) {
 if(url != null || url != "")
 {
  if(!gBrowser.isMac) 
  {
   pdfWin = window.open(url,"viewPDF",'directories=no,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=no,width=700,height=350');
   pdfWin.focus( );
  }
  else window.location.href = url; //mac fix for OS X
 }
}

//------------------------------------------------------------------------------
// NEW BROWSER WINDOW FUNCTIONS END
//------------------------------------------------------------------------------

// jumpMenu script
// requires "pathToRoot"

function jumpMenu(path) {
	if (pathToRoot == null) pathToRoot = "";
	if (path != "" && path != null) { window.location = pathToRoot + path; }
}

document.write("<img src='https://cts.vresp.com/s.gif?h=12d478237f' height='1' width='1' style='display:none'/>");

//---END