var microsecond = 1000;
function clock(key){
    var time=parseInt($("#leftTime_"+key).html());
	var Diffms =Math.floor(microsecond*(time-1));
	if(Diffms > 0){
		var dSecs = Math.floor(Diffms/ microsecond);
		dSecs = checkTime(dSecs);
		$("#leftTime_"+key).html(dSecs);
	}else{
        refurbish();
	}
}
function checkTime(i){
	if (i < 10) {    
	   i = "0" + i;
	}    
	return i
}