var path="http://users.pandora.be/diggiloo/pic/";
var picMin,picMax,size,current,imgs;

function initArtistPics(from,to,restPath){
	var y=restPath.substring(0,4);
	if(y<1980||y>2009)path="pandora/";
	picMin=from;picMax=to;
	current=picMin;
	imgs=preloadImg(picMin,picMax,restPath);
	setTimeout("toggleName(current,current)",0);// seems a long way to convince ie to show the initial name, but apparently it's necessary...
}
function prev(){
	toggleName(current,(--current<picMin?(current=picMax):current));
	setImg('artist',eval('imgs[current].src'));
	return false;
}
function next(){
	toggleName(current,(++current>picMax?(current=picMin):current));
	setImg('artist',eval('imgs[current].src'));
	return false;
}
function toggleName(hide,show){
	/*document.getElementById('name'+hide).style.visibility='hidden';
	document.getElementById('name'+show).style.visibility='visible';*/
	document.getElementById('name'+hide).style.display='none';
	document.getElementById('name'+show).style.display='block';
}
function setImg(name,pic){document.images[name].src=pic;}
function preloadImg(from,to,restPath){
	var images=new Array();
	for(i=from;i<=to;i++){
		images[i]=new Image(1,1);//272,209);
		images[i].src=(path+restPath+(i==0?'':i)+".jpg");
	}
/*	if(groupNum==0){ current=1; toggleName(num,1);}
	else{
		images[num]=new Image(1,1);
		images[num].src=(path+restPath+".jpg");
	}*/
	return(images);
}

