function smartColumns() { //Create a function that calculates the smart columns

    //Reset column size to a 100% once view port has been adjusted
    $("ul.column_index").css({
        'width' : "100%"
    });

    var colWrap = $("ul.column_index").width(); //Get the width of row
    var colNum = Math.floor(colWrap / 180); //Find how many columns of 200px can fit per row / then round it down to a whole number
    var colFixed = Math.floor(colWrap / colNum); //Get the width of the row and divide it by the number of columns it can fit / then round it down to a whole number. This value will be the exact width of the re-adjusted column

    $("ul.column_index").css({
        'width' : colWrap
    }); //Set exact width of row in pixels instead of using % - Prevents cross-browser bugs that appear in certain view port resolutions.
    $("ul.column_index li").css({
        'width' : colFixed
    }); //Set exact width of the re-adjusted column
}

smartColumns();//Execute the function when page loads

$(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function
    smartColumns();
});

$(function() {
    $( "#accordion" ).accordion({
        autoHeight: false,
        navigation: true
    });
    $(".gs_menu").megamenu();
    $(".gs_menu_products").megamenu();
    $('#tabs').tabs();
    $(".btn").button({
        text: true
    });
    $(".search_btn").button({
        icons: {
            primary: 'ui-icon-search'
        },
        text: true
    });
    $(".cart").button({
        icons: {
            primary: 'ui-icon-cart'
        },
        text: true
    });
    $('#slider').nivoSlider();
    $.featureList(
        $("#tabs li a"),
        $("#output li"), {
            start_item	:	1
        }
        );

});

