var browser = 'an unknown browser';
var platform = 'an unknown platform';
var version = '';

//Browser detection
function browserID() {
  var u = navigator.userAgent;
  var i = u.indexOf('WebTV');
  if (i >= 0) { browser = 'WebTV'; i += 6; }
  else {
    i = u.indexOf('MSIE');
    if (i >= 0) { browser = 'Internet Explorer'; i += 5; }
    else {
      i = u.indexOf('Opera');
      if (i >= 0) { browser = 'Opera'; i = u.indexOf(') ') + 2; }
      else {
        i = u.indexOf('Mozilla/');
        if (i >= 0) { browser = 'Netscape'; i += 8; }
      }
    }
  }
  version = parseFloat(u.substring(i, i+4));
  if (u.indexOf('Win') >= 0) {
    platform = 'Windows';
    if (u.indexOf('95') >= 0) platform+=" 95";
    else if (u.indexOf('98') >= 0) platform+=" 98";
    else if (u.indexOf('2000') >= 0) platform+=" 2000";
    else if (u.indexOf('NT') >= 0) platform+=" NT";
  }
  if (u.indexOf('Mac') >= 0) { platform = 'Macintosh'; }
  if (u.indexOf('OS/2') >= 0) { platform = 'OS/2'; }
  if (u.indexOf('X11') >= 0) { platform = 'UNIX'; }
  if (u.indexOf('Linux') >= 0) { platform = 'Linux'; }
//  if (browser=="Netscape" && version>=5) version=6;
	var isNS6 = navigator.userAgent.toLowerCase().indexOf("gecko") == -1 ? false : true;
	if (isNS6) {
		browser=="Netscape";
		version=6;
	}
	
  //document.write("You are using "+browser+" "+version+" on "+platform);
  //document.write(" with Java "+(navigator.javaEnabled()?"enabled":"disabled")+".");
}

//Is Netscape browser
function isNN() {
	var returnValue = false;
	browserID();
	if (browser == 'Netscape')
		returnValue = true;
	return returnValue;	
}

//MSFT IE Only
function ieOnly() {
	if (isNN())
		document.write('<TABLE WIDTH="500"><TR><TD ALIGN="Middle"><FONT SIZE="-1" COLOR="Red">This application ' +
									 'works and looks best with Microsoft\'s Internet Explorer 4.01 browser or higher with ' +
									 'JavaScript enabled. Thanks.</FONT></TD></TR></TABLE>');
}


