$(document).ready(function() {
			var hcontent = $(".one_article").height();
			var hsidebar = $(".sidebar").height();
			if (hcontent-hsidebar > 200) {
				$(".sidebar").css('height', hcontent);
			}
			
			
			$("#map .point .info").hide();

			
			$('#map .point i').click(function() {
			  $("#map .point .info").hide();
			  $(this).parent().find('.info').stop(true, true).show('fast');
			  return false;
			});
  
			$(".page_title .route").toggle(function() { 
				$(this).parent().find('ul').stop(true, true).delay(50).fadeIn("slow");
                      },
                       function() { 
				$(this).parent().find('ul').stop(true, true).delay(50).fadeOut("slow"); 
                    });
			  
			var offset = ($(".page_title span").width() - 70)
				$(".page_title ul").css( "left",offset);
				
			$(".free_call").hover(function() {
				$(this).addClass("act");
			}, function(){
				$(this).removeClass("act");
			});
			$("#header div.menu_wrap div.menu ul li").hover(function() {
				$(this).addClass("hover");
			}, function(){
				$(this).removeClass("hover");
			});
			$("#in_progress a:last").css('margin-right','0');
			$(".footer_menu li:last").css('margin-right','0');
			$(".one_report:last").css('margin-bottom','0');
			
			
			
			$('.error').hide();
			
$("#c_submite").click(function() {
    $('.error').hide();
		
				 var name = $("input#c_name").val();  
					  if (name == "") {  
					$("label#c_name_error").show();  
					$("input#c_name").focus();  
					return false;  
				  } 
				  var phone = $("input#c_phone").val();  
					  if (phone == "") {  
					$("label#c_phone_error").show();  
					$("input#c_phone").focus();  
					return false;  
				  } 
				  var time = $("input#c_time").val();
		
		var dataString = '&name='+ name + '&phone=' + phone + '&time=' + time;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "http://freedomhome.ru/process.php", 
      data: dataString,
      success: function() {
        $('.header_top').append("<div class=\"clrfx\"></div><div id='message' style=\"text-align:center\"></div>");
        $('#message').html("<h2 style=\"text-align:center\">Спасибо!</h2>")
        .append("<p style=\"text-align:center\">Мы перезвоним Вам в ближайшее время.</p>")
        .hide()
        .fadeIn(1500);
      }
     });
    return false;
	});
});
