﻿var img=0;

function setImageNumber(imgn){
	img=imgn;
}

function imageSwitch(f, max){
	
	if(f=="s"){

		if(img==1){

			img=max;
			document.getElementById('hri').src="Immagini/home/"+max+".png";
		}else{

			img--;
			document.getElementById('hri').src="Immagini/home/"+img+".png";
		}
			
	}else if(f=="d"){

		if(img==max){

			img=1;
			document.getElementById('hri').src="Immagini/home/"+"1.png";
		}else{

			img++;
			document.getElementById('hri').src="Immagini/home/"+img+".png";
		}

	
	}
	
}


è(window, 'load', function(){
	setImageNumber(Math.floor(Math.random()*10));
	
	setInterval("imageSwitch('d', 9)", 3900)
});