/*
USAGE

    <SCRIPT LANGUAGE="JScript" FOR=window EVENT=onload TYPE="text/javascript">

        // Note: Requires slideshow.js and preload.js in <root>/jscript folder
        // Images must be 200x150 Landscape in <root>/slideshow folder
        // Slide Show VCR buttons are in <root>/images/vcr folder

        MM_preloadImages("slideshow/graphics/rr_flat.gif","slideshow/graphics/rr_raised.gif","slideshow/graphics/rr_pressed.gif",
                         "slideshow/graphics/p_flat.gif", "slideshow/graphics/p_raised.gif", "slideshow/graphics/p_pressed.gif",
                         "slideshow/graphics/r_flat.gif", "slideshow/graphics/r_raised.gif", "slideshow/graphics/r_pressed.gif",
                         "slideshow/graphics/s_flat.gif", "slideshow/graphics/s_raised.gif", "slideshow/graphics/s_pressed.gif",
                         "slideshow/graphics/ff_flat.gif","slideshow/graphics/ff_raised.gif","slideshow/graphics/ff_pressed.gif");

        // Load the slide show images from the slideshow/ folder
        szAryImg    = "1.jpg$2.jpg$3.jpg$4.jpg$5.jpg$6.jpg$7.jpg$8.jpg$9.gif"
        szAryImg    = szAryImg.split("$");

        // Initialization Settings
        nIndex      = 1;        // Start at the second picture since the first one is already loaded
        nInterval   = 3000;     // Initial wait will be set to 5 seconds after the first image
        bContinious = false;    // If you want it to loop continiously

        // Set to true if you want the slideshow to start on page load
        bRun        = true;


        // Do not change this value
        bInitial    = true;

        // Run the Slide Show
        if(bRun) setTimeout("MySlideShow()",nInterval);

    </SCRIPT>

</HEAD>

*/
var szAryImg    = new String();
var nInterval   = new Number();
var nIndex      = new Number();
var bRun        = new Boolean();
var bInitial    = new Boolean();
var bContinious = new Boolean()


//-------------------------------------------------------------------------------------------------------------------------------------------------------
function SetMyInterval()
{
    with(document)
    {
        nInterval = Number(getElementById("hid_interval").value=getElementById("txt_interval").value) * 1000;
    }
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function MySlideShow()
{

    if(bInitial)
    {
        bInitial = false;
        nInterval = 5000;
    }

    if(!bRun) return;

    if(nIndex == szAryImg.length)
    {
        nIndex = 0;
        if(!bContinious)
        {
            bRun = false;
            MM_swapImage("btn_pl","","slideshow/graphics/r_flat.gif");
            return;
        }
    }

    document.images("slideshow").src = "slideshow/" + szAryImg[nIndex];
    nIndex++;
    setTimeout("MySlideShow()",nInterval);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function btn_FastForward_Click()
{
    nIndex = szAryImg.length -1;
    bRun = true;
    MySlideShow();
    bRun = false;
    MM_swapImage("btn_pl","","slideshow/graphics/r_flat.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function btn_FastReverse_Click()
{
    nIndex = 0;
    bRun = true;
    MySlideShow();
    bRun = false;
    MM_swapImage("btn_pl","","slideshow/graphics/r_flat.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function btn_Stop_Click()
{
    bRun = false;
    MM_swapImage("btn_pl","","slideshow/graphics/r_flat.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function btn_Run_Click()
{
    if(bRun)
    {
        bRun = false;
    }
    else
    {
        bRun = true;
        MySlideShow();
    }
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function opt_Interval_Change(cbo)
{
    nInterval=cbo[cbo.selectedIndex].value * 1000;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function SetRun_MouseOver()
{
    if(bRun)
        MM_swapImage("btn_pl","","slideshow/graphics/p_raised.gif");
    else
        MM_swapImage("btn_pl","","slideshow/graphics/r_raised.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function SetRun_MouseOut()
{
    if(bRun)
        MM_swapImage("btn_pl","","slideshow/graphics/p_flat.gif");
    else
        MM_swapImage("btn_pl","","slideshow/graphics/r_flat.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function SetRun_MouseDown()
{
    if(bRun)
        MM_swapImage("btn_pl","","slideshow/graphics/p_pressed.gif");
    else
        MM_swapImage("btn_pl","","slideshow/graphics/r_pressed.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------
function SetRun_MouseUp()
{
    if(bRun)
        MM_swapImage("btn_pl","","slideshow/graphics/r_flat.gif");
    else
        MM_swapImage("btn_pl","","slideshow/graphics/p_flat.gif");
}
//-------------------------------------------------------------------------------------------------------------------------------------------------------

