/* 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 TargetDate254 = "3/08/2018 15:00"; var SourceDate254 = "02/24/2018 14:08:14"; //var BackColor254; //var ForeColor254; var DisplayFormat254; var FinishMessage254; var LeadingZero254; //if(!BackColor254) BackColor254 = "palegreen"; //if (BackColor) BackColor254=BackColor; //if(!ForeColor254) ForeColor254 = "navy"; //if (ForeColor) ForeColor254=ForeColor; CountActive254 = true; CountStepper254 = -1; LeadingZero254 = true; if(!DisplayFormat254) DisplayFormat254 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat254=DisplayFormat; if(!FinishMessage254) FinishMessage254 = "Closed!"; if (FinishMessage) FinishMessage254=FinishMessage; function calcage254(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero254 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack254(secs) { if (secs < 0) { document.getElementById("cntdwn254").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage254(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage254(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage254(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage254(secs,1,60)); document.getElementById("cntdwn254").innerHTML = DisplayStr; if (CountActive254) setTimeout("CountBack254(" + (secs+CountStepper254) + ")", SetTimeOutPeriod254); } function putspan254() { document.write(""); } //if (typeof(BackColor254)=="undefined") // BackColor254 = "white"; //if (typeof(ForeColor254)=="undefined") // ForeColor254= "black"; if (typeof(TargetDate254)=="undefined") TargetDate254 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat254)=="undefined") DisplayFormat254 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive254)=="undefined") CountActive254 = true; if (typeof(FinishMessage254)=="undefined") FinishMessage254 = ""; if (typeof(CountStepper254)!="number") CountStepper254 = -1; if (typeof(LeadingZero254)=="undefined") LeadingZero254 = true; CountStepper254 = Math.ceil(CountStepper254); if (CountStepper254 == 0) CountActive254 = false; var SetTimeOutPeriod254 = (Math.abs(CountStepper254)-1)*1000 + 990; //putspan254(BackColor254, ForeColor254); putspan254(); var dthen254 = new Date(TargetDate254); var dnow254 = new Date(SourceDate254); if(CountStepper254>0) ddiff254 = new Date(dnow254-dthen254); else ddiff254 = new Date(dthen254-dnow254); gsecs254 = Math.floor(ddiff254.valueOf()/1000); CountBack254(gsecs254);