/* 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 TargetDate145 = "3/13/2017 00:00"; var SourceDate145 = "08/18/2018 14:59:01"; //var BackColor145; //var ForeColor145; var DisplayFormat145; var FinishMessage145; var LeadingZero145; //if(!BackColor145) BackColor145 = "palegreen"; //if (BackColor) BackColor145=BackColor; //if(!ForeColor145) ForeColor145 = "navy"; //if (ForeColor) ForeColor145=ForeColor; CountActive145 = true; CountStepper145 = -1; LeadingZero145 = true; if(!DisplayFormat145) DisplayFormat145 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat145=DisplayFormat; if(!FinishMessage145) FinishMessage145 = "Closed!"; if (FinishMessage) FinishMessage145=FinishMessage; function calcage145(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero145 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack145(secs) { if (secs < 0) { document.getElementById("cntdwn145").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage145(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage145(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage145(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage145(secs,1,60)); document.getElementById("cntdwn145").innerHTML = DisplayStr; if (CountActive145) setTimeout("CountBack145(" + (secs+CountStepper145) + ")", SetTimeOutPeriod145); } function putspan145() { document.write(""); } //if (typeof(BackColor145)=="undefined") // BackColor145 = "white"; //if (typeof(ForeColor145)=="undefined") // ForeColor145= "black"; if (typeof(TargetDate145)=="undefined") TargetDate145 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat145)=="undefined") DisplayFormat145 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive145)=="undefined") CountActive145 = true; if (typeof(FinishMessage145)=="undefined") FinishMessage145 = ""; if (typeof(CountStepper145)!="number") CountStepper145 = -1; if (typeof(LeadingZero145)=="undefined") LeadingZero145 = true; CountStepper145 = Math.ceil(CountStepper145); if (CountStepper145 == 0) CountActive145 = false; var SetTimeOutPeriod145 = (Math.abs(CountStepper145)-1)*1000 + 990; //putspan145(BackColor145, ForeColor145); putspan145(); var dthen145 = new Date(TargetDate145); var dnow145 = new Date(SourceDate145); if(CountStepper145>0) ddiff145 = new Date(dnow145-dthen145); else ddiff145 = new Date(dthen145-dnow145); gsecs145 = Math.floor(ddiff145.valueOf()/1000); CountBack145(gsecs145);