var Rollpic1 = "img/fotos/imagen1.jpg";
var Rollpic2 = "img/fotos/imagen2.jpg";
var Rollpic3 = "img/fotos/imagen3.jpg";
var Rollpic4 = "img/fotos/imagen4.jpg";
var Rollpic5 = "img/fotos/imagen5.jpg";
var Rollpic6 = "img/fotos/imagen6.jpg";
var Rollpic7 = "img/fotos/imagen7.jpg";
var Rollpic8 = "img/fotos/imagen8.jpg";
var Rollpic9 = "img/fotos/imagen9.jpg";
var Rollpic10 = "img/fotos/imagen10.jpg";


//Start at the what pic:
var PicNumber=1;
//Number of pics:
var NumberOfPictures=10;
//Time between pics switching in secs
var HowLongBetweenPic=12;

//SwitchPic Function
function SwitchPic(counter){


	if(counter < HowLongBetweenPic)
	{		
		counter++;
		
		document.roll.src = eval("Rollpic" + PicNumber);

		CallSwitchPic=window.setTimeout("SwitchPic("+counter+")",800); 
	
	}
	else
	{
		if(PicNumber < NumberOfPictures)
		{
			PicNumber++;
			SwitchPic(0);
		}
		else
		{
				PicNumber=1;
				SwitchPic(0);
		}
	
	}
}

function CambiaFoto(img,numero)
{
	PicNumber=numero;
	img.src=eval("Rollpic" + PicNumber);
}

