function activeXComp()
{
	if(navigator.userAgent.indexOf('Linux') != -1) { var OpSys = "Linux"; }
	else
	{
		if((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('95') != -1)) { var OpSys = "Win"; }
		else
		{
			if((navigator.userAgent.indexOf('Win') != -1) && (navigator.userAgent.indexOf('98') != -1)) { var OpSys = "Win"; }
			else
			{
				if(navigator.userAgent.indexOf('Win') != -1) { var OpSys = "Win"; }
				else
				{
					if(navigator.userAgent.indexOf('Mac') != -1) { var OpSys = "Mac"; }
					else { var OpSys = "Other"; }
				}
			}
		}
	}
	
	for (i=1; i<arguments.length; i=i+2)
	{
		if (arguments[i] == "version")  actVersion = parseInt(arguments[i+1]); // flash, WM
		if (arguments[i] == "width") // all
		{
			if (arguments[i+1] != "") actWidth = arguments[i+1];
			else actWidth = 320;
		}
		if (arguments[i] == "height") // all
		{
			if (arguments[i+1] != "") actHeight = arguments[i+1];
			else actHeight = 240;			
		}
		if (arguments[i] == "source") actSource = arguments[i+1]; // (WM - filename, src), (QT - src), (flash - movie, src)
		if (arguments[i] == "loop") actLoop = arguments[i+1]; // QT, WM, Flash (Firefox - PlayCount="999" if loop is true)
		if (arguments[i] == "controls") actControls = arguments[i+1]; // QT, WM (WM - showcontrols), (Firefox WM - ShowDisplay and ShowStatusBar)
		if (arguments[i] == "bgcolor") actBgcolor = arguments[i+1]; // flash, WM
		if (arguments[i] == "autoplay") actAutoplay = arguments[i+1]; // (QT autoplay), (WM autostart)
		if (arguments[i] == "quality") actQuality = arguments[i+1]; // flash
	}

	if (arguments[0] == "QT")
	{
		actHeight = parseInt(actHeight) + 16;
		actClassid = "clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B";
		actCodebase = "http://www.apple.com/qtactivex/qtplugin.cab";
		actPluginspage = "http://www.apple.com/quicktime/download/";
		document.write('<object classid="'+actClassid+'" width="'+actWidth+'" height="'+actHeight+'" codebase="'+actCodebase+'">');
		document.write('<param name ="src" value="'+actSource+'" />');
		document.write('<param name="autoplay" value="'+actAutoplay+'" />');
		document.write('<param name="controller" value="'+actControls+'" />');
		document.write('<param name="loop" value="'+actLoop+'" />');
		document.write('<embed src="'+actSource+'" width="'+actWidth+'" height="'+actHeight+'" autoplay="'+actAutoplay+'" controller="'+actControls+'" loop="'+actLoop+'" pluginspage="'+actPluginspage+'"></embed></object>');
	}
	
	if (arguments[0] == "Flash")
	{
		actClassid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";
		if (actVersion == 4) actCodebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0";
		if (actVersion == 5) actCodebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0";
		if (actVersion == 6) actCodebase = "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0";
		actPluginspage = "http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash";
		document.write('<object classid="'+actClassid+'" codebase="'+actCodebase+'" width="'+actWidth+'" height="'+actHeight+'">');
		document.write('<param name="movie" value="'+actSource+'" />');
		document.write('<param name="menu" value="false" />');
		document.write('<param name="allowScriptAccess" value="sameDomain" />');
		document.write('<param name="quality" value="'+actQuality+'" />');
		document.write('<param name="bgcolor" value="'+actBgcolor+'" />');
		document.write('<param name="loop" value="'+actLoop+'" />');
		document.write('<embed src="'+actSource+'" quality="'+actQuality+'" bgcolor="'+actBgcolor+'" width="'+actWidth+'" height="'+actHeight+'" loop="'+actLoop+'" type="application/x-shockwave-flash" pluginspage="'+actPluginspage+'"></embed></object>');
	}

	if (arguments[0] == "WM")
	{
		if (actVersion == 6)
		{
			actClassid = "clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95";
			actHeight = parseInt(actHeight) + 40;
		}
		
		if (actVersion >= 7)
		{
			actClassid = "clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6";
			actHeight = parseInt(actHeight) + 44;
		}
		if (OpSys == "Win") actPluginspage = "http://microsoft.com/windows/mediaplayer/en/download/";
		if (OpSys == "Mac") actPluginspage = "http://www.microsoft.com/mac/otherproducts/otherproducts.aspx?pid=windowsmedia";
		actCodebase = "http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715";
		document.write('<object id="mediaPlayer" width="'+actWidth+'" height="'+actHeight+'" classid="'+actClassid+'" codebase="'+actCodebase+'" standby="Loading Microsoft Windows Media Player components..." type="application/x-oleobject">');
		document.write('<param name="filename" value="'+actSource+'" />');
		document.write('<param name="showcontrols" value="'+actControls+'" />');
		document.write('<param name="autostart" value="'+actAutoplay+'" />');
		document.write('<param name="loop" value="'+actLoop+'" />');
		document.write('<embed type="application/x-mplayer2" pluginspage="'+actPluginspage+'" id="mediaPlayer" name="mediaPlayer" bgcolor="'+actBgcolor+'" shwcontrols="'+actControls+'" showdisplay="'+actControls+'" showstatusbar="'+actControls+'" width="'+actWidth+'" height="'+actHeight+'" src="'+actSource+'" autostart="'+actAutoplay+'" loop="'+actLoop+'"></embed></object>');
	}

	if (arguments[0] == "RM")
	{
		actClassid = "clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA";
		actPluginspage = "http://www.real.com";
		document.write('<object classid="'+actClassid+'" width="'+actWidth+'" height="'+actHeight+'">');
		document.write('<param name ="src" value="'+actSource+'" />');
		document.write('<param name="controls" value="imagewindow" />'); //value = "imagewindow" or "all" or "controlpanel"
		document.write('<param name="console" value="video" />'); //value =  "_master" (for multiple controls with one video) or any name for one clip.
		document.write('<param name="loop" value="'+actLoop+'" />');
		document.write('<embed src="'+actSource+'" width="'+actWidth+'" height="'+actHeight+'" loop="'+actLoop+'" type="audio/x-pn-realaudio-plugin" controls="imagewindow" console="video" autostart="'+actAutoplay+'" pluginspage="'+actPluginspage+'"></embed></object>');
		if (actControls == "true" || actControls == "yes" || actControls == "1")
		{
		document.write('<object classid="'+actClassid+'" width="'+actWidth+'" height="70">');
		document.write('<param name ="src" value="'+actSource+'" />');
		document.write('<param name="autostart" value="'+actAutoplay+'" />');
		document.write('<param name="controls" value="controlpanel" />');
		document.write('<param name="console" value="video" />');
		document.write('<param name="loop" value="'+actLoop+'" />');
		document.write('<embed src="'+actSource+'" width="'+actWidth+'" height="70" loop="'+actLoop+'" type="audio/x-pn-realaudio-plugin" controls="controlpanel" console="video" autostart="'+actAutoplay+'" pluginspage="'+actPluginspage+'"></embed></object>');
		}
	}
}