$(document).ready(function(){

	$("#accordion").accordion();

	
	$('.apri').click(function() {
		$('#gold1').hide();
		$('#gold2').show();
	});		

	$('.chiudi').click(function() {
		$('#gold2').hide();
		$('#gold1').show();
	});	
	
	
    $('#marquee').marquee('pointer').mouseover(function () {
    	$(this).trigger('stop');
    }).mouseout(function () {
        $(this).trigger('start');
    });
	
	
	$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
	
     var blocco=0;

	$('.sottomenu').mouseover(function(){
     
          blocco=1;
     
     });
	$('.sottomenu').mouseout(function(){
     
          blocco=0;
     
     });	
	
	$('.menu').mouseover(function(){
     
          $(this).find(".sottomenu").show();
     
     });
	$('.menu').mouseout(function(){
     
          if(!blocco)$(this).find(".sottomenu").hide();
     
     });	
	
});

function step1(val){

	f1();
	$('#dett_bollino').show();
	$('#div-risultati').empty();
	
	$('.step1 .radio').removeClass('on');
	$('.step1 #campo'+val).addClass('on');
	
	$('.step2').load("ajax_bollino.php?op=step1&id="+val);
	$('.step3').empty();
}

function step2(step1,val){

	f1();
	$('#dett_bollino').show();
	$('#div-risultati').empty();
	
	$('.step2 .radio').removeClass('on');
	$('.step2 #campo'+val).addClass('on');	
	
	$('.step3').load("ajax_bollino.php?op=step2&step1="+step1+"&id="+val);
}

function step3(step1, tipo, val){

	var valore = $("#valore").val();

	f1();
	$('#dett_bollino').hide();
	$('#div-risultati').load("ajax_bollino.php?op=step3&step1="+step1+"&tipo="+tipo+"&valore="+valore);

}

function f1(){
	$("#contenitore").fadeTo("fast", 0.1); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	$("#fileprogress-content").show();	
}
function f2(){
	$("#contenitore").fadeTo("fast", 1.0); // This sets the opacity of the thumbs to fade down to 30% when the page loads
	$("#fileprogress-content").hide();    
}
