<!--[167,10,75] published at 2005-03-23 18:01:15 from #002 by 40-->
<!--[167,10,75] published at 2005-03-16 13:35:44 from #002 by 40-->
<!--[167,10,75] published at 2005-02-03 19:11:18 from #002 by 40-->
//scripted by guowei1 2004

var curBroad = broadFile;
var curNarrow = narrowFile;
var curFile = broadFile;

var flag = true;
function GetObj(objName){
	if(document.getElementById){
		return eval('document.getElementById("' + objName + '")');
	}else{
		return eval('document.all.' + objName);
	}
}



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("</style>");
document.writeln("<table border=0 cellpadding=0 cellspacing=0>");
document.writeln("<tr>");
document.writeln("<td width=16 height=16><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_00.gif width=16 height=16 alt='图片关键字'></td>");
document.writeln("<td background=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_01.gif></td>");
document.writeln("<td width=16 height=16><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_02.gif width=16 height=16 alt='图片关键字'></td>");
document.writeln("</tr>");
document.writeln("<tr>");
document.writeln("<td background=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_03.gif></td>");
document.writeln("<td bgcolor=#000000 width="+vWidth+" height="+vHeight+">");

document.writeln("	<div id='hideScreen'>");
document.writeln("		<div class=aWhiteMP style='text-align:center;'><a href='javascript:toPlay()' class=vv01><img src='"+iniPic+"' width="+vWidth+" height="+vHeight+" alt='点击播放该视频'></div>");
document.writeln("	</div>");
document.writeln("	<div id='myScreen' style='display:none;'>");
document.writeln("	<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>");
document.writeln("	<PARAM NAME='FileName' VALUE='"+broadFile+"'>");
document.writeln("	<PARAM NAME='AutoStart' VALUE='False'>");
document.writeln("	<PARAM NAME='ShowStatusBar' VALUE='True'>");
document.writeln("	<PARAM NAME='ShowControls' VALUE='False'>");
document.writeln("	<PARAM NAME='ShowTracker' VALUE='False'>");
document.writeln("	<PARAM NAME='EnableTracker' VALUE='False'>");
document.writeln("	<PARAM NAME='ShowPositionControls' VALUE='False'>");
document.writeln("	<PARAM NAME='EnablePositionControls' VALUE='False'>");
document.writeln("	</OBJECT>");
document.writeln("	</div>");
document.writeln("	<div id='tempDiv' style='display:none;'></div>");
document.writeln("</td>");
document.writeln("<td background=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_04.gif></td>");
document.writeln("</tr>");
document.writeln("<tr>");
document.writeln("<td><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_05.gif width=16 height=60 alt='图片关键字'></td>");
document.writeln("<td>");
document.writeln("	<table width=100% cellspacing=0 border=0 cellpadding=0>");
document.writeln("	<tr>");
document.writeln("	<td width=48><img id=playControl src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_07.gif width=48 height=60 alt='播放/暂停' style='cursor:pointer;' onClick='toPlay()'></td>");
document.writeln("	<td width=30><img id=stopControl src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_10.gif width=30 height=60 alt='停止' style='cursor:pointer;' onClick='toStop()'></td>");
document.writeln("	<td width=17><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_11.gif width=17 height=60></td>");
document.writeln("	<td>");
document.writeln("		<table width=100% cellspacing=0 border=0 cellpadding=0>");
document.writeln("		<tr>");
document.writeln("		<td>");
document.writeln("			<table width=100% cellspacing=0 border=0 cellpadding=0>");
document.writeln("			<tr>");
document.writeln("			<td id='pZone' background=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_12.gif onmousedown='mouseDown(0)' style='POSITION: relative;left:0;' width=206><div id='pBox' style='OVERFLOW: hidden;POSITION: relative;cursor:e-resize;left:-5px;top:10px;width:18px;'><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_21.gif width=18 height=9  alt='移动滑块控制影片进度'></div></td>");
document.writeln("			<td width=7><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_19.gif width=7 height=24></td>");
document.writeln("			</tr>");
document.writeln("			</table>");
			
