/* 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 TargetDate139 = "1/16/2017 19:00"; var SourceDate139 = "05/26/2018 05:26:30"; //var BackColor139; //var ForeColor139; var DisplayFormat139; var FinishMessage139; var LeadingZero139; //if(!BackColor139) BackColor139 = "palegreen"; //if (BackColor) BackColor139=BackColor; //if(!ForeColor139) ForeColor139 = "navy"; //if (ForeColor) ForeColor139=ForeColor; CountActive139 = true; CountStepper139 = -1; LeadingZero139 = true; if(!DisplayFormat139) DisplayFormat139 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat139=DisplayFormat; if(!FinishMessage139) FinishMessage139 = "Closed!"; if (FinishMessage) FinishMessage139=FinishMessage; function calcage139(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero139 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack139(secs) { if (secs < 0) { document.getElementById("cntdwn139").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage139(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage139(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage139(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage139(secs,1,60)); document.getElementById("cntdwn139").innerHTML = DisplayStr; if (CountActive139) setTimeout("CountBack139(" + (secs+CountStepper139) + ")", SetTimeOutPeriod139); } function putspan139() { document.write(""); } //if (typeof(BackColor139)=="undefined") // BackColor139 = "white"; //if (typeof(ForeColor139)=="undefined") // ForeColor139= "black"; if (typeof(TargetDate139)=="undefined") TargetDate139 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat139)=="undefined") DisplayFormat139 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive139)=="undefined") CountActive139 = true; if (typeof(FinishMessage139)=="undefined") FinishMessage139 = ""; if (typeof(CountStepper139)!="number") CountStepper139 = -1; if (typeof(LeadingZero139)=="undefined") LeadingZero139 = true; CountStepper139 = Math.ceil(CountStepper139); if (CountStepper139 == 0) CountActive139 = false; var SetTimeOutPeriod139 = (Math.abs(CountStepper139)-1)*1000 + 990; //putspan139(BackColor139, ForeColor139); putspan139(); var dthen139 = new Date(TargetDate139); var dnow139 = new Date(SourceDate139); if(CountStepper139>0) ddiff139 = new Date(dnow139-dthen139); else ddiff139 = new Date(dthen139-dnow139); gsecs139 = Math.floor(ddiff139.valueOf()/1000); CountBack139(gsecs139);