

if (loop == undefined) var loop = "True";
var showControls = "True";
var showControls2=1;
var autostart2 = 1;
var autostart = "True"; 

var	showStatusBar2 = 1;
var showStatusBar = "True"; 

var host=window.location.hostname;
var params_string='host='+host;

if (typeof(video_id) != "undefined") params_string+= '&video_id='+video_id;
if (typeof(driver_id) != "undefined") params_string+= '&driver_id='+driver_id;
if (typeof(team_id) != "undefined") params_string+= '&team_id='+team_id;
if (typeof(rally) != "undefined") params_string+= '&rally='+rally;

if (ratio==undefined) {
	var ratio=1.3;
	if (width==undefined) var width=352;
} else {
	if (width==undefined) var width=Math.round(264*ratio);
	params_string+= '&nohead=1';
}

var height=Math.round(width/ratio,0)+69;


document.write('<table class=autotv border=0 cellspacing=0 cellpadding=0 style="border: 0px" width='+width+'>');
document.write('<TR><TD>');
document.write('<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject" width="'+width+'" height="'+height+'" standby="Loading Microsoft® Windows® Media Player components..." id="vPlayer">');
document.write('<PARAM NAME="FileName" VALUE="http://www.autotv.lv/rallijs/play.php?'+params_string+'">');
document.write('<PARAM NAME="ShowControls" VALUE="'+showControls+'">');
document.write('<PARAM NAME="ShowStatusBar" VALUE="'+showStatusBar+'">');
document.write('<PARAM NAME="TransparentAtStart" Value="False">');
document.write('<PARAM NAME="ClickToPlay" Value="True">');
document.write('<PARAM NAME="AutoStart" Value="'+autostart+'">');
document.write('<PARAM NAME="AnimationatStart" Value="True">');
document.write('<PARAM NAME="autoSize" Value="true">');
document.write('<PARAM NAME="displaySize" Value="False">');
document.write('<PARAM NAME="loop" Value="'+loop+'">');
document.write('<EMBED type="application/x-mplayer2" pluginspage = "http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" SRC="http://www.autotv.lv/rallijs/play.php?'+params_string+'" Name="vPlayer" Width="'+width+'" height="'+height+'" autoStart="'+autostart2+'" transparentAtStart="0" clickToPlay="1" animationAtStart="1" autoSize="1" ShowStatusBar="'+showStatusBar2+'" ShowControls="'+showControls2+'" displaySize="0" align="center">');
document.write('</EMBED>');
document.write('</object>');
document.write('</TD></TR><TR><TD align=right style="background-image: url(http://www.autotv.lv/images/embed_bottom_line.gif); background-repeat: repeat-x; background-position: top left;padding: 0; margin: 0; border: 0;" valign=top height=12><a href="http://www.autotv.lv/" target="_blank" style="padding: 0; margin: 0; border: 0;background: none;"><img src="http://www.autotv.lv/images/embed_bottom.gif" border=0 height=12 width=79 alt="AUTOTV" style="padding: 0; margin: 0; border: 0;"></a></TD></table>');

var player;
try {
 if(window.ActiveXObject)  {
  player = new ActiveXObject("WMPlayer.OCX.7");
 }else if (window.GeckoActiveXObject)  {
  player = new GeckoActiveXObject("WMPlayer.OCX.7");
 }
}
catch(e){
 document.getElementById('videoStartLink').style.display='none';
}
if(player){
 var versionString = player.versionInfo;
}

function vPlay(){
 document.vPlayer.play();
 document.getElementById('videoStartLink').style.display='none';
}