document.writeln("		</td>");
document.writeln("		</tr>");
document.writeln("		<tr>");
document.writeln("		<td bgcolor=#000000>");
document.writeln("			<table width=100% cellspacing=0 background=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_13.gif>");
document.writeln("			<tr>");
document.writeln("			<td>&nbsp;</td>");
document.writeln("			<td width=48><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_14.gif width=48 height=27 alt='宽频' style='cursor:pointer;' onCLick='ChgVideo(curBroad)'></td>");
document.writeln("			<td width=49><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_15.gif width=49 height=27 alt='窄频' style='cursor:pointer;' onCLick='ChgVideo(curNarrow)'></td>");
document.writeln("			<td width=8><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_16.gif width=8 height=36></td>");
document.writeln("			<td width=24><img id=muteControl src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_18.gif width=24 height=36 alt='关闭声音' onClick='Mute()' style='cursor:pointer;'></td>");
document.writeln("			<!--volume-->");
document.writeln("		<td width=41 background=http://image2.sina.com.cn/dongman/bn_new/images/bn_zhengwen_mp_001.gif id='vZone' onmousedown='mouseDown(1)' style='POSITION: relative;left:0;'><div id='vBox' style='OVERFLOW: hidden;POSITION: relative;cursor: pointer;left:0px;top:7px;width:9px;'><img src=http://image2.sina.com.cn/dongman/bofangqiimages/gw_bn_vol_21.gif width=9 height=18 alt='移动滑块控制音量'></div></td>");
document.writeln("			</tr>");
document.writeln("			</table>");
document.writeln("		</td>");
document.writeln("		</tr>");
document.writeln("		</table>");
document.writeln("	</td>");
document.writeln("	</tr>");
document.writeln("	</table>");
	
document.writeln("</td>");
document.writeln("<td><img src=http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_06.gif width=16 height=60></td>");
document.writeln("</tr>");
document.writeln("</table>");




var mutePic = new Image(29,29);
mutePic.src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_17.gif";
function Mute()
{
	//alert(MediaPlayer.Mute);
	if(MediaPlayer.Mute.toString().toLowerCase()=='true')
	{
		MediaPlayer.Mute='False';
		document.images("muteControl").src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_18.gif";
		document.images("muteControl").alt = "关闭声音";
	}else{
		MediaPlayer.Mute='True';
		document.images("muteControl").src = mutePic.src;
		document.images("muteControl").alt = "打开声音";
	}
}

			var isPlayO = false;
			var isStopO = true;
			var isPauseO = false;
			var playPic = new Image(48,77);
			playPic.src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_07.gif";
			var stopPic = new Image(24,35);
			stopPic.src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_10.gif";
			//var pausePic = new Image(28,77);
			//pausePic.src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_18.gif";

