$(document).ready(function() {
    function switchInfo(clicked, other) {
            
        other.stop().animate({'right': '-290px'},500);
        other.removeClass('aperto');
                
        if ( !clicked.hasClass('aperto')) {
            clicked.stop().animate({'right': '0px'},500);
            clicked.addClass('aperto');
        } else {
            clicked.stop().animate({'right': '-290px'},500);
            clicked.removeClass('aperto');
        }
    }
    
    $('#contentFooter a.openInfo').click(function () {
        switchInfo($('#contentCompanyInfo'), $('#contentCredits'));
        return false;     
    });            
    
    $('#contentFooter a.openCredits').click(function () {
        switchInfo($('#contentCredits'), $('#contentCompanyInfo'));
        return false;  
    }); 
    
    $('.closeInfo').click(function() {
        var infoVisibile = $(this).parent();
        infoVisibile.stop().animate({'right': '-290px'},500);
        infoVisibile.removeClass('aperto');
        return false;
    });    
});

