var speedinfownd = null;
var ppplayer = null;
var lastoffsetx = 0;

var g_HeadBegHideTM = 0;
var g_HeadEndHideTM = 0;
var g_TailBegHideTM = 0;
var g_TailEndHideTM = 0;
var g_bIsFirstlive2 = true;

var g_bIsHeadBegShow = true;
var g_bIsHeadEndShow = true;
var g_bIsTailBegShow = true;
var g_bIsTailEndShow = true;

var S_NOHOVER = -100;

var g_WorkLeft = 0;
var g_WorkRight = 0;

//func
function GetPPPlayer()
{
	if (!ppplayer)
	{
		ppplayer = Components.GetObject2("PPPlayer");
	}
}

function CheckMiniMode()
{
	var mframe = Components.GetObject2("mframe");
	if (mframe)
	{
		return mframe.MiniPlayerMode;
	}
	return false;
}

function exitTidyMode()
{
	var mainWnd = Components.GetObject2("@pplive.com/ui/mainwindow;1");
	if (mainWnd)
	{
		mainWnd.exitTidyMode();
	}
}

function DisableAccelset(bDisabled)
{
	var mainWnd = Components.GetObject2("@pplive.com/ui/mainwindow;1");
	if (mainWnd)
	{
		var accelset = mainWnd.getElementById("accelset"); 
		if (accelset)
		{
			accelset.disabled = bDisabled;
		}
		var accelsetPlayer = mainWnd.getElementById("accelsetPlayer"); 
		if (accelsetPlayer)
		{
			accelsetPlayer.disabled = bDisabled;
		}
		var accelsetUI = mainWnd.getElementById("accelsetUI"); 
		if (accelsetUI)
		{
			accelsetUI.disabled = bDisabled;
		}
	}
}

function PtInRect(id)
{
	var left = 0;
	var right = 0;
	var width = 0;
	var height = 0;

	var ppplayercontrol = Components.GetObject2("PPPlayerControl");
	if (ppplayercontrol)
	{
		var btn = ppplayercontrol.getElementById(id);
		if (btn && !btn.disabled)
		{
			left = ppplayercontrol.screenLeft + btn.offsetLeft;
			right = ppplayercontrol.screenTop + btn.offsetTop;
			width = btn.width;
			height = btn.height;
			var mframe = ppplayer.get_MFRAME();
			if (mframe)
			{
				return mframe.PtInRect(left,right,width,height);
			}
		}
	}
	return false;
}

function PtInRectEx(element,win)
{
	var left = 0;
	var right = 0;
	var width = 0;
	var height = 0;

	if (win)
	{
		if (element && !element.disabled && element.visible)
		{
			left = win.screenLeft + element.offsetLeft;
			right = win.screenTop + element.offsetTop;
			width = element.width;
			height = element.height;
			var mframe = ppplayer.get_MFRAME();
			if (mframe)
			{
				return mframe.PtInRect(left,right,width,height);
			}
		}
	}
	return false;
}

function MY_DEBUG(strDebug)
{
	if (!window.debug)
	{
		window.debug = Components.GetObject2("@pplive.com/outputdebug;1");
	}
	if(window.debug)window.debug.DebugString(strDebug);
}

function aa(i)
{
	return i > 9 ? i : '0' + i;
}

// sec -> pos
function ValueToPos(x)
{
	var lDuration = (ppplayer.nPlayFileType == 6)?1800:ppplayer.get_Duration();
	var width = $("playslider").width;
	var pos = (lDuration<=0)?0:width*x/(lDuration);
	return pos>width?width:pos;
}

function time_format(sec)
{
	if(ppplayer)
	{
		if(!ppplayer.nTimeType)
		{
			var m = Math.floor(sec / 60);
			var s = sec % 60;
			return [aa(m), aa(s)].join(':');
		}
		else
		{
			var h = Math.floor(sec / 3600);
			var m = Math.floor(sec % 3600 / 60);
			var s = sec % 60;
			return [aa(h), aa(m), aa(s)].join(':');
		}
	}
	return "00:00";
}


function OnPlayCommon()
{
	if (ppplayer)
	{
		ppplayer.Play();
	}
}

function OnPauseCommon()
{
	if (ppplayer)
	{
		$('playbtn').visible = true;
		$('pausebtn').visible = false;
		$("stopbtn").disabled = false;
		ppplayer.Pause();
	}
}

function OnStopCommon()
{
	if (ppplayer)
	{
		$('playbtn').visible = true;
		$('pausebtn').visible = false;
		$("stopbtn").disabled = true;
		ppplayer.Stop();

		if (ppplayer.bTidyMode)
		{
			exitTidyMode();
		}
	}
}

function OnPreviousCommon()
{
	if (ppplayer)
	{
		ppplayer.PlayNewItem(-1);
	}
}

function OnNextCommon()
{
	if (ppplayer)
	{
		ppplayer.PlayNewItem(1);
	}
}

function OnFullscreenCommon()
{
	if (ppplayer)
	{
		$("fullscreenbtn").visible = false;
		$("unfullscreenbtn").visible = true;
		ppplayer.put_FullScreen(true);
	}
}

function OnUnfullscreenCommon()
{
	if (ppplayer)
	{
		$("fullscreenbtn").visible = true;
		$("unfullscreenbtn").visible = false;
		ppplayer.put_FullScreen(false);
	}
}

function OnVolumeSliderChange(pos)
{
	if (ppplayer)
	{
		var ewa = ppplayer.get_EWA();
		if (ewa)
		{
			if($("volumeslider").value>0)
			{
				ewa.Mute=false;
				if (ppplayer.nVolume < 100)
				{
					ewa.Volume = pos;
				}
				else if (pos < 100)
				{
					ppplayer.nVolume = pos;
					if(pos==0)
					{
						ewa.Mute=true;
					}
					else 
					{
						ewa.Mute = false
						ewa.Volume = pos;
					}
				}
			}
			else
			{
				if(ewa.Mute)return;
				ewa.Mute=true;
			}
		}

		var ppplayercontrol = Components.GetObject2("PPPlayerControl");
		if (ppplayercontrol)
		{
			ppplayercontrol.OnUpdateMute();
		}
		
		var txt = "音量："+pos+"%";
		if (pos >= 100 && pos<1000)
		{
			var accKey = "↑";
			var mainwindow = Components.GetObject2("@pplive.com/ui/mainwindow;1");
			if(mainwindow) accKey = mainwindow.getHotKeyText("key_volumeInc");
			txt = txt + "  \r\n按 " + accKey + " 继续放大音量";
		}
		else
		{
			if($("volumeslider").lasttooltip!=txt)
			{
				$("volumeslider").tooltip = txt;
				$("volumeslider").lasttooltip =txt;
			}
		}
	}
}

function ShowStateSpeedInfo()
{
	if (ppplayer.nPlayFileType == 0 || ppplayer.nPlayFileType == 2)  //none || file
	{
		$("statespeedinfo").visible = false;
	}
	else
	{
		UpdateStateSpeedInfo(-1);
		$("statespeedinfo").visible = true;
	}
}

function UpdateStateSpeedInfo(status)
{
	if (status == -1)
	{
		if (ppplayer)
		{
			var ppp = ppplayer.get_PPP();
			var playerState = ppp.State;
			if(playerState != 2 && playerState != 0 && playerState != 3) //play || buffer || pause
			{
				UpdateStateSpeedInfo(0);
				return ;
			}				
			var videoBitrate = ppp.VideoBitrate;
			var downloadBitrate = ppp.DownloadSpeed;
			if(!videoBitrate)
			{
				return ;
			}
			var diffBitrate = downloadBitrate - videoBitrate;
			var diffPercent = diffBitrate * 100 / videoBitrate;

			var nPlayFileType = ppplayer.nPlayFileType;
			if(nPlayFileType == 5) //vod
			{
				var nPlayerBufferTime = ppp.PlayerBufferTime;
				if(nPlayerBufferTime >= 10 && playerState != 0) //buffer
				{
					status=4;
				}
				else if(nPlayerBufferTime < 10 && nPlayerBufferTime >= 0 && playerState != 0 ) //buffer
				{
					if(diffPercent<-90) status = 0; 
					else if(diffPercent >= -90 && diffPercent < -10) status = 1; 
					else if(diffPercent >= -10 && diffPercent < 10) status = 2; 
					else if(diffPercent >= 10 && diffPercent < 30) status = 3; 
					else if(diffPercent >= 30 ) status = 4; 							
				}
				else
				{
					if(diffPercent < -50) status = 0; 
					else if(diffPercent >= -50 && diffPercent < 0) status = 1; 
					else if(diffPercent >= 0) status = 2; 					
				}

				var mainWnd=Components.GetObject2("@pplive.com/ui/mainwindow;1");
				if(!ppplayer.zwNotShowBalloon && mainWnd)
				{
					//计数
					if(ppplayer.zwCalcLowSpeed && nPlayerBufferTime<2 && diffBitrate<0  && (ppplayer.zwNotShowLowBitrateSwitch==false || ppplayer.zwNotShowPause2Buffer==false))
					{
						ppplayer.zwLowSpeedCount++;
						ppplayer.zwHighSpeedCount=0;
					}
					else if(playerState==2 && nPlayerBufferTime>10 && diffBitrate>80 &&  ppplayer.zwNotShowHighBitrateSwitch==false)
					{
						ppplayer.zwHighSpeedCount++;
						ppplayer.zwLowSpeedCount=0;
					}
					else
					{
						ppplayer.zwLowSpeedCount=0;
						ppplayer.zwHighSpeedCount=0;
					}

					if(ppplayer.zwLowSpeedCount>=10)
					{
						ppplayer.zwLowSpeedCount=0;
						var bitrateswitch = ppp.BitrateSwitch(-1);
						if(bitrateswitch==1)
						{
							if(ppplayer.zwNotShowLowBitrateSwitch==false)
								mainWnd.ShowBDSwitchBalloon(true,-1);
							else if(ppplayer.zwNotShowPause2Buffer==false)
								mainWnd.ShowPause2BufferBalloon(true);
							ppplayer.zwNotShowBalloon=true;
						}
					}
					else if(ppplayer.zwHighSpeedCount>=15)
					{
						ppplayer.zwHighSpeedCount=0;
						var bitrateswitch = ppp.BitrateSwitch(1);
						if(bitrateswitch==1)
						{
							mainWnd.ShowBDSwitchBalloon(true,1);
							ppplayer.zwNotShowBalloon=true;
						}
					}
				}
			}
			else if(nPlayFileType == 1) //synacast
			{
				var synacastBufferProgress = ppp.SynacastBufferProgress;
				var synacastBufferTime = ppp.SynacastBufferTime;
				if(synacastBufferProgress==100 && playerState != 0)
				{
					if(synacastBufferTime >= 80) status = 4;
					else if(synacastBufferTime >= 50 && synacastBufferTime < 80) status = 3;
					else status =2;
				}
				else
				{
					if(diffPercent < -90)nstatus=0;
					else if(diffPercent >= -90 && diffPercent < -10) status = 1;
					else if(diffPercent >= -10 ) status = 2;
				}
			}
			else if(nPlayFileType == 6) //live2
			{
				var nPlayerBufferTime = ppp.PlayerBufferTime;
				var nCoreBufferTime = ppp.SynacastBufferTime;
				if(nPlayerBufferTime >= 10 && playerState != 0) //buffer
				{
					status=4;
				}
				else if(nPlayerBufferTime < 10 && nPlayerBufferTime >= 0 && playerState != 0 ) //buffer
				{
					if(nCoreBufferTime>10)
					{
						status=4;
					}
					else
					{
						if(diffPercent<-90) status = 0; 
						else if(diffPercent >= -90 && diffPercent < -10) status = 1; 
						else if(diffPercent >= -10 && diffPercent < 10) status = 2; 
						else if(diffPercent >= 10 && diffPercent < 30) status = 3; 
						else if(diffPercent >= 30 ) status = 4; 	
					}
				}
				else
				{
					if(diffPercent < -50) status = 0; 
					else if(diffPercent >= -50 && diffPercent < 0) status = 1; 
					else if(diffPercent >= 0) status = 2; 					
				}
			}
			else
			{
				status = 0;
			}
		}
	}

	if (status >= 0 && status <= 4)
	{
		$("statespeedinfo").src = "speed"+status+".png";
	}
}

function GetUpdateVolume(vol,bMute)
{
	if (vol < 0 || bMute)
	{
		vol = 0;
	}
	else if (vol > 100)
	{
		vol = 100;
	}
	return vol;
}

