function RTLSystemCheck(container_id){
	
	this.container = document.getElementById(container_id);
	
	this.doTween = true;
	this.tween = null;
	
	/////
	 
	this.WIN = (typeof navigator.platform == 'string' && navigator.platform.toLowerCase().indexOf('win') != -1);
	this.MAC = (typeof navigator.platform == 'string' && navigator.platform.toLowerCase().indexOf('mac') != -1);
			
	this.IEWIN = (typeof ActiveXObject != 'undefined' && this.WIN);
	this.Chrome = (navigator.userAgent.indexOf('Chrome') > -1);
	this.Opera = (typeof opera != 'undefined');
	this.Gecko = (typeof document.addBinding == 'function');
	this.Konqueror = (navigator.userAgent.indexOf('Konqueror') != -1);
	
	this.requiredFlashVersion = 9;
	
	this.requiredSilverlightVersion = '3.0'; // Ten behoeve van rendering in UI.
	this.requiredSilverlightDetectVersion = '3.0.40624.0'; // Feitelijke versie-detectie.
	
	this.SilverlightDownloadURL = 'http://www.microsoft.com/silverlight/install.aspx';	
	this.FlashDownloadURL = 'http://www.adobe.com/products/flashplayer/';
	this.WMPDownloadURL = 'http://www.microsoft.com/windows/windowsmedia/default.mspx';
	this.Flip4MacDownloadURL = 'http://www.flip4mac.com/wmv_download.htm';
		
	///// result: -1: niet dectecteerbaar, 0: negatief, 1: positief 
	
	this.checks = {

		Browser: {
			title: 'Geschikte webbrowser',
			result: null, 
			commentString: '',
			container: null
		},
		
		AXScripting: {
			title: 'Algemene beveiliging',
			result: null, 
			commentString: '',
			container: null
		},
				
		Flash: {
			title: 'Flash', 
			result: null, 
			commentString: '',
			container: null
		},
				
		Silverlight: {
			title: 'Silverlight', 
			result: null, 
			commentString: '',
			container: null
		},

		WMVPlugin: {
			title: 'Geschikte video plugin', 
			result: null, 
			commentString: '',
			container: null
		},

		DRM: {
			title: 'Bekijken van betaalde video\'s',
			result: null, 
			commentString: '',
			container: null
		}
	},
	
	this.checksOrder = (this.IEWIN? ['Browser', 'AXScripting', 'Flash', 'Silverlight', 'WMVPlugin', 'DRM']: ['Browser', 'Flash', 'Silverlight', 'WMVPlugin', 'DRM']); 
	this.currentCheck = -1;
}

