Portfolio= {
    tabs: function(container, startIndex) {
        var root = container || '#hometabs';
        var speed = 800; //ms?
        startIndex = startIndex || 0;
        root = $(root);
        root.addClass('js-enabled');
        
        //add click events
        $.each(root.find('ul li a'),function(index) {
            var that = $(this);
            if(index == startIndex) {
                that.parent().addClass('current');
            }
            that.click(function(){
                //set current class
                $(this).parent().addClass('current');
                $.each($(this).parent().siblings(),function() {
                    $(this).removeClass('current');
                });
                //show/hide panels
                $.each($(that.attr('href')).fadeIn(speed).siblings(),function(){
                    $(this).hide();
                });
                return false;
            });
        });
        
        //hide all but start index
        $.each(root.find('#hometab-panes > *'),function(index, el) {
            if(index != startIndex) {
                $(this).hide();
            } 
        });
    }
}

$(document).ready(function(){
   //pix tabs
   //UI tabs require too strict markup, roll own tabs function.
   Portfolio.tabs('#hometabs');
});