﻿// JScript File
var present_slide=0;
//Picture Array
var arrayImages = new Array('07MWracing.gif',
'134_3434.jpg',
'113_1306_img.gif',
'img_2183.gif',
'111_1189_img.jpg',
'img_2198.jpg',
'133_3382.jpg',
'IMG_3929.jpg'
);
// base dir of images
var baseDirectory = 'images/HeaderPictures/';
// run flag
var on = 1;
// current pic #
var pictureIndex = -1;
var timerID = 0;
// 3 second delay
var interval = 7000;
function advance()
{	// move to the next pic:
pictureIndex += 1; // increment
pictureIndex %= arrayImages.length; // wraparound if necessary
}
function show()
{	// show current pic:
document.getElementById('imageHeaderPictures').src = baseDirectory + arrayImages[pictureIndex]; // load it
document.getElementById('imageHeaderPictures').alt = arrayImages[pictureIndex]; // update alt
//update();
}
function pictureTimer()
{
// if running
if (on)
{
advance();	// next one
show();		// show it
}
timerID = setTimeout('pictureTimer()',interval); // next time
}
function toggle()
{
//alert(window.location.host)
switch (on)
{
case 0: // if off
on = 1;
advance();
show();
//update();
pictureTimer();
document.getElementById('imageHeaderPictures').title="Click to stop slide show"
break;
case 1: // if on
document.getElementById('imageHeaderPictures').title="Click to start slide show"
on = 0;
//update();
clearTimeout(timerID);
break;
}
}
