	var imgs = [
		{url:'cropimg.php?file=images/hotel/foto1.jpg'}, 
		{url:'cropimg.php?file=images/hotel/foto2.jpg'}, 
		{url:'cropimg.php?file=images/hotel/foto3.jpg'}, 
		{url:'cropimg.php?file=images/hotel/foto4.jpg'},
		{url:'cropimg.php?file=images/hotel/foto5.jpg'}, 
		{url:'cropimg.php?file=images/hotel/foto6.jpg'},
		];
		
		var imgs2 = [
		{url:'cropimg.php?file=images/etna/catania-4.jpg'}, 
		{url:'cropimg.php?file=images/etna/catania-etna-panorama-veduta.jpg'}, 
		{url:'cropimg.php?file=images/etna/etna.jpg'}, 
		{url:'cropimg.php?file=images/etna/etna2.jpg'},
		{url:'cropimg.php?file=images/etna/Mt_Etna.jpg'}, 
		];
		
	function tempoRandom() {
		var secondiRand = Math.floor(Math.random()*8000)+1;
		
		if (secondiRand < 3000) {
			secondiRand += 2000;
		}
		
		return secondiRand;
	}
	
	function cambiaImg1() {
		var numeroFoto1 = Math.floor(Math.random()*5)+1;
		$('#fotoFade').fadeOut(400);
				
				$("#fotoFade").attr({ 
			  src: imgs[numeroFoto1].url+'&action=fotoFade'
				});
				
			$("#fotoFade").fadeIn("slow");
			setTimeout("cambiaImg1()", tempoRandom());
	}
	
	
	function cambiaImg2() {
		var numeroFoto2 = Math.floor(Math.random()*5)+1;
		
		$('#fotoFade2').fadeOut(400);
				
			$("#fotoFade2").attr({ 
			  src: imgs[numeroFoto2].url+'&action=fotoFade2'
				});
				
			$("#fotoFade2").fadeIn("slow");
			setTimeout("cambiaImg2()", tempoRandom());
			
			
	}
	
	
	function cambiaImg3()
	
		{
			
			
			var numeroFoto3 = Math.floor(Math.random()*4)+1;
			
			$('#fotoFade3').fadeOut(400);
				
			$("#fotoFade3").attr({ 
			  src: imgs2[numeroFoto3].url+'&action=fotoFade3'
				});
				
			$("#fotoFade3").fadeIn("slow");
			
			setTimeout("cambiaImg3()", tempoRandom());
			
		}

$(document).ready(function() {

	setTimeout("cambiaImg1()", 2000);
	setTimeout("cambiaImg2()", 4000);
	setTimeout("cambiaImg3()", 6000);
	
});
