systemcheck=function() {
    this.versionCode=parseFloat(navigator.appVersion);
    this.activeX=(navigator.appName == "Microsoft Internet Explorer" && this.versionCode >= 4.0) ? true : false;
    this.theAgent=navigator.userAgent.toLowerCase();
    this.cookiesOk=navigator.cookieEnabled;
    this.isAOL=this.checkAgent("aol") || this.checkAgent("iweng");
    this.isKhtml=this.checkAgent("khtml");
    this.isOpera=this.checkAgent("opera");
    this.isGecko=!this.isKhtml && !this.isOpera && this.checkAgent("gecko/");
    this.isSafari=this.checkAgent("safari");
    this.isKonqueror=this.checkAgent("konqueror");
    this.isNetscape=!this.isOpera && this.checkAgent("netscape") && !this.checkAgent("spoofer") && !this.checkAgent("compatible");
    this.isMozilla=!this.isSafari && !this.isNetscape && !this.isOpera && this.checkAgent("mozilla") && !this.checkAgent("spoofer") && !this.checkAgent("compatible");
    this.isWebtv=this.checkAgent("webtv");
    this.isIE=!this.isWebtv && !this.isOpera && this.checkAgent("msie");
    this.isWinMedia=false;
    this.isRealMedia=false;
    this.osMac=this.checkAgent("mac");
    this.osAnynix=this.checkAgent("linux") || this.checkAgent("unix");
    this.osWin=(navigator.platform == "Win32") || this.checkAgent("windows") || this.checkAgent("winnt") || this.checkAgent("winme") || this.checkAgent("win9") || this.checkAgent("win16");
    this.browserTest();
}

systemcheck.prototype.checkAgent=function(str) {
    return this.theAgent.indexOf(str)!=-1;
}

systemcheck.prototype.detectIE=function(ClassID,name) {
    systemcheck_result = false;
    document.write('<scr'+'ipt language=VBScript>\n on error resume next\n systemcheck_vbrunsok=1\n systemcheck_result = IsObject(CreateObject("' + ClassID + '"))</scr'+'ipt>\n');
    if(systemcheck_result) return name+",";
    return "";
}

systemcheck.prototype.detectNS=function(ClassID,name) {
    if((this.nse.indexOf(ClassID)!=-1) && (navigator.mimeTypes[ClassID].enabledPlugin!=null)) return name+",";
    return "";
}

systemcheck.prototype.browserTest=function(){
    var pluginlist="";
    if(this.isIE && this.osWin) {
	systemcheck_vbrunsok=false;
	pluginlist = this.detectIE("Adobe.SVGCtl","SVG Viewer") + this.detectIE("SWCtl.SWCtl.1","Shockwave Director") + this.detectIE("ShockwaveFlash.ShockwaveFlash.1","Shockwave Flash") + this.detectIE("rmocx.RealPlayer G2 Control.1","RealPlayer") + this.detectIE("QuickTimeCheckObject.QuickTimeCheck.1","QuickTime") + this.detectIE("MediaPlayer.MediaPlayer.1","Windows Media Player") + this.detectIE("PDF.PdfCtrl.5","Acrobat Reader");
	if(systemcheck_vbrunsok){
	    //this.say("Visual basic found.");
	}else{
	    this.say("Sorry, Internet Explorer requires VBScript to provide your browser with information about your browser plugins!\nThere has been no visual basic found, please install or enable VBSript if you wish to launch this application.");
	}
    }
    if(this.isMozilla || this.isNetscape || !this.osWin) {
	this.nse = "";
	for (var i=0;i<navigator.mimeTypes.length;i++) this.nse += navigator.mimeTypes[i].type.toLowerCase();
	pluginlist = this.detectNS("image/svg-xml","SVG Viewer") + this.detectNS("application/x-director","Shockwave Director") + this.detectNS("application/x-shockwave-flash","Shockwave Flash") + this.detectNS("audio/x-pn-realaudio-plugin","RealPlayer") + this.detectNS("video/quicktime","QuickTime") + this.detectNS("application/x-mplayer2","Windows Media Player") + this.detectNS("application/pdf","Acrobat Reader");
	//this.say("NS mimetypes"+this.nse);
    }

    // Add java test result to pluginlist
    pluginlist += navigator.javaEnabled() ? "Java," : "";
    if (pluginlist.length > 0) pluginlist = pluginlist.substring(0,pluginlist.length-1);
    //var cookieMessage=(this.cookiesOk)?"Yes":"No";
    //this.say(pluginlist+"\n"+"in "+this.theAgent+"\n"+"0n "+navigator.platform+"\n"+"Cookies "+cookieMessage);
    this.isWinMedia=(pluginlist.indexOf("Windows Media Player")!=-1)?true:false;
    this.isRealMedia=(pluginlist.indexOf("RealPlayer")!=-1)?true:false;
}

systemcheck.prototype.say=function(message){
    alert(message);
}

systemcheck.getInstance=function() {
    if(!this.instance) {
	this.instance=new systemcheck();
    }
    return this.instance;
}

