<!-- JavaScript source code for Rotating Pictures -->
<!--SCRIPT LANGUAGE="JavaScript">
<!--
/// <summary>
/// ********************************************************************************************************
/// Script: RotatePictures.js
/// Description:	Script to handle rotating pictures on a timed schedule within Tables on a website page.
///               Pulled original from Dreamweaver and modified to allow coplete control of timing.
/// ******************************************************************************************************** </summary> <remarks>
/// MODIFICATION HISTORY
/// Person			Date    Comments
/// ---------------	------	-----------------------------------------------------------------------------
/// Rodney Thompson	2/26/06	Created
/// Rodney Thompson	4/9/06	Changed delay from 6000 to 1 including delay for #5 on list 1 to be 16000
/// Rodney Thompson	4/16/06  Changed to set timer as multiplier of value in array
/// Rodney Thompson	4/23/06  Added another set of first images to beginning of array since we are transitioning
///									to them now rather than displaying them up front.
/// Rodney Thompson	5/2/06	Changed to use a blank image at the beginning for 2, 3, 4.
/// Rodney Thompson	10/12/09	Removed blank image at the beginning for 2, 3, 4.
/// ******************************************************************************************************** </remarks>
// * Dependencies * 
// this function requires the following snippets:
// JavaScript/images/switchImage
//
// BODY Example:
// <body onLoad="mySlideShow1.play(); mySlideShow2.play();">
// <img src="originalImage1.gif" name="slide1">
// <img src="originalImage2.gif" name="slide2">
//
// SCRIPT Example:
// var mySlideList1 = ['image1.gif', 'image2.gif', 'image3.gif'];
// var mySlideShow1 = new SlideShow(mySlideList1, 'slide1', 3000, "mySlideShow1");
// var mySlideList2 = ['image4.gif', 'image5.gif', 'image6.gif'];
// var mySlideShow2 = new SlideShow(mySlideList2, 'slide2', 1000, "mySlideShow2");
var browserName=navigator.appName; 
var mySlideList1 = ['Assets/Pic1-01.gif', 'Assets/Pic1-02.gif', 'Assets/Pic1-03.gif', 'Assets/Pic1-04.gif', 'Assets/Pic1-05.gif', 'Assets/Pic1-06.gif', 'Assets/Pic1-07.gif', 'Assets/Pic1-08.gif', 'Assets/Pic1-09.gif', 'Assets/Pic1-10.gif', 'Assets/Pic1-11.gif', 'Assets/Pic1-12.gif', 'Assets/Pic1-13.gif'];
var mySpeedList1 = [1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1];
var mySlideShow1 = new SlideShow(mySlideList1, mySpeedList1, 'slide1', "mySlideShow1");
var mySlideList2 = ['Assets/Pic2-01.gif', 'Assets/Pic2-02.jpg', 'Assets/Pic2-03.jpg', 'Assets/Pic2-04.jpg', 'Assets/Pic2-05.jpg', 'Assets/Pic2-06.jpg', 'Assets/Pic2-07.jpg', 'Assets/Pic2-08.jpg', 'Assets/Pic2-09.gif', 'Assets/Pic2-10.jpg', 'Assets/Pic2-11.jpg', 'Assets/Pic2-12.jpg', 'Assets/Pic2-13.jpg', 'Assets/Pic2-14.gif'];
var mySpeedList2 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
var mySlideShow2 = new SlideShow(mySlideList2, mySpeedList2, 'slide2', "mySlideShow2");
var mySlideList3 = ['Assets/Pic3-01.gif', 'Assets/Pic3-02.jpg', 'Assets/Pic3-03.jpg', 'Assets/Pic3-04.jpg', 'Assets/Pic3-05.jpg', 'Assets/Pic3-06.jpg', 'Assets/Pic3-07.jpg', 'Assets/Pic3-08.jpg', 'Assets/Pic3-09.gif', 'Assets/Pic3-10.jpg', 'Assets/Pic3-11.jpg', 'Assets/Pic3-12.jpg', 'Assets/Pic3-13.jpg', 'Assets/Pic3-14.gif'];
var mySlideShow3 = new SlideShow(mySlideList3, mySpeedList2, 'slide3', "mySlideShow3");
var mySlideList4 = ['Assets/Pic4-01.gif', 'Assets/Pic4-02.jpg', 'Assets/Pic4-03.jpg', 'Assets/Pic4-04.jpg', 'Assets/Pic4-05.jpg', 'Assets/Pic4-06.jpg', 'Assets/Pic4-07.jpg', 'Assets/Pic4-08.jpg', 'Assets/Pic4-09.gif', 'Assets/Pic4-10.jpg', 'Assets/Pic4-11.jpg', 'Assets/Pic4-12.jpg', 'Assets/Pic4-13.jpg', 'Assets/Pic4-14.gif'];
var mySlideShow4 = new SlideShow(mySlideList4, mySpeedList2, 'slide4', "mySlideShow4");
/// <summary>
/// ========================================================================================================
///	Function:	switchImage
///	Description	:	Applys the new image overlaying a prior image with a transition filter (see stylesheet)
///	Called from	:	
/// ========================================================================================================
/// PROCESSING NOTES:
///	Must have filters[0] to apply the transition.
///   Apply stops anything from being applied until next Play so you can switch Source.
/// -------------------------------------------------------------------------------------------------------
/// OUTPUT/INPUT VARIABLES
/// Variable Name			Description
/// -------------------	-----------------------------------------------------------------------------------
/// imgName				   Name of the Object Containing the Image
/// imgSrc              Relative link to new Image Source file
/// -------------------------------------------------------------------------------------------------------</summary> <remarks>
/// MODIFICATION HISTORY
/// Person           Date     Comments
/// ---------------  --------	-----------------------------------------------------------------------------
/// Rodney Thompson	2/26/05  Created
/// Rodney Thompson	5/2/05	Added in Browser Check to not use filter for Firefox.
/// ========================================================================================================
/// </remarks>
function switchImage(imgName, imgSrc) 
{
  if (document.images)
  {
    if (imgSrc != "none")
    {
    if (browserName=="Microsoft Internet Explorer")
		{
      document.images[imgName].filters[0].Apply();
      document.images[imgName].src = imgSrc;
      document.images[imgName].filters[0].Play();
      }
      else
      {
           document.images[imgName].src = imgSrc; 
		}
    }
  }
}

