/** jQuery.tabify */
(function(a){a.fn.extend({tabify:function(e){function c(b){hash=a(b).find("a").attr("href");return hash=hash.substring(0,hash.length-4)}function f(b){a(b).addClass("active");a(c(b)).show();a(b).siblings("li").each(function(){a(this).removeClass("active");a(c(this)).hide()})}return this.each(function(){function b(){location.hash&&a(d).find("a[href="+location.hash+"]").length>0&&f(a(d).find("a[href="+location.hash+"]").parent())}var d=this,g={ul:a(d)};a(this).find("li a").each(function(){a(this).attr("href", a(this).attr("href")+"-tab")});location.hash&&b();setInterval(b,100);a(this).find("li").each(function(){a(this).hasClass("active")?a(c(this)).show():a(c(this)).hide()});e&&e(g)})}})})(jQuery);

$(function(){
    
    $('.tabs').tabify();
    
    $('.tab-panel').each(function(){
        $(this).find('.quote-cat ol')
            .hide()
        .eq(0) // first ol per panel
            .show();
    });
    
    window.catToggle = function(context, catId) {
        $(context).parent().children('ol').slideToggle('fast');
        return false;
    };
    
    window.showOdds = function(context, catId, subId) {
        $(context)
            .attr('href', 'https://www.betfair.it/?categoryId=' + catId 
                + '&subcategoryId=' + subId)
            .attr('target', '_blank');

        return true;
    };
    
    
});

