//if(!autoPlayFlag) withFlashAd = false;//expired 060206
//if(withFocusPics) playList = false;
if(withFrameAd) withFrame = true;
if(vWidth<320) bandSlt = false;

var broadFile =list[0][0];//宽带默认播放文件,如无则设为空'';
var narrowFile =list[0][1];//窄带默认播放文件,如无则设为空'';
var iniPic = list[0][5];//http://image2.sina.com.cn/gm/home/06/gw_s6_mp_10.gif';//播放器初始画面图片，为空即无图片
var iniText = list[0][2];//放器初始画面图片文字链接，为空即无图片文字链接


var ua = navigator.userAgent;
ua = ua.replace(/\s+/g, "-");
ua = ua.replace(/;/g, "_");
var _is_Safari=navigator.userAgent.indexOf("Safari")>=0;

//for Flash focus PicPlayer begin-- modi 060208 -->
function TansCode(sCode){
	var nCode = "";
	for(var i=0;i<sCode.length;i++){
		if(sCode.charCodeAt(i)<48) nCode += escape(sCode.charAt(i));
		else nCode += sCode.charAt(i);
	}
	return nCode;
}

var focus_width = vWidth + 1;
var focus_height = vHeight + 4;
var text_height = 20;
var swf_height = focus_height + text_height;

var pics="";
var links="";
var texts="";
for(var i=0;i<list.length;i++){
	if(i>0){
		pics  += "|";
		links += "|";
		texts += "|";
	}
	pics += list[i][5];
	links += ("javascript:ChgBN('" + list[i][0] + "','" + list[i][1] + "')");
	texts += TansCode(list[i][2]);
}
//<----------//for Flash focus PicPlayer end


//scripted by guowei1 bellow, 2004
/* detect WMP version begin */
function detectWMP()
{
	var wmpInfo = {
		installed: false,
		scriptable: false,
		type: null,
		versionInfo: null
	};
	var wmp64 = "MediaPlayer.MediaPlayer.1";
	var wmp7 = "WMPlayer.OCX.7";
	if((window.ActiveXObject && navigator.userAgent.indexOf('Windows') != -1) || window.GeckoActiveXObject)
	{
		wmpInfo.type = "ActiveX";
		var player = createActiveXObject(wmp7);
		if(player)
		{
			wmpInfo.installed = true;
			wmpInfo.scriptable = true;
			wmpInfo.versionInfo = player.versionInfo;
			return wmpInfo;
		}
		else
		{
			player = createActiveXObject(wmp64);
			if(player)
			{
				wmpInfo.installed = true;
				wmpInfo.scriptable = true;
				wmpInfo.versionInfo = "6.4";
				return wmpInfo;
			}
			else
			{
				wmpInfo.versionInfo = "none";
				return wmpInfo;
			}
		}
	}
	else if(navigator.mimeTypes)
	{
		wmpInfo.type = "NetscapePlugin";
		var player = navigator.mimeTypes['application/x-mplayer2'].enabledPlugin;
		if(player)
		{
			
			wmpInfo.installed = true;
			//wmpInfo.scriptable = false;
			wmpInfo.versionInfo = "PluginVersion";
			return wmpInfo;
		}
		return wmpInfo;
	}
	
	
}
function createActiveXObject(id)
{
  var error;
  var control = null;

  try
  {
    if (window.ActiveXObject)
    {
      control = new ActiveXObject(id);
    }
    else if (window.GeckoActiveXObject)
    {
      control = new GeckoActiveXObject(id);
    }
  }
  catch (error)
  {
    ;
  }
  return control;
}

var detectionResults = detectWMP();
if((!detectionResults.versionInfo) || (!detectionResults.scriptable)) alert("您的浏览器不支持Windows Media Player，有些功能可能无法正常运行！")
/* detect WMP version end */

var isIE = navigator.appVersion.toLowerCase().indexOf("msie") >= 0;

var curBroad = broadFile;
var curNarrow = narrowFile;
var curFile;
vHeight += 24;

CheckBand();

var flag = true;

function OnloadFun(){
	startdrag();
	setInterval("FixPos()",1000);
	if(typeof setTailPosition == 'function') setTailPosition();

	//for flash media ad below
	if(withFlashAd && autoPlayFlag){
		PlayFlashMediaAd();
	}
}

function PlayFlashMediaAd(){
	init_flash_media_ad();
	stream_check_state();
	flash_stream_ad_check();
}
document.body.onload=OnloadFun;

function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else if(document.layers){
		return eval("document.layers['" + objName +"']");
	}else{
		return eval('document.all.' + objName);
	}
}


var objHTML1 = ("	<OBJECT ID='MediaPlayer' width='"+vWidth+"' height='"+vHeight+"' CLASSID='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject' VIEWASTEXT style='width:"+vWidth+"px;height:"+vHeight+"px;overflow:hidden;'>");
objHTML1 += ("	<PARAM NAME='FileName' VALUE='");


var objHTML2 = ("'>");
objHTML2 += ("	<PARAM NAME='AutoStart' VALUE='"+(autoPlayFlag?"True":"False")+"'>");
objHTML2 += ("	<PARAM NAME='ShowStatusBar' VALUE='True'>");
objHTML2 += ("	<PARAM NAME='ShowControls' VALUE='False'>");
objHTML2 += ("	<PARAM NAME='ShowTracker' VALUE='False'>");
objHTML2 += ("	<PARAM NAME='EnableTracker' VALUE='False'>");
objHTML2 += ("	<PARAM NAME='ShowPositionControls' VALUE='False'>");
objHTML2 += ("	<PARAM NAME='EnablePositionControls' VALUE='False'>");
objHTML2 += ("	<param name='enableContextMenu' value='false'>");
objHTML2 += ("	<embed type=application/x-oleobject codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701' width='"+vWidth+"' height='"+vHeight+"'></embed>");
objHTML2 += ("	</OBJECT>");

document.writeln("<style type='text/css'>");
document.writeln(".aWhiteMP A:link,.aWhiteMP A:visited {text-decoration:none;color:#ffffff;}");
document.writeln(".aWhiteMP A:active,.aWhiteMP A:hover {text-decoration:underline;color:#ff0000;}");
document.writeln(".aWhiteMP{color:#ffffff;}");

document.writeln("A.vv01:link,A.vv01:visited {text-decoration:none;color:#fff;}");
document.writeln("A.vv01:active,A.vv01:hover {text-decoration:none;color:#ff0;}");

document.writeln(".mp table,.mp td,.mp img,.mp div,.mp span,.mp form{border: none;margin: 0 0 0 0;padding: 0 0 0 0;}");
document.writeln("A img{border:none;}");
document.writeln("</style>");

