/* 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 TargetDate124 = "1/11/2018 18:00"; var SourceDate124 = "02/19/2018 23:44:15"; //var BackColor124; //var ForeColor124; var DisplayFormat124; var FinishMessage124; var LeadingZero124; //if(!BackColor124) BackColor124 = "palegreen"; //if (BackColor) BackColor124=BackColor; //if(!ForeColor124) ForeColor124 = "navy"; //if (ForeColor) ForeColor124=ForeColor; CountActive124 = true; CountStepper124 = -1; LeadingZero124 = true; if(!DisplayFormat124) DisplayFormat124 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat124=DisplayFormat; if(!FinishMessage124) FinishMessage124 = "Closed!"; if (FinishMessage) FinishMessage124=FinishMessage; function calcage124(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero124 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack124(secs) { if (secs < 0) { document.getElementById("cntdwn124").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage124(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage124(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage124(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage124(secs,1,60)); document.getElementById("cntdwn124").innerHTML = DisplayStr; if (CountActive124) setTimeout("CountBack124(" + (secs+CountStepper124) + ")", SetTimeOutPeriod124); } function putspan124() { document.write(""); } //if (typeof(BackColor124)=="undefined") // BackColor124 = "white"; //if (typeof(ForeColor124)=="undefined") // ForeColor124= "black"; if (typeof(TargetDate124)=="undefined") TargetDate124 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat124)=="undefined") DisplayFormat124 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive124)=="undefined") CountActive124 = true; if (typeof(FinishMessage124)=="undefined") FinishMessage124 = ""; if (typeof(CountStepper124)!="number") CountStepper124 = -1; if (typeof(LeadingZero124)=="undefined") LeadingZero124 = true; CountStepper124 = Math.ceil(CountStepper124); if (CountStepper124 == 0) CountActive124 = false; var SetTimeOutPeriod124 = (Math.abs(CountStepper124)-1)*1000 + 990; //putspan124(BackColor124, ForeColor124); putspan124(); var dthen124 = new Date(TargetDate124); var dnow124 = new Date(SourceDate124); if(CountStepper124>0) ddiff124 = new Date(dnow124-dthen124); else ddiff124 = new Date(dthen124-dnow124); gsecs124 = Math.floor(ddiff124.valueOf()/1000); CountBack124(gsecs124);