// JScript source code

/*
*This loops thru all of the properties of the navigator object
*The navigator object is a prewritten object that can determine all the values of the user's browser
var browser = "BROWSER INFORMATION\n";
for (var propertyname in navigator)
{
  browser += propertyname + ": " + navigator[propertyname] + "\n";
}
alert(browser);
*/

//Creating the browser object and creating properties for it
var browser = new Object();
browser.agent = navigator.userAgent.toLowerCase();
browser.version = parseInt(navigator.appVersion);
browser.appName = navigator.appName;
browser.system = "";
if (browser.agent.indexOf("win") != -1) browser.system = "Windows";
else if (browser.agent.indexOf("mac") != -1) browser.system = "Mac";
else if (browser.agent.indexOf("X11") != -1) browser.system = "Unix"; 
/*
*This will loop thru all of the properties of the browser object (if activated)
for (var i in browser)
{
  alert (i + ": " + browser[i]);
}
*/
//Defining the error text for the Upgrade message
var noncompatxt = "It is recommended that you upgrade your browser.\n";
noncompatxt += "Some of the features on this page may or may not display or function correctly \nwith the current version of your browser.\n";
noncompatxt += "By clicking on the OK button, you will be redirected to the download page for the latest version of your particular browser.\n";
noncompatxt += "To proceed to the home page without upgrading, click the Cancel button.";
//Performing the test on the browser
if (browser.appName.indexOf("Netscape") != -1 && browser.version < 5)
{
  if (confirm (noncompatxt) == true)
    {
      if (browser.system == "Windows") parent.location = "http://channels.netscape.com/ns/browsers/download.jsp";
      else if (browser.system == "Mac") parent.location = "http://channels.netscape.com/ns/browsers/download.jsp";
    }
}
else if (browser.appName.indexOf("Microsoft") != -1 && browser.version < 4)
{
  if (confirm (noncompatxt) == true)
    {
      if (browser.system == "Windows") parent.location = "http://www.microsoft.com/downloads/details.aspx?FamilyID=1e1550cb-5e5d-48f5-b02b-20b602228de6&displaylang=en";
      else if (browser.system == "Mac") parent.location = "http://www.microsoft.com/mac/download/default.asp#IE"
    }
}
