1/* 2Author: Robert Hashemian 3http://www.hashemian.com/ 4 5You can use this code in any manner so long as the author's 6name, Web address and this disclaimer is kept intact. 7******************************************************** 8Usage Sample: 9 10<script language="JavaScript"> 11TargetDate = "12/31/2020 5:00 AM"; 12BackColor = "palegreen"; 13ForeColor = "navy"; 14CountActive = true; 15CountStepper = -1; 16LeadingZero = true; 17DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; 18FinishMessage = "It is finally here!"; 19</script> 20<script language="JavaScript" src="http://scripts.hashemian.com/js/countdown.js"></script> 21*/ 22 23function CountBack(secs) { 24 if (secs < 0) { 25 $("#countdown").html(FinishMessage); 26 return; 27 } 28 days = calcage(secs,86400,100000); 29 hours = calcage(secs,3600,24); 30 minutes = calcage(secs,60,60); 31 seconds = calcage(secs,1,60); 32 33 $('#remaining-days').html(days); 34 $('#remaining-hours').html(hours); 35 $('#remaining-minutes').html(minutes); 36 $('#remaining-seconds').html(seconds); 37 38 if (CountActive) 39 setTimeout("CountBack(" + (secs+CountStepper) + ")", SetTimeOutPeriod); 40 41 function calcage(secs, num1, num2) { 42 s = ((Math.floor(secs/num1))%num2).toString(); 43 if (LeadingZero && s.length < 2) s = "0" + s; 44 return s; 45 } 46} 47 48CountActive = true; 49FinishMessage = "Refresh to get the new competition!"; 50CountStepper = -1; 51LeadingZero = true; 52 53CountStepper = Math.ceil(CountStepper); 54if (CountStepper == 0) 55 CountActive = false; 56var SetTimeOutPeriod = (Math.abs(CountStepper)-1)*1000 + 990; 57var dthen = TargetDate; 58var dnow = new Date(); 59if(CountStepper>0) 60 ddiff = new Date(dnow-dthen); 61else 62 ddiff = new Date(dthen-dnow); 63gsecs = Math.floor(ddiff.valueOf()/1000); 64 65$(document).ready(function() { 66 CountBack(gsecs); 67});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.