function IEdetect(cname,cid) {
    var bCompAvailable;
    var sCompVersion;
    if (typeof(caps) != "undefined" && typeof(caps.id) != "undefined" && typeof(caps.getComponentVersion) != "undefined") {
        bCompAvailable = caps.isComponentInstalled(cid,"ComponentID");
        sCompVersion = caps.getComponentVersion(cid,"ComponentID");
    }
    if (bCompAvailable) {
        document.write('<tr class="hiover"><th>'+cname+'</th><td>');
        (sCompVersion) ? document.write("v " + sCompVersion) : document.write("-");
        document.writeln("</td></tr>");
		return 1;
    }
	return 0;
}

function plugshow(id) {
	if(document.getElementById("plugin_"+id).style.display == 'none') {
		document.getElementById("plugin_"+id).style.display = 'block';
		document.getElementById("indicat_"+id).src = '/img/button_minus.png';
	} else {
		document.getElementById("plugin_"+id).style.display = 'none';
		document.getElementById("indicat_"+id).src = '/img/button_plus.png';
	}
}

function getPlugins() {
	var plugnum = navigator.plugins.length;
	var plugnames = '';

	setnum('num_comp',plugnum);		

	if (plugnum == 0) {
	    plugnames = 'keine/unbekannt';
	} else {
	    for (i = 0; i < plugnum; i++) {
	        document.write('<table class="grey" style="border:0"><tr style="height:1px; overflow:hidden"><th style="border:0"><img src="/img/px.gif" style="width:280px; height:1px" alt=""/></th><td style="border:0; width:100%"></td></tr><tr class="hiover"><th style="border:0"><a class="opt" href="javascript:plugshow('+i+');"><img id="indicat_'+i+'" style="float:left; width:9px; height:9px; padding-right:4px" src="/img/button_plus.png" alt="+"/>'+navigator.plugins[i].filename+'</a> ('+navigator.plugins[i].length+')</th><td style="border:0">');
	        document.writeln(navigator.plugins[i].name+'</td></tr><tr><td colspan="2"><table class="grey" id="plugin_'+i+'" style="width:100%;display:none">');
			for (j = 0; j < navigator.plugins[i].length; j++) {
				mime = navigator.plugins[i][j];
				enabled = "";
				if (mime) {
					enabled = "<span style=\"color:#990000\">disabled</span>";
					enabledPlugin = mime.enabledPlugin;
					if (enabledPlugin && (enabledPlugin.name == navigator.plugins[i].name)) {
						enabled = "<span style=\"color:#009900\">enabled</span>";
					}
				}
				document.writeln('<tr class="hiover"><td style="border:0; margin:0; padding:0; width:280px">'+mime.type+'</td><td style="border:0;pargin:0;padding:0;width:40px">'+enabled+'</td><td style="width:200px; border:0">'+mime.suffixes+'</td><td style="border:0;">'+mime.description+'</td></tr>');
			}
			document.writeln("</table></td></tr></table>");
	    }
	}
	if (navigator.appName == "Microsoft Internet Explorer") {
		document.write('<table class="grey"><tr style="height:1px; overflow:hidden"><th style="border:0"><img src="/img/px.gif" style="width:280px; height:1px" alt=""/></th><td style="border:0; width:100%"></td></tr>');
		var ienum = 0;
	    ienum = ienum + IEdetect("AOL ART Image Format Support","{47F67D00-9E55-11D1-BAEF-00C04FC2D130}");
	    ienum = ienum + IEdetect("Address Book","{7790769C-0471-11D2-AF11-00C04FA35D02}");
	    ienum = ienum + IEdetect("Adobe Acrobat","{CA8A9780-280D-11CF-A24D-444553540000}");
	    ienum = ienum + IEdetect("Apple Quicktime","{02BF25D5-8C17-4B23-BC80-D3488ABDDC6B}");
	    ienum = ienum + IEdetect("Arabic Text Display Support","{76C19B38-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Chinese (Simplified) Text Display Support","{76C19B34-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Chinese (Traditional) Text Display Support","{76C19B33-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("DirectAnimation Java Classes","{4F216970-C90C-11D1-B5C7-0000F8051515}");
	    ienum = ienum + IEdetect("DirectAnimation","{283807B5-2C60-11D0-A31D-00AA00B92C03}");
	    ienum = ienum + IEdetect("DirectShow","{44BBA848-CC51-11CF-AAFA-00AA00B6015C}");
	    ienum = ienum + IEdetect("DivX","{67DABFBF-D0AB-41fa-9C46-CC0F21721616}");
	    ienum = ienum + IEdetect("Dynamic HTML Data Binding for Java","{4F216970-C90C-11D1-B5C7-0000F8051515}");
	    ienum = ienum + IEdetect("Dynamic HTML Data Binding","{9381D8F2-0288-11D0-9501-00AA00B911A5}");
	    ienum = ienum + IEdetect("Hebrew Text Display Support","{76C19B36-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Internet Connection Wizard","{5A8D6EE0-3E18-11D0-821E-444553540000}");
	    ienum = ienum + IEdetect("Internet Explorer Web Browser","{89820200-ECBD-11CF-8B85-00AA005B4383}");
	    ienum = ienum + IEdetect("Internet Explorer Browsing Enhancements","{630B1DA0-B465-11D1-9948-00C04F98BBC9}");
	    ienum = ienum + IEdetect("Internet Explorer Classes for Java","{08B0E5C0-4FCB-11CF-AAA5-00401C608555}");
	    ienum = ienum + IEdetect("Internet Explorer Help Engine","{DE5AED00-A4BF-11D1-9948-00C04F98BBC9}");
	    ienum = ienum + IEdetect("Internet Explorer Help","{45EA75A0-A269-11D1-B5BF-0000F8051515}");
	    ienum = ienum + IEdetect("Internet Explorer Web Browser","{89820200-ECBD-11CF-8B85-00AA005B4383}");
	    ienum = ienum + IEdetect("Japanese Text Display Support","{76C19B30-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Java Virtual Machine","{08B0E5C0-4FCB-11CF-AAA5-00401C608500}");
	    ienum = ienum + IEdetect("Java Virtual Machine (sun)","{8AD9C840-044E-11D1-B3E9-00805F499D93}");
	    ienum = ienum + IEdetect("Korean Text Display Support","{76C19B31-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Language Auto-Selection","{76C19B50-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Macromedia Flash","{D27CDB6E-AE6D-11CF-96B8-444553540000}");
	    ienum = ienum + IEdetect("Macromedia Shockwave Director","{2A202491-F00D-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Macromedia Shockwave Director","{166B1BCA-3F9C-11CF-8075-444553540000}");
	    ienum = ienum + IEdetect("Microsoft virtual machine","{08B0E5C0-4FCB-11CF-AAA5-00401C608500}");
	    ienum = ienum + IEdetect("NetMeeting NT","{44BBA842-CC51-11CF-AAFA-00AA00B6015B}");
	    ienum = ienum + IEdetect("Offline Browsing Pack","{3AF36230-A269-11D1-B5BF-0000F8051515}");
	    ienum = ienum + IEdetect("Outlook Express","{44BBA840-CC51-11CF-AAFA-00AA00B6015C}");
	    ienum = ienum + IEdetect("Pan-European Text Display Support","{76C19B32-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("RealPlayer","{CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA}");
	    ienum = ienum + IEdetect("Task Scheduler","{CC2A9BA0-3BDD-11D0-821E-444553540000}");
	    ienum = ienum + IEdetect("Thai Text Display Support","{76C19B35-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Uniscribe","{3BF42070-B3B1-11D1-B5C5-0000F8051515}");
	    ienum = ienum + IEdetect("VRML 2.0 Viewer","{90A7533D-88FE-11D0-9DBE-0000C0411FC3}");
	    ienum = ienum + IEdetect("Vector Graphics Rendering (VML)","{10072CEC-8CC1-11D1-986E-00A0C955B42F}");
	    ienum = ienum + IEdetect("Vietnamese Text Display Support","{76C19B37-F0C8-11CF-87CC-0020AFEECF20}");
	    ienum = ienum + IEdetect("Visual Basic Scripting Support","{4F645220-306D-11D2-995D-00C04F98BBC9}");
	    ienum = ienum + IEdetect("Wallet","{1CDEE860-E95B-11CF-B1B0-00AA00BBAD66}");
	    ienum = ienum + IEdetect("Web Folders","{73FA19D0-2D75-11D2-995D-00C04F98BBC9}");
	    ienum = ienum + IEdetect("Windows Desktop Update NT","{89820200-ECBD-11CF-8B85-00AA005B4340}");
	    ienum = ienum + IEdetect("Windows Media Player RealNetwork Support","{23064720-C4F8-11D1-994D-00C04F98BBC9}");
	    ienum = ienum + IEdetect("Windows Media Player","{22D6F312-B0F6-11D0-94AB-0080C74C7E95}");
		document.write('</table>');
		setnum('num_comp',ienum);		
	}
}

function getOnline() {
	if (typeof(navigator.onLine) != "undefined" && navigator.onLine != "") {
		if(navigator.onLine) {
			document.write('<span style="color:#009900">enabled</span>');
		} else {
			document.write('<span style="color:#990000">disabled</span>');
		}
	}
}

function checkXMLhttp() {
	var via = '<span style="color:#990000">not supported</span>';
	try {
		if(window.XMLHttpRequest) {
			via = '<span style="color:#009900">via XMLHttpRequest</span>';
		} else if (window.ActiveXObject) {
			try {
				xmlhttp = new ActiveXObject("Msxml2.XMLHTTP")
			} catch (e1) {
				try {
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
				} catch (e2) {
					return;
				}
				document.getElementById('ajaxtest').innerHTML = '<span style="color:#009900">via Microsoft.XMLHTTP</span>';
				return;
			}
			document.getElementById('ajaxtest').innerHTML = '<span style="color:#009900">via Msxml2.XMLHTTP</span>';
			return;
		}
	} catch(e3) { }
	document.getElementById('ajaxtest').innerHTML = via;
}

function checkHttpOnlyCookie() {
	var nameEQ = "http1=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) {
			document.getElementById('httponly').innerHTML = '<span style="color:#990000">not supported (treated like a normal cookie)</span>';
			return;
		}
	}
	document.getElementById('httponly').innerHTML = '<span style="color:#009900">supported (or the cookie was not set at all)</span>';
	return;
}

