// This function parses the userAgent string returned from
// navigator.appVersion.  For example it may contain something
// like this:
// Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0; COM+ 1.0.2204)
// So in this case you would call it as follows:
//      CheckBrowsere("MSIE", 5.5);
function CheckBrowser(name, version)
{    
    var sub = navigator.userAgent;
    var p = sub.indexOf(name);
    var v = 0;
    if (p > 0) {
        var q = sub.indexOf(";",p);
        var str = sub.substr(p,q-p);
        var sa = str.split(" ");
        if (sa.length > 1) {
            v = parseFloat(sa[1]);
        }
    }
    if (p < 0 || v < version) {
    	document.open();
    	document.write("<b><font color=red>ERROR: this sample requires " + name + " version " + version + " or higher.</font></b>");
    	document.close();
    }
}