//
//  Script Name:   powerpoint.js
//  Author:        PMP
//  Date Written:  12/27/09
//  Remarks:
//      This script will automatically get generated.  It is used to navigate
//      through the slides of a powerpoint presentation on the home page.
//------------------------------------------------------------------------------

var slideSecs = 10
var transSecs = 1
var imgIndx = 1
//var imgMax = 2
var autoMan = 'A'

var imgDiv = document.getElementById('slideshow')

setTimeout('AutoSwap()', slideSecs * 1000)

function AutoSwap()
{
   if(autoMan != 'A')
	    return;
   swapfade(document.getElementById('slideshow'), isf.imgs[imgIndx], transSecs, "")
	 imgIndx++
	 if(imgIndx > imgMax)
	    imgIndx = 0
	 setTimeout('AutoSwap()', slideSecs * 1000)
}
   
function ManSwap(value)
{
   if(value == 'PS')
	 {
	    if(autoMan == 'A')
			{
			   autoMan = 'M'
				 document.getElementById('atitle').innerHTML = 'Play'
			}
			else
			{
			   autoMan = 'A'
				 document.getElementById('atitle').innerHTML = 'Stop'
				 AutoSwap()
			}
	 }
	 else if(value == 1)
	 {
	    autoMan = 'M'
		  document.getElementById('atitle').innerHTML = 'Play'
	    imgIndx++
			if(imgIndx > imgMax)
			   imgIndx = 0
			document.getElementById('slideshow').src = isf.imgs[imgIndx]
	 }
	 else if(value == -1)
	 {
	    autoMan = 'M'
		  document.getElementById('atitle').innerHTML = 'Play'
	    imgIndx--
			if(imgIndx < 0)
			   imgIndx = imgMax
			document.getElementById('slideshow').src = isf.imgs[imgIndx]
	 }
}
