// (C) 2002 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header.

// ==============================
// Set the following variables...
// ==============================

// = dwb ======================================================
// Set the delay for the first slide (in milliseconds)
var FirstSlideDelay = 20000;
// = dwb ======================================================

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 15000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = (SlideShowSpeed / 5000);

// = dwb ======================================================
// The value of the 'rndRange' variable dictates the greatest
// value returned by the 'getRndNum(rndRange)' function
var rndRange = 3;
// = dwb ======================================================

// = dwb ======================================================
// The value of the 'firstLoad' variable dictates which image
// will be the first image displayed each time the page is
// loaded/reloaded/refreshed
var firstLoad = 1;
// = dwb ======================================================

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this

// Specify the image files...
// To add more images, just continue
// the pattern, adding to the array below.
// To use fewer images, remove lines
// starting at the end of the Picture array.
// Caution: The number of Pictures *must*
// equal the number of Captions!

Picture[1]  = "/hmpgpics/001.jpg";
Picture[2]  = "/hmpgpics/002.jpg";
Picture[3]  = "/hmpgpics/003.jpg";
Picture[4]  = "/hmpgpics/004.jpg";
Picture[5]  = "/hmpgpics/005.jpg";
Picture[6]  = "/hmpgpics/006.jpg";
Picture[7]  = "/hmpgpics/007.jpg";
Picture[8]  = "/hmpgpics/008.jpg";
Picture[9]  = "/hmpgpics/009.jpg";
Picture[10] = "/hmpgpics/010.jpg";
Picture[11] = "/hmpgpics/011.jpg";
Picture[12] = "/hmpgpics/012.jpg";
Picture[13] = "/hmpgpics/013.jpg";
Picture[14] = "/hmpgpics/014.jpg";
Picture[15] = "/hmpgpics/015.jpg";
Picture[16] = "/hmpgpics/016.jpg";
Picture[17] = "/hmpgpics/017.jpg";
Picture[18] = "/hmpgpics/018.jpg";
Picture[19] = "/hmpgpics/019.jpg";
Picture[20] = "/hmpgpics/020.jpg";
Picture[21] = "/hmpgpics/021.jpg";
Picture[22] = "/hmpgpics/022.jpg";
Picture[23] = "/hmpgpics/023.jpg";
Picture[24] = "/hmpgpics/024.jpg";
Picture[25] = "/hmpgpics/025.jpg";
Picture[26] = "/hmpgpics/026.jpg";
Picture[27] = "/hmpgpics/027.jpg";
Picture[28] = "/athletics/softball/images/team.jpg";
Picture[29] = "/athletics/basketball/images/team_home.jpg";


// Specify the Captions...
// To add more captions, just continue
// the pattern, adding to the array below.
// To use fewer captions, remove lines
// starting at the end of the Caption array.
// Caution: The number of Captions *must*
// equal the number of Pictures!

Caption[1]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[2]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[3]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[4]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[5]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[6]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[7]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[8]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[9]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[10]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[11]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[12]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[13]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[14]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[15]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[16]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[17]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[18]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[19]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[20]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[21]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[22]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[23]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[24]  = "Celebrating 100 Years Of Service &nbsp;<a href=\"/?url=/dept/conted/centennial/index.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[25]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[26]  = "Lamar State College - Port Arthur. A great place to begin... &nbsp;<a href=\"/?url=/gen/about.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[27]  = "Earn Online LVN-RN Degree... &nbsp;<a href=\"http://www.stateu.com/lamarpa/\"><font color=#FFFF99>(read more...)</font></a>";
Caption[28]  = "Seahawks Women's Softball Team. Go Seahawks &nbsp;<a href=\"/?url=/athletics/softball/index.html\"><font color=#FFFF99>(read more...)</font></a>";
Caption[29]  = "Seahawks Men's Basketball Team. Go Seahawks &nbsp;<a href=\"/?url=/athletics/basketball/index.html\"><font color=#FFFF99>(read more...)</font></a>";

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss;
var pss = Picture.length;
var preLoad = new Array();
var slidePause = SlideShowSpeed;

function runSlideShow()
{
    if (typeof(jss) == "undefined")
    {
        jss = firstLoad;
        loadFirstSlide();
        slidePause = 0;
    } else {
        loadSlide();
        if (firstLoad > 0)
        {
            slidePause = FirstSlideDelay;
            firstLoad = 0;
        } // end if
    } // end if
    if (slidePause < 0) slidePause = 0;
    tss = setTimeout('runSlideShow()', slidePause);
} // end function runSlideShow()

// = dwb ======================================================
// This function is designed to load the first image without
// using the 'blendTrans' effect--that way the first image
// will load quickly and the user will not see the 'empty
// image' box and alt-text before the image fades into view
function loadFirstSlide()
{
    if (typeof(jss) == "undefined") jss = firstLoad;
    preLoad[jss] = new Image();
    preLoad[jss].src = Picture[jss];
    document.images.PictureBox.src = preLoad[jss].src;
    if (document.getElementById) document.getElementById("CaptionBox").innerHTML=Caption[jss];
} // end function loadFirstSlide()
// = dwb ======================================================

function loadSlide()
{
    document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
    document.images.PictureBox.filters.blendTrans.Apply();
    document.images.PictureBox.src = preLoad[jss].src;
    if (document.getElementById) document.getElementById("CaptionBox").innerHTML=Caption[jss];
    if (document.all) document.images.PictureBox.filters.blendTrans.Play();

    var rnd = getRndNum(rndRange); // see 'getRndNum' function comments
    jss = jss + rnd;
    if (jss >= (pss)) jss=rnd;

    var timeBeforePreLoad = new Date();
    var beforePreLoadTime = timeBeforePreLoad.getTime();

    if (typeof(preLoad[jss]) == "undefined")
    {
        preLoad[jss] = new Image();
        preLoad[jss].src = Picture[jss];
    } // end if

    var timeAfterPreLoad = new Date();
    var afterPreLoadTime = timeAfterPreLoad.getTime();

    slidePause = (SlideShowSpeed - (afterPreLoadTime - beforePreLoadTime));
} // end function loadSlide()

// = dwb ======================================================
// The 'getRndNum(offset)' function returns an integer between
// 1 and the value of 'offset'
function getRndNum(offset)
{
    var rndNum = Math.ceil(Math.random() * offset);
    return rndNum;
} // end function getRndNum(offset)
// = dwb ======================================================
