/* 
 * jQuery plugin.
 * Sets element's children equil height.
 * @param   target  its chilren will get the same height
 * @param   options this "options" has only "except" now. The "except" is a string containing a selector expression.
 * @return  elements with updated children
 * @author  andrew
 */


(function($){
    $.fn.childrenHeightEquil = function(target,options){
	var defaults = {
	    except:'.clear'
	},
	    settings = $.extend({},defaults,options);

	return this.each(function(){
	    var pHeight = $(this).height(),
		childs = $(this).children();

	    for(var i=0;i<childs.length;i++){
		if(!$(childs[i]).is(settings.except)){
		    var p_t = parseInt($(childs[i]).css('padding-top')),
			p_b = parseInt($(childs[i]).css('padding-bottom'));
		    $(childs[i]).height(pHeight-p_t-p_b);
		}
	    }
	});
    };
})(jQuery);

$(function(){
    $('#pageCore').childrenHeightEquil();
});



