
// --- FIX PNG FOR IE6 --- //
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])

function fixPNG(myImage) 
{
	if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
	{
	   var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
				  + " style=\"" + "width:" + myImage.width 
				  + "px; height:" + myImage.height 
				  + "px;" + imgStyle + ";"
				  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
				  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"
	   myImage.outerHTML = strNewHTML	  
	}
}

function showUstreamPlayer(video_id)
{
	document.write('<div class="video_player"><embed flashvars="autoplay=false" width="400" height="320" allowfullscreen="true" allowscriptaccess="always" src="http://www.ustream.tv/flash/video/'+ video_id + '" type="application/x-shockwave-flash" /></div>');
}

function showJustinTVplayer(channel,tip_id)
{
	document.write('<object type="application/x-shockwave-flash" height="340" width="400" id="jtv_player_flash" data="http://www.justin.tv/widgets/jtv_tip_embed.swf" bgcolor="#000000">');
	document.write('<param name="movie" value="http://www.justin.tv/widgets/jtv_tip_embed.swf" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="flashvars" value="channel=' + channel+' &tip_id=' + tip_id + '&auto_play=true" />');
	document.write('</object>');
}

function showLivestreamPlayer(channel, source_id)
{
	document.write('<object width="400" height="295" id="lsplayer" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">');
	document.write('<param name="movie" value="http://cdn.livestream.com/grid/LSPlayer.swf?channel=' + channel+'&amp;clip=' + source_id + '&amp;color=0xfcf9fc&amp;autoPlay=false&amp;mute=false"></param>');
	document.write('<param name="allowScriptAccess" value="always"></param>');
	document.write('<param name="allowFullScreen" value="true"></param>');
	document.write('<embed name="lsplayer" src="http://cdn.livestream.com/grid/LSPlayer.swf?channel=' + channel+'&amp;clip=' + source_id + '&amp;color=0xfcf9fc&amp;autoPlay=false&amp;mute=false" width="400" height="295" allowScriptAccess="always" allowFullScreen="true" type="application/x-shockwave-flash"></embed>');
	document.write('</object>');		
}