/* 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 TargetDate136 = "3/14/2017 19:00"; var SourceDate136 = "05/25/2018 06:26:03"; //var BackColor136; //var ForeColor136; var DisplayFormat136; var FinishMessage136; var LeadingZero136; //if(!BackColor136) BackColor136 = "palegreen"; //if (BackColor) BackColor136=BackColor; //if(!ForeColor136) ForeColor136 = "navy"; //if (ForeColor) ForeColor136=ForeColor; CountActive136 = true; CountStepper136 = -1; LeadingZero136 = true; if(!DisplayFormat136) DisplayFormat136 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat136=DisplayFormat; if(!FinishMessage136) FinishMessage136 = "Closed!"; if (FinishMessage) FinishMessage136=FinishMessage; function calcage136(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero136 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack136(secs) { if (secs < 0) { document.getElementById("cntdwn136").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage136(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage136(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage136(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage136(secs,1,60)); document.getElementById("cntdwn136").innerHTML = DisplayStr; if (CountActive136) setTimeout("CountBack136(" + (secs+CountStepper136) + ")", SetTimeOutPeriod136); } function putspan136() { document.write(""); } //if (typeof(BackColor136)=="undefined") // BackColor136 = "white"; //if (typeof(ForeColor136)=="undefined") // ForeColor136= "black"; if (typeof(TargetDate136)=="undefined") TargetDate136 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat136)=="undefined") DisplayFormat136 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive136)=="undefined") CountActive136 = true; if (typeof(FinishMessage136)=="undefined") FinishMessage136 = ""; if (typeof(CountStepper136)!="number") CountStepper136 = -1; if (typeof(LeadingZero136)=="undefined") LeadingZero136 = true; CountStepper136 = Math.ceil(CountStepper136); if (CountStepper136 == 0) CountActive136 = false; var SetTimeOutPeriod136 = (Math.abs(CountStepper136)-1)*1000 + 990; //putspan136(BackColor136, ForeColor136); putspan136(); var dthen136 = new Date(TargetDate136); var dnow136 = new Date(SourceDate136); if(CountStepper136>0) ddiff136 = new Date(dnow136-dthen136); else ddiff136 = new Date(dthen136-dnow136); gsecs136 = Math.floor(ddiff136.valueOf()/1000); CountBack136(gsecs136);