/* 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 TargetDate167 = "3/01/2017 12:00"; var SourceDate167 = "08/21/2018 01:43:48"; //var BackColor167; //var ForeColor167; var DisplayFormat167; var FinishMessage167; var LeadingZero167; //if(!BackColor167) BackColor167 = "palegreen"; //if (BackColor) BackColor167=BackColor; //if(!ForeColor167) ForeColor167 = "navy"; //if (ForeColor) ForeColor167=ForeColor; CountActive167 = true; CountStepper167 = -1; LeadingZero167 = true; if(!DisplayFormat167) DisplayFormat167 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (DisplayFormat) DisplayFormat167=DisplayFormat; if(!FinishMessage167) FinishMessage167 = "Closed!"; if (FinishMessage) FinishMessage167=FinishMessage; function calcage167(secs, num1, num2) { s = ((Math.floor(secs/num1))%num2).toString(); if (LeadingZero167 && s.length < 2) s = "0" + s; return "" + s + ""; } function CountBack167(secs) { if (secs < 0) { document.getElementById("cntdwn167").innerHTML = FinishMessage; return; } DisplayStr = DisplayFormat.replace(/%%D%%/g, calcage167(secs,86400,100000)); DisplayStr = DisplayStr.replace(/%%H%%/g, calcage167(secs,3600,24)); DisplayStr = DisplayStr.replace(/%%M%%/g, calcage167(secs,60,60)); DisplayStr = DisplayStr.replace(/%%S%%/g, calcage167(secs,1,60)); document.getElementById("cntdwn167").innerHTML = DisplayStr; if (CountActive167) setTimeout("CountBack167(" + (secs+CountStepper167) + ")", SetTimeOutPeriod167); } function putspan167() { document.write(""); } //if (typeof(BackColor167)=="undefined") // BackColor167 = "white"; //if (typeof(ForeColor167)=="undefined") // ForeColor167= "black"; if (typeof(TargetDate167)=="undefined") TargetDate167 = "12/31/2020 5:00 AM"; if (typeof(DisplayFormat167)=="undefined") DisplayFormat167 = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds."; if (typeof(CountActive167)=="undefined") CountActive167 = true; if (typeof(FinishMessage167)=="undefined") FinishMessage167 = ""; if (typeof(CountStepper167)!="number") CountStepper167 = -1; if (typeof(LeadingZero167)=="undefined") LeadingZero167 = true; CountStepper167 = Math.ceil(CountStepper167); if (CountStepper167 == 0) CountActive167 = false; var SetTimeOutPeriod167 = (Math.abs(CountStepper167)-1)*1000 + 990; //putspan167(BackColor167, ForeColor167); putspan167(); var dthen167 = new Date(TargetDate167); var dnow167 = new Date(SourceDate167); if(CountStepper167>0) ddiff167 = new Date(dnow167-dthen167); else ddiff167 = new Date(dthen167-dnow167); gsecs167 = Math.floor(ddiff167.valueOf()/1000); CountBack167(gsecs167);