/* Author: Robert Hashemian, modified by Cosmin Cioranu [cauta pe FB(i)] http://www.hashemian.com/ You can use this code in any manner so long as the author's name, Web address and this disclaimer is kept intact. */ //TargetDate = "12/31/2020 5:00 AM"; var TargetDate243 = "1/16/2018 18:00"; var SourceDate243 = "02/25/2018 23:48:34"; //var BackColor243; //var ForeColor243; var DisplayFormat243; var FinishMessage243; var LeadingZero243; //if(!BackColor243) BackColor243 = "palegreen"; //if (BackColor) BackColor243=BackColor; //if(!ForeColor243) ForeColor243 = "navy"; //if (ForeColor) ForeColor243=ForeColor; CountActive243 = true; CountStepper243 = -1; LeadingZero243 = true; if(!DisplayFormat243) DisplayFormat243 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat243=DisplayFormat; if(!FinishMessage243) FinishMessage243 = "Closed!"; if (FinishMessage) FinishMessage243=FinishMessage; function calcage243(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero243 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack243(secs) { if (secs < 0) { document.getElementById("cntdwn243").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage243(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage243(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage243(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage243(secs,1,60)); document.getElementById("cntdwn243").innerHTML = DisplayStr; if (CountActive243) setTimeout("CountBack243(" + (secs+CountStepper243) + ")", SetTimeOutPeriod243); } function putspan243() { document.write(""); } //if (typeof(BackColor243)=="undefined") // BackColor243 = "white"; //if (typeof(ForeColor243)=="undefined") // ForeColor243= "black"; if (typeof(TargetDate243)=="undefined") TargetDate243 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat243)=="undefined") DisplayFormat243 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive243)=="undefined") CountActive243 = true; if (typeof(FinishMessage243)=="undefined") FinishMessage243 = ""; if (typeof(CountStepper243)!="number") CountStepper243 = -1; if (typeof(LeadingZero243)=="undefined") LeadingZero243 = true; CountStepper243 = Math.ceil(CountStepper243); if (CountStepper243 == 0) CountActive243 = false; var SetTimeOutPeriod243 = (Math.abs(CountStepper243)-1)*1000 + 990; //putspan243(BackColor243, ForeColor243); putspan243(); var dthen243 = new Date(TargetDate243); var dnow243 = new Date(SourceDate243); if(CountStepper243>0) ddiff243 = new Date(dnow243-dthen243); else ddiff243 = new Date(dthen243-dnow243); gsecs243 = Math.floor(ddiff243.valueOf()/1000); CountBack243(gsecs243);