/* 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 TargetDate205 = "4/24/2018 18:00"; var SourceDate205 = "12/13/2018 12:45:54"; //var BackColor205; //var ForeColor205; var DisplayFormat205; var FinishMessage205; var LeadingZero205; //if(!BackColor205) BackColor205 = "palegreen"; //if (BackColor) BackColor205=BackColor; //if(!ForeColor205) ForeColor205 = "navy"; //if (ForeColor) ForeColor205=ForeColor; CountActive205 = true; CountStepper205 = -1; LeadingZero205 = true; if(!DisplayFormat205) DisplayFormat205 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat205=DisplayFormat; if(!FinishMessage205) FinishMessage205 = "Closed!"; if (FinishMessage) FinishMessage205=FinishMessage; function calcage205(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero205 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack205(secs) { if (secs < 0) { document.getElementById("cntdwn205").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage205(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage205(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage205(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage205(secs,1,60)); document.getElementById("cntdwn205").innerHTML = DisplayStr; if (CountActive205) setTimeout("CountBack205(" + (secs+CountStepper205) + ")", SetTimeOutPeriod205); } function putspan205() { document.write(""); } //if (typeof(BackColor205)=="undefined") // BackColor205 = "white"; //if (typeof(ForeColor205)=="undefined") // ForeColor205= "black"; if (typeof(TargetDate205)=="undefined") TargetDate205 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat205)=="undefined") DisplayFormat205 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive205)=="undefined") CountActive205 = true; if (typeof(FinishMessage205)=="undefined") FinishMessage205 = ""; if (typeof(CountStepper205)!="number") CountStepper205 = -1; if (typeof(LeadingZero205)=="undefined") LeadingZero205 = true; CountStepper205 = Math.ceil(CountStepper205); if (CountStepper205 == 0) CountActive205 = false; var SetTimeOutPeriod205 = (Math.abs(CountStepper205)-1)*1000 + 990; //putspan205(BackColor205, ForeColor205); putspan205(); var dthen205 = new Date(TargetDate205); var dnow205 = new Date(SourceDate205); if(CountStepper205>0) ddiff205 = new Date(dnow205-dthen205); else ddiff205 = new Date(dthen205-dnow205); gsecs205 = Math.floor(ddiff205.valueOf()/1000); CountBack205(gsecs205);