
// General variables
var cssDir = "styles/";
var winNSCSS = "styles_win_ns.css";
var winIECSS = "styles_win_ie.css";
var macCSS = "styles_mac.css";
var macIE5CSS = "styles_mac_ie.css";

// *************************************************************
//  CLIENT_SIDE SNIFFER CODE
// *************************************************************
// convert all characters to lowercase to simplify testing 
var agt=navigator.userAgent.toLowerCase(); 

// *** BROWSER VERSION *** 
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 

// *** BROWSER TYPE *** 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
            && (agt.indexOf('webtv')==-1));
var is_nav4up = (is_nav && (is_major >= 4));  
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );  
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);  

// *** PLATFORM ***
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac    = (agt.indexOf("mac")!=-1);
			 
//  Select the appropriate stylesheet
if ((is_nav4up || is_ie4up) || (!is_nav && !is_ie)) {
  ChooseStyleSheet();
}



// Function to choose the style sheet for use based on the platform
// and browser version
function ChooseStyleSheet() {
  var styles = cssDir + macCSS;
  if (is_win) {
	if (is_nav) {
      styles = cssDir + winNSCSS;
	} else {
	  // Windows Netscape fonts need to be larger than those for IE
	  styles = cssDir + winIECSS;
	}
  } else if (is_mac) {
      if (is_ie5up) {
	    // Default font settings for Mac IE5 match PC IE fonts
        styles = cssDir + macIE5CSS;
	  } else {
	    styles = cssDir + macCSS;
	  }
 
  } else {
    // Default style = macCSS
	// Macintosh stylesheets have the largest font sizes, which
	// will ensure readability
	styles = cssDir + macCSS;
  }
  document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + styles + "\">");
  return true;
}

var nWidth= "640";
var nHeight="450";

var iMyWidth;
var iMyHeight;
	//gets top and left positions based on user's resolution so window is centered.
iMyWidth = (window.screen.width/2) - (122 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
iMyHeight = (window.screen.height/2) - (225 + 50); //half the screen height minus half the new window height (plus title and status bars).
iMyHeight = 50;
var optionString = "titlebar=no,toolbar=no,status=yes,location=no,menubar=no,resizable=yes,scrollbars=yes,";
			optionString += "height=" + nHeight + ",width=" + nWidth;

var optionString2 = "titlebar=yes,toolbar=yes,status=yes,location=yes,menubar=yes,resizable=yes,scrollbars=yes,";
			optionString2 += "height=" + nHeight + ",width=" + nWidth;
			optionString2 += ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",left=" + iMyWidth + ",top=" + iMyHeight;

var optionString3 = "titlebar=yes,toolbar=no,status=yes,location=no,menubar=yes,resizable=yes,scrollbars=yes,";
			optionString3 += "height=400,width=500";
			optionString3 += ",screenX=100,screenY=50,top=50,left=100";

var optionString4 = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=580,height=450"

// Launches a separate new window each time

var win = null;

function winOpen(url){
	win = window.open(url,"Display",
	"height=450,width=640,toolbar=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=yes");
	win.focus();
}
if (document.images) { 

            img1on = new Image();      
			img1on.src = "images/ind-lk1-on.gif"; 
			img2on = new Image();      
			img2on.src = "images/ind-lk2-on.gif"; 
			img3on = new Image();      
			img3on.src = "images/ind-lk3-on.gif"; 
			img4on = new Image();      
			img4on.src = "images/ind-lk4-on.gif"; 
			img5on = new Image();      
			img5on.src = "images/int-lk1-on.gif"; 
			img6on = new Image();      
			img6on.src = "images/int-lk2-on.gif"; 
			img7on = new Image();      
			img7on.src = "images/int-lk4-on.gif";
            
            img1off = new Image();      
			img1off.src = "images/ind-lk1-off.gif"; 
			img2off = new Image();      
			img2off.src = "images/ind-lk2-off.gif"; 
			img3off = new Image();      
			img3off.src = "images/ind-lk3-off.gif"; 
			img4off = new Image();      
			img4off.src = "images/ind-lk4-off.gif"; 
			img5off = new Image();      
			img5off.src = "images/int-lk1-off.gif"; 
			img6off = new Image();      
			img6off.src = "images/int-lk2-off.gif"; 
			img7off = new Image();      
			img7off.src = "images/int-lk4-off.gif";
        }

// Images turn on.

function imgOn(imgName) {

        if (document.images) {

            document[imgName].src = eval(imgName + "on.src");

        }

}

// Images turn off.

function imgOff(imgName) {

        if (document.images) {

            document[imgName].src = eval(imgName + "off.src");

        }

}



function goTo (page) {
              /* This function is called from the navigation menu
                 to jump to the designated URL. Empty values
                 are ignored and "--" indicates a menu seperator    */
                 
                      if (page != "" ) {
                              if (page == "--" ) {
                                      resetMenu();
                              } else {
                                      document.location.href = page;
                              }
                      }
                      return false;
              }

function resetMenu () {
              /* Resets the menu to the specified menu item           */   
                      document.gmenu.page.options[0].selected = true;
              }

function helpOpen (url) {
    			var helpWin = open(url,"Loading","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=450");
    			helpWin.focus();
    		}

function supportOpen (url) {
    			var helpWin = open(url,"Loading","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=580,height=450");
    			helpWin.focus();
    		}
function helpOpen2(url){
	var helpWin2 = window.open(url,"Help",optionString4);
	helpWin2.focus();
}

 function winDD (url) {
    			var helpDD = open(url,"Loading","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=475,height=500");
    			helpDD.focus();
    		}
