// ==============================
// Set the following variables...
// ==============================

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 10000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

var Picture = new Array(); // don't change this
var Caption = new Array(); // don't change this
var Links = 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]  = 'images/AngealJerman.jpg';
Picture[2]  = 'images/KatherineHull01.jpg';
Picture[3]  = 'images/JeanSitting2.jpg';
Picture[4]  = 'images/bri_0212__3.jpg';
Picture[5]  = 'images/Jordan_LPGA.jpg';
Picture[6]  = 'images/JennRosalas.jpg';
Picture[7]  = 'images/DianaDAlessio.jpg';
Picture[8]  = 'images/BeckyMorgan.jpg';
Picture[9]  = 'images/HaejiKang.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]  = "Angela Jerman";
Caption[2]  = "Katherine Hull";
Caption[3]  = "Jeanne Cho-Hunicke";
Caption[4]  = "Bri Vega"
Caption[5]  = "Jordan Cherebetiu"
Caption[6]  = "Jennifer Rosalas"
Caption[7]  = "Diana D'Alessio"
Caption[8]  = "Becky Morgan"
Caption[9]  = "Haeji Kang"
// Specify the links...
// To add more links, just continue
// the pattern, adding to the array below.
// To use fewer links, remove lines
// starting at the end of teh Links array.
// Caution: The number of Links *must* 
// equal the number of Pictures!
Links[1] = "Players.php?id=3"
Links[2] = "Players.php?id=2"
Links[3] = "Players.php?id=11"
Links[4] = "Players.php?id=4"
Links[5] = "Players.php?id=13"
Links[6] = "Players.php?id=12"
Links[7] = "Players.php?id=8"
Links[8] = "Players.php?id=21"
Links[9] = ""
// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var iss;
var jss = 1;
var pss =  Picture.length-1;

var preLoad = new Array();
for (iss = 1; iss < pss+1; iss++){
preLoad[iss] = new Image();
preLoad[iss].src = Picture[iss];}


function runSlideShow(){
	if (document.all){
		document.images.PictureBox.style.filter="blendTrans(duration=2)";
		document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
		document.images.PictureBox.filters.blendTrans.Apply();
	}
	document.images.PictureBox.src = preLoad[jss].src;
	if(Links[jss] != "")
		document.links.item("playerlink").href = Links[jss];

	if (document.getElementById) document.getElementById("CaptionBox").innerHTML= Caption[jss];
	if (document.all) document.images.PictureBox.filters.blendTrans.Play();

	if(running) {
		jss = jss + 1;
		if (jss > (pss)) jss=1;
		tss = setTimeout('runSlideShow()', SlideShowSpeed);
	}
}

//Indicates if the slide show is running
var running = true;

//Stop Slide Show
function stopnews(){
	if(running) {
		clearInterval(tss);
		running = false;
		jss -= 1;
	}
}

//Start Slide Show
function playnews() {
	if(!running) {
		running = true;
		jss = jss + 1;
		if (jss > (pss)) jss=1;
		runSlideShow();
	}
}

//view the next article
function backward() {
	if(running) {
		stopnews();
	}
	jss = jss - 1;
	if (jss <= 0) jss=Picture.length-1;
	runSlideShow();
}

//view previous article
function fastForward() {
	if(running) {
		stopnews();
	}
	jss = jss + 1;
	if (jss > (pss)) jss=1;

	runSlideShow();
}

//Delay for a brief moment when a news control item is pressed 
function Delay(n) {
var interval = 25;

if(n==1){
	setTimeout('fastForward()', interval);
}else if (n==-1){
	setTimeout('backward()', interval);
}else if (n==2) {
	setTimeout('stopnews()', interval);
}else {
	setTimeout('playnews()', interval);
}

}