	function callback(data){
		$("#sotto_menu").html(data);
	}
	
	function cambia_menu(link){
		$.get('include/menu.php',{attivo:link},callback)
	}

	function trim(str){
		return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');;
	}

	var t;
	
	$(document).ready(function(){
		/*
		var sm = $("#sotto_menu").html();

		$('#menu_superiore li a').mouseenter(function(){
			t = setTimeout('cambia_menu("'+trim($(this).html())+'")', 250);
		}).mouseleave(function(){
			clearInterval(t);
		});

		$('#container_menu').mouseleave(function(){
			$("#sotto_menu").html(sm);
		});
		*/
		
		$("#title").prepend('<h1 class="shadow">'+$("#title h1").text()+'</h1>');
		
		$("#box_dati .scheda").hide();
		$("#box_dati .scheda:first").show().css('opacity','1').css('filter','');/*ennesimo fix per exploder che renderizza il testo con la trasparenza in modo osceno...non togliere*/
		$("#menu_box_dati li:first a").attr('rel','visible').addClass('active');
		
		$("#menu_box_dati li a").click(function(event){
			
			event.preventDefault();
			if($(this).attr('rel') == 'visible') return false;
			
			$(this).addClass('active');
			
			var hide_id = $("#menu_box_dati li a[rel=visible]").attr('href');
			$("#menu_box_dati li a[rel=visible]").attr('rel','').removeClass('active');
			
			var show_id = $(this).attr("href");
			
			$(this).attr('rel','visible');
			
			$('div#foto_etilometro img').attr('src','img/foto/'+$(this).attr('name')+'.jpg');
			$('a.manuale').hide();
			$('a.'+$(this).attr('name')).show();
		
			$(hide_id).fadeOut(200,function(){
				//callback
				$(this).css('opacity',0).hide();
				
				$(show_id).css('opacity',1).fadeIn(200,function(){$(this).css('filter','')/*ennessimo fix per exploder che rendeizza il testo con la trasparenza in modo osceno...non togliere*/});
;			
			});
		});
		
		$("#cycle").cycle();
	});

