1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 var gStardate, gSDBase;
7 window.onload = function() {
8 setTimeout(updateStardate, 0);
11 function updateStardate() {
13 gStardate = document.getElementById("stardate");
15 var curDate = new Date();
18 gSDBase = new Date("September 8, 1966 20:00:00 EST");
20 var sdateval = (curDate - gSDBase) / (86400 * 365.2425);
21 gStardate.textContent = sdateval.toFixed(1);
23 setTimeout(updateStardate, 5*60*1000);
26 function switchModule(modname) {
27 var sections = document.getElementsByTagName('section');
28 for (var i = 0; i <= sections.length - 1; i++) {
29 sections[i].classList.remove("active");
31 var navs = document.getElementById('navlist').children;
32 for (var i = 0; i <= navs.length - 1; i++) {
33 navs[i].classList.remove("active");
36 document.getElementById("nav" + modname).classList.add("active");
37 document.getElementById("sect" + modname).classList.add("active");