var urf = "";
function videoex(urf,la,al){

	function getWmpInfo()
	{
		var wi = new Object();
		wi.installed = false;
		wi.version = 0;
		wi.platform = "";

		// set platform ( win or linux )
		var agt=navigator.userAgent.toLowerCase();
		if ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) ) wi.platform = "win";
		if (agt.indexOf("mac")!=-1) wi.platform = "mac";
		if (agt.indexOf("linux")!=-1) wi.platform = "linux";

		// try activexobject 7.1
		var axobj = null;
		axobj = getActiveXObject("WMPlayer.OCX.7");
		if ( axobj==null )
		{
			// try activexobject 6.4
			axobj = getActiveXObject("MediaPlayer.MediaPlayer.1")
		}

		if ( axobj!=null )
		{
			wi.installed = true;
			parseFloat(axobj.versionInfo);
			wi.version=parseFloat(axobj.versionInfo);
		}
		else if (navigator.plugins && navigator.plugins.length)
		{
			for (var i=0; i<navigator.plugins.length; i++)
			{
				if (navigator.plugins[i].name.toLowerCase().indexOf('windows media') != -1)
				{
					wi.installed=true;
					break;
				}
			}
		}
		else if (navigator.mimeTypes)
		{
	      	wi.installed = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin;
		}

		return wi;
	}

	function getActiveXObject(id)
	{
		// "try" is reserved word in NS4, use eval to hide
		var obj = null;
		if (window.ActiveXObject)
			eval ( "try { obj = new ActiveXObject(id); } catch ( e ) {}" );
		else if (window.GeckoActiveXObject)
			eval ( "try { obj = new GeckoActiveXObject(id); } catch ( e ) {}" );
		return obj;
	}

	function checkWmp()
	{
		return ( getWmpInfo().installed && getWmpInfo().platform!="linux" );
	}

	function checkVersionWmp()
	{
		return getWmpInfo().version;
	}

	function drawDownload(){
		document.write("<b>Attenzione</b>.<br>You need Windows Media Player to show Video.<br><br>");
		document.write("<a href='http://www.microsoft.com/windows/windowsmedia/' target='_new'>Download Windows Media Player</a>");
	}

	if ( checkWmp() )
	{
		var h = "";

		if ( getWmpInfo().version>=7 )
		{
			h =
			'<object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" ' +
			'id="WMP" ' +
			'width="'+la+'" ' +
			'height="'+al+'" disabled> ' +
			'<param name="url" value="'+urf+'"> ' +
			'<param name="AutoStart" VALUE="true"> ' +
			'<param name="stretchToFit" value="True"> ' +
			'<param name="ShowDisplay" value="true"> ' +
			'<param name="EnableContextMenu" value="false"> ' +
			'<param name="ShowStatusBar" value="true"> ' +
			'<param name="uiMode" value="full"> ' + //For Explorer
			'<PARAM name="uiMode" value="none"> '+ //For FireFox
			'<PARAM name="PlayCount" value="9999"> '+

			'</object>';
		}
		else
		{
			h =
			'<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" ' +
			'id="WMP" ' +
			'width="'+la+'" ' +
			'height="'+al+'"> ' +
			'<param name="Filename" value="'+urf+'"> ' +
			'<param name="AutoStart" value="1"> ' +
			'<param name="ShowControls" value="0"> ' +
			'<param name="ShowDisplay" value="0"> ' +
			'<param name="ShowStatusBar" value="0"> ' +
			'<param name="enableContextMenu" value="0"> ' +
			'<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/MediaPlayer/" ' +
			'	name="WMP" ' +
			'	width="'+la+'" ' +
			'	height="'+al+'" ' +
			'	filename="'+urf+'" ' +
			'	autostart="1" ' +
			'	showcontrols="0" ' +
			'	showdisplay="0" ' +
			'	enableContextMenu="0" ' +
			'	showstatusbar="0"></embed> ' +
			'</object>';
		}

		document.write ( h );
	}
	else
	{
		drawDownload();
	}
}