if(withFrame){
	document.write("<table border='0' cellpadding='0' cellspacing='0'><tr height='20'><td background='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_03.gif' valign='top'><img src='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_00.gif' width='16' height='20' /></td><td style='background:url(http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_01.gif) top repeat-x;' valign='top'>" + (withFrameAd?"<img src='"+frameAd["top"]+"' />":"") + "</td><td background='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_04.gif' valign='top'><img src='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_02.gif' width='16' height='20' /></td></tr><tr><td background='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_03.gif' valign='bottom'><img src='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_05.gif' width='16' height='56' /></td><td>");
}

document.writeln("<table border=0 cellpadding=0 cellspacing=0 class='mp'>");
document.writeln("<form name='myForm'>");

document.writeln("<tr>");

document.writeln("<td valign=bottom bgcolor=#000000 width="+vWidth+" height="+vHeight+" style='border:1px solid #333;'>");

document.writeln("	<div id='hideScreen' style='position:relative;display:"+((((iniPic==""||iniPic==null) && (!withFocusPics)) || autoPlayFlag)?"none":"block")+";'>");
if(!withFocusPics){
	document.writeln("		<div id='lBlock' title='点击播放该视频' onClick='toPlay()' class=aWhiteMP style='text-align:center;cursor:pointer;background-color:#fff;height:"+vHeight+"px;weight:"+vWidth+"px;overflow:hidden;'><img name='lPic' src='"+list[0][5]+"' width="+vWidth+" height="+vHeight+" border=0 /><div style='padding:0 0 0 10px;margin-top:6px;text-align:left;height:14px;overflow:hidden;display:none;'><img src='http://image2.sina.com.cn/gm/home/06/gw_game_08.gif' width='13' height='13' align='absmiddle' />&nbsp;<span id=lTitle style='font-size:14px;color:#5F5F5F;font-weight:bold;'>"+list[0][2]+"</span></div><div id='lDesc' style='padding:5px 10px 5px 10px;line-height:19px;color:#333;text-align:left;height:96px;overflow:auto;display:none;'>"+list[0][3]+"</div></div>");
}else{
	var focusPic = '';
	focusPic +="		<div class=aWhiteMP style='text-align:center;'>";
	//focusPic += '<div z-index:100>';
	focusPic += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ focus_width +'" height="'+ swf_height +'">';
	focusPic += '<param name="movie" value="http://image2.sina.com.cn/ent/deco/2006/0208/slideshow.swf"><param name="quality" value="high"><param name="bgcolor" value="#ffffff">';
	focusPic += '<param name="menu" value="false"><param name=wmode value="opaque">';
	focusPic += '<param name="FlashVars" value="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'">';
	focusPic += '<embed src="http://image2.sina.com.cn/ent/deco/2006/0208/slideshow.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#ffffff" quality="high" width="'+ focus_width +'" height="'+ swf_height +'"  type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	focusPic += '</object>';
	focusPic += '</div>';
	document.writeln(focusPic);
	//document.writeln("		</div>");
	
}
document.writeln("		<div id='picMsg' style='color:#fff;background-color:#000;position:absolute;text-align:right;top:"+((iniText=='')?(vHeight-20):(vHeight-20))+"px;left:"+(vWidth-70)+"px;width:70px;height:20px;overflow:hidden;padding:4px 4px 0 0;border-left:1px solid #fff;border-top:1px solid #fff;filter:alpha(opacity=38)'>初始化</div>");
document.writeln("	</div>");
document.writeln("	<div id='myScreen' style='display:"+((((iniPic==""||iniPic==null) && (!withFocusPics)) || autoPlayFlag)?"block":"none")+";width:"+vWidth+"px;height:"+vHeight+"px;overflow:hidden;'>");
document.writeln(objHTML1 + curFile + objHTML2);
document.writeln("	</div>");

//for LIU Jie begin
document.writeln("	<DIV id='div_begin_flash_ad' style='display:none;'>");
document.writeln("	</DIV>");

document.writeln("	<DIV id='div_half_flash_ad' style='display:none;'>");
document.writeln("	</DIV>");

document.writeln("	<DIV id='div_end_flash_ad' style='display:none;'>");
document.writeln("	</DIV>");
//for LIU Jie end


document.writeln("	<div id='tempDiv' style='display:none;'></div>");
document.writeln("</td>");

document.writeln("</tr>");
document.writeln("<tr>");
document.writeln("<td>");

//document.writeln("			<table width=100% cellspacing=0 border=0 cellpadding=0><tr><td height=7 bgcolor=#777777></td></tr></table>");//临时加入051011

document.writeln("			<table width=100% cellspacing=0 border=0 cellpadding=0>");
document.writeln("			<tr><td width=21><img src=http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_00.gif width=21 height=16></td>");
document.writeln("			<td id='pZone' background=http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_02.gif onmousedown='mouseDown(0)' style='POSITION: relative;left:0;'><div id='pBox' title='移动滑块控制影片进度' style='OVERFLOW: hidden;POSITION: relative;cursor:e-resize;left:-5px;top:3px;width:23px;height:11px;background-image:url(http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_03.gif)'></div></td>");
document.writeln("			<td width=21><img src=http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_01.gif width=21 height=16></td></tr>");
document.writeln("			</table>");

document.writeln("\
<table width=100% height=28 cellspacing=0 border=0 cellpadding=0 background=http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_06.gif>\
<tr>\
<td width=17></td>\
<td width=28><img id=playControl src="+(autoPlayFlag?"http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_pause.gif":"http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_play.gif")+" width=28 height=28 alt='播放/暂停' style='cursor:pointer;' onClick='toPlay()'/></td>\
<td width=24><img id=stopControl src="+(autoPlayFlag?"http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_stop1.gif":"http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_stop0.gif")+" width=21 height=28 alt='停止' style='cursor:pointer;' onClick='toStop()'/></td>\
<td width=50 align=right style='color:#666;display:"+(bandSlt?"block":"none")+";'><div id='broad'><input name=band type=radio value='broad'" + ((curFile==curBroad)?" checked":"") + " onClick='SetBand()'/>宽频</div></td><td width=50 style='color:#666;display:"+(bandSlt?"block":"none")+";'><div id='narrow'><input name=band type=radio value='narrow'" + ((curFile==curNarrow)?" checked":"") + " onClick='SetBand()'/>窄频</div></td>\
<td align=center><div style='width:0px;height:0px;position:relative;'><div id='msgBox' style='color:#f00;left:22px;top:22px;width:138px;padding:5px 5px 5px 5px;line-height:19px;border:1px solid #aaa;display:none;background-color:#fff;z-index:99;position:absolute;filter:alpha(opacity=90);'></div></div><img src='http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_zoom.gif' width=25 height=28 title='全屏播放' onClick=FullScreen() style='cursor:pointer;'/></td>\
<td><div id='autoDetect' title='点击下载视频优化ActiveX控件，安装成功后即可视频优化！' onclick='CheckBand(true)' style='cursor:pointer;color:#666;padding-top:5px;text-align:center;display:"+(autoDetectFlag?"block":"none")+";'>优化</div></td>\
<td width=20><img id=muteControl src=http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_mute1.gif width=20 height=28 alt='关闭声音' onClick='Mute()' style='cursor:pointer;'/></td>\
<td width=8></td>\
<td width=44 background='http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_05.gif' id='vZone' onmousedown='mouseDown(1)' title='移动滑块控制音量' style='POSITION: relative;left:0;background-position:left top;background-repeat:no-repeat;'><div id='vBox' style='OVERFLOW: hidden;POSITION: relative;cursor: pointer;left:0px;top:6px;width:9px;height:17px;background-image:url(http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_04.gif);'></div></td>\
<td width=10></td>\
</tr>\
</table>\
");


