"; photo_captions[13] = "The Battle of Hogwarts, from Harry Potter and the Deathly Hallows Part 2";photo_urls[14] = "https://www.nelug.org/mediagallery/mediaobjects/disp/1/1_a_walk_down_diagon_alley.jpg"; photo_captions[14] = "A walk down Diagon Alley";photo_urls[15] = "https://www.nelug.org/mediagallery/mediaobjects/disp/e/e_a_walk_down_diagon_alley.jpg"; photo_captions[15] = "A walk down Diagon Alley";photo_urls[16] = "https://www.nelug.org/mediagallery/mediaobjects/disp/1/1_some_details_of_magical_creaturs_shop.jpg"; photo_captions[16] = "Some Details of Magical Creaturs Shop";photo_urls[17] = "https://www.nelug.org/mediagallery/mediaobjects/disp/c/c_olivanders_wands.jpg"; photo_captions[17] = "Olivanders Wands";photo_urls[18] = "https://www.nelug.org/mediagallery/mediaobjects/disp/1/1_malfoy_family_entering_gringotts.jpg"; photo_captions[18] = "Malfoy Family entering Gringotts";photo_urls[19] = "https://www.nelug.org/mediagallery/mediaobjects/disp/9/9_inside_the_various_shops.jpg"; photo_captions[19] = "Inside the various shops";photo_urls[20] = "https://www.nelug.org/mediagallery/mediaobjects/disp/d/d_gringotts_from_down_the_alley.jpg"; photo_captions[20] = "Gringotts from down the Alley";photo_urls[21] = "https://www.nelug.org/mediagallery/mediaobjects/disp/c/c_gringotts_from_above.jpg"; photo_captions[21] = "Gringotts from above";photo_urls[22] = "https://www.nelug.org/mediagallery/mediaobjects/disp/6/6_flourish_and_blotts_books.jpg"; photo_captions[22] = "Flourish and Blotts Books";
var photo_count = 22;
function stopOrStart() {
if (onoff) {
stop();
} else {
play();
}
}
function toggleLoop() {
if (loop) {
loop = 0;
} else {
loop = 1;
}
}
function changeElementText(id, newText) {
element = document.getElementById(id);
element.innerHTML = newText;
}
function stop() {
changeElementText("stopOrStartText", "Play");
onoff = 0;
status = "The slide show is stopped, Click [play] to resume.";
clearTimeout(timer);
}
function play() {
changeElementText("stopOrStartText", "Stop");
onoff = 1;
status = "Slide show is running...";
go_to_next_photo();
}
function changeDirection() {
if (direction == 1) {
direction = -1;
changeElementText("changeDirText", "forward");
} else {
direction = 1;
changeElementText("changeDirText", "reverse");
}
preload_next_photo();
}
function preload_complete() {
}
function reset_timer() {
clearTimeout(timer);
if (onoff) {
timeout_value = document.slideshow.time.options[document.slideshow.time.selectedIndex].value * 1000;
timer = setTimeout('go_to_next_photo()', timeout_value);
}
}
function wait_for_current_photo() {
/* Show the current photo */
if (!show_current_photo()) {
/*
* The current photo is not loaded yet. Set a short timer just to wait
* until the current photo is loaded.
*/
status = "Picture is loading...(" + current_location + " of " + photo_count +
"). Please Wait..." ;
clearTimeout(timer);
timer = setTimeout('wait_for_current_photo()', 500);
return 0;
} else {
status = "Slide show is running...";
preload_next_photo();
reset_timer();
}
}
function go_to_next_photo() {
/* Go to the next location */
current_location = next_location;
/* Show the current photo */
if (!show_current_photo()) {
wait_for_current_photo();
return 0;
}
preload_next_photo();
reset_timer();
}
function preload_next_photo() {
/* Calculate the new next location */
next_location = (parseInt(current_location) + parseInt(direction));
if (next_location > photo_count) {
next_location = 1;
if (!loop) {
stop();
}
}
if (next_location == 0) {
next_location = photo_count;
if (!loop) {
stop();
}
}
/* Preload the next photo */
preload_photo(next_location);
}
function show_current_photo() {
/*
* If the current photo is not completely loaded do not display it.
*/
if (!images[current_location] || !images[current_location].complete) {
preload_photo(current_location);
return 0;
}
document.slide.src = images[current_location].src;
setCaption(photo_captions[current_location]);
return 1;
}
function preload_photo(index) {
/* Load the next picture */
if (pics_loaded < photo_count) {
/* not all the pics are loaded. Is the next one loaded? */
if (!images[index]) {
images[index] = new Image;
images[index].onLoad = preload_complete();
images[index].src = photo_urls[index];
pics_loaded++;
}
}
}
function setCaption(text) {
changeElementText("caption", "[" + current_location + " of " + photo_count + "] " + text);
}
//]]>