// JavaScript Document
var theImages = new Array()

//definizione dei nomi immagine da caricare
theImages[0] = 'img/immagineA.jpg' 
theImages[1] = 'img/immagineB.jpg' 
theImages[2] = 'img/immagineC.jpg' 
theImages[3] = 'img/immagineD.jpg' 

var j = 0
var p = theImages.length;
var preBuffer = new Array()

for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));

function showImage(root){
	if(whichImage==0){
		document.write('<img src="'+root+theImages[whichImage]+'" alt="una persona che idalemente partecipa corredata dallo slogan io partecipo" width="178" height="175">');
	}
	else if(whichImage==1){
		document.write('<img src="'+root+theImages[whichImage]+'" alt="una persona che idalemente partecipa corredata dallo slogan io partecipo" width="178" height="175">');
	}
	else if(whichImage==2){
		document.write('<img src="'+root+theImages[whichImage]+'" alt="una persona che idalemente partecipa corredata dallo slogan io partecipo" width="178" height="175">');
	}
	else if(whichImage==3){
		document.write('<img src="'+root+theImages[whichImage]+'" alt="una persona che idalemente partecipa corredata dallo slogan io partecipo" width="178" height="175">');
	}
	else if(whichImage==4){
		document.write('<img src="'+root+theImages[whichImage]+'" alt="una persona che idalemente partecipa corredata dallo slogan io partecipo" width="178" height="175">');
	}

}

