/* =============================================================================
$Id: comon.js,v 1.10 2006/01/13 09:16:51 rupert Exp $
$Date: 2006/01/13 09:16:51 $
$Revision: 1.10 $
$Author: rupert $
Copyright (c) 2005 Conchango Ltd. All rights reserved.
Web Application Version: [BUILD_16.07.32_2_071011]
Release Date: [12-October-2007]
============================================================================= */

var flash =
{
	_MM_contentVersion: 5,
	_MM_FlashCanPlay: false,
	_plugin: ((navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0),

	setup: function()
	{
		if ( this._plugin ) 
		{
			var words = navigator.plugins["Shockwave Flash"].description.split(" ");
			for (var i = 0; i < words.length; ++i)
			{
				if (isNaN(parseInt(words[i])))
					continue;
				MM_PluginVersion = words[i]; 
			}
			this._MM_FlashCanPlay = MM_PluginVersion >= this._MM_contentVersion;
		}
		else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) 
		{
			flash._MM_FlashCanPlay=true;
			//document.write('<scr' + 'ipt langauge="VBScript"\> \n'); //FS hide this from IE4.5 Mac by splitting the tag
			//document.write('on error resume next \n');
			//document.write('flash._MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
			//document.write('</scr' + 'ipt\> \n');
		}
	},

	play: function(id,swf,img,w,h)
	{
		if ( this._MM_FlashCanPlay ) 
		{
			document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
			document.write('  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" ');
			document.write(' id="'+id+'" width="'+w+'" height="'+h+'" align="">');
			document.write(' <param name="movie" value="'+swf+'" /> <param name="menu" value="false" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" />  '); 
			document.write(' <embed src="'+swf+'" menu="false" quality="high" bgcolor="#FFFFFF"  ');
			document.write(' swLiveConnect="FALSE" width="'+w+'" height="'+h+'" name="'+id+'" align=""');
			document.write(' type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">');
			document.write(' </embed>');
			document.write('</object>');
		}
		else
		{
			document.write('<img src="'+img+'" width="'+w+'" height="'+h+'" />');
		}
	}
}

flash.setup();
