/* Simple JavaScript browser sniffer */

var agent = navigator.userAgent.toLowerCase();
var appVer = navigator.appVersion.toLowerCase();
var version = parseFloat(appVer);

var iePos  = appVer.indexOf('msie');
if (iePos > -1) {
   version = parseFloat(appVer.substring(iePos + 5, appVer.indexOf(';', iePos)))
}
var isIE = (iePos > -1);

var isNav = ((agent.indexOf('mozilla') > -1) && (agent.indexOf('spoofer') == -1)
            && (agent.indexOf('compatible') == -1) && (agent.indexOf('opera') == -1)
            && (agent.indexOf('webtv') == -1));

var nav6Pos = agent.indexOf('netscape6');
if (nav6Pos > -1) {
   version = parseFloat(agent.substring(nav6Pos + 10));
}

// raise an alert if browser is earlier than IE v5.5 or Netscape v4.76
if (isIE && version < 5.5) {
   alert("HiCommand requires Microsoft Internet Explorer version 5.5 or later.");
} else if (isNav && version < 4.76) {
   alert("HiCommand requires Netscape Communicator version 4.76 or later.");
}
