function contar(ayo,mes,dia,hora,minuto,segundo,id) {

	var a = new Date();
	var dif = new Date(ayo,mes - 1,dia,hora,minuto,segundo); 
	dif = (dif.getTime() - a.getTime())/1000;; 
	if (dif < 0) { 
		if (document.getElementById('llego' + id).style.display == "none") {
			document.getElementById('llego' + id).style.display = "block"; 
		}
		if (document.getElementById('rest' + id).style.display == "block") {
			document.getElementById('rest' + id).style.display = "none"; 
		}
		dif = dif*-1; 
	}
  
	dia= Math.floor(dif/60/60/24);  
	hora= Math.floor((dif - dia*60*60*24)/60/60);
	minuto= Math.floor((dif - dia*60*60*24 - hora*60*60)/60);
	segundo= Math.floor(dif - dia*60*60*24 - hora*60*60 - minuto*60);
	var txt = '';
	if (dia > 0) {
		txt+=dia;
		if (dia != 1) { txt+=' '+contar_days; }
		else { txt+=' '+contar_day; }  	
		txt+= '<br />';
	}
	if (hora > 0 || dia > 0) {
		txt+=hora;
		if (hora != 1) { txt+=' '+contar_hours; }
		else { txt+=' '+contar_hour; }  	
		txt+= '<br />';
	}
	if (minuto > 0 || hora > 0 || dia > 0) {
		txt+=minuto;
		if (minuto != 1) { txt+=' '+contar_minutes; }
		else { txt+=' '+contar_minute; }  	
		txt+= '<br />';
	}
	txt+=segundo;
	if (segundo != 1) { txt+=' '+contar_seconds; }
	else { txt+=' '+contar_second; }  		
	document.getElementById('contar' + id).innerHTML=txt;
}