/* 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 TargetDate239 = "4/10/2018 18:00"; var SourceDate239 = "06/25/2018 12:48:09"; //var BackColor239; //var ForeColor239; var DisplayFormat239; var FinishMessage239; var LeadingZero239; //if(!BackColor239) BackColor239 = "palegreen"; //if (BackColor) BackColor239=BackColor; //if(!ForeColor239) ForeColor239 = "navy"; //if (ForeColor) ForeColor239=ForeColor; CountActive239 = true; CountStepper239 = -1; LeadingZero239 = true; if(!DisplayFormat239) DisplayFormat239 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat239=DisplayFormat; if(!FinishMessage239) FinishMessage239 = "Closed!"; if (FinishMessage) FinishMessage239=FinishMessage; function calcage239(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero239 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack239(secs) { if (secs < 0) { document.getElementById("cntdwn239").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage239(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage239(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage239(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage239(secs,1,60)); document.getElementById("cntdwn239").innerHTML = DisplayStr; if (CountActive239) setTimeout("CountBack239(" + (secs+CountStepper239) + ")", SetTimeOutPeriod239); } function putspan239() { document.write(""); } //if (typeof(BackColor239)=="undefined") // BackColor239 = "white"; //if (typeof(ForeColor239)=="undefined") // ForeColor239= "black"; if (typeof(TargetDate239)=="undefined") TargetDate239 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat239)=="undefined") DisplayFormat239 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive239)=="undefined") CountActive239 = true; if (typeof(FinishMessage239)=="undefined") FinishMessage239 = ""; if (typeof(CountStepper239)!="number") CountStepper239 = -1; if (typeof(LeadingZero239)=="undefined") LeadingZero239 = true; CountStepper239 = Math.ceil(CountStepper239); if (CountStepper239 == 0) CountActive239 = false; var SetTimeOutPeriod239 = (Math.abs(CountStepper239)-1)*1000 + 990; //putspan239(BackColor239, ForeColor239); putspan239(); var dthen239 = new Date(TargetDate239); var dnow239 = new Date(SourceDate239); if(CountStepper239>0) ddiff239 = new Date(dnow239-dthen239); else ddiff239 = new Date(dthen239-dnow239); gsecs239 = Math.floor(ddiff239.valueOf()/1000); CountBack239(gsecs239);