(function($) {
        $.extend($.fn, {
            defaultButton: function(selector) {
                this.keypress(function(e) {
                    if (e.which == 13 && e.target.type != 'textarea') {
                        var tmpBtn = $(this).find(selector);
                        if (tmpBtn[0].type == 'submit')
                            tmpBtn[0].click();
                        else if ($(tmpBtn[0]).attr('onclick')) 
                        {
                            var ret = $(tmpBtn[0]).attr('onclick')();
                            if(ret)
                                eval(tmpBtn[0].href);
                        }
                        else
                            eval(tmpBtn[0].href.replace(/%20/g,' '));
                        
                    }
                });
            }
        });
    })(jQuery);
