<?xml version="1.0" encoding="utf-8"?>
<window screenLeft="3" screenTop="27" width="309" height="168" titleBar="false" resizeMargins="0,0,0,0" onload="windowOnLoad();" onok="OnOk();window.close();" oncancel="window.returnValue = 0; window.close();" maximizable="false">
	<script src="common.js" />
	<script language="JavaScript">
	<![CDATA[
	/* 返回值：0 表示取消 1 关闭 2 最小化到托盘 */
		function windowOnLoad()
		{
			$("miniTrayicon").checked = true;
			// 从注册表中载入配置信息
			var registry = Components.CreateObject("@pplive.com/registry;1");
			if (registry && registry.open(registry.HKCU, "Software\\PPLive\\Config\\Other"))
			{
				if (registry.readDWORD("NoExitInfo")) // 不显示关闭对话框
				{
					$("nonextHint").checked = true;
				}
				if (registry.queryType("CloseAction") == 0 || registry.readDWORD("CloseAction")) // 最小化到托盘
				{
					$("miniTrayicon").checked = true;
				}
				else
				{
					$("exitRadio").checked = true;
				}
			}
		}
		function OnOk()
		{
			var registry = Components.CreateObject("@pplive.com/registry;1");
			if (!registry.open(registry.HKCU, "Software\\PPLive\\Config\\Other",IRegistry.KEY_ALL))
			{
				window.returnValue = 0;
				return;
			}
			if ($("nonextHint").checked)
			{
				registry.writeDWORD("NoExitInfo", 1);
			}
			if ($("miniTrayicon").checked) // 最小化到托盘
			{
				window.returnValue = 2;
				registry.writeDWORD("CloseAction", 1);
			}
			else
			{
				window.returnValue = 1;
				registry.writeDWORD("CloseAction", 0);
			}
		}
	]]>
	</script>
	<subwindow left="0" top="0" width="309" height="168">
		<!-- top left -->
		<subwindow left="0" top="0" width="80" height="27" backgroundImage="bg_left_top.bmp" clippingColor="#FF00FF" />
		<!-- top -->
		<subwindow left="80" top="0" width="221" height="27" backgroundImage="bg_top.bmp" clippingColor="#FF00FF" horizontalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- top right -->
		<subwindow left="301" top="0" width="8" height="27" backgroundImage="bg_right_top.bmp" clippingColor="#FF00FF" horizontalAlignment="right"/>
		<!-- right -->
		<subwindow left="307" top="27" width="2" height="139" backgroundImage="bg_right.bmp" clippingColor="#FF00FF" horizontalAlignment="right" verticalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000" />
		<!-- bottom right -->
		<subwindow left="307" top="166" width="2" height="2" backgroundImage="set_bg_right_bot.bmp" clippingColor="#FF00FF" horizontalAlignment="right" verticalAlignment="bottom" />
		<!-- bottom -->
		<subwindow left="2" top="166" width="305" height="2" backgroundImage="set_bg_bot.bmp" clippingColor="#FF00FF" horizontalAlignment="stretch" verticalAlignment="bottom"  backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- bottom left -->
		<subwindow left="0" top="166" width="2" height="2" backgroundImage="set_bg_left_bot.bmp" clippingColor="#FF00FF" horizontalAlignment="left" verticalAlignment="bottom" />
		<!-- left -->
		<subwindow left="0" top="27" width="2" height="139" backgroundImage="bg_left.bmp" clippingColor="#FF00FF" horizontalAlignment="left" verticalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- center -->
		<subwindow left="2" top="27" width="305" height="139" horizontalAlignment="stretch" verticalAlignment="stretch" backgroundColor="#FFFFFF">
		</subwindow>
		<!-- close button -->
		<button left="274" top="0" width="26" height="23" image="close.bmp" hoverImage="close_hover.bmp" downImage="close_down.bmp" onclick="window.returnValue = 0; window.close();" tooltip="关闭"/>
		
		<subwindow left="20" top="45" width="270" height="53" backgroundImage="groupbox.png" backgroundImageStretchMode="ninegrid" nineGridMargins="4,4,4,4" backgroundColor="#FFFFFF"/>
		<label left="28" top="39" width="28" height="13" value="关闭" backgroundColor="#FFFFFF" foregroundColor="#000000"/>

		<radio id="exitRadio" left="32" top="55" width="120" height="20" label="退出应用程序" textAlignment="left vcenter" backgroundColor="#FFFFFF" />
		<radio id="miniTrayicon" left="32" top="76" width="120" height="20" label="最小化到托盘" textAlignment="left vcenter" backgroundColor="#FFFFFF" />

		<checkbox id="nonextHint" left="32" top="107" width="180" height="16" label="记住本次操作，以后不再询问" textAlignment="left vcenter" backgroundColor="#FFFFFF"/>
		<button left="145" top="127" width="70" height="27" image="button.bmp" hoverImage="button_hover.bmp" downImage="button_down.bmp" onclick="OnOk();window.close();" label="确定" />
		<button left="221" top="127" width="70" height="27" image="button.bmp" hoverImage="button_hover.bmp" downImage="button_down.bmp" onclick="window.returnValue = 0; window.close();" label="取消" />
	</subwindow>
</window>