/* 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 TargetDate148 = "7/10/2017 16:00"; var SourceDate148 = "10/16/2018 12:55:51"; //var BackColor148; //var ForeColor148; var DisplayFormat148; var FinishMessage148; var LeadingZero148; //if(!BackColor148) BackColor148 = "palegreen"; //if (BackColor) BackColor148=BackColor; //if(!ForeColor148) ForeColor148 = "navy"; //if (ForeColor) ForeColor148=ForeColor; CountActive148 = true; CountStepper148 = -1; LeadingZero148 = true; if(!DisplayFormat148) DisplayFormat148 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat148=DisplayFormat; if(!FinishMessage148) FinishMessage148 = "Closed!"; if (FinishMessage) FinishMessage148=FinishMessage; function calcage148(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero148 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack148(secs) { if (secs < 0) { document.getElementById("cntdwn148").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage148(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage148(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage148(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage148(secs,1,60)); document.getElementById("cntdwn148").innerHTML = DisplayStr; if (CountActive148) setTimeout("CountBack148(" + (secs+CountStepper148) + ")", SetTimeOutPeriod148); } function putspan148() { document.write(""); } //if (typeof(BackColor148)=="undefined") // BackColor148 = "white"; //if (typeof(ForeColor148)=="undefined") // ForeColor148= "black"; if (typeof(TargetDate148)=="undefined") TargetDate148 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat148)=="undefined") DisplayFormat148 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive148)=="undefined") CountActive148 = true; if (typeof(FinishMessage148)=="undefined") FinishMessage148 = ""; if (typeof(CountStepper148)!="number") CountStepper148 = -1; if (typeof(LeadingZero148)=="undefined") LeadingZero148 = true; CountStepper148 = Math.ceil(CountStepper148); if (CountStepper148 == 0) CountActive148 = false; var SetTimeOutPeriod148 = (Math.abs(CountStepper148)-1)*1000 + 990; //putspan148(BackColor148, ForeColor148); putspan148(); var dthen148 = new Date(TargetDate148); var dnow148 = new Date(SourceDate148); if(CountStepper148>0) ddiff148 = new Date(dnow148-dthen148); else ddiff148 = new Date(dthen148-dnow148); gsecs148 = Math.floor(ddiff148.valueOf()/1000); CountBack148(gsecs148);