$(document).ready(function() {
	/* border-radius support detecting */
	if (!Modernizr.borderradius) {
		$('.b-rounded').append('<span class="rc lt"></span><span class="rc rt"></span><span class="rc lb"></span><span class="rc rb"></span>');
	}
	
	function getHeight() {
		var thisHeight = $('#body').height();
		var step = 186;
		var minHeight = 349;
		
		for (i = 1; i < 10; i++) {
			if (thisHeight < minHeight) {
				thisHeight = minHeight;
			} else {
				if (((thisHeight % step) > 0) && (i == Math.floor(thisHeight / step))) {
					thisHeight = minHeight + (i - 1) * step;
				}
			}
		}
		
		$('#body').css({ height: thisHeight + 'px' });
	}
	
	getHeight();
	$(document).ready(function(){
		$(".item-detail-img").lightbox({
			fitToScreen: true,
			imageClickClose: true,
			fileLoadingImage : '/bitrix/templates/.default/elki-palki/js/lightbox/images/loading.gif',
			fileBottomNavCloseImage : '/bitrix/templates/.default/elki-palki/js/lightbox/images/closelabel.gif'
		});
	}); 
});