function checkVolumeHover()
{
	if(this && this.nodename && this.nodename=="button" && !this.visible)
	{
		//过渡状态
		return;
	}

	if(ppplayer)
	{
		var mute = ppplayer.hover_mute;
		var mute2 = ppplayer.hover_mute2;
		var mute3 = ppplayer.hover_mute3;
		var mute4 = ppplayer.hover_mute4;
		var unmute = ppplayer.hover_muteplus;
		var muteplus = ppplayer.hover_unmute;
		var volpop = ppplayer.hover_volpop;

		if(mute || mute2 || mute3 || mute4 || unmute || muteplus || volpop)
		{
			if(ppplayer.checkVolumeHoverTimeId)
			{
				window.clearTimeout(ppplayer.checkVolumeHoverTimeId);
				ppplayer.checkVolumeHoverTimeId=0;
			}
			if (ppplayer.DataRateWnd && !ppplayer.DataRateWnd.closed)
			{
				ppplayer.DataRateWnd.close();
			}
			if (ppplayer.VolumePopDlg &&  !ppplayer.VolumePopDlg.closed)
			{
				ppplayer.VolumePopDlg.visible=true;
				return;
			}
			if(!this) return;

			var wnd = window.open("playcontrol\\VolumePopDlg.xml","","owner=1");
			var volumepopdlg = Components.GetObject2("VolumePopDlg");
			if (volumepopdlg)
			{
				Components.UnRegisterObject("VolumePopDlg");
			}
			Components.RegisterObject("VolumePopDlg", wnd);
			wnd.moveTo(this.offsetLeft+window.screenLeft+this.width/2-wnd.outerWidth/2,window.screenTop-wnd.outerHeight + this.offsetTop);
			wnd.visible = true;
			ppplayer.VolumePopDlg = wnd;
		}
		else
		{
			if (ppplayer.VolumePopDlg && !ppplayer.VolumePopDlg.closed)
			{
				ppplayer.checkVolumeHoverTimeId = window.SetTimeout("closeVolumePopDlg();",100);
			}
		}
	}
}
function closeVolumePopDlg()
{
	if(ppplayer && ppplayer.VolumePopDlg && !ppplayer.VolumePopDlg.closed && ppplayer.checkVolumeHoverTimeId)
	{
		ppplayer.VolumePopDlg.close();
		ppplayer.checkVolumeHoverTimeId=0
	}
}
function UpdateVolumeSlider()
{
	if (ppplayer)
	{
		var ewa = ppplayer.get_EWA();
		if (ewa)
		{
			var nVol = ewa.Volume;
			var bMute = ewa.Mute;
			var vol = GetUpdateVolume(nVol,bMute);
			if($("volumeslider").value!=vol)$("volumeslider").value = vol;
			var txt = "音量："+nVol+"%";
			if(nVol>=100 && nVol<1000)
			{
					var accKey = "↑";
					var mainwindow = Components.GetObject2("@pplive.com/ui/mainwindow;1");
					if(mainwindow) accKey = mainwindow.getHotKeyText("key_volumeInc");
					txt = txt + "  \r\n按 " + accKey + " 继续放大音量";
			}
			if($("volumeslider").lasttooltip!=txt)
			{
				$("volumeslider").tooltip =txt;
				$("volumeslider").lasttooltip=txt;
			}

		}
	}
}

function SetMute(vol,bMute)
{
	$("mutebtn").visible = false;
	$("mute2btn").visible = false;
	$("mute3btn").visible = false;
	$("mute4btn").visible = false;
	$("muteplusbtn").visible = false;
	if (bMute)
	{
		$("unmutebtn").visible = true;
		return ;
	}
	else
	{
		$("unmutebtn").visible = false;
	}
	
	if (vol <= 0)
	{
		$("mutebtn").visible = true;
	}
	else if(vol > 0 && vol <= 35)
	{
		$("mute2btn").visible = true;
	}
	else if (vol > 35 && vol <= 80) 
	{
		$("mute3btn").visible = true;
	}
	else if (vol > 80 && vol <= 100)
	{
		$("mute4btn").visible = true;
	}
	else
	{
		$("muteplusbtn").visible = true;
	}
}

function UpdateMute()
{
	if (ppplayer && !ppplayer.dragging)
	{
		var ewa = ppplayer.get_EWA();
		if (ewa)
		{
			var vol = ewa.Volume;
			var mute = ewa.Mute;
			ppplayer.bMute = mute;
			if (mute)      //静音
			{
				$("mutebtn").visible = false;
				$("mute2btn").visible = false;
				$("mute3btn").visible = false;
				$("mute4btn").visible = false;
				$("muteplusbtn").visible = false;
				$("unmutebtn").visible = true;
				vol=0;
			}
			else
			{
				SetMute(vol,false);
			}

			var txt = "音量："+vol+"%";
			if(vol>=100 && vol<1000)
			{
					var accKey = "↑";
					var mainwindow = Components.GetObject2("@pplive.com/ui/mainwindow;1");
					if(mainwindow) accKey = mainwindow.getHotKeyText("key_volumeInc");
					txt = txt + "  \r\n按 " + accKey + " 继续放大音量";
			}
			try{$("volumeslider").value = vol>100?100:vol;if($("volumeslider").lasttooltip!=txt){$("volumeslider").tooltip=txt;$("volumeslider").lasttooltip=txt;}}catch(e){}
			try{Components.GetObject2("VolumePopDlg").SetVolume(vol);}catch(e){}

			var mframe = Components.GetObject2("mframe");
			if(mframe && mframe.TipControl)
			{
				//hover mute , unmute 和 muteplus 时 不显示tip
				if (!ppplayer.hover_mute && !ppplayer.hover_mute2 && !ppplayer.hover_mute3 && !ppplayer.hover_mute4 && !ppplayer.hover_unmute && !ppplayer.hover_muteplus)
				{
					if (!ppplayer.bNoVolumeTips)
					{
						if (vol > 100)
						{
							mframe.TipControl.ShowTipText(txt,0x00e0ac,3);
						}
						else
						{
							mframe.TipControl.ShowTipText(txt,0xcccccc,3);
						}
					}
				}
			}

		}
	}

	var mainWnd=Components.GetObject2("@pplive.com/ui/mainwindow;1");
	if(mainWnd && mainWnd.miniPlayer)
	{
		try{mainWnd.miniPlayer.updateMute();}catch(e){}
	}
}
function OnUserLogin()
{
	if ($("stateinfogallop").visible)
	{
		var passport = Components.GetObject2("@pplive.com/passport;1");
		var isVipUser = false;
		if(passport)isVipUser = passport.IsVipUser;
		if(isVipUser)
		{
			if(ppplayer)
			{
                // 如果前一个状态是26（VIP错误），在VIP登录的情况下，优先显示播放状态，而不是错误信息
                if (ppplayer.nPlayState == 26) 
                {
			        ppplayer.bErrorStateInfo = false;
                }
				var playstate = ppplayer.get_PlayState();
				SetStateInfoText(playstate);
			}
			else
			{
				$("stateinfolabel").value = window.stateinfotxt;
				$("stateinfogallop").visible = false;
			}
		}
	}
}
function OnUserLogout()
{
	if(hasGallop())
	{
		if(window.innerwidth >= 400)$("stateinfogallop").visible=true;
		$("stateinfolabel").value = "";
		$("stateinfolabel").visible = false;
	}
}
//callback
function OnLoadCommon()
{
	//dot信息气泡
	window.balloons = 0;
	window.balloons = new Balloons(window);
	window.updateDragInterval = 0;

	if(Components.GetObject2("PPPlayerControl"))Components.UnregisterObject("PPPlayerControl");
	var mainWnd=Components.GetObject2("@pplive.com/ui/mainwindow;1");
	if(mainWnd)
	{
		if(!mainWnd.vecOnUserLogin)mainWnd.vecOnUserLogin = {};
		mainWnd.vecOnUserLogin["PlayControl"] = function(newval)
		{
			if(newval)OnUserLogin();
			else OnUserLogout();
		}
	}

	var gallopStateInfo = Components.GetObject2("gallopStateInfo");
	if(gallopStateInfo)$("stateinfogallop").setContractId("gallopStateInfo", true);

	//init
	window.$ = function(id)
	{
		return document.getElementById(id);
	};
	window.updateInterval = 0;
	window.stateinfoInterval = 0 ;
	window.stateinfotxt="";

	window.SetContentDot = function(dotInfo)
	{
		SetContentDot(dotInfo);
	}

	window.NotifyHidePane = function()
	{
		if(window.balloons == 0)	window.balloons = new Balloons(window);
		window.balloons.Close("education\\DotTip.xml");
	}
	//获取播放控制接口
	GetPPPlayer();
	if (ppplayer)
	{
		window.$("live2msg").value=ppplayer.live2msg;
		ppplayer.hover_mute=false;
		ppplayer.hover_mute2=false;
		ppplayer.hover_mute3=false;
		ppplayer.hover_mute4=false;
		ppplayer.hover_muteplus=false;
		ppplayer.hover_unmute=false;
		ppplayer.hover_volpop=false;
		//runmode
		if(mainWnd)
		{	
			ppplayer.nRunMode = mainWnd.runMode;
			ppplayer.bTidyMode = mainWnd.tidyMode;
		}

		//播放,暂停,停止
		var playstate = ppplayer.get_PlayState();
		SetStateInfoText(playstate);
		if ((playstate == 2 || playstate == 0) && ppplayer.bAlreadyPlaying)   //play || buffering
		{
			$("playbtn").visible = false;
			$("pausebtn").visible = true;
			$("stopbtn").disabled = false;
		}
		else if ((playstate == 2 || playstate == 0) && !ppplayer.bAlreadyPlaying)   //play || buffering
		{
			$("playbtn").visible = true;
			$("pausebtn").visible = false;
			$("stopbtn").disabled = false;
		}
		else if (playstate == 3) //pause
		{
			$("playbtn").visible = true;
			$("pausebtn").visible = false;
			$("stopbtn").disabled = false;
		}
		else
		{
			$("playbtn").visible = true;
			$("pausebtn").visible = false;
			$("stopbtn").disabled = true;
		}
		//slider label
		if(playstate == 0 && ppplayer.nPlayFileType != 1) //buffering && 非直播
		{
			$("playslider").visible = true;
			if(ppplayer.nPlayFileType == 5)
			{
				$("playtimelabel").visible = true;
				$("playtimebeg").visible = false;
				$("playtimeend").visible = false;
			}
			else if(ppplayer.nPlayFileType == 6)
			{
				$("playtimelabel").visible = false;
				$("playtimebeg").visible = true;
				$("playtimeend").visible = true;
			}
		}
		else if(ppplayer.nPlayFileType == 1)
		{
			$("playtimelabel").visible = false;
			$("playtimebeg").visible = false;
			$("playtimeend").visible = false;
		}
		if(playstate == -2 && ppplayer.nRunMode == 0)
		{
			$("playtimelabel").visible = false;
			$("playtimebeg").visible = false;
			$("playtimeend").visible = false;
		}

		//next,previous
		if (ppplayer.bCanPrevious)
		{
			$("previousbtn").disabled = false;
		}
		else
		{
			$("previousbtn").disabled = true;
		}

		if (ppplayer.bCanNext)
		{
			$("nextbtn").disabled = false;
		}
		else
		{
			$("nextbtn").disabled = true;
		}

		//mute
		SetMute(ppplayer.nVolume,ppplayer.bMute);

		//dataratebtn
		if (!ppplayer.bTidyMode || EwaIsFullScreen())
		{
			var rt = ppplayer.rt;
			if (rt & 0x0002)   //蓝光频道关联普通高清频道
			{	
				$("shiftbtn").label = "蓝光";
				$("shiftbtn").disabled = false;
			}
			else if (rt & 0x004)   //高清频道关联蓝光频道
			{	
				$("shiftbtn").label = "高清";
				$("shiftbtn").disabled = false;
			}
			else
			{	//根据 vtp 字段，来显示对应的频道类别
				var vtp = ppplayer.vtp;
				if (vtp == -1)
				{
					$("shiftbtn").label = "清晰度";
				}
				else if (vtp == 0)
				{
					$("shiftbtn").label = "标清";
				}
				else if (vtp == 1)
				{
					$("shiftbtn").label = "高清";
				}
				else if (vtp == 2)
				{
					$("shiftbtn").label = "蓝光";
				}
				$("shiftbtn").disabled = true;
			}
		}
		//fullscreen,unfullscreen
		if (ppplayer.get_FullScreen())
		{
			$("fullscreenbtn").visible = false;
			$("unfullscreenbtn").visible = true;
		}
		else
		{
			$("fullscreenbtn").visible = true;
			$("unfullscreenbtn").visible = false;
		}
		//------------------------------
		var child = $("playslider").firstChild;
		while (child != null)
		{
			child.visible = false;
			child = child.nextSibling;
		}
		ppplayer.bIsAlreadyInit = false;
		//------------------------------再新页面创建dot按钮
		if(ppplayer.bIsContentDotInited && ppplayer.bCanPlay && ppplayer.nPlayFileType == 5)
		{
			ppplayer.arrDotBtn = [];
			for(var i=0 ; i<ppplayer.nCurNumDot ; ++i)
			{
				ppplayer.arrDotBtn[i] = document.createElement("<button left='-20' top='1' width='11' height='10' image='mark_content_NM.png' hoverImage='mark_content_HV.png' downImage='mark_content_HV.png' disabledImage='mark_content_NM.png' onclick='OnDotBtnCommon(this);' cursor='hand' visible='false' onmousemove='MouseDotHover(this);' onmouseout='MouseDotOut();'/>");
				$("playslider").insertBefore(ppplayer.arrDotBtn[i], $("playslider").firstChild);
				ppplayer.arrDotBtn[i].visible = true;
				ppplayer.arrDotBtn[i].moveTo(ValueToPos(ppplayer.arrDotTime[i])-ppplayer.arrDotBtn[i].width/2, ppplayer.arrDotBtn[i].top);
			}
		}
		InitSliderAndDot();
		OnSliderSize();
		//------------------------------
		if (!ppplayer.bAlreadyPlaying)
		{
			$("playslider").disabled = true;
		}
		else
		{
			$("playslider").disabled = false;
		}

		//statespeedinfo
		ShowStateSpeedInfo();
		window.ReAnchorBalloon=function()
		{
			var mainWnd=Components.GetObject2("@pplive.com/ui/mainwindow;1");
			if(mainWnd && mainWnd.balloons)
			{
				var ppplayercontrol = Components.GetObject2("PPPlayerControl");
				if(ppplayercontrol)
				{
					//AutoSeek
					mainWnd.balloons.ReAnchor("education\\AutoSeek.xml",ppplayercontrol.hwnd);
					//BDSwitch
					//HDSwitch
					{

						var shiftbtn = ppplayercontrol.$("shiftbtn");
						if(!shiftbtn || !shiftbtn.visible) return;

						var offsetLeft = parseInt(shiftbtn.offsetLeft + shiftbtn.width/2);
						var offsetTop =parseInt(shiftbtn.offsetTop + shiftbtn.height/2-5);

						mainWnd.balloons.ReAnchorEx("education\\BDSwitch.xml",ppplayercontrol.hwnd,offsetLeft,offsetTop);
						mainWnd.balloons.ReAnchorEx("education\\HDSwitch.xml",ppplayercontrol.hwnd,offsetLeft,offsetTop);
					}

					//Pause2Buffer
					{
						var pausebtn = ppplayercontrol.$("pausebtn");
						if(!pausebtn) return;

						var offsetLeft = parseInt(pausebtn.offsetLeft + pausebtn.width/2+4);
						var offsetTop =parseInt(pausebtn.offsetTop + 3);
						mainWnd.balloons.ReAnchorEx("education\\Pause2Buffer.xml",ppplayercontrol.hwnd,offsetLeft,offsetTop);
					}
					//PPAPIsForbidden
					{
						var statespeedinfo = ppplayercontrol.$("statespeedinfo");
						if(!statespeedinfo || !statespeedinfo.visible) return;

						var offsetLeft = parseInt(statespeedinfo.offsetLeft + statespeedinfo.width/2 - ppplayercontrol.outerWidth);
						var offsetTop =parseInt(statespeedinfo.offsetTop + statespeedinfo.height/2);

						mainWnd.balloons.ReAnchorEx("education\\PPAPIsForbidden.xml",ppplayercontrol.hwnd,offsetLeft,offsetTop);
					}

				}
			}
		}
	}

	$("stateinfogallop").OnCountChange = function(arg)
	{
		if(arg==0)
		{
			if ($("stateinfogallop").visible)
			{
				$("stateinfolabel").value = window.stateinfotxt;
				$("stateinfogallop").visible = false;
				if(window.innerwidth >= 400)$("stateinfolabel").visible = true;
			}
		}
		else if(!$("stateinfogallop").visible)
		{
			var passport = Components.GetObject2("@pplive.com/passport;1");
			var isVipUser = false;
			if(passport)isVipUser = passport.IsVipUser;
			if(!isVipUser)
			{
				$("stateinfolabel").value="";
				if(window.innerwidth >= 400)$("stateinfogallop").visible = true;
				$("stateinfolabel").visible = false;
			}
		}
	}
}

