// Functions for flipping through images.
// Build an array of image ids.
// Create a variable to hold the first image.
// Next and previous will display the next/previous image.


function show_image(n) {
    $(".images .image").css("display", "none");
    $(".images .image"+n).css("display", "block");
}
function show_previous(event) {
    // Show the previous image in the list.
    i -= 1;
    if (i < 0) i = 0; 
    if (i == 0) {
        i = 0;
        // showing the first, disable the previous link
        $(event.target).css("display", "none");
    }
    $("a.show_next").css("display", "inline");
    show_image(image_indexes[i]);
    return false;
}
function show_next(event) {
    // Show the next image in the list.
    i += 1;
    if (i >= image_indexes.length) i -= 1;
    if (i == image_indexes.length-1) {
        // showing the last, disable the next link
        $(event.target).css("display", "none");
    }
    $("a.show_previous").css("display", "inline");
    show_image(image_indexes[i]);
    return false;
}
function email_friend(event) {
    // Not used, remove at a later date,  [dvh 2/21/08]
    return popup(this.href, 'emailfriend', 600, 500);
}

