/* initPage */
$(document).ready(function(){
	$('.resize-section').initResizeBlock({
		resizeEls: '.column',
		indentProp: 'marginRight'
	});
});

/* resize Block */
jQuery.fn.initResizeBlock = function(_options){
	// defaults options	
	var _options = jQuery.extend({
		resizeEls: '.column',
		indentProp: 'marginRight'
	},_options);

	return this.each(function(){
		var _this = jQuery(this);
		var _wrapperWidth = _this.parent().width();
		var _rezEls = _this.find(_options.resizeEls);
		if(_rezEls.length && _rezEls.length*_rezEls.outerWidth(true) != _wrapperWidth){
			var _indent = parseInt(_rezEls.css(_options.indentProp));
			if(_indent){
				_rezEls.css({"width": Math.floor((_wrapperWidth- _rezEls.length*_indent)/_rezEls.length)});
			}else{
				_rezEls.css({"width": Math.floor(parseInt_wrapperWidth/_rezEls.length)});
			}
		}
	});
}