document.writeln("</td>");

document.writeln("</form>");
document.writeln("</table>");

if(withFrame){
	document.write("</td><td background='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_04.gif' valign='bottom'><img src='http://image2.sina.com.cn/ent/deco/2006/0208/gw_mp_frame_06.gif' width='16' height='56' /></td></tr></table>");
}


function RadioBand(){
	if(curFile == curBroad) document.myForm.band[0].checked = true;
	else document.myForm.band[1].checked = true;
	if(curBroad=="" || curBroad==null) GetObj("broad").style.display = "none";
	else GetObj("broad").style.display = "block";
	if(curNarrow=="" || curNarrow==null) GetObj("narrow").style.display = "none";
	else GetObj("narrow").style.display = "block";
}
RadioBand();


function ShowMsg(Msg){
	GetObj("msgBox").innerHTML = Msg;
	GetObj("msgBox").style.display = "block";
}


function HideMsg(){GetObj("msgBox").style.display = "none";}

function FullScreen(){
	if(document.MediaPlayer.Duration>0){
		document.MediaPlayer.DisplaySize = 3;
	}
}
function SetBand(){

	if(((document.myForm.band[0].checked)?curBroad:curNarrow)!=document.MediaPlayer.FileName){
		//GetObj('myScreen').innerHTML=objHTML1+((document.myForm.band[0].checked)?curBroad:curNarrow)+objHTML2;
		toStop();
		ChgVideo((document.myForm.band[0].checked)?curBroad:curNarrow);
	}
}


