if (typeof window.console === 'undefined') {
	window.console = {
		log: function () {
			void(0);
		}
	};
}

jQuery(function($) {
	var currContentHeight = 0;
	var maxContentHeight = 0;
	var currTitleHeight = 0;
	var maxTitleHeight = 0;
	var rowLeveler = $('.rowLeveler');
	rowLeveler.each(function() {
		var titleLeveler = $(this).find('.titleLeveler');
		titleLeveler.each(function() {
			currTitleHeight = $(this).height();
			//console.log(this, 'title height:', currTitleHeight, 'px');
			if (currTitleHeight > maxTitleHeight) {
				maxTitleHeight = currTitleHeight;
			}
		});
		titleLeveler.height(maxTitleHeight);
		//console.log('Setting all above objects\' title height to:', maxTitleHeight, 'px');
		currTitleHeight = 0;
		maxTitleHeight = 0;
		
		var contentLeveler = $(this).find('.contentLeveler');
		contentLeveler.each(function() {
			currContentHeight = $(this).height();
			//console.log(this, 'content height:', currContentHeight, 'px');
			if (currContentHeight > maxContentHeight) {
				maxContentHeight = currContentHeight;
			}
		});
		contentLeveler.height(maxContentHeight);
		//console.log('Setting all above objects\' content height to:', maxContentHeight, 'px');
		currContentHeight = 0;
		maxContentHeight = 0;
	});
	
	$('input:text')
		.hint()
	;
	
	$('.target_blank')
		.attr('target', '_blank')
	;
	
	$('.submitCheck')
		.attr('value', '1')
	;
	
	$('a.inputButton')
		.click(function() {
			$(this).parents('form')
				.submit()
			;
		})
	;
	
	$('.corners, #brc, #catProd #productsSection li a,  #catProd #servicesSection li a')
		.corner('5px')
	;
	$('.themeContainer')
		.corner('bl br tr 6px')
	;
	
	$('.lightbox').lightBox({
		overlayBgColor: '#000',
		overlayOpacity: 0.8,
		imageLoading: '/img/lightbox/lightbox-ico-loading.gif',
		imageBtnClose: '/img/lightbox/lightbox-btn-close.gif',
		imageBtnPrev: '/img/lightbox/lightbox-btn-prev.gif',
		imageBtnNext: '/img/lightbox/lightbox-btn-next.gif',
		imageBlank: '/img/lightbox/lightbox-blank.gif',
		containerBorderSize: 10,
		containerResizeSpeed: 350
	});
	$('a[rel=lightbox]').lightBox({
		overlayBgColor: '#000',
		overlayOpacity: 0.8,
		imageLoading: '/img/lightbox/lightbox-ico-loading.gif',
		imageBtnClose: '/img/lightbox/lightbox-btn-close.gif',
		imageBtnPrev: '/img/lightbox/lightbox-btn-prev.gif',
		imageBtnNext: '/img/lightbox/lightbox-btn-next.gif',
		imageBlank: '/img/lightbox/lightbox-blank.gif',
		containerBorderSize: 10,
		containerResizeSpeed: 350
	});
});
