/* 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 TargetDate224 = "4/04/2018 14:00"; var SourceDate224 = "05/22/2018 18:36:15"; //var BackColor224; //var ForeColor224; var DisplayFormat224; var FinishMessage224; var LeadingZero224; //if(!BackColor224) BackColor224 = "palegreen"; //if (BackColor) BackColor224=BackColor; //if(!ForeColor224) ForeColor224 = "navy"; //if (ForeColor) ForeColor224=ForeColor; CountActive224 = true; CountStepper224 = -1; LeadingZero224 = true; if(!DisplayFormat224) DisplayFormat224 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat224=DisplayFormat; if(!FinishMessage224) FinishMessage224 = "Closed!"; if (FinishMessage) FinishMessage224=FinishMessage; function calcage224(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero224 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack224(secs) { if (secs < 0) { document.getElementById("cntdwn224").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage224(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage224(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage224(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage224(secs,1,60)); document.getElementById("cntdwn224").innerHTML = DisplayStr; if (CountActive224) setTimeout("CountBack224(" + (secs+CountStepper224) + ")", SetTimeOutPeriod224); } function putspan224() { document.write(""); } //if (typeof(BackColor224)=="undefined") // BackColor224 = "white"; //if (typeof(ForeColor224)=="undefined") // ForeColor224= "black"; if (typeof(TargetDate224)=="undefined") TargetDate224 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat224)=="undefined") DisplayFormat224 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive224)=="undefined") CountActive224 = true; if (typeof(FinishMessage224)=="undefined") FinishMessage224 = ""; if (typeof(CountStepper224)!="number") CountStepper224 = -1; if (typeof(LeadingZero224)=="undefined") LeadingZero224 = true; CountStepper224 = Math.ceil(CountStepper224); if (CountStepper224 == 0) CountActive224 = false; var SetTimeOutPeriod224 = (Math.abs(CountStepper224)-1)*1000 + 990; //putspan224(BackColor224, ForeColor224); putspan224(); var dthen224 = new Date(TargetDate224); var dnow224 = new Date(SourceDate224); if(CountStepper224>0) ddiff224 = new Date(dnow224-dthen224); else ddiff224 = new Date(dthen224-dnow224); gsecs224 = Math.floor(ddiff224.valueOf()/1000); CountBack224(gsecs224);