function insertAudio(count, filePath) {
    var playerId = "#jquery_jplayer_" + count;
    $(playerId).jPlayer({
        ready: function (event) {
            $(this).jPlayer("setMedia", {
                mp3: "../../assets/audio/" + filePath
            });
        },
        play: function () { // To avoid multiple jPlayers playing together.
            $(this).jPlayer("pauseOthers");
        },
        volume: 1,
        swfPath: "./",
        supplied: "mp3",
        wmode: "window",
        useStateClassSkin: true,
        autoBlur: false,
        smoothPlayBar: true,
        keyEnabled: true,
        remainingDuration: true,
        toggleDuration: true,
        cssSelectorAncestor: "#jp_container_" + count
    })
};

function insertTracks(count, filePath) {
    var playerId = "#jquery_jplayer_" + count;
    $(playerId).jPlayer({
        ready: function (event) {
            $(this).jPlayer("setMedia", {
                mp3: "../../assets/tracks/" + filePath
            });
        },
        play: function () { // To avoid multiple jPlayers playing together.
            $(this).jPlayer("pauseOthers");
        },
        volume: 1,
        swfPath: "./",
        supplied: "mp3",
        wmode: "window",
        useStateClassSkin: true,
        autoBlur: false,
        smoothPlayBar: true,
        keyEnabled: true,
        remainingDuration: true,
        toggleDuration: true,
        cssSelectorAncestor: "#jp_container_" + count
    })
};

$(document).ready(function () {
    $('.jp-progress,.jp-time-holder').each(function(){
        var parentWidth = $(this).closest(".js-ibp-player").width()/2;
        $(this).width(parentWidth);
    });
});