<!--

//inizio Gestione contenuto della pagina----------------------------------------------------------------------

var actualImageIndex;
var fullarray
	function GetGalleryFromXML(){
	if($F('chiavegalleria')!='0')
	{
		urlGallery = 'http://www.parrocchiasannicolo.it//AllLanguages/Common/GalleryInfo.asp?foldergallery='+ $F('chiavegalleria');
		//alert(urlGallery)
		new Ajax.Request(urlGallery ,   
		{     method:'get',
		      asynchronous :true
		      ,
				onCreate: function()
				{
					//$('galleryOL').hide();
				}
				,
				onSuccess: function(transport)
				{       
					var responsexml = transport.responseText || "no response text"; 
					response = xml2json(parseXml(responsexml),'');
				
					try
					{
						jdata =response.evalJSON() ;
					}
					catch (e) 
					{
				 		alert('Errore dulante la verifica dei dati JSON');
				    }	
				    

							
				    if (jdata!='')
				    {
						//alert('1')				    
					    fullarray=jdata
					    actualImageIndex="-1"
					    SetPeriodicalExecutorImages();
						//alert('2');
						updateImage();	
						updateImage();			    					    
						$('ImgLoadingGallery').hide();
						$('ImgSlide').show();
					}
				}
				,     
				onFailure: function()
				{ 
					alert('si č verificato un problema riprova pių tardi.');
					//$('loadingprev').hide();
				}   
				,
				onComplete: function()
				{
				
				}
		}); 
		}
	}
	
	
	function UpdateSlideShow()
	{
	a=0;
	nothingToWrite=1;
	mytr='';
	mytable='';
	
	//$('ImgSlide').remove();
	
	var item = fullarray.Root.images.image[actualImageIndex]
	percorsoCompleto='/FotoGallery/' + $F('chiavegalleria') +'/small/' + item.path
	
	//alert(percorsoCompleto);
	//new Effect.Shake($('ImgSlide'))
	$('ImgSlide').src = percorsoCompleto;
	//tmpLinkPic = '<A id="ImgSlide"  HREF="#' + '><IMG src="' + percorsoCompleto + '" width="150" BORDER="1" ALT="' + item.path + '"/></A>'
	//new Insertion.Bottom('ContSlide', tmpLinkPic);						

	}

	function updateImage()
	{
		actualImageIndex++;

		if (actualImageIndex == fullarray.Root.images.image.length)
		{
			actualImageIndex=0;
		}
		//alert(actualImageIndex)
		UpdateSlideShow();
		//$('header').style.background='url("/images/header/Banners/' + arrayBanner.Banners.Banner[actualBannerIndex].url + '") right top no-repeat';		
	}


//Fine Gestione contenuto della pagina------------------------------------------------------------------------

	function SetPeriodicalExecutorImages()
	{
		new PeriodicalExecuter(updateImage, 3);
	}
	
	
	Event.observe(window, 'load',GetGalleryFromXML );	
-->
