/* 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 TargetDate137 = "9/15/2017 15:00"; var SourceDate137 = "05/25/2018 06:14:18"; //var BackColor137; //var ForeColor137; var DisplayFormat137; var FinishMessage137; var LeadingZero137; //if(!BackColor137) BackColor137 = "palegreen"; //if (BackColor) BackColor137=BackColor; //if(!ForeColor137) ForeColor137 = "navy"; //if (ForeColor) ForeColor137=ForeColor; CountActive137 = true; CountStepper137 = -1; LeadingZero137 = true; if(!DisplayFormat137) DisplayFormat137 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat137=DisplayFormat; if(!FinishMessage137) FinishMessage137 = "Closed!"; if (FinishMessage) FinishMessage137=FinishMessage; function calcage137(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero137 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack137(secs) { if (secs < 0) { document.getElementById("cntdwn137").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage137(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage137(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage137(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage137(secs,1,60)); document.getElementById("cntdwn137").innerHTML = DisplayStr; if (CountActive137) setTimeout("CountBack137(" + (secs+CountStepper137) + ")", SetTimeOutPeriod137); } function putspan137() { document.write(""); } //if (typeof(BackColor137)=="undefined") // BackColor137 = "white"; //if (typeof(ForeColor137)=="undefined") // ForeColor137= "black"; if (typeof(TargetDate137)=="undefined") TargetDate137 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat137)=="undefined") DisplayFormat137 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive137)=="undefined") CountActive137 = true; if (typeof(FinishMessage137)=="undefined") FinishMessage137 = ""; if (typeof(CountStepper137)!="number") CountStepper137 = -1; if (typeof(LeadingZero137)=="undefined") LeadingZero137 = true; CountStepper137 = Math.ceil(CountStepper137); if (CountStepper137 == 0) CountActive137 = false; var SetTimeOutPeriod137 = (Math.abs(CountStepper137)-1)*1000 + 990; //putspan137(BackColor137, ForeColor137); putspan137(); var dthen137 = new Date(TargetDate137); var dnow137 = new Date(SourceDate137); if(CountStepper137>0) ddiff137 = new Date(dnow137-dthen137); else ddiff137 = new Date(dthen137-dnow137); gsecs137 = Math.floor(ddiff137.valueOf()/1000); CountBack137(gsecs137);