$(function()
{
	if ($.browser.msie)
	{
		try	{ document.execCommand('BackgroundImageCache', false, true); }
		catch(e) {}
	}

	$.fn.textFill = function(options)
	{
		options = jQuery.extend({
			maxWidth: 160,
			startSize: 8,
			maxSize: false
        }, options);

		return $(this).each(function()
		{
			var ctr = 0;
			do
			{
				$(this).css('font-size', (options.startSize + ctr) + 'px');
				ctr++;
			}
			while ($(this).width() <= options.maxWidth && (!options.maxSize || options.startSize + ctr < options.maxSize));


			if ($(this).width() > options.maxWidth)
			{
				$(this).css('font-size', (options.startSize + ctr - 1) + 'px');
			}
		});
	}

//	$('#Categories li a.Level1').textFill({maxWidth: 140, maxSize: 24});
	$('#Aside h3 a').textFill({maxWidth: 160, maxSize: 50});
});
