/* 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 TargetDate116 = "7/04/2017 00:00"; var SourceDate116 = "10/17/2018 10:22:17"; //var BackColor116; //var ForeColor116; var DisplayFormat116; var FinishMessage116; var LeadingZero116; //if(!BackColor116) BackColor116 = "palegreen"; //if (BackColor) BackColor116=BackColor; //if(!ForeColor116) ForeColor116 = "navy"; //if (ForeColor) ForeColor116=ForeColor; CountActive116 = true; CountStepper116 = -1; LeadingZero116 = true; if(!DisplayFormat116) DisplayFormat116 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat116=DisplayFormat; if(!FinishMessage116) FinishMessage116 = "Closed!"; if (FinishMessage) FinishMessage116=FinishMessage; function calcage116(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero116 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack116(secs) { if (secs < 0) { document.getElementById("cntdwn116").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage116(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage116(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage116(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage116(secs,1,60)); document.getElementById("cntdwn116").innerHTML = DisplayStr; if (CountActive116) setTimeout("CountBack116(" + (secs+CountStepper116) + ")", SetTimeOutPeriod116); } function putspan116() { document.write(""); } //if (typeof(BackColor116)=="undefined") // BackColor116 = "white"; //if (typeof(ForeColor116)=="undefined") // ForeColor116= "black"; if (typeof(TargetDate116)=="undefined") TargetDate116 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat116)=="undefined") DisplayFormat116 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive116)=="undefined") CountActive116 = true; if (typeof(FinishMessage116)=="undefined") FinishMessage116 = ""; if (typeof(CountStepper116)!="number") CountStepper116 = -1; if (typeof(LeadingZero116)=="undefined") LeadingZero116 = true; CountStepper116 = Math.ceil(CountStepper116); if (CountStepper116 == 0) CountActive116 = false; var SetTimeOutPeriod116 = (Math.abs(CountStepper116)-1)*1000 + 990; //putspan116(BackColor116, ForeColor116); putspan116(); var dthen116 = new Date(TargetDate116); var dnow116 = new Date(SourceDate116); if(CountStepper116>0) ddiff116 = new Date(dnow116-dthen116); else ddiff116 = new Date(dthen116-dnow116); gsecs116 = Math.floor(ddiff116.valueOf()/1000); CountBack116(gsecs116);