(function($){

    $.fn.TableDecorator = function(){

        var me = this;

        this.options = {
            initialSelector: 'tbody tr'
        };

        this.init = function(){
            this.decorateList(this.find(this.options.initialSelector));
        };

        this.decorateList = function(rows){

            if(rows.length > 0){

                rows.first().addClass('first');
                rows.last().addClass('last');

                rows.each(function(index){
                    var item = $(this);

                    item.addClass(index % 2 == 0 ? 'odd' : 'even');

                });
            }
        };

        this.init();

    }
})(jQuery);
