/* 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 TargetDate138 = "3/15/2017 19:00"; var SourceDate138 = "02/25/2018 07:49:37"; //var BackColor138; //var ForeColor138; var DisplayFormat138; var FinishMessage138; var LeadingZero138; //if(!BackColor138) BackColor138 = "palegreen"; //if (BackColor) BackColor138=BackColor; //if(!ForeColor138) ForeColor138 = "navy"; //if (ForeColor) ForeColor138=ForeColor; CountActive138 = true; CountStepper138 = -1; LeadingZero138 = true; if(!DisplayFormat138) DisplayFormat138 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat138=DisplayFormat; if(!FinishMessage138) FinishMessage138 = "Closed!"; if (FinishMessage) FinishMessage138=FinishMessage; function calcage138(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero138 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack138(secs) { if (secs < 0) { document.getElementById("cntdwn138").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage138(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage138(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage138(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage138(secs,1,60)); document.getElementById("cntdwn138").innerHTML = DisplayStr; if (CountActive138) setTimeout("CountBack138(" + (secs+CountStepper138) + ")", SetTimeOutPeriod138); } function putspan138() { document.write(""); } //if (typeof(BackColor138)=="undefined") // BackColor138 = "white"; //if (typeof(ForeColor138)=="undefined") // ForeColor138= "black"; if (typeof(TargetDate138)=="undefined") TargetDate138 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat138)=="undefined") DisplayFormat138 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive138)=="undefined") CountActive138 = true; if (typeof(FinishMessage138)=="undefined") FinishMessage138 = ""; if (typeof(CountStepper138)!="number") CountStepper138 = -1; if (typeof(LeadingZero138)=="undefined") LeadingZero138 = true; CountStepper138 = Math.ceil(CountStepper138); if (CountStepper138 == 0) CountActive138 = false; var SetTimeOutPeriod138 = (Math.abs(CountStepper138)-1)*1000 + 990; //putspan138(BackColor138, ForeColor138); putspan138(); var dthen138 = new Date(TargetDate138); var dnow138 = new Date(SourceDate138); if(CountStepper138>0) ddiff138 = new Date(dnow138-dthen138); else ddiff138 = new Date(dthen138-dnow138); gsecs138 = Math.floor(ddiff138.valueOf()/1000); CountBack138(gsecs138);