<!--
//name: util.js
//version: 1
//created: 02/05/02
//task:  sniffs browser and platform and assigns corresponding stylesheet


//setstyle function used to set different styles for mac
//***********************************************

var platform;
	if (navigator.appVersion.indexOf("95") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("2000") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("98") != -1) platform = "PC";
    if (navigator.appVersion.indexOf("16") != -1) platform = "PC";
	if (navigator.appVersion.indexOf("NT") != -1) platform = "PC";
    if (navigator.appVersion.indexOf("PPC") != -1) platform = "Mac";
	if (navigator.appVersion.indexOf("PowerPC") != -1) platform = "Mac";

var browser = navigator.appName;

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


//----------------------------------------------------------
//FUNCTION SET CSS FOR MAC OR WIN
function setStyle()
{

var output = "";
	if (platform == "Mac") 
	{
		if (navigator.appVersion.indexOf("MSIE 5.0") != -1)
		{
			document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="/styles/extWIN.css">');
		}
		else 
		{
			document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="/styles/extMAC.css">');
		}
	}
	else if (platform == "PC") 
	{
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="/styles/extWIN.css">');
	}
	else
	{
		document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="/styles/extWIN.css">');
	}
}
function nsFix() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document == 'undefined'){
      document = new Object;
    }
    if (typeof document.scaleFont == 'undefined') {
      document.netscapeCssFix = new Object;
      document.netscapeCssFix.initWindowWidth = window.innerWidth;
      document.netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = netscapeCssFix;
  }
}

function netscapeCssFix() {

  // This part gets around another unfortunate bug whereby Netscape 
  // fires a resize event when the scrollbars pop up. This 
  // checks to make sure that the window's available size 
  // has actually changed.
  if (document.netscapeCssFix.initWindowWidth != window.innerWidth || document.netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}
function openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

function swap(imgName, imgB){ 
	document[imgName].src= eval(imgB + ".src");
	}
//-->
