//-------------- Edit Variables Here --------------
//-----------------------VVV-----------------------

//List of images to use
imageList = new Array (
	"_style/news/04.gif",
	"_style/news/03.gif",
	"_style/news/02.gif"
);	//no comma after last image

//Corresponding URLs
linkList = new Array (
	"forum",
	"http://twitter.com/gomanga",
	"kindle/index.php"
);	//no comma after last URL

//Slide time, in milliseconds
var delay = 9000;

//-----------------------^^^-----------------------
//-------------------------------------------------










//------------- Actual Functions Here -------------
//-----------------------VVV-----------------------

var imgNum = 0;
var imgLength = imageList.length - 1;

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

function chgImg(direction) {
	if (document) {
		imgNum = imgNum + direction;
		if (imgNum > imgLength) {
			imgNum = 0;
		}
		if (imgNum < 0) {
			imgNum = imgLength;
		}
		document.getElementById('updateSlides').style.backgroundImage = "url("+imageList[imgNum]+")";
		document.getElementById('updateLink').href = linkList[imgNum];
  	 }
}

function gotoUpdate(direction) {
	chgImg(direction);
	window.clearInterval(run);
}