// Definizione dell'oggetto SlideShow che gestisce
// la sezione SlideShow

var SlideImage = {};

var SlideShow = {

	empty: true,
	myExtra: '',
	myDuration: 0,

	SetTimer: function(timer,pause)
	{
		this.timeout = timer;
		this.pause = pause;
	},
	
	StartSlideShow: function()
	{
		Sito.StopHoverTitoli();
		if (this.empty)
			{
			$('Q1').empty();
			$('Q2').empty();
			$('Q3').empty();
			$('Q1').removeEvents('mouseenter');
			$('Q1').removeEvents('mouseleave');
			$('Q2').removeEvents('mouseenter');
			$('Q2').removeEvents('mouseleave');
			$('Q3').removeEvents('mouseenter');
			$('Q3').removeEvents('mouseleave');
			$('Q1').set('styles',{'top':'21px','height':'417px','width':'836px','left':'87px'});
			$('Q2').set('styles',{'top':'21px','height':'417px','width':'272px','left':'369px'});
			$('Q3').set('styles',{'top':'21px','height':'417px','width':'272px','left':'651px'});
			$('Q1').setStyle('display', 'inline');
			$('Q2').setStyle('display', 'none');
			$('Q3').setStyle('display', 'none');
			$('Q4').setStyle('display', 'none');
			}
		
		//Sito.CambiaColore();
		Sito.StartHoverTitoli();
		$('home').removeClass('manina');
			
		/* Sistemo le funzionalità di hover dei contenitori */
		
		$('Q1').addEvents({
			mouseenter: function(){
									// Mostra selettori di immagine
									SlideShow.GalleryQ1.MostraFrecce();																
								},
			mouseleave: function(){
									// Togli selettori di immagine
									SlideShow.GalleryQ1.NascondiFrecce();								
								}
							});
		/* Qui è possibile aggiungere o togliere immagini  dalle gallerie  */
		/* Basta aggiungere all'interno degli array */
		this.GalleryQ1 = new GallerySlide('Q1',SlideImage,SlideTrans,this.timeout,this.pause,true);
		Sito.OpenGallery = this.GalleryQ1;
		this.GalleryQ1.NascondiFrecce();
		
		/* Inizializzo le funzionalità della pagina */
		// Non necessario perché c'è l'autostart a true
		//SlideShow.GalleryQ1.Mostra(0);
		
		this.empty = false;						
	},
	
	CloseSlideShow: function()
	{
	if (!this.empty)
			{
			try
				{
				this.GalleryQ1.Svuota();
				delete this.GalleryQ1;
				this.empty = true;
				Sito.OpenGallery=$empty;
				}
			catch(e)
				{
				alert(e.message);
				} 
			}
	}
};
	
