var smallimages=new Array("book1small", "book2small", "book3small", "book4small", "book5small");
var imageURL=new Array();
var imageALT=new Array();
var imageLINK=new Array();

imageURL[0]="images/bokBirgitta_h245.jpg";
imageALT[0]="Birgitta - Helgon och kändis";
imageLINK[0]="minabocker.jsp#Birgitta";

imageURL[1]="images/bokLinneBlomsterkungen_h245.jpg";
imageALT[1]="Carl von Linné - Blomsterkungen";
imageLINK[1]="minabocker.jsp#LinneBlomsterkungen";

imageURL[2]="images/bokLinneTe_h245.jpg";
imageALT[2]="Linnés dröm om svenskt te blev aldrig verklighet";
imageLINK[2]="minabocker.jsp#LinneTe";

imageURL[3]="images/bokSminket_h245.jpg";
imageALT[3]="Sminket i historien";
imageLINK[3]="minabocker.jsp#Sminket";

imageURL[4]="images/bokVikingarnasMat_h245.jpg";
imageALT[4]="Vikingarnas Mat";
imageLINK[4]="minabocker.jsp#VikingarnasMat";

var s=0;
var c=smallimages.length-1;
function startBookLoop()
{
	t=setTimeout('switchPicture()',5000);
}
function switchPicture()
{
	s++;
	c++;
	if (s==smallimages.length) s=0;
	if (c==smallimages.length) c=0;
	document.getElementById(smallimages[s]).style.border="3px solid black";
	document.getElementById(smallimages[c]).style.border="1px solid black";

	document.getElementById("focusedbook").src=imageURL[s];
	document.getElementById("focusedbook").alt=imageALT[s];
	document.getElementById("focusedbooklink").href=imageLINK[s];
	document.getElementById("focusedbookname").innerHTML=imageALT[s];
	t=setTimeout('switchPicture()',5000);
}

function stopBookLoop()
{
	clearTimeout(t);
}