function OnUnLoadCommon()
{
	//---------------------  remove Child
	for(var i=0 ; i<ppplayer.nCurNumDot ; ++i)
	{
		var child = $("playslider").firstChild;
		while (child != null)
		{
			if(child != $("curplaytagbtn") && child != $("skipheadbeg") && child != $("skipheadend") && 
				child != $("skiptailbeg") && child != $("skiptailend") && child != $("thumb") )
				$("playslider").removeChild(child);
			child = child.nextSibling;
		}
	}
	//---------------------
	if(window.balloons)
		window.balloons.Clear();
	window.balloons = 0;
	ppplayer.nHoverIndex = S_NOHOVER;
	ppplayer.nOldHover = S_NOHOVER;
	//---------------------------------------------------------
	var mainWnd=Components.GetObject2("@pplive.com/ui/mainwindow;1");
//	if(mainWnd)mainWnd.vecOnUserLogin["PlayControl"]=null;  //此句不能加。。切换迷你后会出问题
	if(window.updateInterval)window.clearInterval(window.updateInterval);
	var playcontrol = Components.GetObject2("PPPlayerControl");
	if(playcontrol && playcontrol.hwnd == window.hwnd)
	{
		Components.UnregisterObject("PPPlayerControl");
	}
}

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

function OnCloseStateTip()
{
	var mframe = Components.GetObject2("mframe");
	if (mframe)
	{
		mframe.CloseStateTip();
	}
}

var g_IsChilddisabled = false;
	
//判断是否在sliderThumb下
function IsBtnInSliderThumb(btn)
{
	var lDuration = (ppplayer.nPlayFileType == 6)?1800:ppplayer.get_Duration();
	var pos = (lDuration<=0)?0:$("playslider").width* $("playslider").value/lDuration;
	var l = btn.left;
	var r = btn.left+btn.width;
	var ll, rr;
	if (ppplayer && ppplayer.nRunMode == 0)
	{ll = pos-9;	rr = pos+9;		}
	else if (ppplayer && ppplayer.nRunMode == 1)
	{ll = pos-13;	rr = pos+13;	}
	if( (l>ll&&r<rr) || (l<ll&&r>ll) || (l<rr&&r>rr) )
	{
		g_IsChilddisabled = true;
		btn.disabled = true;
	}
}

function OnCurPlayTagHover(btn)
{
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	IsBtnInSliderThumb(btn);
	if( (ppplayer.nHoverIndex == -5 || (ppplayer.nOldHover == -5 && ppplayer.nHoverIndex == S_NOHOVER && window.balloons.IsVisible("education\\DotTip.xml"))) )
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)		balloon.ResetTip();
		return ;
	}
	ppplayer.nHoverIndex = -5;
	ppplayer.nOldHover = ppplayer.nHoverIndex;

	var pos = $("playslider").valueForPos(btn.left+btn.width/2.0);
	var h = ppplayer.dtTimeBeg.getHours();
	var m = ppplayer.dtTimeBeg.getMinutes()+parseInt(pos/60);
	var s = parseInt(pos%60);
	ShowDotTip(btn, aa(h)+"时"+aa(m)+"分"+aa(s)+"秒", "现在播到这里");
}

function OnCurPlayTagOut()
{
	var balloon = window.balloons.Get("education\\DotTip.xml");
	if(balloon)		balloon.CloseTip();

	ppplayer.nHoverIndex = S_NOHOVER;
}

function OnCurPlayTagCommon(btn)
{
	//-------------------二代直播当前标记点击	
	if (ppplayer)
	{
		var lDuration = 1800;
		$("playslider").max = lDuration;
		var ppp = ppplayer.get_PPP();
		if (ppp)
		{
			btn.disabled = true;

			var dt = new Date(ppplayer.dtTimeBeg.getTime());
			dt.setSeconds(dt.getSeconds() + $("playslider").progressValue); 
			ppplayer.put_CurrentPosition(dt.getTime()/1000);

			OnTimer();
			g_IsChilddisabled = true;
		}
	}
}

function ShowDotTip(btn, tm, ds)
{
//	if((window.screenLeft+btn.left)<0 || (window.screenLeft+btn.left+btn.width)>=window.screen.width) return ;
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	if(ds == "") return ;
	if(g_WorkRight == 0)
	{
		var mframe = Components.GetObject2("mframe");
		if (mframe)
		{
			g_WorkLeft = mframe.GetWorkLeft();
			g_WorkRight = mframe.GetWorkRight();
							
			g_WorkLeft = (g_WorkLeft<=0)?g_WorkLeft:0;
			g_WorkRight = (g_WorkRight<=0)?(window.screen.width):g_WorkRight;
			if(g_WorkLeft >= g_WorkRight)	return ;
		}
	}
	var xPos = btn.left + btn.width/2.0 + $("playslider").left + $("playctrl").left;
	if( !(window.balloons.IsVisible("education\\DotTip.xml")) )
	{
		window.balloons.Create("education\\DotTip.xml", window.hwnd, 0, 40, xPos, $("playctrl").top);
		window.balloons.Show("education\\DotTip.xml", false);
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)balloon.SetTextAndShow(tm, ds, window.hwnd, xPos, $("playctrl").top, window.screenLeft, g_WorkLeft, g_WorkRight);
	}
	else
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");	
		if(balloon)balloon.SetTextAndMoveTo(tm, ds, window.hwnd, xPos, $("playctrl").top, window.screenLeft);
	}
}
//------------------------------------------------------------------------------- HeadBeg
function HeadBegHover(btn)
{
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	IsBtnInSliderThumb(btn);
	if(g_HeadBegHideTM)
	{
		window.clearTimeout(g_HeadBegHideTM);
		g_HeadBegHideTM = 0;
	}
	if( (ppplayer.nHoverIndex == -1 || (ppplayer.nOldHover == -1 && ppplayer.nHoverIndex == S_NOHOVER && window.balloons.IsVisible("education\\DotTip.xml"))) )
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)		balloon.ResetTip();
		return ;
	}
	ppplayer.nHoverIndex = -1;
	ppplayer.nOldHover = ppplayer.nHoverIndex;
	ShowDotTip(btn, time_format(ppplayer.m_tmSkipHeadbeg), "片头开始");
}
function HeadBegOut()
{
	ppplayer.nHoverIndex = S_NOHOVER;
	if(g_HeadBegHideTM)
	{
		window.clearTimeout(g_HeadBegHideTM);
		g_HeadBegHideTM = 0;
	}
	g_HeadBegHideTM = window.setTimeout("$('skipheadbeg').visible = false; g_HeadBegHideTM = 0;", 2*1000);
	//----------------
	var balloon = window.balloons.Get("education\\DotTip.xml");
	if(balloon)		balloon.CloseTip();
}
function OnHeadBegCommon(btn)
{
	if (ppplayer && ppplayer.m_tmSkipHeadbeg>0)
	{
		btn.disabled = true;
		ppplayer.put_CurrentPosition( ppplayer.m_tmSkipHeadbeg );
		OnTimer();
		g_IsChilddisabled = true;
	}
}
//------------------------------------------------------------------------------- HeadEnd
function HeadEndHover(btn)
{
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	IsBtnInSliderThumb(btn);
	if(g_HeadEndHideTM)
	{
		window.clearTimeout(g_HeadEndHideTM);
		g_HeadEndHideTM = 0;
	}
	if( (ppplayer.nHoverIndex == -2 || (ppplayer.nOldHover == -2 && ppplayer.nHoverIndex == S_NOHOVER && window.balloons.IsVisible("education\\DotTip.xml"))) )
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)		balloon.ResetTip();
		return ;
	}
	ppplayer.nHoverIndex = -2;
	ppplayer.nOldHover = ppplayer.nHoverIndex;
	ShowDotTip(btn, time_format(ppplayer.m_tmSkipHeadend), "片头结束");
}
function HeadEndOut()
{
	ppplayer.nHoverIndex = S_NOHOVER;
	if(g_HeadEndHideTM)
	{
		window.clearTimeout(g_HeadEndHideTM);
		g_HeadEndHideTM = 0;
	}
	g_HeadEndHideTM= window.setTimeout("$('skipheadend').visible = false; g_HeadEndHideTM = 0;", 2*1000);
	var balloon = window.balloons.Get("education\\DotTip.xml");
	if(balloon)		balloon.CloseTip();
}
function OnHeadEndCommon(btn)
{
	if (ppplayer && ppplayer.m_tmSkipHeadend>0)
	{
		btn.disabled = true;
		ppplayer.put_CurrentPosition( ppplayer.m_tmSkipHeadend );
		OnTimer();
		g_IsChilddisabled = true;
	}
}
//------------------------------------------------------------------------------- TailBeg
function TailBegHover(btn)
{
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	IsBtnInSliderThumb(btn);//tip
	if(g_TailBegHideTM)//消失线程
	{
		window.clearTimeout(g_TailBegHideTM);
		g_TailBegHideTM = 0;
	}
	if( (ppplayer.nHoverIndex == -3 || (ppplayer.nOldHover == -3 && ppplayer.nHoverIndex == S_NOHOVER && window.balloons.IsVisible("education\\DotTip.xml"))) )
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)		balloon.ResetTip();
		return ;
	}
	ppplayer.nHoverIndex = -3;
	ppplayer.nOldHover = ppplayer.nHoverIndex;
	ShowDotTip(btn, time_format(ppplayer.m_tmSkipTailbeg), "片尾开始");
}
function TailBegOut()
{
	ppplayer.nHoverIndex = S_NOHOVER;
	if(g_TailBegHideTM)
	{
		window.clearTimeout(g_TailBegHideTM);
		g_TailBegHideTM = 0;
	}
	g_TailBegHideTM = window.setTimeout("$('skiptailbeg').visible = false; g_TailBegHideTM = 0;", 2*1000);
	var balloon = window.balloons.Get("education\\DotTip.xml");
	if(balloon)		balloon.CloseTip();
}
function OnTailBegCommon(btn)
{
	if (ppplayer && ppplayer.m_tmSkipTailbeg>0)
	{
		btn.disabled = true;
		ppplayer.put_CurrentPosition( ppplayer.m_tmSkipTailbeg );
		OnTimer();
		g_IsChilddisabled = true;
	}
}
//------------------------------------------------------------------------------- TailEnd
function TailEndHover(btn)
{
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	IsBtnInSliderThumb(btn);//tip
	if(g_TailEndHideTM)//消失线程
	{
		window.clearTimeout(g_TailEndHideTM);
		g_TailEndHideTM = 0;
	}
	if( (ppplayer.nHoverIndex == -4 || (ppplayer.nOldHover == -4 && ppplayer.nHoverIndex == S_NOHOVER && window.balloons.IsVisible("education\\DotTip.xml"))) )
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)		balloon.ResetTip();
		return ;
	}
	ppplayer.nHoverIndex = -4;
	ppplayer.nOldHover = ppplayer.nHoverIndex;
	ShowDotTip(btn, time_format(ppplayer.m_tmSkipTailend), "片尾结束");
}
function TailEndOut()
{
	ppplayer.nHoverIndex = S_NOHOVER;
	if(g_TailEndHideTM)
	{
		window.clearTimeout(g_TailEndHideTM);
		g_TailEndHideTM = 0;
	}
	g_TailEndHideTM = window.setTimeout("$('skiptailend').visible = false; g_TailEndHideTM = 0;", 2*1000);
	var balloon = window.balloons.Get("education\\DotTip.xml");
	if(balloon)		balloon.CloseTip();
}
function OnTailEndCommon(btn)
{
	if (ppplayer && ppplayer.m_tmSkipTailend>0)
	{
		btn.disabled = true;
		ppplayer.put_CurrentPosition( ppplayer.m_tmSkipTailend );
		OnTimer();
		g_IsChilddisabled = true;
	}
}
//------------------------------------------------------------------------------- DotBtn
function OnDotBtnCommon(btn)
{
	//-------------------打点按钮点击
	var index = -7777;
	for(var i=0 ; i<ppplayer.nCurNumDot ; ++i)
	{
		if(ppplayer.arrDotBtn[i] == btn)
		{
			index = i;break;
		}
	}
	if(index==-7777)		return ;
	if (ppplayer && index<ppplayer.nCurNumDot && ppplayer.arrDotTime[index]>0)
	{
		btn.disabled = true;
		ppplayer.put_CurrentPosition( ppplayer.arrDotTime[index] );
		OnTimer();
		g_IsChilddisabled = true;
	}
}
function MouseDotHover(btn)
{	
	IsBtnInSliderThumb(btn);
	var index = -7777;
	for(var i=0 ; i<ppplayer.nCurNumDot ; ++i)
	{
		if(ppplayer.arrDotBtn[i] == btn)
		{
			index = i;break;
		}
	}
	if(index==-7777)	return ;
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	if( ppplayer.nHoverIndex == index 
		|| (ppplayer.nOldHover == index && ppplayer.nHoverIndex == S_NOHOVER && window.balloons.IsVisible("education\\DotTip.xml")) )
	{
		var balloon = window.balloons.Get("education\\DotTip.xml");
		if(balloon)		balloon.ResetTip();
		return ;
	}
	ppplayer.nHoverIndex = index;
	ppplayer.nOldHover = ppplayer.nHoverIndex;
	ShowDotTip(btn, time_format(ppplayer.arrDotTime[ppplayer.nHoverIndex]), ppplayer.arrDotDS[ppplayer.nHoverIndex]);
}
function MouseDotOut()
{
	ppplayer.nHoverIndex = S_NOHOVER;
	//----------------
	var balloon = window.balloons.Get("education\\DotTip.xml");
	if(balloon)		balloon.CloseTip();
}
//------------------------------------------------------------------------------- 

