/* 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 TargetDate158 = "3/07/2017 00:00"; var SourceDate158 = "08/16/2018 13:42:36"; //var BackColor158; //var ForeColor158; var DisplayFormat158; var FinishMessage158; var LeadingZero158; //if(!BackColor158) BackColor158 = "palegreen"; //if (BackColor) BackColor158=BackColor; //if(!ForeColor158) ForeColor158 = "navy"; //if (ForeColor) ForeColor158=ForeColor; CountActive158 = true; CountStepper158 = -1; LeadingZero158 = true; if(!DisplayFormat158) DisplayFormat158 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat158=DisplayFormat; if(!FinishMessage158) FinishMessage158 = "Closed!"; if (FinishMessage) FinishMessage158=FinishMessage; function calcage158(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero158 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack158(secs) { if (secs < 0) { document.getElementById("cntdwn158").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage158(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage158(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage158(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage158(secs,1,60)); document.getElementById("cntdwn158").innerHTML = DisplayStr; if (CountActive158) setTimeout("CountBack158(" + (secs+CountStepper158) + ")", SetTimeOutPeriod158); } function putspan158() { document.write(""); } //if (typeof(BackColor158)=="undefined") // BackColor158 = "white"; //if (typeof(ForeColor158)=="undefined") // ForeColor158= "black"; if (typeof(TargetDate158)=="undefined") TargetDate158 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat158)=="undefined") DisplayFormat158 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive158)=="undefined") CountActive158 = true; if (typeof(FinishMessage158)=="undefined") FinishMessage158 = ""; if (typeof(CountStepper158)!="number") CountStepper158 = -1; if (typeof(LeadingZero158)=="undefined") LeadingZero158 = true; CountStepper158 = Math.ceil(CountStepper158); if (CountStepper158 == 0) CountActive158 = false; var SetTimeOutPeriod158 = (Math.abs(CountStepper158)-1)*1000 + 990; //putspan158(BackColor158, ForeColor158); putspan158(); var dthen158 = new Date(TargetDate158); var dnow158 = new Date(SourceDate158); if(CountStepper158>0) ddiff158 = new Date(dnow158-dthen158); else ddiff158 = new Date(dthen158-dnow158); gsecs158 = Math.floor(ddiff158.valueOf()/1000); CountBack158(gsecs158);