

	
 
$(function() {
    $('.box-images').each(function(index, value){
        $(value).find('a').lightBox();
    });
});

function togglebyid(id)
{
    if($("#"+id).css("display")=="none")
    {
        $("#"+id).slideDown("slow");
    }else
    {
        $("#"+id).slideUp("slow");
    }
    return false;
}
function toggleMainAndSon(id)
{
    if($("#"+id).css("display")=="none")
    {
        $("#"+id).slideDown("slow");
    }else
    {
        $("#"+id).slideUp("slow");
        slideUpbyClass('boxotherdeparts');
    }
    
    return false;
}
function togglebyclass(classname)
{
    if($("."+classname).css("display")=="none")
    {
        $("."+classname).slideDown("slow");
    }else
    {
        $("."+classname).slideUp("slow");
    }
    return false;
}
function slideUpbyid(id)
{
    $("#"+id).slideUp("slow");
    return false;
}
function slideDownbyid(id)
{
    $("#"+id).slideDown("slow");
    return false;
}
function slideUpbyClass(classname)
{
    $("."+classname).slideUp("slow");
    return false;
}
function showhide(itemid)
{
    if($("#"+itemid).css('display')=='none'){
        $("#"+itemid).slideDown("slow");
    }else
    {
        $("#"+itemid).slideUp("slow");
    }
    return false;
}
function SetSel(id)
{
    if (document.getElementById(id).className=="")
    {
        document.getElementById(id).className="sel";
    }else
    {
        document.getElementById(id).className="";
    }
    return false;
}
function ShowRelatedProduct(callerid, destinationid)
{
    var p = $('.sel');
    var l= p.length;
    var id2hide;
    if (l > 0){
        id2hide = p[0].id;
        var element2hide = document.getElementById(id2hide);
        element2hide.className="";
    }
    $(".boxotherdeparts").slideUp("slow");
    if($("#"+destinationid).css("display")=="none")
    {
        var itemtoshow = $("#"+destinationid).slideDown("slow");
        document.getElementById(callerid).className="sel";
    }else
    {
        $("#"+destinationid).slideUp("slow");
        document.getElementById(callerid).className="";
    }
    return false;
}


function HideRelatedProducts()
{
    $(".altre-date-item").slideUp("slow");
    return false;
}

$(document).ready(function() {
    $(".altri-dettagli").click(function() {
        $('.altri-dettagli-container').hide('slow');
        $(".meno-dettagli").hide();
        $(".altri-dettagli").show();
        $(this).hide();
        $(this).next().show().next().show('slow');
    });
    $(".meno-dettagli").click(function() {
        $(".meno-dettagli").hide();
        $(".altri-dettagli").show();
        $(".altri-dettagli-container").hide('slow');
    });
    $('.altre-date2').click(function() {
        $('.boxotherdeparts').slideUp('slow');
        $('.altre-date-container').slideUp('slow');
        $('.more-arrow-u').removeClass('more-arrow-u');
        if ($(this).parent().next('.altre-date-container').css('display') == 'none') {
            $(this).parent().next('.altre-date-container').slideDown('slow');
            $(this).addClass('more-arrow-u');
        }
        $('a.sel').removeClass('sel');
        return false;
    });
});

$('.MainImage').live('click',function(){
    $(this).parent().find('a').eq(0).click();
});

