var photos=new Array();
var photoslink=new Array();
var photosdesc=new Array();
var which=-1;

//Specify whether images should be linked or not (1=linked)
var linkornot=1;

//define images. You can have as many as you want. Images MUST be of the same dimensions (for NS's sake)
photos[0]="../images/foto1.jpg";
photos[1]="../images/foto2.jpg";
photos[2]="../images/foto3.jpg";
photos[3]="../images/foto4.jpg";
photos[4]="../images/foto5.jpg";
photos[5]="../images/foto6.jpg";
photos[6]="../images/foto7.jpg";
photos[7]="../images/foto8.jpg";

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photoslink[0]="foto1_max@600@400";
photoslink[1]="foto2_max@400@600";
photoslink[2]="foto3_max@400@600";
photoslink[3]="foto4_max@600@400";
photoslink[4]="foto5_max@400@600";
photoslink[5]="foto6_max@400@600";
photoslink[6]="foto7_max@400@600";
photoslink[7]="foto8_max@400@600";

//Set corresponding URLs for above images. Define ONLY if variable linkornot equals "1"
photosdesc[0]=""
photosdesc[1]=""
photosdesc[2]=""
photosdesc[3]=""
photosdesc[4]=""
photosdesc[5]=""
photosdesc[6]=""
photosdesc[7]=""

//do NOT edit pass this line
var preloadedimages=new Array();
for (i=0;i<photos.length;i++)
{
	preloadedimages[i]=new Image();
	preloadedimages[i].src=photos[i];
}

function applyeffect()
{
	if (document.all)
	{
		photoslider.filters.revealTrans.Transition=Math.floor(Math.random()*23)
		photoslider.filters.revealTrans.stop()
		photoslider.filters.revealTrans.apply()
	}
}

function playeffect()
{
	if (document.all)	photoslider.filters.revealTrans.play();
}

function keeptrack()
{
	document.all.testo.innerHTML=photosdesc[which];
	window.status=photosdesc[which]+" ("+(which+1)+"/"+photos.length+")";
}

function backward()
{
	if (which>0)	which--;
	else			which=photos.length-1;
	//applyeffect();
	document.images.photoslider.src=photos[which];
	//playeffect();
	keeptrack();
}

function forward()
{
	if (which<photos.length-1)	which++;
	else						which=0;
	//applyeffect();
	document.images.photoslider.src=photos[which];
	//playeffect();
	keeptrack();
}

function transport()
{
	var w=window.open("../popup_foto.asp?n="+photoslink[which],"foto","resizable=no,width=410,height=335,scrollbars=no,border=no");
	w.focus();
	//window.location=photoslink[which];
}