
	var vidDiv = null;
	
function addElement(oid, source, width, height, autostart, display, mute)
{


if (source == "http://ads.teamtalk.com/RealMedia/ads/adstream_sx.ads/www.teamtalk.com/home/0@x01?www.teamtalk.com/football/tv/playlist.asx") {
	var source = "http://www.teamtalk.com/football/tv/playlist.asx"
}

var vidDiv = document.getElementById('vidDiv');

if(autostart== "Y")
{
var oAutoStart = "True";
var eAutoStart = "1";
}
else
{
var oAutoStart = "False";
var eAutoStart = "0";
}

if(display== "full") {

	var eStatus = "1";
	var oStatus = "true"
	
	var eControls = "1";
	var oControls = "true"
	
	height = eval(height + 70);
	
} else if(display== "mini") {
	var eStatus = "0";
	var oStatus = "false"
	
	var eControls = "1";
	var oControls = "true";
	
	height = eval(height + 46);
	
} else if(display== "none") {

	var eStatus = "0";
	var oStatus = "false"
	
	var eControls = "1";
	var oControls = "true";
}

if(mute == "Y") {
	var oMute = "true";
	var eMute = 1;
	var vol = 0;
} else {
	var oMute = "false";
	var eMute = 0; 
	var vol = 100;
}

var markup = '<OBJECT id="' + oid + '" height="' + height + '" width="' + width + '" name="' + oid + '"'
			+ 'CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"'
			+ 'type="application/x-oleobject">'
			+ '<PARAM NAME="URL" VALUE="' + source + '">'
			+ '<PARAM NAME="ShowControls" VALUE="' + oControls + '">'	
			+ '<PARAM NAME="ShowStatusBar" VALUE="' + oStatus + '">'
			+ '<PARAM NAME="ShowDisplay" VALUE="false">'
			+ '<PARAM NAME="StretchToFit" VALUE="true">'
			+ '<PARAM NAME="AutoSize" VALUE="true">'
			+ '<PARAM NAME="AutoStart" VALUE="' + oAutoStart + '">'
			+ '<PARAM name="PlayCount" value="1">'
			+ '<PARAM name="Mute" value="' + oMute + '">'
			+ '<PARAM name="Volume" value="' + vol + '">'
			+ '<PARAM NAME="SendPlayStateChangeEvents" VALUE="true">'
			+ '<embed type="application/x-mplayer2" src="' + source + '"'
			+ ' id="' + oid + '" name="' + oid + '" showcontrols="' + eControls + '" showstatusbar="' + eStatus + '" '
			+ ' showdisplay="0" stretchtofit="1" autosize="1" autostart="' + eAutoStart + '"  width="' + width + '" height="' + height+ '" volume="' + vol + '" mute="' + eMute + '" showaudiocontrols="1" >'
			+ '</OBJECT>'
			+ '<noembed>This browser appears to be unable to display inline video.</noembed>';
			
	//alert(markup);

	vidDiv.innerHTML = markup;
			
}

 