function counter(id,timestamp){
	window.setInterval("showTime("+id+","+timestamp+")", 1000);
}
function showTime(spanId,timestamp){
	var time = new Date();
	var zeroTime = timestamp;
	var countDown = Math.round(zeroTime - time.getTime()/1000);
	var d = Math.floor(countDown/(24*60*60));	
	var h = Math.floor(((countDown-d*24*60*60)/60)/60);
	var m = Math.floor((countDown-d*24*60*60-h*60*60)/60);
	var s = Math.floor((countDown-d*24*60*60-h*60*60-m*60));
	if(zeroTime - time.getTime()/1000 > 0) document.getElementById("countdown_"+spanId).innerHTML = d+"d "+h+"h "+m+"m "+s+"s";
	else document.getElementById("countdown_"+spanId).innerHTML = "0d 0h 0m 0s";
}