function OnPlaySliderMove(event)
{
	if (ppplayer)
	{
		if (lastoffsetx != event.offsetX)
		{	
			//old tip
			if(ppplayer.nPlayFileType == 6)
			{
				var pos = $("playslider").valueForPos(event.offsetX);
				if(pos < $("playslider").progressValue && pos >= 0)
				{
					var dt = new Date(ppplayer.dtTimeBeg.getTime());
					dt.setSeconds(dt.getSeconds()+pos);
					var h = dt.getHours();
					var m = dt.getMinutes();
					var s = dt.getSeconds();
					//------------------------
					$("playslider").tooltip = "定位到： " + [aa(h), aa(m), aa(s)].join(':');
					lastoffsetx = event.offsetX;
				}
				else
				{
					$("playslider").tooltip = "";
				}
			}
			else
			{
				var pos = $("playslider").valueForPos(event.offsetX);
				$("playslider").tooltip = "定位到： "+time_format(pos);
				lastoffsetx = event.offsetX;
				if (ppplayer.dragging)
				{
					var lDuration = $("playslider").max;

					//time info
					var strTimeCurrent = time_format(pos);
					var strTimeDuration = time_format(lDuration);
					var strTime = strTimeCurrent + "/" + strTimeDuration;

					$("playtimelabel").value = strTime;
				}
			}
			//-------------------Undisable child ctrl
			if(g_IsChilddisabled && (ppplayer.nPlayFileType == 5 || ppplayer.nPlayFileType == 6))
			{
				var Duration = (ppplayer.nPlayFileType == 6)?1800:ppplayer.get_Duration();
				var pos = (Duration<=0)?0:$("playslider").width*$("playslider").value/Duration;	
				var wt;
				if (ppplayer.nRunMode == 0)		wt = 9;
				else if(ppplayer.nRunMode == 1)	wt = 13;
				if(event.offsetX < pos-wt || event.offsetX > pos+wt)
				{
					var child = null;
					child = $("playslider").firstChild;
					while (child != null)
					{
						child.disabled = false;
						child = child.nextSibling;
					}
					g_IsChilddisabled = false;
				}
			}
			if(ppplayer.nPlayFileType == 5)//head tail tag
			{
				//--------------------------20px	----可见且没有消失线程
				if(g_bIsHeadBegShow)
				{
					var dot = $("skipheadbeg");
					if(event.offsetX>dot.left-20 && event.offsetX<dot.left+dot.width+20)
						dot.visible = true;
					else if(dot.visible == true && g_HeadBegHideTM == 0)
						g_HeadBegHideTM = window.setTimeout("$('skipheadbeg').visible = false; g_HeadBegHideTM = 0;", 2*1000);
				}
				if(g_bIsHeadEndShow)
				{
					var dot = $("skipheadend");
					if(event.offsetX>dot.left-20 && event.offsetX<dot.left+dot.width+20)
						dot.visible = true;
					else if(dot.visible == true && g_HeadEndHideTM == 0)
						g_HeadEndHideTM = window.setTimeout("$('skipheadend').visible = false; g_HeadEndHideTM = 0;", 2*1000);
				}
				if(g_bIsTailBegShow)
				{
					var dot = $("skiptailbeg");
					if(event.offsetX>dot.left-20 && event.offsetX<dot.left+dot.width+20)
						dot.visible = true;
					else if(dot.visible == true && g_TailBegHideTM == 0)
						g_TailBegHideTM = window.setTimeout("$('skiptailbeg').visible = false; g_TailBegHideTM = 0;", 2*1000);
				}	
				if(g_bIsTailEndShow)
				{
					var dot = $("skiptailend");
					if(event.offsetX>dot.left-20 && event.offsetX<dot.left+dot.width+20)
						dot.visible = true;
					else if(dot.visible == true && g_TailEndHideTM == 0)
						g_TailEndHideTM = window.setTimeout("$('skiptailend').visible = false; g_TailEndHideTM = 0;", 2*1000);
				}
				//--------------------------
			}
		}
	}
}

function OnSliderMouseOut(event)
{
	if (ppplayer)
	{
		if(ppplayer.nPlayFileType == 5)
		{
			if(g_bIsHeadBegShow)
				if($("skipheadbeg").visible == true && g_HeadBegHideTM == 0)//可见且没有消失线程
					g_HeadBegHideTM = window.setTimeout("$('skipheadbeg').visible = false; g_HeadBegHideTM = 0;", 2*1000);
			if(g_bIsHeadEndShow)
				if($("skipheadend").visible == true && g_HeadEndHideTM == 0)
					g_HeadEndHideTM = window.setTimeout("$('skipheadend').visible = false; g_HeadEndHideTM = 0;", 2*1000);
			if(g_bIsTailBegShow)
				if($("skiptailbeg").visible == true && g_TailBegHideTM == 0)
					g_TailBegHideTM = window.setTimeout("$('skiptailbeg').visible = false; g_TailBegHideTM = 0;", 2*1000);
			if(g_bIsTailEndShow)
				if($("skiptailend").visible == true && g_TailEndHideTM == 0)
					g_TailEndHideTM = window.setTimeout("$('skiptailend').visible = false; g_TailEndHideTM = 0;", 2*1000);
		}
	}
}

function SetContentDot(dotInfo)
{
	if(ppplayer.nPlayFileType == 5 && !ppplayer.bIsContentDotInited)
	{
		var count = 0;
		if(dotInfo)				
		{
			count = dotInfo.itemCount;
		}
		if(count==0)		return ;
		//---------------------------加点
		while(count>ppplayer.nCurNumDot)
		{
			ppplayer.arrDotBtn[ppplayer.nCurNumDot] = document.createElement("<button left='-20' top='1' width='11' height='10' image='mark_content_NM.png' hoverImage='mark_content_HV.png' downImage='mark_content_HV.png' disabledImage='mark_content_NM.png' onclick='OnDotBtnCommon(this);' cursor='hand' visible='false' onmousemove='MouseDotHover(this);' onmouseout='MouseDotOut();'/>");
			$("playslider").insertBefore(ppplayer.arrDotBtn[ppplayer.nCurNumDot], $("playslider").firstChild);
			++ppplayer.nCurNumDot;
		}
		//---------------------------记录打点时间 arrDotTime
		for(var i=0 ; i<ppplayer.arrDotBtn.length ; ++i)
		{
			if(i<count)
			{
				var dotnode = dotInfo.Item(i);
				ppplayer.arrDotTime[i] = dotnode.dotPos;
				ppplayer.arrDotDS[i] = dotnode.dotDesc;
				if(ppplayer.arrDotTime[i]<=0 || ppplayer.arrDotDS[i]=="")
					ppplayer.arrDotBtn[i].visible = false;
				else
				{
					ppplayer.arrDotBtn[i].visible = true;
					var pos;
					if(ppplayer.bAlreadyPlaying)	pos = ValueToPos(ppplayer.arrDotTime[i]);
					else pos = -100;
					ppplayer.arrDotBtn[i].moveTo(pos-ppplayer.arrDotBtn[i].width/2, ppplayer.arrDotBtn[i].top);
				}
			}
			else
			{
				ppplayer.arrDotTime[i] = -1;
				ppplayer.arrDotBtn[i].visible = false;
			}
		}
		if(ppplayer.nCurNumDot>0)
		{
			ppplayer.bIsContentDotInited = true;
			OnSliderSize();
		}
	}
}

//-----------------------------------------
/*
function testDot()
{
	var count = 10;
	while(count>ppplayer.nCurNumDot)
	{
		ppplayer.arrDotBtn[ppplayer.nCurNumDot] = document.createElement("<button left='-20' top='1' width='11' height='10' image='mark_content_NM.png' hoverImage='mark_content_HV.png' downImage='mark_content_HV.png' disabledImage='mark_content_NM.png' onclick='OnDotBtnCommon(this);' cursor='hand' visible='false' onmousemove='MouseDotHover(this);' onmouseout='MouseDotOut();'/>");
		$("playslider").insertBefore(ppplayer.arrDotBtn[ppplayer.nCurNumDot], $("playslider").firstChild);
		++ppplayer.nCurNumDot;
	}	
	for(var i=0 ; i<ppplayer.arrDotBtn.length ; ++i)
	{
		if(i<count)
		{
			ppplayer.arrDotTime[i] = 200*(i+1);
			ppplayer.arrDotDS[i] = "zxcvbnm123456789";
			ppplayer.arrDotBtn[i].visible = true;
			ppplayer.arrDotBtn[i].moveTo(ValueToPos(ppplayer.arrDotTime[i])-ppplayer.arrDotBtn[i].width/2, ppplayer.arrDotBtn[i].top);
		}
		else
		{
			ppplayer.arrDotTime[i] = -1;
			ppplayer.arrDotBtn[i].visible = false;
		}
	}
	ppplayer.bIsContentDotInited = true;
	if(!ppplayer.bIsSkipDotInited)
	{
		ppplayer.m_tmSkipHead=295;
		ppplayer.m_tmSkipTail=1610;
		ppplayer.bIsSkipDotInited = true;
	}
	OnSliderSize();
}*/

