/* - - - - - - - - - - - - - - - - - - - - - - - LYSS website automated effects Author: Chris Geerling - - - - - - - - - - - - - - - - - - - - - - - */ /* --- LYSS FAIR DATE -- */ var Yr = 2008; var Mth = 10; var Dy = 26; /* --- Script Methods --- */ function DaysBetweenDateAndNow(yr, mo, dy){ var d, r, t1, t2, t3; //Declare variables. var MinMilli = 1000 * 60 //Initialize variables. var HrMilli = MinMilli * 60 var DyMilli = HrMilli * 24 t1 = Date.UTC(yr, mo - 1, dy) //Get milliseconds since 1/1/1970. d = new Date(); //Create Date object. t2 = d.getTime(); //Get current time. //if (t2 >= t1) // t3 = t2 - t1; //else t3 = t1 - t2; r = Math.round(t3 / DyMilli); return(r); //Return difference. } function WeeksToFair() { var Ctrl = document.getElementById('WeeksToFair'); if (Ctrl) { var DaysToGo = DaysBetweenDateAndNow(Yr,Mth,Dy); if (DaysToGo > 0) { var WeeksToGo = Math.floor(DaysToGo / 7); Ctrl.innerText = 'Only ' + WeeksToGo + ' weeks (' + DaysToGo + ' days) to go!'; } } } function NoticePopup() { var Ctrl = document.getElementById('WeeksToFair'); if (Ctrl) { var DaysToGo = DaysBetweenDateAndNow(Yr,Mth,Dy); if (DaysToGo > 0) { var wnd = window.open('fair_notices.html','Wnd','top=164,left=162,width=500,height=400,scrollbars=yes,resizable=0,toolbar=0,status=0,dependent=1'); } } } function FairPageLoad() { WeeksToFair(); NoticePopup(); } function Body_OnLoad() { if (document.images) { var imgCount = document.images.length; var img; for (var i=0; i'; } var src = img.src; html = '' + html + AltText + ''; img.outerHTML = html; } } } } function BuildIndex() { if (document.getElementById) { var Bookmarks = document.anchors; var FramedBox = document.getElementById('LinkBox'); var UL = document.createElement('UL'); if ((Bookmarks) && (FramedBox)) { if (Bookmarks.length > 0) { for (var i=0; i < Bookmarks.length; i++) { var A = Bookmarks[i]; if (A.name) { var Na = document.createElement('A'); var Li = document.createElement('LI'); Na.href='#' + A.name; Na.innerText = A.name.toLowerCase(); Li.appendChild(Na); UL.appendChild(Li); } FramedBox.appendChild(UL); FramedBox.style.display = ''; } } } } }