// Welcome to your jquery.base file ... place awesome jquery stuff here to help spruce up / fix / whatever your site. A link to this file has already been placed in each masterpage

jQuery(function() {
	jQuery("#topnav a").hover(
		function () {
			jQuery("#topnav a").css({'background' : 'url(../images/bg/mouseover.png)', 'height' : '38px !important;'});
		}, 
		function () {
			jQuery("#topnav a").css({'background-image' : 'none', 'height' : '38px !important;'});
		}
	 );
	
	// Template 5
	function cropPercent() {
		var newWidth = jQuery(this).width() - 1;
		jQuery(this).width(newWidth);
	}
	if(jQuery.browser.msie) {
	
		jQuery('.multipleskinarea').each(function(){
			var sumColWidths = 0;
			jQuery('.multipleskinarea .base_col').each(function(){
				sumColWidths = sumColWidths + jQuery(this).outerWidth(true);
			});
			// Uncomment to show calculations (pre-adjustment)
			//jQuery(this).prepend("MSCA Width: " + jQuery(this).width() + "px<br />sumColWidths: " + sumColWidths + "px");
			if (jQuery(this).width() < sumColWidths ){
				jQuery(this).children('.base_col').each(cropPercent);
			};
		});
		jQuery('#mainlead').each(function(){
			var sumLeadWidths = 0;
			sumLeadWidths = jQuery('#mainlead .left').outerWidth(true) + jQuery('#mainlead .right').outerWidth(true);
			// Uncomment to show calculations (pre-adjustment)
			//jQuery(this).prepend("MSCA Width: " + jQuery(this).width() + "px<br />sumLeadWidths: " + sumLeadWidths + "px");
			if (jQuery(this).width() < sumLeadWidths ){
				jQuery('#mainlead .left').each(cropPercent);
				jQuery('#mainlead .right').each(cropPercent);
			};
			
		});
	};
	
});