
function BrowserStats() {
  var userAgent = " " + navigator.userAgent.toLowerCase();

  // determine nn/ie, rounded version number and platform
  this.nn = userAgent.indexOf( "mozilla" ) > 0;

  // "compatible" versions of mozilla are not netscape
  if( userAgent.indexOf( "compatible" ) > 0 ) this.nn = false;

  this.ie = userAgent.indexOf( "msie" ) > 0;
  this.version = navigator.appVersion;
  this.major = parseInt( this.version );
  this.mac = userAgent.indexOf( "mac" ) > 0;
  
  // ie 5 reports itself as 4
  if( this.ie ) {
    if( userAgent.indexOf( "msie 5" ) > 0 )
      this.major = 5;
  }
  return this;
}

var browser = new BrowserStats();

// font platform resize
var platformCSS;
if( browser.mac && browser.major >= 5 ) {
  platformCSS = "ieadjust.css";
} else if( browser.mac ){
  platformCSS = "v4adjustMac.css";
}
if( !browser.mac && browser.ie ) {
  platformCSS = "ieadjust.css";
}

if( browser.nn && browser.major >= 5 ) {
  platformCSS = "ieadjust.css";
}
if( platformCSS ){
  document.write( "<link rel='stylesheet' href='" + styleDir +"/" + platformCSS + " 'type='text/css'>" );
}

// menu objects
function Menu( argName, argItems, argX, argY, argWidth, argSubMenuName, argSubMenuHilite, argFlag  ) {
  this.name = argName;
  this.items = argItems;
  this.x = argX;
  this.y = argY;
  this.width = argWidth;
  this.subMenuName = argSubMenuName;
  this.subMenuHilite = argSubMenuHilite;
  this.flag = argFlag;
}

function MenuItem( argValue, argUrl, argSubMenu ) {
  this.value  = argValue;
  this.url = argUrl;
  this.subMenu  = argSubMenu;
}

// menu methods
function getStyleObj( argObjId ) {
  if( document.getElementById && document.getElementById( argObjId ) ) {
    // W3C DOM
	  return document.getElementById( argObjId ).style;
  } else if( document.all && document.all( argObjId ) ) {
    // IE 4+ DOM
	  return document.all( argObjId ).style;
  } else if( document.layers && document.layers[argObjId] ) {
    // NN 4 DOM
	  return document.layers[argObjId];
  } else {
	  return false;
  }
}

function showMenu( argObjId ) {
  var styleObj = getStyleObj( argObjId );
  if( styleObj ) {
	  styleObj.visibility = "visible";
  }
}

function hideMenu( argObjId ) {
  var styleObj = getStyleObj( argObjId );
  if( styleObj ) {
	  styleObj.visibility = "hidden";
  }
}

function hiliteBgColor( argMenuItem, color ) {
	if( browser.nn && browser.major < 5 ) {
    var menuObj = eval( argMenuItem );
    if( menuObj ) menuObj.bgColor = color;
  }	else if( browser.ie || ( browser.nn && browser.major > 4 ) ) {
    var styleObj = getStyleObj( argMenuItem );
    if( styleObj ) styleObj.backgroundColor = color;
  }
}

function timedHideMenu( argMenu, milliseconds ) {
  if( browser.ie || ( browser.nn && browser.major > 4 ) ) 
	hideMenu( argMenu );
  else 
	eval( argMenu + "Timer = setTimeout( \"hideMenu( \'" + argMenu + "\' )\", " + milliseconds + " );" )
}

//For links that just need new window
function playMovie( topic ) {
  window.open(topic, "newWindow","history=no,align=center,width=380,height=430,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=no,resizable");
}

function viewImage( topic ) {
	window.open(topic, "newWindow","history=no,align=center,width=850,height=650,toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=yes,resizable");
}

