(function($) {
	$(function() {
		var chBar = function(obj) {
			if(obj.is(':checked')) {
				// -- Отмечено
				$('.wwNoRow').hide();
				$('.wwYesRow').show();
				$('.wwNoRow input').attr('disabled', 'disabled');
				$('.wwYesRow input').removeAttr('disabled');
			}
			else {
				// -- Не отмечено
				$('.wwYesRow').hide();
				$('.wwNoRow').show();
				$('.wwYesRow input').attr('disabled', 'disabled');
				$('.wwNoRow input').removeAttr('disabled');
			}
		}
		// -- Ищем чекбокс замены бруса
		var barChange = $('.dop_opcii input[type="checkbox"]').filter(':first');
		
		barChange.click(function() {
			chBar($(this));
		});
		
		chBar(barChange);
		
		$('#uteplenie input[type="checkbox"]').removeAttr('checked');
		$('#uteplenie input[type="checkbox"]').click(function() {
			if($(this).is(':checked')) {
				$('#uteplenie input[type="checkbox"]:checked').removeAttr('checked');
				$(this).attr('checked', 'checked');
			}
		});
		$('.tooltipSup').tooltip({
			delay: 0,
			top: -30,
			left: 10
		});
	});
})(jQuery);


