jQuery(function($){    
    var tab = $(".chama-tab-switch");
    tab.find(".chama-tab").on("click", function() {
    var $this = $(this);

    if ($this.hasClass("active")) return;

    var direction = $this.attr("tab-direction");
    var panel = $this.attr("tab");

    tab.removeClass("left right").addClass(direction);
    tab.find(".chama-tab.active").removeClass("active");
    $this.addClass("active");

    $('.chama-tab-content').hide();
    $('#' + panel).fadeIn();
  });
});