+ // player for audiobooks
+
+ // event handlers for playing different formats
+ $('.audiotabs span').click(function(){
+ $('.audiobook-list').hide();
+ $('.audiotabs .active').removeClass('active');
+ // we don't want to interact with "audiobook" label, just 'format' tabs
+ var $this = $(this);
+ $this.addClass("active");
+ $("#"+$this.attr('data-format')+"-files").show();
+ });
+
+ $('.audiobook-list').hide();
+ if($(".audiotabs .active").length > 0) {
+ $("#"+$(".audiotabs .active").html().toLowerCase()+"-files").show();
+ }
+
+ /* this will be useful for javascript html player
+ var medias = $('.audiobook-list a');
+ var mp3List = [];
+ var oggList = [];
+ var daisyList = [];
+ var tmpExt;
+ if (medias.length > 0) {
+ // creating sources list for player
+ medias.each(function(index, item) {
+ tmpExt = item.href.split(".").pop();
+ if(tmpExt == "mp3") {
+ mp3List.push(item.href);
+ } else if (tmpExt == "ogg") {
+ oggList.push(item.href);
+ } else if(tmpExt == "daisy") {
+ daisyList.push(item.href);
+ }
+ });
+ }*/
+