<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Happy8Clock.aspx.vb" Inherits="LuckBet.Happy8Clock" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
	<HEAD>
		<title>Clock</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
				<table width="100%" border="0" cellspacing="0" cellpadding="5">
					<tr>
						<td align="left">
							<font color =red><span id="oTime">loading...</span></font>
						</td>
					</tr>
				</table>
			<script type="text/javascript" laugnage="javascript"> 
var sum=<% =sum%>; 
var ISSUE =<% =ISSUE%>;
var str; 
var newstimer;

function cDate(oSum) 
{ 
   var min=Math.floor(oSum/60); 
   if(min<1) 
   {
      min==0
   } 
   
   var sec=oSum%60; 
   str=min*60+sec
    if(str<=0) 
    { 
		str="第"+ISSUE+"期已经开奖，请刷新查看！"
		setTimeout('Reload()',3000); 
    } 
    else
    {
		str="距离第"+ISSUE+"期开奖还有"+str+"秒"
	}
   return str 
} 

function submitForm() 
{  
    if(sum<=0) 
    { 
		document.all['oTime'].innerHTML = "第"+ISSUE+"期已经开奖，请刷新查看！";
		setTimeout('Reload()',3000);   
    } 
    else
    {
        sum=sum-1 
        cDate(sum) 
        //document.getElementById("STime").value=str;
        document.all['oTime'].innerHTML = str;
        //if(sum<=0) 
        //{ 
			//setTimeout('Reload()',10000);   
        //} 
    }
} 
function Reload()
{
  clearInterval(newstimer) 
  location.href=('Happy8Clock.aspx')
}
newstimer=setInterval("submitForm()",1000) 
			</script>
		</form>
	</body>
</HTML>
