/* 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 TargetDate161 = "3/02/2017 00:00"; var SourceDate161 = "08/18/2018 15:02:19"; //var BackColor161; //var ForeColor161; var DisplayFormat161; var FinishMessage161; var LeadingZero161; //if(!BackColor161) BackColor161 = "palegreen"; //if (BackColor) BackColor161=BackColor; //if(!ForeColor161) ForeColor161 = "navy"; //if (ForeColor) ForeColor161=ForeColor; CountActive161 = true; CountStepper161 = -1; LeadingZero161 = true; if(!DisplayFormat161) DisplayFormat161 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat161=DisplayFormat; if(!FinishMessage161) FinishMessage161 = "Closed!"; if (FinishMessage) FinishMessage161=FinishMessage; function calcage161(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero161 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack161(secs) { if (secs < 0) { document.getElementById("cntdwn161").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage161(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage161(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage161(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage161(secs,1,60)); document.getElementById("cntdwn161").innerHTML = DisplayStr; if (CountActive161) setTimeout("CountBack161(" + (secs+CountStepper161) + ")", SetTimeOutPeriod161); } function putspan161() { document.write(""); } //if (typeof(BackColor161)=="undefined") // BackColor161 = "white"; //if (typeof(ForeColor161)=="undefined") // ForeColor161= "black"; if (typeof(TargetDate161)=="undefined") TargetDate161 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat161)=="undefined") DisplayFormat161 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive161)=="undefined") CountActive161 = true; if (typeof(FinishMessage161)=="undefined") FinishMessage161 = ""; if (typeof(CountStepper161)!="number") CountStepper161 = -1; if (typeof(LeadingZero161)=="undefined") LeadingZero161 = true; CountStepper161 = Math.ceil(CountStepper161); if (CountStepper161 == 0) CountActive161 = false; var SetTimeOutPeriod161 = (Math.abs(CountStepper161)-1)*1000 + 990; //putspan161(BackColor161, ForeColor161); putspan161(); var dthen161 = new Date(TargetDate161); var dnow161 = new Date(SourceDate161); if(CountStepper161>0) ddiff161 = new Date(dnow161-dthen161); else ddiff161 = new Date(dthen161-dnow161); gsecs161 = Math.floor(ddiff161.valueOf()/1000); CountBack161(gsecs161);