// JavaScript Document

//===========================================================
//Script:   JavaScript Cross-Browser SlideShow Script
//          With Cross-Fade Effect between Images
//          Adjustable Timing and Unlimited Images
//Function: Displays images continuously in a slideshow
//          presentation format, with a fade effect on
//          image transitions.
//Browsers: All common browsers: NS3-6, IE 4-6
//          Fade effect only in IE; others degrade gracefully
//Author:   etLux
//===========================================================

//Step 1.
//Put the following script in the head of your page:

//<script>

// =======================================
// slide show variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000

// Duration of crossfade (seconds)
var crossFadeDuration = 7

// Specify the image files
var ssPic = new Array() // don't touch this
// to add more images, just add to the array below

var webRoot = '/'	// set this in 'runSlideShow' function 

ssPic[0]  = 'images/slideshowPics/BreakingTape.gif'
ssPic[1]  = 'images/slideshowPics/danny_arms_up.gif'
ssPic[2]  = 'images/slideshowPics/fatExecFinishingUSCAA.gif'
ssPic[3]  = 'images/slideshowPics/handoff.gif'
ssPic[4]  = 'images/slideshowPics/LMC-Handoff.gif'
ssPic[5]  = 'images/slideshowPics/logo98.gif'
ssPic[6]  = 'images/slideshowPics/logo99.gif'
ssPic[7]  = 'images/slideshowPics/nationalsLogoBtnDn.gif'
ssPic[8]  = 'images/slideshowPics/nationalsLogoBtnUp.gif'
ssPic[9]  = 'images/slideshowPics/USCAA-Cube3-star.gif'
ssPic[10] = 'images/slideshowPics/UscaaFinisher.gif'
ssPic[11] = 'images/slideshowPics/USCAA-gal.gif'
ssPic[12] = 'images/slideshowPics/USCAA-guy.gif'
ssPic[13] = 'images/slideshowPics/UscaaHandoffBaton.gif'
ssPic[14] = 'images/slideshowPics/USCAA-hurdler.gif'
ssPic[15] = 'images/slideshowPics/uscaaMap.gif'


// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var p = ssPic.length

//var preLoad = new Array()
//for (i = 0; i < p; i++){
//   preLoad[i] = new Image()
//   preLoad[i].src = ssPic[i]
//}

function runSlideShow(ssSpeed, 		// milliseconds (5000 = 5 sec)
					  ssImage, 		// ID of the slideShow image
					  rand,			// 1 = random images
					  wRoot) {		// webRoot path
	if (typeof ssSpeed == "undefined") ssSpeed = slideShowSpeed
	if (typeof ssImage == "undefined") ssIMage = "slideShow"
	if (typeof rand == "undefined") rand = 0
	if (typeof wRoot == "undefined") wRoot = '/'
	
	webRoot = wRoot
	
	ssObj = eval("document.images." + ssImage)
	if (rand) j = Math.floor(Math.random() * ssPic.length)		// random number between 0 and ssPic.length-1
   if (document.all){
      ssObj.style.filter="blendTrans(duration=2)"
      ssObj.style.filter="blendTrans(duration=crossFadeDuration)"
      ssObj.filters.blendTrans.Apply()      
   }
   //ssObj.src = preLoad[j].src
   ssObj.src = webRoot + ssPic[j]
   if (document.all){
      ssObj.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (p-1)) j=0
   t = setTimeout('runSlideShow(' + ssSpeed + ',"' + ssImage + '",' + rand + ',"' + wRoot + '")', ssSpeed)
}
//</script>

//===========================================================

//Step 2.
//Put this onload event call in your body tag:
  
//<body onload="runSlideShow()">  

//===========================================================

//Step 3.
//Put this in the body of your page where you want the 
//slide show to appear.  

//Set widths and heights same as images
//Set image file same as first image in array ssPic[] (above)

//<table border="0" cellpadding="0" cellspacing="0">
//<tr>
//<td id="VU" height=150 width=150>
//<img src="1.jpg" name='SlideShow' width=150 height=150></td>
//</tr>
//</table>

//===========================================================
