var SSLServerTime;
var LocalSSLSubServerSecond;
var ActiveSSLExpectDgendtime;
var ActiveSSLExpect;
var DgSSLEndRemainSecond;
var fasecond = 0;
var IsGetLocalSSLSubServerSecond = false;
var DgSSLEndRemainSecondMsg
/*取服务器时间*/
function GetSSLTimeComparetoServer()
{
	IsGetLocalSSLSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "http://www.kuaic.cn/Trade/GetTimeXml.asp?Lottery=时时乐",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalSSLSubServerSecond = true;
				var row = $(data).find("row");
				SSLServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalSSLSubServerSecond = Math.round((Date.parse(date)-Date.parse(SSLServerTime.replace(/-/g,"/")))/1000);
				LocalSSLSubServerSecond = LocalSSLSubServerSecond-1;
				ActiveSSLExpectDgendtime = $(row).attr("endtime");
				ActiveSSLExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function SSLMinusSeconds()
{
	var date = new Date();
	DgSSLEndRemainSecond = Math.round((Date.parse(ActiveSSLExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalSSLSubServerSecond);
	var h = Math.floor(DgSSLEndRemainSecond/3600);
	var m = Math.floor((DgSSLEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgSSLEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgSSLEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgSSLEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgSSLEndRemainSecondMsg = h+":"+m+":"+s;
	}
}



/*显示当前期信息*/
function ShowSSLActiveExpect()
{
	if (IsGetLocalSSLSubServerSecond)
	{
		SSLMinusSeconds();
		if(DgSSLEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#SSLIssue").html(""+ActiveSSLExpect+"");
			$("#SSLIssueEnd").html(DgSSLEndRemainSecondMsg);
		}
		else
		{
			$("#SSLIssue").html("请等待开售")
			$("#SSLIssueEnd").html("00:00");
			GetSSLTimeComparetoServer();
		}
	}
	setTimeout("ShowSSLActiveExpect()",1000);
}

$(function(){
	GetSSLTimeComparetoServer();
	ShowSSLActiveExpect();
})




var SSCServerTime;
var LocalSSCSubServerSecond;
var ActiveSSCExpectDgendtime;
var ActiveSSCExpect;
var DgSScEndRemainSecond;
var fasecond = 60;
var IsGetLocalSSCSubServerSecond = false;
var DgSScEndRemainSecondMsg
/*取服务器时间*/
function GetSSCTimeComparetoServer()
{
	IsGetLocalSSCSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "http://www.kuaic.cn/Trade/GetTimeXml.asp?Lottery=重庆时时彩",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalSSCSubServerSecond = true;
				var row = $(data).find("row");
				SSCServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalSSCSubServerSecond = Math.round((Date.parse(date)-Date.parse(SSCServerTime.replace(/-/g,"/")))/1000);
				LocalSSCSubServerSecond = LocalSSCSubServerSecond-1;
				ActiveSSCExpectDgendtime = $(row).attr("endtime");
				ActiveSSCExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function SSCMinusSeconds()
{
	var date = new Date();
	DgSScEndRemainSecond = Math.round((Date.parse(ActiveSSCExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalSSCSubServerSecond);
	var h = Math.floor(DgSScEndRemainSecond/3600);
	var m = Math.floor((DgSScEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgSScEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgSScEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgSScEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgSScEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowSSCActiveExpect()
{
	if (IsGetLocalSSCSubServerSecond)
	{
		SSCMinusSeconds();
		if(DgSScEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#SSCIssue").html(""+ActiveSSCExpect+"");
			$("#SSCIssueEnd").html(DgSScEndRemainSecondMsg);
		}
		else
		{
			$("#SSCIssue").html("请等待开售")
			$("#SSCIssueEnd").html("00:00");
			GetSSCTimeComparetoServer();
		}
	}
	setTimeout("ShowSSCActiveExpect()",1000);
}

$(function(){
	GetSSCTimeComparetoServer();
	ShowSSCActiveExpect();
})

var JXSSCServerTime;
var LocalJXSSCSubServerSecond;
var ActiveJXSSCExpectDgendtime;
var ActiveJXSSCExpect;
var DgJXSSCEndRemainSecond;
var fasecond = 60;
var IsGetLocalJXSSCSubServerSecond = false;
var DgJXSSCEndRemainSecondMsg
/*取服务器时间*/
function GetJXSSCTimeComparetoServer()
{
	IsGetLocalJXSSCSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "http://www.kuaic.cn/Trade/GetTimeXml.asp?Lottery=江西时时彩",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalJXSSCSubServerSecond = true;
				var row = $(data).find("row");
				JXSSCServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalJXSSCSubServerSecond = Math.round((Date.parse(date)-Date.parse(JXSSCServerTime.replace(/-/g,"/")))/1000);
				LocalJXSSCSubServerSecond = LocalJXSSCSubServerSecond-1;
				ActiveJXSSCExpectDgendtime = $(row).attr("endtime");
				ActiveJXSSCExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function JXSSCMinusSeconds()
{
	var date = new Date();
	DgJXSSCEndRemainSecond = Math.round((Date.parse(ActiveJXSSCExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalJXSSCSubServerSecond);
	var h = Math.floor(DgJXSSCEndRemainSecond/3600);
	var m = Math.floor((DgJXSSCEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgJXSSCEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgJXSSCEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgJXSSCEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgJXSSCEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowJXSSCActiveExpect()
{
	if (IsGetLocalJXSSCSubServerSecond)
	{
		JXSSCMinusSeconds();
		if(DgJXSSCEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#JXSSCIssue").html(""+ActiveJXSSCExpect+"");
			$("#JXSSCIssueEnd").html(DgJXSSCEndRemainSecondMsg);
		}
		else
		{
			$("#JXSSCIssue").html("请等待开售")
			$("#JXSSCIssueEnd").html("00:00");
			GetJXSSCTimeComparetoServer();
		}
	}
	setTimeout("ShowJXSSCActiveExpect()",1000);
}

$(function(){
	GetJXSSCTimeComparetoServer();
	ShowJXSSCActiveExpect();
})

var TJSSCServerTime;
var LocalTJSSCSubServerSecond;
var ActiveTJSSCExpectDgendtime;
var ActiveTJSSCExpect;
var DgTJSSCEndRemainSecond;
var fasecond = 60;
var IsGetLocalTJSSCSubServerSecond = false;
var DgTJSSCEndRemainSecondMsg
/*取服务器时间*/
function GetTJSSCTimeComparetoServer()
{
	IsGetLocalTJSSCSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "http://www.kuaic.cn/Trade/GetTimeXml.asp?Lottery=天津时时彩",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalTJSSCSubServerSecond = true;
				var row = $(data).find("row");
				TJSSCServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalTJSSCSubServerSecond = Math.round((Date.parse(date)-Date.parse(TJSSCServerTime.replace(/-/g,"/")))/1000);
				LocalTJSSCSubServerSecond = LocalTJSSCSubServerSecond-1;
				ActiveTJSSCExpectDgendtime = $(row).attr("endtime");
				ActiveTJSSCExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function TJSSCMinusSeconds()
{
	var date = new Date();
	DgTJSSCEndRemainSecond = Math.round((Date.parse(ActiveTJSSCExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalTJSSCSubServerSecond);
	var h = Math.floor(DgTJSSCEndRemainSecond/3600);
	var m = Math.floor((DgTJSSCEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgTJSSCEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgTJSSCEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgTJSSCEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgTJSSCEndRemainSecondMsg = h+":"+m+":"+s;
	}
}



/*显示当前期信息*/
function ShowTJSSCActiveExpect()
{
	if (IsGetLocalTJSSCSubServerSecond)
	{
		TJSSCMinusSeconds();
		if(DgTJSSCEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#TJSSCIssue").html(""+ActiveTJSSCExpect+"");
			$("#TJSSCIssueEnd").html(DgTJSSCEndRemainSecondMsg);
		}
		else
		{
			$("#TJSSCIssue").html("请等待开售")
			$("#TJSSCIssueEnd").html("00:00");
			GetTJSSCTimeComparetoServer();
		}
	}
	setTimeout("ShowTJSSCActiveExpect()",1000);
}

$(function(){
	GetTJSSCTimeComparetoServer();
	ShowTJSSCActiveExpect();
})

var XJSSCServerTime;
var LocalXJSSCSubServerSecond;
var ActiveXJSSCExpectDgendtime;
var ActiveXJSSCExpect;
var DgXJSSCEndRemainSecond;
var fasecond = 60;
var IsGetLocalXJSSCSubServerSecond = false;
var DgXJSSCEndRemainSecondMsg
/*取服务器时间*/
function GetXJSSCTimeComparetoServer()
{
	IsGetLocalXJSSCSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=新疆时时彩",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalXJSSCSubServerSecond = true;
				var row = $(data).find("row");
				XJSSCServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalXJSSCSubServerSecond = Math.round((Date.parse(date)-Date.parse(XJSSCServerTime.replace(/-/g,"/")))/1000);
				LocalXJSSCSubServerSecond = LocalXJSSCSubServerSecond-1;
				ActiveXJSSCExpectDgendtime = $(row).attr("endtime");
				ActiveXJSSCExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function XJSSCMinusSeconds()
{
	var date = new Date();
	DgXJSSCEndRemainSecond = Math.round((Date.parse(ActiveXJSSCExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalXJSSCSubServerSecond);
	var h = Math.floor(DgXJSSCEndRemainSecond/3600);
	var m = Math.floor((DgXJSSCEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgXJSSCEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgXJSSCEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgXJSSCEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgXJSSCEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowXJSSCActiveExpect()
{
	if (IsGetLocalXJSSCSubServerSecond)
	{
		XJSSCMinusSeconds();
		if(DgXJSSCEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#XJSSCIssue").html(""+ActiveXJSSCExpect+"");
			$("#XJSSCIssueEnd").html(DgXJSSCEndRemainSecondMsg);
		}
		else
		{
			$("#XJSSCIssue").html("请等待开售")
			$("#XJSSCIssueEnd").html("00:00");
			GetXJSSCTimeComparetoServer();
		}
	}
	setTimeout("ShowXJSSCActiveExpect()",1000);
}

$(function(){
	GetXJSSCTimeComparetoServer();
	ShowXJSSCActiveExpect();
})


var HLJSSCServerTime;
var LocalHLJSSCSubServerSecond;
var ActiveHLJSSCExpectDgendtime;
var ActiveHLJSSCExpect;
var DgHLJSSCEndRemainSecond;
var fasecond = 60;
var IsGetLocalHLJSSCSubServerSecond = false;
var DgHLJSSCEndRemainSecondMsg
/*取服务器时间*/
function GetHLJSSCTimeComparetoServer()
{
	IsGetLocalHLJSSCSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=黑龙江时时彩",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalHLJSSCSubServerSecond = true;
				var row = $(data).find("row");
				HLJSSCServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalHLJSSCSubServerSecond = Math.round((Date.parse(date)-Date.parse(HLJSSCServerTime.replace(/-/g,"/")))/1000);
				LocalHLJSSCSubServerSecond = LocalHLJSSCSubServerSecond-1;
				ActiveHLJSSCExpectDgendtime = $(row).attr("endtime");
				ActiveHLJSSCExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function HLJSSCMinusSeconds()
{
	var date = new Date();
	DgHLJSSCEndRemainSecond = Math.round((Date.parse(ActiveHLJSSCExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalHLJSSCSubServerSecond);
	var h = Math.floor(DgHLJSSCEndRemainSecond/3600);
	var m = Math.floor((DgHLJSSCEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgHLJSSCEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgHLJSSCEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgHLJSSCEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgHLJSSCEndRemainSecondMsg = h+":"+m+":"+s;
	}
}



/*显示当前期信息*/
function ShowHLJSSCActiveExpect()
{
	if (IsGetLocalHLJSSCSubServerSecond)
	{
		HLJSSCMinusSeconds();
		if(DgHLJSSCEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#HLJSSCIssue").html(""+ActiveHLJSSCExpect+"");
			$("#HLJSSCIssueEnd").html(DgHLJSSCEndRemainSecondMsg);
		}
		else
		{
			$("#HLJSSCIssue").html("请等待开售")
			$("#HLJSSCIssueEnd").html("00:00");
			GetHLJSSCTimeComparetoServer();
		}
	}
	setTimeout("ShowHLJSSCActiveExpect()",1000);
}

$(function(){
	GetHLJSSCTimeComparetoServer();
	ShowHLJSSCActiveExpect();
})

var SYXWServerTime;
var LocalSYXWSubServerSecond;
var ActiveSYXWExpectDgendtime;
var ActiveSYXWExpect;
var DgSYXWEndRemainSecond;
var fasecond = 60;
var IsGetLocalSYXWSubServerSecond = false;
var DgSYXWEndRemainSecondMsg
/*取服务器时间*/
function GetSYXWTimeComparetoServer()
{
	IsGetLocalSYXWSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=江西11选5",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalSYXWSubServerSecond = true;
				var row = $(data).find("row");
				SYXWServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalSYXWSubServerSecond = Math.round((Date.parse(date)-Date.parse(SYXWServerTime.replace(/-/g,"/")))/1000);
				LocalSYXWSubServerSecond = LocalSYXWSubServerSecond-1;
				ActiveSYXWExpectDgendtime = $(row).attr("endtime");
				ActiveSYXWExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function SYXWMinusSeconds()
{
	var date = new Date();
	DgSYXWEndRemainSecond = Math.round((Date.parse(ActiveSYXWExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalSYXWSubServerSecond);
	var h = Math.floor(DgSYXWEndRemainSecond/3600);
	var m = Math.floor((DgSYXWEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgSYXWEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgSYXWEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgSYXWEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgSYXWEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowSYXWActiveExpect()
{
	if (IsGetLocalSYXWSubServerSecond)
	{
		SYXWMinusSeconds();
		if(DgSYXWEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#SYXWIssue").html(""+ActiveSYXWExpect+"");
			$("#SYXWIssueEnd").html(DgSYXWEndRemainSecondMsg);
		}
		else
		{
			$("#SYXWIssue").html("请等待开售")
			$("#SYXWIssueEnd").html("00:00");
			GetSYXWTimeComparetoServer();
		}
	}
	setTimeout("ShowSYXWActiveExpect()",1000);
}

$(function(){
	GetSYXWTimeComparetoServer();
	ShowSYXWActiveExpect();
})


var SYYDJServerTime;
var LocalSYYDJSubServerSecond;
var ActiveSYYDJExpectDgendtime;
var ActiveSYYDJExpect;
var DgSYYDJEndRemainSecond;
var fasecond = 60;
var IsGetLocalSYYDJSubServerSecond = false;
var DgSYYDJEndRemainSecondMsg
/*取服务器时间*/
function GetSYYDJTimeComparetoServer()
{
	IsGetLocalSYYDJSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=11运夺金",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalSYYDJSubServerSecond = true;
				var row = $(data).find("row");
				SYYDJServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalSYYDJSubServerSecond = Math.round((Date.parse(date)-Date.parse(SYYDJServerTime.replace(/-/g,"/")))/1000);
				LocalSYYDJSubServerSecond = LocalSYYDJSubServerSecond-1;
				ActiveSYYDJExpectDgendtime = $(row).attr("endtime");
				ActiveSYYDJExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function SYYDJMinusSeconds()
{
	var date = new Date();
	DgSYYDJEndRemainSecond = Math.round((Date.parse(ActiveSYYDJExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalSYYDJSubServerSecond);
	var h = Math.floor(DgSYYDJEndRemainSecond/3600);
	var m = Math.floor((DgSYYDJEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgSYYDJEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgSYYDJEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgSYYDJEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgSYYDJEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowSYYDJActiveExpect()
{
	if (IsGetLocalSYYDJSubServerSecond)
	{
		SYYDJMinusSeconds();
		if(DgSYYDJEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#SYYDJIssue").html(""+ActiveSYYDJExpect+"");
			$("#SYYDJIssueEnd").html(DgSYYDJEndRemainSecondMsg);
		}
		else
		{
			$("#SYYDJIssue").html("请等待开售")
			$("#SYYDJIssueEnd").html("00:00");
			GetSYYDJTimeComparetoServer();
		}
	}
	setTimeout("ShowSYYDJActiveExpect()",1000);
}

$(function(){
	GetSYYDJTimeComparetoServer();
	ShowSYYDJActiveExpect();
})


var GDSYXWServerTime;
var LocalGDSYXWSubServerSecond;
var ActiveGDSYXWExpectDgendtime;
var ActiveGDSYXWExpect;
var DgGDSYXWEndRemainSecond;
var fasecond = 60;
var IsGetLocalGDSYXWSubServerSecond = false;
var DgGDSYXWEndRemainSecondMsg
/*取服务器时间*/
function GetGDSYXWTimeComparetoServer()
{
	IsGetLocalGDSYXWSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=广东11选5",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalGDSYXWSubServerSecond = true;
				var row = $(data).find("row");
				GDSYXWServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalGDSYXWSubServerSecond = Math.round((Date.parse(date)-Date.parse(GDSYXWServerTime.replace(/-/g,"/")))/1000);
				LocalGDSYXWSubServerSecond = LocalGDSYXWSubServerSecond-1;
				ActiveGDSYXWExpectDgendtime = $(row).attr("endtime");
				ActiveGDSYXWExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function GDSYXWMinusSeconds()
{
	var date = new Date();
	DgGDSYXWEndRemainSecond = Math.round((Date.parse(ActiveGDSYXWExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalGDSYXWSubServerSecond);
	var h = Math.floor(DgGDSYXWEndRemainSecond/3600);
	var m = Math.floor((DgGDSYXWEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgGDSYXWEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgGDSYXWEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgGDSYXWEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgGDSYXWEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowGDSYXWActiveExpect()
{
	if (IsGetLocalGDSYXWSubServerSecond)
	{
		GDSYXWMinusSeconds();
		if(DgGDSYXWEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#GDSYXWIssue").html(""+ActiveGDSYXWExpect+"");
			$("#GDSYXWIssueEnd").html(DgGDSYXWEndRemainSecondMsg);
		}
		else
		{
			$("#GDSYXWIssue").html("请等待开售")
			$("#GDSYXWIssueEnd").html("00:00");
			GetGDSYXWTimeComparetoServer();
		}
	}
	setTimeout("ShowGDSYXWActiveExpect()",1000);
}

$(function(){
	GetGDSYXWTimeComparetoServer();
	ShowGDSYXWActiveExpect();
})


var CQSYXWServerTime;
var LocalCQSYXWSubServerSecond;
var ActiveCQSYXWExpectDgendtime;
var ActiveCQSYXWExpect;
var DgCQSYXWEndRemainSecond;
var fasecond = 60;
var IsGetLocalCQSYXWSubServerSecond = false;
var DgCQSYXWEndRemainSecondMsg
/*取服务器时间*/
function GetCQSYXWTimeComparetoServer()
{
	IsGetLocalCQSYXWSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=重庆11选5",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalCQSYXWSubServerSecond = true;
				var row = $(data).find("row");
				CQSYXWServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalCQSYXWSubServerSecond = Math.round((Date.parse(date)-Date.parse(CQSYXWServerTime.replace(/-/g,"/")))/1000);
				LocalCQSYXWSubServerSecond = LocalCQSYXWSubServerSecond-1;
				ActiveCQSYXWExpectDgendtime = $(row).attr("endtime");
				ActiveCQSYXWExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function CQSYXWMinusSeconds()
{
	var date = new Date();
	DgCQSYXWEndRemainSecond = Math.round((Date.parse(ActiveCQSYXWExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalCQSYXWSubServerSecond);
	var h = Math.floor(DgCQSYXWEndRemainSecond/3600);
	var m = Math.floor((DgCQSYXWEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgCQSYXWEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgCQSYXWEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgCQSYXWEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgCQSYXWEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowCQSYXWActiveExpect()
{
	if (IsGetLocalCQSYXWSubServerSecond)
	{
		CQSYXWMinusSeconds();
		if(DgCQSYXWEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#CQSYXWIssue").html(""+ActiveCQSYXWExpect+"");
			$("#CQSYXWIssueEnd").html(DgCQSYXWEndRemainSecondMsg);
		}
		else
		{
			$("#CQSYXWIssue").html("请等待开售")
			$("#CQSYXWIssueEnd").html("00:00");
			GetCQSYXWTimeComparetoServer();
		}
	}
	setTimeout("ShowCQSYXWActiveExpect()",1000);
}

$(function(){
	GetCQSYXWTimeComparetoServer();
	ShowCQSYXWActiveExpect();
})


var AHSYXWServerTime;
var LocalAHSYXWSubServerSecond;
var ActiveAHSYXWExpectDgendtime;
var ActiveAHSYXWExpect;
var DgAHSYXWEndRemainSecond;
var fasecond = 60;
var IsGetLocalAHSYXWSubServerSecond = false;
var DgAHSYXWEndRemainSecondMsg
/*取服务器时间*/
function GetAHSYXWTimeComparetoServer()
{
	IsGetLocalAHSYXWSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=安徽11选5",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalAHSYXWSubServerSecond = true;
				var row = $(data).find("row");
				AHSYXWServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalAHSYXWSubServerSecond = Math.round((Date.parse(date)-Date.parse(AHSYXWServerTime.replace(/-/g,"/")))/1000);
				LocalAHSYXWSubServerSecond = LocalAHSYXWSubServerSecond-1;
				ActiveAHSYXWExpectDgendtime = $(row).attr("endtime");
				ActiveAHSYXWExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function AHSYXWMinusSeconds()
{
	var date = new Date();
	DgAHSYXWEndRemainSecond = Math.round((Date.parse(ActiveAHSYXWExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalAHSYXWSubServerSecond);
	var h = Math.floor(DgAHSYXWEndRemainSecond/3600);
	var m = Math.floor((DgAHSYXWEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgAHSYXWEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgAHSYXWEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgAHSYXWEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgAHSYXWEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowAHSYXWActiveExpect()
{
	if (IsGetLocalAHSYXWSubServerSecond)
	{
		AHSYXWMinusSeconds();
		if(DgAHSYXWEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#AHSYXWIssue").html(""+ActiveAHSYXWExpect+"");
			$("#AHSYXWIssueEnd").html(DgAHSYXWEndRemainSecondMsg);
		}
		else
		{
			$("#AHSYXWIssue").html("请等待开售")
			$("#AHSYXWIssueEnd").html("00:00");
			GetAHSYXWTimeComparetoServer();
		}
	}
	setTimeout("ShowAHSYXWActiveExpect()",1000);
}

$(function(){
	GetAHSYXWTimeComparetoServer();
	ShowAHSYXWActiveExpect();
})


var JSSYXWServerTime;
var LocalJSSYXWSubServerSecond;
var ActiveJSSYXWExpectDgendtime;
var ActiveJSSYXWExpect;
var DgJSSYXWEndRemainSecond;
var fasecond = 60;
var IsGetLocalJSSYXWSubServerSecond = false;
var DgJSSYXWEndRemainSecondMsg
/*取服务器时间*/
function GetJSSYXWTimeComparetoServer()
{
	IsGetLocalJSSYXWSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=江苏11选5",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalJSSYXWSubServerSecond = true;
				var row = $(data).find("row");
				JSSYXWServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalJSSYXWSubServerSecond = Math.round((Date.parse(date)-Date.parse(JSSYXWServerTime.replace(/-/g,"/")))/1000);
				LocalJSSYXWSubServerSecond = LocalJSSYXWSubServerSecond-1;
				ActiveJSSYXWExpectDgendtime = $(row).attr("endtime");
				ActiveJSSYXWExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function JSSYXWMinusSeconds()
{
	var date = new Date();
	DgJSSYXWEndRemainSecond = Math.round((Date.parse(ActiveJSSYXWExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalJSSYXWSubServerSecond);
	var h = Math.floor(DgJSSYXWEndRemainSecond/3600);
	var m = Math.floor((DgJSSYXWEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgJSSYXWEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgJSSYXWEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgJSSYXWEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgJSSYXWEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowJSSYXWActiveExpect()
{
	if (IsGetLocalJSSYXWSubServerSecond)
	{
		JSSYXWMinusSeconds();
		if(DgJSSYXWEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#JSSYXWIssue").html(""+ActiveJSSYXWExpect+"");
			$("#JSSYXWIssueEnd").html(DgJSSYXWEndRemainSecondMsg);
		}
		else
		{
			$("#JSSYXWIssue").html("请等待开售")
			$("#JSSYXWIssueEnd").html("00:00");
			GetJSSYXWTimeComparetoServer();
		}
	}
	setTimeout("ShowJSSYXWActiveExpect()",1000);
}

$(function(){
	GetJSSYXWTimeComparetoServer();
	ShowJSSYXWActiveExpect();
})


var JSKSServerTime;
var LocalJSKSSubServerSecond;
var ActiveJSKSExpectDgendtime;
var ActiveJSKSExpect;
var DgJSKSEndRemainSecond;
var fasecond = 60;
var IsGetLocalJSKSSubServerSecond = false;
var DgJSKSEndRemainSecondMsg
/*取服务器时间*/
function GetJSKSTimeComparetoServer()
{
	IsGetLocalJSKSSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=江苏快3",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalJSKSSubServerSecond = true;
				var row = $(data).find("row");
				JSKSServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalJSKSSubServerSecond = Math.round((Date.parse(date)-Date.parse(JSKSServerTime.replace(/-/g,"/")))/1000);
				LocalJSKSSubServerSecond = LocalJSKSSubServerSecond-1;
				ActiveJSKSExpectDgendtime = $(row).attr("endtime");
				ActiveJSKSExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function JSKSMinusSeconds()
{
	var date = new Date();
	DgJSKSEndRemainSecond = Math.round((Date.parse(ActiveJSKSExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalJSKSSubServerSecond);
	var h = Math.floor(DgJSKSEndRemainSecond/3600);
	var m = Math.floor((DgJSKSEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgJSKSEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgJSKSEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgJSKSEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgJSKSEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowJSKSActiveExpect()
{
	if (IsGetLocalJSKSSubServerSecond)
	{
		JSKSMinusSeconds();
		if(DgJSKSEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#JSKSIssue").html(""+ActiveJSKSExpect+"");
			$("#JSKSIssueEnd").html(DgJSKSEndRemainSecondMsg);
		}
		else
		{
			$("#JSKSIssue").html("请等待开售")
			$("#JSKSIssueEnd").html("00:00");
			GetJSKSTimeComparetoServer();
		}
	}
	setTimeout("ShowJSKSActiveExpect()",1000);
}

$(function(){
	GetJSKSTimeComparetoServer();
	ShowJSKSActiveExpect();
})


var AHKSServerTime;
var LocalAHKSSubServerSecond;
var ActiveAHKSExpectDgendtime;
var ActiveAHKSExpect;
var DgAHKSEndRemainSecond;
var fasecond = 60;
var IsGetLocalAHKSSubServerSecond = false;
var DgAHKSEndRemainSecondMsg
/*取服务器时间*/
function GetAHKSTimeComparetoServer()
{
	IsGetLocalAHKSSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=安徽快3",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalAHKSSubServerSecond = true;
				var row = $(data).find("row");
				AHKSServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalAHKSSubServerSecond = Math.round((Date.parse(date)-Date.parse(AHKSServerTime.replace(/-/g,"/")))/1000);
				LocalAHKSSubServerSecond = LocalAHKSSubServerSecond-1;
				ActiveAHKSExpectDgendtime = $(row).attr("endtime");
				ActiveAHKSExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function AHKSMinusSeconds()
{
	var date = new Date();
	DgAHKSEndRemainSecond = Math.round((Date.parse(ActiveAHKSExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalAHKSSubServerSecond);
	var h = Math.floor(DgAHKSEndRemainSecond/3600);
	var m = Math.floor((DgAHKSEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgAHKSEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgAHKSEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgAHKSEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgAHKSEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowAHKSActiveExpect()
{
	if (IsGetLocalAHKSSubServerSecond)
	{
		AHKSMinusSeconds();
		if(DgAHKSEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#AHKSIssue").html(""+ActiveAHKSExpect+"");
			$("#AHKSIssueEnd").html(DgAHKSEndRemainSecondMsg);
		}
		else
		{
			$("#AHKSIssue").html("请等待开售")
			$("#AHKSIssueEnd").html("00:00");
			GetAHKSTimeComparetoServer();
		}
	}
	setTimeout("ShowAHKSActiveExpect()",1000);
}

$(function(){
	GetAHKSTimeComparetoServer();
	ShowAHKSActiveExpect();
})


var JLKSServerTime;
var LocalJLKSSubServerSecond;
var ActiveJLKSExpectDgendtime;
var ActiveJLKSExpect;
var DgJLKSEndRemainSecond;
var fasecond = 60;
var IsGetLocalJLKSSubServerSecond = false;
var DgJLKSEndRemainSecondMsg
/*取服务器时间*/
function GetJLKSTimeComparetoServer()
{
	IsGetLocalJLKSSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=吉林快3",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalJLKSSubServerSecond = true;
				var row = $(data).find("row");
				JLKSServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalJLKSSubServerSecond = Math.round((Date.parse(date)-Date.parse(JLKSServerTime.replace(/-/g,"/")))/1000);
				LocalJLKSSubServerSecond = LocalJLKSSubServerSecond-1;
				ActiveJLKSExpectDgendtime = $(row).attr("endtime");
				ActiveJLKSExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function JLKSMinusSeconds()
{
	var date = new Date();
	DgJLKSEndRemainSecond = Math.round((Date.parse(ActiveJLKSExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalJLKSSubServerSecond);
	var h = Math.floor(DgJLKSEndRemainSecond/3600);
	var m = Math.floor((DgJLKSEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgJLKSEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgJLKSEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgJLKSEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgJLKSEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowJLKSActiveExpect()
{
	if (IsGetLocalJLKSSubServerSecond)
	{
		JLKSMinusSeconds();
		if(DgJLKSEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#JLKSIssue").html(""+ActiveJLKSExpect+"");
			$("#JLKSIssueEnd").html(DgJLKSEndRemainSecondMsg);
		}
		else
		{
			$("#JLKSIssue").html("请等待开售")
			$("#JLKSIssueEnd").html("00:00");
			GetJLKSTimeComparetoServer();
		}
	}
	setTimeout("ShowJLKSActiveExpect()",1000);
}

$(function(){
	GetJLKSTimeComparetoServer();
	ShowJLKSActiveExpect();
})


var GdKlsfServerTime;
var LocalGdKlsfSubServerSecond;
var ActiveGdKlsfExpectDgendtime;
var ActiveGdKlsfExpect;
var DgGdKlsfEndRemainSecond;
var fasecond = 60;
var IsGetLocalGdKlsfSubServerSecond = false;
var DgGdKlsfEndRemainSecondMsg
/*取服务器时间*/
function GetGdKlsfTimeComparetoServer()
{
	IsGetLocalGdKlsfSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=广东快乐十分",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalGdKlsfSubServerSecond = true;
				var row = $(data).find("row");
				GdKlsfServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalGdKlsfSubServerSecond = Math.round((Date.parse(date)-Date.parse(GdKlsfServerTime.replace(/-/g,"/")))/1000);
				LocalGdKlsfSubServerSecond = LocalGdKlsfSubServerSecond-1;
				ActiveGdKlsfExpectDgendtime = $(row).attr("endtime");
				ActiveGdKlsfExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function GdKlsfMinusSeconds()
{
	var date = new Date();
	DgGdKlsfEndRemainSecond = Math.round((Date.parse(ActiveGdKlsfExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalGdKlsfSubServerSecond);
	var h = Math.floor(DgGdKlsfEndRemainSecond/3600);
	var m = Math.floor((DgGdKlsfEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgGdKlsfEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgGdKlsfEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgGdKlsfEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgGdKlsfEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowGdKlsfActiveExpect()
{
	if (IsGetLocalGdKlsfSubServerSecond)
	{
		GdKlsfMinusSeconds();
		if(DgGdKlsfEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#GdKlsfIssue").html(""+ActiveGdKlsfExpect+"");
			$("#GdKlsfIssueEnd").html(DgGdKlsfEndRemainSecondMsg);
		}
		else
		{
			$("#GdKlsfIssue").html("请等待开售")
			$("#GdKlsfIssueEnd").html("00:00");
			GetGdKlsfTimeComparetoServer();
		}
	}
	setTimeout("ShowGdKlsfActiveExpect()",1000);
}

$(function(){
	GetGdKlsfTimeComparetoServer();
	ShowGdKlsfActiveExpect();
})


var HnKlsfServerTime;
var LocalHnKlsfSubServerSecond;
var ActiveHnKlsfExpectDgendtime;
var ActiveHnKlsfExpect;
var DgHnKlsfEndRemainSecond;
var fasecond = 60;
var IsGetLocalHnKlsfSubServerSecond = false;
var DgHnKlsfEndRemainSecondMsg
/*取服务器时间*/
function GetHnKlsfTimeComparetoServer()
{
	IsGetLocalHnKlsfSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?Lottery=广东快乐十分",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalHnKlsfSubServerSecond = true;
				var row = $(data).find("row");
				HnKlsfServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalHnKlsfSubServerSecond = Math.round((Date.parse(date)-Date.parse(HnKlsfServerTime.replace(/-/g,"/")))/1000);
				LocalHnKlsfSubServerSecond = LocalHnKlsfSubServerSecond-1;
				ActiveHnKlsfExpectDgendtime = $(row).attr("endtime");
				ActiveHnKlsfExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function HnKlsfMinusSeconds()
{
	var date = new Date();
	DgHnKlsfEndRemainSecond = Math.round((Date.parse(ActiveHnKlsfExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalHnKlsfSubServerSecond);
	var h = Math.floor(DgHnKlsfEndRemainSecond/3600);
	var m = Math.floor((DgHnKlsfEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgHnKlsfEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgHnKlsfEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgHnKlsfEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgHnKlsfEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowHnKlsfActiveExpect()
{
	if (IsGetLocalHnKlsfSubServerSecond)
	{
		HnKlsfMinusSeconds();
		if(DgHnKlsfEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#HnKlsfIssue").html(""+ActiveHnKlsfExpect+"");
			$("#HnKlsfIssueEnd").html(DgHnKlsfEndRemainSecondMsg);
		}
		else
		{
			$("#HnKlsfIssue").html("请等待开售")
			$("#HnKlsfIssueEnd").html("00:00");
			GetHnKlsfTimeComparetoServer();
		}
	}
	setTimeout("ShowHnKlsfActiveExpect()",1000);
}

$(function(){
	GetHnKlsfTimeComparetoServer();
	ShowHnKlsfActiveExpect();
})

var PLSServerTime;
var LocalPLSSubServerSecond;
var ActivePLSExpectDgendtime;
var ActivePLSExpect;
var DgPLSEndRemainSecond;
var fasecond = 60;
var IsGetLocalPLSSubServerSecond = false;
var DgPLSEndRemainSecondMsg
/*取服务器时间*/
function GetPLSTimeComparetoServer()
{
	IsGetLocalPLSSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?action=Dpc&Lottery=排列三",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalPLSSubServerSecond = true;
				var row = $(data).find("row");
				PLSServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalPLSSubServerSecond = Math.round((Date.parse(date)-Date.parse(PLSServerTime.replace(/-/g,"/")))/1000);
				LocalPLSSubServerSecond = LocalPLSSubServerSecond-1;
				ActivePLSExpectDgendtime = $(row).attr("endtime");
				ActivePLSExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function PLSMinusSeconds()
{
	var date = new Date();
	DgPLSEndRemainSecond = Math.round((Date.parse(ActivePLSExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalPLSSubServerSecond);
	var h = Math.floor(DgPLSEndRemainSecond/3600);
	var m = Math.floor((DgPLSEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgPLSEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgPLSEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgPLSEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgPLSEndRemainSecondMsg = h+":"+m+":"+s;
	}
}


/*显示当前期信息*/
function ShowPLSActiveExpect()
{
	if (IsGetLocalPLSSubServerSecond)
	{
		PLSMinusSeconds();
		if(DgPLSEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#PLSIssue").html(""+ActivePLSExpect+"");
			$("#PLSIssueEnd").html(DgPLSEndRemainSecondMsg);
		}
		else
		{
			$("#PLSIssue").html("销售截止")
			$("#PLSIssueEnd").html("00:00");
			GetPLSTimeComparetoServer();
		}
	}
	setTimeout("ShowPLSActiveExpect()",1000);
}

$(function(){
	GetPLSTimeComparetoServer();
	ShowPLSActiveExpect();
})


var SDServerTime;
var LocalSDSubServerSecond;
var ActiveSDExpectDgendtime;
var ActiveSDExpect;
var DgSDEndRemainSecond;
var fasecond = 60;
var IsGetLocalSDSubServerSecond = false;
var DgSDEndRemainSecondMsg
/*取服务器时间*/
function GetSDTimeComparetoServer()
{
	IsGetLocalSDSubServerSecond = false;
	$.ajax({
		type: "POST",
		url: "/Trade/GetTimeXml.asp?action=Dpc&Lottery=福彩3D",
		data: {},
		dataType:"xml",
		success: function(data){
			var err = $(data).find("err");
			if($(err).attr("type")=="1")
			{
				IsGetLocalSDSubServerSecond = true;
				var row = $(data).find("row");
				SDServerTime = $(row).attr("servertime");
				var date = new Date();
				LocalSDSubServerSecond = Math.round((Date.parse(date)-Date.parse(SDServerTime.replace(/-/g,"/")))/1000);
				LocalSDSubServerSecond = LocalSDSubServerSecond-1;
				ActiveSDExpectDgendtime = $(row).attr("endtime");
				ActiveSDExpect = $(row).attr("expect");
			}
			else
			{}
		}
	});
}



//计算离各时间还有多少秒
function SDMinusSeconds()
{
	var date = new Date();
	DgSDEndRemainSecond = Math.round((Date.parse(ActiveSDExpectDgendtime.replace(/-/g,"/"))-Date.parse(date))/1000+LocalSDSubServerSecond);
	var h = Math.floor(DgSDEndRemainSecond/3600);
	var m = Math.floor((DgSDEndRemainSecond-h*3600)/60);
	if (m<10)
	{
		m = "0"+m;
		//m = m;
	}
	var s = DgSDEndRemainSecond%60;
	if(s<10)
	{
		s = "0"+s;
		//s = s;
	}
	if (h<1)
	{
		m = Math.floor(DgSDEndRemainSecond/60);
		if (m<10)
		{
			m = "0"+m;
			//m = m;
		}
		DgSDEndRemainSecondMsg = m+":"+s;
	}
	else
	{
		if (h<10)
		{
			h = "0"+h;
		}
		DgSDEndRemainSecondMsg = h+":"+m+":"+s;
	}

}


/*显示当前期信息*/
function ShowSDActiveExpect()
{
	if (IsGetLocalSDSubServerSecond)
	{
		SDMinusSeconds();
		if(DgSDEndRemainSecond>0) //售卖中，截止倒计时
		{
			//显示当前期期号
			$("#SDIssue").html(""+ActiveSDExpect+"");
			$("#SDIssueEnd").html(DgSDEndRemainSecondMsg);
		}
		else
		{
			$("#SDIssue").html("销售截止")
			$("#SDIssueEnd").html("00:00");
			GetSDTimeComparetoServer();
		}
	}
	setTimeout("ShowSDActiveExpect()",1000);
}

$(function(){
	GetSDTimeComparetoServer();
	ShowSDActiveExpect();
})