latest = "7";

languagesq = new Object;
languagesq["un"] = "Unknown language, ";
languagesq["cn"] = "Chinese (simp.) language, ";
languagesq["cs"] = "Czech language, ";
languagesq["da"] = "Danish language, ";
languagesq["de"] = "German language, ";
languagesq["el"] = "Greek language, ";
languagesq["en"] = "English language, ";
languagesq["es"] = "Spanish language, ";
languagesq["fc"] = "French (Canada) language, ";
languagesq["fi"] = "Finnish language, ";
languagesq["fr"] = "French language, ";
languagesq["hu"] = "Hungarian language, ";
languagesq["it"] = "Italian language, ";
languagesq["ja"] = "Japanese language, ";
languagesq["ko"] = "Korean language, ";
languagesq["nl"] = "Dutch language, ";
languagesq["no"] = "Norwegian language, ";
languagesq["pl"] = "Polish language, ";
languagesq["pt"] = "Brazilian Portuguese language, ";
languagesq["ru"] = "Russian language, ";
languagesq["sv"] = "Swedish language, ";
languagesq["tr"] = "Turkish language, ";
languagesq["tw"] = "Chinese (trad.) language, ";
languagesq["uk"] = "English (UK) language, ";
languagesq["de-de"] = "German language, ;"
languagesq["en-gb"] = "English (UK) language, ";
languagesq["en-us"] = "English language, ";
languagesq["es-es"] = "Spanish language, ";
languagesq["fr-fr"] = "French language, ";
languagesq["ja-jp"] = "Japanese language, ";

lang = "un";
Component = "Unknown browser";
platform = "Unknown platform";
OS = "";
version = parseFloat(navigator.appVersion);
UA = navigator.userAgent;
ua = navigator.userAgent.toLowerCase();

// Language
if (((start = ua.indexOf("[")) > 0) && ((end = ua.indexOf("]")) == (ua.indexOf("[") + 3))){
  language = ua.substring(start+1, end);
} else if (navigator.language) {
  language = navigator.language.toLowerCase();
} else if (navigator.userLanguage) {
  language = navigator.userLanguage.toLowerCase();
}
if (languagesq[language]) {
  lang = language;
}

// OS
if (((ua.indexOf("ppc") > 0) && (ua.indexOf("mac") > 0))
    || (ua.indexOf("mac_power") > 0)) {
//  if (ua.indexOf("os x")) {
//    OS = "macosx";
//  } else {
    OS = "macppc";
//  }
} else if ((ua.indexOf("linux 2.2") > 0)
	   || (ua.indexOf("netscape6") && ua.indexOf("linux") > 0)) {
  OS = "linux2.2";
} else if (ua.indexOf("win") > 0) {
  OS = "win32";
}

// Other info
start = UA.indexOf('(') + 1;
end = UA.indexOf(')');
str = UA.substring(start, end);
info = str.split('; ');

if (ua.indexOf('msie') != -1) {
  platform = info[2];
  Component = navigator.appName;
  str = info[1].substring(5, info[1].length);
  version = parseFloat(str);
} else if ((start = ua.indexOf("netscape6")) > 0) {
  if (info[0].toLowerCase() == "windows") {
    platform = info[2];
  } else {
    platform = info[0] + " " + info[2];
  }
  Component = "Netscape";
  version = ua.substring(start+10, ua.length);
  if ((start = version.indexOf("b")) > 0 ) {
    pr = version.substring(start+1,version.length);
    str = version.substring(0,version.indexOf("b"));
    version = str + " Preview Release " + pr;
  }
} else {
  if(info[2]) {
    if (info[0].toLowerCase() == "windows") {
      platform = info[2];
    } else {
      platform = info[0] + " " + info[2];
    }
  } else {
    platform = info[0];
  }
  if (ua.indexOf("gecko") > 0) {
    Component = "Mozilla";
  } else if (ua.indexOf("nav") > 0) {
    Component = "Netscape Navigator";
  } else {
    Component = "Netscape Communicator";
  }
}
// Some formatting
if ((platform.indexOf("NT") != -1) && (platform.indexOf("5.1") != -1)) {
  platform = "Windows XP";
}
if (parseInt(version) == parseFloat(version)) {
  version = version + ".0";
}

// Message according to the sniff result
if (version == latest) {
  Congrats();
} else if (OS != "") {
  if (languagesq[lang].indexOf("English language,") != -1) {
    Upgrade();
  } else {
    Upgrade_General();
  }
} else {
  Upgrade_General();
}
You_R_running = "<B>" + "You are currently using: </b><BR>\n";
You_R_running += "<B>" + Component + " " + version + "</B> <BR> ";
You_R_running += "" + languagesq[lang] +  platform + "<BR> ";

document.writeln("<BR clear=all><DIV align=right>");
document.writeln("<BR><a href=javascript:hide();>" + "Close this pop-up window");
document.writeln(" </A></DIV>");
document.writeln("<p>Wadsworth Center's website is being redesigned to be useable by all browsers and devices by authoring to <a href=http://www.w3.org/WAI/gettingstarted/>"   + "W3C Web Accessibility Initiative </a> and <a href=http://www.oft.state.ny.us/policy/99-3.htm>NYS Office for Technology, Technology Policy 99-3</a> standards.</p>");
document.writeln("<ul><li><a href=http://www.w3.org/TR/1999/REC-html401-19991224/>" + "HTML 4.01 Transitional</a> -  supports webpages that are more accessible to users with disabilities.");
document.writeln("<li><a href=http://www.w3.org/TR/2001/WD-xhtml1-20011004>" + "XHTML 1.0 Transitional</a> - <a href=http://www.w3.org/TR/2001/WD-xhtml1-20011004/#why>Why the Need for XHTML?</a>");
document.writeln("</ul>");
document.writeln("<p>While taking care to ensure that all the information will still be accessible while keeping a standard design in non-compliant browsers, it is recommended that you upgrade your browser to a standards compliant browser.</p>");
document.writeln("<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH=100%><TR><TD>");
document.writeln(You_R_running);
document.writeln("<BR><HR SIZE=1 NOSHADE WIDTH=80% align=center>" + We_Recommend);
document.writeln(Download);

