function flashDetect(){

	///// Flash 8 detectie.
	var flashversie = -1;

	if(typeof window.ActiveXObject != 'undefined' && navigator.platform.indexOf('Win') != -1){

		try{

			var flash_obj = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.8');
			flashversie = 9;

		} catch (e){

			flashversie = -1;
		}

		flash_obj = null;

	} else if(navigator.plugins){

		var flash_obj = navigator.plugins['Shockwave Flash'];

		if (flash_obj && typeof flash_obj.description == 'string'){

			var versienummer = flash_obj.description.match( /([0-9]+)/ );
			flashversie = versienummer? parseInt(versienummer[0]): flashversie;
		}
	}

	return flashversie;
}

function schrijfObject(movie_name, object_name, flash_width,flash_height, version, flashcontainer, flash_vars){

	if (!(document.getElementById && document.getElementById(flashcontainer)))
		return;

		if(flashDetect() >= version){

			var tussenstring =
			'<obj' + 'ect classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="' + object_name + '" width="' + flash_width + '" height="' + flash_height + '" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">' +
      '<par' + 'am name="quality" value="high" />' +
      '<par' + 'am name="wmode" value="transparent" />' +
      '<par' + 'am name="movie" value="' + movie_name + '" />' +
      '<par' + 'am name="allowScriptAccess" value="always" />' +
	  	'<par' + 'am name="FlashVars" value="' + flash_vars + '" />' +
      '<emb' + 'ed sr' + 'c="' + movie_name + '" quality="high" flashvars="' + flash_vars + '" width="' + flash_width + '" height="' + flash_height + '" name="' + object_name + '" wmode="transparent" align="middle" quality="high" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></emb'+'ed>' +
     	'<\/obj'+'ect>';

     	document.getElementById(flashcontainer).innerHTML = tussenstring;

		} else {

			if(flash_width > 200) {

				document.getElementById(flashcontainer).innerHTML =
					'<div'+' style="background:#333333;border:2px solid #333333;-moz-border-radius: 10px;-webkit-border-radius: 10px;">' +
					'<p'+' style="font-family: Verdana, Arial; font-weight: bold; color: #FFFFFF; margin: 5px;">Wij hebben niet kunnen detecteren of u over de Flash ' + version + ' player beschikt.<\/p>' +
					'<p'+' style="font-family: Verdana, Arial; font-weight: bold; font-size: 11px; color: #FFFFFF; margin: 5px; margin-top: 8px;">' +
					'U kunt de nieuwste Flash player downloaden bij <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" target="_blank" style="color: #FFFFFF; font-weight:bold;text-decoration:underline;">Adobe<\/a>.' +
					'<\/p>' +
					'<\/div>';

			} else {

				document.getElementById(flashcontainer).innerHTML =
					'<div'+' style="background:#333333;border:2px solid #333333;-moz-border-radius: 10px;-webkit-border-radius: 10px;">' +
					'<p'+' style="font-family: Verdana, Arial; font-weight: bold; font-size: 11px; color: #FFFFFF; margin: 5px; margin-top: 8px;">' +
					'Geen Flash-plugin gevonden' +
					'<\/p>' +
					'<\/div>';
				}
		}
}

