$(document).ready(function() {
	// Hide the quote.
	shrinkText('quote-container', 'quote');
	// Position the quote.
	var quoteCellHeight = $("#quote").height();
	var quoteTextHeight = $("#quote-text #quote-container").height();
	// Resize quote text.
	var diff = ( quoteCellHeight - quoteTextHeight ) / 2;
	//alert(diff);
	$("#quote .inner #quote-container").css({paddingTop:diff});
});

function shrinkText( text, container )
{
	var t = $('#'+text);
	var c = $('#'+container);
	var textHeight = t.height();
	var containerHeight = c.height();
	var fontSize = t.css('font-size').replace('px','');
	var lineHeight = t.css('line-height').replace('px','');
	if (textHeight > containerHeight-10) {
		// Resize text.
		t.css( {'font-size':(fontSize-2)+'px', 'line-height':(lineHeight-2)+'px'});
		var textHeight = t.height();
		if (textHeight > containerHeight-10) {
			shrinkText( text, container );
		}
	}
}
