/* 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 TargetDate126 = "12/01/2017 18:00"; var SourceDate126 = "02/19/2018 23:46:39"; //var BackColor126; //var ForeColor126; var DisplayFormat126; var FinishMessage126; var LeadingZero126; //if(!BackColor126) BackColor126 = "palegreen"; //if (BackColor) BackColor126=BackColor; //if(!ForeColor126) ForeColor126 = "navy"; //if (ForeColor) ForeColor126=ForeColor; CountActive126 = true; CountStepper126 = -1; LeadingZero126 = true; if(!DisplayFormat126) DisplayFormat126 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat126=DisplayFormat; if(!FinishMessage126) FinishMessage126 = "Closed!"; if (FinishMessage) FinishMessage126=FinishMessage; function calcage126(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero126 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack126(secs) { if (secs < 0) { document.getElementById("cntdwn126").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage126(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage126(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage126(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage126(secs,1,60)); document.getElementById("cntdwn126").innerHTML = DisplayStr; if (CountActive126) setTimeout("CountBack126(" + (secs+CountStepper126) + ")", SetTimeOutPeriod126); } function putspan126() { document.write(""); } //if (typeof(BackColor126)=="undefined") // BackColor126 = "white"; //if (typeof(ForeColor126)=="undefined") // ForeColor126= "black"; if (typeof(TargetDate126)=="undefined") TargetDate126 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat126)=="undefined") DisplayFormat126 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive126)=="undefined") CountActive126 = true; if (typeof(FinishMessage126)=="undefined") FinishMessage126 = ""; if (typeof(CountStepper126)!="number") CountStepper126 = -1; if (typeof(LeadingZero126)=="undefined") LeadingZero126 = true; CountStepper126 = Math.ceil(CountStepper126); if (CountStepper126 == 0) CountActive126 = false; var SetTimeOutPeriod126 = (Math.abs(CountStepper126)-1)*1000 + 990; //putspan126(BackColor126, ForeColor126); putspan126(); var dthen126 = new Date(TargetDate126); var dnow126 = new Date(SourceDate126); if(CountStepper126>0) ddiff126 = new Date(dnow126-dthen126); else ddiff126 = new Date(dthen126-dnow126); gsecs126 = Math.floor(ddiff126.valueOf()/1000); CountBack126(gsecs126);