(function($){

$(document).ready(function(){
	
	$('#primary .widget-list > li:last-child').css({'border-bottom':'none'});
	$('#content.post-list .post').last().css({'border-bottom':'none'});
	
	var hc = 0;
	var hp = 0;
	var mx = 0;
	hc = $('#container').height();
	hp = $('#primary').height();
	
	if (hc > hp)
		$('#primary').height(hc + 40);
	else 
		$('#container').height(hp - 40);
	

	$('.menu-header #menu-top_menu > li').each( function(index) {
		
		var div = $(this).children('div');
		if (div.length == 1) {
			$(this).addClass('hasChild');
		}
	});


	if ($('.partners-list').length)
	{
		$('.partners-list').each( function(ul) {
			$(this).children('li').equalHeights();
		});
	}


	if ($('.blog-menu').length)
	{
		$('.blog-menu li:not(:first) a').addClass('blog-item');
	}

	if ($.browser.msie) {
		try {document.execCommand("BackgroundImageCache", false, true);} catch(err){};
		if (typeof(DD_belatedPNG) != 'undefined')
		{
			DD_belatedPNG.fix('img');
		}
	}

});


	$.fn.equalHeights = function(minHeight, maxHeight) {
		tallest = (minHeight) ? minHeight : 0;
		this.each(function() {
			if($(this).height() > tallest) {
				tallest = $(this).height();
			}
		});
		if((maxHeight) && tallest > maxHeight) tallest = maxHeight;
		return this.each(function() {
			$(this).height(tallest).css("overflow","auto");
		});
	}


})(jQuery);
