All pastes #989034 Raw Edit

Anonymous

public javascript v1 · immutable
#989034 ·published 2008-04-18 01:49 UTC
rendered paste body
<html><body><script type="text/javascript">function countDown(){var i=0;var end=2;var d=new Array();var h=new Array();var m=new Array();var s=new Array();for (i=0;i<=end;i++){    time = document.getElementById('expire').value.split(":");    n = document.getElementById('expire').name;    finished[n] = false;    l[n] = "length";    d[n] = time[0];    h[n] = time[1];    m[n] = time[2];    s[n] = time[3];}if(d[n] == "ERROR"){ e[n] = "error";finished[n]=true;}mycars.lengthfor (i=0;i<=l.length;i++){    if (s[n] > 0) {        s[n]--;    } else {        s[n] = "59";        if (m[n] > 0) {            m[n]--;        } else {            m[n] = "59";            if (h[n] > 0) {                h[n]--;            } else {                h[n] = "23";                if (d[n] > 0) {                    d[n]--;                } else {                    finished[n] = true;                }            }        }    }h[n]=checkTime(h[n]);m[n]=checkTime(m[n]);s[n]=checkTime(s[n]);if(e[n] == "error"){document.getElementByName(n).value = "ERROR";} else {    document.getElementByName(n).value = d[n]+":"+h[n]+":"+m[n]+":"+s[n];    if (d[n] < 1) {        if (h[n] < 1) {           if (m[n] < 1) {              if (s[n] < 1) {                 document.getElementByName(n).value = "EXPIRED";                 finished[n] = true;              }           }        }   }{    if (!finished[n])        setTimeout('countDown()', 1000);}}setTimeout('countDown()', 1000);var look=new RegExp("0");function checkTime(i){if (i<10) { if(look.exec(i) == null)   {      i="0" + i;   } }return i;}</script><input type='text' id='expire' name='1' value='5:20:04:46'><input type='text' id='expire' name='2' value='2:12:14:26'></body></html>