$(document).ready(function(){
	//var main_height = $(".main_photo img").height();
	//if (main_height != '0') { $(".main_photo").height(main_height); }

	

	$(".photos_small a").click(function () {
	var xe = $(this).attr("href");
		$(".main_photo img").fadeOut("fast", function(){	 	});
		$(".main_photo").height ($(".main_photo img").height());
			$(".main_photo img").load(function() {  
				if ($(".main_photo img").width() > 640) {
					$(".main_photo img").attr("width", 640);
				}
	
				$(".main_photo").height ($(".main_photo img").height());
				$(".main_photo img").fadeIn("slow");
			}).attr('src', xe);
 

	$(".photos_small a").removeClass("photo_selected").addClass("photo_notselected");
	$(this).removeClass("photo_notselected").addClass("photo_selected");
	return false;
    });
	

	if ($("#form_calc").length) {
		$('HTML').addClass('JS');
		$("span.help").hide();
		$("span.help").wrap("<span class='ico'></span>");
		$("span.ico").append("&nbsp;");
		


    if ($(".ico").size() > 0) {
        $(".ico").hover(function(){
            $(this).find('span.help').fadeIn(200);
        }, function(){
            $(this).find('span.help').fadeOut(100);
        });
	}

		
		$("div.dop2 input").attr("disabled", true);
		$("div.dop2").css({color:"#979797"});
		
		$("input[name=PROPERTY[17]]:[value=25]").click(function () {
			$("div.dop input").removeAttr("disabled");
			$("div.dop").css({color:"#000"});			
			$("div.dop2 input").attr("disabled", true);
			$("div.dop2").css({color:"#979797"});
			$("div.dop input:first").attr('checked', true);
		});
		$("input[name=PROPERTY[17]]:[value=26]").click(function () {
			$("div.dop2 input").removeAttr("disabled");
			$("div.dop2").css({color:"#000"});			
			$("div.dop input").attr("disabled", true);
			$("div.dop").css({color:"#979797"});
			$("div.dop2 input:first").attr('checked', true);
		});		
	}


    //	Хорошего дня!
});