function InitSliderAndDot()
{
	if(!ppplayer.bIsAlreadyInit && ppplayer.bCanPlay && ppplayer.bAlreadyPlaying)
	{
		ppplayer.bIsAlreadyInit = true;
		if ( ppplayer.nPlayFileType == 5 ) //点播
		{
			$("playslider").visible = true;$("playtimelabel").visible = true;
			$("playtimebeg").visible = false;$("playtimeend").visible = false;
			$("curplaytagbtn").visible = false;
			//------------------------------ time type
			var lDuration = ppplayer.get_Duration();
			if(lDuration > 3600)	ppplayer.nTimeType = true;
			else	ppplayer.nTimeType = false;
			//------------------------------
			$("playslider").moveSizeTo(5, $("playslider").top, $("playctrl").right-(ppplayer.nTimeType?95:70), $("playslider").height);
			//------------------------------ add head tail tag(SkipDot)
			if(!ppplayer.bIsSkipDotInited)
			{
				var ppp = Components.GetObject2("PPP");
				if(ppp)
				{
					ppplayer.m_tmSkipHeadbeg = 0;
					ppplayer.m_tmSkipHeadend = 0;
					if(ppp.VideoHeadBeg)	ppplayer.m_tmSkipHeadbeg=ppp.VideoHeadBeg.dotPos;
					if(ppp.VideoHeadEnd)	ppplayer.m_tmSkipHeadend=ppp.VideoHeadEnd.dotPos;
					ppplayer.m_tmSkipTailbeg = 0;
					ppplayer.m_tmSkipTailend = 0;
					if(ppp.VideoTailBeg)	ppplayer.m_tmSkipTailbeg=ppp.VideoTailBeg.dotPos;
					if(ppp.VideoTailEnd)	ppplayer.m_tmSkipTailend=ppp.VideoTailEnd.dotPos;
				}
				ppplayer.bIsSkipDotInited = true;
			}
			//------------------------------ show head tail tag
			$("skipheadbeg").visible = false;
			$("skipheadend").visible = false;
			$("skiptailbeg").visible = false;
			$("skiptailend").visible = false;
			if(ppplayer.m_tmSkipHeadbeg > 0 && ppplayer.m_tmSkipHeadbeg < lDuration)
			{
				g_bIsHeadBegShow = true;
				$("skipheadbeg").moveTo(ValueToPos(ppplayer.m_tmSkipHeadbeg)-$("skipheadbeg").width/2, $("skipheadbeg").top);
			}
			else	g_bIsHeadBegShow = false;
			if(ppplayer.m_tmSkipHeadend > 0 && ppplayer.m_tmSkipHeadend < lDuration)
			{
				g_bIsHeadEndShow = true;
				$("skipheadend").moveTo(ValueToPos(ppplayer.m_tmSkipHeadend)-$("skipheadend").width/2, $("skipheadend").top);
			}
			else	g_bIsHeadEndShow = false;
			if(ppplayer.m_tmSkipTailbeg > 0 && ppplayer.m_tmSkipTailbeg < lDuration)
			{
				g_bIsTailBegShow = true;
				$("skiptailbeg").moveTo(ValueToPos(ppplayer.m_tmSkipTailbeg)-$("skiptailbeg").width/2, $("skiptailbeg").top);
			}
			else	g_bIsTailBegShow = false;
			if(ppplayer.m_tmSkipTailend > 0 && ppplayer.m_tmSkipTailend < lDuration)	
			{
				g_bIsTailEndShow = true;
				$("skiptailend").moveTo(ValueToPos(ppplayer.m_tmSkipTailend)-$("skiptailend").width/2, $("skiptailend").top);
			}
			else	g_bIsTailEndShow = false;
			//------------------------------ 
			OnSliderSize();
			window.updateInterval = window.setInterval("OnTimer();", 1000);
			OnTimer();
		}
		else if(ppplayer.nPlayFileType == 2)//本地
		{
			$("playslider").visible = true;$("playtimelabel").visible = true;
			$("playtimebeg").visible = false;$("playtimeend").visible = false;
			var child = $("playslider").firstChild;
			while (child != null)
			{
				child.visible = false;
				child = child.nextSibling;
			}
			//------------------------------ time type
			var lDuration = ppplayer.get_Duration();
			if(lDuration > 3600)	ppplayer.nTimeType = true;
			else	ppplayer.nTimeType = false;
			//------------------------------
			$("playslider").moveSizeTo(5, $("playslider").top, $("playctrl").right-(ppplayer.nTimeType?95:70), $("playslider").height);			

			window.updateInterval = window.setInterval("OnTimer();", 1000);
			OnTimer();
		}
		else if( ppplayer.nPlayFileType == 6 )//如果是二代直播
		{
			$("playslider").visible = true;$("playtimelabel").visible = false;
			$("playtimebeg").visible = true;$("playtimeend").visible = true;
			$("playslider").moveSizeTo(35, $("playslider").top, $("playctrl").right-70, $("playslider").height);
			var child = $("playslider").firstChild;
			while (child != null)
			{
				child.visible = false;
				child = child.nextSibling;
			}
			$("curplaytagbtn").visible = true;
			window.updateInterval = window.setInterval("OnTimer();", 1000);
			OnTimer();
		}
		else if( ppplayer.nPlayFileType == 1 )//一代直播
		{
			$("playslider").visible = false;$("playtimelabel").visible = false;
			$("playtimebeg").visible = false;$("playtimeend").visible = false;
			var child = $("playslider").firstChild;
			while (child != null)
			{
				child.visible = false;
				child = child.nextSibling;
			}
		}
	}
}

function OnWinSize()
{
	if(ppplayer)
	{
		if( ppplayer.nPlayFileType == 6 )
			$("playslider").moveSizeTo(35, $("playslider").top, $("playctrl").right-70, $("playslider").height);
		else if( ppplayer.nPlayFileType != 1 )
			$("playslider").moveSizeTo(5, $("playslider").top, $("playctrl").right-(ppplayer.nTimeType?95:70), $("playslider").height);
	}
}

function OnSliderSize()
{
	if(ppplayer && ppplayer.nPlayFileType == 5)
	{
		var lDuration = ppplayer.get_Duration();
		var headbegcenter = 0;	
		var headendcenter = 0;
		if(ppplayer.m_tmSkipHeadbeg > 0 && ppplayer.m_tmSkipHeadbeg < lDuration)
		{
			headbegcenter = ValueToPos(ppplayer.m_tmSkipHeadbeg)-$("skipheadbeg").width/2;
			$("skipheadbeg").moveTo(headbegcenter, $("skipheadbeg").top);
		}
		if(g_bIsHeadEndShow)
		{
			headendcenter = ValueToPos(ppplayer.m_tmSkipHeadend)-$("skipheadend").width/2;
			$("skipheadend").moveTo(headendcenter, $("skipheadend").top);
		}
		if(headbegcenter && headendcenter && Math.abs(headbegcenter-headendcenter) < $("skipheadbeg").width)
		{
			g_bIsHeadBegShow = false;
			$("skipheadbeg").visible = false;
		}
		else if(!g_bIsHeadBegShow && headbegcenter)	//不显示 && 位置合法
			g_bIsHeadBegShow = true;

		var tailbegcenter = 0;
		var tailendcenter = 0;
		if(g_bIsTailBegShow)
		{
			tailbegcenter = ValueToPos(ppplayer.m_tmSkipTailbeg)-$("skiptailbeg").width/2;
			$("skiptailbeg").moveTo(tailbegcenter, $("skiptailbeg").top);
		}
		if(ppplayer.m_tmSkipTailend > 0 && ppplayer.m_tmSkipTailend < lDuration)
		{
			tailendcenter = ValueToPos(ppplayer.m_tmSkipTailend)-$("skiptailend").width/2;
			$("skiptailend").moveTo(tailendcenter, $("skiptailend").top);
		}
		if(tailbegcenter && tailendcenter && Math.abs(tailbegcenter-tailendcenter) < $("skiptailbeg").width)
		{
			g_bIsTailEndShow = false;
			$("skiptailend").visible = false;
		}
		else if(!g_bIsTailEndShow && tailendcenter)	//不显示 && 位置合法
			g_bIsTailEndShow = true;

		if(ppplayer.bIsContentDotInited && ppplayer.nCurNumDot > 0)
		{
			var lastPos = -10000;
			for(var i=0 ; i<ppplayer.nCurNumDot ; ++i)
			{
				if(ppplayer.arrDotTime[i]>0)
				{
					var newPos=0;
					if(lastPos != -10000)
					{
						newPos = parseInt(ValueToPos(ppplayer.arrDotTime[i])-ppplayer.arrDotBtn[i].width/2);
						if(Math.abs(newPos-lastPos) > ppplayer.arrDotBtn[i].width)
						{
							ppplayer.arrDotBtn[i].moveTo(newPos, ppplayer.arrDotBtn[i].top);
							ppplayer.arrDotBtn[i].visible = true;
							lastPos = newPos;
						}
						else
							ppplayer.arrDotBtn[i].visible = false;
					}
					else
					{
						newPos = parseInt(ValueToPos(ppplayer.arrDotTime[i])-ppplayer.arrDotBtn[i].width/2);
						ppplayer.arrDotBtn[i].moveTo(newPos, ppplayer.arrDotBtn[i].top);
						ppplayer.arrDotBtn[i].visible = true;
						lastPos = newPos;
					}
					//if conflict to head tail tag
					if(ppplayer.arrDotBtn[i].visible && headbegcenter && g_bIsHeadBegShow)
					{
						if(Math.abs(newPos-headbegcenter) < ppplayer.arrDotBtn[i].width)
							ppplayer.arrDotBtn[i].visible = false;
						else
							ppplayer.arrDotBtn[i].visible = true;
					}
					if(ppplayer.arrDotBtn[i].visible && headendcenter)
					{
						if(Math.abs(newPos-headendcenter) < ppplayer.arrDotBtn[i].width)
							ppplayer.arrDotBtn[i].visible = false;
						else
							ppplayer.arrDotBtn[i].visible = true;
					}
					if(ppplayer.arrDotBtn[i].visible && tailbegcenter)
					{
						if(Math.abs(newPos-tailbegcenter) < ppplayer.arrDotBtn[i].width)
							ppplayer.arrDotBtn[i].visible = false;
						else
							ppplayer.arrDotBtn[i].visible = true;
					}
					if(ppplayer.arrDotBtn[i].visible && tailendcenter && g_bIsTailEndShow)
					{
						if(Math.abs(newPos-tailendcenter) < ppplayer.arrDotBtn[i].width)
							ppplayer.arrDotBtn[i].visible = false;
						else
							ppplayer.arrDotBtn[i].visible = true;
					}
				}
			}
		}
	}
	if(ppplayer.nPlayFileType == 6)
	{
		$("curplaytagbtn").left = $("playslider").progressValue * $("playslider").width/(1800.0)-$("curplaytagbtn").width/2.0;
	}
	if(window.balloons == 0)	window.balloons = new Balloons(window);
	window.balloons.Close("education\\DotTip.xml");
}

function OnVolumeSliderDragBegin(pos)
{
	if (ppplayer)
	{
		var ewa = ppplayer.get_EWA();
		if(ewa)
		{
			ppplayer.beforeDragVolume = ewa.Volume;
		}
	}
}
function OnVolumeSliderDragEnd(pos)
{
	if (ppplayer)
	{
		//ppplayer.afterDragVolume = pos;
		var ewa = ppplayer.get_EWA();
		if(ewa && pos==0)
		{
			ewa.Mute=true;
			ewa.Volume=ppplayer.beforeDragVolume;
		}
	}
}

function OnSliderChange(pos)
{
/*	if (ppplayer && ppplayer.nPlayFileType == 6)
		if(pos > $("playslider").progressValue)
			ppplayer.value = $("playslider").progressValue;*/
}

function OnDragTimer()
{
	if ($("playslider").dragging)
	{
		if (ppplayer)
		{
			ppplayer.dragging = true;
			var pos = $("playslider").value;
			//update pos
			if(ppplayer.nPlayFileType == 6 && window.lastdragpos != pos)
			{
				if(pos>$("playslider").progressValue)
					pos = $("playslider").progressValue;
				var dt = new Date(ppplayer.dtTimeBeg.getTime());
				dt.setSeconds(dt.getSeconds()+pos); 
				ppplayer.put_CurrentPosition(dt.getTime()/1000);
				window.lastdragpos = pos;
			}
			else if(window.lastdragpos != pos)
			{	
				ppplayer.put_CurrentPosition(pos);
				window.lastdragpos = pos;
			}
		}
	}
}

function OnPlaySliderDragBegin(pos)
{
	//start timer
	window.lastdragpos = 0;
	window.updateDragInterval = window.setInterval("OnDragTimer();", 500);
	//
	if (ppplayer)
		ppplayer.dragging = true;
	//拖动静音
	if (ppplayer)
	{
		var ewa = ppplayer.get_EWA();
		if (!ppplayer.bMute)
			if (ewa)
				ewa.Mute = true;
	}
}

function OnPlaySliderDragEnd(pos)
{
	if (ppplayer)
	{
		//clear timer
		window.clearInterval(window.updateDragInterval);
		window.updateDragInterval = 0;
		//live 2
		if(ppplayer.nPlayFileType == 6)
		{
			if(pos > $("playslider").progressValue)
				pos = $("playslider").progressValue;
			//update pos
			var dt = new Date(ppplayer.dtTimeBeg.getTime());
			dt.setSeconds(dt.getSeconds()+pos); 
			ppplayer.put_CurrentPosition(dt.getTime()/1000);
		}
		else
		{
			//update label
			if (ppplayer.dragging)
			{
				var lDuration = $("playslider").max;
				var strTimeCurrent = time_format(pos);
				var strTimeDuration = time_format(lDuration);
				var strTime = strTimeCurrent + "/" + strTimeDuration;
				$("playtimelabel").value = strTime;
			}
			if (window.lastdragpos != pos || pos == 0)
			{
				ppplayer.put_CurrentPosition(pos);
			}
		}
		//update pos
		ppplayer.dragging = false;	
		//恢复静音
		if (!ppplayer.bMute)
		{
			var ewa = ppplayer.get_EWA();
			if (ewa)
			{
				ppplayer.bNoVolumeTips = true;
				ewa.Mute = false;
				ppplayer.bNoVolumeTips = false;
			}
		}
		if(ppplayer.nPlayFileType == 5)
		{
			var mframe = Components.GetObject2("mframe");
			if (mframe)
			{
				mframe.CloseStateTip();
			}
		}
	}
}

function OnStateInfoSizeCommon()
{
	if (window.innerwidth < 400)
	{
		$("stateinfo").visible = false;
		$("stateinfogallop").visible = false;
		if (window.stateinfoInterval)
		{
			window.clearInterval(window.stateinfoInterval);
			window.stateinfoInterval=0;
		}
	}
	else
	{
		$("stateinfo").visible = true;
		if (!window.stateinfoInterval)
		{
			window.stateinfoInterval = window.setInterval("OnStateInfoTimer();", 3000);
			OnStateInfoTimer();
		}
	}
}

function OnSpeedInfoOver()
{
	speedinfownd = null;
	speedinfownd = window.open("playcontrol\\P2PDetail.xml","","owner=1;hidden=1");
	if (ppplayer && ppplayer.nPlayFileType == 5)  //点播
	{
		speedinfownd.ShowSpeedInfoWindow(this.offsetLeft+window.screenLeft-120,this.offsetTop+window.screenTop-48,128,48,false);
	}
	else if (ppplayer && ppplayer.nPlayFileType == 1 )  //直播	
	{
		speedinfownd.ShowSpeedInfoWindow(this.offsetLeft+window.screenLeft-100,this.offsetTop+window.screenTop-84,105,84,true);
	}
	else if (ppplayer && ppplayer.nPlayFileType == 6)  //二代直播
	{
		speedinfownd.ShowSpeedInfoWindow(this.offsetLeft+window.screenLeft-100,this.offsetTop+window.screenTop-66,105,66,true);
	}

}

function OnSpeedInfoOut()
{
	if (speedinfownd)
	{
		speedinfownd.close();
	}
}

