<%@ Page Language="C#" Inherits="SiteServer.BackgroundPages.Modal.ProgressBar" Trace="false" EnableViewState="false" %>
<%@ Register TagPrefix="bairong" Namespace="BaiRong.Controls" Assembly="BaiRong.Controls" %>
<%@ Register TagPrefix="user" Namespace="UserCenter.Controls" Assembly="UserCenter.Pages" %>
<%@ Register TagPrefix="site" Namespace="SiteServer.Controls" Assembly="SiteServer.Controls" %>

<HTML>
	<HEAD>
		<!--#include file="../inc/html_head.inc"-->
<user:custom type="style" runat="server"></user:custom>
		<title id="MyTitle" runat="server"></title>
		<bairong:Code type="Prototype" runat="server" />
		
		
<meta http-equiv="content-type" content="text/html;charset=gb2312">
		<bairong:NoTagText id="RegisterScripts" runat="server" />
		<script type="text/javascript" language="javascript">
			function writeProgressBar(totalCount, currentCount, message)
			{
				if (totalCount != 0 && currentCount != 0)
				{
					$('prgressBarPercetage').innerHTML = parseInt(currentCount*100/totalCount) + '';
					$('progressBarBoxContent').style.width = parseInt(currentCount*350/totalCount) + 'px';
					if (totalCount == currentCount)
					{
						$('uploadWarningText').innerHTML = '任务完成。';
					}
					else
					{
						$('uploadWarningText').innerHTML = '(' + currentCount + '/' + totalCount + ')&nbsp;';
						if (!_isNull(message)) $('uploadWarningText').innerHTML += message;
					}
				}
				else
				{
					if (!_isNull(message)) $('uploadWarningText').innerHTML = message;
				}
			}
			
			function writeResult(resultMessage, errorMessage)
			{
				$('uploadError').style.display = 'none';
				$('uploadWarning').style.display = 'none';
				if (errorMessage != '')
				{
					$('uploadError').style.display = '';
					$('uploadErrorText').innerHTML = errorMessage;
				}
				if (resultMessage != '')
				{
					writeProgressBar(1, 1);
					$('uploadWarning').style.display = '';
					$('uploadWarningText').innerHTML = resultMessage;
				}
			}
		</script>
	</HEAD>
	<body>
		<form id="myForm" runat="server">
<bairong:Message runat="server"></bairong:Message>
<asp:Literal ID="ltlPoweredBy" runat="server"></asp:Literal>
		  	<table cellpadding="3" width="95%" align="center">
			<tr align="left">
				<td>
					<div id="progressBar" style="margin: 1em 2em 2em 2em;">
						<div id="theMeter">
							<div id="progressBarText" style="font-weight: bold; padding: 5px;">任务完成: <span id="prgressBarPercetage">0</span>%</div>
							<div id="progressBarBox" style="width: 350px; height: 20px; border: 1px inset; background: #eee;">
								<div id="progressBarBoxContent" style="width: 0; height: 20px; border-right: 1px solid #444; background: #9ACB34;"></div>
							</div>
						</div>
					</div>
					
					<div id="uploadError" style="position:relative; margin: 2em; display:none;">
						<p style=" padding-left: 25px; padding-bottom: 5px; color:red; text-align: left; vertical-align: middle; background:url(../Pic/icon/error.jpg) no-repeat left top;"> 执行出错，错误信息为：<span id="uploadErrorText"></span></p>
					</div>
		
					<div id="uploadWarning" style="position:relative; margin: 2em;">
						<p style=" padding-left: 25px; padding-bottom: 5px; text-align: left; vertical-align: middle; background:url(../Pic/icon/warn.jpg) no-repeat left top;"> <span id="uploadWarningText">任务初始化...</span><br />您可以安全地离开此窗口！</p>
					</div>
				</td>
			</tr>
			<tr>
				<td align="center">
					<input type="button" class="button" name="Cancel" value="关 闭" onClick="window.parent.hidePopWin();" />
				</td>
			</tr>
	  </table>
		</form>
	</body>
</HTML>
