
	function GetServerTime(ids,timer)
	{
		var now = new Date();
		var urodz = new Date(timer);
		now.setTime(now.getTime()+250);
		days = (urodz - now) / 1000 / 60 / 60 / 24;
		daysRound = Math.floor(days);
		hours = (urodz - now) / 1000 / 60 / 60 - (24 * daysRound);
		hoursRound = Math.floor(hours);
		minutes = (urodz - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
		minutesRound = Math.floor(minutes);
		seconds = (urodz - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
		secondsRound = Math.round(seconds);
		try{ 
			document.getElementById(ids).innerHTML = daysRound + "天" + hoursRound + "时" + minutesRound + "分" + secondsRound + "秒";
		} 
		catch(Exception){ 
			
		}
		if(daysRound<0){
			days = urodz / 1000 / 60 / 60 / 24;
			daysRound = Math.floor(days);
			hours = urodz / 1000 / 60 / 60 - (24 * daysRound);
			hoursRound = Math.floor(hours);
			minutes = urodz / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
			minutesRound = Math.floor(minutes);
			seconds = urodz / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
			secondsRound = Math.round(seconds);
			try{ 
				document.getElementById(ids).innerHTML = "<span style=\"color:#FF0000\">本团购已结束</style>";
			} 
			catch(Exception){ 
			
			}
		}
		
	}
	

function countDown(){
var i;
var objArray =document.getElementsByTagName("label");
//alert(objArray.length);
for (i=0;i<(objArray.length);i++)
{
	

if (objArray[i].id.indexOf("article_")>-1) 
{

objHid = document.getElementById("hid_article_" + objArray[i].id.substring(objArray[i].id.indexOf("_")+1)); 

//objHid.value就是对应的时间值，然后改下面就行了

var d=Date.parse(objHid.value);

var today=new Date();
var time=d-today;


var 时间=objArray[i];
if(Math.floor(time)<=0){
时间.innerHTML='抢购时间已过!';

}
else
{
var 天=Math.floor(time/(1000*60*60*24));
var 小时=Math.floor(time/(1000*60*60))%24;
var 分=Math.floor(time/(1000*60))%60;
var 秒=Math.floor(time/1000)%60;
时间.innerHTML=天+'<font style="font-size:12px;">天</font>'+小时+'<font style="font-size:12px;">时</font>'+分+'<font style="font-size:12px;">分</font>'+秒+'<font style="font-size:12px;">秒</font>';
时间.style.fontSize='16px';
时间.style.color='5f5f5f';
} 

}
}
setTimeout('countDown()',1000);
}
countDown();
	

//上面是到计时


//下面是Ajax更新点击次数
function doOnClick(objName,STid) {
    if (window.XMLHttpRequest) {req = new XMLHttpRequest();} 
	else if (window.ActiveXObject) {req = new ActiveXObject("Microsoft.XMLHTTP");}
    req.open( "get", "/inc/ajax_click.asp?"+objName+"="+STid, false );
    req.send();
	
    //FlagReg = req.responseBody
   // FlagReg = req.responseText
	//var clicknum="click_"+STid;
		//document.getElementById(clicknum).innerHTML = FlagReg;
}
