/*  Copyright © 2001, 2002 OGMA Consulting Corp. */

// TR 03/03/03
// Use version>=5.5 for IE, for Netscape use the userAgent string before
// the appName string as it returns the actual version number. Check this
// to be >= 6.2. Also: use parseFloat so that the numerical compare works
// properly with versions such as "6.1.1" or "5.5beta"

 function sniffBrowser(message) {


    isIE = false;
    isNetscape = false;
    isValidVersion = false

    if (navigator.appName.indexOf("Microsoft") != -1) {
      isIE = true;

      var versionMatch = /MSIE\s*([\d.]+)/;
      var result = navigator.appVersion.match(versionMatch);

      if (result != null) {
        var version = result[1];

				if ( parseFloat(version) >= 5.5) {
					isValidVersion = true;
					return version
				}
      }

    } else if (navigator.appName.indexOf("Netscape") != -1) {
      isNetscape = true;

      var userAgentVersionMatch = /Netscape\S*\/([\d.]+)/;
      var result = navigator.userAgent.match( userAgentVersionMatch );

      if (result != null) {

				var version = result[1];

				if ( parseFloat(version) >= 6.2 ) {
					isValidVersion = true;
					return version;
				}

      } else {
      	var appVersionMatch = /^([\d.]+)\s*/;
				result = navigator.appVersion.match(appVersionMatch);

				var version = result[1];
				if ( parseFloat(version) >= 5.0) {
					isValidVersion = true;
					return version
				}
      }
    }

    if (!isValidVersion) {
      alert(message);
    }
  }