/* 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 TargetDate191 = "2/01/2017 16:00"; var SourceDate191 = "08/21/2018 01:42:38"; //var BackColor191; //var ForeColor191; var DisplayFormat191; var FinishMessage191; var LeadingZero191; //if(!BackColor191) BackColor191 = "palegreen"; //if (BackColor) BackColor191=BackColor; //if(!ForeColor191) ForeColor191 = "navy"; //if (ForeColor) ForeColor191=ForeColor; CountActive191 = true; CountStepper191 = -1; LeadingZero191 = true; if(!DisplayFormat191) DisplayFormat191 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat191=DisplayFormat; if(!FinishMessage191) FinishMessage191 = "Closed!"; if (FinishMessage) FinishMessage191=FinishMessage; function calcage191(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero191 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack191(secs) { if (secs < 0) { document.getElementById("cntdwn191").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage191(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage191(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage191(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage191(secs,1,60)); document.getElementById("cntdwn191").innerHTML = DisplayStr; if (CountActive191) setTimeout("CountBack191(" + (secs+CountStepper191) + ")", SetTimeOutPeriod191); } function putspan191() { document.write(""); } //if (typeof(BackColor191)=="undefined") // BackColor191 = "white"; //if (typeof(ForeColor191)=="undefined") // ForeColor191= "black"; if (typeof(TargetDate191)=="undefined") TargetDate191 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat191)=="undefined") DisplayFormat191 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive191)=="undefined") CountActive191 = true; if (typeof(FinishMessage191)=="undefined") FinishMessage191 = ""; if (typeof(CountStepper191)!="number") CountStepper191 = -1; if (typeof(LeadingZero191)=="undefined") LeadingZero191 = true; CountStepper191 = Math.ceil(CountStepper191); if (CountStepper191 == 0) CountActive191 = false; var SetTimeOutPeriod191 = (Math.abs(CountStepper191)-1)*1000 + 990; //putspan191(BackColor191, ForeColor191); putspan191(); var dthen191 = new Date(TargetDate191); var dnow191 = new Date(SourceDate191); if(CountStepper191>0) ddiff191 = new Date(dnow191-dthen191); else ddiff191 = new Date(dthen191-dnow191); gsecs191 = Math.floor(ddiff191.valueOf()/1000); CountBack191(gsecs191);