;(function($) {
    $.fn.buttonfit = function(options) {
        var fontSize = options.maxFontPixels;
        var ourText = $('a:first', this);
        var maxWidth = $(this).width();
		var maxHeight = $(this).height();
		alert(maxHeight);
        var textWidth;
        do {
            ourText.css('font-size', fontSize);
            textWidth = ourText.width();
			textHeight = ourText.height();
			alert(textHeight);
            fontSize = fontSize - 1;
         } while ((textHeight > maxHeight || textWidth > maxWidth) && fontSize > 3);
        return this;
    }
})(jQuery);