function OnTimer()
{
	if (ppplayer)
	{
		if(ppplayer.nPlayFileType == 6)
		{
			$("playslider").max = 1800;

			var dtCurPlay = new Date(ppplayer.get_CurrentPosition()*1000);
			var h = dtCurPlay.getHours();
			var m = dtCurPlay.getMinutes();
			var s = dtCurPlay.getSeconds();
	
			//buffering
			if(dtCurPlay.getFullYear() == "1970")	return;

			if(m<30 && (ppplayer.bCurPeriod||g_bIsFirstlive2))
			{
				$("playtimebeg").value = [aa(h), aa(0)].join(':');
				$("playtimeend").value = [aa(h), aa(30)].join(':');
				ppplayer.dtTimeBeg = dtCurPlay;
				ppplayer.dtTimeBeg.setMinutes(0,0,0);

				g_bIsFirstlive2 = false;
				ppplayer.bCurPeriod = false;
			}
			else if(m>=30 && (!ppplayer.bCurPeriod||g_bIsFirstlive2))
			{
				$("playtimebeg").value = [aa(h), aa(30)].join(':');
				$("playtimeend").value = [aa((h+1)%24), aa(0)].join(':');
				ppplayer.dtTimeBeg = dtCurPlay;
				ppplayer.dtTimeBeg.setMinutes(30,0,0);
	
				g_bIsFirstlive2 = false;
				ppplayer.bCurPeriod = true;
			}

			//progressValue
			var ppp = ppplayer.get_PPP();
			if (ppp)
			{
				//当前播放tag
				var dtCur = new Date(ppp.EndData*1000);
				if((dtCur-ppplayer.dtTimeBeg) > 1800000)
				{
					$("playslider").progressValue = 1800;
					$("curplaytagbtn").visible = false;
				}
				else
				{
					var tmp = dtCur.getSeconds()+(dtCur.getMinutes()-(ppplayer.bCurPeriod?30:0))*60;
					$("playslider").progressValue = (tmp>0)?tmp:0;
					//位置合法性
					var right = ValueToPos($("playslider").progressValue)+$("curplaytagbtn").width/2.0;
					if(right>$("playslider").width || right-$("curplaytagbtn").width<0)	
						$("curplaytagbtn").visible = false;
					else
						$("curplaytagbtn").visible = true;
					$("curplaytagbtn").left = tmp * $("playslider").width/(1800.0)-$("curplaytagbtn").width/2.0;
				}
			}			
			//progress slider
			if (!ppplayer.dragging)
				window.SetPlaySliderValue(s+(m-(ppplayer.bCurPeriod?30:0))*60);
			//位置校正
			if($("playslider").value > $("playslider").progressValue)
				window.SetPlaySliderValue($("playslider").progressValue);
		}
		else
		{
			var lCurrentPosition = ppplayer.get_CurrentPosition();
			var lDuration = ppplayer.get_Duration();

			$("playslider").max = lDuration;

			//time info
			var strTimeCurrent = time_format(lCurrentPosition);
			var strTimeDuration = time_format(lDuration);
			var strTime = strTimeCurrent + "/" + strTimeDuration;

			if (!ppplayer.dragging)
			{
				$("playtimelabel").value = strTime;
			}
			//白条
			if (ppplayer.nPlayFileType == 5)
			{
				var ppp = ppplayer.get_PPP();
				if (ppp)
				{
					var TotalBytes = ppp.TotalBytes;
					var EndData = ppp.EndData;
					$("playslider").progressValue = (TotalBytes==0)?0:EndData * lDuration /TotalBytes;
				}
			}
			//statespeedinfo
			UpdateStateSpeedInfo(-1);
			if (ppplayer.dragging)
			{
				return;
			}
			//progress slider
			window.SetPlaySliderValue(lCurrentPosition);
		}
	}
}
function OnStateInfoTimer()
{
	if (ppplayer)
	{
		var ppp = ppplayer.get_PPP();
		if(ppp)
		{
			var playerState = ppp.State;
			if(playerState!==0) //!=buffering
			{
				window.clearInterval(window.stateinfoInterval);
				window.stateinfoInterval=0;
				if(hasGallop())
				{
					var passport = Components.GetObject2("@pplive.com/passport;1");
					var isVipUser = false;
					if(passport)
					{
						isVipUser = passport.IsVipUser;
					}
					if(!isVipUser)
					{
						$("stateinfolabel").value="";
						if(window.innerwidth >= 400)$("stateinfogallop").visible = true;
						$("stateinfolabel").visible = false;
						return;
					}
				}
				$("stateinfogallop").visible=false;
				if(playerState==2)//play
					window.stateinfotxt = "正在播放:" + ppp.ChannelName;
				else if(playerState==3)//pause
					window.stateinfotxt = "已暂停";
				else
					window.stateinfotxt = "欢迎使用PPTV";

			}
			else
			{
				window.stateinfotxt = "正在缓冲,已加载:" + ppp.BufferingProgress+ "% 下载速度:"+ ppp.DownloadSpeed+"KB/s";
			}
		}
	}
	if (ppplayer.bErrorStateInfo)
	{
		window.stateinfotxt = ppplayer.StateInfoText;
	}

	$("stateinfolabel").value = window.stateinfotxt;
	$("stateinfogallop").visible = false;
	$("stateinfolabel").visible = true;

	if (ppplayer)
	{
		ppplayer.StateInfoText = window.stateinfotxt;
	}
}
function hasGallop()
{
	var gallopCount = $("stateinfogallop").wrappedObject.gallopCount;
	if(gallopCount>0)return true;
	else return false;
}
function SetStateInfoText(state)
{
	switch(state)
	{
		case 0://buffering
		case 1://ready
		{
			var txt = "正在缓冲";
			if (ppplayer)
			{
				var ppp = ppplayer.get_PPP();
				if(ppp)txt  = "正在播放:" + ppp.ChannelName;
			}
			window.stateinfotxt = txt;
		}
			break;
		case 2://play
		{
			var txt = "正在播放";
			if (ppplayer)
			{
				var ppp = ppplayer.get_PPP();
				if(ppp) txt  = "正在播放:" + ppp.ChannelName;
			}
			window.stateinfotxt = txt;
		}
			break;
		case 3://pause
			window.stateinfotxt = "已暂停";
			break;
		case 4://stop
			window.stateinfotxt = "已停止";
			break;
		case 5://media end
			window.stateinfotxt = "播放结束";
			break;
		default:
			window.stateinfotxt = "欢迎使用PPTV";
			break;
	}
	if (ppplayer.bErrorStateInfo)
	{
		window.stateinfotxt = ppplayer.StateInfoText;
	}
	$("stateinfogallop").visible = false;
	$("stateinfolabel").value = window.stateinfotxt;
	$("stateinfolabel").visible = true;
	if (ppplayer)
	{
		ppplayer.StateInfoText = window.stateinfotxt;
	}
	if(window.stateinfoInterval)
	{
		window.clearInterval(window.stateinfoInterval);
		window.stateinfoInterval=0;
	}
	if (!ppplayer.bErrorStateInfo)
	{
		if(state==0)
			window.stateinfoInterval = window.setInterval("OnStateInfoTimer();", 1000);
		else
			window.stateinfoInterval = window.setInterval("OnStateInfoTimer();", 3000);
	}
}

function SetStateInfoText2(newVal)
{
	switch(newVal)
	{
	case 1:
		{
			window.stateinfotxt = "开始播放";
		}
		break;
	case 2:
		{
			window.stateinfotxt = "播放结束";
		}
		break;
	case 3:
		{
			window.stateinfotxt = "开始拖动";
		}
		break;
	case 4:
		{
			window.stateinfotxt = "拖动结束";
		}
		break;
	case 5:
		{
			window.stateinfotxt = "正在获取频道信息...";
		}
		break;
	case 6:
		{
			window.stateinfotxt = "正在获取频道信息...";
		}
		break;
	case 7:
		{
			window.stateinfotxt = "获取频道信息结束";
		}
		break;
	case 8:
	case 9:
		{
		}
		break;
	case 10: //正在获取媒体信息...
	case 11:
	case 12:
	case 13:
	case 14:
	case 34:
		{
			window.stateinfotxt = "正在获取媒体信息...";//Drag请求进行中
		}
		break;
	case 15:
	case 16:
	case 17:
	case 18:
		{
		}
		break;
	case 19:
		{
		}
		break;
	case 20:
		{
			window.stateinfotxt = "已暂停";
		}
		break;
	case 21:
		{
			window.stateinfotxt = "停止播放";
		}
		break;
	case 22:
		{
			window.stateinfotxt = "媒体结束";
		}
		break;
	case 24:
	case 25:
		{
			if (newVal == 24)
				window.stateinfotxt = "获取媒体信息失败!";
			else
				window.stateinfotxt = "获取媒体信息失败!!";
		}
		break;
	case 26:
		{
			window.stateinfotxt = "请登录VIP账号";
		}
		break;
	case 32:
		{
			window.stateinfotxt = "播放失败，请尝试重新播放...";
		}
		break;
	case 27:
	case 23:
	case 28:
	case 29:
	case 30:
	case 31:
	case 33:
		{
			window.stateinfotxt = "获取频道信息失败!";
		}
		break;
	}
	if ((newVal >=5 && newVal <=7) || (newVal >= 23 && newVal<=35))
	{
		if(window.stateinfoInterval)
		{
			window.clearInterval(window.stateinfoInterval);
			window.stateinfoInterval=0;
		}
		if (ppplayer)
		{
			ppplayer.bErrorStateInfo = true;
		}
	}
	else
	{
		if (ppplayer && ppplayer.bErrorStateInfo)
		{
			ppplayer.bErrorStateInfo = false;
			if(!window.stateinfoInterval)
			{
				window.stateinfoInterval = window.setInterval("OnStateInfoTimer();", 1000);
			}
		}
	}

    if (ppplayer)
	{
        ppplayer.nPlayState = newVal;
    }
	$("stateinfogallop").visible = false;
	$("stateinfolabel").value = window.stateinfotxt;
	$("stateinfolabel").visible = true;
	if (ppplayer)
	{
		ppplayer.StateInfoText = window.stateinfotxt;
	}
	/*
	if(window.stateinfoInterval)
	{
		window.clearInterval(window.stateinfoInterval);
		window.stateinfoInterval=0;
	}
	window.stateinfoInterval = window.setInterval("OnStateInfoTimer();", 3000);
	*/
}
window.SetTaskbarProgress=function(aCompleted,aTotal)
{
	var mainwindow = Components.GetObject2("@pplive.com/ui/mainwindow;1");
	if(mainwindow && mainwindow.taskbar)
	{
		if(aCompleted>0 && aCompleted<=aTotal)
		{
			mainwindow.taskbar.SetProgressValue(aCompleted,aTotal);
		}
		else
		{
			mainwindow.taskbar.SetProgressState(0);
		}
	}
}
window.SetPlaySliderValue=function(newVal)
{
	var pos = newVal;
	try{$("playslider").value = pos;}catch(e){}
	try
	{
		if(ppplayer)
		{
			var duration = ppplayer.get_Duration();
			window.SetTaskbarProgress(pos,duration);
		}
	}
	catch (e)
	{
	}
}
//event
window.OnStateChange = function(newVal)
{
	InitSliderAndDot();
	SetStateInfoText(newVal);
	if (newVal == 4 || newVal == 5 || newVal == -2) //stop || media end || initialize
	{
		if(newVal == 4 || newVal == 5)
		{
			//--------------------- remove Child
			for(var i=0 ; i != ppplayer.nCurNumDot ; ++i)
				$("playslider").removeChild(ppplayer.arrDotBtn[i]);
			ppplayer.arrDotBtn = [];
			ppplayer.nCurNumDot = 0;
			//--------------------- 
			ppplayer.bIsContentDotInited = false;
			ppplayer.bIsSkipDotInited = false;
			ppplayer.bIsAlreadyInit = false;
			ppplayer.bIsAdFinished = false;
			g_bIsFirstlive2 = true;
			ppplayer.nTimeType = false;
			$("playtimelabel").value = "00:00/00:00";
			//--------------------- release tip
			if(window.balloons!=0)
				window.balloons.Clear();
			window.balloons = 0;
			ppplayer.nHoverIndex = S_NOHOVER;
			ppplayer.nOldHover = S_NOHOVER;
		}
		if (ppplayer)
		{
			if(ppplayer.zwNotShowLowBitrateSwitch==false || ppplayer.zwNotShowHighBitrateSwitch==false ||ppplayer.zwNotShowPause2Buffer==false)
			{
				ppplayer.zwNotShowBalloon=false;
			}
			ppplayer.zwLowSpeedCount=0;
			ppplayer.zwHighSpeedCount=0;
			ppplayer.zwCalcLowSpeed=false;
		}
		//--------------------- hide ctrl
		$("curplaytagbtn").visible = false;
		$("skipheadbeg").visible = false;
		$("skipheadend").visible = false;
		$("skiptailbeg").visible = false;
		$("skiptailend").visible = false;

		$("playtimebeg").visible = false;
		$("playtimeend").visible = false;
		$("playslider").visible = false;
		$("playslider").moveSizeTo(5, $("playslider").top, $("playctrl").right-(ppplayer.nTimeType?95:70), $("playslider").height);
		$("playtimelabel").visible = false;

		$("playbtn").visible = true;
		$("pausebtn").visible = false;
		$("stopbtn").disabled = true;
	
		$("playslider").progressValue = 0;
		window.SetPlaySliderValue(0);

		if(window.updateInterval)	window.clearInterval(window.updateInterval);
		window.updateInterval = 0;
		UpdateStateSpeedInfo(0);
	}
	else 
	{
		if(newVal == 2)	//play
		{
			if (ppplayer)ppplayer.zwCalcLowSpeed=true;
		}
		$("stopbtn").disabled = false;
		if (newVal == 2 || (newVal == 0 && ppplayer.bCanPlay))  //play || buffering
		{	
			//更新二代直播区段
			if( ppplayer.nPlayFileType == 6 )
				g_bIsFirstlive2 = true;	

			if (!ppplayer.bAlreadyPlaying)
			{
				if(newVal == 2)
				{
					$("playbtn").visible = true;
					$("pausebtn").visible = false;
				}
				$("playslider").disabled = true;
			}
			else if(ppplayer.bIsAdFinished || ppplayer.nPlayFileType != 6)
			{
				if(newVal == 2)
				{
					$("playbtn").visible = false;
					$("pausebtn").visible = true;
				}
				$("playslider").disabled = false;
			}
			if (ppplayer && ppplayer.nPlayFileType != 1 && ppplayer.nPlayFileType != 0 && ppplayer.nPlayFileType != 6)
			{
				$("playslider").visible = true;
				$("playtimelabel").visible = true;
			}
			ShowStateSpeedInfo();
			if (!window.updateInterval && newVal == 2)
			{
				window.updateInterval = window.setInterval("OnTimer();", 1000);
				OnTimer();
			}
			if (newVal == 2)
			{
				if (ppplayer)
				{
					if (ppplayer.nPlayFileType == 2)  //本地文件
					{
						if (!ppplayer.bTidyMode)
						{
							$("shiftbtn").label = "清晰度";
							$("shiftbtn").disabled = true;
						}
						ppplayer.bDisabledInfoBtn = true;
					}
					else
					{
						ppplayer.bDisabledInfoBtn = false;
					}
					if (ppplayer.nRunMode == 1 && !ppplayer.bTidyMode)
					{
						$("btn_infobtn").disabled = ppplayer.bDisabledInfoBtn;
						var ui = Components.GetObject2("@pplive.com/ui/mainwindow;1");
						if(ui)
						{
							ui.$("menu_film_info").disabled = ppplayer.bDisabledInfoBtn;
						}
					}
				}
			}
		}
		else
		{
			$("playbtn").visible = true;
			$("pausebtn").visible = false;
		}
	}
}

