	

    

	
	
	
	
	$(document).ready(function()
{
				var asidebar = $("#sidebar");
				var aheader = $("#header");
				var amenu = $(".moveMenu");
				var change = 0;

														 	// menu and logo animation
														  $(window).scroll(function(){
														   	    
														   	     if($(this).scrollTop() > 10) {
														   	     	
														   	     	             if(change == 0){
														   	     								////////////////////////
														   	     								   		
														   	     								   		asidebar.stop().animate({
														   	     								   			top:'119px'
														   	     								   			}, 100, function (){
														   	     								   				
														   	     								   		//some backend
														   	     								   	}
														   	     								   	);
														   	     								   		//////////////////////////
														   	     								   		
														   	     								   		////////////////////////
														   	     								   	
														   	     								   		aheader.stop().animate({
														   	     								   			marginTop:'30px'
														   	     								   			}, 100, function (){
														   	     								   		// end
														   	     								   	}
														   	     								   	);
														   	     								   		//////////////////////////
														   	     								   		
														   	     								 
														   	     								   amenu .stop().animate({
														   	     								   	top:'0'
														   	     								   	}, 300, function (){
														   	     								   		
														   	     											//some backend
														   	     								   	}
														   	     								   	);
														   	         
														   	          change = 1;
														   	        } //chiudo if (change == 0)
														   	  }else{
														   	     	
														   	     	      if(change == 1){  
														   	     	
														   	     						////////////perchè questo arriva in ritardo?//////////////
														   	      				   amenu.stop().animate({
														   	      				   	top:'90'
														   	      				   	}, 300, function (){
																							
															        								//some backend
														   	      				   	}
														   	      				   	);
														   	      				   //////////////////////////
		
														   	     							////////////////////////
														   	      				   		
														   	      				   		asidebar.stop().animate({
														   	      				   			top:'89px'
														   	      				   			}, 100, function (){
														   	      				   				
														   	      				   			//some backend
														   	      				   	}
														   	      				   	);
														   	      				   		//////////////////////////	
														   	      				   		
														   	      				   		
														   	      				   		/////////////////////////
														   	      				   		aheader.stop().animate({
														   	      				   			marginTop:'0px'
														   	      				   			}, 100, function (){
														   	      				   		
														   	      				   		//some backend
														   	      				   	}
															        				
														   	      				   	);
														   	      				   		
														   	      				   		
														   	      				   		
														   	      				   		//////////////////////////
														   	     	
														   	     	 change = 0;
														   	     	}
														 	
														   	     }
														   	 });
													    
													    	// enlarge and re-small the map
													      $("#enLargeMap").click(function(){
      	
      																	$("#map").animate({
      																	
      																												width:'600px',
      																												height:'400px'
            																									}, 500, function(){
            																										
            																										$("#enSmallMap").css({'display' : 'block'});
            																										$("#enLargeMap").css({'display' : 'none'});
            																										$("#enSmallMap").click(function(){
            																																												$("#map").animate({
																												      																													width:'260px',
																												      																													height:'306px'
																												            																									}, 500, function(){
																												            																																			$("#enSmallMap").css({'display' : 'none'});
																												            																																			$("#enLargeMap").css({'display' : 'block'});
																												            																																		}
																												            																										
																												            																										);
            																																										});   																	
      																	
      																										});
      
    																		});
    
    
    
    
    
    
    																// link esterni
																		$('a[rel=external]').attr('class', 'external');
																		$('a[rel=external]').attr('target', '_blank');
	
	             										
	             										
	             										
	             											// footer animation 
	             										 	$("#footer").hover( function() { $(this).stop().animate( { height: "200px"}, 500)},function() { $(this).stop().animate(  {  height: "35px"  }, 500);});
    
    
    
  

    
    }); //*//**//*/*/*/*/*/*/*/*/ chiusura (document).ready
    
    
    
    
    
    				
    			
						
						
				
						
						  

