/*
  Copyright 2001 - American Federation of Government Employees
*/

// Browser Detect
var varBrowser = "Other";
if(navigator.appName.indexOf("Netscape",0) == 0)
  {varBrowser = "Netscape";
}else{
  if((navigator.appName.indexOf("Microsoft",0) == 0) || (navigator.appName.indexOf("MS",0) == 0))
  {varBrowser = "MSIE";}
}

// Find the screen resolution, store as ResolutionHeight, ResolutionWidth
ver = "";
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if (bName == "Netscape" && bVer >= 3) ver = "n3"; 
if (bName == "Netscape" && bVer >= 6) ver = "n6"; 
if (bName =="Microsoft Internet Explorer" && bVer >= 3) ver= "i3"; 
if (ver == "i3"){
  var resup=window.screen.height; 
  var resside=window.screen.width; 
}
if (ver == "n3"){ 
  var toolkit = Packages.java.awt.Toolkit.getDefaultToolkit();
  var screen_size = toolkit.getScreenSize();
  resup=screen_size.height
  resside=screen_size.width
}
var ResolutionWidth = resside;
var ResolutionHeight = resup;

// PopupWindowLarge: Opens new window (600 x 400) with no navigation controls or menus, then focuses user on the new window.
// Parameters: Takes the url of the window to open
function PopupWindowLarge(url) {
  var previewWin = window.open(url,'PreviewWindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=600,height=400');
  previewWin.focus();
  return false;
}

// PopupWindowSmall: Opens new window (250 x 250) with no navigation controls or menus, then focuses user on the new window.
// Parameters: Takes the url of the window to open
// Use: Can be called in a <script> block, or in events such as OnClick.  Example: <a href="http://www.yahoo.com/" target="_blank" OnClick="return PopupWindowSmall('http://www.yahoo.com/')">
function PopupWindowSmall(url) {
  var previewWin = window.open(url,'PreviewWindow','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=250,height=250');
  previewWin.focus();
  return false;
}

// ConfirmMessage: Confirm popup box for a user to confirm an action, such as deleting.
// Parameters: message - Text that user will see
// Use: Example: <a href="http://www.netscape.com/" OnClick="return ConfirmMessage('Netscape is a bad browser.')">
function ConfirmMessage(message){
  if( confirm (message) ){
    return true;
  }else{
    return false; 
  }
}

// standard image swap
function imgOn(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "on.src");
  }
}
function imgOff(imgName) {
  if (document.images) {
    document[imgName].src = eval(imgName + "off.src");
  }
}

// to clear the search box
function searchClear() {
  if (document.searchForm.Criteria.value == 'search') {
    document.searchForm.Criteria.value = '';
  }
}

// Empty function
function nada() {
  return false;
}

// Kill Frames
function frameKill() {
  if (parent.frames[1])
  {
    parent.location.href=self.location.href;
  }
}
