- $('p.header span').click(function(){
- if(this.className != "desc"){
- $('.audiobook-list').hide();
- $('p.header span.active').attr('class', '');
- // we don't want to interact with "audiobook" label, just 'format' tabs
- this.className = "active";
- $("#"+$("p.header span.active").html().toLowerCase()+"-files").show();
- }
+ $('.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();