/*					
	Funzionamento dello slideshow / non toccate queste righe se non conoscete javascript				
*/					
// Additional methods for Element added by SU, Couloir					
Object.extend(Element, {					
	getWidth: function(element) {				
   	element = $(element);				
   	return element.offsetWidth; 				
	},				
	setWidth: function(element,w) {				
   	element = $(element);				
    	element.style.width = w +"px";				
	},				
	setHeight: function(element,h) {				
   	element = $(element);				
    	element.style.height = h +"px";				
	},				
	setSrc: function(element,src) {				
    	element = $(element);				
    	element.src = src; 				
	},				
	setHref: function(element,href) {				
    	element = $(element);				
    	element.href = href; 				
	},				
	setInnerHTML: function(element,content) {				
		element = $(element);			
		element.innerHTML = content;			
	}				
});					
// Rules					
var myrules = {									
	'#slideshow' : function(element){				
		element.onload = function(){			
			new Effect.Appear(this,{duration: 1});		
			setTimeout(nextPhoto,ssSpeed*100);		
		}			
	}				
};					
var idPhoto = -1;					
var arrayPhoto = new Array();					
//=============================================					
/*					
	Parametri slideshow / da modificare				
*/					
					
// pausa tra una foto e l'altra, in secondi					
var ssSpeed = 32;					
// percorsi delle foto, relativi al file slideshow_js.html					
arrayPhoto[0] = 'pics/Accenture.jpg';
arrayPhoto[1] = 'pics/cabot.jpg';
arrayPhoto[2] = 'pics/Cameo.jpg';
arrayPhoto[3] = 'pics/casappa.jpg';
arrayPhoto[4] = 'pics/CIRA.jpg';
arrayPhoto[5] = 'pics/Continental.jpg';
arrayPhoto[6] = 'pics/diasorin.jpg';
arrayPhoto[7] = 'pics/distam.jpg';
arrayPhoto[8] = 'pics/donalson.jpg';
arrayPhoto[9] = 'pics/Ema.jpg';
arrayPhoto[10] = 'pics/FCI.jpg';
arrayPhoto[11] = 'pics/Fiberweb.jpg';
arrayPhoto[12] = 'pics/Fimi.jpg';
arrayPhoto[13] = 'pics/Fresenius.jpg';
arrayPhoto[14] = 'pics/GD.jpg';
arrayPhoto[15] = 'pics/Gsk.jpg';
arrayPhoto[16] = 'pics/home-depot.jpg';
arrayPhoto[17] = 'pics/Indena.jpg';
arrayPhoto[18] = 'pics/ITT.jpg';
arrayPhoto[19] = 'pics/Kone.jpg';
arrayPhoto[20] = 'pics/nw.jpg';
arrayPhoto[21] = 'pics/Osram.jpg';
arrayPhoto[22] = 'pics/Precicast.jpg';
arrayPhoto[23] = 'pics/rb.jpg';
arrayPhoto[24] = 'pics/SABIC.jpg';
arrayPhoto[25] = 'pics/Sacmi.jpg';
arrayPhoto[26] = 'pics/saes.jpg';
arrayPhoto[27] = 'pics/SolvayPharma.jpg';
arrayPhoto[28] = 'pics/Tioxide.jpg';
arrayPhoto[29] = 'pics/Agilent.jpg';
arrayPhoto[30] = 'pics/VDO.jpg';
arrayPhoto[31] = 'pics/Zeiss.jpg';

//=============================================					
/*					
	Funzionamento dello slideshow / non toccate queste righe se non conoscete javascript				
*/					
function nextPhoto (){					
	var ss = $('slideshow');				
	new Effect.Fade(ss,{duration: 1});				
	setTimeout(loadPhoto,1000);				
					
}					
function loadPhoto (){					
	var ss = $('slideshow');				
	if (idPhoto < arrayPhoto.length-1){				
		idPhoto = idPhoto+1;			
		Element.setSrc(ss,arrayPhoto[idPhoto]);			
	} else {				
		idPhoto = 0;			
		Element.setSrc(ss,arrayPhoto[idPhoto]);			
	}				
}					
setTimeout(nextPhoto,0);					

