jQuery(document).ready(function($) {
	
	/*
		Expand <pre> when hovering over long code blocks
		@see http://www.viget.com/inspire/simple-jquery-solution-to-a-simple-problem
	*/

	$("pre:not([name='code'])").wrapInner("<span></span>");

	if(!($.browser.msie && $.browser.version=="6.0" || $.browser.version=="7.0")) {
	
		$("pre").hover(function() {
			var contentwidth = $(this).contents().width();
			var blockwidth = $(this).width();
			if(contentwidth > blockwidth) {
				$(this).animate({ width: "737px"}, 250);
				}
			}, function() {
				$(this).animate({ width: "401px" }, 250);
		});

	};
	
});