/* Copyright fabreva 2009 */
/* è vietata la riproduzione, la distribuzione o la vendita di questo codice */




function effettiinentrata(pagina)
{

    switch(true)
	{
		
		
	case pagina == 'index':
	
	new Effect.BlindDown('lacantinadeisaporimenu', { duration: 1,   transition: Effect.Transitions.sinoidal , 
						              delay:0 });
	
	
	
	
	
	
	
	new Effect.Parallel([
   
      
      new Effect.Move('menutrasparente', {y: 120,  mode: 'relative', transition: Effect.Transitions.sinoidal , sync:true }),
	
	new Effect.Move('lacantinadeisaporimenu', {y: 120,  mode: 'relative', transition: Effect.Transitions.sinoidal , sync:true }),
	
	new Effect.Move('menucliccabile', {y: 120,  mode: 'relative', transition: Effect.Transitions.sinoidal , sync:true })

	  
	 
	   
	  ], { duration: 1.1 ,  delay:1 });
	
	break;
  
   
   
	
	}
	

}



function fotoslider()
{
	
	
	// variabile di inizializzazione
	turno = 1;
	
	
	
	//effetto per cambiare le foto nello slider
	new PeriodicalExecuter(function(pe)
           
		   {  
		   
		   
		   switch(true)
		      {
				
				
				case (turno == 1):
				
		        new Effect.Parallel([
   
                          
                          new Effect.Appear('centralslider2', { sync: true  }) 
      
	                     

	  
	 
	   
	                      ], { duration: 1.9 , fps: 55,  transition: Effect.Transitions.sinoidal, afterFinish: function()
									
									{
										
										fotoselect();
										$('centralslider').update('<img src="'+fotocar+'" width="864" height="245" />');
										
									} 
									 
							     
								 });
			
			
		            
	
	             turno = 2;
		       
			     break;
			     
				 
				case (turno == 2):
				
		         new Effect.Parallel([
   
                          new Effect.Fade('centralslider2',  { sync: true  })
                         
      
	                   

	  
	 
	   
	                      ], { duration: 1.9 ,  fps: 55 , transition: Effect.Transitions.sinoidal, afterFinish: function()
									
									{
										
										fotoselect();
										$('centralslider2').update('<img src="'+fotocar+'" width="864" height="245" />');
										
									} 
									
									});
			
			
			
		          
					 
				 turno = 1;	 
		       
			     break; 
				
                  }
				  
			     
				 }, 15);
			   
			   

}


function fotoselect()
{
	
	     
			
			
			
			
			if(start != lunghezzaplaylist)
			{
			
			 
			
			fotocar = elencofoto[start]; 
			start = start+1;
			
			
			
			
			
			}
			else
			{
			
			start = 0;
			fotocar = elencofoto[start]; 
			start = start+1;
		
			
			}
		  
		  
		
	
}



// inizia il discorso dell'aggiornamento ajax
function ajaxgoright(component,  extra2 , extra3 , extra4)
{


 if(component == 'mailing')
  {
	insidemenu = 'mailing'; 
	new Ajax.Updater( insidemenu, 'ajax-'+insidemenu+'-0-0-0.html', { method: 'post'  , encoding: 'UTF-8' ,
					 parameters: { c12: $('c12').value, c14: $('c14').value , c16: $('c16').value ,  c17: $('c17').value
					               , c15: $('c15').value, c18: $('c18').value }} ); 
	  
  }
  
  else
  {

			  
new Ajax.Updater( component, 'ajax-'+component+'-'+extra2+'-'+extra3+'-'+extra4+'.html', { method: 'get'  , encoding: 'UTF-8' , onComplete: function(){  if(component == 'calendario'){instanziatooltip();} else{ addObservers();}
	
  // active del menu centrale	
  // tranne che dal calendario
  // tranne che staff che anche quello è strano
  
 
  
  
  
  
  
  if((component != 'calendario')&&(component != 'staff'))
  {
	insidemenu = 'aggmenu'; 
	new Ajax.Updater( insidemenu, 'ajax-'+insidemenu+'-'+extra2+'-'+extra3+'-'+extra4+'.html', { method: 'get'  , encoding: 'UTF-8'} );  
	  
  }
  
  if(component == 'foto')
  {   
  
      
	  
	  lightwindowInit();
  }
  
  
   // caso in cui sono nel sotto sotto menu (capita solo nello staff)
  if(component == 'staff')
  {
	  
	insidemenu2 = 'aggmenu2'; 
	new Ajax.Updater( insidemenu2, 'ajax-'+insidemenu2+'-1-'+extra3+'-'+extra4+'.html', { method: 'get'  , encoding: 'UTF-8'} );
	
	
   }
  
   // caso in sto selezionando dalla sopracategoria e voglio cambiare
   // il titolo in alto
  if(component == 'aggmenu2')
  {
	insidemenu3 = 'titoloelencoitemstaff'; 
	new Ajax.Updater( insidemenu3, 'ajax-'+insidemenu3+'-'+extra2+'-'+extra3+'-'+extra4+'.html', { method: 'get'  , encoding: 'UTF-8'} );
	
	if(($('staff')) != undefined)
	{$('staff').update('');}
	
	
  }
																																														  } });
  }
			
}

  	  