<!-- Next Neaps prediction - Mike Tomlinson, http://www.ukdivers.net, mailto:mike@ukdivers.net) -->

var currentDate  = new Date();
var x = currentDate;
currentDate.setTime(currentDate.getTime() + (currentDate.getTimezoneOffset()*60000));
var blueMoonDate = new Date(96, 1, 3, 16, 15, 0);
var lunarPeriod  = 29*(24*3600*1000) + 12*(3600*1000) + 44.05*(60*1000);
var moonPhaseTime = (currentDate.getTime() - blueMoonDate.getTime()) % lunarPeriod;
var time = Math.round((lunarPeriod-moonPhaseTime)/(24*3600*1000));
<!-- (time = Next full moon, Note that tides trail the moon phases by about 2 Days) -->
var day= 29-(time)
if(day==0) tides = "We are midway between Neap and Spring tides";
if(day==1) tides = "Spring tides are in 2 days";
if(day==2) tides = "Spring tides are tomorrow";
if(day==3) tides = "This is the first day of Spring tides";
if(day==4) tides = "This is the second day of Spring tides";
if(day==5) tides = "We are just going off Spring tides";
if(day==6) tides = "We are just going off Spring tides";
if(day==7) tides = "We are midway between Spring and Neap tides";
if(day==8) tides = "Neap tides are in 2 days";
if(day==9) tides = "Neap Tides are tomorrow";
if(day==10) tides = "This is the first day of Neap tides";
if(day==11) tides = "This is the second day of Neap tides";
if(day==12) tides = "We are just going off Neap tides";
if(day==13) tides = "We are just going off Neap tides";
if(day==14) tides = "We are midway between Neap and Spring tides";
if(day==15) tides = "Spring tides are in 2 days";
if(day==16) tides = "Spring tides are tomorrow";
if(day==17) tides = "This is the first day of Spring tides";
if(day==18) tides = "This is the second day of Spring tides";
if(day==19) tides = "We are just going off Spring tides";
if(day==20) tides = "Neap Tides are in 4 Days";
if(day==21) tides = "We are midway between Spring and Neap tides";
if(day==22) tides = "Neap tides are in 2 days";
if(day==23) tides = "Neap Tides are tomorrow";
if(day==24) tides = "This is the first day of Neap tides";
if(day==25) tides = "This is the second day of Neap tides";
if(day==26) tides = "We are just going off Neap tides";
if(day==27) tides = "Spring Tides are in 4 Days";
if(day==28) tides = "We are midway between Neap and Spring tides";

document.write(tides);


