// real player detection ------------------------------------------------------

var HasRealPlayer=false;

var RealPlayerPlugin=0;
var RealPlayer5=0;
var RealPlayer4=0;
var RealPlayerG2=0;

if ( navigator.plugins )
{
	for (i = 0; i < navigator.plugins.length; i++)
	{
		plugin = navigator.plugins[i];
		if (plugin.name.indexOf("RealPlayer",0)!=-1) RealPlayerPlugin=1;
	}
}

if ( !RealPlayerPlugin || is_ie )
{
	document.write('<SCRIPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('RealPlayerG2 = (NOT IsNull(CreateObject("rmocx.RealPlayer G2 Control")))\n');
	document.write('RealPlayer5 = (NOT IsNull(CreateObject("RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)")))\n');
	document.write('RealPlayer4 = (NOT IsNull(CreateObject("RealVideo.RealVideo(tm) ActiveX Control (32-bit)")))\n');
	document.write('</SCRIPT\> \n');
}

if ( RealPlayerPlugin || RealPlayerG2 || RealPlayer5 || RealPlayer4 ) HasRealPlayer = true;

// real player detection ------------------------------------------------------

function drawVideo(src, objname, width, height)
{
	if ( HasRealPlayer )
	{
		document.write("<embed src='" + src + "'");          
		document.write(" type='audio/x-pn-realaudio-plugin'");
		document.write(" name='" + objname + "'");
		document.write(" width=" + width );
		document.write(" height=" + height);
		document.write(" controls=ImageWindow");
		document.write(" nologo=true");
		document.write(" autostart=true");
		document.write(" console=video1>");
		document.write("</embed>");
	}
	else
	{
		drawRealPlayerDownload();
	}
}

function drawVideoController( objname, width, height)
{
	if (HasRealPlayer && !is_mac)
	{
		document.write("<embed ");
		document.write(" type='audio/x-pn-realaudio-plugin'");
		document.write(" name='" + objname + "'");
		document.write(" width=" + width );
		document.write(" height=" + height );
		document.write(" controls=PositionSlider");
		document.write(" nologo=true");
		document.write(" autostart=true");
		document.write(" console=video1>");
		document.write(" </embed>");
	}
	else
	{
		document.write("&nbsp;");
	}
}

function drawRealPlayerDownload()
{
	document.write("<span class='masmalllightbold'>Attenzione:<BR>RealPlayer<br>non è installato.<br>")
	document.write("<a href='http://www.real.com' target='_new'><font color=yellow size=2>Scarica gratis<br>RealPlayer</font></a></span>");
}
