<%@ Page Language="C#" Inherits="SiteServer.BackgroundPages.GeneralProgressBar" 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>
		<link rel="stylesheet" href="style.css" type="text/css" />
		<user:custom type="style" runat="server"></user:custom>
		<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">
        <asp:Literal ID="ltlPoweredBy" runat="server"></asp:Literal>
			<DIV class="column">
<div class="columntitle"><asp:Label id="DisplayTitle" runat="server" /></div>
		  
						<table cellpadding="3" width="95%" align="center">
							<tr>
								<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>
						</table>
					</div>
		</form>
		
</body>
</HTML>
