aquí dejo el codigo del contador regresivo:
Código:
// Contador regresivo en java // definimos estilos ... document.write("<form name='p56'><input style='text-align:center; font-family:arial, helvetica, sans-serif; font-size:14px; width:450px; color:#ffffff;font-weight:normal;background-color:transparent; padding:3px; margin:0px 0px 0px 0px;overflow:visible;border:0px;' id='pagein' name='pageinval85'/></form>"); function countdown_load56() { // definimos el texto antes del evento var the_event="Faltan..."; // definimos el texto despues del evento var on_event="Ahora"; // definimos fecha yr=año, mo=mes, da=dia, Hr=hora var yr=2010;var mo=02;var da=7;var hr=22; // definimos mi=minutos, sec=segundos var min=00;var sec=0; var month=''; var month=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); var bottom_event=""; var now_d=new Date(); var now_year=now_d.getYear(); if (now_year < 1000)now_year+=1900; var now_month=now_d.getMonth(); var now_day=now_d.getDate(); var now_hour=now_d.getHours(); var now_min=now_d.getMinutes(); var now_sec=now_d.getSeconds(); var now_val=month[now_month]+" "+now_day+", "+now_year+" "+now_hour+":"+now_min+":"+now_sec;event_val=month[mo-1]+" "+da+", "+yr+" "+hr+":"+min+":"+sec;difference=Date.parse(event_val)-Date.parse(now_val); differenceday=Math.floor(difference/(60*60*1000*24)*1);differencehour=Math.floor((difference%(60*60*1000*24))/(60*60*1000)*1); differencemin=Math.floor(((difference%(60*60*1000*24))%(60*60*1000))/(60*1000)*1);differencesec=Math.floor((((difference%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1); if(differenceday<=0&&differencehour<=0&&differencemin<=0&&differencesec<=1&&now_day==da) { document.forms.p56.pageinval85.value=on_event;return; } else if (differenceday<=-1) { document.forms.p56.pageinval85.value="Event : "+on_event+" : passed";return; } else{ document.forms.p56.pageinval85.value=the_event+" "+differenceday+" dias "+differencehour+" horas "+differencemin+" minutos "+differencesec+" segundos "+bottom_event } setTimeout("countdown_load56()",1000); } countdown_load56();