function seo_top() { $('.about_block.about').after(''); var lenth = 0, flag = true; if ($('.about p').length > 1) { $('.about_buf').html($('.about').html()); $('.about_buf p').each(function() { if (flag) { lenth = lenth + $(this).text().length; if (lenth > 500) { if ($(this).prev('p').text().length) { for (var i = -1; i < $(this).index(); i++) { $('.short_seo').prepend($(this).prev('p').get()); } $('.short_seo').append('
Показать подробное описание
'); } else { $('.short_seo').prepend($('.about_buf p:first').get(0)).append('
Показать подробное описание
'); } if ($('.about h1').text().length) { $('.short_seo').prepend('

' + $('.about h1').text() + '

'); } $('.short_seo').show(); $('.about_block.about').hide().append('
Скрыть подробное описание
'); flag = false; } } }); } else if ($('.about p').length == 1 && $('.about p').html().length > 500) { $('.about').hide().append('Скрыть подробное описание'); $('.short_seo').html('

' + $('.about p').html().substr(0, 500) + '...' + '

').prepend('

' + $('.about h1').text() + '

').show().append('
Показать подробное описание
'); } } $(document).ready(function() { seo_top(); $('.rate_plug').circliful(); $('.rate_plug').each(function() { $(this).attr('data-part') === '500' ? $(this).addClass('full_rate') : ''; }); $(".subways_popup").hide(); $(".callback").click(); $('body').on('click', '#subway_id', function(e) { e.preventDefault(); $(".overlay").show().css({"background": "none"}); $(".speciality").removeClass("active"); $(".spec_wrapper").hide(); $(".subway").addClass("active"); $('.wrap_popup').show(); $('.subways_popup').show(); $(".subways_popup .close").click(function() { $('.wrap_popup').hide(); $('.subways_popup').hide(); $(".subway").removeClass("active"); $(".overlay").hide(); }); }); $(".spec_wrapper").hide(); $.fn.centerWindow = function() { this.css("position", "absolute"); this.css("top", (300 + $(window).height() - this.outerHeight()) / 2 + $(window).scrollTop() + "px"); this.css("left", ($(window).width() - this.outerWidth()) / 2 + $(window).scrollLeft() + "px"); return this; }; $.fn.centerWindow2 = function() { this.css("position", "absolute"); this.css("top", ($(window).height() - this.outerHeight()) / 2 + $(window).scrollTop() + "px"); this.css("left", ($(window).width() - this.outerWidth()) / 2 + $(window).scrollLeft() + "px"); return this; }; $("body").on("click", ".speciality", function() { $(".services_popup").show().centerWindow2(); var overlay_two = $("
"); $("body").before(overlay_two) $(".overlay_menu, .services_popup .close").click(function() { $(".services_popup").hide(); $(".overlay_menu").remove(); $(".speciality").removeClass("active"); }); $(".spec_wrapper").show(); $('.wrap_popup').hide(); $('.subways_popup').hide(); $(".subway").removeClass("active"); $(".speciality").addClass("active"); $('.phone').mask('+7 (999) 999-99-99'); }); $("body").on("click", ".subway", function() { $(".subways_popup").show().centerWindow(); var overlay_two = $("
"); $("body").before(overlay_two) $(".overlay_menu, .subways_popup .close").click(function() { $(".subways_popup").hide(); $(".overlay_menu").remove(); $(".subway").removeClass("active"); }); $(".subways_popup").show(); $('.spec_wrapper").').hide(); $('.subways_popup').hide(); $(".subway").removeClass("active"); $(".speciality").addClass("active"); }); $("body").on("click", ".spec_wrapper .close", function() { $(".spec_wrapper").hide(); $(".speciality").removeClass("active") $(".overlay").hide(); }); $(".overlay").click(function() { $(".spec_wrapper").hide(); $(".speciality").removeClass("active") $('.wrap_popup').hide(); $('.subways_popup').hide(); $(".subway").removeClass("active"); $(this).hide(); }); $("body").on("click", ".call_block .callback", function() { $("
X
").appendTo(".filter_row"); }); $("body").on("click", ".clos", function() { $(".callback_popup").remove(); $(this).remove() }); $("body").on("click", ""); $(".wrap_popup li").eq(11).addClass("m20"); $(".wrap_popup li").eq(28).addClass("m20"); $(".wrap_popup li").eq(41).addClass("m20"); $(".wrap_popup li").eq(47).addClass("m20"); $(".wrap_popup li").eq(48).addClass("m20"); $(".wrap_popup li").eq(49).addClass("m20"); $(".wrap_popup li").eq(78).addClass("m20"); $(".wrap_popup li").eq(82).addClass("m20"); $(".wrap_popup li").eq(92).addClass("m20"); $(".wrap_popup li").eq(101).addClass("m20"); $(".wrap_popup li").eq(107).addClass("m20"); $(".wrap_popup li").eq(133).addClass("m20"); $(".wrap_popup li").eq(137).addClass("m20"); $(".wrap_popup li").eq(153).addClass("m20"); $(".wrap_popup li").eq(169).addClass("m20"); $(".wrap_popup li").eq(179).addClass("m20"); $(".wrap_popup li").eq(182).addClass("m20"); $(".wrap_popup li").eq(184).addClass("m20"); $(".wrap_popup li").eq(189).addClass("m20"); $(".wrap_popup li").eq(192).addClass("m20"); $(".wrap_popup li").eq(194).addClass("m20"); $(".wrap_popup li").eq(195).addClass("m20"); $(".wrap_popup li").eq(197).addClass("m20"); $(".speciality").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); }); $(".subway").hover(function() { $(this).addClass("hover"); }, function() { $(this).removeClass("hover"); }); $('body').on('click', '.street', function() { $(this).addClass('active').parents('.result_list_item').find('.map_in_list').slideDown(); }); $('body').on('click', '.close_map', function() { $(this).parents('.map_in_list').slideUp().parents('.result_list_item').find('.street').removeClass('active'); }); $('body').on('click', '.about_block .more_descr', function() { $('.about_block.about, .short_seo').toggle(); }); $('body').on('click', '.overlay, .order_popup .close', function() { $('.overlay').hide(); $('.overlay_close').show(); }); $('body').on('click', '.really_close .close, .overlay_close, .go_on', function() { $('.overlay').show(); $('.really_close').hide(); $('.overlay_close').hide(); }); }); $(window).scroll(function() { if ($(this).scrollTop() > 127) { $(".logo_row").hide(); $(".clos").hide(); $('.filter_row').css({"position": "fixed", "width": "1096px", "top": "-50px"}) } else { $(".logo_row").show(); $('.filter_row').css({"position": "static", "width": "auto", "top": "0"}) $(".clos").show(); } });