$(document).ready(function () {

    //Default Action
    $(".tabContent").hide(); //Hide all content
    var activeTab = Math.floor(2 * Math.random());

    if (activeTab == 0) {
        $("ul.tabs li:first").addClass("active").show(); //Activate first tab
        $(".tabContent:first").fadeIn(5); //Show first tab content    
    } else if (activeTab == 1) {
        $("ul.tabs li:last").addClass("active").show(); //Activate first tab
        $(".tabContent:last").fadeIn(5); //Show first tab content    
    }

    //On Click Event
    $("ul.tabs li").click(function () {
        if (!($(this).hasClass("active"))) {
            $("ul.tabs li").removeClass("active"); //Remove any "active" class
            $(this).addClass("active"); //Add "active" class to selected tab
            $(".tabContent").fadeOut().hide(); //Hide all tab content
            var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
            $(activeTab).fadeIn(); //Fade in the active content
            return false;
        }
    });

});
