/* 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 TargetDate152 = "11/14/2017 15:00"; var SourceDate152 = "10/17/2018 02:37:38"; //var BackColor152; //var ForeColor152; var DisplayFormat152; var FinishMessage152; var LeadingZero152; //if(!BackColor152) BackColor152 = "palegreen"; //if (BackColor) BackColor152=BackColor; //if(!ForeColor152) ForeColor152 = "navy"; //if (ForeColor) ForeColor152=ForeColor; CountActive152 = true; CountStepper152 = -1; LeadingZero152 = true; if(!DisplayFormat152) DisplayFormat152 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat152=DisplayFormat; if(!FinishMessage152) FinishMessage152 = "Closed!"; if (FinishMessage) FinishMessage152=FinishMessage; function calcage152(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero152 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack152(secs) { if (secs < 0) { document.getElementById("cntdwn152").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage152(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage152(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage152(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage152(secs,1,60)); document.getElementById("cntdwn152").innerHTML = DisplayStr; if (CountActive152) setTimeout("CountBack152(" + (secs+CountStepper152) + ")", SetTimeOutPeriod152); } function putspan152() { document.write(""); } //if (typeof(BackColor152)=="undefined") // BackColor152 = "white"; //if (typeof(ForeColor152)=="undefined") // ForeColor152= "black"; if (typeof(TargetDate152)=="undefined") TargetDate152 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat152)=="undefined") DisplayFormat152 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive152)=="undefined") CountActive152 = true; if (typeof(FinishMessage152)=="undefined") FinishMessage152 = ""; if (typeof(CountStepper152)!="number") CountStepper152 = -1; if (typeof(LeadingZero152)=="undefined") LeadingZero152 = true; CountStepper152 = Math.ceil(CountStepper152); if (CountStepper152 == 0) CountActive152 = false; var SetTimeOutPeriod152 = (Math.abs(CountStepper152)-1)*1000 + 990; //putspan152(BackColor152, ForeColor152); putspan152(); var dthen152 = new Date(TargetDate152); var dnow152 = new Date(SourceDate152); if(CountStepper152>0) ddiff152 = new Date(dnow152-dthen152); else ddiff152 = new Date(dthen152-dnow152); gsecs152 = Math.floor(ddiff152.valueOf()/1000); CountBack152(gsecs152);