//<script>
var flashinstalled = 0;
var flashversion = 0;
var MSDetect = "false";

function detectFlash(){

	if (navigator.plugins && navigator.plugins.length)
	{
		x = navigator.plugins["Shockwave Flash"];
		if (x)
		{
			flashinstalled = 2;
			if (x.description)
			{
				y = x.description;
				flashversion = y.charAt(y.indexOf('.')-1);
			}
		}
		else
			flashinstalled = 1;
		if (navigator.plugins["Shockwave Flash 2.0"])
		{
			flashinstalled = 2;
			flashversion = 2;
		}
	}
	else if (navigator.mimeTypes && navigator.mimeTypes.length)
	{
		x = navigator.mimeTypes['application/x-shockwave-flash'];
		if (x && x.enabledPlugin)
			flashinstalled = 2;
		else
			flashinstalled = 1;
	}
	else{
		MSDetect = "true";
	}
	
	if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('Opera') == -1)){
		document.writeln(' <script language="VBScript"> ');
		document.writeln(' on error resume next ');
		document.writeln(' If MSDetect = "true" Then ');
		document.writeln(' For i = 2 to 6 ');
		document.writeln(' If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then ');
		document.writeln(' Else ');
		document.writeln(' flashinstalled = 2 ');
		document.writeln(' flashversion = i ');
		document.writeln(' End If ');
		document.writeln(' Next ');
		document.writeln(' End If ');
		document.writeln(' If flashinstalled = 0 Then ');
		document.writeln(' flashinstalled = 1 ');
		document.writeln(' End If ');
		document.writeln(' <\/script> ');
	}

}




function openFlash(movieURL, whichVersion, intHeight, intWidth){

	detectFlash();
	
	if ((flashinstalled == 2) && (flashversion >= whichVersion)) {
		document.write ('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + whichVersion + ',0,0,0"' +
		' width="' + intWidth + '" height="' + intHeight + '"><param name="movie" value="' + movieURL + '">' +
		' <param name=quality value=high>'   +
		' <embed src="' + movieURL + '" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"' +
		' width="' + intWidth + '" height="' + intHeight + '">   </embed> </object>'); 
	}
	else {
		document.write('<center>You need an up to date flash player.<br/> Click <a href="http://www.bbc.co.uk/webwise/glossary/f.shtml?file=flash" target="_blank">here</a> to find out more about the flash plugin.</center>');
	}
}

//</script>
