/* 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 TargetDate122 = "5/26/2017 19:00"; var SourceDate122 = "08/18/2018 15:01:09"; //var BackColor122; //var ForeColor122; var DisplayFormat122; var FinishMessage122; var LeadingZero122; //if(!BackColor122) BackColor122 = "palegreen"; //if (BackColor) BackColor122=BackColor; //if(!ForeColor122) ForeColor122 = "navy"; //if (ForeColor) ForeColor122=ForeColor; CountActive122 = true; CountStepper122 = -1; LeadingZero122 = true; if(!DisplayFormat122) DisplayFormat122 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat122=DisplayFormat; if(!FinishMessage122) FinishMessage122 = "Closed!"; if (FinishMessage) FinishMessage122=FinishMessage; function calcage122(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero122 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack122(secs) { if (secs < 0) { document.getElementById("cntdwn122").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage122(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage122(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage122(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage122(secs,1,60)); document.getElementById("cntdwn122").innerHTML = DisplayStr; if (CountActive122) setTimeout("CountBack122(" + (secs+CountStepper122) + ")", SetTimeOutPeriod122); } function putspan122() { document.write(""); } //if (typeof(BackColor122)=="undefined") // BackColor122 = "white"; //if (typeof(ForeColor122)=="undefined") // ForeColor122= "black"; if (typeof(TargetDate122)=="undefined") TargetDate122 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat122)=="undefined") DisplayFormat122 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive122)=="undefined") CountActive122 = true; if (typeof(FinishMessage122)=="undefined") FinishMessage122 = ""; if (typeof(CountStepper122)!="number") CountStepper122 = -1; if (typeof(LeadingZero122)=="undefined") LeadingZero122 = true; CountStepper122 = Math.ceil(CountStepper122); if (CountStepper122 == 0) CountActive122 = false; var SetTimeOutPeriod122 = (Math.abs(CountStepper122)-1)*1000 + 990; //putspan122(BackColor122, ForeColor122); putspan122(); var dthen122 = new Date(TargetDate122); var dnow122 = new Date(SourceDate122); if(CountStepper122>0) ddiff122 = new Date(dnow122-dthen122); else ddiff122 = new Date(dthen122-dnow122); gsecs122 = Math.floor(ddiff122.valueOf()/1000); CountBack122(gsecs122);