var mutePic = new Image();
mutePic.src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_mute0.gif";
function Mute()
{
	//alert(MediaPlayer.Mute);
	if(document.MediaPlayer.Mute.toString().toLowerCase()=='true')
	{
		document.MediaPlayer.Mute='False';
		document.images("muteControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_mute1.gif";
		document.images("muteControl").alt = "关闭声音";
	}else{
		document.MediaPlayer.Mute='True';
		document.images("muteControl").src = mutePic.src;
		document.images("muteControl").alt = "打开声音";
	}
}

			var isPlayO = autoPlayFlag?true:false;
			var isStopO = autoPlayFlag?false:true;
			var isPauseO = autoPlayFlag?false:true;
			var playPic = new Image();
			playPic.src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_play.gif";
			var stopPic = new Image();
			stopPic.src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_stop0.gif";
			//var pausePic = new Image(28,77);
			//pausePic.src = "http://image2.sina.com.cn/dongman/bn_new/http://image2.sina.com.cn/gm/home/06/gw_bn_mp_18.gif";


function toPlay()
{
	if(!isIE){
		alert("请使用IE浏览器欣赏视频!谢谢!")
		return false;
	}
	if(document.MediaPlayer.FileName != curPreB && document.MediaPlayer.FileName != curPreN){
		ChgBN(curPreB,curPreN);
		return false;
	}
	//document.MediaPlayer.AutoStart="True";
	if(document.MediaPlayer.PlayState!=3 && document.MediaPlayer.PlayState!=8){
		if(isPlayO){
			toPause();
		}else{
			if(isStopO||isPauseO)
			{

				/* 050829 新增 part1 begin */
				if(withFocusPics){
					GetObj("hideScreen").innerHTML = "";
				}
				/* 050829 新增 part1 end */

				//alert(isStopO||isPauseO);
				document.MediaPlayer.Play();
				document.MediaPlayer.AutoStart="True";
				document.images("playControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_pause.gif";
				document.images("stopControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_stop1.gif";
				//document.images("pauseControl").src = "http://image2.sina.com.cn/dongman/BN/http://image2.sina.com.cn/dongman/bn_new/images/vod009.gif";
				isPlayO = true;
				isStopO = false;
				isPauseO = false;
				//alert(isPlayO +"=="+ isStopO+"=="+ isPauseO);

			}
				if(flag){
					GetObj('hideScreen').style.display = 'none';
					GetObj('myScreen').style.display = 'block';
					PlayFlashMediaAd();
					flag = false;
				}
		}
	}
	if(GetObj("div_end_flash_ad")) GetObj("div_end_flash_ad").style.display='none';
}

function toPlay2()
{
	document.MediaPlayer.AutoStart="True";
	if(document.MediaPlayer.Duration>0){
		if(isStopO||isPauseO)
		{
				/* 050829 新增 part2 begin */
				if(!withFocusPics){
					GetObj("hideScreen").innerHTML = "";
				}
				/* 050829 新增 part2 end */
			//alert(isStopO||isPauseO);
			document.MediaPlayer.Play();
			document.images("playControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_pause.gif";
			document.images("stopControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_stop1.gif";
			//document.images("pauseControl").src = "http://image2.sina.com.cn/dongman/BN/http://image2.sina.com.cn/dongman/bn_new/images/vod009.gif";
			isPlayO = true;
			isStopO = false;
			isPauseO = false;
			//alert(isPlayO +"=="+ isStopO+"=="+ isPauseO);
		}

		if(flag){
			GetObj('hideScreen').style.display = 'none';
			GetObj('myScreen').style.display = 'block';
			flag = false;
		}
	}
	if(GetObj("div_end_flash_ad")) GetObj("div_end_flash_ad").style.display='none';
}

			/*
			//stop on current video
			function toStop()
			{
			//alert(MediaPlayer.Mute);
				if(isPlayO||isPauseO)
				{
					document.MediaPlayer.Stop();
					document.images("playControl").src = playPic.src;
					document.images("stopControl").src = stopPic.src;
					isPlayO = false;
					isStopO = true;
				}
				if((!flag)&&(document.MediaPlayer.FileName==broadFile||document.MediaPlayer.FileName==narrowFile)){
					GetObj('hideScreen').style.display = 'block';
					GetObj('myScreen').style.display = 'none';
					flag = true;
				}
			}
			*/

//back to ini video
function toStop()
{
if(document.MediaPlayer.PlayState!=3 && document.MediaPlayer.PlayState!=8){
	//alert(MediaPlayer.Mute);
			
	if(isPlayO||isPauseO)
	{
		document.MediaPlayer.AutoStart="False";
		document.MediaPlayer.Stop();
		document.images("playControl").src = playPic.src;
		document.images("stopControl").src = stopPic.src;
		isPlayO = false;
		isStopO = true;
		//clearInterval(idTmr);

		if(!flag){
		  if((iniPic!=""&&iniPic!=null) || (withFocusPics)){
			GetObj('hideScreen').style.display = 'block';
			//GetObj('hideScreen').innerHTML = focusPic;
			GetObj('myScreen').style.display = 'none';
			
				/* 050829 新增 part3 begin */
				if(withFocusPics){
					GetObj("hideScreen").innerHTML = focusPic;
				}
				/* 050829 新增 part3 end */
			
		  }
			curBroad = broadFile;
			curNarrow = narrowFile;
			CheckBand();
			document.MediaPlayer.FileName = curFile;
			flag = true;
		}
		GetObj('pBox').style.left = '0px';

		//Flash.Ad.Reset begin ---->
		GetObj("div_begin_flash_ad").style.display = "none";
		GetObj("div_begin_flash_ad").innerHTML = "";
		GetObj("div_half_flash_ad").style.display = "none";
		GetObj("div_half_flash_ad").innerHTML = "";
		GetObj("div_end_flash_ad").style.display = "none";
		GetObj("div_end_flash_ad").innerHTML = "";
		//<-----FLash.Ad.Reset end
	}
}
xFlag = true;
}
			
			function toPause()
			{
			//alert(MediaPlayer.Mute);
				if(document.MediaPlayer.Duration>0){
					if(isPlayO&&document.MediaPlayer.PlayState!=3)
					{
						document.MediaPlayer.Pause();
						document.images("playControl").src = playPic.src;
						//document.images("pauseControl").src = pausePic.src;
						isPlayO = false;
						isPauseO = true;
					}
				}
			}
			//--->


	
	var fFlag= false;
	//mpControl func

	//drag func
	var pFlag = false;

	var pZoneWidth = vWidth - 60;//GetObj('pZone').offsetWidth;

	function startdrag()
	{
		//alert(document.MediaPlayer.Duration||(!isNaN(document.MediaPlayer.Duration)));
		if(document.MediaPlayer.Duration||(!isNaN(document.MediaPlayer.Duration))){
			window.document.onmousemove = mouseMove;
			window.document.ondragstart = mouseEnd;
			window.document.onmouseup = mouseUp;
			/*window.document.onmousedown = mouseDown;*/
		}else{
			GetObj('myScreen').innerHTML='<img width=320 height=264 src=http://image2.sina.com.cn/dongman/BN/http://image2.sina.com.cn/gm/home/06/gw_bn_278.jpg alt="请使用IE浏览器观看视频"/>';
		}
	}
	var isPorV = 0;
	function mouseDown(objSign){
		//alert(window.event.srcElement.id);
		isPorV = objSign;
		if(isPorV==0){
			if(document.MediaPlayer.Duration>0){
				pFlag = true;
				//GetObj('pBox').style.left = (window.event.x-9);
				if(window.event.srcElement.id!='pZone') GetObj('pBox').style.left = GetObj('pBox').offsetLeft;
				else GetObj('pBox').style.left = (window.event.x-9);
			}
		}else if(isPorV==1){
			vFlag = true;
			if(window.event.srcElement.id!='vZone') GetObj('vBox').style.left = GetObj('vBox').offsetLeft;
			else GetObj('vBox').style.left = (window.event.x-4);
		}
	}


function GetOLeft(myObj){
	curObj = myObj;
	//alert(curObj.tagName+":"+curObj.offsetLeft)
	var objLT = curObj.offsetLeft;
	while(curObj!=curObj.offsetParent && curObj.offsetParent){
		curObj=curObj.offsetParent;
		if(curObj.tagName=="DIV" || curObj.tagName=="TABLE" || curObj.tagName=="TR" || curObj.tagName=="TD"){
			//alert(curObj.tagName+":"+curObj.offsetLeft)
			objLT += curObj.offsetLeft;
		}

	}
	return objLT;
}
	function mouseMove(){
			//window.status = (window.event.clientX +"-"+ GetOLeft(GetObj('pZone'))+"\n"+GetObj('pZone').offsetLeft)
		if(isPorV==0){
			if(document.MediaPlayer.Duration>0){
				//alert(window.event.x-25);
				//if(pFlag) alert(parseInt(GetObj('pBox').style.left));
				//if(pFlag) GetObj('pBox').style.left = window.event.clientX-10;// - clickleft;
				//if(pFlag) GetObj('PlayState').innerText = (GetObj('pZone').offsetLeft+':'+GetObj('pBox').style.left+":"+window.event.clientX);
				if(pFlag) GetObj('pBox').style.left = window.event.clientX - GetOLeft(GetObj('pZone')) - 9 +"px"; //window.event.x-9;
				if (parseInt(GetObj('pBox').style.left.replace("px","")) > pZoneWidth) GetObj('pBox').style.left=pZoneWidth +"px";
				if (parseInt(GetObj('pBox').style.left.replace("px","")) < -5) GetObj('pBox').style.left=-5 +"px";
			}

		}else if(isPorV==1){
			//window.status = (window.event.clientX +"-"+ GetOLeft(GetObj('vZone'))+"\n"+GetObj('vZone').offsetLeft);
			if(vFlag) GetObj('vBox').style.left = window.event.clientX - GetOLeft(GetObj('vZone')) - 4 +"px"; //window.event.x-9;
				if (parseInt(GetObj('vBox').style.left.replace("px","")) > 35) GetObj('vBox').style.left = 35 +"px";
				if (parseInt(GetObj('vBox').style.left.replace("px","")) < 0) GetObj('vBox').style.left = 0 +"px";
		}
	}

	function mouseUp()
	{
		if(isPorV==0){
			if(document.MediaPlayer.Duration>0){
				if (pFlag){
					var duration = document.MediaPlayer.Duration;
					document.MediaPlayer.CurrentPosition=duration * (parseInt(GetObj('pBox').style.left)/pZoneWidth);
					//alert(window.event.x +"-"+GetObj('pZone').style.left+"="+parseInt(GetObj('pBox').style.left)+"("+duration * (parseInt(GetObj('pBox').style.left)/139)+")");
				}
				pFlag = false;
			}
		}else if(isPorV==1){
			if (vFlag){
				//var volume = document.MediaPlayer.Volume;
				tempVol = (10 - (parseInt(GetObj('vBox').style.left)/3.7))*(-100);
				if(tempVol<=-1000){
					if(document.MediaPlayer.Mute.toString().toLowerCase()=='false' && document.images("muteControl").src != mutePic.src){
						document.MediaPlayer.Mute='True';
						document.images("muteControl").src = mutePic.src;
						document.images("muteControl").alt = "打开声音";
					}
				}else{
					if(document.MediaPlayer.Mute.toString().toLowerCase()=='true')
					{
						document.MediaPlayer.Mute='False';
						document.images("muteControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_mute1.gif";
						document.images("muteControl").alt = "关闭声音";
					}
				}
				document.MediaPlayer.Volume=Math.round(tempVol);//duration * (parseInt(GetObj('vBox').style.left)/139);
				//alert(window.event.x +"-"+GetObj('pZone').style.left+"="+parseInt(GetObj('pBox').style.left)+"("+duration * (parseInt(GetObj('pBox').style.left)/139)+")");
			}
			vFlag = false;
		}
	}

	function mouseEnd()
	{
		if(document.MediaPlayer.Duration>0){
			window.event.returnValue = false;
		}
	}

	function FixPos(){
		if(document.MediaPlayer.Duration>0){
			var duration = document.MediaPlayer.Duration;
			var pos = document.MediaPlayer.CurrentPosition;
			if (pos == 0)
			{
				var pBoxPos = Math.round(pos/duration*pZoneWidth)-5;
			}
			else{
				var pBoxPos = Math.round(pos/duration*pZoneWidth);
			}
			if (!isNaN(pBoxPos)) GetObj('pBox').style.left = pBoxPos;
			//alert(Math.round(pos/duration*200));
			//alert(document.MediaPlayer.Duration)
			if((document.MediaPlayer.Duration-1)<document.MediaPlayer.CurrentPosition) toStop();
		}
		//window.status = "PlayState:" + document.MediaPlayer.PlayState + " Duration:" + document.MediaPlayer.Duration;
		if((document.MediaPlayer.PlayState==0 || document.MediaPlayer.PlayState==8) && (!xFlag)) toStop();
		if(GetObj('hideScreen').style.display.toLowerCase()=='block') ShowState();//图片上的VIDEO播放状态
	}
	
	var xFlag = true;
	function ShowState(){
		var msgObj = GetObj('picMsg');
		if(msgObj == null) return false;
		switch (document.MediaPlayer.PlayState){
			case 0:
				msgObj.innerText = '已就绪';
				xFlag = false;
				break;
			case 1:
				msgObj.innerText = '已暂停';
				break;
			case 2:
				msgObj.innerText = '播放中';
				break;
			case 3:
				msgObj.innerText = '连接服务器';
				fFlag= true;
				break;
			case 4:
				msgObj.innerText = 'Stream is scanning forward';
				break;
			case 5:
				msgObj.innerText = 'Stream is scanning in reverse';
				break;
			case 6:
				msgObj.innerText = 'Skipping to next';
				break;
			case 7:
				msgObj.innerText = 'Skipping to previous';
				break;
			case 8:
				msgObj.innerText = '未打开任何影音文件';
				break;
			default:
				msgObj.innerText = '...';
		}
	
	//0 mpStopped Playback is stopped. 
	//1 mpPaused Playback is paused. 
	//2 mpPlaying Stream is playing. 
	//3 mpWaiting Waiting for stream to begin. 
	//4 mpScanForward . 
	//5 mpScanReverse Stream is scanning in reverse. 
	//6 mpSkipForward Skipping to next. 
	//7 mpSkipReverse Skipping to previous. 
	//8 mpClosed Stream is not open. 
	
	}

	

	function VolumeUp(vol){
		/*050206-guowei1
		tempVol = (9 - vol)*(-100);
		if(tempVol < (-500)) tempVol-=200;
		//alert(tempVol);
		document.MediaPlayer.Volume= tempVol;
		for(var i=1;i<=vol;i++){
			document.images['vol'+i].src = 'http://image2.sina.com.cn/dongman/BN/images/vod023_'+i+'o.gif';
		}
		for(var i=vol+1;i<=9;i++){
			document.images['vol'+i].src = 'http://image2.sina.com.cn/dongman/BN/images/vod023_'+i+'.gif';
		}*/
		tempVol = (10 - vol)*(-100);
		document.MediaPlayer.Volume= tempVol;
		GetObj('vBox').style.left = vol/10*35;
	}


	function checkstat()
			{
				//alert('out'+document.MediaPlayer.PlayState)
				if (document.MediaPlayer.PlayState==0||document.MediaPlayer.PlayState==8){
					//alert(document.MediaPlayer.PlayState)
					toPlay2();
					//060209//clearInterval(idTmr);
					GetObj('hideScreen').innerHTML=(!withFocusPics)?tempHTML:focusPic;
					GetObj('lBlock').onclick = toPlay;
					//alert("withFocusPics：" + withFocusPics)
					broadFile = tempFile;
				}else{
					setTimeout("checkstat()", 300);
				}
			}
	var tempHTML;
	var tempFile;
	function ChgVideo(filename){
		if(!isIE){
			alert("请使用IE浏览器欣赏视频!谢谢!")
			return false;
		}

			var tempCurB = curBroad;
			var tempCurN = curNarrow;

			if(autoPlayFlag) document.MediaPlayer.AutoStart="True";
			curBroad = tempCurB;
			curNarrow = tempCurN;

			tempHTML = GetObj('hideScreen').innerHTML;
			tempFile = broadFile;
			GetObj('hideScreen').innerHTML='<div align=center style="padding-top:'+Math.floor(vHeight/2)+'px;width:'+(vWidth)+'px;height:'+(vHeight)+'px;"><font color=white>视频加载中，请稍候</font></div>';
			broadFile = filename;
			document.MediaPlayer.FileName=filename;
			if(autoPlayFlag){
			//for the issue AutoPlay=True;
			//if(autoPlayFlag == true){
				document.images("playControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_pause.gif";
				document.images("stopControl").src = "http://image2.sina.com.cn/gm/home/06/gw_cctv_050826_stop1.gif";
				isPlayO = true;
				isStopO = false;
				isPauseO = false;
			//}
			//end
			}else{
				//if(autoPlayFlag == true) 
					//060209//idTmr = setInterval("checkstat()",300);//No need to SetInterval when AutoPlay==True;
					checkstat();
			}
	}

	function ChgBN(bFile,nFile){
		toStop();
		curBroad = bFile;
		curNarrow = nFile;
		curFile = curBroad;
		CheckBand();

		RadioBand();
		//alert("bFile:"+bFile+","+nFile+"\ncurFile:"+curBroad+","+curNarrow+"\nchecked:"+document.myForm.band[0].checked+"\filename:"+((document.myForm.band[0].checked)?curBroad:curNarrow));
		ChgVideo((document.myForm.band[0].checked)?curBroad:curNarrow);
	}
	function SetBN(bFile,nFile){
		curBroad = bFile;
		curNarrow = nFile;
		curFile = curBroad;

		if(autoPlayFlag) document.MediaPlayer.AutoStart="False"
		document.MediaPlayer.FileName = curFile;
		if(autoPlayFlag) document.MediaPlayer.AutoStart="True"
	}

/*
	function CheckBand(){
			if (kbps > 300)
			{
					if (curBroad == "" || curBroad==null)
					{
						curFile=curNarrow;
					}
					else
					{
						curFile=curBroad;
					}
			}
			else if(kbps > 90)
			{
					curFile=curNarrow;
			}
			else
			{
					curFile=curNarrow;
			}
			//alert(curFile+"\n"+curBroad+"<B:N>"+curNarrow)
	}
*/

//new CheckBand begin 060216
/*document.writeln('\
<!-- Ping ActiveX start -->\
<object id="snping" classid="clsid:A0ABEB73-F219-4CBA-B8AE-9298115E56CC" height=0 width=0 CODEBASE="http://pingpang.sina.com.cn/uni_play_cab.CAB#Version=1,0,0,1"></object>\
<!-- Ping ActiveX end -->\
');*/
//document.writeln('<div id="pingObj" style="display:none;"></div>');
document.writeln('<iframe id=pingObj name=pingObj width=0 height=0 BORDER=0 FRAMEBORDER=0 scrolling=no style="display:none;"></iframe>');


var ajax_count = 0;
function ajax_send(url,callback){
	
	(new Image()).src=url + "&ajax-seq=" + ajax_count++;
	/*
	var request=ajax_request();
	if(!request||_is_Safari&&!callback){
		(new Image()).src=url
	}else{
		
		request.open("GET",url,true);
		if(callback){
			request.onreadystatechange=function(){
				if(request.readyState==4){
					callback(request.responseText)
				}
			
			}
		
		}
		request.send(null)
	}
	*/
}
function ajax_request(){
	var a=null;
	try{
		a=new ActiveXObject("Msxml2.XMLHTTP")
	}catch(b){
		try{
			a=new ActiveXObject("Microsoft.XMLHTTP")
		}catch(c){
			a=null
		}
	}
	if(!a&&typeof XMLHttpRequest!="undefined"){
		a=new XMLHttpRequest()
	}
	return a
}
//???//alert(typeof uni_play_ping2.CSPing)
var autoDetectFlag = false;
function CheckBand(flag){
	//var CheckBand
	curFile=curNarrow;
	var url_i = "http://pingpang.sina.com.cn/cgi-bin/pinginstall.pl?install=i&ua=" + ua;
	ajax_send(url_i,null);
	
	try{
		ping=new ActiveXObject("uni_play_ping.CSPing");
		var url_i = "http://pingpang.sina.com.cn/cgi-bin/pinginstall.pl?install=y&ua=" + ua;
		ping.Init();
		var addr = "nv.sina.com.cn";
		var pingResult = ping.Ping(addr);
		
		//Log.write("result:"+ pingResult +",localIP:" + ping.localIP + ",remoteIP:" + ping.remoteIP + ",total:" + ping.totalCount + ",succ:" + ping.succCount + ",minTime:" + ping.minTime + ",maxTime:" + ping.maxTime + ",band:" + ping.band  );
		//alert(pingResult)
		if (pingResult == 0){
			getPingFile(ping, addr);
			var url = "http://pingpang.sina.com.cn/cgi-bin/pingclick.pl?src=" + ping.localIP + "&dest=" + ping.remoteIP + "&err=" + pingResult +"&timeout="+ ping.timeout +"&band="+ ping.band +"&min="+ ping.minTime +"&max="+ ping.maxTime +"&total="+ ping.totalCount +"&succ="+ ping.succCount +"&file=" + curFile + "&ua=" + ua;
			//alert(url);
			ajax_send(url,null);
			
			//Log.write("curFile:" + curFile);
			return;
		}else{
			var url = "http://pingpang.sina.com.cn/cgi-bin/pingclick.pl?src=" + ping.localIP + "&dest=" + ping.remoteIP + "&err=" + pingResult +"&timeout="+ ping.timeout +"&band="+ ping.band +"&min="+ ping.minTime +"&max="+ ping.maxTime +"&total="+ ping.totalCount +"&succ="+ ping.succCount +"&file=" + curFile + "&ua=" + ua;
			ajax_send(url,null);
		}
		
		
	}catch(b){
		//安装失败
		//alert("ping activex install failed");
		//alert(b.description);
		var url = "http://pingpang.sina.com.cn/cgi-bin/pinginstall.pl?install=n&ua=" + ua;
		ajax_send(url,null);
		if(GetObj("pingObj")){
			GetObj("autoDetect").style.display = "block";
			if(flag){
				/*var tempObj = document.createElement("OBJECT");
				tempObj.setAttribute("id", "snping");
				tempObj.setAttribute("classid", "clsid:A0ABEB73-F219-4CBA-B8AE-9298115E56CC");
				tempObj.setAttribute("width", "0");
				tempObj.setAttribute("height", "0");
				tempObj.setAttribute("CODEBASE", "http://pingpang.sina.com.cn/uni_play_cab.CAB#Version=1,0,0,1");
				GetObj("pingObj").appendChild(tempObj);*/
				/*GetObj("pingObj").innerHTML = '<object id="snping" classid="clsid:A0ABEB73-F219-4CBA-B8AE-9298115E56CC" height=0 width=0 CODEBASE="http://pingpang.sina.com.cn/uni_play_cab.CAB#Version=1,0,0,1"></object>';*/
				//alert(GetObj("pingObj").innerHTML);
				pingObj.document.write('<html><body><object id="snping" classid="clsid:A0ABEB73-F219-4CBA-B8AE-9298115E56CC" height=0 width=0 CODEBASE="http://pingpang.sina.com.cn/uni_play_cab.CAB#Version=1,0,0,1"></object></body></html>');
				pingObj.document.close();
			}
		}else{
			autoDetectFlag = true;
		}
		
	}
	curFile = curBroad;
		
}

function getPingFile(ping,addr){
	
	if (ping.band > 200000){
		if (curBroad == "" || curBroad==null){
			curFile=curNarrow;
		}else{
			curFile=curBroad;
		}
	}else{
		curFile=curNarrow;
	}	
		
		//mms://nv.sina.com.cn/vl/2005/09/20479858.wmv
	var idx1 = curFile.indexOf("/");
	if (idx1 > 0){
		var idx2 = curFile.indexOf("/", idx1 + 1);
		if (idx2 > 0){
			var idx3 = curFile.indexOf("/", idx2 + 1);	
			var tmpFile = curFile.substring(0, idx2 + 1) + addr + curFile.substring(idx3);
			curFile = tmpFile;
		}
	}
	
}

//new Checkband end

	/* <----PlayList begin */
	var btnDownOff = new Image();
	var btnDownOn  = new Image();
	var btnUpOff   = new Image();
	var btnUpOn    = new Image();
	btnDownOff.src="http://image2.sina.com.cn/gm/home/06/gw_game_03.gif";
	btnDownOn.src="http://image2.sina.com.cn/gm/home/06/gw_game_03on.gif";
	btnUpOff.src="http://image2.sina.com.cn/gm/home/06/gw_game_04.gif";
	btnUpOn.src="http://image2.sina.com.cn/gm/home/06/gw_game_04on.gif";

	var myIn;
	function Scroll(sign){
		if(sign==0){
			if(myIn){
				clearInterval(myIn);
				myIn = null;
			}
		}else if(sign==1){
			myIn = setInterval("GetObj('vList').scrollTop+=3",50);
		}else if(sign==2){
			myIn = setInterval("GetObj('vList').scrollTop-=3",50);
			
		}
	}
	var lPicArr = new Array();
	for(var i=0;i<list.length;i++){
		lPicArr[i] = new Image();
		lPicArr[i].src = list[i][5];
	}
	var curPreB = broadFile;
	var curPreN = narrowFile;
	function Desc(idx){
		if(GetObj("hideScreen").style.display!="none" && GetObj("lPic")){
			GetObj("lPic").src = lPicArr[idx].src;
			GetObj("lTitle").innerHTML = list[idx][2];
			GetObj("lDesc").innerHTML = list[idx][3];
			//document.MediaPlayer.FileName = list[idx][0];
			GetObj("lBlock").onclick = function(){
				ChgBN(list[idx][0],list[idx][1]);
			}
			curPreB = list[idx][0];
			curPreN = list[idx][1];
		}
	}
	function ChgCurPre(board, narrow){
		curPreB = board;
		curPreN = narrow;
	}

	if(playList){
		document.writeln('\
		<style type="text\/css" media="all">\
		img{border:none;}\
		.listPic{float:left;height:31px;overflow:hidden;}\
		.listText{float:left;color:fff;padding:3px 0 0 3px;height:31px;overflow:hidden;}\
		.listText a:link,.listText a:visited {text-decoration: none;color:#fff;}\
		.listText a:active,.listText a:hover {text-decoration: underline;color:#f00;}\
		<\/style>\
		<div style="margin-top:1px;">\
			<div id="vList" class="" style="text-align:center;height:69px;overflow:auto;border:1px solid #ccc;">\
		');
				document.writeln('<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#ffffff">');
				var textTemp = "";
				var reg1 = /<\/a>/g;
				var reg2 = /<a\s.*>/g;
				for(var i=0;i<list.length;i++){
					textTemp = list[i][2].replace(reg1,"").replace(reg2,"");
					document.writeln('<tr><td bgcolor="#676767" style="padding:1px 1px 1px 1px;"><div class="listPic" onmouseover="Desc('+i+')"><a href="javascript:ChgBN(\''+list[i][0]+'\',\''+list[i][1]+'\')"><img src="'+list[i][4]+'" width="41" height="31" alt="'+textTemp+'" /></a></div>');
					document.writeln('<div class="listText" onmouseover="Desc('+i+')">·<a href="javascript:ChgBN(\''+list[i][0]+'\',\''+list[i][1]+'\')" title="'+textTemp+'">'+textTemp+'</a></div></td></tr>');
				}
				document.writeln('</table>');
		document.writeln('\
			<\/div>\
		<\/div>\
		');
	}
	/* <----PlayList end */

	VolumeUp(9);//设定默认音量（0至9的正数）；


		//flash 流媒体广告 --->
	// code from LIUJie --->
	var i_flash;
	var v_flash;
	if (navigator.plugins) {
		for (var i=0; i < navigator.plugins.length; i++) {
			if (navigator.plugins[i].name.toLowerCase().indexOf("shockwave flash") >= 0) {
				if(withFlashAd){
					i_flash = true
				}
				v_flash = navigator.plugins[i].description.substring(navigator.plugins[i].description.toLowerCase().lastIndexOf("flash ") + 6, navigator.plugins[i].description.length);
			}
		}
	}

//-----------------------

document.writeln('\
<SCRIPT type=text\/vbscript>\n\
	on error resume next\n\
	set f = CreateObject("ShockwaveFlash.ShockwaveFlash")\n\
	if IsObject(f) then\n\
		if(withFlashAd) then\n\
			i_flash = true\n\
		end if\n\
		v_flash = hex(f.FlashVersion())\n\
	end if\n\
<\/SCRIPT>\
');

//--------------------



//var flash_stream_publish_mode = "123";//控制贴片位置 0:无广告 1:片首 2:片中 3:片尾
if(!i_flash) flash_stream_publish_mode = "0";


//var begin_flash_ad_name = "http://image2.sina.com.cn/ent/ad/video/U146P28T66D119F3608DT20050523113341.swf"

//var half_flash_ad_name = "http://image2.sina.com.cn/qc/ads/2005/half_flash_ad.swf"

//var end_flash_ad_name = "http://image2.sina.com.cn/qc/ads/2005/end_flash_ad.swf"

var add_count = 0

var begin_flag = 0
var half_flag = 0
var end_flag = 0
var flash_stream_publish_channel = ""


function init_flash_media_ad(){
	//alert("init_flash_media_ad")
	flash_media_ad_html = ""
	if (flash_stream_publish_mode.indexOf('1') >= 0){
		div_style = GetObj("myScreen").style
		div_style.display ="none"
		flash_media_ad_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='"+vWidth+"' height='"+vHeight+"' id='begin_flash_ad' align='middle'>"
		flash_media_ad_html = flash_media_ad_html + "<param name='movie' value='"+ begin_flash_ad_name +"'>";
		flash_media_ad_html = flash_media_ad_html + "<param name='quality' value='high'>";
		flash_media_ad_html = flash_media_ad_html + " <embed src='"+begin_flash_ad_name+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+vWidth+"' height='"+vHeight+"'></embed>";
		flash_media_ad_html = flash_media_ad_html + "</object>"
		
		GetObj("div_begin_flash_ad").innerHTML = flash_media_ad_html;
		GetObj("div_begin_flash_ad").style.display="block"
	}
	
	if (flash_stream_publish_mode.indexOf('2') >= 0){
		flash_media_ad_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='"+vWidth+"' height='"+vHeight+"' id='half_flash_ad' align='middle'>"
		flash_media_ad_html = flash_media_ad_html + "<param name='movie' value='"+ half_flash_ad_name +"'>";
		flash_media_ad_html = flash_media_ad_html + "<param name='quality' value='high'>";
		flash_media_ad_html = flash_media_ad_html + " <embed src='"+half_flash_ad_name+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+vWidth+"' height='"+vHeight+"'></embed>";
		flash_media_ad_html = flash_media_ad_html + "</object>"
		GetObj("div_half_flash_ad").innerHTML = flash_media_ad_html;
	}
	
	if (flash_stream_publish_mode.indexOf('3') >= 0){
		flash_media_ad_html = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0' width='"+vWidth+"' height='"+vHeight+"' id='end_flash_ad' align='middle'>"
		flash_media_ad_html = flash_media_ad_html + "<param name='movie' value='"+ end_flash_ad_name +"'>";
		flash_media_ad_html = flash_media_ad_html + "<param name='quality' value='high'>";
		flash_media_ad_html = flash_media_ad_html + " <embed src='"+end_flash_ad_name+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+vWidth+"' height='"+vHeight+"'></embed>";
		flash_media_ad_html = flash_media_ad_html + "</object>"
		GetObj("div_end_flash_ad").innerHTML = flash_media_ad_html;
	}	
}



function MediaPlayer_play(){
	div_style = GetObj("myScreen").style
	div_style.display ="block"
	div_style.left = "0px"
	div_style.position = "relative"
	div_style.top = "0px"
	//div_style.z-index = "1000"
	document.MediaPlayer.play()
}

function flash_stream_ad_check(){
	//alert("flash_stream_ad_check")
	
	
	mdp_cur_pos = document.MediaPlayer.currentPosition
	mdp_duration = document.MediaPlayer.duration
	var playState = document.MediaPlayer.playState
	
	
	if (begin_flag == 0 && mdp_cur_pos + 1 < mdp_duration / 2){
		if (flash_stream_publish_mode.indexOf("0") >= 0){
			//alert("flash_stream_publish_mode:" + flash_stream_publish_mode)
			//alert("stream_check_state")
			MediaPlayer_play()
			begin_flag = 1
			//alert("stream_check_state  return")
		}	
	}
	if (end_flag == 0 && mdp_cur_pos > 0 && mdp_cur_pos + 1 > mdp_duration){
		//alert("end")
		//if (flash_stream_publish_mode.indexOf("3") >= 0 && flash_stream_publish_channels.indexOf(flash_stream_publish_channel) >= 0){
		if (flash_stream_publish_mode.indexOf("3") >= 0){
			end_flash_ad_start()
			end_flag = 1
		}	
	}	
	if (half_flag == 0 && mdp_cur_pos > 0  && mdp_cur_pos + 1 > mdp_duration / 2){
		//alert("half")
		//if (flash_stream_publish_mode.indexOf("3") >= 0 && flash_stream_publish_channels.indexOf(flash_stream_publish_channel) >= 0){
		if (flash_stream_publish_mode.indexOf("2") >= 0){
			half_flash_ad_start()
			half_flag = 1
		}	
	}
	if (flash_stream_publish_mode != "0"){
		setTimeout('flash_stream_ad_check()', 800)
	}	
}

function stream_check_state(){
	//alert("stream_check_state")
	
	if (flash_stream_publish_mode.indexOf("0") >= 0){
		return
	}	
	
	var playState = document.MediaPlayer.playState;
	if (add_count > 10){
		return
	}
	add_count++;
	if (playState != 2 && playState != 1){
		//alert("media player play");
		document.MediaPlayer.play()
		setTimeout('stream_check_state()', 500);
	}else if (playState == 2 || playState == 6){
		//alert("media player paused");
		document.MediaPlayer.pause()
	}
}


function begin_flash_ad_end(){
	var host_name = document.location.hostname
	if (host_name.length >= 0){
		var dot_idx = host_name.indexOf(".");
		flash_stream_publish_channel = host_name.substring(0, dot_idx)	
	}
	
	//alert("begin_flash_ad_end")
	GetObj("div_begin_flash_ad").style.display="none"
	if(GetObj("div_end_flash_ad").style.display=="none"&&GetObj("div_begin_flash_ad").style.display=="none"&&GetObj("div_half_flash_ad").style.display=="none") GetObj("myScreen").style.display="block"
	document.MediaPlayer.play()
	
	
}


function half_flash_ad_start(){
	//alert("half_flash_ad_start")
	document.MediaPlayer.pause()
	GetObj("myScreen").style.display="none"
	GetObj("div_half_flash_ad").style.display="block"
	GetObj("div_begin_flash_ad").style.display="none"
	GetObj("div_end_flash_ad").style.display="none"
	GetObj("half_flash_ad").play()
	
}

function half_flash_ad_end(){
	//alert("half_flash_ad_end")
	GetObj("div_half_flash_ad").style.display="none"
	if(GetObj("div_end_flash_ad").style.display=="none"&&GetObj("div_begin_flash_ad").style.display=="none"&&GetObj("div_half_flash_ad").style.display=="none") GetObj("myScreen").style.display="block"
	document.MediaPlayer.play()
}

function end_flash_ad_start(){
	//alert("end_flash_ad_start")
	document.MediaPlayer.stop()
	GetObj("myScreen").style.display="none"
	GetObj("div_end_flash_ad").style.display="block"
	GetObj("div_begin_flash_ad").style.display="none"
	GetObj("div_half_flash_ad").style.display="none"
	GetObj("end_flash_ad").play()
}

function end_flash_ad_end(){
	//alert("end_flash_ad_end")
	begin_flag = 0
	half_flag = 0
	end_flag = 0
	GetObj("div_end_flash_ad").style.display="none"
	if(GetObj("div_end_flash_ad").style.display=="none"&&GetObj("div_begin_flash_ad").style.display=="none"&&GetObj("div_half_flash_ad").style.display=="none") GetObj("myScreen").style.display="block"
	
	//document.MediaPlayer.play()
	toPlay();
}

//----------


if(withFlashAd){
document.writeln("\
<SCRIPT FOR='begin_flash_ad' EVENT='FSCommand(command,args)' LANGUAGE='JavaScript'>\
begin_flash_ad_end()\
<\/SCRIPT>\
<SCRIPT FOR='half_flash_ad' EVENT='FSCommand(command,args)' LANGUAGE='JavaScript'>\
half_flash_ad_end()\
<\/SCRIPT>\
<SCRIPT FOR='end_flash_ad' EVENT='FSCommand(command,args)' LANGUAGE='JavaScript'>\
end_flash_ad_end()\
<\/SCRIPT>\
<SCRIPT FOR='showvideo' EVENT='FSCommand(command,args)' LANGUAGE='JavaScript'>\
begin_flash_ad_end()\
<\/SCRIPT>\
");
}
//<--- code from LIUJie end
//<----流媒体广告 end


/* 补丁:Uniplay插件正式上线后，请删除些部分内容 -begin- */
GetObj("autoDetect").style.display = "none";
/* -end- */