document.writeln(" </TD></TR></TABLE>");

// Subroutines
function Congrats() {
  We_Recommend = ("<FONT FACE=\"Arial, Helvetica\" SIZE=3><FONT COLOR=000000><b>Congratulations!</b></FONT>\n "
		  + "<BR><font size=1>You are using one of the most recent browsers from Netscape! <BR>"
		  + "<A HREF=\"http://home.netscape.com/browsers/6/index.html?cp=djulrn\">Learn more</A> about new features, "
		  + "check out <A href=\"http://info.netscape.com/fwd/djusb/http://channel.netscape.com/sidebar/sbd/index.tmpl\">My Sidebar</a> or download Netscape 6 <A href=\"http://home.netscape.com/themes/index.html?cp=djuthm\">"
		  + "Themes</a>.<BR><BR>In order to continually provide the best possible products, we invite you to participate in our <A HREF=\"/browsers/6/feedback/index.html?cp=djufb\">Feedback</A> program.</FONT></FONT>");

  Download = "";
}

function Upgrade_General() {
  We_Recommend = "<FONT FACE=\"Arial, Helvetica\" SIZE=2>Netscape currently offers two browser suites in over 23 languages and 20 platforms. Please select the most appropriate product below:</FONT>\n";
  Download = ("<FONT FACE=\"Arial, Helvetica\" SIZE=2><A HREF=\"http://home.netscape.com/download/1126101/10004-----_qual.html?cp=djun6x\">Netscape 6 Series</A>"
	      + "<BR><A HREF = \"http://home.netscape.com/download/1126101/10000-----_qual.html?cp=dju47x\">Netscape Communicator Series</A></FONT>\n");
}

function Upgrade() {
  var extra_msg = "";
  We_Recommend = ("<UL><LI class=green> Upgrade  to \n  "
                  + "Netscape " + latest + ""
                  + "<BR> "
		  + languagesq["en"] +  platform + " ");

  if (OS == "linux2.2") {
    Bitpath = "http://ftp.netscape.com/pub/netscape6/english/6.2.1/unix/linux22/netscape-i686-pc-linux-gnu-installer.tar.gz";
    clickpath = "djulnx";
    cdcp = "djulnxcd";
  } else if (OS == "macppc") {
    Bitpath = "http://ftp.netscape.com/pub/netscape6/english/6.2.1/mac/macos8/MacNetscape6Installer.sea.bin";
    clickpath = "djumac";
    cdcp = "djumaccd";
    extra_msg += ("<FONT FACE=\"Arial, Helvetica\" SIZE=2><B>MacOS X users</B> - "
		  + "<A HREF=\"http://info.netscape.com/fwd/djuosx/http://cgi.netscape.com/cgi-bin/pdms_download_path.cgi?USE_NSDA=NO&BITPATH=http://ftp.netscape.com/pub/netscape6/english/6.2.1/mac/macosx/sea/Netscape6-macosX.smi.bin\">Click Here</A></FONT>");
  } else if (OS == "macosx") {
    Bitpath = "http://ftp.netscape.com/pub/netscape6/english/6.2.1/mac/macosx/sea/Netscape6-macosX.smi.bin";
    clickpath = "djuosx";
    cdcp = "djumaccd";
  } else {
    Bitpath = "http://ftp.netscape.com/pub/netscape6/english/6.2.1/windows/win32/N6Setup.exe";
    clickpath = "djuwin";
    cdcp = "djuwincd";
  }
  var dwn_dest = ("http://home.netscape.com/computing/download/index.html"
		   );
  var cd_dest = ("http://info.netscape.com/fwd/" + cdcp + "/" +
		 "http://cd.netscape.com/");

  Download = ("<TABLE cellpadding=0  BORDER=0 ><TR><TD ALIGN=right><A HREF=\""
	      + dwn_dest
	      + "\">FREE - Download now from www.netscape.com"
	      + "</A></TD>");
  if (version != "6.01") {
    Download += ("<TD></TD>"
		 + "<TD ALIGN=left><A HREF=\"" + cd_dest
		 + "\"> </A></TD></TR></TABLE>");
  } else {
    Download += ("</TR></TABLE>");
  }
  Download += extra_msg;
}

document.writeln("<BR clear=all><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD>");
document.writeln("<UL><LI class=green>Upgrade to Internet Explorer 6.0");
document.writeln("<BR><a href=http://www.microsoft.com/windows/ie/downloads/ie6/default.asp>" + "FREE - Download now from www.microsoft.com ");
document.writeln(" </TD></TR></TABLE>");

document.writeln("<BR clear=all><TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD>");
document.writeln("<UL><LI class=green>Upgrade to Adobe Acrobat Reader 5.0");
document.writeln("<BR><a href=http://www.adobe.com/products/acrobat/readstep2.html>" + "FREE - Download now from www.adobe.com ");
document.writeln("<BR><a href=http://www.health.state.ny.us/nysdoh/key.htm#pdf>" + "HELP with Adobe Portable Document Format files ");
document.writeln(" </TD></TR></TABLE>");

