// JavaScript Document

//images

NewImg = new Array (

"testimage/GotGameU_Splash1.jpg",

"testimage/GotGameU_Splash2.jpg",

"testimage/GotGameU_Splash3.jpg",

"testimage/GotGameU_Splash4.jpg",

"testimage/GotGameU_Splash5.jpg"

);



//product descriptions

ProdPage = new Array (

"http://u.gotgame.com/apply", 

"http://u.gotgame.com/apply",

"http://u.gotgame.com/apply", 

"http://u.gotgame.com/apply",

"http://u.gotgame.com/apply"

);



var ImgNum = 0;

var ImgLength = NewImg.length - 1;



//Time delay between Slides in milliseconds

var delay = 10000;



var lock = false;

var run;



function chgImg(direction) {

	Buttons = new Array(

		document.nav_1,

		document.nav_2,

		document.nav_3,

		document.nav_4,

		document.nav_5

	);



	if (document.images) {

		ImgNum = ImgNum + direction;

		if (ImgNum > ImgLength) {

			ImgNum = 0;

		}

		if (ImgNum < 0) {

			ImgNum = ImgLength;

		}

		document.slideshow.src = NewImg[ImgNum];

		document.getElementById("linker").href = ProdPage[ImgNum];

		document.getElementById("read").href = ProdPage[ImgNum];

		var count=1;

		var img=count+2;



		for (var i=0; i<5; i++){

			if (count==ImgNum+1)

				Buttons[i].src = "include/img/player_nav/playnav_r_0" + img + ".jpg";

 			else

				Buttons[i].src = "include/img/player_nav/playnav_0" + img + ".jpg";

			count++;

			img=count+2;

		}



   }

}



function setImg(position) {

	Buttons = new Array(

		document.nav_1,

		document.nav_2,

		document.nav_3,

		document.nav_4,

		document.nav_5

	);

	

	if (document.images) {

		ImgNum = position;

		if (ImgNum > ImgLength) {

			ImgNum = 0;

		}

		if (ImgNum < 0) {

			ImgNum = ImgLength;

		}



		document.slideshow.src = NewImg[ImgNum];

		document.getElementById("linker").href = ProdPage[ImgNum];

		document.getElementById("read").href = ProdPage[ImgNum];

		var count=1;

		var img=count+2;

		for (var i=0; i<5; i++){

			if (count==position+1)

				Buttons[i].src = "include/img/player_nav/playnav_r_0" + img + ".jpg";

 			else

				Buttons[i].src = "include/img/player_nav/playnav_0" + img + ".jpg";

			count++;

			img=count+2;

		}

   }

}



function auto() {

	if (lock == true) {

		lock = false;

		window.clearInterval(run);

	}

	else if (lock == false) {

		lock = true;

		run = setInterval("chgImg(1)", delay);

	}

	document.slideshow.src = NewImg[0];

	document.getElementById("linker").href = ProdPage[0];

	document.getElementById("read").href = ProdPage[0];





}





