jQuery(function(){
	
	if(jQuery('.col2-with-image')) {
		jQuery('.col2-with-image .block-border:odd').addClass("block-odd");
	}
	if(jQuery('.col2-only-image')) {
		jQuery('.col2-only-image .block-border:odd').addClass("block-odd");
	}
	if(jQuery('.col1-products')) {
		jQuery('.col1-products .block-border:even').addClass("even");
	}
	if(jQuery('.col1-text')) {
		jQuery('.col1-text .block-border:even').addClass("even");
	}
	
	if(jQuery('.data-table')) {
		jQuery('.data-table thead tr th:first, .data-table tbody tr td:first').addClass('first');
		jQuery('.data-table thead tr th:last').addClass('last');
	}
	
	var moreHeight = 0;
	jQuery('.col-main').children().each(function(){
		if(jQuery(this).is('div')) {
			moreHeight += jQuery(this).innerHeight();
		}
	});
	
	if(jQuery('.cms-page-view').is('body')) {
		if(jQuery('.col-left').outerHeight() > moreHeight) {
			jQuery('.col-main > div.std:last-child').css({
				'height': (jQuery('.col-left').outerHeight() - (moreHeight - jQuery('.col-main > .std:last-child').innerHeight())) + 'px'
			});
			jQuery('.col-main').css('height','auto');
		}
	} else {
		if(jQuery('.col-left').outerHeight() > moreHeight) {
			jQuery('.col-main').append('<div style="padding: 8px 0 20px;height:'+(jQuery('.col-left').outerHeight() - moreHeight)+'px" class="block-border"></div>');
			jQuery('.col-main').css('height','auto');
		}
	}
});
