/* 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 TargetDate125 = "5/24/2017 19:00"; var SourceDate125 = "02/25/2018 11:38:09"; //var BackColor125; //var ForeColor125; var DisplayFormat125; var FinishMessage125; var LeadingZero125; //if(!BackColor125) BackColor125 = "palegreen"; //if (BackColor) BackColor125=BackColor; //if(!ForeColor125) ForeColor125 = "navy"; //if (ForeColor) ForeColor125=ForeColor; CountActive125 = true; CountStepper125 = -1; LeadingZero125 = true; if(!DisplayFormat125) DisplayFormat125 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat125=DisplayFormat; if(!FinishMessage125) FinishMessage125 = "Closed!"; if (FinishMessage) FinishMessage125=FinishMessage; function calcage125(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero125 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack125(secs) { if (secs < 0) { document.getElementById("cntdwn125").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage125(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage125(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage125(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage125(secs,1,60)); document.getElementById("cntdwn125").innerHTML = DisplayStr; if (CountActive125) setTimeout("CountBack125(" + (secs+CountStepper125) + ")", SetTimeOutPeriod125); } function putspan125() { document.write(""); } //if (typeof(BackColor125)=="undefined") // BackColor125 = "white"; //if (typeof(ForeColor125)=="undefined") // ForeColor125= "black"; if (typeof(TargetDate125)=="undefined") TargetDate125 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat125)=="undefined") DisplayFormat125 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive125)=="undefined") CountActive125 = true; if (typeof(FinishMessage125)=="undefined") FinishMessage125 = ""; if (typeof(CountStepper125)!="number") CountStepper125 = -1; if (typeof(LeadingZero125)=="undefined") LeadingZero125 = true; CountStepper125 = Math.ceil(CountStepper125); if (CountStepper125 == 0) CountActive125 = false; var SetTimeOutPeriod125 = (Math.abs(CountStepper125)-1)*1000 + 990; //putspan125(BackColor125, ForeColor125); putspan125(); var dthen125 = new Date(TargetDate125); var dnow125 = new Date(SourceDate125); if(CountStepper125>0) ddiff125 = new Date(dnow125-dthen125); else ddiff125 = new Date(dthen125-dnow125); gsecs125 = Math.floor(ddiff125.valueOf()/1000); CountBack125(gsecs125);