/* Google search bar for site. Maintain this custom search or others
* by logging into google with my account and going to
* https://cse.google.com/cse/all. If you're not me, and if I never
* told you that you are then you're probably not, I can assign other
* google users to be able to maintain the URLs for the searches. */
if (typeof ignoreGcse == 'undefined') {
(function() {
var cx = '005579885767466475821:oqt5wpxqlt8';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
}
/* Get the logo URL. */
var date = new Date();
var dayOfMonth = date.getDate();
var logoIndex = dayOfMonth % 3;
var logo;
if (logoIndex == 1) logo = "ApolloPatchD.png";
else if (logoIndex == 2) logo = "ApolloPatchC.png";
else logo = "ApolloPatchA.png";
/* Template for the page's header. You just have to substitute
for @TITLE@ and @SUBTITLE@ and then print the result at the
top of the
. */
headerTemplate = ''
+ ''
+ ''
+ ''
+ ' '
+ ''
+ ' '
+ ''
+ ''
+ ''
+ ''
+ ' '
+ ''
+ ' '
+ ' | '
+ ''
+ 'Virtual AGC — AGS — LVDC — Gemini'
+ ' '
+ '@TITLE@ '
+ '@SUBTITLE@ '
+ ' '
+ ' | '
+ ''
+ ' '
+ ''
+ ' '
+ ' | '
+ ' '
+ ''
+ ' '
+ ' '
+ ''
+ ''
+ ' '
+ ''
+ ' '
+ ' | '
+ ''
+ ' '
+ ' | '
+ '
';
if (typeof ignoreGcse == 'undefined') {
headerTemplate += ''
+ ' '
+ ' | '
+ '
';
}
headerTemplate += ''
+ '
';
/*
* The following function is only used for host https://virtualagc.github.io/virtualagc.
* On that "staging" version of the website, there are no directories like
* Documents, Downloads, hrst, klabs, etc., and so references to them need to be
* redirected to http://www.ibiblio.org/apollo + whatever. We simply
* loop through all of the links in the page, and if any of them are to one of the
* affected subdirectories, we prefix the href properly.
*/
var retargetedFolders = [ "/OnnoHommes/",
"/AlessandroCinqueman/",
"/DimitrisVitoris/",
"/WebMirror/",
"/FabrizioPresentationPhotos/",
"/hrst/",
"/NARASWoverflow/",
"/Pultorak_files/",
"/Downloads/",
"/Artemis072Scans/",
"/NARA-SW/",
"/ScansForConversion/",
"/Documents/",
"/RileyRainey/",
"/YUL/",
"/ApolloProjectOnline/",
"/doc/",
"/klabs/",
"/AGCHandbook/",
"/KiCad/",
"/NARA-aperture-cards/"
]
var numRetargets = retargetedFolders.length
window.onload = function() {
if (window.location.hostname != "virtualagc.github.io")
return
var i, j
var links = document.links
var numLinks = links.length
for (i = 0; i < numLinks; i++) {
if ("href" in links[i]) {
for (j = 0; j < numRetargets; j++) {
var index = links[i].href.indexOf(retargetedFolders[j])
if (index >= 0) {
links[i].href = "http://www.ibiblio.org/apollo" + links[i].href.substring(index)
break
}
}
}
}
var images = document.images
var numImages = images.length
for (i = 0; i < numImages; i++) {
if ("src" in images[i]) {
for (j = 0; j < numRetargets; j++) {
var index = images[i].src.indexOf(retargetedFolders[j])
if (index >= 0) {
images[i].src = "http://www.ibiblio.org/apollo" + images[i].src.substring(index)
break
}
}
}
}
}