var N_IMG	= 11;

var nImg	= 0
var aRoll	= new Array(N_IMG);
						
for (i = 0; i < N_IMG + 1; i++)
{
	aRoll[i] = new Image();
}
aRoll[0].src = "DirFoto/P1.gif";
aRoll[1].src = "DirFoto/P2.gif";
aRoll[2].src = "DirFoto/P3.gif";
aRoll[3].src = "DirFoto/P4.gif";
aRoll[4].src = "DirFoto/P5.gif";
aRoll[5].src = "DirFoto/P6.gif";
aRoll[6].src = "DirFoto/P7.gif";
aRoll[7].src = "DirFoto/P8.gif";
aRoll[8].src = "DirFoto/P9.gif";
aRoll[9].src = "DirFoto/P10.gif";
aRoll[10].src = "DirFoto/P11.gif";

function StartRollover()
{
	timeout = self.setInterval("Rollover()",2000);
}

function Rollover()
	{
		// Carico l'immagine
		imgRoll.src = aRoll[nImg].src;
		// Incremento il contatore
		nImg++;
		// Se è l'ultima riparto da 0
		if (nImg == N_IMG) {nImg = 0}
	}

	function ShowFoto()
		{
			var oWin;
			var pathFoto = new String();
			var oImg = new Image();
			var opzioni;
			var i;
			
			
			pathFoto = imgRoll.src;
			//pathFoto = pathFoto.substr(0,pathFoto.length - 5);
			//pathFoto = pathFoto + ".JPG";
			pathFoto = pathFoto.replace("gif","JPG");
			pathFoto = pathFoto.replace("P","G");
			
			oImg.src = pathFoto;
			// alert(typeof(oImg));
			
			// opzioni = "width=" + oImg.width + ",height=" + oImg.height;
			opzioni = "location=0,resizable=yes"
			oWin = window.open(pathFoto,"Foto",opzioni);
			// oWin.document.title = "L\''azienda da vicino.";
			
			oImg = undefined;
			return false;
		}
	
	function ShowImg(pathImg)
		{
			var oWin;
			var opzioni;
			
			opzioni = "location=0,resizable=yes"
			oWin = window.open(pathImg,"Immagine",opzioni);
			
			oImg = undefined;
			return false;
		}
	
	function ShowImg(pathImg, opzioni)
		{
			var oWin;
			oWin = window.open(pathImg,"Immagine",opzioni);
			
			oImg = undefined;
			return false;
		}
		
	function ShowNews(cod)
		{
			window.open("DirNews/VisualizzaNews.asp?Id=" + cod,null,"toolbar=0,scrollbar=0,width=400,height=300,resizable=1");
		}