var timerrunning = []; var timerid = []; var auctiondate = []; var starttime = []; var showtimeid = []; function Showtime () { var _day = ' Day '; var _hour = ' Hour '; var _minute = ' min '; var _second = ' sec '; var _end = ' End '; var dateleft = 0; var hourleft = 0; var minuteleft = 0; var secondleft = 0; var hourzero = "; var minutezero = "; var secondzero = "; var c = auctiondate.length; for (var i = 0, j = auctiondate.length I < J; i++) { if (auctiondate[i] = = null) { C- Continue } now = new Date (); var ts = parseint ((starttime[i]–now.gettime ())/1000) + auctiondate[i]; if (TS < 0) { ts = 0; Curhour = 0; Curminute = 0; Cursecond = 0; } else { Dateleft = parseint (ts/86400); TS = ts–dateleft * 86400; Hourleft = parseint (ts/3600); TS = ts–hourleft * 3600; Minuteleft = parseint (TS/60); Secondleft = Ts–minuteleft * 60; } if (Hourleft < 10) { Hourzero = ' 0′; } if (Minuteleft < 10) { Minutezero = ' 0′; } if (Secondleft <) {Secondzero = ' 0′} if (Dateleft > 0) { Temp = dateleft + _day + hourzero + hourleft + _hour + minutezero + minuteleft + _minute + secondzero + secondleft + _seco nd } else { if (Hourleft > 0) { Temp = hourleft + _hour + minutezero + minuteleft + _minute + secondzero + secondleft + _second; } else { if (Minuteleft > 0) { Temp = minuteleft + _minute + secondzero + secondleft + _second; } else { if (Secondleft > 0) { Temp = Secondleft + _second; } else { Temp = "; } } } } if (ts Temp = "<strong>" + _end + "</strong>"; Auctiondate[i] = null; } if (document.getElementById (Showtimeid[i])) { document.getElementById (Showtimeid[i]). InnerHTML = Temp; } Timerrunning[i] = true; } if (C > 0) { Timerid = settimeout ("Showtime ()", 1000); } } function Stopclock (timerrunning, Timerid) { if (timerrunning) { Cleartimeout (Timerid); } Timerrunning = false; } function Onload_lefttime (now_time, Gmt_end_time, ShowTime) { var auctiondate_tmp = 0; var _gmtendtime = 0; var cur_date = new Date (); _gmtendtime = Gmt_end_time; if (_gmtendtime > 0) { if (now_time = = undefined) { var tmp_val = parseint (_gmtendtime) -parseint (Cur_date.gettime ()/1000 + cur_date.gettimezoneoffset () * 60); } else { var tmp_val = parseint (_gmtendtime) –now_time; } if (Tmp_val > 0) { Auctiondate_tmp = Tmp_val; } } Timerrunning[timerrunning.length] = false; Timerid[timerid.length] = null; Auctiondate[auctiondate.length] = auctiondate_tmp; Starttime[starttime.length] = Cur_date.gettime (); Showtimeid[showtimeid.length] = ShowTime; Showtime (); } |