window.OnStateChangeEx = function(newVal)
{
	SetStateInfoText2(newVal);

	switch(newVal)
	{
		case 7:		return ;
		break;
		case 36:	//mediaopen
		{
			if(!ppplayer.bIsAlreadyInit && ppplayer.nPlayFileType != 6 && ppplayer.nPlayFileType != 1)
			{
				var lDuration = ppplayer.get_Duration();
				if(lDuration > 3600)
				{
					ppplayer.nTimeType = true;
					$("playtimelabel").value = "00:00:00/"+time_format(lDuration);
				}
				else	
				{
					ppplayer.nTimeType = false;
					$("playtimelabel").value = "00:00/"+time_format(lDuration);
				}
				//------------------------------
				$("playslider").moveSizeTo(5, $("playslider").top, $("playctrl").right-(ppplayer.nTimeType?95:70), $("playslider").height);
			}
		}
		break;
		case 40:	//广告结束
		{
			ppplayer.bIsAdFinished = true;
			if(ppplayer.bAlreadyPlaying && $("playslider").disabled == true)
			{	
				$("playbtn").visible = false;
				$("pausebtn").visible = true;
				$("playslider").disabled = false;
			}
		}
		break;
		case 41:	// live2 -- auto
		{
			window.$("live2msg").value = "由于网络环境的不稳定给您带来的卡顿，请您谅解";
			if(ppplayer)	ppplayer.live2msg=window.$("live2msg").value;
		}
		break;
		case 42:	// live2 -seek
		{
			window.$("live2msg").value = "这里已没有节目内容，我们将为您切到当前直播的时间段";
			if(ppplayer)	ppplayer.live2msg=window.$("live2msg").value;
		}
		break;
		case 43:	// live2 -pause
		{
			window.$("live2msg").value = "您离开的太久，即将为您切到当前直播的时间段，请稍候…";
			if(ppplayer)	ppplayer.live2msg=window.$("live2msg").value;
		}
		break;
		case 45:	//skip headbeg
	//	case 46:	//skip headend
		{
			window.$("live2msg").value = "正在为您跳过片头，请稍候…";
			if(ppplayer)	ppplayer.live2msg = window.$("live2msg").value;
		}
		break;
		case 47:	//skip tailbeg
	//	case 48:	//skip tailend
		{
			window.$("live2msg").value = "正在为您跳过片尾，请稍候…";
			if(ppplayer)	ppplayer.live2msg = window.$("live2msg").value;
		}
		break;
		case 49:	//联播提示
		{
			var ppp = Components.GetObject2("PPP");
			if(ppp)
			{
				if(ppp.NextPlayName != "")
				{
					var NextName = ppp.NextPlayName;
					if(NextName.length > 11)
						NextName = NextName.substring(0, 11) + "...";
					window.$("live2msg").value = "当前为联播状态，即将为您播放" + NextName;
					if(ppplayer)	ppplayer.live2msg = window.$("live2msg").value;
				}
				else
				{
					var mframe = Components.GetObject2("mframe");
					if (mframe)
						mframe.CloseStateTip();
				}
			}
		}
		break;
	}

	if (ppplayer &&  !ppplayer.bTidyMode)
	{
		var linkid = ppplayer.linkid;
		var rt = ppplayer.rt;
		if ((rt & 0x0002) && linkid)   //蓝光频道关联普通高清频道
		{	
			$("shiftbtn").label = "蓝光";
			$("shiftbtn").disabled = false;
		}
		else if ((rt & 0x004) && linkid)   //高清频道关联蓝光频道
		{	
			$("shiftbtn").label = "高清";
			$("shiftbtn").disabled = false;
		}
		else
		{	//根据 vtp 字段，来显示对应的频道类别
			var vtp = ppplayer.vtp;
			if (vtp == 0)
			{
				$("shiftbtn").label = "标清";
			}
			else if (vtp == 1)
			{
				$("shiftbtn").label = "高清";
			}
			else if (vtp == 2)
			{
				$("shiftbtn").label = "蓝光";
			}
			$("shiftbtn").disabled = true;
		}
	}
}

window.OnStateChangeExFull = function(Message,Action,wParam,lParam)
{
	if (Message == "stop")
	{
		if (Action == "mediaend")
		{
			if (wParam == "0")  //没有后续节目
			{
				if (ppplayer && ppplayer.bTidyMode)
				{
					exitTidyMode();
				}
			}
		}
		else if (Action == "stop")
		{
			if (ppplayer && ppplayer.bTidyMode)
			{
				exitTidyMode();
			}
		}
	}
}

window.OnPlayItemChange = function(bCanPrevious,bCanNext)
{
	if (bCanPrevious)
	{
		$("previousbtn").disabled = false;
	}
	else
	{
		$("previousbtn").disabled = true;
	}
	if (bCanNext)
	{
		$("nextbtn").disabled = false;
	}
	else
	{
		$("nextbtn").disabled = true;
	}
}

window.OnFullScreen = function(bFullScreen)
{
}

window.OnSetVolume = function(vol)
{
	var nVol = vol;
	if (vol > 100)
	{
		vol = 100;
	}
	else if (vol < 0)
	{
		vol = 0;
	}
	if(ppplayer)
	{
		var ewa = ppplayer.get_EWA();
		if (ewa && ewa.Mute)
		{
			vol=0;
		}
	}
	if (ppplayer && ppplayer.nRunMode == 0)
	{
		$("volumeslider").value = vol;
		var txt = "音量："+nVol+"%";
		if (nVol >= 100 && nVol<1000)
		{
			var accKey = "↑";
			var mainwindow = Components.GetObject2("@pplive.com/ui/mainwindow;1");
			if(mainwindow) accKey = mainwindow.getHotKeyText("key_volumeInc");
			txt =txt + "  \r\n按 " + accKey + " 继续放大音量";
		}
		if($("volumeslider").lasttooltip!=txt)
		{
			$("volumeslider").tooltip =txt;
			$("volumeslider").lasttooltip =txt;
		}

	}
	else if (ppplayer && ppplayer.nRunMode == 1)
	{
		var volumepopdlg = Components.GetObject2("VolumePopDlg");
		if (volumepopdlg)
		{
			if (volumepopdlg.visible == true)
			{
				volumepopdlg.getElementById("volumeslider").value = vol;
				var txt = "音量："+nVol+"%";
				if (nVol >= 100 && nVol<1000)
				{
					var accKey = "↑";
					var mainwindow = Components.GetObject2("@pplive.com/ui/mainwindow;1");
					if(mainwindow) accKey = mainwindow.getHotKeyText("key_volumeInc");
					txt = txt + "  \r\n按" + accKey + "继续放大音量";
				}
				if(volumepopdlg.getElementById("volumeslider").lasttooltip!=txt)
				{

					volumepopdlg.getElementById("volumeslider").tooltip = txt;
					volumepopdlg.getElementById("volumeslider").lasttooltip = txt;
				}
			}
		}
	}
	UpdateMute();
}

window.OnUpdateMute = function()
{
	UpdateMute();
}

window.OnDisabledShiftBtn = function(bDisabled)
{
	$("shiftbtn").disabled = bDisabled;
}

