 
jQuery.fn.equalHeights = function(px) {
        jQuery(this).each( function(){
               var currentTallest = 0;
               jQuery(this).children("div.base_col").each(function(i){
                       if (jQuery(this).height() > currentTallest) { currentTallest = jQuery(this).height(); }
               });
               jQuery(this).children("div.base_col").css({'min-height': currentTallest}); 
        });
        return this;
}

$(function() {
	// rounded corners and drops
	$("div#footer").corner("round");
	$("div#main").corner("round bl br");
	$(".label_text_m01").corner("round 5px");
	$(".skin_mn01").corner("round");

	$(".contentblock_mn02").corner("round tr bl br");
	$(".label_text_mn02").corner("round tl");

	// $(".skin_mn02").corner("round");
	// $(".skin_bg01_inner").corner("round tl tr");
	$(".skin_bg01").corner("round");
	
	
	// $("#footer_inner").dropShadow({left: 0, top: 4});
	// $("#footer").redrawShadow();
	
	$("div.eq1 div.skin_bg01").equalHeights();
$("div.eq2 div.skin_bg01").equalHeights();
$("div.eq2 div.skin_bg01").equalHeights();
	
	
	
	$("td").removeAttr("nowrap");
	// add first and last classes to various elements
	/*$("#footer ul, .subnavblock, .footlinksblock").each( function() {
		$(this).children("li:last").addClass("li_last");
		$(this).children("li:first").addClass("li_first");
	});
	$("#content #maintop, #content #mainbot, #content .left, #content .right, #rm").each( function() {
		$(this).children(".skin:last").addClass("last");
		//$(this).children(".skin:first").addClass("first");
	});*/
	
	// Template 5
	function cropPercent() {
		var newWidth = $(this).width() - 1;
		$(this).width(newWidth);
	}
	if($.browser.msie) {
		$('.multipleskinarea').each(function(){
			var sumColWidths = 0;
			$('.multipleskinarea .base_col').each(function(){
				sumColWidths = sumColWidths + $(this).outerWidth(true);
			});
			// Uncomment to show calculations (pre-adjustment)
			//$(this).prepend("MSCA Width: " + $(this).width() + "px<br />sumColWidths: " + sumColWidths + "px");
			if ($(this).width() < sumColWidths ){
				$(this).children('.base_col').each(cropPercent);
			};
		});
		$('#mainlead').each(function(){
			var sumLeadWidths = 0;
			sumLeadWidths = $('#mainlead .left').outerWidth(true) + $('#mainlead .right').outerWidth(true);
			// Uncomment to show calculations (pre-adjustment)
			//$(this).prepend("MSCA Width: " + $(this).width() + "px<br />sumLeadWidths: " + sumLeadWidths + "px");
			if ($(this).width() < sumLeadWidths ){
				$('#mainlead .left').each(cropPercent);
				$('#mainlead .right').each(cropPercent);
			};
		});
	};
});
