// Len 17/12/2009 - minor rewrite & simplification to go with new homepage design (with no narrow view support)
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin )
{
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i)
    {
		if (isNaN(parseInt(words[i])))
			continue;
		var MM_PluginVersion = words[i]; 
	}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.appVersion.indexOf("Win") != -1))
{
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}
    // This SWF file needs to be in something like /images/1/flash (KW 20070103)
// MM_FlashCanPlay = true; // This line enables flash
// MM_FlashCanPlay = false; // This line disables flash


function homepageflash(flashfile, alt_image, click_url)
{
    SiteProtocol = parent.location.protocol +'//' ;
    SiteURL = parent.document.domain ;
    if (click_url.substring(0,7) != "http://")
    	click_url = "http://" + SiteURL + click_url ;

	if (arguments.length>3)
		hasbg=true ; // extra argument to not override background color parameters as they are already in the flash file.
	else
		hasbg=false ;
    	
	if ( MM_FlashCanPlay )
	{
		document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
		document.write('  codebase="'+SiteProtocol+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" ');
		document.write(' ID="script" WIDTH="254" HEIGHT="89" ALIGN="">');
		document.write(' <PARAM NAME=movie VALUE="'+SiteProtocol+SiteURL+flashfile+'"> <PARAM NAME=quality VALUE=high> ')
		
		if (hasbg == false)
			document.write(' <PARAM NAME=bgcolor VALUE=#ffffff>  <param name="wmode" value="opaque" /> ') ;
		else // Len 15/06/2011 - so flash won't show through quote tool in Safari 
			document.write(' <param name="wmode" value="transparent" /> ') ;
		document.write(' <param name="FlashVars" value="clickTag=' + click_url + '" />') ;

		document.write(' <EMBED src="'+SiteProtocol+SiteURL+flashfile+'" quality=high ') ;
		if (hasbg == false)
				document.write(' bgcolor=#ffffff wmode=opaque  ');
		else // Len 15/06/2011 - so flash won't show through quote tool in Safari 
				document.write(' wmode=transparent  ');
		document.write(' flashvars="clickTag=' + click_url + '" ')
		document.write(' swLiveConnect=FALSE WIDTH="254" HEIGHT="89" NAME="script" ALIGN=""');
		document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="'+SiteProtocol+'www.macromedia.com/go/getflashplayer">');
		document.write(' </EMBED>');
		document.write(' </OBJECT>');
	
	}
	else
	{
		document.write('<IMG onMouseOver="this.style.cursor=\'pointer\'" onMouseOut="this.style.cursor=\'default\'" onClick="javascript:window.location=\''+click_url+'\';" SRC="'+SiteProtocol+SiteURL+alt_image+'" WIDTH="254" HEIGHT="89" usemap="#script" BORDER=0>');
	}
}