window.OnClickControl = function(newVal)
{
	if (newVal == 1) //play
	{
		$("playbtn").visible = false;
		$("pausebtn").visible = true;
		$("stopbtn").disabled = false;
	}
	else if (newVal == 2) //pause
	{
		$("playbtn").visible = true;
		$("pausebtn").visible = false;
		$("stopbtn").disabled = false;
	}
}
window.OnPutPosition= function(newVal)
{
	if(ppplayer)ppplayer.zwCalcLowSpeed=false;
}
// SIG // Begin signature block
// SIG // MIIVVgYJKoZIhvcNAQcCoIIVRzCCFUMCAQExCzAJBgUr
// SIG // DgMCGgUAMGcGCisGAQQBgjcCAQSgWTBXMDIGCisGAQQB
// SIG // gjcCAR4wJAIBAQQQEODJBs441BGiowAQS9NQkAIBAAIB
// SIG // AAIBAAIBAAIBADAhMAkGBSsOAwIaBQAEFI5yCpGgEZKR
// SIG // MkAAVJolvu0QE5HFoIIRWzCCA3owggJioAMCAQICEDgl
// SIG // 1/r4Ya+e9JDnJrXWWtUwDQYJKoZIhvcNAQEFBQAwUzEL
// SIG // MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJ
// SIG // bmMuMSswKQYDVQQDEyJWZXJpU2lnbiBUaW1lIFN0YW1w
// SIG // aW5nIFNlcnZpY2VzIENBMB4XDTA3MDYxNTAwMDAwMFoX
// SIG // DTEyMDYxNDIzNTk1OVowXDELMAkGA1UEBhMCVVMxFzAV
// SIG // BgNVBAoTDlZlcmlTaWduLCBJbmMuMTQwMgYDVQQDEytW
// SIG // ZXJpU2lnbiBUaW1lIFN0YW1waW5nIFNlcnZpY2VzIFNp
// SIG // Z25lciAtIEcyMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
// SIG // iQKBgQDEtfJSFbyIhmApFkpbL0uRa4eR8zVUWDXq0TZe
// SIG // Yk1SUTRxwntmHYnI3SrEagr2N9mYdJH2kq6wtXaW8alK
// SIG // Y0VHLmsLkk5LK4zuWEqL1AfkGiz4gqpY2c1C8y3Add6N
// SIG // q8eOHZpsTAiVHt7b72fhcsJJwp5gPOHivhajY3hpFHut
// SIG // LQIDAQABo4HEMIHBMDQGCCsGAQUFBwEBBCgwJjAkBggr
// SIG // BgEFBQcwAYYYaHR0cDovL29jc3AudmVyaXNpZ24uY29t
// SIG // MAwGA1UdEwEB/wQCMAAwMwYDVR0fBCwwKjAooCagJIYi
// SIG // aHR0cDovL2NybC52ZXJpc2lnbi5jb20vdHNzLWNhLmNy
// SIG // bDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDCDAOBgNVHQ8B
// SIG // Af8EBAMCBsAwHgYDVR0RBBcwFaQTMBExDzANBgNVBAMT
// SIG // BlRTQTEtMjANBgkqhkiG9w0BAQUFAAOCAQEAUMVLyCSA
// SIG // 3+QNJMLeGrGhAqGmgi0MgxWBNwqCDiywWhdhtdgF/ojb
// SIG // 8ZGRs1YaQKbrkr44ObB1NnQ6mE/kN7qZicqVQh2wuceg
// SIG // jVfg+tVkBEI1TgHRM6IXyE2qJ8fy4YZMAjhNg3jG/FPg
// SIG // 6+AGh92klp5eDJjipb6/goXDYOHfrSjYx6VLZNrHG1u9
// SIG // rDkI1TgioTOLL4qa67wHIT9EQQkHtWUcJLxI00SA66HP
// SIG // yQK0FM9UxxajgFz5eT5dcn2IF54sQ6LKU859PfYqOrhP
// SIG // lAClbQqDXfleU/QYs1cPcMP79a2VoA4X3sQWgGDJDytu
// SIG // hgTx6/R4J9EFxe40W165STLyMzCCA8QwggMtoAMCAQIC
// SIG // EEe/GZXfjVJGQ/fbbUgNMaQwDQYJKoZIhvcNAQEFBQAw
// SIG // gYsxCzAJBgNVBAYTAlpBMRUwEwYDVQQIEwxXZXN0ZXJu
// SIG // IENhcGUxFDASBgNVBAcTC0R1cmJhbnZpbGxlMQ8wDQYD
// SIG // VQQKEwZUaGF3dGUxHTAbBgNVBAsTFFRoYXd0ZSBDZXJ0
// SIG // aWZpY2F0aW9uMR8wHQYDVQQDExZUaGF3dGUgVGltZXN0
// SIG // YW1waW5nIENBMB4XDTAzMTIwNDAwMDAwMFoXDTEzMTIw
// SIG // MzIzNTk1OVowUzELMAkGA1UEBhMCVVMxFzAVBgNVBAoT
// SIG // DlZlcmlTaWduLCBJbmMuMSswKQYDVQQDEyJWZXJpU2ln
// SIG // biBUaW1lIFN0YW1waW5nIFNlcnZpY2VzIENBMIIBIjAN
// SIG // BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqcqypMzN
// SIG // IK8KfYmsh3XwtE7x38EPv2dhvaNkHNq7+cozq4QwiVh+
// SIG // jNtr3TaeD7/R7Hjyd6Z+bzy/k68Numj0bJTKvVItq0g9
// SIG // 9bbVXV8bAp/6L2sepPejmqYayALhf0xS4w5g7EAcfrkN
// SIG // 3j/HtN+HvV96ajEuA5mBE6hHIM4xcw1XLc14NDOVEpkS
// SIG // ud5oL6rm48KKjCrDiyGHZr2DWFdvdb88qiaHXcoQFTyf
// SIG // hOpUwQpuxP7FSt25BxGXInzbPifRHnjsnzHJ8eYiGdvE
// SIG // s0dDmhpfoB6Q5F717nzxfatiAY/1TQve0CJWqJXNroh2
// SIG // ru66DfPkTdmg+2igrhQ7s4fBuwIDAQABo4HbMIHYMDQG
// SIG // CCsGAQUFBwEBBCgwJjAkBggrBgEFBQcwAYYYaHR0cDov
// SIG // L29jc3AudmVyaXNpZ24uY29tMBIGA1UdEwEB/wQIMAYB
// SIG // Af8CAQAwQQYDVR0fBDowODA2oDSgMoYwaHR0cDovL2Ny
// SIG // bC52ZXJpc2lnbi5jb20vVGhhd3RlVGltZXN0YW1waW5n
// SIG // Q0EuY3JsMBMGA1UdJQQMMAoGCCsGAQUFBwMIMA4GA1Ud
// SIG // DwEB/wQEAwIBBjAkBgNVHREEHTAbpBkwFzEVMBMGA1UE
// SIG // AxMMVFNBMjA0OC0xLTUzMA0GCSqGSIb3DQEBBQUAA4GB
// SIG // AEpr+epYwkQcMYl5mSuWv4KsAdYcTM2wilhu3wgpo17I
// SIG // ypMT5wRSDe9HJy8AOLDkyZNOmtQiYhX3PzchT3AxgPGL
// SIG // OIez6OiXAP7PVZZOJNKpJ056rrdhQfMqzufJ2V7duyuF
// SIG // PrWdtdnhV/++tMV+9c8MnvCX/ivTO1IbGzgn9z9KMIIE
// SIG // /DCCBGWgAwIBAgIQZVIm4bIuGOFZDymFrCLnXDANBgkq
// SIG // hkiG9w0BAQUFADBfMQswCQYDVQQGEwJVUzEXMBUGA1UE
// SIG // ChMOVmVyaVNpZ24sIEluYy4xNzA1BgNVBAsTLkNsYXNz
// SIG // IDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBB
// SIG // dXRob3JpdHkwHhcNMDkwNTIxMDAwMDAwWhcNMTkwNTIw
// SIG // MjM1OTU5WjCBtjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT
// SIG // DlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln
// SIG // biBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBv
// SIG // ZiB1c2UgYXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29t
// SIG // L3JwYSAoYykwOTEwMC4GA1UEAxMnVmVyaVNpZ24gQ2xh
// SIG // c3MgMyBDb2RlIFNpZ25pbmcgMjAwOS0yIENBMIIBIjAN
// SIG // BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvmcdtGCq
// SIG // EElvVhd8Zslehg3V8ayncYOOi4n4iASJFQa6LYQhleTR
// SIG // nFBM+9IivdrysjU7Ho/DCfv8Ey5av4l8PTslHvbzWHuc
// SIG // 9AG1xgq4gM6+J3RhZydNauXsgWFYeaPgFxASFSew4U00
// SIG // fytHIES53mYkZorNT7ofxTjIVJDhcvYZZnVquUlozzh5
// SIG // DaowqNssYEie16oUAamD1ziRMDkTlgM6fEBUtq3gLxuD
// SIG // 3KgRUj4Cs9cr/SG2p1yjDwupphBQDjQuTafOyV4l1Iy8
// SIG // 8258KbwBXfwxh1rVjIVnWIgZoL818OoroyHnkPaD5ajt
// SIG // YHhee2CD/VcLXUENY1Rg1kMh7wIDAQABo4IB2zCCAdcw
// SIG // EgYDVR0TAQH/BAgwBgEB/wIBADBwBgNVHSAEaTBnMGUG
// SIG // C2CGSAGG+EUBBxcDMFYwKAYIKwYBBQUHAgEWHGh0dHBz
// SIG // Oi8vd3d3LnZlcmlzaWduLmNvbS9jcHMwKgYIKwYBBQUH
// SIG // AgIwHhocaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3Jw
// SIG // YTAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBf
// SIG // oV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAHBgUrDgMC
// SIG // GgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDov
// SIG // L2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYD
// SIG // VR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMDMDQGCCsG
// SIG // AQUFBwEBBCgwJjAkBggrBgEFBQcwAYYYaHR0cDovL29j
// SIG // c3AudmVyaXNpZ24uY29tMDEGA1UdHwQqMCgwJqAkoCKG
// SIG // IGh0dHA6Ly9jcmwudmVyaXNpZ24uY29tL3BjYTMuY3Js
// SIG // MCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFDbGFzczND
// SIG // QTIwNDgtMS01NTAdBgNVHQ4EFgQUl9BrqCZwyKE/lB8I
// SIG // LcQ1m6ShHvIwDQYJKoZIhvcNAQEFBQADgYEAiwPA3ZTY
// SIG // QaJhabAVqHjHMMaQPH5C9yS25INzFwR/BBCcoeL6gS/r
// SIG // wMpE53LgULZVECCDbpaS5JpRarQ3MdylLeuMAMcdT+dN
// SIG // MrqF+E6++mdVZfBqvnrKZDgaEBB4RXYx84Z6Aw9gwrNd
// SIG // nfaLZnaCG1nhg+W9SaU4VuXeQXcOWA8wggURMIID+aAD
// SIG // AgECAhBtUn9NfWwaK6fvgdUMiddlMA0GCSqGSIb3DQEB
// SIG // BQUAMIG2MQswCQYDVQQGEwJVUzEXMBUGA1UEChMOVmVy
// SIG // aVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy
// SIG // dXN0IE5ldHdvcmsxOzA5BgNVBAsTMlRlcm1zIG9mIHVz
// SIG // ZSBhdCBodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBh
// SIG // IChjKTA5MTAwLgYDVQQDEydWZXJpU2lnbiBDbGFzcyAz
// SIG // IENvZGUgU2lnbmluZyAyMDA5LTIgQ0EwHhcNMDkxMTE5
// SIG // MDAwMDAwWhcNMTIxMTE4MjM1OTU5WjCBzjELMAkGA1UE
// SIG // BhMCQ04xETAPBgNVBAgTCFNoYW5naGFpMREwDwYDVQQH
// SIG // EwhTaGFuZ2hhaTEbMBkGA1UEChQSUFBMaXZlIENvcnBv
// SIG // cmF0aW9uMT4wPAYDVQQLEzVEaWdpdGFsIElEIENsYXNz
// SIG // IDMgLSBNaWNyb3NvZnQgU29mdHdhcmUgVmFsaWRhdGlv
// SIG // biB2MjEfMB0GA1UECxQWUHJvZHVjdCBQbGFubmluZyBE
// SIG // ZXB0LjEbMBkGA1UEAxQSUFBMaXZlIENvcnBvcmF0aW9u
// SIG // MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDY7Kff
// SIG // TNpvjGy6zGck0u1/S+B50zuxRF0HrIlPfcpSGmsQyfzm
// SIG // b2eigTz0KuN+palZSdpx0amg9gD+ANFSNo9uqfk1PLeP
// SIG // V7187RIh4taAGUnYROqkPr9kVAsU/SepgjYLVAU46+Bu
// SIG // FtDmCaenpb6rqE+0Y6AV50Rc3iBA0rHvawIDAQABo4IB
// SIG // gzCCAX8wCQYDVR0TBAIwADAOBgNVHQ8BAf8EBAMCB4Aw
// SIG // RAYDVR0fBD0wOzA5oDegNYYzaHR0cDovL2NzYzMtMjAw
// SIG // OS0yLWNybC52ZXJpc2lnbi5jb20vQ1NDMy0yMDA5LTIu
// SIG // Y3JsMEQGA1UdIAQ9MDswOQYLYIZIAYb4RQEHFwMwKjAo
// SIG // BggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24u
// SIG // Y29tL3JwYTATBgNVHSUEDDAKBggrBgEFBQcDAzB1Bggr
// SIG // BgEFBQcBAQRpMGcwJAYIKwYBBQUHMAGGGGh0dHA6Ly9v
// SIG // Y3NwLnZlcmlzaWduLmNvbTA/BggrBgEFBQcwAoYzaHR0
// SIG // cDovL2NzYzMtMjAwOS0yLWFpYS52ZXJpc2lnbi5jb20v
// SIG // Q1NDMy0yMDA5LTIuY2VyMB8GA1UdIwQYMBaAFJfQa6gm
// SIG // cMihP5QfCC3ENZukoR7yMBEGCWCGSAGG+EIBAQQEAwIE
// SIG // EDAWBgorBgEEAYI3AgEbBAgwBgEBAAEB/zANBgkqhkiG
// SIG // 9w0BAQUFAAOCAQEAEHyS6zHfeAr7VXV0+4exGGIaodyt
// SIG // snOwewImElZdtDXV0P9r4B6gp1Ej1ZT8Ddco099Xc7NE
// SIG // e7gyfzCQh27Uq6DSVQP0P9zBI2VgwWaOLweplMHFqKrD
// SIG // q0DXzRAsXiYCu15ugktqWBRVhsOCrNFPcYAiEHhMeRJY
// SIG // 1p5pA+TyXSs2X5AyL1zfpaqrDfJKmhspWabkMbjyLWG9
// SIG // jkQv7K4rviPg//9QfzZoYG3cJBMDqLC3KsSFXs6GNzXo
// SIG // 7EDYhzgJFjpalJUV0n7TL+aPFgRY6/lG3UYPZtsRtGBI
// SIG // W2frpPZy0ww0vcTMzXYL+2TGyka40qCWF3XUw14+znhe
// SIG // yMNA5TGCA2cwggNjAgEBMIHLMIG2MQswCQYDVQQGEwJV
// SIG // UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNV
// SIG // BAsTFlZlcmlTaWduIFRydXN0IE5ldHdvcmsxOzA5BgNV
// SIG // BAsTMlRlcm1zIG9mIHVzZSBhdCBodHRwczovL3d3dy52
// SIG // ZXJpc2lnbi5jb20vcnBhIChjKTA5MTAwLgYDVQQDEydW
// SIG // ZXJpU2lnbiBDbGFzcyAzIENvZGUgU2lnbmluZyAyMDA5
// SIG // LTIgQ0ECEG1Sf019bBorp++B1QyJ12UwCQYFKw4DAhoF
// SIG // AKBwMBAGCisGAQQBgjcCAQwxAjAAMBkGCSqGSIb3DQEJ
// SIG // AzEMBgorBgEEAYI3AgEEMBwGCisGAQQBgjcCAQsxDjAM
// SIG // BgorBgEEAYI3AgEVMCMGCSqGSIb3DQEJBDEWBBQ7Ssgu
// SIG // 3djmrOB/TNlcKnytX0WWZjANBgkqhkiG9w0BAQEFAASB
// SIG // gCu+P0QMo5LSL+hukt/e5jgzxdG4Jp8RxHfC0Hqr0PqM
// SIG // NceAZtKoDAbtKuuJjPBTVaCDrxmdEAmehQLjZSMSeDEE
// SIG // gb1OOkNCpv4wXUxDrraH6xMhcrtZ6xh40RoTEhw8wx1S
// SIG // CuKf/tZZjXSDDgN3VjE3xbiAIujOo8ZoD7P9o9wFoYIB
// SIG // fzCCAXsGCSqGSIb3DQEJBjGCAWwwggFoAgEBMGcwUzEL
// SIG // MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJ
// SIG // bmMuMSswKQYDVQQDEyJWZXJpU2lnbiBUaW1lIFN0YW1w
// SIG // aW5nIFNlcnZpY2VzIENBAhA4Jdf6+GGvnvSQ5ya11lrV
// SIG // MAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZI
// SIG // hvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xMTA5MDUxMTM2
// SIG // MjFaMCMGCSqGSIb3DQEJBDEWBBTuQ9p2DeJF5sdx+Uh4
// SIG // 1bxBbOAxgTANBgkqhkiG9w0BAQEFAASBgExOy39MJmMP
// SIG // rAPNfmbULzDJ/mxI4TZc9vV8dU1HttzrVVsEcaiHhWqp
// SIG // 5C/hlWV7J3TGLsdtN2OdRO1jKH74dNwLXoze07VEpGdA
// SIG // /9X5EqFrsVFSUeI8i2kC3McIETz3GNlqtIvUZzbioic/
// SIG // lQ+mG8ZJTbFoZg4Ai6W89km6xEzl
// SIG // End signature block
