$(document).ready(function(){if($("#dot").length>0){moveDot();updateCountdown()}});var now=new Date();var time_correction=server_time-now.getTime()/1000;function moveDot(){var b=new Date();var d=b.getTime()/1000+time_correction;for(var c=0;c<timeline.length;c++){if(timeline[c][2]>d){var a=document.getElementById("dot");a.style.left=(timeline[c][0]-5)+"px";a.style.top=(timeline[c][1]-5)+"px";a.style.visibility="inherit";break}}setTimeout("moveDot()",60000)}function pause(b){var a=new Date();var c=a.getTime()+b;while(true){a=new Date();if(a.getTime()>c){return}}}function toFmt(a){if((a>=0)&&(a<=9)){return"0"+a}else{return a}}function updateCountdown(){var h=document.getElementById("highcountdown");var e=document.getElementById("lowcountdown");var c=document.getElementById("hightime");var g=document.getElementById("lowtime");var b=new Date();var f=Math.round(b.getTime()/1000+time_correction);var l="-";var j="-";for(i=0;i<high_tides.length;i++){if(high_tides[i]>f){var k=high_tides[i]-f;l=toFmt(Math.floor(k/3600))+" hr ";l+=toFmt(Math.floor((k%3600)/60))+" min ";l+=toFmt(k%60)+" s";var d=new Date(b.valueOf()+k*1000+time_correction*1000+3600000*(hrdiff+b.getTimezoneOffset()/60));j=toFmt(d.getHours())+":"+toFmt(d.getMinutes())+":"+toFmt(d.getSeconds());break}}h.value=l;c.value=j;l="-";j="-";for(i=0;i<low_tides.length;i++){if(low_tides[i]>f){var k=low_tides[i]-f;l=toFmt(Math.floor(k/3600))+" hr ";l+=toFmt(Math.floor((k%3600)/60))+" min ";l+=toFmt(k%60)+" s";var d=new Date(b.valueOf()+k*1000+time_correction*1000+3600000*(hrdiff+b.getTimezoneOffset()/60));j=toFmt(d.getHours())+":"+toFmt(d.getMinutes())+":"+toFmt(d.getSeconds());break}}e.value=l;g.value=j;var a=document.getElementById("localtime");var d=new Date(b.valueOf()+time_correction*1000+3600000*(hrdiff+b.getTimezoneOffset()/60));a.value=toFmt(d.getHours())+":"+toFmt(d.getMinutes())+":"+toFmt(d.getSeconds());setTimeout("updateCountdown()",1000)};