<?xml version="1.0" encoding="utf-8"?>
<window screenLeft="0" screenTop="0" width="600" height="463" titleBar="false" resizeMargins="0,0,0,0" maximizable="false" onload="windowOnload();" onunload="windowOnUnload();" minWidth="600" minHeight="463" maxWidth="600" maxHeight="463">
<script src="common.js" />
<script>
<![CDATA[
	function thisGetCityCode()
	{
		var channelFactory = Components.GetObject("@pplive.com/ChannelManagerFactory;1");
		if (channelFactory)
		{
			var channelManager = channelFactory.live();
			if (channelManager)
			{
				return channelManager.cityCode;
			}
		}

		return "1";
	}
    var hMutex;
	function centerWindow()
	{
		var screen = window.screen;
		var left = screen.left + (screen.width - window.outerWidth)/2;
		var top = screen.top + (screen.height - window.outerHeight)/2;
		window.moveSizeTo(left, top, window.outerWidth, window.outerHeight);
	}
	function oneWeek(value)
	{
		var registry = Components.CreateObject("@pplive.com/registry;1");
		if (registry.open(registry.HKCU, "Software\\PPLive\\Config\\Other",IRegistry.KEY_ALL))
		{
			registry.writeDWORD("minisiteForbid0",value?1:0);
		}
	}
	function windowOnload()
	{
		window.oneWeek = oneWeek;
		hMutex = 0;
		centerWindow();
		window.title="PPTV今日焦点";
		window.bShowDirect = false;
		$("miniSiteBrowser").EnableAccelerator(false,0,116);
		window.showDirect = function(bDirect)
		{
			window.bShowDirect = bDirect;
		}
		window.miniSitegotoUrl=function(url)
		{
			var minisiteUrl = "http://client-mini.pptv.com/minisite/" + thisGetCityCode() + ".html";
			$("miniSiteBrowser").Url  = minisiteUrl;
		}
		window.miniSize=function()
		{
			var ppmutex = Components.CreateObject("@pplive.com/ppmutex;1");
			if (ppmutex)
			{
				if (ppmutex.OpenMutex("pptv_minisite"))
				{
					return ;
				}
			}
			window.sizemode=1;
		}
		window.showminiSite=function(show)
		{
			var ppapi = Components.CreateObject("@pplive.com/api;1");
			if (ppapi)
			{
				var hWnd = 0;
				do
				{
					hWnd = ppapi.FindWindowEx(0,hWnd,"PPGuiFoundation","PPTV今日焦点");
					if (ppapi.GetWindowLong(hWnd,-16) & 0x10000000)
					{
						ppapi.ShowWindow(hWnd,1);
						ppapi.BringWindowToTop(hWnd);
						break;
					}
				}
				while (hWnd);
			}

			var ppmutex = Components.CreateObject("@pplive.com/ppmutex;1");
			if (ppmutex)
			{
				if (ppmutex.OpenMutex("pptv_minisite"))
				{
					return ;
				}
				hMutex = ppmutex.CreateMutex("pptv_minisite");
			}
			window.topMost=true;
			window.visible=show;
			window.topMost=false;
		}
		window.destroyWeb=function()
		{
			//$("miniSiteBrowser").DestroyBrowser();
		}
		$("miniSiteBrowser").SetBkgroundColor(0xf8f4ec);
		$("miniSiteBrowser").DefaultBkgd = true;
		window.showOneWeek=function(show)
		{
			//$("nomind").visible=show;
		}

		//统计日志
		var  pplDac=Components.GetObject2("@pplive.com/PPLStat;1");
		if(pplDac)
		{
			pplDac.PPLMiniSiteShow();
		}
	}

	function windowOnUnload()
	{
		var ppmutex = Components.CreateObject("@pplive.com/ppmutex;1");
		if (ppmutex)
		{
			if (hMutex != 0)
			{
				ppmutex.CloseHandle(hMutex);
			}
		}
	}
]]>
</script>
	<subwindow left="0" top="0" width="600" height="463">
		<!-- top left -->
		<subwindow left="0" top="0" width="64" height="32" backgroundImage="mini_title_l.bmp" clippingColor="#FF00FF" />
		<!-- top -->
		<subwindow left="64" top="0" width="530" height="32" backgroundImage="mini_title_m.bmp" clippingColor="#FF00FF" horizontalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- top right -->
		<subwindow left="594" top="0" width="6" height="32" backgroundImage="mini_title_r.bmp" clippingColor="#FF00FF" horizontalAlignment="right"/>
		<!-- right -->
		<subwindow left="596" top="32" width="4" height="424" backgroundImage="mini_main_r.bmp" clippingColor="#FF00FF" horizontalAlignment="right" verticalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#FF0000" />
		<!-- bottom right -->
		<subwindow left="596" top="437" width="4" height="26" backgroundImage="mini_bottom_r.bmp" clippingColor="#FF00FF" horizontalAlignment="right" verticalAlignment="bottom" />
		<!-- bottom -->
		<subwindow left="4" top="437" width="592" height="26" backgroundImage="mini_bottom_m.bmp" clippingColor="#FF00FF" horizontalAlignment="stretch" verticalAlignment="bottom"  backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- bottom left -->
		<subwindow left="0" top="437" width="4" height="26" backgroundImage="mini_bottom_l.bmp" clippingColor="#FF00FF" horizontalAlignment="left" verticalAlignment="bottom" />
		<!-- left -->
		<subwindow left="0" top="32" width="4" height="424" backgroundImage="mini_main_l.bmp" clippingColor="#FF00FF" horizontalAlignment="left" verticalAlignment="stretch" backgroundImageStretchMode="stretch" backgroundColor="#000000"/>
		<!-- center -->
		<subwindow left="4" top="32" width="592" height="427" horizontalAlignment="stretch" verticalAlignment="stretch" backgroundColor="#ecf4f8">
		<widget id="miniSiteBrowser" left="0" top="0" width="592" height="427" horizontalAlignment="stretch" verticalAlignment="stretch" contractId="@pplive.com/WebBrowser;1"/>
		</subwindow>
		<!-- close button -->
		<button left="530" top="0" width="30" height="32" image="btn_min_1.bmp" hoverImage="btn_min_2.bmp" downImage="btn_min_3.bmp" tooltip="最小化" onclick="window.sizemode=1;"/>
		<button left="560" top="0" width="30" height="32" image="btn_close_1.bmp" hoverImage="btn_close_2.bmp" downImage="btn_close_3.bmp" onclick="window.close();" tooltip="关闭"/>

		<label id="windowTitle" left="70" top="6" width="200" height="20" value="今日焦点" fontFace="宋体"  fontSize="14"  foregroundColor="#0078d5" passThrough="true" textAlignment="left vcenter" fontStyle="bold"/>	
		<!--
		<checkbox id="nomind" left="7" top="428" width="120" height="27" label="一周内不再显示" fontFace="宋体" fontSize="12"  foregroundColor="#0078d5" textAlignment="left vcenter" onclick="oneWeek(!$('nomind').checked);" visible="false"/>
		-->
	</subwindow>
</window>