<?xml version="1.0" encoding="utf-8"?>
<window left="0" top="0" width="32" height="92" titleBar="false" resizeMargins="0,0,0,0" onload="Onload();" onunload="OnUnload();">
	<script src="common.js" />
	<script src="playcontrolcommon.js" />
	<script>
	<![CDATA[
		function Onload()
		{
			//获取播放控制接口
			GetPPPlayer();

			window.checkHoverTimeid = window.setInterval("checkHover();",200);
			//添加窗口
			if (ppplayer)
			{
				var mframe = ppplayer.get_MFRAME();
				if (mframe)
				{
					mframe.AddWnd("VolumePopDlg",window);
				}
			}
			//volumeslider
			UpdateVolumeSlider();
			window.SetVolume=function(pos)
			{
				var vol = pos;
				if (vol > 100)
				{
					vol = 100;
				}
				else if (vol < 0)
				{
					vol = 0;
				}
				$("volumeslider").value = vol;
				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 + " 继续放大音量";
				}
				if($("volumeslider").lasttooltip!=txt)
				{
					$("volumeslider").tooltip =txt;
					$("volumeslider").lasttooltip=txt;
				}
			}
			DisableAccelset(true);
		}

		function OnUnload()
		{
			window.clearInterval(window.checkHoverTimeid);
			DisableAccelset(false);
			//移除窗口
			if (ppplayer && ppplayer.VolumePopDlg == window)
			{

				var mframe = ppplayer.get_MFRAME();
				if (mframe)
				{
					mframe.RemoveWnd("VolumePopDlg");
				}
				ppplayer.VolumePopDlg = null;

				var volumepopdlg = Components.GetObject2("VolumePopDlg");
				if (volumepopdlg)
				{
					Components.UnRegisterObject("VolumePopDlg");
				}
			}
		}
		function checkHover()
		{
			if(PtInRectEx($("winx"),window))
			{
				if(ppplayer)ppplayer.hover_volpop=true;
			}
			else
			{
				if(ppplayer)ppplayer.hover_volpop=false;
			}
			checkVolumeHover.call(null);
		}
	]]>
	</script>
	<subwindow id="winx" left="0" top="0" width="32" height="92" visible="true" passThrough="false" backgroundColor="#FF00FF" onmouseover="checkHover();" onmouseout="checkHover();">
		<image left="0" top="0" width="32" height="3" src="volume_bg_top.bmp" visible="true" passThrough="true"/>
		<image left="0" top="3" width="32" height="86" src="volume_bg_m.bmp" visible="true" stretchMode="stretch" verticalAlignment="stretch" passThrough="true"/>
		<image left="0" top="89" width="32" height="3" src="volume_bg_bottom.bmp" visible="true" passThrough="true"/>
		<slider id="volumeslider" left="5" top="5" width="22" height="82" direction="vertical" backgroundImage="volume_bar_1.png" foregroundImage="volume_bar_2.png" thumbImage="volume_thumb_normal.png" thumbHoverImage="volume_thumb_hover.png" thumbDownImage="volume_thumb_down.png" borderSize="0" min="0" value="0" max="100" disabled="false" onchange="OnVolumeSliderChange(this.value);" foregroundImageStretchMode="bottom" thumbOverlay="false" onmouseover="window.hoversl=true;checkHover();" onmouseout="window.hoversl=false;checkHover();" ondragbegin="OnVolumeSliderDragBegin(this.value);" ondragend="OnVolumeSliderDragEnd(this.value);"/>
	</subwindow>
</window> 
