/* 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 TargetDate249 = "2/06/2018 18:00"; var SourceDate249 = "08/18/2018 14:58:43"; //var BackColor249; //var ForeColor249; var DisplayFormat249; var FinishMessage249; var LeadingZero249; //if(!BackColor249) BackColor249 = "palegreen"; //if (BackColor) BackColor249=BackColor; //if(!ForeColor249) ForeColor249 = "navy"; //if (ForeColor) ForeColor249=ForeColor; CountActive249 = true; CountStepper249 = -1; LeadingZero249 = true; if(!DisplayFormat249) DisplayFormat249 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat249=DisplayFormat; if(!FinishMessage249) FinishMessage249 = "Closed!"; if (FinishMessage) FinishMessage249=FinishMessage; function calcage249(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero249 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack249(secs) { if (secs < 0) { document.getElementById("cntdwn249").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage249(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage249(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage249(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage249(secs,1,60)); document.getElementById("cntdwn249").innerHTML = DisplayStr; if (CountActive249) setTimeout("CountBack249(" + (secs+CountStepper249) + ")", SetTimeOutPeriod249); } function putspan249() { document.write(""); } //if (typeof(BackColor249)=="undefined") // BackColor249 = "white"; //if (typeof(ForeColor249)=="undefined") // ForeColor249= "black"; if (typeof(TargetDate249)=="undefined") TargetDate249 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat249)=="undefined") DisplayFormat249 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive249)=="undefined") CountActive249 = true; if (typeof(FinishMessage249)=="undefined") FinishMessage249 = ""; if (typeof(CountStepper249)!="number") CountStepper249 = -1; if (typeof(LeadingZero249)=="undefined") LeadingZero249 = true; CountStepper249 = Math.ceil(CountStepper249); if (CountStepper249 == 0) CountActive249 = false; var SetTimeOutPeriod249 = (Math.abs(CountStepper249)-1)*1000 + 990; //putspan249(BackColor249, ForeColor249); putspan249(); var dthen249 = new Date(TargetDate249); var dnow249 = new Date(SourceDate249); if(CountStepper249>0) ddiff249 = new Date(dnow249-dthen249); else ddiff249 = new Date(dthen249-dnow249); gsecs249 = Math.floor(ddiff249.valueOf()/1000); CountBack249(gsecs249);