$('.support-tabs a.tab').each(function (e) {
    
    
    var content_div_name = $(this).attr('rel');
    
    
    var content_div = $('#'+content_div_name);
    
    
    
    // If the corresponding content field is empty, remove the tab
    if ($.trim(content_div.text()) == '') {
        $(this).parents('li').remove();
        return true;
    }
    
    // Abfrage nach Klasse von Kai eingebaut am 26.01.2012
    if (!content_div.hasClass("notitle")) {
    	content_div.prepend('<h2>' + $(this).text() + '</h2>');
    }
    
    $(this).click(function(e) {
        e.preventDefault();
        // switch all tabs off
        $(".active").removeClass("active");
        // switch this tab on
        $(this).addClass("active");
        // slide all content up
        $(".content").hide();
        // slide this content up
        var content_show = $(this).attr("rel");
        $("#"+content_show).show();
        
        return true;
    });
    
    return true;
});

function clickSupportTab(index) {
    $('.support-tabs a[rel=content_' + index + ']').trigger('click');
    return false;
}
