// in IE there is a bug will cause some elements
// to not draw on screen when the user uses the back button
// the below fixes that problem by forcing the page to redraw
//function msieDisplayFix()
//{
//    document.getElementById("bodyNode").style.display = "block"
//}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) { if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
          document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

//
// DOM-based browser sniffer
//
function checkBrowser(isIdx) {
  var ns4 = false;
  var ie4 = false;
  var ns6 = false;
  var showobject = "visible";
  var hideobject = "hidden";

  if( isIdx ) {
    styleFiles = ["/styles/index.css", "/styles/tables.css"];
  } else {
    styleFiles = ["/styles/page.css", "/styles/tables.css"];
  }
  
  if(document.all) { // MS Internet Explorer
    ie4=true;
    //window.alert("ie4 "+ie4+ " " +navigator.userAgent);
    document.writeln('<style><!--');
    document.writeln('body { margin: 0px 0px 0px 76px; }');
    document.writeln('// --></style>');
    document.write('<style>');
    for( var i=0; i < styleFiles.length; i++ ) {
      //alert("\@import \""+styleFiles[i]+'";');
      document.write("\@import \""+styleFiles[i]+"\";");
    }
    document.writeln('</style>');
  }
  else if(document.getElementById) { // Mozilla Netscape 6 although MS IE defines that function too
    ns6=true;
    //alert("ns6 "+ns6+ " " +navigator.userAgent);
    showobject = "show";
    document.writeln('<style><!--');
    document.writeln('body { margin: -14px 0px 0px 80px }');
    document.writeln('// --></style>');
    for( var i=0; i < styleFiles.length; i++ ) {
      //alert("stylesheet "+styleFiles[i]);
      document.writeln('<link rel="stylesheet" href="'+styleFiles[i]+'" />');
    }
  }
  else if(document.layers) { // Netscape 4
    ns4=true;
    //alert("ns4 layers "+ns4);
    showobject = "show";
    hideobject = "hide";
    document.writeln('<style><!--');
    document.writeln('body { margin: -14px 0px 0px 80px }');
    document.writeln('// --></style>');
    for( var i=0; i < styleFiles.length; i++ ) {
      document.write('<link rel="stylesheet" href="'+styleFiles[i]+'" />');
    }
    MM_reloadPage(ns4);
  }
  else {
    //alert("else");
    showobject = "show";
    document.writeln('<link rel="stylesheet" href="/styles/index.css" />');
    document.writeln('<link rel="stylesheet" href="/styles/tables.css" />');
  }
}
//window.onLoad = checkBrowser(true);

