var flashinstalled = 0;
var flashversion = 0;
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 
{
	
	document.write('<SC'+'RIPT LANGUAGE="VBScript">\n');
	document.write('on error resume next\n');
	document.write('For i = 2 to 7 \n');
	document.write('If Not(IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & i))) Then \n');
	document.write('Else \n');
	document.write('flashinstalled = 2 \n');
	document.write('flashversion = i \n');
	document.write('End If \n');
	document.write('Next \n');
	document.write('If flashinstalled = 0 Then \n');
	document.write('flashinstalled = 1 \n');
	document.write('End If \n');
	document.write('</SCRIPT> \n');
}

	
function imageToFlashReplacement()
{
	replaceTheImages(document.getElementsByTagName('img'));
}
function replaceTheImages(x)
{
	var replace = document.createElement('span');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].getAttribute && x[i].getAttribute('flash') && x[i].parentNode)
		{
			var y = replace.cloneNode(true);
			var p = x[i].parentNode;
			var src = x[i].src;
			var strW = x[i].getAttribute('flashwidth') ? ' width="'+x[i].getAttribute('flashwidth')+'" ' : '';
			var strH = x[i].getAttribute('flashheight') ? ' height="'+x[i].getAttribute('flashheight')+'" ' : '';
			var strWM = x[i].getAttribute('flashwmode') ? ' wmode="'+x[i].getAttribute('flashwmode')+'" ' : '';
			strFlash = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" '+strW + strH+' >';
			strFlash += '<param name="movie" value="flash/'+ x[i].getAttribute('flash') +'.swf">';
			strFlash += '<param name="quality" value="high"><param name="menu" value="false">';
			if (strWM != ''){strFlash += '<param name="wmode" value="' + x[i].getAttribute('flashwmode') + '">';}
			strFlash += '<embed src="flash/' + x[i].getAttribute('flash') + '.swf" menu="false" ' +strWM + ' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" '+strW + strH+' >';
			strFlash += '</embed>';
			strFlash += '</object>';
			y.innerHTML = strFlash;
			x[i].parentNode.replaceChild(y,x[i]);
			setTimeout('imageToFlashReplacement()',200)
		}
	}
}

function itfr()
{
	var W3CDOMAndFlash 	= (document.createElement && document.getElementsByTagName && (flashinstalled == 2) && (flashversion >= 6));
	if (!W3CDOMAndFlash) return;
	imageToFlashReplacement();
}
addOnLoad('itfr')