/* 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 TargetDate259 = "3/01/2018 15:00"; var SourceDate259 = "05/22/2018 18:49:56"; //var BackColor259; //var ForeColor259; var DisplayFormat259; var FinishMessage259; var LeadingZero259; //if(!BackColor259) BackColor259 = "palegreen"; //if (BackColor) BackColor259=BackColor; //if(!ForeColor259) ForeColor259 = "navy"; //if (ForeColor) ForeColor259=ForeColor; CountActive259 = true; CountStepper259 = -1; LeadingZero259 = true; if(!DisplayFormat259) DisplayFormat259 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat259=DisplayFormat; if(!FinishMessage259) FinishMessage259 = "Closed!"; if (FinishMessage) FinishMessage259=FinishMessage; function calcage259(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero259 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack259(secs) { if (secs < 0) { document.getElementById("cntdwn259").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage259(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage259(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage259(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage259(secs,1,60)); document.getElementById("cntdwn259").innerHTML = DisplayStr; if (CountActive259) setTimeout("CountBack259(" + (secs+CountStepper259) + ")", SetTimeOutPeriod259); } function putspan259() { document.write(""); } //if (typeof(BackColor259)=="undefined") // BackColor259 = "white"; //if (typeof(ForeColor259)=="undefined") // ForeColor259= "black"; if (typeof(TargetDate259)=="undefined") TargetDate259 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat259)=="undefined") DisplayFormat259 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive259)=="undefined") CountActive259 = true; if (typeof(FinishMessage259)=="undefined") FinishMessage259 = ""; if (typeof(CountStepper259)!="number") CountStepper259 = -1; if (typeof(LeadingZero259)=="undefined") LeadingZero259 = true; CountStepper259 = Math.ceil(CountStepper259); if (CountStepper259 == 0) CountActive259 = false; var SetTimeOutPeriod259 = (Math.abs(CountStepper259)-1)*1000 + 990; //putspan259(BackColor259, ForeColor259); putspan259(); var dthen259 = new Date(TargetDate259); var dnow259 = new Date(SourceDate259); if(CountStepper259>0) ddiff259 = new Date(dnow259-dthen259); else ddiff259 = new Date(dthen259-dnow259); gsecs259 = Math.floor(ddiff259.valueOf()/1000); CountBack259(gsecs259);