// This is a set of javascript routines used to implement a specific
// type of rollover.

// Written by David Snyder, University of Michigan
// March, 1998 

// This routine is called when the mouse enters the area owned by an object.
function event_mouse_over(image_number)
{
    // If not properly initialize, stop now.
    if(!initialized) return true;

    // Load the "on" image.
    image_name = 'image_' + image_number;
    eval("document.slide_frame.src = r" + image_name + ".src");

    return true;
}


// This routine is called when the mouse leaves the area owned by an object.
function event_mouse_out()
{
    // If not properly initialize, stop now.
    if(!initialized) return true;

    // Load the "on" image.
    image_name = 'image_0';
    eval("document.slide_frame.src = r" + image_name + ".src");

    return true;
}

// Routine which tests if this effect will work with this browser.
function test_ok()
{
    // If this effect will not work with this browser, set initialized false.
    with(navigator)
    {
        browser = appCodeName;
        version = parseInt(appVersion);
        if(browser=="Mozilla" && version>=3)
            initialized = true;
        else
            initialized = false;
    }
}

// Routine which initializes the slideshow.
function init_slideshow(image_directory, image_list, image_suffix)
{
    // Initialize.
    test_ok();

    // Preload the slideshow images.
    for(var i = 0; i <=image_list.length; i++)
    {
        var image_file = image_list[i];
        var image_name = 'image_' + i;
        eval("r" + image_name  + " = new Image()");
        eval("r" + image_name  + ".src = '" + image_directory + image_file +
             "." + image_suffix + "'");
    }
}

