PageSourceSearch

https://raise.ru/js/main.js?1

js raise.ru collected 2026-10-02 10:19:18 UTC 55,364 bytes, 1,676 lines download raw bytes

1$(document).ready(function(){
2    
3    
4    $(".complaint_button").bind( "click", function() {
5        var oldid = 0;
6        if($('#complaint_id').val() > 0) {
7            oldid = $('#complaint_id').val();
8        }
9        $('#complaint_form').children('textarea').val(''); $('#complaint_id').val(''); $('#complaint_phone').val(''); $('#complaint_url').val('');
10        var ads_id = $(this).attr("number");
11        //alert(ads_id);
12        $('.item_'+ads_id).children().hide();
13        $('#complaint_id').val(ads_id);
14
15        $("#complaint_form").detach().appendTo($('.item_'+ads_id)).show();
16        $(".item_"+oldid).children().show();
17
18    });
19
20    $('#complaint_form .f_submit').click(function(){
21        that=this;
22        finish=0;
23        var ads_id = $('#complaint_id').val();
24        var ads_url = $('#adsurl_'+ads_id).attr("href");
25        //alert(ads_url);
26        if($('#complaint_form textarea').val()==''){alert('Заполните поле с жалобой!'); return false;}
27        $.ajax({
28            url: '/ajax/complaint_send.php',
29            dataType : "html",
30            data: { text: $('#complaint_form textarea').val(), phone: $('#complaint_phone').val(), id: ads_id, type: "", url: ads_url},
31            success: function (data, textStatus) {
32                if(data > 0) {
33                    //alert("-"+data+"-");
34                    $('.item_' + $.trim(data)).children().show();
35                    $("#complaint_form").hide();
36                    alert('Жалоба отправленна!');
37                }
38            }
39        });
40        return false;
41    });
42    
43    //detectOutdatedBrowser();
44    hideSecondBanner();
45    activePresentation();
46    //styler
47    $('.lang').styler();
48    $('.choice').styler();
49    $('.choice_part').styler();
50//    $('.top_menu').styler();
51    $('.choice_form').styler();
52	
53	
54	$("#hide_also").bind( "click", function() {
55	  $("#view_also_data").attr("style", "display:none;");
56	  $("#view_also").html("показать еще");	  
57    });
58	
59	$("#view_also").bind( "click", function() {
60	  $("#view_also_data").attr("style", " ");
61	  $("#view_also").html(" ");  	  
62    }); 
63	
64	$("#hide_also2").bind( "click", function() {
65	  $("#view_also_data2").attr("style", "display:none;");
66	  $("#view_also2").html("показать еще");
67      $("#view_also2").attr("style", " ");		  
68    }); 
69	
70	$("#view_also2").bind( "click", function() {
71	  $("#view_also_data2").attr("style", " ");
72	  $("#view_also2").html(" ");
73      $("#view_also2").attr("style", "display:none;");	  
74    });
75	
76	$(".request_f").on("click", function() {
77     //$(".title_form").click()
78	 $(".msg_dealer").find("form").slideDown(500); 
79    }); 
80	
81	
82	$('#submit_filter_form').click(function(){
83			 var check = checkDataFilterForm(); 
84			 if(check == false) 
85			  return false;
86	}); 
87	
88	$('#marks_select_block').find('.jq-selectbox__select').click(function(){
89			 var check = checkDataFilterForm(); 
90			 if(check == false)  
91			  return false;
92	});  
93	
94    // activation
95/*    $(".tabs label").on("click", function(){
96        $(".tabs li").find("a").removeClass("active");
97        $(this).find("a").addClass("active");
98        $(this).prev("input").prop("checked", true);
99    })*/
100    $("nav > a").on("click", function(){
101        $("nav > a").removeClass("active");
102        $(this).addClass("active");
103    })
104    $(".pagination li a").on("click", function(){
105        $(".pagination li").find("a").removeClass("active");
106        $(this).addClass("active");
107    })
108    $(".filter form .advanced").on("click", function() {
109        if($(this).hasClass("minus")) {
110            $(".filter fieldset").slideUp(500);
111            $(this).removeClass("minus");
112        }else {
113            $(".filter fieldset").slideDown(500);
114            $(this).addClass("minus");
115        }
116    });
117    $(".open_contacts").on("click", function() {
118        var parent = $(this).parents(".deal_location");
119        if($(this).hasClass("active")) {
120            parent.find(".deal_details_contact").slideDown(500);
121            $(this).html("close contacts");
122            $(this).removeClass("active");
123        }else {
124            parent.find(".deal_details_contact").slideUp(500);
125            $(this).addClass("active");
126            $(this).html("open contacts");
127        }
128    });
129    $(".folded").on("click", function () {
130        var elem = $(this).parents(".spoiler-wrap").find(".body_spoiler");
131        if (elem.hasClass("active")) {
132            elem.slideUp(300);
133            elem.removeClass("active");
134        } else {
135            elem.slideDown(300);
136            elem.addClass("active");
137        }
138    })
139
140    $(".list_product_desc span, .firm_desc span, .drop_filter > span").on("click", function() {
141        var isOpen = $(this).hasClass("open_list");
142        var parent = $(this).parents("[data-class=fading_block]");
143        var height = parent[0].scrollHeight + 15;
144        var heightMin;
145        if (isOpen === true) {
146            hideList(parent, height);
147        } else {
148            $(parent).animate({
149                height: height
150            }, 500, function() {
151                $(this).find("span").addClass("open_list");
152                $(this).removeClass("fading");
153                $(this).removeClass("white_down");
154            });
155
156        }
157    })
158    $(".title_form").on("click", function() {
159        var parent = $(this).parents(".msg_dealer")
160        if (parent.length == 0) {
161            parent = $(this).parent();
162        }
163        if (parent.hasClass("active")) {
164            parent.find("form").slideUp(500);
165            parent.removeClass("active");
166        } else {
167            parent.find("form").slideDown(500);
168            parent.addClass("active");
169        }
170    });
171    $(".app > ul, .correct_blk").hover(
172        function(){
173            $(".app").addClass("app_normal");
174        },
175        function(){
176            $(".app").removeClass("app_normal");
177        }
178    );
179    $(".app div").hover(
180        function(){
181            $(".app").addClass("app_active");
182        },
183        function(){
184            $(".app").removeClass("app_active");
185        }
186    );
187    /*$(".search").on("click", function () {
188        $(this).toggleClass("active");
189        $(".search_field").toggleClass("active");
190        $(".popup_menu").removeClass("active");
191    })*/
192    $(".a_account_service").on("click", function () {
193        $(".account_service").toggleClass("active");
194        $(".popup-service").toggleClass("active");
195    })
196    $(".a_closed-menu").on("click", function () { /* _new_ */
197        $(".closed-menu").toggleClass("active");
198        $(".popup_closed-menu").toggleClass("active");
199    })
200    $(".a_for-buyers").on("click", function () { /* _new_ */
201        $(".for-buyers").toggleClass("active");
202        $(".popup_for-buyers").toggleClass("active");
203    })
204    $(".a_for-sellers").on("click", function () { /* _new_ */
205        $(".for-sellers").toggleClass("active");
206        $(".popup_for-sellers").toggleClass("active");
207    })
208    /*$(":not(.search.active)").on("click", function(e) {
209        if ($(this).hasClass('current_selected_region') || $(this).hasClass('open-lightbox')) {
210            return;
211        }
212        if ($(e.target.outerHTML).hasClass('jq-selectbox__select-text') || $(e.target.outerHTML).hasClass('jq-selectbox__select')) {
213            return false;
214        }
215        if ($(".search").hasClass("active") || $(".desc_ad").length) {
216            $(".jq-selectbox__dropdown").css("display", "none");
217            e.stopPropagation();
218        }
219        if(!($(this).hasClass("search") && $(this).hasClass("active")) && !($(this).parents(".search_field").length == 1)) {
220            $(".search_field").removeClass("active");
221            $(".search").removeClass("active");
222        }
223    })*/
224
225    /* _new_ */
226    $(":not(.a_for-buyers)").on("click", function(e) {   
227        if ($(this).hasClass('current_selected_region') || $(this).hasClass('open-lightbox')) {
228            return;
229        }
230        if ($(e.target.outerHTML).hasClass('jq-selectbox__select-text') || $(e.target.outerHTML).hasClass('jq-selectbox__select')) {
231            return false;
232        }
233        if ($(".for-buyers").hasClass("active") || $(".desc_ad").length) {
234            $(".jq-selectbox__dropdown").css("display", "none");
235            e.stopPropagation();
236        }
237        if(!($(this).hasClass("for-buyers") && $(this).hasClass("active")) && !($(this).parents(".popup_for-buyers").length == 1)) {
238            $(".popup_for-buyers").removeClass("active"); 
239            $(".for-buyers").removeClass("active");
240        }
241    });
242    /* _new_ */
243    $(":not(.a_for-sellers)").on("click", function(e) {   
244        if ($(this).hasClass('current_selected_region') || $(this).hasClass('open-lightbox')) {
245            return;
246        }
247        if ($(e.target.outerHTML).hasClass('jq-selectbox__select-text') || $(e.target.outerHTML).hasClass('jq-selectbox__select')) {
248            return false;
249        }
250        if ($(".for-sellers").hasClass("active") || $(".desc_ad").length) {
251            $(".jq-selectbox__dropdown").css("display", "none");
252            e.stopPropagation();
253        }
254        if(!($(this).hasClass("for-sellers") && $(this).hasClass("active")) && !($(this).parents(".popup_for-sellers").length == 1)) {
255            $(".popup_for-sellers").removeClass("active"); /* _new_ */
256            $(".for-sellers").removeClass("active");
257        }
258    });
259    $(":not(.a_account_service)").on("click", function(e) {
260        if ($(this).hasClass('current_selected_region') || $(this).hasClass('open-lightbox')) {
261            return;
262        }
263        if ($(e.target.outerHTML).hasClass('jq-selectbox__select-text') || $(e.target.outerHTML).hasClass('jq-selectbox__select')) {
264            return false;
265        }
266        if ($(".account_service").hasClass("active") || $(".desc_ad").length) {
267            $(".jq-selectbox__dropdown").css("display", "none");
268            e.stopPropagation();
269        }
270        if(!($(this).hasClass("account_service") && $(this).hasClass("active")) && !($(this).parents(".popup-service").length == 1)) {
271            $(".popup-service").removeClass("active"); 
272            $(".account_service").removeClass("active");
273        }
274    });
275    /* _new_ */
276    $(":not(.a_closed-menu)").on("click", function(e) {   
277        if ($(this).hasClass('current_selected_region') || $(this).hasClass('open-lightbox')) {
278            return;
279        }
280        if ($(e.target.outerHTML).hasClass('jq-selectbox__select-text') || $(e.target.outerHTML).hasClass('jq-selectbox__select')) {
281            return false;
282        }
283        if ($(".closed-menu").hasClass("active") || $(".desc_ad").length) {
284            $(".jq-selectbox__dropdown").css("display", "none");
285            e.stopPropagation();
286        }
287        if(!($(this).hasClass("closed-menu") && $(this).hasClass("active")) && !($(this).parents(".popup_closed-menu").length == 1)) {
288            $(".popup_closed-menu").removeClass("active"); 
289            $(".closed-menu").removeClass("active");
290        }
291    });
292
293//    iFooterBanner();
294    setBrand();
295    hideBlk(".firm_desc");
296    hideBlk(".product_view > div");
297//    hideBlkProduct(".inner_product_desc");
298//    removeBorder(".banners > div");
299    removeBorder(".above_banner ul > li");
300    syncBlocks(".block_items.new .title_block_items", ".block_items .title_block_items");
301    syncBlocks(".block_items.new .list_block_items li", ".block_items .list_block_items li");
302    removeAddHeader(".details_product_desc", ".add_header");
303    removeAddHeader(".inner_product_desc", ".add_header");
304//    setWidth(".items li", ".desc_item", ".details_desc");
305    minHeightAbout();
306
307    // slider
308    //slider init
309  //slider init
310        if ($('.fancybox-thumbs').length != 0) {
311            $('.fancybox-thumbs').fancybox({
312                padding : [0, 0, 0, 0],
313                prevEffect : 'none',
314                nextEffect : 'none',
315
316                closeBtn  : true,
317                arrows    : true,
318                nextClick : true,
319
320                //loop: false,
321                helpers : {
322                    thumbs : {
323                        width  : 100,
324                        height : 75
325                    }
326                },
327                tpl: {
328                    next     : '<a class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a><a class="fancybox-nav fancybox-next custom-next" href="javascript:;"></a>',
329                    prev     : '<a class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a><a class="fancybox-nav fancybox-prev custom-prev" href="javascript:;"></a>'
330                },
331                 afterLoad: function(current, previous) {
332                    var index = current.index + 1;
333//                    var src = current.href;
334//                    $(".preview > img").attr("src", src);
335//                    previewSize($(".preview > img"), current.width, current.height, 350, 263);
336//                    $(".preview > ul .zoom.active").removeClass("active");
337//                    $(".preview > ul li:nth-child("+index+") .zoom").addClass("active");
338
339                     $(".preview > ul .zoom.active").removeClass("active");
340                     $(".preview > ul li:nth-child("+index+") .zoom").addClass("active");
341                     previewSize($(".zoom.active img"), current.width, current.height, 350, 263);
342
343                     var height = $(".zoom.active img").height();
344                     var width = $(".zoom.active img").width();
345                     centerPreview(height, width);
346                 },
347                beforeShow: function () {
348                    sliderSize($(".fancybox-image"), this.width, this.height, 800, 600);
349                } 
350            });
351
352            initSlider();
353    }
354    $(".list_previews > li:not(.preview)").on("click", function () {
355        var img = $(this).find("img");
356        var src = img.attr("src");
357        var id = img.attr("id");
358//        $(".preview > img").attr("src", src);
359        $(".preview > ul .zoom.active").removeClass("active");
360        $(".preview > ul").find(".zoom[id='"+id+"']").addClass("active");
361        var elem = $(".zoom.active img");
362		
363		
364
365		
366		//if(w > 0 && h == 0) {
367	     //h = 263; 
368	    //}
369		
370        previewSize(elem, img[0].naturalWidth, img[0].naturalHeight, 350, 263);
371
372        var height = elem.height();
373        var width = elem.width();
374        centerPreview(height, width);
375    })
376
377/*    $(".btn_contact, .btn_contact span").on("click", function () {
378        var li = $(this).parents("li");
379        if (!li.hasClass("active")) {
380            $(".items li").removeClass("active");
381            li.addClass("active");
382            $(".desc_item").removeClass("active");
383            $(".desc_ad").removeClass("active");
384            $(this).parents(".desc_item").addClass("active");
385            li.find(".desc_ad").addClass("active");
386        }
387    });
388    $(":not(.btn_contact, .btn_contact span, .desc_ad, .desc_ad "+'*'+")").on("click", function (e) {
389       if ($(this).hasClass('current_selected_region') || $(this).hasClass('open-lightbox')) {
390           return;
391       }
392       if ($(".search").hasClass("active") || $(".desc_ad").length) {
393            e.stopPropagation();
394        }
395        $(".items li").removeClass("active");
396        $(".desc_item").removeClass("active");
397        $(".desc_ad").removeClass("active");
398    })
399    $(".btncontact, .btncontact span").on("click", function (e) {
400       if ($(".search").hasClass("active") || $(".desc_ad").length) {
401            e.stopPropagation();
402        }
403        $(".items li").removeClass("active");
404        $(".desc_item").removeClass("active");
405        $(".desc_ad").removeClass("active");
406        resizeTitle();
407    })*/
408
409    /*resizeBanner();*/
410    isAndroid();
411    categoryList();
412    //resizeTitle();
413    centerBanner(".banner_bottom1");
414    hideList();
415    isList();
416	
417
418	
419$('.javalnk').click(function(){
420    if($(this).attr("rel").slice(0, 4) == "http")
421        var location=$(this).attr("rel");
422    else 
423        var location='/'+$(this).attr("rel");
424    if($(this).hasClass('blank'))
425        window.open(location,'_blank');
426    else
427        window.location.href=location;
428});	
429})
430
431$(window).resize(function(){
432//    iFooterBanner();
433    centerBanner(".banner_bottom1");
434//    resizeBanner();
435    categoryList();
436    hideList();
437    //resizeTitle();
438//    hideBlkProduct(".inner_product_desc");
439    syncBlocks(".block_items.new .title_block_items", ".block_items .title_block_items");
440    syncBlocks(".block_items.new .list_block_items li", ".block_items .list_block_items li");
441//    setWidth(".items li", ".desc_item", ".details_desc");
442    minHeightAbout();
443    activePresentation();
444})
445
446function detectOutdatedBrowser(){
447    outdatedBrowser({
448        bgColor: '#f25648',
449        color: '#ffffff',
450        lowerThan: 'transform' // 'IE9'
451    });
452}
453/*function changeSize( page, data, delta) {
454    switch (page) {
455        case "main_content ru":
456            // var mainBottom =
457            $(".main_content.ru").css("padding-bottom", data[0] + "px");
458            $(".main_content .banners.ru").css("bottom", data[1] + "px");
459            $(".above_banner").css("bottom", data[2]+data[1] + "px");
460            break;
461        case "rub_content":
462        case "rub_content all_rubrics":
463            var rubContent = data[0] + delta;
464            var rubListingItem = data[1] + delta/3;
465            var rubWidth = rubContent/3;
466            var reviewList = data[3] + delta/3;
467            $(".rubricator").width(rubContent);
468            if ($("section.container > div").hasClass("all_rubrics")) {
469                $(".rub_listing li a").width(rubListingItem);
470                resizeRubricator(rubWidth);
471            }
472            $(".info_reviews .pagination").css("margin-right", data[2] +"px");
473            $(".review_listing li").css("margin-right", reviewList +"px");
474
475            break;
476        case "content":
477            var listItems = data[0] + delta;
478            var padd = data[1] + delta;
479            var listBlockItems = data[2] + delta/2;
480            var deal_left = data[3] + delta/2;
481            var deal_right = data[4] + delta/2;
482            var product = data[5] + delta;
483            var adServicesProduct = data[6] + delta;
484            var descItem = data[7] + delta;
485            var dealerCard = data[8] + delta;
486            var boardCard = data[9] + delta;
487            $(".list_items").width(listItems);
488            $(".advanced.item").css("padding-right", padd + "px");
489            $(".block_items").width(listBlockItems);
490            $(".deal_details_desc").css("max-width", deal_left + "px");
491            $(".deal_details_desc_count").css("max-width", deal_right + "px");
492            $(".product_desc").width(product);
493            $(".ad_services .product_desc").width(adServicesProduct);
494            $(".desc_item").width(descItem);
495            $(".product.dealer_card").width(dealerCard);
496            $(".product.board_services").width(boardCard);
497            break;
498    }
499}*/
500/*
501function resizeBanner () {
502    var width = $(".banners").outerWidth();
503    var maxWidth = 300;
504    var minWidth = 240;
505    var screenWidth = window.innerWidth;
506    var page = $("section.container > div").attr("class");
507    var width1 = $(".banner").outerWidth()
508    if (page == "content" &&  width1 == 240) {
509        $(".banners").width(width1);
510        width = width1;
511    }
512    var delta = maxWidth - width;
513    switch (page) {
514        case "main_content ru":
515            // [listing]
516            var bannA = $(".above_banner li:first-child").height() + $(".above_banner li:last-child").height();
517            var bannAAll = bannA + $(".above_banner li:nth-child(2)").height();
518            var bannB = $(".banners.ru div:first-child").height() + 20;
519            var bannBAll = 0;
520            for (var l=1; l <= $(".banners.ru div").length; l++) {
521                bannBAll = bannBAll + $(".banners.ru div:nth-child("+l+")").height() + 20;
522            }
523            var correctBlk1 = 50;
524            var correctBlk2 = 70;
525            if ($('section.container[data-brand]').length == 1) {
526                correctBlk1 = correctBlk1 + 180;
527                correctBlk2 = correctBlk2 + 180;
528            }
529            var allPaddMain = bannA + bannB + correctBlk1;
530            var allPaddMainMin = bannAAll + bannBAll + correctBlk2;
531            var bannBBott = 160;
532
533            var data_1280 = [0, 0, 0];
534            var data_1024 = [0, 0, 0];
535            var data_960 = [allPaddMain, bannBBott, bannB];
536            var data_690 = [allPaddMainMin, bannBBott, bannBAll];
537            if(screenWidth > 1024) {
538                $(".main_content.ru").css("padding-bottom", "0px");
539            }
540            if(screenWidth > 690 && screenWidth <= 1024){
541                changeSize(page, data_960, 0)
542            }
543            if(screenWidth < 690) {
544                changeSize(page, data_690, 0);
545            }
546            break;
547        case "content":
548            // [item, padding, listBlock, paddingLeft(Used|New), paddingRight(Used|New), (.product_desc) (.ad_services .product_desc), (.product.dealer_card), (.product.board_services)]
549            var data_1280 = [684, 419, 334, 288, 249, 503, 883, 444, 903, 901];
550            var data_1024 = [424, 158, 206, 158, 119, 257, 627, 185, 647, 642];
551            var data_960 = data_1024;
552
553            break;
554        case "rub_content":
555        case "rub_content all_rubrics":
556            // [.rubricator, .rub_listing li a, (.info_reviews .pagination), (.review_listing li)]
557            var data_1280 = [916, 285, 20, 20];
558            var data_1024 = [660, 190, 32, 10];
559            var data_960 = [647, 190, 0, 10];
560            var data_690 = [424, 190, 0, 6];
561            break;
562    }
563    if (width < maxWidth && width >= minWidth) {
564        if(screenWidth >= 1280 ){
565            changeSize(page, data_1280, delta)
566        }
567        if(screenWidth > 1024 && screenWidth < 1280 ){
568            changeSize(page, data_1024, delta)
569        }
570        if(screenWidth > 690 && screenWidth <= 1024){
571            changeSize(page, data_960, 0)
572        }
573        if(screenWidth < 690) {
574            if (data_690) {changeSize(page, data_690, 0);}
575            rubListing(screenWidth);
576        }
577    } else {
578        rubListing(screenWidth);
579    }
580
581}
582*/
583
584function isAndroid() {
585    var is_mobile = /mobile|android/i.test (navigator.userAgent);
586    if (is_mobile) {
587        $(".add_nav").css("top", "7px");
588    }
589}
590function categoryList () {
591    var firstList = $($(".category_list")[0]).find("li");
592    var secondList = $($(".category_list")[1]).find("li");
593
594    for (var k = 0; k < firstList.length; k++) {
595        var height1 = $(firstList[k]).height();
596        var height2 = $(secondList[k]).height();
597        if ( height1 >= height2) {
598            $(secondList[k]).height(height1);
599        } else {
600            $(firstList[k]).height(height2);
601        }
602    }
603}
604function hideList () {
605    var elem = $("[data-class=fading_block]");
606    if (elem.length > 0) {
607        var baseHeight = $(elem)[0].scrollHeight + 10;
608        var totalHeight = 100;
609        var isOpen = $("[data-class=fading_block] span").hasClass("open_list");
610        if (isOpen === true) {
611            var parent = $(".open_list").parents("[data-class=fading_block]");
612            var baseHeight = parent[0].scrollHeight + 10;
613            var height;
614            switch(parent[0].id) {
615                case "list_product_desc":
616                    totalHeight = 115;
617                    height= perCent(115, baseHeight, 0.6);
618                    break;
619                case "firm_desc":
620                    totalHeight = 100;
621                    height=perCent(100, baseHeight, 0.6);
622                    break;
623                case "drop_filter":
624                    totalHeight = 24;
625                    height=perCent(24, baseHeight, 0.6);
626                    break;
627                default:
628                    break;
629            }
630            var status = changeVisibilityHideLine(parent, totalHeight, baseHeight);
631
632            $(parent).find("span").removeClass("open_list");
633            if (status) {
634                $(parent).animate({
635                    height: height}, 500);
636            }
637        } else {
638            changeVisibilityHideLine(elem, totalHeight, baseHeight);
639
640        }
641    }
642}
643function perCent (height, fullHeight, param) {
644    if (height/(fullHeight - 10) > param) {
645        return fullHeight*param + "px";
646    } else {
647        return height  + "px";
648    }
649}
650/*function rubListing (screenWidth) {
651    var isRubricator = $("section.container > div").hasClass("all_rubrics");
652    var width;
653    if (isRubricator && (screenWidth > 690)) {
654        width = $(".rubricator").width()/3;
655        resizeRubricator(width)
656    } else {
657        width = $(".rubricator").width()/2;
658        resizeRubricator(width)
659    }
660}
661function resizeRubricator (width) {
662    var isRubricator = $("section.container > div").hasClass("all_rubrics");
663    if (isRubricator){
664        $('.rub_listing').isotope({
665            itemSelector: '.rub_listing > ul',
666            masonry: {
667                columnWidth: width
668            }
669        });
670    }
671}*/
672function sliderSize (elem, w, h, wB, hB) {
673    var kElem = w/h;
674    var kBox = wB/hB;
675    if (kBox < kElem) {
676        elem.width(wB);
677        elem.height(wB/kElem);
678    } else {
679        elem.height(hB);
680        elem.width(kElem*hB);
681    }
682}
683function previewSize (elem, w, h, wB, hB) {
684	  
685	
686    var kElem = w/h;
687    var kBox = wB/hB;
688    if (kBox < kElem) {
689        if (w >
689 wB) {
690            elem.width(wB);
691            elem.height((wB*h)/w);
692        } else {
693            elem.height(h);
694            elem.width(w);
695        }
696    } else {
697        if (h > hB) {
698            elem.height(hB);
699            elem.width(kElem*hB);
700        } else {
701            elem.height(h);
702            elem.width(w);
703        }
704    }
705}
706
707/*function resizeTitle () {
708    var listItem = $(".items li");
709    for (var k = 0; k < listItem.length; k++) {
710        var price = $(listItem[k]).find(".price_item_desc").width();
711        var allWidth = $(listItem[k]).width() - 165;
712        var width = allWidth - price;
713        $(listItem[k]).find(".box_title").width(width)
714    }
715}*/
716
717function removeBorder (elem) {
718    var item_count = 0;
719    $.map($(elem), function(item, i){
720        if ($(item).contents().length == 0 || $(item).height() == 0) {
721            $($(elem)[i]).addClass("no-border");
722            item_count++;
723        }
724        if (item_count == $(elem).length) {
725            $(".add_bann_c").addClass("active")
726        }
727    })
728}
729
730function hideBlk (elem) {
731    if($.trim($(elem).text()) == "") {
732        $(elem).addClass("no-display")
733    }
734}
735
736function hideBlkProduct(elem) {
737    if ($(elem).height() < $(elem).parent().height()) {
738        $(".hide_line").addClass("no-display");
739        $(elem).parent().removeClass("fading");
740    } else {
741        $(".hide_line").removeClass("no-display");
742        $(elem).parent().addClass("fading");
743    }
744}
745
746function syncBlocks (elem, elemN) {
747    var element = [];
748    element[0] = $(elem).length >= $(elemN).length ? $(elemN) : $(elem);
749    element[1] = $(elem).length < $(elemN).length ? $(elemN) : $(elem);
750    $.map(element[0], function(item, i) {
751        $(item).css('height', 'inherit');
752        $(element[1][i]).css('height', 'inherit');
753        var height = $(item).height();
754        var heightN = $(element[1][i]).height();
755        if (height >= heightN) {
756            $(element[1][i]).height(height);
757        } else {
758            $(item).height(heightN);
759        }
760    })
761}
762
763function setWidth (parentList, outerElem, elem) {
764    $.map($(parentList), function (item, i) {
765        var width = $(item).find(outerElem).width() - 72;
766        $(item).find(elem).width(width);
767    })
768}
769
770function removeAddHeader (elem, header) {
771    if ($(".product_desc").find(elem).length == 1) {
772        if (!$(elem).height()) {
773            $(header).removeClass("active");
774        }
775    }
776}
777
778function setBrand () {
779    var elem = $('section.container[data-brand]');
780    if (elem.length) {
781        $('#wrapper').addClass('branding');
782    }
783}
784
785function centerBanner (elem) {
786    var width = $('section.container > div').width();
787    var widthBanner = $('section.container > div').hasClass('main_content') ? 0 : $(".banners").outerWidth() ;
788    var currWidth = width - widthBanner;
789    $(elem).width(currWidth);
790}
791
792function changeVisibilityHideLine (elem, totalHeight, baseHeight) {
793    if ((totalHeight + 35 - baseHeight) > 0) {
794        $(elem).removeClass("fading");
795        $(elem).removeClass("white_down");
796        $(elem).find("span").addClass('no-display');
797        return false;
798    } else {
799        $(elem).addClass("fading");
800        $(elem).addClass("white_down");
801        $(elem).find("span").removeClass("no-display");
802        return true;
803    }
804}
805
806function initSlider () {
807    $(".preview > ul .zoom.active").removeClass("active");
808    $(".preview > ul li:first-child .zoom").addClass("active");
809    var elem = $(".preview .zoom.active img")
810    var height = elem[0].naturalHeight ? elem[0].naturalHeight : elem.height();
811    var width = elem[0].naturalWidth ? elem[0].naturalWidth : elem.width();
812	
813	// temp
814	if(height == 0) {
815		var real_h = $("#i_height").val();
816		var real_w = $("#i_width").val();
817		if(real_h > 0 && real_h < 280) {
818			height = real_h;
819			width = real_w;   
820		} 
821		else {
822		 height = 263;
823 //alert(2); 		 
824		}
825		//alert($("#idimg_1").height());
826		 //if(width > 300) { 
827		  //height = 262; 
828		 //}
829		 //else {
830		  //height = width - 20; 
831		 //}  		 
832	} 
833	
834    previewSize(elem, width, height, 350, 263);
835    centerPreview(elem.height(), elem.width());
836}
837
838function centerPreview (height, width) {
839    $(".preview > ul .zoom.active").height(height);
840    if (height < 263) {
841        $(".preview > ul .zoom.active").width(width);
842    } else {
843        $(".preview > ul .zoom.active").width(350);
844    }
845}
846
847function isList () {
848    var elem = $('.proposal_used');
849    var img = $("#company_logo");
850    if (elem.length != 0) {
851        if (img.height() > 58) {
852            var pbtm = img.height() - 28;
853            $(".contact_firm").css('padding-bottom', pbtm);
854        }
855        if (elem.find('li').length == 0) {
856            //$(".proposal_firm").addClass('no-display');
857        }
858
859    }
860
861}
862
863function hideSecondBanner() {
864    if ($(".banner:first-child").height() > 800) {
865        $(".second_banner").addClass('no-display')
866    }
867}
868
869function minHeightAbout () {
870    var height = $(".about_page_right").height() - 20;
871    $(".about_page_center").css('min-height', height + "px")
872}
873
874function activePresentation () {
875    var presentation = $(".about_page_center .presentation");
876    if (!!presentation.length) {
877        $(".about_page_center").addClass("active");
878    }
879}
880
881/*function iFooterBanner () { 
882    var elem = $(".footer-banner");
883    var elemOut = $("section.container")
884    if ((elem.length != 0) && (elemOut.length != 0)) {
885        var marBtm = 20 + elem.height();
886        var padBtm = 20 + $("footer.footer").height();
887        elemOut.css("margin-bottom", marBtm + "px");
888        elemOut.css("padding-bottom",  padBtm + "px");
889    } else {
890        elem.addClass("hidden")
891    }
892}*/
893
894    function checkDataFilterForm() { 
895	 		 var selected_category = $("#choose_category").find('option:selected').val();
896			 if(selected_category < 1) {
897			  $('#brd_select').find('.category-select').addClass("bold_border");
898			  
899			  var heightWind = $(window).scrollTop();  
900              
901			  if(heightWind > 215) {
902			   $('html, body').animate({
903                scrollTop: $("#top_select_category").offset().top
904               }, 200);
905              }			   
906              return false;
907			  
908             }
909             else
910			  return true;	 
911	}
912	
913	
914	
915	
916	
917	
918	
919	
920/* ################################# OLD */
921
922$(function(){
923	setTimeout(initPopups, 500);
924	initAjaxTarget();
925	
926	$("#labelused").bind( "click", function() { 
927	 $("#group_used").attr("style", " ");
928	 $("#group_used1").attr("style", " ");
929    }); 
930	
931	$("#labelnew").bind( "click", function() {		
932	 $("#group_used").attr("style", "display:none");
933	 $("#group_used1").attr("style", "display:none");
934    }); 
935	
936	$("#choose_category").change(function(){ 
937	    //$('#brd_select').find('.jq-selectbox__select').removeClass("bold_border");
938		$('.category-select').removeClass("bold_border");  		   
939		
940        var element = $(this).find('option:selected'); 
941        var catDir = element.attr("catDir"); 
942		var cid = element.val();
943        if(cid > 0) 
944		 $('.category-select').removeClass("choose");
945	    else
946		 $('.category-select').addClass("choose");
947        var catalog_vector = element.attr("catalog_vector");
948        var catalog_level = element.attr("catalog_level");		
949        $('#category_dir').val(catDir);
950		
951		//alert(catalog_level); 
952
953		if(cid > 0)   
954         getMarks(cid, "used", catalog_vector, catalog_level);         
955		
956    }); 
957 	
958	
959	//$("#brd_select").attr("style", "border: 1px solid red;");
960    //$('.choice > .jq-selectbox__select').css('border', '1px solid red'); 	
961	
962}); 
963
964function getMarks(cid, typeads, catalog_vector, catalog_level) {
965 			$.ajax({  
966				type: "POST",	// Тип запроса   
967				url: "/ajax/get_marks.php",	// Путь к сценарию, обработающему запрос  
968				dataType: "json",	// Тип данных, в которых сервер должен прислать ответ
969				data: "cid=1&type_id=" + typeads + "&catalog_vector=" + catalog_vector + "&catalog_level=" + catalog_level ,	// Строка POST-запроса 
970				error: function () {	// Обработчик, который будет запущен в случае неудачного запроса
971					alert( "При выполнении запроса произошла ошибка :(" );	// Сообщение о неудачном запросе
972				},
973				success: function ( data ) { // Обработчик, который будет запущен после успешного запроса
974                   $("#make_select option").remove(); 
975                    
976                    $('#make_select').append($('<option>', {
977						value: '',
978						text: 'Выбрать'
979					})); 					
980
981					for ( var i = 0; i < data.length; i++ ) {
982						// Каждое полученное значение вставим в список 
983						$('#make_select').append($('<option>', {
984							value: data[i].client_dir, 
985							text: data[i].client_shortname
986						})); 						
987					}  
988					// После того, как мы сформировали список, мы можем сделать его активным
989					// обратившись к его свойству disabled
990					$('#make_select' ).prop( 'disabled', false );	// Включаем поле
991					$('#make_select').trigger('refresh'); // обновляем  
992				}
993			});	
994}
995
996function initAjaxTarget(){ 
997	// getting links rel
998	$('.lightbox a').not('.btn-close').not('.active').click(function(){
999		if($(this).attr('rel')){
1000			var ajaxTarget = $(this).attr('rel');
1001			$.ajax({
1002			  url: '/ajax/regions/get_town_of_region.php?rid='+ajaxTarget,
1003			  async: false, 
1004			  success: function(data) {
1005                $("#towns_of_region").html(data);
1006                $(".region-name").html($("#aj_selected_region").html());			
1007			  }
1008			});
1009			
1010			console.log('ajaxTarget = '+ajaxTarget);
1011		}
1012		//return false;  // OFF
1013	});
1014	// preventing click on active link
1015	$('.lightbox a.active').click(function(){
1016		//return false; // OFF 14:49
1017	});
1018}
1019
1020
1021// popups function
1022function initPopups() {
1023	var _zIndex = 1000;
1024	var _fadeSpeed = 350;
1025	var _faderOpacity = 0.88;
1026	var _faderBackground = '#466789';
1027	var _faderId = 'lightbox-overlay';
1028	var _closeLink = 'a.btn-close, .btn-choose';
1029	var _fader;
1030	var _lightbox = null;
1031	var _openers = jQuery('a.open-lightbox');
1032	var _page = jQuery(document);
1033	var _minWidth = jQuery('body > div:eq(0)').outerWidth();
1034	var _scroll = false;
1035
1036	// init popup fader
1037	_fader = jQuery('#'+_faderId);
1038	if(!_fader.length) {
1039		_fader = jQuery('<div />');
1040		_fader.attr('id',_faderId);
1041		jQuery('body').append(_fader);
1042	}
1043	_fader.css({
1044		opacity:_faderOpacity,
1045		backgroundColor:_faderBackground,
1046		position:'absolute',
1047		overflow:'hidden',
1048		display:'none',
1049		top:0,
1050		left:0,
1051		zIndex:_zIndex
1052	});
1053
1054	// IE6 iframe fix
1055	if(jQuery.browser.msie && jQuery.browser.version < 7) {
1056		if(!_fader.children().length) {
1057			var _frame = jQuery('<iframe src="javascript:false" frameborder="0" scrolling="no" />');
1058			_frame.css({
1059				opacity:0,
1060				width:'100%',
1061				height:'100%'
1062			});
1063			var _frameOverlay = jQuery('<div>');
1064			_frameOverlay.css({
1065				top:0,
1066				left:0,
1067				zIndex:1,
1068				opacity:0,
1069				background:'#000',
1070				position:'absolute',
1071				width:'100%',
1072				height:'100%'
1073			});
1074			_fader.empty().append(_frame).append(_frameOverlay);
1075		}
1076	}
1077
1078	// lightbox positioning function
1079	function positionLightbox() {
1080		if(_lightbox) {
1081			var _windowHeight = jQuery(window).height();
1082			var _windowWidth = jQuery(window).width();
1083			var _lightboxWidth = _lightbox.outerWidth();
1084			var _lightboxHeight = _lightbox.outerHeight();
1085			var _pageHeight = _page.height();
1086			
1087			_fader.css('width', jQuery("body").width());
1088			if (_windowHeight < _pageHeight) _fader.css('height',_pageHeight);
1089				else _fader.css('height',_windowHeight);
1090
1091			_lightbox.css({
1092				position:'absolute',
1093				zIndex:(_zIndex+1)
1094			});
1095
1096			// vertical position
1097			if (_windowHeight > _lightboxHeight) {
1098				if (jQuery.browser.msie && jQuery.browser.version < 7) {
1099					_lightbox.css({
1100						position:'absolute',
1101						top: parseInt(jQuery(window).scrollTop()) + (_windowHeight - _lightboxHeight) / 2
1102					});
1103				} else {
1104					_lightbox.css({
1105						position:'fixed',
1106						top: (_windowHeight - _lightboxHeight) / 2
1107					});
1108				}
1109			} else {
1110				var _faderHeight = _fader.height();
1111				if(_faderHeight < _lightboxHeight) _fader.css('height',_lightboxHeight);
1112				if (!_scroll) {
1113					if (_faderHeight - _lightboxHeight > parseInt(jQuery(window).scrollTop())) {
1114						_faderHeight = parseInt(jQuery(window).scrollTop())
1115						_scroll = _faderHeight;
1116					} else {
1117						_scroll = _faderHeight - _lightboxHeight;
1118					}
1119				}
1120				_lightbox.css({
1121					position:'absolute',
1122					top: _scroll
1123				});
1124			}
1125
1126			// horizontal position
1127			if (_windowWidth > _lightbox.outerWidth()) _lightbox.css({left:(_windowWidth - _lightbox.outerWidth()) / 2});
1128			else _lightbox.css({left: 0});
1129		}
1130	}
1131
1132	// show/hide lightbox
1133	function toggleState(_state) {
1134		if(!_lightbox) return;
1135		if(_state) {
1136			if(jQuery.browser.msie && jQuery.browser.version == 7) {
1137				_lightbox.show();
1138			}
1139			_fader.fadeIn(_fadeSpeed,function(){
1140				_lightbox.fadeIn(_fadeSpeed);
1141			});
1142			_scroll = false;
1143			positionLightbox();
1144		} else {
1145			if(jQuery.browser.msie && jQuery.browser.version == 7) {
1146				_lightbox.hide();
1147			}
1148			_lightbox.fadeOut(_fadeSpeed,function(){
1149				_fader.fadeOut(_fadeSpeed);
1150				_scroll = false;
1151			});
1152		}
1153	}
1154
1155	// popup actions
1156	function initPopupActions(_obj) {
1157		if(!_obj.get(0).jsInit) {
1158			_obj.get(0).jsInit = true;
1159			// close link
1160			_obj.find(_closeLink).click(function(){
1161				_lightbox = _obj;
1162				toggleState(false);
1163				return false;
1164			});
1165		}
1166	}
1167
1168	// lightbox openers
1169	_openers.each(function(){
1170		var _opener = jQuery(this);
1171		var _target = _opener.attr('href');
1172		var _reg = new RegExp(/\#[^\s]+/gi);
1173
1174		// popup load type - ajax or static
1175		if(!_reg.test(_target)) {
1176			_opener.click(function(){
1177			 
1178				// ajax load
1179				if(jQuery('div[rel*="'+_target+'"]').length == 0) {
1180				
1181					jQuery.ajax({
1182						url: _target,
1183						type: "POST",
1184						dataType: "html",
1185						success: function(msg){
1186							// append loaded popup
1187							_lightbox = jQuery(msg);
1188							_lightbox.find('img').load(positionLightbox)
1189							_lightbox.attr('rel',_target).hide().css({
1190								position:'absolute',
1191								zIndex:(_zIndex+1),
1192								top: -9999,
1193								left: -9999
1194							});
1195							jQuery('body').append(_lightbox);
1196
1197							// init js for lightbox
1198							initPopupActions(_lightbox);
1199
1200							// show lightbox
1201							toggleState(true);
1202						},
1203						error: function(msg){
1204							alert('AJAX error!');
1205							return false;
1206						}
1207					});
1208				} else {
1209					_lightbox = jQuery('div[rel*="'+_target+'"]');
1210					toggleState(true);
1211				}
1212				return false;
1213			});
1214		} else {
1215			if(jQuery(_target).length) {
1216				// init actions for popup
1217				var _popup = jQuery(_target);
1218				initPopupActions(_popup);
1219				_popup.hide();
1220					// open popup
1221					_opener.click(function(){
1222					if(_lightbox) {
1223						_lightbox.fadeOut(_fadeSpeed,function(){
1224							_lightbox = _popup.hide();
1225							toggleState(true);
1226						})
1227					} else {
1228						_lightbox = _popup.hide();
1229						toggleState(true);
1230					}
1231					return false;
1232				});
1233			}
1234		}
1235	});
1236
1237	// event handlers
1238	jQuery(window).resize(positionLightbox);
1239	jQuery(window).scroll(positionLightbox);
1240	jQuery(document).keydown(function (e) {
1241		if (!e) evt = window.event;
1242		if (e.keyCode == 27) {
1243			toggleState(false);
1244		}
1245	})
1246	_fader.click(function(){
1247		if(!_fader.is(':animated')) toggleState(false);
1248		return false;
1249	})
1250}
1251
1252
1253
1254/*
1255$(document).ready(function() {
1256          setTimeout("$('.tooltip').animate({left:'-3px'},500)", 3000);  
1257        });
1258$(window).scroll(function(){
1259			
1260getscroll();
1261if (yScroll > 180)
1262{$('.tooltip').css('position','fixed').css('top' , '10px')} else
1263{$('.tooltip').css('position','absolute').css('top','')}
1264
1265});
1266function getscroll(){
1267if (self.pageYOffset){
1268yScroll = self.pageYOffset;
1269xScroll = self.pageXOffset;
1270} else if (document.documentElement && document.documentElement.scrollTop){
1271yScroll = document.documentElement.scrollTop;
1272xScroll = document.documentElement.scrollLeft;
1273} else if (document.body){
1274yScroll = document.body.scrollTop;
1275xScroll = document.body.scrollLeft;
1276}
1277};
1278*/
1279	$('a.tooltip_close, a.tooltip_close1').bind('click', function(){  
1280		$('.tooltip').animate({left:'-523px'},500);
1281		$('.tooltip').hide();  
1282		return false;
1283	});
1284	
1285	
1286	
1287	$('a.close-tooltip').live('click', function(){
1288		$('.tooltip').hide();
1289		return false;
1290	});
1291	
1292	$('a.tooltip_close1').live('click', function(){
1293		$('.tooltip').animate({left:'-523px'},500);
1294		return false;
1295	});
1296	
1297 
1298
1299$( document ).ready(function() { 
1300  $(".btn_text").bind("click", function(e){
1301
1302	// cразу и мобильный показываем
1303    $("#btn_text_1").attr("style", "display:none;");
1304    $("#btn_phone_1").attr("style", " "); 	
1305	var ofid = $("#ofid").html(); 
1306	if(ofid) {  
1307	 $("#btn_text_"+ofid).attr("style", "display:none;");
1308     $("#btn_phone_"+ofid).attr("style", " "); 	
1309	}
1310	  
1311    $(".btn_text").attr("style", "display:none;");
1312    $(".btn_phone").attr("style", " ");
1313	var user_id=$(".btn_phone").attr("user_id");
1314	var type=$(".btn_phone").attr("type");
1315	var id=$(".btn_phone").attr("ads_id");
1316	//alert(id);  
1317    if(user_id > 0) {   
1318	  $.ajax({  
1319	  type: "GET",
1320	  cache: false,
1321	  url: "/scripts/cl.php?id="+id+"&type="+type+"&user_id="+user_id+"&ads_type=contactview"
1322	  }); 	
1323	}	 
1324  }); 
1325});
1326
1327/* To Top scrolling */
1328(function($){
1329	$.fn.UItoTop = function(options) {
1330
1331 		var defaults = {
1332    			text: 'To Top',
1333    			min: 200,
1334    			inDelay:600,
1335    			outDelay:400,
1336      			containerID: 'toTop',
1337    			containerHoverID: 'toTopHover',
1338    			scrollSpeed: 1200,
1339    			easingType: 'linear'
1340 		    },
1341            settings = $.extend(defaults, options),
1342            containerIDhash = '#' + settings.containerID,
1343            containerHoverIDHash = '#'+settings.containerHoverID;
1344		
1345		$('body').append('<a href="#" id="'+settings.containerID+'">'+settings.text+'</a>');
1346		$(containerIDhash).hide().on('click.UItoTop',function(){
1347			$('html, body').animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
1348			$('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType);
1349			return false;
1350		})
1351		.prepend('<span id="'+settings.containerHoverID+'"></span>')
1352		.hover(function() {
1353				$(containerHoverIDHash, this).stop().animate({
1354					'opacity': 1
1355				}, 600, 'linear');
1356			}, function() { 
1357				$(containerHoverIDHash, this).stop().animate({
1358					'opacity': 0
1359				}, 700, 'linear');
1360			});
1361					
1362		$(window).scroll(function() {
1363			var sd = $(window).scrollTop();
1364			if(typeof document.body.style.maxHeight === "undefined") {
1365				$(containerIDhash).css({
1366					'position': 'absolute',
1367					'top': sd + $(window).height() - 50
1368				});
1369			}
1370			if ( sd > settings.min ) 
1371				$(containerIDhash).fadeIn(settings.inDelay);
1372			else 
1373				$(containerIDhash).fadeOut(settings.Outdelay);
1374		});
1375};
1376})(jQuery); 
1377
1378
1379jQuery.extend( jQuery.easing,
1380{
1381	easeInQuad: function (x, t, b, c, d) {
1382		return c*(t/=d)*t + b;
1383	},
1384	easeOutQuad: function (x, t, b, c, d) {
1385		return -c *(t/=d)*(t-2) + b;
1386	},
1387	easeInOutQuad: function (x, t, b, c, d) {
1388		if ((t/=d/2) < 1) return c/2*t*t + b;
1389		return -c/2 * ((--t)*(t-2) - 1) + b;
1390	},
1391	easeInCubic: function (x, t, b, c, d) {
1392		return c*(t/=d)*t*t + b;
1393	},
1394	easeOutCubic: function (x, t, b, c, d) {
1395		return c*((t=t/d-1)*t*t + 1) + b;
1396	},
1397	easeInOutCubic: function (x, t, b, c, d) {
1398		if ((t/=d/2) < 1) return c/2*t*t*t + b;
1399		return c/2*((t-=2)*t*t + 2) + b;
1400	},
1401	easeInQuart: function (x, t, b, c, d) {
1402		return c*(t/=d)*t*t*t + b;
1403	},
1404	easeOutQuart: function (x, t, b, c, d) {
1405		return -c * ((t=t/d-1)*t*t*t - 1) + b;
1406	},
1407	easeInOutQuart: function (x, t, b, c, d) {
1408		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
1409		return -c/2 * ((t-=2)*t*t*t - 2) + b;
1410	},
1411	easeInQuint: function (x, t, b, c, d) {
1412		return c*(t/=d)*t*t*t*t + b;
1413	},
1414	easeOutQuint: function (x, t, b, c, d) {
1415		return c*((t=t/d-1)*t*t*t*t + 1) + b;
1416	},
1417	easeInOutQuint: function (x, t, b, c, d) {
1418		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
1419		return c/2*((t-=2)*t*t*t*t + 2) + b;
1420	},
1421	easeInSine: function (x, t, b, c, d) {
1422		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
1423	},
1424	easeOutSine: function (x, t, b, c, d) {
1425		return c * Math.sin(t/d * (Math.PI/2)) + b;
1426	},
1427	easeInOutSine: function (x, t, b, c, d) {
1428		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
1429	},
1430	easeInExpo: function (x, t, b, c, d) {
1431		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
1432	},
1433	easeOutExpo: function (x, t, b, c, d) {
1434		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
1435	},
1436	easeInOutExpo: function (x, t, b, c, d) {
1437		if (t==0) return b;
1438		if (t==d) return b+c;
1439		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
1440		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
1441	},
1442	easeInCirc: function (x, t, b, c, d) {
1443		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
1444	},
1445	easeOutCirc: function (x, t, b, c, d) {
1446		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
1447	},
1448	easeInOutCirc: function (x, t, b, c, d) {
1449		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
1450		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
1451	},
1452	easeInElastic: function (x, t, b, c, d) {
1453		var s=1.70158;var p=0;var a=c;
1454		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
1455		if (a < Math.abs(c)) { a=c; var s=p/4; }
1456		else var s = p/(2*Math.PI) * Math.asin (c/a);
1457		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
1458	},
1459	easeOutElastic: function (x, t, b, c, d) {
1460		var s=1.70158;var p=0;var a=c;
1461		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
1462		if (a < Math.abs(c)) { a=c; var s=p/4; }
1463		else var s = p/(2*Math.PI) * Math.asin (c/a);
1464		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
1465	},
1466	easeInOutElastic: function (x, t, b, c, d) {
1467		var s=1.70158;var p=0;var a=c;
1468		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
1469		if (a < Math.abs(c)) { a=c; var s=p/4; }
1470		else var s = p/(2*Math.PI) * Math.asin (c/a);
1471		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
1472		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
1473	},
1474	easeInBack: function (x, t, b, c, d, s) {
1475		if (s == undefined) s = 1.70158;
1476		return c*(t/=d)*t*((s+1)*t - s) + b;
1477	},
1478	easeOutBack: function (x, t, b, c, d, s) {
1479		if (s == undefined) s = 1.70158;
1480		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
1481	},
1482	easeInOutBack: function (x, t, b, c, d, s) {
1483		if (s == undefined) s = 1.70158; 
1484		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
1485		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
1486	},
1487	easeInBounce: function (x, t, b, c, d) {
1488		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
1489	},
1490	easeOutBounce: function (x, t, b, c, d) {
1491		if ((t/=d) < (1/2.75)) {
1492			return c*(7.5625*t*t) + b;
1493		} else if (t < (2/2.75)) {
1494			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
1495		} else if (t < (2.5/2.75)) {
1496			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
1497		} else {
1498			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
1499		}
1500	},
1501	easeInOutBounce: function (x, t, b, c, d) {
1502		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
1503		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
1504	}
1505});
1506
1507function getTownsOfRegion(id) {  
1508 	    $("#clicklightbox2").click(); 	
1509	         $(".region-name").html($("#aj_selected_region").html()); 
1510 			var ajaxTarget = id;
1511			$.ajax({ 
1512			  url: '/ajax/regions/get_town_of_region.php?rid='+ajaxTarget,
1513			  async: false, 
1514			  success: function(data) {
1515                $("#towns_of_region").html(data);
1516                $(".region-name").html($("#aj_selected_region").html());			
1517			  }
1518			});
1519}
1520
1521	function viewall(v) {
1522	 if(v == 1) { 
1523	  $("#view_also_data").attr("style", " ");
1524	  $("#view_also").html(" ");
1525     }
1526     else { 
1527	  $("#view_also_data").attr("style", "display:none;");
1528	  $("#view_also").html("показать еще");	
1529	 }	 
1530	} 
1531	
1532$(document).ready(function(){
1533	$( "#req__region" ).find(".jq-selectbox__select").bind( "click", function() {   
1534
1535				$.ajax({ 
1536				url: '/ajax/get_countries.php',
1537				type: "POST",
1538				async: true,  
1539				dataType: "json", 
1540				beforeSend: function(){
1541					$("#list_country_load2").html('<img src="/images/gif-load2.gif" />')					
1542				}, 
1543				success: function(data){ 
1544				 $("#list_country_load2").empty();  	
1545				 $.each(data, function(key, val) {				 				
1546                  $( '#country' ).append( '<option  value="' + key + '">' + val + '</option>' );					  			  
1547                 }); 	  							
1548                 $( '#country' ).trigger('refresh');
1549				}				
1550				}); 
1551			
1552}); 	 
1553});
1554
1555$( ".current_selected_region, .tooltip_not_my_region" ).bind( "click", function() {  
1556$.ajax({     
1557 url: '/ajax/regions/get_regions.php', 
1558 async: true, 
1559 success: function(data) { 
1560 $("#block_abc").html(data);				
1561 } 
1562}); 
1563});
1564
1565
1566$(document).ready(function(){  
1567$( ".jq-selectbox__select" ).click(function( event ) {
1568  			   
1569              var vect = $("#mvector").html();
1570			  var ptype = $("#mptype").html();
1571			  var mbrand = $("#mbrand").html();
1572			  var msdata = $("#msdata").html();
1573			  var curbrand = "";
1574		  
1575			  if(vect && msdata != "1") {    
1576				  
1577	  $( "#make_select" ).attr("disabled", "disabled"); 
1578	  $( '#make_select' ).trigger('refresh');
1579
1580	  $( "#make_select" ).removeAttr("disabled");  				  
1581	  $( '#make_select' ).trigger('refresh');
1582			   
1583			   	$.ajax({ 
1584				url: '/ajax/marks_of_category.php?vect='+vect+'&ptype='+ptype+'&brand='+mbrand,
1585				type: "POST",
1586				async: true,  
1587				dataType: "json", 
1588				beforeSend: function(){
1589					$("#sel_marks_load2").html('<img src="/images/gif-load.gif" />')					
1590				}, 
1591				success: function(data){
1592					
1593				 $("#sel_marks_load2").empty();    
1594				 $.each(data, function(key, val) {   
1595                  				
1596                 x = 0; 				 
1597				 $.each(val, function(key2, val2) {  
1598                    if(x == 0) {
1599					 /*$( '#make_select' ).append( '<option value="">Выбрать</option>' );*/ 
1600					}
1601                    if(curbrand && val2 == curbrand)   
1602					 sel = 'selected="selected"';
1603                    else 
1604                     sel = '';	 				
1605                    $( '#make_select' ).append( '<option '+sel+' value="' + key2 + '">' + val2 + '</option>' );
1606                    x++;					
1607                 }); 				  
1608				 $( '#make_select' ).trigger('refresh'); 
1609				 $("#msdata").html("1");  
1610                 $( "#marks_select_block").find(".jq-selectbox__dropdown").attr('style', 'position: absolute; width: 275px; display: block; height: auto; bottom: auto; top: 27px;');  
1611                       	 			 
1612                });   
1613				
1614				   
1615				} 
1616			});
1617			
1618              } 
1619			 
1620});
1621
1622$( "#view_also" ).click(function( event ) {
1623	
1624	var vect = $("#mvector").html();
1625	var ptype = $("#mptype").html();
1626	var mbrand = $("#mbrand").html();
1627	var klevel = $("#klevel").html();
1628    if(vect) { 
1629			   	$.ajax({ 
1630				url: '/ajax/get_marks_category.php?vect='+vect+'&ptype='+ptype+'&brand='+mbrand+'&klevel='+klevel,
1631				type: "POST",   
1632				dataType: "html",  
1633				beforeSend: function(){
1634					$("#list_marks_load2").html('<img src="/images/gif-load.gif" />')					
1635				}, 
1636				success: function(data){ 					
1637				 $("#list_marks_load2").empty();
1638                 $("#view_also").html(data);   				 
1639				} 
1640			});
1641	}
1642	
1643});
1644 	
1645}); 
1646
1647
1648	  
1649
1650 function getmdata(mask, type) {  	 
1651			$.ajax({ 
1652			  url: '/ajax/get_marks_category.php?mask='+mask+'&type='+type,
1653			  async: false,  
1654			  success: function(data) { 
1655                /*$("#towns_of_region").html(data);*/			
1656			  }
1657			});  
1658 }
1659
1660 function getudata(mid, type, cl, bcl) { 
1661			   	$.ajax({ 
1662				url: '/ajax/get_users_of_marks.php?mid='+mid+'&type='+type,
1663				type: "POST",   
1664				dataType: "html",  
1665				beforeSend: function(){  
1666					$("#list_user_"+bcl+"2").html('<img src="/images/gif-load2.gif" />')					
1667				}, 
1668				success: function(data){ 					
1669				 $("#list_user_"+bcl+"2").empty();
1670                 $("#"+cl).html(data);      				 
1671				}   
1672			});  
1673 }
1674 
1675
1676

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.