// Global constants var replacementChar = /%s/ var numMetadataItems = 7 var timeoutID var playing var showPlayStopInternal // Global variables var outputSubTitle var imagesOnAPage var index function parseCommandLine() { if (location.href.indexOf("?") == -1) { return 0 } // Parse any command line arguments urlQuery = location.href.split("?") urlTerms = urlQuery[1].split(",") if (urlTerms[0] != null) { index = parseInt(urlTerms[0]) } if (urlTerms[1] != null) { playing = parseInt(urlTerms[1]) } } function printBodyStartTag() { document.write("
") document.write("") } function stopStartSlideShow(firstTime) { if (playing == 1) { playing = 0 clearTimeout(timeoutID) if (firstTime != 1) { index = -1 slideShow() } } else { playing = 1 timeoutID = setInterval("slideShow()", delay) } } function slideShow() { index = index + 1 if (index >= imageDB.length) { index = 0 } // Change the image window.location.href = "page.htm?" + index + "," + playing // Change the play text to stop slideShowControl.innerText="Stop"; } function init(showPlayStop) { // Make output strings from theme.js and data.js outputSubTitle = themeSubTitle.replace(replacementChar, subTitle); // Perform some initial calculations imagesOnAPage = rows*columns playing = 0 index = 0 parseCommandLine() showPlayStopInternal = 1; if (themeShowPlayStop == 0) { if (showPlayStop == 0) { showPlayStopInternal = 0; } } // Start or stop the slideshow if (playing == 0) { playing = 1 } else { playing = 0 } stopStartSlideShow(1) } function printTitle(writePageTitle) { if (strip == 1 && writePageTitle == 0) { return } var tempTitle = themeThumbTitle; if (writePageTitle == 1) { tempTitle = themeImageTitle; } document.write("") document.write(" |
") outputImageLink = themeImageLink.replace(replacementChar, index); outputImageLink = outputImageLink.replace(replacementChar, playing); document.write(outputImageLink) document.write(" | ") document.write("
" + imageMetadataDB[i] + " | ") document.write("
")
document.write(" ")
var url = themeURLHolder.replace(replacementChar, URL);
url = url.replace(replacementChar, urlMouseOverText);
url = url.replace(replacementChar, urlMouseOverText);
document.write(url)
document.write(" ")
document.write(" | ")
// Write play/stop
if (showPlayStopInternal == 1) {
document.write("") document.write(" | ") } // Write first link if (index != 0) { document.write(" ") document.write("")
document.write(" ")
if (writePageLinks == 0) {
outputFirstLink = themeFirstHolder.replace(replacementChar, playing);
outputFirstLink = outputFirstLink.replace(replacementChar, firstMouseOverText);
document.write(outputFirstLink)
}
else {
if (index != 0) {
outputFirstLink = themeFirstHolder.replace(replacementChar, playing);
outputFirstLink = outputFirstLink.replace(replacementChar, firstMouseOverText);
document.write(outputFirstLink)
}
}
document.write(" ")
document.write(" | ")
}
// Write previous link
if (index != 0) {
document.write("")
document.write(" ")
var previousIndex
if (writePageLinks == 0) {
previousIndex = index - 1;
outputPreviousLink = themePreviousHolder.replace(replacementChar, previousIndex);
outputPreviousLink = outputPreviousLink.replace(replacementChar, playing);
outputPreviousLink = outputPreviousLink.replace(replacementChar, previousMouseOverText);
document.write(outputPreviousLink)
}
else {
if (index != 0) {
previousIndex = index-imagesOnAPage;
if (previousIndex < 0) {
previousIndex = 0
}
outputPreviousLink = themePreviousHolder.replace(replacementChar, previousIndex);
outputPreviousLink = outputPreviousLink.replace(replacementChar, playing);
outputPreviousLink = outputPreviousLink.replace(replacementChar, previousMouseOverText);
document.write(outputPreviousLink)
}
}
document.write(" ")
document.write(" | ")
}
// Write next link
var nextIndex
if (writePageLinks == 0) {
nextIndex = index + 1;
if (nextIndex < imageDB.length) {
document.write("")
document.write(" ")
outputNextLink = themeNextHolder.replace(replacementChar, nextIndex);
outputNextLink = outputNextLink.replace(replacementChar, playing);
outputNextLink = outputNextLink.replace(replacementChar, nextMouseOverText);
document.write(outputNextLink)
document.write(" ")
document.write(" | ")
}
}
else {
nextIndex = index+imagesOnAPage;
if (nextIndex < thumbDB.length) {
document.write("")
document.write(" ")
outputNextLink = themeNextHolder.replace(replacementChar, nextIndex);
outputNextLink = outputNextLink.replace(replacementChar, playing);
outputNextLink = outputNextLink.replace(replacementChar, nextMouseOverText);
document.write(outputNextLink)
document.write(" ")
document.write(" | ")
}
}
// Write last link
var lastIndex
if (writePageLinks == 0) {
lastIndex = imageDB.length-1;
if (index < imageDB.length-1 && lastIndex < imageDB.length) {
document.write("")
document.write(" ")
outputLastLink = themeLastHolder.replace(replacementChar, lastIndex);
outputLastLink = outputLastLink.replace(replacementChar, playing);
outputLastLink = outputLastLink.replace(replacementChar, lastMouseOverText);
document.write(outputLastLink)
}
}
else {
lastIndex = thumbDB.length - imagesOnAPage;
if (lastIndex < 0) {
lastIndex = 0;
}
if (index < lastIndex) {
document.write(" ")
document.write(" | ")
}
}
document.write("")
outputLastLink = themeLastHolder.replace(replacementChar, lastIndex);
outputLastLink = outputLastLink.replace(replacementChar, playing);
outputLastLink = outputLastLink.replace(replacementChar, lastMouseOverText);
document.write(outputLastLink)
document.write(" ")
document.write(" |
")
document.write("
| ")
}
counter++
}
document.write("