function toPlay()
{
	if(document.MediaPlayer.Duration>0){
		if(isPlayO){
			toPause();
		}else{
			if(isStopO||isPauseO)
			{
				//alert(isStopO||isPauseO);
				document.MediaPlayer.Play();
				document.images("playControl").src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_08.gif";
				document.images("stopControl").src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_09.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;
	}
}

function toPlay2()
{
	if(document.MediaPlayer.Duration>0){

			if(isStopO||isPauseO)
			{
				//alert(isStopO||isPauseO);
				document.MediaPlayer.Play();
				document.images("playControl").src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_08.gif";
				document.images("stopControl").src = "http://image2.sina.com.cn/dongman/bn_new/images/gw_bn_mp_09.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;
	}
}

			/*
			//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()
{
	//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;
		//clearInterval(idTmr);

		if(!flag){
			GetObj('hideScreen').style.display = 'block';
			GetObj('myScreen').style.display = 'none';
			document.MediaPlayer.FileName = broadFile;
			curBroad = broadFile;
			curNarrow = narrowFile;
			flag = 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;

	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/dongman/bn_new/images/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 mouseMove(){
		if(isPorV==0){
			if(document.MediaPlayer.Duration>0){
				//alert(window.event.x-25);
				//if(pFlag) alert(parseInt(document.getElementById('pBox').style.left));
				//if(pFlag) document.getElementById('pBox').style.left = window.event.clientX-10;// - clickleft;
				//if(pFlag) document.getElementById('PlayState').innerText = (document.getElementById('pZone').offsetLeft+':'+document.getElementById('pBox').style.left+":"+window.event.clientX);
				if(pFlag) document.getElementById('pBox').style.left = window.event.clientX - document.getElementById('pZone').offsetLeft - 9; //window.event.x-9;
				if (parseInt(document.getElementById('pBox').style.left) > 206) document.getElementById('pBox').style.left=206;
				if (parseInt(document.getElementById('pBox').style.left) < -5) document.getElementById('pBox').style.left=-5;
			}

		}else if(isPorV==1){
			if(vFlag) document.getElementById('vBox').style.left = window.event.clientX - document.getElementById('vZone').offsetLeft - 4; //window.event.x-9;
				if (parseInt(document.getElementById('vBox').style.left) > 35) document.getElementById('vBox').style.left=35;
				if (parseInt(document.getElementById('vBox').style.left) < 0) document.getElementById('vBox').style.left=0;
		}
	}

	function mouseUp()
	{
		if(isPorV==0){
			if(document.MediaPlayer.Duration>0){
				if (pFlag){
					var duration = document.MediaPlayer.Duration;
					document.MediaPlayer.CurrentPosition=duration * (parseInt(document.getElementById('pBox').style.left)/206);
					//alert(window.event.x +"-"+document.getElementById('pZone').style.left+"="+parseInt(document.getElementById('pBox').style.left)+"("+duration * (parseInt(document.getElementById('pBox').style.left)/139)+")");
				}
				pFlag = false;
			}
		}else if(isPorV==1){
			if (vFlag){
				//var volume = document.MediaPlayer.Volume;
				tempVol = (10 - (parseInt(document.getElementById('vBox').style.left)/3.5))*(-100);
				//alert(tempVol);
				document.MediaPlayer.Volume=Math.round(tempVol);//duration * (parseInt(document.getElementById('vBox').style.left)/139);
				//alert(window.event.x +"-"+document.getElementById('pZone').style.left+"="+parseInt(document.getElementById('pBox').style.left)+"("+duration * (parseInt(document.getElementById('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*206)-5;
			}
			else{
				var pBoxPos = Math.round(pos/duration*206);
			}
			if (!isNaN(pBoxPos)) document.getElementById('pBox').style.left = pBoxPos;
			//alert(Math.round(pos/duration*200));
			if(document.MediaPlayer.PlayState==0) toStop();
			//if(document.MediaPlayer.Duration==document.MediaPlayer.CurrentPosition) toStop();
		}
	}
	/*
	function ShowState(){
		myObj = document.getElementById('PlayState');
		switch (document.MediaPlayer.PlayState){
			case 0:
				myObj.innerText = '已停止';
				break;
			case 1:
				myObj.innerText = '已暂停';
				break;
			case 2:
				myObj.innerText = '播放中';
				break;
			case 3:
				myObj.innerText = '读取缓冲';
				fFlag= true;
				break;
			case 4:
				myObj.innerText = 'Stream is scanning forward';
				break;
			case 5:
				myObj.innerText = 'Stream is scanning in reverse';
				break;
			case 6:
				myObj.innerText = 'Skipping to next';
				break;
			case 7:
				myObj.innerText = 'Skipping to previous';
				break;
			case 8:
				myObj.innerText = '未打开任何影音文件';
				break;
			default:
				myObj.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. 
	
	}
	setInterval("ShowState()",500);
	*/

	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;
		document.getElementById('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();
					clearInterval(idTmr);
					GetObj('hideScreen').innerHTML=tempHTML;
					broadFile = tempFile;
				}else{}
			}
	var tempHTML;
	var tempFile;
	function ChgVideo(filename){
		
			var tempCurB = curBroad;
			var tempCurN = curNarrow;

			toStop();

			curBroad = tempCurB;
			curNarrow = tempCurN;

			tempHTML = GetObj('hideScreen').innerHTML;
			tempFile = broadFile;
			GetObj('hideScreen').innerHTML='<div align=center><font color=white>视频加载中</font></div>';
			broadFile = filename;
			document.MediaPlayer.FileName=filename;
			idTmr = setInterval("checkstat()",300);
	}

		function ChgBN(bFile,nFile){
		curBroad = bFile;
		curNarrow = nFile;
		ChgVideo(bFile);
	}
