$(document).ready( function(){
	//$("#front-content-boxes ul li").setAllToMaxHeight();
	$("#front-content-boxes ul li").equalHeight();
	
	/*
	var maxHeight = 0;
	$("#front-content-boxes ul li .wrapper").each( function(){
		if ( $(this).outerHeight() >= maxHeight ){
			maxHeight = $(this).outerHeight();
		}
		//alert( $(this).outerHeight() + " " + $(this).height() + " " + $(this).offsetHeight );
	});
	$("#front-content-boxes ul li .wrapper").height(maxHeight+50);
	*/
	
});

$.fn.setAllToMaxHeight = function(){
	return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}

$.fn.equalHeight = function(){
        var height = 0,
                reset = $.browser.msie ? "1%" : "auto";

        return this
                .css("height", reset)
                .each(function() {
                        height = Math.max(height, this.offsetHeight);
						if ($.browser.webkit) {
						    height = height + 20;
						 }
                })
                .css("height", height)
                .each(function() {
                        var h = this.offsetHeight;
                        if (h > height) {
                                $(this).css("height", height - (h - height));
                        };
                });

    };

