﻿$(document).ready(function() {

    jQuery("#tab1").jcarousel({
        scroll: 4,
        auto: 15,
        animation: 'slow',
        wrap: 'last'
    });


    /* Product Tabs */

    //When page loads...
    $(".products_box_carousel").hide(); //Hide all content
    $("ul.products_box_tabs li:first").addClass("this").show(); //Activate first tab
    $(".products_box_carousel:first").show(); //Show first tab content

    //On Click Event
    $("ul.products_box_tabs li").click(function() {

        $("ul.products_box_tabs li").removeClass("this"); //Remove any "active" class
        $(this).addClass("this"); //Add "active" class to selected tab
        $(".products_box_carousel").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        jQuery(activeTab).jcarousel({
            scroll: 4,
            auto: 15,
            animation: 'slow',
            wrap: 'last'
        });
        return false;

    });


    /* Top Tag Tabs */

    //When page loads...
    $(".tag_box").hide(); //Hide all content
    $("ul.tags_box_tabs li:first").addClass("this").show(); //Activate first tab
    $(".tag_box:first").show(); //Show first tab content

    //On Click Event
    $("ul.tags_box_tabs li").click(function() {

        $("ul.tags_box_tabs li").removeClass("this"); //Remove any "active" class
        $(this).addClass("this"); //Add "active" class to selected tab
        $(".tag_box").hide(); //Hide all tab content
        var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
        $(activeTab).fadeIn(); //Fade in the active ID content
        return false;

    });

});