/// <summary>
/// ========================================================================================================
///	Function:	SlideShow
///	Description	:	Sets the current variables according to what has been passed in.
///	Called from	:	
/// ========================================================================================================
/// PROCESSING NOTES:
///	Must have filters[0] to apply the transition.
///   Apply stops anything from being applied until next Play so you can switch Source.
/// -------------------------------------------------------------------------------------------------------
/// OUTPUT/INPUT VARIABLES
/// Variable Name			Description
/// -------------------	-----------------------------------------------------------------------------------
/// imgName				   Name of the Object Containing the Image
/// imgSrc              Relative link to new Image Source file
/// -------------------------------------------------------------------------------------------------------</summary> <remarks>
/// MODIFICATION HISTORY
/// Person           Date     Comments
/// ---------------  --------	-----------------------------------------------------------------------------
/// Rodney Thompson	2/26/05  Created
/// ========================================================================================================
/// </remarks>
//function SlideShow(slideList, image, speed, name)
//Replace Speed with Array of Slide Timing Speed
function SlideShow(slideList, speedList, image, name)          
{
  this.slideList = slideList;
  this.speedList = speedList;
  this.image = image;
  this.name = name;
  this.current = 0;
  this.timer = 0;
}
/// This somehow defines the prototype of the SlideShow_play function and executes it.

SlideShow.prototype.play = SlideShow_play;  

/// <summary>
/// ========================================================================================================
///	Function:	SlideShow_play
///	Description	:	Handle Image Switching and Timing.
///	Called from	:	
/// ========================================================================================================
/// PROCESSING NOTES:
///	Sets the array counter to the next item in the list and calls switchImage then sets the next execution
///   according the matching item in the speedList
/// -------------------------------------------------------------------------------------------------------</summary> <remarks>
/// MODIFICATION HISTORY
/// Person           Date     Comments
/// ---------------  --------	-----------------------------------------------------------------------------
/// Rodney Thompson	2/26/05  Created
/// Rodney Thompson	4/16/05  Changed to set timer as multiplier of value in array
/// ========================================================================================================
/// </remarks>
function SlideShow_play()       
{
  with(this)
  {
    if(current++ == slideList.length-1) current = 0;
    switchImage(image, slideList[current]);
    clearTimeout(timer);
    //Use 2nd Array as timer
    
    timer = setTimeout(name+'.play()', speedList[current]*10000);
  }
}

/// <summary>
/// ========================================================================================================
///	Function:	StartImageBlocks
///	Description	:	Called on Page Load to Start the Image Rotation
///	Called from	:	
/// ========================================================================================================
/// PROCESSING NOTES:
///   Uses window timing feature window.setTimeout to execute the object at the specified time delay.
/// -------------------------------------------------------------------------------------------------------</summary> <remarks>
/// MODIFICATION HISTORY
/// Person           Date     Comments
/// ---------------  --------	-----------------------------------------------------------------------------
/// Rodney Thompson	2/26/06  Created
/// Rodney Thompson	4/16/06	Changed to start a full cycle after pictures hit the page.
/// Rodney Thompson	4/23/06  Changed to start transition to each image based off of 0 since we won't have 2-4 images.
/// ========================================================================================================
/// </remarks>
function StartImageBlocks()
{
	window.setTimeout('mySlideShow1.play()', 0, 'JavaScript');
   window.setTimeout('mySlideShow2.play()', 2000, 'JavaScript');
	window.setTimeout('mySlideShow3.play()', 4000, 'JavaScript');
	window.setTimeout('mySlideShow4.play()', 6000, 'JavaScript');
}
-->
<!--/SCRIPT --> 