/* 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 TargetDate118 = "3/17/2017 17:00"; var SourceDate118 = "08/21/2018 01:44:28"; //var BackColor118; //var ForeColor118; var DisplayFormat118; var FinishMessage118; var LeadingZero118; //if(!BackColor118) BackColor118 = "palegreen"; //if (BackColor) BackColor118=BackColor; //if(!ForeColor118) ForeColor118 = "navy"; //if (ForeColor) ForeColor118=ForeColor; CountActive118 = true; CountStepper118 = -1; LeadingZero118 = true; if(!DisplayFormat118) DisplayFormat118 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat118=DisplayFormat; if(!FinishMessage118) FinishMessage118 = "Closed!"; if (FinishMessage) FinishMessage118=FinishMessage; function calcage118(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero118 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack118(secs) { if (secs < 0) { document.getElementById("cntdwn118").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage118(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage118(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage118(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage118(secs,1,60)); document.getElementById("cntdwn118").innerHTML = DisplayStr; if (CountActive118) setTimeout("CountBack118(" + (secs+CountStepper118) + ")", SetTimeOutPeriod118); } function putspan118() { document.write(""); } //if (typeof(BackColor118)=="undefined") // BackColor118 = "white"; //if (typeof(ForeColor118)=="undefined") // ForeColor118= "black"; if (typeof(TargetDate118)=="undefined") TargetDate118 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat118)=="undefined") DisplayFormat118 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive118)=="undefined") CountActive118 = true; if (typeof(FinishMessage118)=="undefined") FinishMessage118 = ""; if (typeof(CountStepper118)!="number") CountStepper118 = -1; if (typeof(LeadingZero118)=="undefined") LeadingZero118 = true; CountStepper118 = Math.ceil(CountStepper118); if (CountStepper118 == 0) CountActive118 = false; var SetTimeOutPeriod118 = (Math.abs(CountStepper118)-1)*1000 + 990; //putspan118(BackColor118, ForeColor118); putspan118(); var dthen118 = new Date(TargetDate118); var dnow118 = new Date(SourceDate118); if(CountStepper118>0) ddiff118 = new Date(dnow118-dthen118); else ddiff118 = new Date(dthen118-dnow118); gsecs118 = Math.floor(ddiff118.valueOf()/1000); CountBack118(gsecs118);