

$(document).ready(function() {
    
    $('.news_show1').hide('slow');
   
    $('.leggi1').click(function() {

            $('.news_show1').show('slow');
            $('.leggi1').css({"display":"none"});
            $('.chiudi1').css({"display":"inline"});


    });
    $('.chiudi1').click(function() {

            $('.news_show1').hide('slow');
            $('.chiudi1').css({"display":"none"});
             $('.leggi1').css({"display":"inline"});

    });
    
        $('.news_show2').hide('slow');
   
    $('.leggi2').click(function() {

            $('.news_show2').show('slow');
            $('.leggi2').css({"display":"none"});
            $('.chiudi2').css({"display":"inline"});


    });
    $('.chiudi2').click(function() {

            $('.news_show2').hide('slow');
            $('.chiudi2').css({"display":"none"});
             $('.leggi2').css({"display":"inline"});

    });
    
        $('.news_show3').hide('slow');
   
    $('.leggi3').click(function() {

            $('.news_show3').show('slow');
            $('.leggi3').css({"display":"none"});
            $('.chiudi3').css({"display":"inline"});


    });
    $('.chiudi3').click(function() {

            $('.news_show3').hide('slow');
            $('.chiudi3').css({"display":"none"});
             $('.leggi3').css({"display":"inline"});

    });
    
        $('.news_show4').hide('slow');
   
    $('.leggi4').click(function() {

            $('.news_show4').show('slow');
            $('.leggi4').css({"display":"none"});
            $('.chiudi4').css({"display":"inline"});


    });
    $('.chiudi5').click(function() {

            $('.news_show5').hide('slow');
            $('.chiudi5').css({"display":"none"});
             $('.leggi5').css({"display":"inline"});

    });
    
        $('.news_show6').hide('slow');
   
    $('.leggi6').click(function() {

            $('.news_show6').show('slow');
            $('.leggi6').css({"display":"none"});
            $('.chiudi6').css({"display":"inline"});


    });
    $('.chiudi7').click(function() {

            $('.news_show7').hide('slow');
            $('.chiudi7').css({"display":"none"});
             $('.leggi7').css({"display":"inline"});

    });
    
        $('.news_show8').hide('slow');
   
    $('.leggi8').click(function() {

            $('.news_show8').show('slow');
            $('.leggi8').css({"display":"none"});
            $('.chiudi8').css({"display":"inline"});


    });
    $('.chiudi8').click(function() {

            $('.news_show8').hide('slow');
            $('.chiudi8').css({"display":"none"});
             $('.leggi8').css({"display":"inline"});

    });



    

 $("a.group").fancybox({ 'zoomSpeedIn': 300, 'zoomSpeedOut': 300 }); 
    
$('#line_toogle').click(function() {
	$('#short_container').toggle();
	
   });


 $("#line_toogle").toggle(function(){
                $('#short_container').load("info_box.php");
		$("#line_toogle").css({"background-position":"left bottom"});

		}, function () {
                $('#short_container').hide();
		$("#line_toogle").css({"background-position":"left top"});


	});








//////////SLIDE SHOW FORMA





/*
$('#main').hover(function() {

    $('div.slide_menu ul li.active a'). animate({width: "0px"}, {duration: 600, easing:"easeOutsine"});
    },
    function() {
	$('div.slide_menu ul li.active a'). animate({width: "100px"}, {duration: 600, easing:"easeOutsine"});
    });
*/


 $('div.slide_menu ul.forma li.active a').css({
	'min-width': '520px'
    });

    $('#main').hover(function() {

	$('div.slide_menu ul.forma li.active a').css({
	    'min-width': '0px'
	});
	//$('div.slide_menu ul li.active a'). animate({width: "100px"}, {duration: 600, easing:"easeOutQuad"});
    },
    function() {

	$('div.slide_menu ul.forma li.active a').css({
	    'min-width': '520px'
	});
    });



    $('div.slide_menu ul.forma li a').hover(function() {
	if ($(this).is(':animated')) {
	    $(this).stop().animate({
		width: "520px"
	    },
	    {
		duration: 600,
		easing: "easeOutQuad"
	    });
	} else {
	    $(this).stop().animate({
		width: "520px"
	    },
	    {
		duration: 600,
		easing: "easeOutQuad"
	    });
	}
    },
    function() {
	if ($(this).is(':animated')) {
	    $(this).stop().animate({
		width: "150px"
	    },
	    {
		duration: 600,
		easing: "easeInSine"
	    })
	} else {
	    $(this).stop('animated:').animate({
		width: "150px"
	    },
	    {
		duration: 600,
		easing: "easeInSine"
	    });
	}
    });

    //////////SLIDE SHOW COLORE

//animate search vertical accordion
    $('div.slide_menu ul.colore li.active a').css({
	'min-width': '300px'
    });

    $('#main').hover(function() {

	$('div.slide_menu ul.colore li.active a').css({
	    'min-width': '0px'
	});
	//$('div.slide_menu ul li.active a'). animate({width: "100px"}, {duration: 600, easing:"easeOutQuad"});
    },
    function() {

	$('div.slide_menu ul.colore li.active a').css({
	    'min-width': '300px'
	});
    });



    $('div.slide_menu ul.colore li a').hover(function() {
	if ($(this).is(':animated')) {
	    $(this).stop().animate({
		width: "300px"
	    },
	    {
		duration: 600,
		easing: "easeOutQuad"
	    });
	} else {
	    $(this).stop().animate({
		width: "300px"
	    },
	    {
		duration: 600,
		easing: "easeOutQuad"
	    });
	}
    },
    function() {
	if ($(this).is(':animated')) {
	    $(this).stop().animate({
		width: "50px"
	    },
	    {
		duration: 600,
		easing: "easeInSine"
	    })
	} else {
	    $(this).stop('animated:').animate({
		width: "50px"
	    },
	    {
		duration: 600,
		easing: "easeInSine"
	    });
	}
    });


  //////////SLIDE SHOW UTILIZZO


//animate search vertical accordion
    $('div.slide_menu ul.utilizzo li.active a').css({
	'min-width': '570px'
    });

    $('#main').hover(function() {

	$('div.slide_menu ul.utilizzo li.active a').css({
	    'min-width': '0px'
	});
	//$('div.slide_menu ul li.active a'). animate({width: "100px"}, {duration: 600, easing:"easeOutQuad"});
    },
    function() {

	$('div.slide_menu ul.utilizzo li.active a').css({
	    'min-width': '570px'
	});
    });



    $('div.slide_menu ul.utilizzo li a').hover(function() {
	if ($(this).is(':animated')) {
	    $(this).stop().animate({
		width: "650px"
	    },
	    {
		duration: 600,
		easing: "easeOutQuad"
	    });
	} else {
	    $(this).stop().animate({
		width: "570px"
	    },
	    {
		duration: 600,
		easing: "easeOutQuad"
	    });
	}
    },
    function() {
	if ($(this).is(':animated')) {
	    $(this).stop().animate({
		width: "200px"
	    },
	    {
		duration: 600,
		easing: "easeInSine"
	    })
	} else {
	    $(this).stop('animated:').animate({
		width: "200px"
	    },
	    {
		duration: 600,
		easing: "easeInSine"
	    });
	}
    });

    //opacity

    $(".item_list img").animate( {opacity: "0.5"}, 10 );


    $(".item_list img").hover(

                function() {

                       $( this ).animate( {opacity: "1"}, 10 );

               },

               function() {

                       $( this ).animate( {opacity: "0.5"}, 10 );

               });


$('#list').pager('div');
$('#list1').pager('div');
$('#list2').pager('div');
$('#list3').pager('div');
$('#list4').pager('div');
$('#list5').pager('div');
$('#list6').pager('div');
$('#list7').pager('div');
$('#list8').pager('div');
$('#list9').pager('div');
$('#list10').pager('div');

}); ///document ready


//accordion
$(function() {
    $("#accordion").accordion();
});





$(function() {
    $("#nav_category").lavaLamp({
                fx: "backout",
                speed: 700,
                click: function(event, menuItem) {

                }
    });
});





    ///ajax load item dettaglio
    $(function() {
	
	$("#main_products .show_item").click(function(){
	$('#main_products .show_item').removeClass("active");
	id=$(this).attr("id");
	//$('#'+id+'.img').animate( {opacity: "1"}, 10 );

	$('#'+id).addClass("active");
	//$(this).next('div').append(id);
	$('#show_attributes').load("catalogs.php?s=0&item_id="+id);
	$('#show_dati_tecnici').load("catalogs.php?s=2&item_id="+id);
        $('#show_colori').load("catalogs.php?s=1&item_id="+id);
        
	});

    });

 $(document).ready(function() {
 $("div#mappa img").animate( {opacity: "1"}, 1,function() {
 $("div#mappa a img").hover(
 function() {
 $( this ).animate( {opacity: "0"}, 1 );},function() {
 $( this ).animate( {opacity: "1"}, 1 );
 });
 });
 });


