
$(function () {
    $('#jplayer').on($.jPlayer.event.ended, function (event) {
        $('.pic *').fadeIn();

        $('#jplayer_sound').jPlayer({
            ready: function () {
                $(this).jPlayer('setMedia', {mp3: './media/859-1.mp3'});
            },
            play: function () {
                $(this).jPlayer('pauseOthers');
                $('.pic').animate({opacity: 0.7});
                $(this).parent().parent().animate({opacity: 1});
            },
            swfPath: '../../styles/flash',
            supplied: 'mp3',
            cssSelectorAncestor: '#jp_container_sound'
        });

        $('#jplayer_sound2').jPlayer({
            ready: function () {
                $(this).jPlayer('setMedia', {mp3: './media/859-2.mp3'});
            },
            play: function () {
                $(this).jPlayer('pauseOthers');
                $('.pic').animate({opacity: 0.7});
                $(this).parent().parent().animate({opacity: 1});
            },
            swfPath: '../../styles/flash',
            supplied: 'mp3',
            cssSelectorAncestor: '#jp_container_sound2'
        });
    });
});
