<?xml version="1.0" encoding="utf-8"?>
<window screenLeft="3" screenTop="27" width="369" height="194" titleBar="false" resizeMargins="0,0,0,0" onload="windowOnload();" oncancel="window.returnValue=0; window.close();" onok=" saveSetting(); window.returnValue=1; window.close();" onunload="" maximizable="false">
	<script src="common.js" />
	<script>
	<![CDATA[
		function windowOnload()
		{
			$("fileTypes").appendItem(".BMP");
			$("fileTypes").appendItem(".GIF");
			$("fileTypes").appendItem(".JPG");
			$("fileTypes").appendItem(".PNG");
			$("fileTypes").selectedIndex = 3;
			$("saveToFile").checked = true;
			$("pathBox").value = Components.GetObject("@pplive.com/filepath;1").GetKnownFolderPath("desktop");

			var registry = Components.CreateObject("@pplive.com/registry;1");
			if (registry && registry.open(registry.HKCU, "Software\\PPLive\\Config\\Other",IRegistry.KEY_READ))
			{
				var type = registry.readDWORD("screenshottype");
				if (type == 1)
				{
					$("saveToClipboard").checked = true;
				}
				else if (type == 2)
				{
					$("saveToFile").checked = true;
				}
				var path = registry.readString("screenshotpath");
				if (path.length > 0)
				{
					$("pathBox").value = path;
				}
				if (registry.queryType("pictype") == 4)
				{
					var picType = registry.readDWORD("pictype");
					if (picType >= 0 && picType <= 3)
					{
							$("fileTypes").selectedIndex = picType;
					}
				}
			}
		}
		// 1 剪切板 2 文件
		function changeSaveType(type)
		{
			if (type == 1)
			{
				$("pathBox").disabled = true;
				$("fileTypes").disabled = true;
			}
			else if (type == 2)
			{
				$("pathBox").disabled = false;
				$("fileTypes").disabled = false;
			}
		}
		function saveSetting()
		{
			var registry = Components.CreateObject("@pplive.com/registry;1");
			if (!registry || !registry.create(registry.HKCU, "Software\\PPLive\\Config\\Other"))
			{
				return;
			}
			registry.writeDWORD("screenshottype", $("saveToClipboard").checked ? 1 : 2);
			if ($("pathBox").value.length > 0)
			{
				registry.writeString("screenshotpath", $("pathBox").value);
			}
			registry.writeDWORD("screenshotpathsetted", $("neverRemind").checked ? 1 : 0);
		}
	]]>
	</script>
	<subwindow left="0" top="0" width="369" height="194">
		<!-- 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="281" height="27" backgroundImage="bg_top.bmp" clippingColor="#FF00FF" horizontalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- top right -->
		<subwindow left="361" top="0" width="8" height="27" backgroundImage="bg_right_top.bmp" clippingColor="#FF00FF" horizontalAlignment="right"/>
		<!-- right -->
		<subwindow left="367" top="27" width="2" height="165" backgroundImage="bg_right.bmp" clippingColor="#FF00FF" horizontalAlignment="right" verticalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000" />
		<!-- bottom right -->
		<subwindow left="367" top="192" width="2" height="2" backgroundImage="set_bg_right_bot.bmp" clippingColor="#FF00FF" horizontalAlignment="right" verticalAlignment="bottom" />
		<!-- bottom -->
		<subwindow left="2" top="192" width="365" height="2" backgroundImage="set_bg_bot.bmp" clippingColor="#FF00FF" horizontalAlignment="stretch" verticalAlignment="bottom"  backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- bottom left -->
		<subwindow left="0" top="192" 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="165" backgroundImage="bg_left.bmp" clippingColor="#FF00FF" horizontalAlignment="left" verticalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- center -->
		<subwindow left="2" top="27" width="365" height="165" horizontalAlignment="stretch" verticalAlignment="stretch" backgroundColor="#efefef">
		</subwindow>
		<!-- close button -->
		<button left="342" top="2" width="24" height="24" image="close.png" hoverImage="close_hover.png" downImage="close_down.png" onclick="window.close();" tooltip="关闭"/>

		<label id="windowTitle" left="55" top="4" width="380" height="18" value="截图另存为" fontFace="Arial"  fontSize="13"  foregroundColor="#efefef" passThrough="true" textAlignment="left vcenter" fontStyle="bold"/>

		<radio id="saveToClipboard" left="10" top="40" width="100" height="20" label="保存到剪切板" onchange="if(this.checked)changeSaveType(1);"/>
		<radio id="saveToFile" left="10" top="60" width="90" height="20" label="保存成文件"  onchange="if(this.checked)changeSaveType(2);"/>

		<label left="26" top="85" width="60" height="20" value="保存路径:" textAlignment="left vcenter" visible="true"/>
		<textbox id="pathBox" left="86" top="85" width="202" height="20" emptyText="" visible="true"/>
		<button left="292" top="82" width="73" height="27" image="button.bmp" hoverImage="button_hover.bmp" downImage="button_down.bmp" onclick="var path = SelectFolder(); if(path) $('pathBox').value=path;" label="浏览" textAlignment="center vcenter" />

		<label left="26" top="111" width="60" height="20" value="保存类型:" textAlignment="left vcenter" visible="true"/>
		<select id="fileTypes" left="86" top="111" width="59" height="20" visible="true"/>

		<checkbox id="neverRemind" left="10" top="160" width="160" height="20" label="不再提示保存路径" checked="true"/>

		<button left="218" top="160" width="70" height="27" image="button.bmp" hoverImage="button_hover.bmp" downImage="button_down.bmp" onclick="saveSetting();window.returnValue=1;window.close();" label="确定" textAlignment="center vcenter">
		</button>
		<button left="292" top="160" width="70" height="27" image="button.bmp" hoverImage="button_hover.bmp" downImage="button_down.bmp" onclick="window.returnValue=0; window.close();" label="取消" textAlignment="center vcenter">
		</button>
	</subwindow>
</window>
