(function( $ ){
    // Default category to be used if none are passed.
    var settings = {
        'category'     : "Category"
    }; // end settings var
    var methods = {
        init : function(options) {
            return this.each(function(){
                // if options are passed in the call, replace the defaults with them.
                options = $.extend( settings, options);
                
                // Maintain chainability by keeping scope of 'this'.
                var $this = $(this);
                
                var functionCall = "recordOutboundLink(this, '" + options.category + "', '";
                
                // go through each anchor tag and add the onclick.
                $('a', this).each(function() {
                    $(this).attr('onclick', ' ' + functionCall + $(this).attr('href') + "');return false;");
                });
            });
        }
    }; // end methods var
    $.fn.urlT = function( method ) {
        if ( methods[method] ){
            return methods[method].apply( this, Array.prototype.slice.call( arguments, 1));
        } else if( typeof method == 'object' || ! method ) {
            return methods.init.apply( this, arguments );
        } else {
            $.error( 'Method ' + method + ' does not exist on Jquery.urlT' );
            return false;
        }
    }; // end function urlT
})( jQuery );
