function wykryj_przeglondarke() {
	var userAgent = navigator.userAgent.toLowerCase();
	var appName = navigator.appName.toLowerCase();
	
	var docAll = (document.all) ? true : false;
	var docLayers = (document.layers) ? true : false;
	var docGetElemId = (document.getElementById) ? true : false;
	
	this.win = (userAgent.indexOf('win') != -1) ? true : false;
	this.mac = (userAgent.indexOf('mac') != -1) ? true : false;
	this.linux = (userAgent.indexOf('linux') != -1 || userAgent.indexOf('x11') != -1) ? true : false;
	
	this.ie = (appName.indexOf('internet explorer') != -1) ? true : false;
	this.ie4 = (this.ie && !docGetElemId);
	this.ie4win = (this.ie4 && this.win);
	this.ie4mac = (this.ie4 && this.mac && !docGetElemId);
	this.ie5 = (this.ie4 && docGetElemId);
	this.ie5mac = (this.ie5 && this.mac);
	
	this.ns = (appName.indexOf('netscape') != -1) ? true : false;
	this.ns4 = (this.ns && docLayers);
	this.ns6 = (this.ns && docGetElemId);
	
	this.opera = (appName.indexOf('opera') != -1 || userAgent.indexOf('opera') != -1) ? true : false;
	

	if (this.ie4win) {
		with (document) {
			write('<script language="VBScript" type="text/vbscript">\n');
			
			write('Function flashActX(version)\n');
			write('\tOn Error Resume Next\n');
			write('\t\n');
			write('\tDim FlashObj\n');
			write('\tFlashObj = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & version))\n');
			write('\tflashActX = FlashObj\n');
			write('End Function\n');
			write('\n\n');
			
			write('Function quickTimeActX()\n');
			write('\tOn Error Resume Next\n');
			write('\t\n');
			write('\tDim QuickTimeObj, QuickTime4Obj, QuickTime5Obj\n');
			write('\tQuickTime4Obj = IsObject(CreateObject("QuickTimeCheckObject.QuickTimeCheck.1"))\n');
			write('\tQuickTime5Obj = IsObject(CreateObject("QuickTime.QuickTime.1"))\n');
			write('\tIf QuickTime4Obj Or QuickTime5Obj Then\n');
			write('\t\tQuickTimeObj = true\n');
			write('\tElse\n');
			write('\t\tQuickTimeObj = false\n');
			write('\tEnd If\n');
			write('\tquickTimeActX = QuickTimeObj\n');
			write('End Function\n');
			
			write('Function realActX()\n');
			write('\tOn Error Resume Next\n');
			write('\t\n');
			write('\tDim RealObj, Real4Obj, Real5Obj, RealG2Obj\n');
			write('\tReal4Obj = IsObject(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)"))\n');
			write('\tReal5Obj = IsObject(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)"))\n');
			write('\tRealG2Obj = IsObject(CreateObject("rmocx.RealPlayer G2 Control"))\n');
			write('\tIf Real4Obj Or Real5Obj Or RealG2Obj Then\n');
			write('\t\tRealObj = true\n');
			write('\tElse\n');
			write('\t\tRealObj = false\n');
			write('\tEnd If\n');
			write('\trealActX = RealObj\n');
			write('End Function\n');
			write('\n\n');
			
			write('Function winMediaActX()\n');
			write('\tOn Error Resume Next\n');
			write('\t\n');
			write('\tDim WinMediaObj\n');
			write('\tWinMediaObj = IsObject(CreateObject("MediaPlayer.MediaPlayer.1"))\n');
			write('\twinMediaActX = WinMediaObj\n');
			write('End Function\n');
			
			write('</script>\n');
		}
		
		this.flash4Enabled = (typeof(flashActX(4)) == 'undefined') ? false : flashActX(4);
		this.flash5Enabled = (typeof(flashActX(5)) == 'undefined') ? false : flashActX(5);
		this.quickTimeEnabled = (typeof(quickTimeActX()) == 'undefined') ? false : quickTimeActX();
		this.realEnabled = (typeof(realActX()) == 'undefined') ? false : realActX();
		this.winMediaEnabled = (typeof(winMediaActX()) == 'undefined') ? false : winMediaActX();
	} else {
		if (navigator.plugins && navigator.plugins['Shockwave Flash']) {
			var str = navigator.plugins['Shockwave Flash'].description.split(' ');
			var flashPlugIn = 0;
			for (var i = 0; i < str.length; i++) {
				if (!isNaN(parseInt(str[i]))) {
					flashPlugIn = parseInt(str[i]);
					break;
				}
			}
			this.flash4Enabled = (flashPlugIn >= 4) ? true : false;
			this.flash5Enabled = (flashPlugIn >= 5) ? true : false;
		} else {
			this.flash4Enabled = false;
			this.flash5Enabled = false;
		}
		
		if (navigator.plugins) {
			var quickTimePlugIn = false;
			var realPlugIn = false;
			var winMediaPlugIn = false;
			
			for (var i = 0; i < navigator.plugins.length; i++) {
				if (navigator.plugins[i].name.indexOf('QuickTime') != -1) {
					quickTimePlugIn = true;
				} else if (navigator.plugins[i].name.indexOf('RealPlayer') != -1) {
					realPlugIn = true;
				} else if (navigator.plugins[i].name.indexOf('Windows Media') != -1) {
					winMediaPlugIn = true;
				}
			}
			
			this.quickTimeEnabled = quickTimePlugIn;
			this.realEnabled = realPlugIn;
			this.winMediaEnabled = winMediaPlugIn;
		} else {
			this.quickTimeEnabled = false;
			this.realEnabled = false;
			this.winMediaEnabled = false;
		}
	}
	
	this.javaEnabled = navigator.javaEnabled();
}

var is = new wykryj_przeglondarke();