

function chiudi(){
		// Get a reference to the container.
		var container = $( "#container" );	
		
	// Hide - slide up.
	container.slideUp( 2050 );
		$('#apri_chiudi').animate({
			bottom: '-=242'
		}, 2000);
		$('#apri_chiudi a').html('&uarr; '+lingua(1))
}

function apri (){

	
	
	// Get a reference to the container.
		var container = $( "#container" );	
	// Show - slide down.
	container.slideDown( 2000 );
		$('#apri_chiudi').animate({
			bottom: '+=242'
		}, 2000)
			$('#apri_chiudi a').html('&darr; '+lingua(0))
											
}
function lingua(t){
	var query = document.location.href;
	var apri ='Apri';
	var chiudi ='Chiudi';


	if(query.search (/inglese/)!='-1'){
		apri = 'Open';
		chiudi='Close';
		}
	
	if(query.search (/francese/)!='-1'){
		apri = 'Ouverte';
		chiudi='Fermer';	
		}	


	if(t==1){
		return apri;
	}else{
		return chiudi;
	} 
	 
}


function menu(){
	$('#menu').css('right', '-100%').css('position', 'relative')
	
	//metto l'animazione del logo qui
	$('#menu').animate({
		right: '+=80%'
	}, 2000, function(){
	
	})
}


$(document).ready(function() {	
//menu
  $("ul.sf-menu").superfish({ 
            animation: {height:'show'},   // slide-down effect without fade-in 
            delay:     1200               // 1.2 second delay on mouseout 
        }); 




// When the DOM is ready, initialize the scripts.
	var container = $( "#container" );	
 

 
 
			// Bind the link to toggle the slide.
			$( "#apri_chiudi a" ).click(
				function( event ){
					// Prevent the default event.
					event.preventDefault();
 
					// Toggle the slide based on its current
					// visibility.
					if (container.is( ":visible" )){
						chiudi()
 
					} else {
 						apri()
						
					}
				}
			);
 







})
	

