$(document).ready(function(){
    $(".tab_content").hide();
    /*$("ul.jtabs li:first").addClass("active").show();
    $(".tab_content:first").show();*/
	
    $('a.anchor').remove().prependTo('body');
	
    var tabid = document.location.toString();
    if (tabid.match('#')) {
        var tab_anchor = '#' + tabid.split('#')[1];

        $('ul.jtabs li:has(a[href="'+tab_anchor+'"])').addClass('active').show();
        $(""+tab_anchor+"").show();       
    }
    else {
        $("ul.jtabs li:first").addClass("active").show();
        $(".tab_content:first").show();
    }
    
    $("ul.jtabs li").click(function(){
        $("ul.jtabs li").removeClass("active");
        $(this).addClass("active");
        var activeTab = $(this).find("a").attr("href");
        $(activeTab).fadeIn();
        $(".tab_content:not(" + activeTab + ")").hide();
        return false;
    });
});