RTLSystemCheck.prototype = {
	
	nextDetect: function(){
		
		this.currentCheck++;
		
		if(this.currentCheck == this.checksOrder.length) return;
		
		/////
		
		var current_check_string = this.checksOrder[this.currentCheck];
		var current_check_obj = this.checks[current_check_string];
		
		this['detect' + current_check_string](current_check_obj);
		
		this.createResultHTML(current_check_obj);
	},
	
	createResultHTML: function(check_obj){
	
		if(check_obj.result == 1){
			
			var container = document.createElement('div');
			container.className = 'systemcheck_positive_result';
			
			var title = document.createElement('h3');
			title.className = 'systemcheck_positive_result_title';
			title.appendChild(document.createTextNode(check_obj.title));
			
			var mark = document.createElement('img');
			mark.className = 'systemcheck_positive_result_mark';
			mark.setAttribute('src', '/system/systemcheck/images/positive_result_mark.jpg');
			mark.setAttribute('width', '14');
			mark.setAttribute('height', '15');
			
			container.appendChild(title);
			container.appendChild(mark);
			
			if(this.currentCheck > 0 && this.checks[ this.checksOrder[this.currentCheck - 1] ].result < 1){
				container.style.marginTop = '5px';	
			}
					
		} else {
			
			var container = document.createElement('div');
			container.className = 'systemcheck_negative_result';
			
			/////
			
			var top = document.createElement('img');
			top.setAttribute('src', '/system/systemcheck/images/negative_result_top.gif');
			top.setAttribute('width', '835');
			top.setAttribute('height', '12');
			top.style.position = 'absolute';
			top.style.left = '-1px';
			top.style.top = '-1px';
			
			var bottom = document.createElement('img');
			bottom.setAttribute('src', '/system/systemcheck/images/negative_result_bottom.gif');
			bottom.setAttribute('width', '835');
			bottom.setAttribute('height', '12');
			bottom.style.position = 'absolute';
			bottom.style.left = '-1px';
			bottom.style.bottom = '-1px';
			
			container.appendChild(top);
			container.appendChild(bottom);
		
			/////
			
			var title_container = document.createElement('div');
			title_container.className = 'systemcheck_negative_result_title_container';
			
			var title = document.createElement('h3');
			title.className = 'systemcheck_negative_result_title';
			title.appendChild(document.createTextNode(check_obj.title));
			
			var mark = document.createElement('img');
			mark.className = 'systemcheck_negative_result_mark';
			mark.setAttribute('src', '/system/systemcheck/images/negative_result_mark.jpg');
			mark.setAttribute('width', '16');
			mark.setAttribute('height', '17');
			
			title_container.appendChild(title);
			title_container.appendChild(mark);
			
			container.appendChild(title_container);
			
			/////
						
			var comment = document.createElement('p');
			comment.className = 'systemcheck_negative_result_text';
			comment.innerHTML = check_obj.commentString;
			
			container.appendChild(comment);
		}
				
		/////
		
		check_obj.container = container;
		
		if(this.doTween){
			
			container.style.left = '-1000px';
			this.container.appendChild(container);
		
			this.startTween(check_obj);
			
		} else {
			
			this.container.appendChild(container);
			
			var self = this;
			
			setTimeout(function(){ self.nextDetect();}, 1250);
		}
	},
	
	startTween: function(check_obj){
		
		var self = this;
		
		this.tween = new Tween(check_obj.container.style, 'left', Tween.backEaseOut, -1000, 0, 1, 'px');
		this.tween.onMotionFinished = function(){ self.nextDetect();};
		this.tween.start();
	},	

	/////	
		
	detectBrowser: function(check_obj){
		
		if(this.IEWIN){

			///// Bij IEWIN controle op IE6 of hoger.
	
			check_obj.result = (typeof this.container.ownerDocument == 'object')? 1: 0;
			
			if(check_obj.result == 0){			
				check_obj.commentString = 'Je gebruikt een verouderde internetbrowser die onze site mogelijk niet goed weergeeft. Wij adviseren een update naar de meest recente versie van Internet Explorer of Mozilla Firefox.'; 
			}
	
		} else if(this.Opera) {
	
			check_obj.result = 0;
			check_obj.commentString = 'Je gebruikt de Opera webbrowser. Het is mogelijk dat niet alle onderdelen van onze site goed worden weergegeven. Wij adviseren daarom de laatste versie van Mozilla Firefox te installeren.';
		
		} else if(this.Konqueror){

			check_obj.result = 0;
			check_obj.commentString = 'Je gebruikt waarschijnlijk Konqueror. Het is mogelijk dat niet alle onderdelen van onze site goed worden weergegeven. Wij adviseren daarom de laatste versie van Mozilla Firefox te installeren.';

		} else {
			
			check_obj.result = 1;
		}
	},
	
	detectAXScripting: function(check_obj){

		///// Er wordt uitgegaan van het axioma dat minimaal één van de componenten in de progids array geïnstalleerd is.
				
		var progids = ['Microsoft.XMLDOM', 'Microsoft.XMLHTTP'];
		var ax_scripting, ax_obj;
	
		for(var i = 0; i < progids.length; i++){
			
			ax_scripting = false;			
	
			try {
				
				ax_obj = new ActiveXObject(progids[i]);
				ax_scripting = true;
				
			} catch(e){
				
				ax_scripting = false;
			}
			
			ax_obj = null;
			
			/////
			
			if(ax_scripting){
				break;
			}
		}	
			
	
		xmlhttp = null;
	
		/////
		
		check_obj.result = (ax_scripting? 1: 0);
		
		if(check_obj.result == 0){
			check_obj.commentString = 'De beveiling van je internetbrowser staat verkeerd ingesteld, waardoor sommige onderdelen op onze site niet goed werken. ';
			check_obj.commentString += 'Zet het beveiligingsniveau van je internetbrowser op gemiddeld (hoog).';
		}
	},
	
	detectFlash: function(check_obj){

		if(this.IEWIN && this.checks.AXScripting.result == 0){

			check_obj.result = -1;
			check_obj.commentString = 'Niet detecteerbaar (zie Algemene beveiliging).';
			
			return;
		}
		
		/////

		var flash_version = -1;
	
		if(this.IEWIN){
	
			try{
	
				var flash_obj = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + this.requiredFlashVersion);
				flash_version = this.requiredFlashVersion;
	
			} catch (e){
	
				flash_version = -1;
			}
	
			flash_obj = null;
	
		} else if(navigator.plugins){
	
			var flash_obj = navigator.plugins['Shockwave Flash'];
	
			if (flash_obj && typeof flash_obj.description == 'string'){
	
				var version_nr = flash_obj.description.match(/\d+\.\d/);
				flash_version = version_nr? parseInt(version_nr[0]): flash_version;
			}
		}
	
		/////

		check_obj.result = (flash_version >= this.requiredFlashVersion? 1: 0);
		
		if(check_obj.result == 0){
			check_obj.commentString = 'Op onze website wordt veel gebruik gemaakt van Flash ' + this.requiredFlashVersion + '. ';
			check_obj.commentString += 'Hiervoor is de Flash ' + this.requiredFlashVersion + ' player benodigd. ';
			check_obj.commentString += 'Wij hebben de Flash player helaas niet aangetroffen. ';
			check_obj.commentString += '<a href="' + this.FlashDownloadURL + '" target="_blank" >Download</a> de nieuwste Flash player.'; 
		}
	},
	
	detectSilverlight: function(check_obj){
		
		if(this.IEWIN && this.checks.AXScripting.result == 0){

			check_obj.result = -1;
			check_obj.commentString = 'Niet detecteerbaar (zie Algemene beveiliging).';
			
			return;
		}
		
		/*
		
		Er wordt momenteel nog niet gedetecteerd of de gebruiker een Silverlight compatible OS gebruikt.
		
		*/
		
		check_obj.result = (Silverlight.isInstalled(this.requiredSilverlightDetectVersion)? 1: 0);
						
		if(check_obj.result == 0){
			check_obj.commentString = 'Op onze website wordt gebruik gemaakt van Silverlight ' + this.requiredSilverlightVersion + '. ';
			check_obj.commentString += 'Hiervoor is de Silverlight ' + this.requiredSilverlightVersion + ' player benodigd. ';
			check_obj.commentString += 'Wij hebben de Silverlight player helaas niet aangetroffen. ';
			check_obj.commentString += '<a href="' + this.SilverlightDownloadURL + '" target="_blank">Download</a> de nieuwste Silverlight player.'; 
		}
	},
		
	detectWMVPlugin: function(check_obj){
		
		if(this.IEWIN && this.checks.AXScripting.result == 0){

			check_obj.result = -1;
			check_obj.commentString = 'Niet detecteerbaar (zie Algemene beveiliging).';
			
			return;
		}
		
		/////
		
		var is_installed;
		
		if(this.IEWIN){
	 
			var wmp = null;
				
			try {
	
				wmp = new ActiveXObject('WMPlayer.OCX.7');
				is_installed = true;
				
			} catch (e){
	
				is_installed = false;
			}
	
			wmp = null;
				
		} else {
	
			///// Helaas bevatten description en name property van plugin object Windows Media Player geen versie info. Er wordt vooralsnog uitgegaan van WM9 compatibility bij het vinden van een plugin.
	
			var plugin_name = (typeof navigator.mimeTypes == 'object' && typeof navigator.mimeTypes['video/x-ms-wvx'] == 'object' && typeof navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin == 'object' && navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin != null && typeof navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin.name == 'string')? navigator.mimeTypes['video/x-ms-wvx'].enabledPlugin.name.toLowerCase(): '';
			is_installed = (plugin_name != '');
		}
		
		/////
		
		check_obj.result = (is_installed? 1: 0);
					
		if(check_obj.result == 0){
			
			if(this.WIN){
				check_obj.commentString = 'Je beschikt niet over de nieuwste versie van Windows Media Player.  <a href="' + this.WMPDownloadURL + '" target="_blank">Download</a> de nieuwste versie.'; 
			} else if(this.MAC){
				check_obj.commentString = 'Je beschikt niet over de nieuwste versie van de Flip4Mac plugin. <a href="' + this.Flip4MacDownloadURL + '" target="_blank">Download</a> de nieuwste versie van de Flip4Mac plugin.'; 
			} else {
				check_obj.commentString = 'Je beschikt niet over een video plugin.';
			}
		}
	},
	
	detectDRM: function(check_obj){
		
		if(this.IEWIN && this.checks.AXScripting.result == 0){

			check_obj.result = -1;
			check_obj.commentString = 'Niet detecteerbaar (zie Algemene beveiliging).';
			
			return;
		}
		
		if(!this.WIN){
		
			check_obj.result = 0;
			check_obj.commentString = 'Voor het kijken naar onze betaalde video\'s is de meeste recente versie van Windows Mediaplayer nodig. Dit is alleen beschikbaar voor Windows. Omdat je geen gebruik maakt van Windows kun je geen betaalde video\'s bekijken.';
			
			return;	
		}
				
		/////
		
		var drm_obj = null;
		var drm_version = -1;
		
		if(this.IEWIN){
		
			try {
		
				drm_obj = new ActiveXObject('DRM.GetLicense'); 
				drm_version = parseInt(drm_obj.GetDRMVersion());
				
				drm_obj = null;
				
				if(isNaN(drm_version)) throw {};
				
			} catch(e){
				
				drm_version = -1;
			}
		}	
		
		/////
		
		check_obj.result = (drm_version >= 9? 1: 0);
				
		if(check_obj.result == 0){
		
			if(drm_version > -1){
				check_obj.commentString = 'Je beschikt helaas niet over de meest recente versie van Windows Media Player. Wij adviseren je daarom de nieuwste versie van Windows Media Player te <a href="' + this.WMPDownloadURL + '" target="_blank" >downloaden</a>.'; 
			} else {	
				check_obj.commentString = 'Wij hebben helaas niet met zekerheid kunnen vaststellen of je beschikt over de meest recente versie van Windows Mediaplayer.';
			}		
		}
	}	
};

///// Variabelen ten behoeve van navigatiebalk.	

var herechannel = 'service';
var hereprogid = 'systemcheck';
var hereloc = location.href;
var nodart = 1;

///// Schrijven achtergrond CSS.

document.write('<style type="text/css" >');
document.write('body { background-color: #E3E6E7; background-image: url(/system/systemcheck/images/body_bg.gif); background-repeat: repeat-x;}');
document.write('</style>');