PageSourceSearch

https://ezestate.net/wp-content/themes/wpresidence/js/control.js?ver=1.0

js ezestate.net collected 2026-10-08 03:29:28 UTC 126,681 bytes, 3,376 lines download raw bytes

1/*global $,Modernizr, jQuery, ajaxcalls_vars,wpestate_custom_search_start_filtering_ajax,imagesLoaded,wpestate_restart_js_after_ajax, panorama,wpestate_toggleStreetView,wpestate_start_filtering_ajax,map,google,wpestate_new_open_close_map,document,initialGeop,placeCircle,wpestate_custom_search_start_filtering_ajax,first_time_wpestate_show_inpage_ajax_half,wpestate_show_pins, wpestate_load_stats,wpestate_enable_half_map_pin_action,wpestate_change_map_type,wpestate_load_stats_tabs,control_vars,mapfunctions_vars, wpestate_map_shortcode_function,grecaptcha,window*/
2var width,height;
3width   = jQuery(window).width();
4height  = jQuery(window).height();
5var scroll_trigger  =   0;
6
7
8
9jQuery(window).scroll(function () {
10    "use strict";
11    
12  
13    
14    var scroll = jQuery(window).scrollTop();
15    if(control_vars.stiky_search==='yes'){
16        wpestate_adv_search_sticky(scroll);
17    }else{
18        wpestate_header_sticky(scroll);
19    }
20  
21    if (scroll >= control_vars.scroll_trigger) {
22        jQuery('.contact-box').addClass('islive');
23        jQuery('.backtop').addClass('islive');
24    }else{
25        jQuery('.contact-box ').removeClass('islive');
26        jQuery('.backtop').removeClass('islive');
27        jQuery('.contactformwrapper').addClass('hidden');
28    }
29    jQuery('.contact_close_button').on( 'click', function(event) {
30        event.preventDefault();  
31        jQuery('.contactformwrapper').addClass('hidden');
32    });
33
34});
35
36
37
38function wpestate_adv_search_sticky(scroll){
39  
40    "use strict";
41    if(scroll>20 ){
42        if( jQuery('.has_header_type4').length <= 0){
43            jQuery(".master_header").hide();
44        }else{
45            jQuery('.top_bar_wrapper').hide();
46        }
47    }else{
48        jQuery(".master_header,.top_bar_wrapper").show(); 
49    }
50
51    if( wpestate_isScrolledIntoView(scroll) && scroll_trigger===0 ){
52        jQuery('#search_wrapper').addClass('sticky_adv');
53    }
54    
55    if( scroll_trigger !==0 ){
56        if(scroll < scroll_trigger  ){
57            jQuery('#search_wrapper').removeClass('sticky_adv').removeClass('sticky_adv_anime');
58        }else{
59            jQuery('#search_wrapper').addClass('sticky_adv');
60        }
61        
62        if(scroll > scroll_trigger -20 ){
63            jQuery('#search_wrapper').addClass('sticky_adv_anime');
64        }
65    }
66}
67
68function wpestate_isScrolledIntoView(scroll){
69    "use strict";
70    if(jQuery('#search_wrapper').length>0){
71        var elemTop     =   parseInt(   jQuery('#search_wrapper').offset().top );
72        var elemHeight  =   parseInt(   jQuery('#search_wrapper').height() );
73        elemHeight  =0;
74
75        if( (elemTop+elemHeight+3)<scroll){
76            return true;
77        }else{
78            if(scroll_trigger===0){
79                scroll_trigger=elemTop+elemHeight+30;
80            }
81            return false;
82        }
83    }
84  
85}
86
87function isScrolledIntoView(elem){
88    "use strict";
89    var docViewTop = jQuery(window).scrollTop();
90    var docViewBottom = docViewTop + jQuery(window).height();
91
92    var elemTop = jQuery(elem).offset().top;
93    var elemBottom = elemTop + jQuery(elem).height();
94    return ((elemBottom <= docViewBottom) && (elemTop >= docViewTop));
95}
96
97
98
99
100
101function wpestate_header_sticky(scroll){
102    "use strict";
103    var switch_logo;
104    if (scroll >= control_vars.scroll_trigger) {
105        if (!Modernizr.mq('only all and (max-width: 1023px)')) {
106            
107            jQuery(".master_header").addClass("master_header_sticky");
108            jQuery('.logo').addClass('miclogo');
109                switch_logo = jQuery('.header_wrapper_inside').attr('data-sticky-logo');
110            if(jQuery('.header5_top_row').length > 0){
111                switch_logo = jQuery('.header5_top_row').attr('data-sticky-logo');
112            }
113           
114            if(wpestate_isRetinaDisplay()){
115                switch_logo=wpestate_get_custom_retina_pin(switch_logo);
116            }
117           
118            if( switch_logo!=='' ){
119                jQuery('#logo_image').attr('src',switch_logo);
120            }
121          
122            if( !jQuery(".header_wrapper").hasClass('header_type4') ){
123                jQuery(".header_wrapper").addClass("navbar-fixed-top");
124                jQuery(".header_wrapper").addClass("customnav");
125            }
126            jQuery('.barlogo').show();
127            jQuery('#user_menu_open').hide();
128            jQuery('.navicon-button').removeClass('opensvg');
129            jQuery('#wpestate_header_shoping_cart').hide();
130        }
131   
132    } else {
133        jQuery(".master_header").removeClass("master_header_sticky");
134        jQuery(".header_wrapper").removeClass("navbar-fixed-top");
135        jQuery(".header_wrapper").removeClass("customnav");
136     
137        jQuery('.barlogo').hide();
138        jQuery('#user_menu_open').hide();
139        jQuery('#wpestate_header_shoping_cart').hide();
140        jQuery('.logo').removeClass('miclogo');
141        
142        switch_logo = jQuery('.header_wrapper_inside').attr('data-sticky-logo');
143        if(jQuery('.header5_top_row').length > 0){
144            switch_logo = jQuery('.header5_top_row').attr('data-sticky-logo');
145        }
146        
147      
148          
149        if( switch_logo!=='' ){
150            switch_logo = jQuery('.header_wrapper_inside').attr('data-logo');
151            if(jQuery('.header5_top_row').length > 0){
152                switch_logo = jQuery('.header5_top_row').attr('data-logo');
153            }
154         
155              
156            if(wpestate_isRetinaDisplay()){
157                switch_logo=wpestate_get_custom_retina_pin(switch_logo);
158            }
159            jQuery('#logo_image').attr('src',switch_logo);
160        }
161    }
162}
163
164
165
166
167
168
169function wpestate_isRetinaDisplay() {
170    "use strict";
171    if (window.matchMedia) {
172        var mq = window.matchMedia("only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 2.6/2), only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen  and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 1.3dppx)");
173        return (mq && mq.matches || (window.devicePixelRatio >
173 1)); 
174    }
175}
176
177
178jQuery(window).resize(function() {
179    "use strict";    
180    if(jQuery(window).width() != width ){
181        jQuery('#mobile_menu').hide('10');
182    }
183    wpestate_half_map_responsive();
184
185});
186
187
188function wpestate_half_map_responsive(){
189    if (Modernizr.mq('only screen and (min-width: 640px)') && Modernizr.mq('only screen and (max-width: 1025px)')) {
190        var half_map_header = jQuery('.master_header ').height();
191    }
192    
193}
194
195
196
197
198
199
200
201Number.prototype.format = function(n, x) {
202    var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\.' : '$') + ')';
203    return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&'+control_vars.price_separator);
204};
205
206function wpestate_element_hide(item){
207    "use strict";
208    jQuery(document).on( 'click', function(event) {
209        if (!jQuery(item).is(event.target) && jQuery(item).has(event.target).length === 0 ){
210            jQuery('#results').fadeOut();
211
212        }
213    });
214} 
215wpestate_element_hide('.search_wrapper'); 
216    
217function wpestate_lazy_load_carousel_property_unit(){
218    "use strict";
219    jQuery('.property_unit_carousel img').each(function(event){
220          var new_source='';
221          new_source=jQuery(this).attr('data-lazy-load-src');
222          if(typeof (new_source)!=='undefined' && new_source!==''){
223              jQuery(this).attr('src',new_source);
224          }
225      });
226}
227 //recaptha
228    
229    
230var widgetId1,widgetId2,widgetId3,widgetId4;
231 var wpestate_onloadCallback = function() {
232
233    // Renders the HTML element with id 'example1' as a reCAPTCHA widget.
234    // The id of the reCAPTCHA widget is assigned to 'widgetId1'.
235
236    if(  document.getElementById('top_register_menu') ){
237        widgetId1 = grecaptcha.render('top_register_menu', {
238            'sitekey' : control_vars.captchakey,
239            'theme' : 'light'
240        });
241    }
242
243    if(  document.getElementById('mobile_register_menu') ){
244        widgetId2 = grecaptcha.render('mobile_register_menu', {
245            'sitekey' : control_vars.captchakey,
246            'theme' : 'light'
247        });
248    }
249
250
251    if(  document.getElementById('widget_register_menu') ){
252        widgetId3 = grecaptcha.render('widget_register_menu', {
253            'sitekey' : control_vars.captchakey,
254            'theme' : 'light'
255        });
256    }
257
258    if(  document.getElementById('shortcode_register_menu') ){
259        widgetId4 = grecaptcha.render('shortcode_register_menu', {
260            'sitekey' : control_vars.captchakey,
261            'theme' : 'light'
262        });
263    }
264
265};
266   
267
268jQuery(document).ready(function ($) {
269    "use strict";
270 
271    if(jQuery('.wpestate_anime').length>0 ){
272        jQuery('.wpestate_anime').each( function(){
273            var element_id = $(this).attr('id');
274            wpestate_anime('#'+element_id);
275            wpestate_property_list_sh('#'+element_id+' .wpestate_item_list_sh', '#'+element_id+' .control_tax_sh');
276        });
277          
278    }
279   
280   
281    if(jQuery('#googleMap_shortcode').length>0 ){
282         
283        if(  jQuery(".single-estate_property").length==0 ){
284            wpestate_map_shortcode_function();
285        }else{ 
286            if(  jQuery("#googleMap").length==0 &&  jQuery("#googleMapSlider").length==0 ){
287            // wpestate_map_shortcode_function(); 
288            }
289        }        
290    }
291   
292 
293    $('body').on('click', '.add_custom_parameter', function(){
294        var cloned = $('.cliche_row').clone();
295        cloned.removeClass('cliche_row');
296
297
298        $('input', cloned).val();
299        $('.add_custom_data_cont').append( cloned );
300    });	
301
302    $('body').on('click', '.remove_parameter_button', function(){
303        var pnt = $(this).parents( '.single_parameter_row' );
304        pnt.fadeOut(500, function(){
305                pnt.replaceWith('');
306        });
307    });
308 	
309        
310        
311    wpestate_enable_stripe_booking_prop();
312  
313    if(control_vars.sticky_footer==='yes'){
314        var footer_height=jQuery('#colophon').height();
315        jQuery('.container.main_wrapper').css('margin-bottom',footer_height);
316    }
317    
318    if( jQuery('.with_search_on_start').length>0 && 
319        jQuery('.with_search_form_float').length<=0   && 
320        Modernizr.mq('only screen and (min-width: 1023px)')  
321    ){
322        var header_media_pad = jQuery('.master_header  ').height(); 
323        jQuery('.search_wrapper').css('margin-top',header_media_pad+"px"); 
324        jQuery('.header_media').css('padding-top',"0px");
325    }
326	
327    var screen_width,screen_height,map_tab;
328    
329    $.datepicker.setDefaults( $.datepicker.regional[control_vars.datepick_lang] );
330
331    estate_start_lightbox();
332    estate_start_lightbox_floorplans();
333    estate_sidebar_slider_carousel();
334    estate_splash_slider();
335    var new_height;
336    if ($(".full_screen_yes").length) {
337      
338        if( jQuery('.header_transparent').length > 0){
339            new_height = jQuery( window ).height();
340        }else{
341            new_height = jQuery( window ).height() - jQuery('.master_header').height();
342        }
343        
344        if( $('.with_search_on_start').length>0 ){
345            new_height=new_height- jQuery('.search_wrapper.with_search_on_start ').height();
346        }
347        
348        jQuery('.wpestate_header_image,.wpestate_header_video,.theme_slider_wrapper,.theme_slider_classic,.theme_slider_wrapper .item_type2 ').css('height',new_height);
349    }
350    
351    
352    var handler_top;
353    $('.adv_handler').on( 'click', function(event) {
354        event.preventDefault();
355        
356        var check_row=$('.adv_search_hidden_fields');
357        
358        
359        if($('#search_wrapper').hasClass('with_search_form_float')){
360            if( !$('#search_wrapper').hasClass('openmore') ){
361                check_row.css('display','block');
362                var height = check_row.height();
363                handler_top = parseInt ( $('#search_wrapper').css('top'));
364                var top = parseInt ( $('#search_wrapper').css('top'))-height;
365
366                check_row.css('display','none');
367
368                $('#search_wrapper').animate({
369                    'top':top
370                }, { duration: 200, queue: false });
371                $('.adv_search_hidden_fields').slideDown( { duration: 200, queue: false });
372                $('#search_wrapper').addClass('openmore');
373            }else{
374
375                $('#search_wrapper').animate({
376                    'top':handler_top
377                }, { duration: 200, queue: false });
378                $('.adv_search_hidden_fields').slideUp ({ duration: 200, queue: false });
379                $('#search_wrapper').removeClass('openmore');
380            }
381        }else{
382            
383           $('.adv_search_hidden_fields').slideToggle();
384        } 
385     
386      
387        
388    });
389    
390    
391    
392    jQuery('.wp-block-residence-gutenberg-block-testimonial-slider').each(function(){
393      
394       if( jQuery(this).find('.type_class_3 ').length>0 ){
395           jQuery(this).addClass('container_type_3');
396       }
397        
398    })
399    
400    
401    
402    
403    
404    
405    jQuery('#preview_view_all').on( 'click', function(event) {
406      
407        if( (mapfunctions_vars.adv_search_type==='6' || mapfunctions_vars.adv_search_type==='7' || mapfunctions_vars.adv_search_type==='8' || mapfunctions_vars.adv_search_type==='9' ) ){
408        
409            jQuery('.search_wrapper .tab-pane.active .wpresidence_button').trigger('click');
410        }else{
411            jQuery('.search_wrapper .wpresidence_button').trigger('click');
412        }
413    });
414    
415    $('#open_packages').on( 'click', function(event) {
416        $('.pack_description_row').slideToggle();
417        $('.pack-listing:first').find('.buypackage').trigger('click');
418    });
419    
420    $('.buy_package_sh a').on( 'click', function(event) {
421        if (parseInt(ajaxcalls_vars.userid, 10) === 0 ) {
422            event.preventDefault();
423            jQuery('#modal_login_wrapper').show(); 
424            jQuery('#loginpop').val('1');
425        }
426    });
427    
428    
429    $('.theme_slider_2 .prop_new_details ').on( 'click', function(event) {
430        var new_link;
431        new_link =  $(this).attr('data-href');
432        window.open (new_link,'_self',false);
433    });    
434
435    $('.theme_slider_classic').on( 'click', function(event) {
436        
437       if (event.target == this)  {
438            var new_link;
439            new_link =  $(this).attr('data-href');
440            window.open (new_link,'_self',false);
441        }
442    });
443 
444    
445        
446//    $('.property_listing').matchHeight();
447    setTimeout(function() {   wpresidence_list_view_arrange(); }, 300);    
448   
449    ////////// adv serach 6
450    $('.adv6_tab_head').on( 'click', function(event) {
451        var tab_controls;
452        $('.adv_search_tab_item').removeClass('active');
453        $(this).parent().addClass('active');      
454        tab_controls = $(this).attr('aria-controls');
455        $('.adv6_price_low').removeClass('price_active');
456        $('.adv6_price_max').removeClass('price_active');
457         
458        $('#'+tab_controls).find('.adv6_price_low').addClass('price_active');  
459        $('#'+tab_controls).find('.adv6_price_max').addClass('price_active');
460        
461    });
462    
463    
464    
465    var mega_menu_width;
466    if( $('.header_wrapper').hasClass('header_type2')  ){
467        mega_menu_width=$('.header_wrapper_inside').width()-90;
468        $('#access ul li.with-megamenu>ul.sub-menu, #access ul li.with-megamenu:hover>ul.sub-menu').css('width',mega_menu_width+'px');
469    }
470      
471    if(  $('.header_wrapper').hasClass('header_type5') ){
472        mega_menu_width=$('.header5_top_row').width();
473        $('#access ul li.with-megamenu>ul.sub-menu, #access ul li.with-megamenu:hover>ul.sub-menu').css('width',mega_menu_width+'px').css('max-width','1024px');
474    }
475      
476      
477   ////////// header type 3
478
479      
480    ////////// map shortcode
481    map_tab=0;
482    $('#propmaptrigger').on( 'click', function(event) {
483        if(map_tab===0){
484           
485            wpestate_map_shortcode_function();
486            map_tab=1;
487            
488        }
489    });
490    
491 
492    
493    $('.testimonial-slider-container').each(function(){
494        var items   = parseInt( $(this).attr('data-visible-items'));
495        var auto    = parseInt(  $(this).attr('data-auto') );
496        
497        if (auto === 0 ){
498        
499            $(this).slick({
500                infinite: true,
501                slidesToShow: items,
502                slidesToScroll: 1,
503                dots: true,
504       
505                responsive: [
506                    {
507                     breakpoint:1025,
508                     settings: {
509                       slidesToShow: 1,
510                       slidesToScroll: 1
511                     }
512                   },
513                    {
514                      breakpoint: 480,
515                      settings: {
516                        slidesToShow: 1,
517                        slidesToScroll: 1
518                      }
519                    }
520                ]
521            });
522            if(control_vars.is_rtl==='1'){
523                  $(this).slick('slickSetOption','rtl',true,true);
524            }
525        }else{
526            
527            $(this).slick({
528                infinite: true,
529                slidesToShow: items,
530                slidesToScroll: 1,
531                dots: true,
532                autoplay: true,
533                autoplaySpeed: auto,
534          
535                 responsive: [
536                    {
537                     breakpoint:1025,
538                     settings: {
539                       slidesToShow: 1,
540                       slidesToScroll: 1
541                     }
542                   },
543                    {
544                      breakpoint: 480,
545                      settings: {
546                        slidesToShow: 1,
547                        slidesToScroll: 1
548                      }
549                    }
550                ]
551            });
552            if(control_vars.is_rtl==='1'){
553                  $(this).slick('slickSetOption','rtl',true,true);
554            }
555        }
556    });
557
558
559    $('.theme_slider_2,.property_multi_image_slider').each(function(){
560        var items   = 3;
561        var auto    = parseInt(  $(this).attr('data-auto') );
562        
563        if (auto === 0 ){
564        
565            $(this).slick({
566                infinite: true,
567                slidesToShow: items,
568                slidesToScroll: 1,
569                dots: true,
570             
571                responsive: [
572                    {
573                     breakpoint:1025,
574                     settings: {
575                       slidesToShow: 2,
576                       slidesToScroll: 1
577                     }
578                   },
579                    {
580                      breakpoint: 480,
581                      settings: {
582                        slidesToShow: 1,
583                        slidesToScroll: 1
584                      }
585                    }
586                ]
587            });
588            if(control_vars.is_rtl==='1'){
589                  $(this).slick('slickSetOption','rtl',true,true);
590            }
591            
592        }else{
593            
594            $(this).slick({
595                infinite: true,
596                slidesToShow: items,
597                slidesToScroll: 1,
598                dots: true,
599                autoplay: true,
600                autoplaySpeed: auto,
601                
602                 responsive: [
603                    {
604                     breakpoint:1025,
605                     settings: {
606                       slidesToShow: 2,
607                       slidesToScroll: 1
608                     }
609                   },
610                    {
611                      breakpoint: 480,
612                      settings: {
613                        slidesToShow: 1,
614                        slidesToScroll: 1
615                      }
616                    }
617                ]
618            });
619            if(control_vars.is_rtl==='1'){
620                  $(this).slick('slickSetOption','rtl',true,true);
621            }
622        }
623    });
624    
625
626	
627	
628	
629
630	 
631    $('.shortcode_slider_list').each(function(){
632        var items   = $(this).attr('data-items-per-row');
633        var auto    = parseInt(  $(this).attr('data-auto') );
634        var slick;
635        if (auto === 0 ){
636       
637            slick=$(this).slick({
638                infinite: true,
639                slidesToShow: items,
640                slidesToScroll: 1,
641                dots: true,
642        
643                responsive: [
644                    {
645                     breakpoint:1025,
646                     settings: {
647                       slidesToShow: 2,
648                       slidesToScroll: 1
649                     }
650                   },
651                    {
652                      breakpoint: 480,
653                      settings: {
654                        slidesToShow: 1,
655                        slidesToScroll: 1
656                      }
657                    }
658                ]
659            });
660            if(control_vars.is_rtl==='1'){
661                $(this).slick('slickSetOption','rtl',true,true);
662            
663            }
664        }else{
665            
666            slick= $(this).slick({
667                infinite: true,
668                slidesToShow: items,
669                slidesToScroll: 1,
670                dots: true,
671                autoplay: true,
672                autoplaySpeed: auto,
673          
674                 responsive: [
675                    {
676                     breakpoint:1025,
677                     settings: {
678                       slidesToShow: 2,
679                       slidesToScroll: 1
680                     }
681                   },
682                    {
683                      breakpoint: 480,
684                      settings: {
685                        slidesToShow: 1,
686                        slidesToScroll: 1
687                      }
688                    }
689                ]
690            });
691            if(control_vars.is_rtl==='1'){
692                $(this).slick('slickSetOption','rtl',true,true);
693            }
694        }
695    });
696     
697     $('.slider_container').css('overflow','initial');
698  
699	////////////////////////////
700	// taxonomy slick slider
701	////////////////////////////
702	$('.estate_places_slider').each(function(){
703		var items   = $(this).attr('data-items-per-row');
704        var auto    = parseInt(  $(this).attr('data-auto') );
705        var slick;
706        if (auto === 0 ){
707       
708            slick=$(this).slick({
709                infinite: true,
710                slidesToShow: items,
711                slidesToScroll: 1,
712                dots: false,
713         
714                responsive: [
715                    {
716                     breakpoint:1025,
717                     settings: {
718                       slidesToShow: 2,
719                       slidesToScroll: 1
720                     }
721                   },
722                    {
723                      breakpoint: 480,
724                      settings: {
725                        slidesToShow: 1,
726                        slidesToScroll: 1
727                      }
728                    }
729                ]
730            });
731            if(control_vars.is_rtl==='1'){
732                  $(this).slick('slickSetOption','rtl',true,true);
733                  $(this).slick('slidesToScroll','-1');
734            }
735        }else{
736            
737            slick= $(this).slick({
738                infinite: true,
739                slidesToShow: items,
740                slidesToScroll: 1,
741                dots: false,
742                autoplay: true,
743                autoplaySpeed: auto,
744           
745                 responsive: [
746                    {
747                     breakpoint:1025,
748                     settings: {
749                       slidesToShow: 2,
750                       slidesToScroll: 1
751                     }
752                   },
753                    {
754                      breakpoint: 480,
755                      settings: {
756                        slidesToShow: 1,
757                        slidesToScroll: 1
758                      }
759                    }
760                ]
761            });
762            if(control_vars.is_rtl==='1'){
763                $(this).slick('slickSetOption','rtl',true,true);
764            }
765        }
766	});
767  
768    
769    $(window).on("load", function() {
770        wpestate_lazy_load_carousel_property_unit();
771    });
772
773    wpestate_half_map_responsive();
774  
775
776    $('.show_stats').on( 'click', function(event) {
777        event.preventDefault();
778        var parent,listing_id;
779        parent = $(this).parent().parent().parent();
780        listing_id = $(this).attr('data-listingid');
781        //$('.statistics_wrapper').slideUp();
782        
783        if( parent.find('.statistics_wrapper').hasClass('is_slide')  ){
784               parent.find('.statistics_wrapper').slideUp().removeClass('is_slide'); 
785        }else{
786            parent.find('.statistics_wrapper').slideDown().addClass('is_slide'); 
787            wpestate_load_stats(listing_id);
788        }
789        
790    
791
792   
793    });
794   
795     $('.tabs_stats,#1462452319500-8587db8d-e959,#1462968563400-b8613baa-7092').on( 'click', function(event) {
796       var parent,listing_id;
797       listing_id = $(this).attr('data-listingid');
798       if(typeof(listing_id)==='undefined'){
799           listing_id =  $('.estate_property_first_row').attr('data-prp-listingid');
800       }
801       
802    
803       wpestate_load_stats_tabs(listing_id);
804    });
805    
806  
807    
808    ////////////////////////////////////////////////////////////////////////////
809    //new retina script
810    ////////////////////////////////////////////////////////////////////////////
811        
812        $('.retina_ready').dense({
813            'ping'      : true,
814            'dimension' : 'preserve'
815        });
816        var image_unnit = $('<div data-1x="'+control_vars.path+'/css/css-images/unit.png" data-2x="'+control_vars.path+'/css/css-images/unit_2x.png" />').dense('getImageAttribute');
817        var image_unnit = $('<div data-1x="'+control_vars.path+'/css/css-images/unitshare.png" data-2x="'+control_vars.path+'/css/css-images/unitshare_2x.png" />').dense('getImageAttribute');
818        
819    ////////////////////////////////////////////////////////////////////////////
820    //invoice filters
821    ////////////////////////////////////////////////////////////////////////////
822     
823
824   $(function() {
825        jQuery("#invoice_start_date,#invoice_end_date").datepicker({
826            dateFormat : "yy-mm-dd",
827        }).datepicker('widget').wrap('<div class="ll-skin-melon"/>');
828    });
829    /* 
830    jQuery("#invoice_end_date").datepicker({
831        dateFormat : "yy-mm-dd",
832      
833    }, jQuery.datepicker.regional[control_vars.datepick_lang]).datepicker('widget').wrap('<div class="ll-skin-melon"/>');
834    
835    */
836    
837    $('#invoice_start_date, #invoice_end_date, #invoice_type ,#invoice_status ').on('change', function(){ 
838        wpestate_filter_invoices();
839    });
840   
841    ////////////////////////////////////////////////////////////////////////////
842    //new mobile menu 1.10 
843    ////////////////////////////////////////////////////////////////////////////
844
845    $('.all-elements').animate({
846            minHeight: 100+'%'
847    });
848    
849    $('.header-tip').addClass('hide-header-tip');
850    
851    var vc_size;
852    var var_parents=new Array();
853    var var_parents_back=new Array();
854    
855    
856    
857    $('.mobile-trigger').on( 'click', function(event) {
858        if(  $('#all_wrapper').hasClass('moved_mobile') ){
859            wpestate_close_mobile_menu();
860        }else{
861           
862           
863            $('#all_wrapper,#colophon').css('-webkit-transform','translate(266px, 0px)');
864            $('#all_wrapper,#colophon').css('-moz-transform','translate(266px, 0px)');
865            $('#all_wrapper,#colophon').css('-ms-transform','translate(266px, 0px)');
866            $('#all_wrapper,#colophon').css('-o-transform','translate(266px, 0px)');
867            $('.page-template-property_list_half #all_wrapper').css('height','100%');
868            $('#all_wrapper,#colophon').addClass('moved_mobile');
869            
870            $('.mobilewrapper-user').hide();
871            $('.mobilewrapper').show();
872            $('.mobilewrapper').css('-webkit-transform','translate(0px, 0px)'); 
873            $('.mobilewrapper').css('-moz-transform','translate(0px, 0px)');  
874            $('.mobilewrapper').css('-ms-transform','translate(0px, 0px)');  
875            $('.mobilewrapper').css(' -o-transform','translate(0px, 0px)');  
876            $('body').css('overflow-x','hidden');
877             
878        }
879    });
880     
881     
882    $('.mobile-trigger-user').on( 'click', function(event) {
883        if ($('#all_wrapper').hasClass('moved_mobile_user')) {
884            wpestate_close_mobile_user_menu();
885        } else {
886            $('#all_wrapper,#colophon').css('-webkit-transform', 'translate(-265px, 0px)');
887            $('#all_wrapper,#colophon').css('-moz-transform', 'translate(-265px, 0px)');
888            $('#all_wrapper,#colophon').css('-ms-transform', 'translate(-265px, 0px)');
889            $('#all_wrapper,#colophon').css('-o-transform', 'translate(-265px, 0px)');
890            $('.page-template-property_list_half #all_wrapper').css('height','100%');
891            $('#all_wrapper,#colophon').addClass('moved_mobile_user');
892          
893            $('.mobilewrapper-user').show();
894            $('.mobilewrapper').hide();
895            $('.mobilewrapper-user').css('-webkit-transform', 'translate(0px, 0px)');
896            $('.mobilewrapper-user').css('-moz-transform', 'translate(0px, 0px)');
897            $('.mobilewrapper-user').css('-ms-transform', 'translate(0px, 0px)');
898            $('.mobilewrapper-user').css(' -o-transform', 'translate(0px, 0px)');
899            
900            $('#compare_close').trigger('click');
901        }
902    });
903     
904    $('.mobilemenu-close-user').on( 'click', function(event) {
905        wpestate_close_mobile_user_menu();
906    });
907    
908    
909    $('.mobilemenu-close').on( 'click', function(event) {
910        wpestate_close_mobile_menu();        
911    });
912    
913    function wpestate_close_mobile_user_menu(){
914        $('#all_wrapper,#colophon').css('-webkit-transform', 'translate(0px, 0px)');
915        $('#all_wrappe,#colophonr').css('-moz-transform', 'translate(0px, 0px)');
916        $('#all_wrapper,#colophon').css('-ms-transform', 'translate(0px, 0px)');
917        $('#all_wrapper,#colophon').css('-o-transform', 'translate(0px, 0px)');
918        $('#all_wrapper,#colophon').removeClass('moved_mobile_user');
919        
920        setTimeout(function() {   $('#all_wrapper,#colophon').removeAttr('style'); }, 200);
921
922        $('.mobilewrapper-user').hide();
923        $('.mobilewrapper').hide();
924        $('.mobilewrapper-user').css('-webkit-transform', 'translate(265px, 0px)');
925        $('.mobilewrapper-user').css('-moz-transform', 'translate(265px, 0px)');
926        $('.mobilewrapper-user').css('-ms-transform', 'translate(265px, 0px)');
927        $('.mobilewrapper-user').css('-o-transform', 'translate(265px, 0px)');
928    }
929    
930    function wpestate_close_mobile_menu(){
931    
932          
933            
934        $('#all_wrapper,#colophon').css('-webkit-transform','translate(0px, 0px)');  
935        $('#all_wrapper,#colophon').css('-moz-transform','translate(0px, 0px)'); 
936        $('#all_wrapper,#colophon').css('-ms-transform','translate(0px, 0px)'); 
937        $('#all_wrapper,#colophon').css('-o-transform','translate(0px, 0px)'); 
938      
939        setTimeout(function() {   $('#all_wrapper,#colophon').removeAttr('style'); }, 200);
940        
941        $('#all_wrapper,#colophon').removeClass('moved_mobile');    
942        
943        $('.mobilewrapper').hide();
944        $('.mobilewrapper-user').hide();
945        $('.mobilewrapper').css('-webkit-transform','translate(-265px, 0px)'); 
946        $('.mobilewrapper').css('-moz-transform','translate(-265px, 0px)');
947        $('.mobilewrapper').css('-ms-transform','translate(-265px, 0px)');
948        $('.mobilewrapper').css('-o-transform','translate(-265px, 0px)');
949     
950       
951    }
952    
953    
954    $('#menu-main-menu li').on( 'click', function(event) {
955        event.stopPropagation();
956        var selected;
957        selected = $(this).find('.sub-menu:first');
958        selected.slideToggle();
959    });
960
961        
962    
963    ////////////////////////////////////////////////////////////////////////////
964    // multiple cur set cookige
965    ////////////////////////////////////////////////////////////////////////////
966    
967    $('.list_sidebar_currency li').on( 'click', function(event) {
968        var ajaxurl,data,pos,symbol,coef,curpos, pick;
969        data=$(this).attr('data-value');
970        pos=$(this).attr('data-pos');
971        symbol=$(this).attr('data-symbol');
972        coef=$(this).attr('data-coef');
973        curpos=$(this).attr('data-curpos');
974        
975		var parent_pointer = $(this).parents('.dropdown ');
976		pick = $(this).text();
977		$('.sidebar_filter_menu', parent_pointer).text(pick).append('<span class="caret caret_sidebar"></span>');
978				
979        ajaxurl     =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
980        var nonce = jQuery('#wpestate_change_currency').val();
981        jQuery.ajax({
982            type: 'POST',
983            url: ajaxurl,
984            data: {
985                'action'    :   'wpestate_set_cookie_multiple_curr',
986                'curr'      :   data,
987                'pos'       :   pos,
988                'symbol'    :   symbol,
989                'coef'      :   coef,
990                'curpos'    :   curpos,
991                'security'  :   nonce
992            },
993            success: function (data) {     
994         
995               location.reload();
996            },
997            error: function (errorThrown) {}
998        });//end ajax     
999        
1000    });
1001    
1002    
1003    ////////////////////////////////////////////////////////////////////////////
1004    // easure unit cookige
1005    ////////////////////////////////////////////////////////////////////////////
1006    
1007    $('.list_sidebar_measure_unit li').on( 'click', function(event) {
1008        var ajaxurl,value, pick;
1009        value = $(this).attr('data-value');
1010   
1011        var parent_pointer = $(this).parents('.dropdown ');
1012        pick = $(this).text();
1013        $('.sidebar_filter_menu', parent_pointer).text(pick).append('<span class="caret caret_sidebar"></span>');
1014        var nonce = jQuery('#wpestate_change_measure').val();
1015        ajaxurl     =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
1016        jQuery.ajax({
1017            type: 'POST',
1018            url: ajaxurl,
1019            data: {
1020                'action'    :   'wpestate_set_cookie_measure_unit',
1021                'value'     :   value,
1022                'security'  : nonce
1023            },
1024            success: function (data) {     
1025         
1026               location.reload();
1027            },
1028            error: function (errorThrown) {}
1029        });//end ajax     
1030        
1031    });
1032    
1033    
1034    
1035    
1036    ////////////////////////////////////////////////////////////////////////////
1037    // map control
1038    ////////////////////////////////////////////////////////////////////////////
1039    $('#map-view').on( 'click', function(event) {
1040        $('.map-type').fadeIn(400);
1041    });
1042    
1043    $('.map-type').on( 'click', function(event) {
1044        var map_type;
1045        $('.map-type').hide();
1046        map_type=$(this).attr('id');
1047        wpestate_change_map_type(map_type);
1048        
1049    });
1050
1051    ////////////////////////////////////////////////////////////////////////////
1052    // listing map actions
1053    ////////////////////////////////////////////////////////////////////////////
1054   
1055    if (typeof wpestate_enable_half_map_pin_action == 'function'){
1056
1057        wpestate_enable_half_map_pin_action();
1058    }
1059    ////////////////////////////////////////////////////////////////////////////
1060    /// direct pay
1061    ////////////////////////////////////////////////////////////////////////////
1062    
1063    $('.perpack').on( 'click', function(event) {
1064        var direct_pay_modal, selected_pack,selected_prop,include_feat,attr;
1065        selected_prop   =   $(this).attr('data-listing');
1066        
1067        var price_pack  =   $(this).parent().parent().find('.submit-price-total').text();
1068     
1069     
1070        if (control_vars.where_curency === 'after'){
1071            price_pack = price_pack +' '+control_vars.submission_curency;
1072        }else{
1073            price_pack = control_vars.submission_curency+' '+price_pack;
1074        }
1075        
1076        price_pack=control_vars.direct_price+': '+price_pack;
1077        
1078        
1079        include_feat=' data-include-feat="0" ';
1080        $('#send_direct_bill').attr('data-include-feat',0);
1081        $('#send_direct_bill').attr('data-listing',selected_prop);
1082         
1083        if ( $(this).parent().find('.extra_featured').attr('checked') ){
1084            include_feat=' data-include-feat="1" ';
1085            $('#send_direct_bill').attr('data-include-feat',1);
1086        }
1087
1088        attr = $(this).attr('data-isupgrade');
1089        if (typeof attr !== typeof undefined && attr !== false) {
1090            include_feat=' data-include-feat="1" ';
1091            $('#send_direct_bill').attr('data-include-feat',1);
1092        }
1093
1094
1095        window.scrollTo(0, 0);
1096        direct_pay_modal='<div class="modal fade" id="direct_pay_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">'+control_vars.direct_title+'</h4><div class="modal-body listing-submit"><span class="to_be_paid">'+price_pack+'</span><span>'+control_vars.direct_pay+'</span><div id="send_direct_bill" '+include_feat+' data-listing="'+selected_prop+'">'+control_vars.send_invoice+'</div></div></div></div></div></div>';
1097        jQuery('body').append(direct_pay_modal);
1098        jQuery('#direct_pay_modal').modal();
1099        wpestate_enable_direct_pay_perlisting();
1100        
1101          $('#direct_pay_modal').on('hidden.bs.modal', function (e) {
1102               $('#direct_pay_modal').remove();
1103        });
1104        
1105    });
1106    
1107    
1108    $('#direct_pay').on( 'click', function(event) {
1109        var direct_pay_modal, selected_pack,selected_prop,include_feat,attr, price_pack,packName;
1110
1111        packName = jQuery('.package_selected .pack-listing-title').text();
1112        selected_pack = jQuery('.package_selected .pack-listing-title').attr('data-packid');
1113        price_pack = jQuery('.package_selected .pack-listing-title').attr('data-packprice');
1114    
1115     
1116        if (control_vars.where_curency === 'after'){
1117            price_pack = price_pack +' '+control_vars.submission_curency;
1118        }else{
1119            price_pack = control_vars.submission_curency+' '+price_pack;
1120        }
1121        
1122        price_pack=control_vars.direct_price+': '+price_pack;
1123        
1124        if(selected_pack!==''){
1125            window.scrollTo(0, 0);
1126            direct_pay_modal='<div class="modal fade" id="direct_pay_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button><h4 class="modal-title">'+control_vars.direct_title+'</h4><div class="modal-body listing-submit"><span class="to_be_paid">'+price_pack+'</span><span>'+control_vars.direct_pay+'</span><div id="send_direct_bill" data-pack="'+selected_pack+'">'+control_vars.send_invoice+'</div></div></div></div></div></div>';
1127            jQuery('body').append(direct_pay_modal);
1128            jQuery('#direct_pay_modal').modal();
1129            wpestate_enable_direct_pay();
1130        }
1131        
1132        $('#direct_pay_modal').on('hidden.bs.modal', function (e) {
1133               $('#direct_pay_modal').remove();
1134        });
1135         
1136    });
1137        
1138        
1139     
1140        
1141    function  wpestate_enable_direct_pay_perlisting(){
1142      
1143        jQuery('#send_direct_bill').unbind('click');
1144        jQuery('#send_direct_bill').on( 'click', function(event) {
1145            jQuery('#send_direct_bill').unbind('click');
1146            var selected_pack,ajaxurl,include_feat;
1147           
1148            selected_pack   =   jQuery(this).attr('data-listing');
1149            include_feat    =   jQuery(this).attr('data-include-feat');
1150            ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
1151            
1152            var   nonce = jQuery('#wpresidence_simple_pay_actions_nonce').val(); 
1153            jQuery.ajax({
1154                type: 'POST',
1155                url: ajaxurl,
1156                data: {
1157                    'action'            :   'wpestate_direct_pay_pack_per_listing',
1158                    'selected_pack'     :   selected_pack,
1159                    'include_feat'      :   include_feat,
1160                    'security'          :   nonce,
1161                },
1162                success: function (data) {
1163                    jQuery('#send_direct_bill').hide();
1164                    jQuery('#direct_pay_modal .listing-submit span:nth-child(2)').empty().html(control_vars.direct_thx);
1165                },
1166                error: function (errorThrown) {}
1167            });//end ajax  
1168
1169        });
1170         
1171    }    
1172        
1173        
1174    function wpestate_enable_direct_pay(){
1175        jQuery('#send_direct_bill').on( 'click', function(event) {
1176            jQuery('#send_direct_bill').unbind('click');
1177            var selected_pack,ajaxurl;
1178            selected_pack=jQuery(this).attr('data-pack');
1179            ajaxurl     =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
1180            var   nonce = jQuery('#wpresidence_simple_pay_actions_nonce').val();
1181            jQuery.ajax({
1182                type: 'POST',
1183                url: ajaxurl,
1184                data: {
1185                    'action'            :   'wpestate_direct_pay_pack',
1186                    'selected_pack'     :   selected_pack,
1187                    'security'             :   nonce
1188                },
1189                success: function (data) {     
1190                    jQuery('#send_direct_bill').hide();
1191                    jQuery('#direct_pay_modal .listing-submit span:nth-child(2)').empty().html(control_vars.direct_thx);
1192                  
1193                },
1194                error: function (errorThrown) {}
1195            });//end ajax  
1196
1197 
1198    
1199    
1200        });
1201        
1202    }    
1203     
1204  
1205    
1206    ////////////////////////////////////////////////////////////////////////////
1207    /// stripe
1208    ////////////////////////////////////////////////////////////////////////////
1209    $('#pack_select').on('change', function(){ 
1210        var stripe_pack_id,stripe_ammount,the_pick;
1211        $( "#pack_select option:selected" ).each(function() {
1212            stripe_pack_id=$(this).val();
1213            stripe_ammount=parseFloat( $(this).attr('data-price'))*100;
1214            the_pick=$(this).attr('data-pick');
1215        });
1216    
1217        $('#pack_id').val(stripe_pack_id);
1218        $('#pay_ammout').val(stripe_ammount);
1219        $('#stripe_form').attr('data-amount',stripe_ammount);
1220        
1221        $('.stripe_buttons').each(function(){
1222            $(this).hide();
1223            if( $(this).attr('id') === the_pick){
1224                 $(this).show();
1225            }
1226        });
1227
1228    });
1229    
1230      $('#pack_recuring').on( 'click', function(event) {
1231        if( $(this).attr('checked') ) {
1232            $('#stripe_form').append('<input type="hidden" name="stripe_recuring" id="stripe_recuring" value="1">');
1233        }else{
1234            $('#stripe_recuring').remove();
1235        }
1236    });
1237    
1238    ////////////////////////////////////////////////////////////////////////////
1239    /// floor plans
1240    ////////////////////////////////////////////////////////////////////////////
1241    
1242    $('.front_plan_row').on( 'click', function(event) {
1243        event.preventDefault();
1244        $(this).parent().find('.front_plan_row_image').slideUp();        
1245        $(this).next().slideDown();
1246    });
1247
1248    $('.deleter_floor').on( 'click', function(event) {
1249        $(this).parent().remove();
1250    });
1251    // on submit
1252    
1253    
1254    
1255    
1256    
1257    
1258    
1259    
1260    
1261    
1262    
1263    
1264    
1265    ////////////////////////////////////////////////////////////////////////////
1266    /// slider price 
1267    ////////////////////////////////////////////////////////////////////////////
1268    
1269    var price_low_val= parseInt( $('#price_low').val() );
1270    var price_max_val= parseInt( $('#price_max').val() );
1271 
1272    function wpestate_getCookie(cname) {
1273       var name = cname + "=";
1274       var ca = document.cookie.split(';');
1275       for(var i=0; i<ca.length; i++) {
1276           var c = ca[i];
1277           while (c.charAt(0)==' ') c = c.substring(1);
1278           if (c.indexOf(name) == 0) return c.substring(name.length,c.length);
1279       }
1280       return "";
1281   }
1282
1283
1284 
1285    var my_custom_curr_symbol  =   decodeURI ( wpestate_getCookie('my_custom_curr_symbol') );
1286    var my_custom_curr_coef    =   parseFloat( wpestate_getCookie('my_custom_curr_coef'));
1287    var my_custom_curr_pos     =   parseFloat( wpestate_getCookie('my_custom_curr_pos'));
1288    var my_custom_curr_cur_post=   wpestate_getCookie('my_custom_curr_cur_post');
1289    var slider_counter = 0;
1290   
1291    wpestate_enable_slider('slider_price', 'price_low', 'price_max', 'amount', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef);
1292    $( "#slider_price" ).slider({
1293        stop: function( event, ui ) {
1294            if (typeof (wpestate_show_pins) !== "undefined") {   
1295                first_time_wpestate_show_inpage_ajax_half=1;
1296                wpestate_show_pins(); 
1297            }
1298        }
1299    });
1300    wpestate_enable_slider('slider_price_sh', 'price_low_sh', 'price_max_sh', 'amount_sh', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef); 
1301    wpestate_enable_slider('slider_price_widget', 'price_low_widget', 'price_max_widget', 'amount_wd', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef);
1302    wpestate_enable_slider('slider_price_mobile', 'price_low_mobile', 'price_max_mobile', 'amount_mobile', my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef);
1303
1304    wpestate_enable_slider_radius('wpestate_slider_radius',control_vars.min_geo_radius, control_vars.max_geo_radius, control_vars.initial_radius);
1305    
1306
1307    if(control_vars.adv6_taxonomy_term!==''){
1308        control_vars.adv6_taxonomy_term.forEach(wpestate_advtabs_function);
1309    }
1310    
1311    function wpestate_advtabs_function(item){
1312       wpestate_enable_slider_tab(control_vars.adv6_min_price[slider_counter],control_vars.adv6_max_price[slider_counter],'slider_price_'+item, 'price_low_'+item, 'price_max_'+item, 'amount_'+item, my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post,my_custom_curr_coef,control_vars.adv6_min_price[slider_counter],control_vars.adv6_max_price[slider_counter]);
1313       slider_counter++;
1314        $( '#slider_price_'+item ).slider({
1315            stop: function( event, ui ) {
1316                if (typeof (wpestate_show_pins) !== "undefined") {   
1317                    first_time_wpestate_show_inpage_ajax_half=1;
1318                    wpestate_show_pins(); 
1319                }
1320            }
1321        });
1322    }
1323   
1324   
1325   
1326   
1327   
1328   
1329    function wpestate_replace_plus(string){
1330        return string.replace("+"," ");
1331    }
1332  function wpestate_enable_slider_tab(slider_min,slider_max,slider_name, price_low, price_max, amount, my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post, my_custom_curr_coef) {
1333        "use strict";
1334        var price_low_val, price_max_val, temp_min, temp_max;
1335        price_low_val = parseInt(jQuery('#'+price_low).val(), 10);
1336        price_max_val = parseInt(jQuery('#'+price_max).val(), 10);
1337
1338  
1339        slider_min = parseInt(slider_min,10);
1340        slider_max = parseInt(slider_max,10);
1341        
1342        if (!isNaN(my_custom_curr_pos) && my_custom_curr_pos !== -1) {
1343            slider_min =slider_min *my_custom_curr_coef;
1344            slider_max =slider_max *my_custom_curr_coef;
1345        }
1346        
1347        jQuery("#" + slider_name).slider({
1348            range: true,
1349            min: parseFloat(slider_min),
1350            max: parseFloat(slider_max),
1351            values: [price_low_val, price_max_val ],
1352            slide: function (event, ui) {
1353
1354                if (!isNaN(my_custom_curr_pos) && my_custom_curr_pos !== -1) {
1355                    jQuery("#" + price_low).val(ui.values[0]);
1356                    jQuery("#" + price_max).val(ui.values[1]);
1357                    
1358                    jQuery("#price_low").val(ui.values[0]);
1359                    jQuery("#price_max").val(ui.values[1]);
1360                    
1361                    
1362                    temp_min= ui.values[0] ;
1363                    temp_max= ui.values[1];
1364
1365                    if (my_custom_curr_cur_post === 'before') {
1366                        jQuery("#" + amount).text( wpestate_replace_plus( decodeURIComponent ( my_custom_curr_symbol ) ) + " " + temp_min.format() + " " + control_vars.to + " " + wpestate_replace_plus ( decodeURIComponent ( my_custom_curr_symbol ) )+ " " + temp_max.format());
1367                    } else {
1368                        jQuery("#" + amount).text(temp_min.format() + " " + wpestate_replace_plus ( decodeURIComponent ( my_custom_curr_symbol ) )+ " " + control_vars.to + " " + temp_max.format() + " " + wpestate_replace_plus ( decodeURIComponent ( my_custom_curr_symbol ) ) );
1369                    }
1370                } else {
1371                    jQuery("#" + price_low).val(ui.values[0]);
1372                    jQuery("#" + price_max).val(ui.values[1]);
1373                     
1374                    jQuery("#price_low").val(ui.values[0]);
1375                    jQuery("#price_max").val(ui.values[1]);
1376
1377                    if (control_vars.where_curency === 'before') {
1378                        jQuery("#" + amount).text( wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) + " " + ui.values[0].format() + " " + control_vars.to + " " +  wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) + " " + ui.values[1].format());
1379                    } else {
1380                        jQuery("#" + amount).text(ui.values[0].format() + " " + wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) + " " + control_vars.to + " " + ui.values[1].format() + " " + wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) );
1381                    }
1382                }
1383            }
1384        });
1385    }
1386
1387
1388    function wpestate_enable_slider_radius(slider_name,low_val, max_val, now_val){
1389        
1390        if( jQuery("#" + slider_name).length > 0){
1391            jQuery("#" + slider_name).slider({
1392                range: true,
1393                min: parseFloat(low_val),
1394                max: parseFloat(max_val),
1395                value: parseFloat(now_val),
1396                range: "max",
1397                slide: function (event, ui) {
1398
1399                    jQuery("#geolocation_radius").val( ui.value);
1400                    jQuery('.radius_value').text(ui.value+" "+control_vars.geo_radius_measure); 
1401                   
1402                    
1403                },
1404                stop: function (event, ui) {
1405                    if(placeCircle!=''){
1406                        if(control_vars.geo_radius_measure==='miles'){
1407                            placeCircle.setRadius(ui.value*1609.34);
1408                        }else{
1409                            placeCircle.setRadius(ui.value*1000);
1410                        }
1411                        wpestate_show_pins();
1412                        
1413                    }
1414                }
1415            });
1416        }
1417        jQuery("#geolocation_search").on('change', function(){ 
1418  
1419            if( $(this).val()==='' ){
1420                jQuery('#geolocation_lat').val('');
1421                jQuery('#geolocation_long').val('');
1422                if(placeCircle!=''){
1423                    placeCircle.setMap(null);
1424                    placeCircle='';
1425                }
1426            }
1427        });
1428        
1429        
1430        if( jQuery("#geolocation_search").length > 0){
1431            var input, defaultBounds, autocomplete_normal;
1432            input = (document.getElementById('geolocation_search'));
1433            
1434
1435            
1436            if( parseInt( mapfunctions_vars.geolocation_type ) == 1 ){
1437                defaultBounds = new google.maps.LatLngBounds(
1438                    new google.maps.LatLng(-90, -180),
1439                    new google.maps.LatLng(90, 180)
1440                );
1441                var options = {
1442                    bounds: defaultBounds,
1443                    types: ['geocode'],
1444                   // types: ['(regions)'],
1445                };
1446
1447            
1448                autocomplete_normal = new google.maps.places.Autocomplete(input, options);
1449                google.maps.event.addListener(autocomplete_normal, 'place_changed', function () {
1450                    initialGeop=0;
1451                    var place = autocomplete_normal.getPlace();  
1452                    var place_lat = place.geometry.location.lat();
1453                    var place_lng = place.geometry.location.lng();
1454
1455                    jQuery('#geolocation_lat').val(place_lat);
1456                    jQuery('#geolocation_long').val(place_lng);
1457
1458
1459                    //wpestate_geolocation_marker(place_lat,place_lng);
1460                    if (typeof (wpestate_show_pins) !== "undefined") {   
1461                        first_time_wpestate_show_inpage_ajax_half=1;
1462                        wpestate_show_pins(); 
1463                    }
1464
1465                });
1466        
1467            } else if( parseInt( mapfunctions_vars.geolocation_type ) == 2 ){
1468                
1469     
1470               
1471    
1472                    jQuery('#geolocation_search').autocomplete( {
1473                        
1474                        
1475                            source: function ( request, response ) {
1476                                    jQuery.get( 'https://nominatim.openstreetmap.org/search', {
1477                                            format: 'json',
1478                                            q: request.term,//was q
1479                                            //addressdetails:'1',
1480                                    }, function( result ) {
1481                                       
1482                                            if ( !result.length ) {
1483                                                response( [ {
1484                                                    value: '',
1485                                                    label: 'there are no results'
1486                                                } ] );
1487                                                return;
1488                                            }
1489                                            response( result.map( function ( place ) {
1490                                                    return {
1491                                                            label: place.display_name,
1492                                                            latitude: place.lat,
1493                                                            longitude: place.lon,
1494                                                            value: place.display_name,
1495
1496                                                    };
1497                                            } ) );
1498                                    }, 'json' );
1499                            },
1500                            select: function ( event, ui ) {
1501                                initialGeop=0;
1502                                jQuery('#geolocation_lat').val(ui.item.latitude);
1503                                jQuery('#geolocation_long').val(ui.item.longitude);
1504
1505                                if (typeof (wpestate_show_pins) !== "undefined") {   
1506                                    first_time_wpestate_show_inpage_ajax_half=1;
1507                                    wpestate_show_pins(); 
1508                                }
1509
1510                            }
1511                    });
1512                    $('#geolocation_search').attr('autocomplete','on');
1513            }
1514        
1515        }
1516        
1517        
1518    }
1519
1520    function wpestate_enable_slider(slider_name, price_low, price_max, amount, my_custom_curr_pos, my_custom_curr_symbol, my_custom_curr_cur_post, my_custom_curr_coef) {
1521      
1522        var price_low_val, price_max_val, temp_min, temp_max, slider_min, slider_max;
1523        price_low_val = parseInt(jQuery('#'+price_low).val(), 10);
1524        price_max_val = parseInt(jQuery('#'+price_max).val(), 10);
1525
1526  
1527        slider_min = control_vars.slider_min;
1528        slider_max = control_vars.slider_max;
1529        if (!isNaN(my_custom_curr_pos) && my_custom_curr_pos !== -1) {
1530            slider_min =slider_min *my_custom_curr_coef;
1531            slider_max =slider_max *my_custom_curr_coef;
1532        }
1533        
1534        jQuery("#" + slider_name).slider({
1535            range: true,
1536            min: parseFloat(slider_min),
1537            max: parseFloat(slider_max),
1538            values: [price_low_val, price_max_val ],
1539            slide: function (event, ui) {
1540
1541                if (!isNaN(my_custom_curr_pos) && my_custom_curr_pos !== -1) {
1542                    jQuery("#" + price_low).val(ui.values[0]);
1543                    jQuery("#" + price_max).val(ui.values[1]);
1544
1545                    temp_min= ui.values[0] ;
1546                    temp_max= ui.values[1];
1547
1548                    if (my_custom_curr_cur_post === 'before') {
1549                        jQuery("#" + amount).text( wpestate_replace_plus( decodeURIComponent ( my_custom_curr_symbol ) ) + " " + temp_min.format() + " " + control_vars.to + " " + wpestate_replace_plus ( decodeURIComponent ( my_custom_curr_symbol ) )+ " " + temp_max.format());
1550                    } else {
1551                        jQuery("#" + amount).text(temp_min.format() + " " + wpestate_replace_plus ( decodeURIComponent ( my_custom_curr_symbol ) )+ " " + control_vars.to + " " + temp_max.format() + " " + wpestate_replace_plus ( decodeURIComponent ( my_custom_curr_symbol ) ) );
1552                    }
1553                } else {
1554                    jQuery("#" + price_low).val(ui.values[0]);
1555                    jQuery("#" + price_max).val(ui.values[1]);
1556
1557                    if (control_vars.where_curency === 'before') {
1558                        jQuery("#" + amount).text( wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) + " " + ui.values[0].format() + " " + control_vars.to + " " +  wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) + " " + ui.values[1].format());
1559                    } else {
1560                        jQuery("#" + amount).text(ui.values[0].format() + " " + wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) + " " + control_vars.to + " " + ui.values[1].format() + " " + wpestate_replace_plus ( decodeURIComponent ( control_vars.curency ) ) );
1561                    }
1562                }
1563            }
1564        });
1565    }
1566
1567
1568    
1569    ////////////////////////////////////////////////////////////////////////////
1570    /// print property page
1571    ////////////////////////////////////////////////////////////////////////////
1572      
1573    $('#print_page').on( 'click', function(event) {
1574        var prop_id, myWindow, ajaxurl;
1575        ajaxurl      =   control_vars.admin_url+'admin-ajax.php'; 
1576        event.preventDefault();
1577   
1578        prop_id=$(this).attr('data-propid');
1579     
1580        myWindow=window.open('','Print Me','width=700 ,height=842');
1581        var nonce = jQuery('#wpestate_ajax_filtering').val();
1582        $.ajax({    
1583                type: 'POST',
1584                url: ajaxurl, 
1585            data: {
1586                'action'        :   'wpestate_ajax_create_print',
1587                'propid'        :   prop_id,
1588                'security'      :   nonce
1589            },
1590            success:function(data) {  
1591                myWindow.document.write(data); 
1592                myWindow.document.close();
1593                myWindow.focus();
1594                
1595                setTimeout(function(){
1596                    myWindow.print();
1597                }, 3000);
1598        
1599        
1600             
1601            },
1602            error: function(errorThrown){
1603            }
1604
1605        });//end ajax  var ajaxurl      =   control_vars.admin_url+'admin-ajax.php';     
1606    });
1607    
1608        
1609
1610    ////////////////////////////////////////////////////////////////////////////
1611    /// save search actions
1612    ////////////////////////////////////////////////////////////////////////////
1613    
1614    
1615    $('#save_search_button').on( 'click', function(event) {
1616        var nonce, search, search_name, parent, ajaxurl,meta;
1617        search_name     =   jQuery('#search_name').val();
1618        search          =   jQuery('#search_args').val();
1619        meta            =   jQuery('#meta_args').val();
1620        nonce           =   jQuery('#wpestate_save_search_nonce').val();
1621        ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
1622        
1623        jQuery('#save_search_notice').html(control_vars.save_search);
1624        
1625        jQuery.ajax({
1626            type: 'POST',
1627            url: ajaxurl,
1628            data: {
1629                'action'        :   'wpestate_save_search_function',
1630                'search_name'   :   search_name,
1631                'search'        :   search,
1632                'meta'          :   meta,
1633                'security'         :   nonce
1634            },
1635            success: function (data) {
1636               
1637                jQuery('#save_search_notice').html(data);
1638                jQuery('#search_name').val('');
1639            },
1640            error: function (errorThrown) {
1641            }
1642        });
1643        
1644    });
1645    
1646    
1647    $('.delete_search').on( 'click', function(event) {
1648        var  search_id, parent, ajaxurl,confirmtext;
1649        confirmtext = control_vars.deleteconfirm;
1650        
1651        if (confirm(confirmtext)) {       
1652            event.preventDefault();
1653            ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
1654            search_id       =   $(this).attr('data-searchid');
1655            parent          =   $(this).parent();
1656            $(this).html(control_vars.deleting);
1657            var nonce = jQuery('#wpestate_searches_actions').val();
1658            jQuery.ajax({
1659                type: 'POST',
1660                url: ajaxurl,
1661                data: {
1662                    'action'        :   'wpestate_delete_search',
1663                    'search_id'     :   search_id,
1664                    'security'      :   nonce,
1665                },
1666                success: function (data) {
1667                  
1668                    if (data==='deleted'){
1669                        parent.remove();
1670                    }
1671
1672                },
1673                error: function (errorThrown) {
1674                }
1675            });
1676            
1677       
1678        }
1679        
1680    });
1681    
1682    
1683    
1684    
1685    ////////////////////////////////////////////////////////////////////////////
1686    
1687    var adv_search_top;
1688    $('.adv_extended_options_text').on( 'click', function(event) {
1689     
1690        $('.adv-search-1.adv_extended_class').css('height','auto');
1691        $('.adv_extended_class .adv1-holder').css('height','auto');
1692        $(this).parent().find('.adv_extended_options_text').hide();
1693        var check_row=$(this).parent().find('.extended_search_check_wrapper');
1694        
1695        
1696        if($('#search_wrapper').hasClass('with_search_form_float')){
1697            check_row.css('display','block');
1698            var height = check_row.height();
1699            adv_search_top = parseInt ( $('#search_wrapper').css('top'));
1700            var top = parseInt ( $('#search_wrapper').css('top'))-height;
1701
1702            check_row.css('display','none');
1703            
1704            $('#search_wrapper').animate({
1705                'top':top
1706            }, { duration: 200, queue: false });
1707               
1708        } 
1709        check_row.slideDown(  { duration: 200, queue: false});   
1710    
1711        $(this).parent().find('.adv_extended_close_button').show();
1712    });
1713    
1714    
1715    
1716    
1717    $('.adv_extended_close_button').on( 'click', function(event) {
1718      
1719        $(this).hide();
1720        $(this).parent().parent().find('.adv_extended_options_text').show();
1721        $('.adv-search-1.adv_extended_class').removeAttr('style');
1722        $('.adv_extended_class .adv1-holder').removeAttr('style');
1723        
1724        if($('#search_wrapper').hasClass('with_search_form_float')){
1725            $('#search_wrapper').animate({
1726                'top':adv_search_top
1727            },{ duration: 200, queue: false });
1728        }
1729        
1730        $(this).parent().parent().find('.extended_search_check_wrapper').slideUp({ duration: 200, queue: false });
1731      
1732    });
1733    
1734    
1735    //////////////////////////////////////////////////////////////
1736    
1737    $('#adv_extended_options_text_widget').on( 'click', function(event) {
1738      
1739        $(this).parent().find('.adv_extended_options_text').hide();
1740        $(this).parent().find('.extended_search_check_wrapper').slideDown();
1741        $(this).parent().find('#adv_extended_close_widget').show();
1742    });
1743    
1744    $('#adv_extended_close_widget').on( 'click', function(event) {
1745        $(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
1746        $(this).hide();
1747        $(this).parent().parent().find('.adv_extended_options_text').show();
1748    });
1749    
1750    ////////////////////////////////////////////////////////////////////////////////
1751       $('#adv_extended_options_text_short').on( 'click', function(event) {   
1752        $(this).parent().find('.adv_extended_options_text').hide();
1753        $(this).parent().find('.extended_search_check_wrapper').slideDown();
1754        $(this).parent().find('#adv_extended_close_short').show();
1755    });
1756    
1757    $('#adv_extended_close_short').on( 'click', function(event) {
1758        $(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
1759        $(this).hide();
1760        $(this).parent().parent().find('.adv_extended_options_text').show();
1761    });
1762    
1763    
1764    /////////////////////////////////////////////////////////////////////////////////////
1765    $('#adv_extended_options_text_mobile').on( 'click', function(event) {   
1766        $(this).parent().find('.adv_extended_options_text').hide();
1767        $(this).parent().find('.extended_search_check_wrapper').slideDown();
1768        $(this).parent().find('#adv_extended_close_mobile').show();
1769    });
1770    
1771    $('#adv_extended_close_mobile').on( 'click', function(event) {
1772        $(this).parent().parent().find('.extended_search_check_wrapper').slideUp();
1773        $(this).hide();
1774        $(this).parent().parent().find('.adv_extended_options_text').show();
1775    });
1776    /////////////////////////////////////////////////////////////////////////////////////////
1777    
1778    
1779   
1780   
1781  
1782    
1783//    $('#login_user_topbar,#login_pwd_topbar').on('focus', function(e) {
1784//       $('#user_menu_open').addClass('iosfixed');
1785//    });
1786     
1787     
1788     
1789    $('#estate-carousel .slider-content h3 a,#estate-carousel .slider-content .read_more ').on( 'click', function(event) {
1790      var new_link;
1791      new_link =  $(this).attr('href');
1792      window.open (new_link,'_self',false);
1793    });
1794     
1795     
1796    ////////////////////////////////////////////////////////////////////////////////////////////
1797    ///city-area-selection
1798    ///////////////////////////////////////////////////////////////////////////////////////////
1799    
1800    wpestate_filter_city_area('filter_city','filter_area');
1801    wpestate_filter_city_area('sidebar-adv-search-city','sidebar-adv-search-area');
1802    wpestate_filter_city_area('adv-search-city','adv-search-area');
1803    wpestate_filter_city_area('half-adv-search-city','half-adv-search-area');
1804    wpestate_filter_city_area('shortcode-adv-search-city','shortcode-adv-search-area');
1805    wpestate_filter_city_area('mobile-adv-search-city','mobile-adv-search-area');
1806
1807	
1808	//extra
1809	//wpestate_filter_city_area('shortcode-advanced_city','shortcode-advanced_area');
1810  
1811	////////////////////////////////////////////////////////////////////////////////////////////
1812    //county-city-selection
1813    ///////////////////////////////////////////////////////////////////////////////////////////
1814	wpestate_filter_county_city( 'filter_county', 'filter_city' );
1815	wpestate_filter_county_city( 'sidebar-adv-search-countystate', 'sidebar-adv-search-city' );
1816	wpestate_filter_county_city( 'adv-search-countystate', 'adv-search-city' );
1817	wpestate_filter_county_city( 'half-adv-search-countystate', 'half-adv-search-city' );
1818	wpestate_filter_county_city( 'shortcode-adv-search-countystate', 'shortcode-adv-search-city' );
1819	wpestate_filter_county_city( 'mobile-adv-search-countystate', 'mobile-adv-search-city' );
1820	
1821	//wpestate_filter_county_city( 'mobile-adv-search-countystate', 'mobile-adv-search-city' );
1822        
1823   
1824    
1825    
1826    var all_browsers_stuff;
1827    
1828    $('#property_city_submit').on('change', function(){ 
1829        var city_value, area_value;
1830        city_value=$(this).val();
1831  
1832        all_browsers_stuff=$('#property_area_submit_hidden').html();
1833        $('#property_area_submit').empty().append(all_browsers_stuff);
1834        $('#property_area_submit option').each(function(){
1835            area_value=$(this).attr('data-parentcity');
1836          
1837            if( city_value ===area_value || area_value==='all'){
1838              //  $(this).show();        
1839            }else{
1840                //$(this).hide();
1841                 $(this).remove();
1842            }
1843        });
1844    });
1845	 $('#property_county').on('change', function(){ 
1846        var county_value, city_value;
1847        county_value=$(this).val();
1848  
1849        all_browsers_stuff=$('#property_city_submit_hidden').html();
1850        $('#property_city_submit').empty().append(all_browsers_stuff);
1851        $('#property_city_submit option').each(function(){
1852            city_value=$(this).attr('data-parentcounty');
1853          
1854            if( county_value ===city_value || city_value==='all'){
1855              //  $(this).show();        
1856            }else{
1857                //$(this).hide();
1858                 $(this).remove();
1859            }
1860        });
1861    });
1862    
1863     
1864    ////////////////////////////////////////////////////////////////////////////////////////////
1865    ///mobile
1866    ///////////////////////////////////////////////////////////////////////////////////////////
1867
1868
1869    $('#adv-search-header-mobile').on( 'click', function(event) {
1870        $('#adv-search-mobile').fadeToggle('300');
1871        
1872    });
1873
1874
1875    ////////////////////////////////////////////////////////////////////////////////////////////
1876    ///navigational links
1877    ///////////////////////////////////////////////////////////////////////////////////////////
1878
1879    $('.nav-prev,.nav-next ').on( 'click', function(event) {
1880        event.preventDefault();
1881        var link = $(this).find('a').attr('href');
1882        window.open (link,'_self',false);
1883    });
1884
1885    ////////////////////////////////////////////////////////////////////////////////////////////
1886    /// featured agent
1887    ///////////////////////////////////////////////////////////////////////////////////////////
1888 
1889  
1890    $('.featured_agent_details_wrapper, .agent-listing-img-wrapper').on( 'click', function(event) {
1891        var newl= $( this ).attr('data-link');
1892        window.open (newl,'_self',false);
1893    });  
1894    
1895    $('.see_my_list_featured').on( 'click', function(event) {
1896            event.stopPropagation();
1897    });
1898  
1899    ////////////////////////////////////////////////////////////////////////////////////////////
1900    /// featuerd property
1901    ///////////////////////////////////////////////////////////////////////////////////////////
1902    
1903    $('.featured_cover').on( 'click', function(event) {
1904        var newl= $( this ).attr('data-link');
1905        window.open (newl,'_self',false);
1906    }); 
1907
1908
1909    $( '.agent_face' )
1910        .on('mouseenter', function(){   $(this).find('.agent_face_details').fadeIn('500'); })
1911        .on('mouseleave', function(){  $(this).find('.agent_face_details').fadeOut('500'); });
1912         
1913        
1914    ////////////////////////////////////////////////////////////////////////////////////////////
1915    /// listings unit navigation
1916    ///////////////////////////////////////////////////////////////////////////////////////////
1917    $('.places_cover,.agent_unit, .blog_unit , .featured_widget_image').on( 'click', function(event) {
1918        var link;
1919        link = $(this).attr('data-link'); 
1920
1921        window.open(link, '_self');
1922    });
1923
1924 $('.property_listing').on( 'click', function(event) {
1925        if(control_vars.new_page_link==='_blank' && !jQuery(this).hasClass('places_listing')){
1926            return;
1927        }
1928        var link;
1929        link = $(this).attr('data-link'); 
1930
1931        window.open(link, '_self');
1932    });
1933
1934
1935
1936
1937   
1938
1939    $('.share_unit').on( 'click', function(event) {
1940        event.stopPropagation();
1941    });
1942
1943    $('.related_blog_unit_image').on( 'click', function(event) {
1944         var link;
1945        link = $(this).attr('data-related-link'); 
1946        window.open(link, '_self');
1947    });
1948
1949    ////////////////////////////////////////////////////////////////////////////////////////////
1950    /// user menu
1951    ///////////////////////////////////////////////////////////////////////////////////////////
1952
1953    wpestate_open_menu();
1954   
1955    jQuery('#login_trigger_modal').on( 'click', function(event) {
1956        
1957        if (!Modernizr.mq('only all and (max-width: 768px)')) {
1958            jQuery('#modal_login_wrapper').show(); 
1959            jQuery('#loginpop').val('2');
1960        }else{
1961            jQuery('.mobile-trigger-user').trigger('click');
1962             jQuery('#loginpop').val('2');
1963        }
1964    });
1965    
1966    $('#user_menu_u.user_not_loged .submit_action').on( 'click', function(event) {
1967        jQuery('.login-links').show();
1968        $('#modal_login_wrapper').show(); 
1969    });
1970    
1971    $('#login-modal_close').on( 'click', function(event) {
1972        $('#modal_login_wrapper').hide();
1973    });
1974    
1975    $('#shopping-cart').on('click',function (event) {
1976     
1977        $('#user_menu_open').removeClass('iosfixed').fadeOut(400);
1978        if ($('#wpestate_header_shoping_cart').is(":visible")) {
1979            jQuery('#wpestate_header_shoping_cart').fadeOut(400);
1980        } else {
1981            jQuery('#wpestate_header_shoping_cart').fadeIn(400);
1982        }
1983        event.stopPropagation();
1984    });
1985
1986
1987    $(document).on( 'click', function(event) {
1988       
1989        var clicka  =   event.target.id;
1990        var clicka2 =   $(event.target).attr('share_unit');
1991        jQuery('#wpestate_header_shoping_cart').fadeOut(400);
1992        if ( !$('#'+clicka).parents('.topmenux').length) {
1993            $('#user_menu_open').removeClass('iosfixed').hide(400); 
1994            $('.navicon-button').removeClass('opensvg');
1995            $('#user_menu_u .navicon-button').removeClass('open');
1996        }
1997      
1998        $('.share_unit').hide();
1999     
2000        
2001        if (event.target.id == "header_type3_wrapper" || $(event.target).parents("#header_type3_wrapper").size()) { 
2002         
2003        } else { 
2004            var css_right   = parseFloat( $('.header_type3_menu_sidebar').css('right') );
2005            var css_left    = parseFloat( $('.header_type3_menu_sidebar').css('left') );
2006            
2007       
2008            
2009          //  if (  $('.header_type3_menu_sidebar').hasClass('sidebaropen')  ) {
2010            
2011            if(css_right===0 || css_left===0 ){
2012                $('.header_type3_menu_sidebar.header_left.sidebaropen').css("right","-300px");
2013                $('.header_type3_menu_sidebar.header_right.sidebaropen').css("left","-300px");
2014                $('.container.main_wrapper.has_header_type3').css("padding","0p
2014x");
2015                $('.master_header').removeAttr('style');
2016               
2017            }
2018        }
2019    });
2020    
2021    
2022    $('#header_type3_trigger').on( 'click', function(event) {
2023   
2024        event.preventDefault(); 
2025        if ( !$('.container').hasClass('is_boxed') ){
2026            if( $('.header_type3_menu_sidebar').hasClass('header_left') ){
2027                $(".header_type3_menu_sidebar").css("right","0px");
2028                $(".container.main_wrapper ").css("padding-right","300px");
2029                $(".master_header").css("right","150px");
2030            }else{
2031                $(".header_type3_menu_sidebar").css("left","0px");
2032                $(".container.main_wrapper ").css("padding-left","300px");
2033                $(".master_header").css("left","150px");
2034            }
2035            $(".header_type3_menu_sidebar").addClass("sidebaropen");
2036        }else{
2037             if( $('.header_type3_menu_sidebar').hasClass('header_left') ){
2038                $(".header_type3_menu_sidebar").css("right","0px");
2039              
2040            }else{
2041                $(".header_type3_menu_sidebar").css("left","0px");
2042              
2043            }
2044            $(".header_type3_menu_sidebar").addClass("sidebaropen");
2045        }
2046    });
2047      
2048      
2049    ////////////////////////////////////////////////////////////////////////////////////////////
2050    /// new controls for upload pictures
2051    ///////////////////////////////////////////////////////////////////////////////////////////
2052
2053    jQuery('#imagelist i.fa-trash-o').on( 'click', function(event) {
2054          var curent='';  
2055          jQuery(this).parent().remove();
2056
2057          jQuery('#imagelist .uploaded_images').each(function(){
2058             curent=curent+','+jQuery(this).attr('data-imageid'); 
2059          });
2060          jQuery('#attachid').val(curent); 
2061
2062      });
2063
2064    jQuery('#imagelist img').dblclick(function(){
2065
2066        jQuery('#imagelist .uploaded_images .thumber').each(function(){
2067            jQuery(this).remove();
2068        });
2069
2070        jQuery(this).parent().append('<i class="fa thumber fa-star"></i>');
2071        jQuery('#attachthumb').val(   jQuery(this).parent().attr('data-imageid') );
2072    });   
2073
2074    
2075  
2076    
2077    
2078    $('#switch').on( 'click', function(event) {
2079        $('.main_wrapper').toggleClass('wide');
2080    });
2081
2082
2083    $('#accordion_prop_addr, #accordion_prop_details, #accordion_prop_features').on('shown.bs.collapse', function () {
2084        $(this).find('h4').removeClass('carusel_closed');
2085    });
2086    
2087    $('#accordion_prop_addr, #accordion_prop_details, #accordion_prop_features').on('hidden.bs.collapse', function () {
2088        $(this).find('h4').addClass('carusel_closed');
2089    });
2090    
2091    ///////////////////////////////////////////////////////////////////////////////////////////  
2092    //////// advanced search filters
2093    ////////////////////////////////////////////////////////////////////////////////////////////    
2094 
2095    var elems = ['.directory_sidebar','.search_wrapper' , '#advanced_search_shortcode', '#advanced_search_shortcode_2', '.adv-search-mobile','.advanced_search_sidebar'];
2096 
2097    $.each( elems, function( i, elem ) {
2098    
2099        $(elem+' li').on( 'click', function(event) {
2100
2101            event.preventDefault();
2102            var pick, value, parent,parent_replace;
2103            
2104            parent_replace='.filter_menu_trigger';
2105            if(elem === '.advanced_search_sidebar' || elem === '.directory_sidebar' ){
2106                parent_replace='.sidebar_filter_menu';      
2107            }
2108            
2109            pick = $(this).text();
2110            value = $(this).attr('data-value');
2111 
2112			// agents search patch
2113			//if( $(this).parents('.advanced_search_sidebar').hasClass('ag_ag_dev_search_widget') ){
2114			if( $(this).parent().hasClass('aag_picker') ){
2115				$('.ag_ag_dev_search_selector').hide();
2116				$('.selector_for_'+value).fadeIn();
2117			}
2118		 
2119			
2120            parent = $(this).parent().parent();  
2121            if(elem === '.directory_sidebar' ){
2122                parent.find(parent_replace).text(pick).append('<span class="caret caret_sidebar"></span>').attr('data-value',value);
2123            }else{
2124                parent.find(parent_replace).text(pick).append('<span class="caret caret_filter"></span>').attr('data-value',value);
2125            }
2126            parent.find('input').val(value);    
2127        });
2128    });
2129 
2130    
2131 
2132 
2133    jQuery('.search_wrapper li, .extended_search_check_wrapper input[type="checkbox"]').on( 'click', function(event) {
2134     
2135        
2136        if (typeof (wpestate_show_pins) !== "undefined") {    
2137            first_time_wpestate_show_inpage_ajax_half=1;
2138            wpestate_show_pins(); 
2139        }
2140    });
2141
2142
2143   
2144
2145
2146    var typingTimer;                //timer identifier
2147    var doneTypingInterval = 1500;  //time in ms, 5 second for example
2148    var $input = $('#adv_location,.search_wrapper input[type=text]');
2149    
2150    $input.on('keyup', function () {
2151        if(jQuery(this).attr('id')=='geolocation_search' || jQuery(this).attr('id')=='geolocation_search2') {
2152            return;
2153        }
2154        clearTimeout(typingTimer);
2155        typingTimer = setTimeout(wpestate_done_typing, doneTypingInterval);
2156    });
2157
2158    //on keydown, clear the countdown 
2159    $input.on('keydown', function () {
2160      clearTimeout(typingTimer);
2161    });
2162
2163    
2164    function wpestate_done_typing(){
2165        if (typeof (wpestate_show_pins) !== "undefined") {   
2166            first_time_wpestate_show_inpage_ajax_half=1;
2167            wpestate_show_pins(); 
2168        }
2169    }
2170
2171   
2172
2173    function isFunction(possibleFunction) {
2174         return typeof(possibleFunction) === typeof(Function);
2175    }
2176
2177
2178   
2179
2180    /// ******************** end check
2181    ///////////////////////////////////////////////////////////////////////////////////////////  
2182    //////// advanced search filters 
2183    ////////////////////////////////////////////////////////////////////////////////////////////    
2184
2185    $('#openmap').on( 'click', function(event) {
2186        
2187        if( $(this).find('i').hasClass('fa-angle-down') ){
2188            $(this).empty().append('<i class="fa fa-angle-up"></i>'+control_vars.close_map);
2189            
2190            if (control_vars.show_adv_search_map_close === 'no') {
2191                $('.search_wrapper').addClass('adv1_close');
2192                wpestate_adv_search_click();
2193            }
2194            
2195        }else{
2196            $(this).empty().append('<i class="fa fa-angle-down"></i>'+control_vars.open_map);
2197          
2198        }
2199        wpestate_new_open_close_map(2);
2200     
2201    });
2202  
2203    
2204    ///////////////////////////////////////////////////////////////////////////////////////////  
2205    //////// full screen map
2206    ////////////////////////////////////////////////////////////////////////////////////////////    
2207    var wrap_h;
2208    var map_h;
2209    
2210    $('#gmap-full').on( 'click', function(event) {
2211
2212      
2213        if(  $('#gmap_wrapper').hasClass('fullmap') ){    
2214            $('#google_map_prop_list_wrapper').removeClass('fullhalf');
2215
2216            $('#gmap_wrapper').removeClass('fullmap').css('height',wrap_h+'px');
2217            $('#googleMap').removeClass('fullmap').css('height',map_h+'px');
2218            $('.master_header ').removeClass('header_full_map');
2219            $('#search_wrapper').removeClass('fullscreen_search');
2220            $('#search_wrapper').removeClass('fullscreen_search_open');
2221            $('.nav_wrapper').removeClass('hidden');
2222             if(  !$('#google_map_prop_list_wrapper').length ){
2223                 $('.content_wrapper').show();
2224             }
2225            $('body,html').animate({
2226                 scrollTop: 0
2227            }, "slow");
2228            $('#openmap').show();
2229            $(this).empty().append('<i class="fa fa-arrows-alt"></i>'+control_vars.fullscreen).removeClass('spanselected');
2230
2231            $('#google_map_prop_list_wrapper').removeClass('fullscreen');
2232            $('#google_map_prop_list_sidebar').removeClass('fullscreen');
2233            
2234            
2235        }else{
2236            $('#gmap_wrapper,#googleMap').css('height','100%').addClass('fullmap');
2237  
2238            $('#google_map_prop_list_wrapper').addClass('fullscreen');
2239            $('#google_map_prop_list_sidebar').addClass('fullscreen');
2240
2241
2242
2243
2244            $('#google_map_prop_list_wrapper').addClass('fullhalf');
2245
2246
2247            wrap_h=$('#gmap_wrapper').outerHeight();
2248            map_h=$('#googleMap').outerHeight();
2249          
2250            $('.master_header ').addClass('header_full_map');
2251
2252
2253            $('#search_wrapper').addClass('fullscreen_search');
2254            $('.nav_wrapper').addClass('hidden');
2255            if(  !$('#google_map_prop_list_wrapper').length ){
2256                $('.content_wrapper').hide();
2257            }
2258
2259            $('#openmap').hide();
2260            $(this).empty().append('<i class="fa fa-square-o"></i>'+control_vars.default).addClass('spanselected');
2261
2262        }
2263        wpresidence_map_resise();
2264        
2265
2266      
2267    });
2268  
2269    
2270    $('#street-view').on( 'click', function(event) {
2271         wpestate_toggleStreetView();
2272    });
2273    
2274    
2275    
2276    $('#slider_enable_map').on( 'click', function(event) {
2277        var cur_lat, cur_long, myLatLng;
2278        
2279        $('#carousel-listing div').removeClass('slideron');
2280        $('.vertical-wrapper,.verticalstatus,.carusel-back,.carousel-round-indicators,.caption-wrapper,.carousel-indicators ').hide();
2281        $(this).addClass('slideron');
2282        
2283        $('#googleMapSlider').show();
2284        if(wp_estate_kind_of_map===1){
2285            google.maps.event.trigger(map, "resize");
2286        }else{
2287            setTimeout(function(){ map.invalidateSize(); }, 600);  
2288        }  
2289               
2290        cur_lat     =   jQuery('#googleMapSlider').attr('data-cur_lat');
2291        cur_long    =   jQuery('#googleMapSlider').attr('data-cur_long');  
2292        
2293        if(wp_estate_kind_of_map===1){
2294            map.setOptions({draggable: true});
2295            myLatLng    =   new google.maps.LatLng(cur_lat,cur_long);
2296            map.setCenter(myLatLng);
2297            map.panBy(10,-100);
2298            panorama.setVisible(false); 
2299        }
2300       $('#gmapzoomminus.smallslidecontrol').show();
2301       $('#gmapzoomplus.smallslidecontrol').show();
2302       $('#carousel-listing .google_map_poi_marker').show();
2303    });
2304    
2305    $('#slider_enable_street').on( 'click', function(event) {
2306        var cur_lat, cur_long, myLatLng;
2307        
2308        $('#carousel-listing div').removeClass('slideron');
2309        $('.vertical-wrapper,.verticalstatus ').hide();
2310        $('.carusel-back,.carousel-round-indicators,.caption-wrapper,.carousel-indicators ').hide();
2311     
2312        $(this).addClass('slideron');
2313        
2314        cur_lat     =   jQuery('#googleMapSlider').attr('data-cur_lat');
2315        cur_long    =   jQuery('#googleMapSlider').attr('data-cur_long');
2316        myLatLng    =   new google.maps.LatLng(cur_lat,cur_long);
2317        $('#googleMapSlider').show();
2318        panorama.setPosition(myLatLng);
2319        panorama.setVisible(true); 
2320        $('#gmapzoomminus.smallslidecontrol,#carousel-listing .google_map_poi_marker').hide();
2321        $('#gmapzoomplus.smallslidecontrol').hide();
2322        
2323
2324    });
2325  
2326    $('#slider_enable_slider').on( 'click', function(event) {
2327        $('#gmapzoomminus.smallslidecontrol').hide();
2328        $('#gmapzoomplus.smallslidecontrol').hide();
2329       
2330        $('#carousel-listing div').removeClass('slideron');
2331        $(this).addClass('slideron');
2332        $('.vertical-wrapper,.verticalstatus ').show();
2333        $('.carusel-back,.carousel-round-indicators,.caption-wrapper,.carousel-indicators ').show();
2334     
2335        $('#googleMapSlider').hide();
2336        panorama.setVisible(false); 
2337        
2338        $('#gmapzoomminus.smallslidecontrol,#carousel-listing .google_map_poi_marker').hide();
2339        $('#gmapzoomplus.smallslidecontrol').hide();
2340    });
2341    
2342    ///////////////////////////////////////////////////////////////////////////////////////////
2343    ///////     caption-wrapper
2344    ///////////////////////////////////////////////////////////////////////////////////////////	       
2345  
2346    $('.caption-wrapper').on( 'click', function(event) {
2347        $(this).toggleClass('closed');   
2348        $('.carusel-back').toggleClass('rowclosed');
2349        $('.post-carusel .carousel-indicators').toggleClass('rowclosed');      
2350    });
2351
2352    $('#carousel-listing').on('slid.bs.carousel', function () {
2353   
2354        if( $(this).hasClass('carouselvertical') ){
2355            wpestate_show_capture_vertical();
2356        }else{
2357            wpestate_show_capture();
2358        }
2359        $('#carousel-listing div').removeClass('slideron');
2360        $('#slider_enable_slider').addClass('slideron');
2361    });
2362    
2363    
2364    $('.carousel-round-indicators li').on( 'click', function(event) {
2365        $('.carousel-round-indicators li').removeClass('active');
2366        $(this).addClass('active');
2367    });
2368    
2369    $('.videoitem iframe').on( 'click', function(event) {
2370        $('.estate_video_control').remove();
2371    });
2372    ///////////////////////////////////////////////////////////////////////////////////////
2373    ////// Advanced search
2374    /////////////////////////////////////////////////////////////////////////////////////////
2375
2376    wpestate_adv_search_click();
2377
2378   
2379    
2380    
2381  
2382    ///////////////////////////////////////////////////////////////////////////////////////////
2383    ///////   tool tips on prop unit
2384    ///////////////////////////////////////////////////////////////////////////////////////////	       
2385    $( ".share_list, .icon-fav, .compare-action, .dashboad-tooltip,#slider_enable_map ,#slider_enable_slider,#slider_enable_street,#slider_enable_street_sh").on({
2386        mouseenter: function () {
2387            $( this ).tooltip('show') ;
2388        },
2389        mouseleave: function () {
2390           $( this ).tooltip('hide');
2391        }
2392     });
2393    
2394        
2395    $('.share_list').on( 'click', function(event) {
2396        event.stopPropagation();
2397        var sharediv=$(this).parent().find('.share_unit');
2398        sharediv.toggle();
2399        $(this).toggleClass('share_on');
2400    });
2401    
2402
2403    ///////////////////////////////////////////////////////////////////////////////////////////
2404    ///////   back to top
2405    ///////////////////////////////////////////////////////////////////////////////////////////	       
2406           
2407         
2408     $('.backtop').on( 'click', function(event) {
2409         event.preventDefault();
2410  
2411         $('body,html').animate({
2412                scrollTop: 0
2413          }, "slow");
2414
2415     });    
2416         
2417    ///////////////////////////////////////////////////////////////////////////////////////////
2418    ///////    footer contact
2419    ///////////////////////////////////////////////////////////////////////////////////////////	       
2420         
2421    $('.contact-box ').on( 'click', function(event) {
2422        event.preventDefault();
2423        $('.contactformwrapper').toggleClass('hidden');
2424        wpestate_contact_footer_starter();
2425    });
2426         
2427   
2428     
2429
2430    ///////////////////////////////////////////////////////////////////////////////////////////
2431    ///////   widget morgage calculator
2432    ///////////////////////////////////////////////////////////////////////////////////////////
2433    $('#morg_compute').on( 'click', function(event) {
2434        
2435        var intPayPer  = 0;
2436        var intMthPay  = 0;
2437        var intMthInt  = 0;
2438        var intPerFin  = 0;
2439        var intAmtFin  = 0;
2440        var intIntRate = 0;
2441        var intAnnCost = 0;
2442        var intVal     = 0;
2443        var salePrice  = 0;
2444
2445        salePrice = $('#sale_price').val();
2446        intPerFin = $('#percent_down').val() / 100;
2447
2448        intAmtFin = salePrice - salePrice * intPerFin;
2449        intPayPer =  parseInt ($('#term_years').val(),10) * 12;
2450        intIntRate = parseFloat ($('#interest_rate').val(),10);
2451        intMthInt = intIntRate / (12 * 100);
2452        intVal = wpestate_raisePower(1 + intMthInt, -intPayPer);
2453        intMthPay = intAmtFin * (intMthInt / (1 - intVal));
2454        intAnnCost = intMthPay * 12;
2455
2456        $('#am_fin').html("<strong>"+control_vars.morg1+"</strong><br> " + (Math.round(intAmtFin * 100)) / 100 + " ");
2457        $('#morgage_pay').html("<strong>"+control_vars.morg2+"</strong><br> " + (Math.round(intMthPay * 100)) / 100 + " ");
2458        $('#anual_pay').html("<strong>"+control_vars.morg3+"</strong><br> " + (Math.round(intAnnCost * 100)) / 100 + " ");
2459        $('#morg_results').show();
2460        $('.mortgage_calculator_div').css('height',532+'px');
2461    });
2462
2463
2464
2465    ///////////////////////////////////////////////////////////////////////////////////////////
2466    /////// Search widget
2467    ///////////////////////////////////////////////////////////////////////////////////////////
2468    $('#searchform input').focus(function(){
2469      $(this).val(''); 
2470    }).blur(function(){
2471
2472    });
2473   
2474  
2475   
2476    ////////////////////////////////////////////////////////////////////////////////////////////
2477    /// adding total for featured listings  
2478    ///////////////////////////////////////////////////////////////////////////////////////////
2479    $('.extra_featured').on('change', function(){ 
2480       var parent= $(this).parent().parent();
2481       var price_regular  = parseFloat( parent.find('.submit-price-no').text(),10 );
2482       var price_featured = parseFloat( parent.find('.submit-price-featured').text(),10 );
2483       var total= price_regular+price_featured;
2484
2485       if( $(this).is(':checked') ){
2486            parent.find('.submit-price-total').text(total);
2487            parent.find('.stripe_form_featured').show();
2488            parent.find('.stripe_form_simple').hide();
2489       }else{
2490           //substract from total
2491            parent.find('.submit-price-total').text(price_regular);
2492            parent.find('.stripe_form_featured').hide();
2493            parent.find('.stripe_form_simple').show();
2494       }
2495    });
2496  
2497  
2498     ///////////////////////////////////////////////////////////////////////////////////////////
2499    ///////  resise colums on compare page
2500    ///////////////////////////////////////////////////////////////////////////////////////////
2501
2502    $('.compare_wrapper').each(function() {
2503        var cols = $(this).find('.compare_item_head').length;
2504        $(this).addClass('compar-' + cols);
2505    });
2506    
2507    /////////////////////////////////////////////////////////////////////////////////////////
2508    /////// grid to list view
2509    ///////////////////////////////////////////////////////////////////////////////////////////
2510
2511
2512    $('.col-md-12.listing_wrapper .property_unit_custom_element.image').each(function(){
2513       $(this).parent().addClass('wrap_custom_image'); 
2514    });
2515
2516
2517    $('#list_view').on( 'click', function(event) {
2518        $(this).toggleClass('icon_selected');
2519        $('#listing_ajax_container').addClass('ajax12');
2520        $('#grid_view').toggleClass('icon_selected');
2521        
2522         
2523        $('#listing_ajax_container .listing_wrapper').hide().removeClass('col-md-4').removeClass('col-md-3').addClass('col-md-12').fadeIn(400) ;
2524       
2525        $('.the_grid_view').fadeOut(10,function() {
2526            $('.the_list_view:not(.half_map_list_view)').fadeIn(300);
2527           
2528        });    
2529         
2530        // custom unit code 
2531        $('#listing_ajax_container .col-md-12.listing_wrapper .property_unit_custom_element.image').each(function(){
2532            $(this).parent().addClass('wrap_custom_image'); 
2533        });
2534      
2535        //jQuery('.listing_wrapper.col-md-12  > .property_listing').matchHeight();
2536        wpresidence_list_view_arrange();
2537     });
2538     
2539     $('#grid_view').on( 'click', function(event) {
2540        var class_type;
2541        class_type = $('#listing_ajax_container .listing_wrapper:first-of-type').attr('data-org');
2542        $(this).toggleClass('icon_selected');
2543        $('#listing_ajax_container').removeClass('ajax12');
2544        $('#list_view').toggleClass('icon_selected');
2545        $('#listing_ajax_container .listing_wrapper ').hide().removeClass('col-md-12').addClass('col-md-'+class_type).fadeIn(400); 
2546        $('#listing_ajax_container .the_list_view').fadeOut(10,function(){
2547             $('.the_grid_view').fadeIn(300);
2548        });     
2549        // custom unit code 
2550        // custom unit code 
2551        $('#listing_ajax_container .wrap_custom_image').each(function(){
2552            $(this).removeClass('wrap_custom_image'); 
2553            jQuery('.property_listing_custom_design').css('padding-left','0px'); 
2554        });
2555       
2556        // setTimeout(function() {   jQuery('.property_listing').matchHeight(); }, 300);    
2557     });
2558     
2559     
2560     
2561    function  wpresidence_list_view_arrange(){
2562        var wrap_image = parseInt( jQuery('.wrap_custom_image').width());
2563      
2564        if(wrap_image!=0){
2565           jQuery('.col-md-12>.property_listing_custom_design').css('padding-left',wrap_image); 
2566        }
2567    }
2568     
2569     
2570    ///////////////////////////////////////////////////////////////////////////////////////////
2571    ///////   compare action
2572    ///////////////////////////////////////////////////////////////////////////////////////////
2573    var already_in=[];
2574    $('#compare_close').on( 'click', function(event) {
2575        $('.prop-compare').animate({
2576            right: "-240px"
2577        });
2578    });
2579    
2580    $('.compare-action').on( 'click', function(e) {
2581    
2582        e.preventDefault();
2583        e.stopPropagation();
2584        $('.prop-compare').animate({
2585                            right: "0px"
2586                        });
2587
2588        var post_id = $(this).attr('data-pid');
2589         for(var i = 0; i < already_in.length; i++) {
2590            if(already_in[i] === post_id) {
2591                return;
2592            }
2593        }
2594        
2595        already_in.push(post_id);
2596      
2597        
2598        var post_image = $(this).attr('data-pimage');
2599
2600        var to_add = '<div class="items_compare" style="display:none;"><img src="' + post_image + '"  class="img-responsive"><input type="hidden" value="' + post_id + '" name="selected_id[]" /></div>';
2601        $('div.items_compare:first-child').css('background', 'red');
2602        if (parseInt($('.items_compare').length,10) > 3) {
2603            $('.items_compare:first').remove();
2604        }
2605        $('#submit_compare').before(to_add);
2606        
2607        $('#submit_compare').on( 'click', function(event) {
2608            $('#form_compare').trigger('submit');
2609        });
2610    
2611        $('.items_compare').fadeIn(500);
2612    });
2613
2614    $('#submit_compare').on( 'click', function(event) {
2615        $('#form_compare').trigger('submit');
2616    });
2617    
2618    
2619    
2620     /////////////////////////////////////////////////////////////////////////////////////////
2621     ////// form upload
2622     /////////////////////////////////////////////////////////////////////////////////////////
2623       
2624    $('#form_submit_2,#form_submit_1 ').on( 'click', function(event) {
2625        var loading_modal;
2626        window.scrollTo(0, 0);
2627        loading_modal='<div class="modal fade" id="loadingmodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-body listing-submit"><span>'+control_vars.addprop+'</div></div></div></div></div>';
2628        
2629        jQuery('body').append(loading_modal);
2630        jQuery('#loadingmodal').modal();
2631    });
2632       
2633       
2634    $('#add-new-image').on( 'click', function(event) {
2635        $('<p><label for="file">New Image:</label><input type="file" name="upload_attachment[]" id="file_featured"></p> ').appendTo('#files_area');
2636    });
2637       
2638       
2639       
2640    $('.delete_image').on( 'click', function(event) {
2641        var image_id=$(this).attr('data-imageid'); 
2642
2643        var curent=$('#images_todelete').val(); 
2644        if(curent===''){
2645              curent=image_id;
2646        }else{
2647              curent=curent+','+image_id;
2648        }
2649
2650        $('#images_todelete').val(curent) ;     
2651        $(this).parent().remove();              
2652   });
2653
2654     /////////////////////////////////////////////////////////////////////////////////////////
2655     ////// mouse over map tooltip
2656     /////////////////////////////////////////////////////////////////////////////////////////
2657       
2658    $('#googleMap').on('mousemove', function(e){
2659       $('.tooltip').css({'top':e.pageY,'left':e.pageX, 'z-index':'1'});
2660    });
2661
2662    setTimeout(function(){  $('.tooltip').fadeOut("fast");},10000);
2663});
2664
2665////////////////// END ready
2666
2667function wpestate_filter_city_area(selected_city,selected_area){
2668    "use strict";   
2669    jQuery('#'+selected_city+' li').on( 'click', function(event) {
2670        event.preventDefault();
2671        var pick, value_city, parent, selected_city, is_city, area_value;
2672        value_city   = String( jQuery(this).attr('data-value2') ).toLowerCase();       
2673
2674        jQuery('#'+selected_area+' li').each(function(){
2675            is_city = String ( jQuery(this).attr('data-parentcity') ).toLowerCase();
2676            is_city = is_city.replace(" ","-");
2677            area_value   = String ( jQuery(this).attr('data-value') ).toLowerCase();    
2678            if(is_city === value_city || value_city === 'all' ){
2679                jQuery(this).show();
2680            }else{
2681                jQuery(this).hide();
2682            }
2683        });
2684    });
2685}
2686
2687
2688// filter city by county
2689function wpestate_filter_county_city(selected_county,selected_city){
2690    "use strict";  
2691    jQuery('#'+selected_county+' li').on( 'click', function(event) {
2692        event.preventDefault();
2693        var pick, value_county, parent, selected_county, is_county, area_value;
2694        value_county   = String( jQuery(this).attr('data-value2') ).toLowerCase();       
2695
2696        jQuery('#'+selected_city+' li').each(function(){
2697            is_county = String ( jQuery(this).attr('data-parentcounty') ).toLowerCase();
2698            is_county = is_county.replace(" ","-");
2699            area_value   = String ( jQuery(this).attr('data-value') ).toLowerCase(); 
2700
2701		
2702			
2703            if(is_county === value_county || value_county === 'all' ){
2704                jQuery(this).show();
2705            }else{
2706                jQuery(this).hide();
2707            }
2708        });
2709    });
2710}
2711    
2712
2713
2714
2715
2716function  wpestate_show_capture_vertical(){
2717    "use strict";
2718 
2719    var  slideno, slidedif, tomove, curentleft, position;
2720    jQuery('#googleMapSlider').hide();
2721    position=parseInt( jQuery('#carousel-listing .carousel-inner .active').index(),10);
2722    jQuery('#carousel-indicators-vertical  li').removeClass('active');
2723    jQuery('#carousel-listing  .caption-wrapper span').removeClass('active');
2724    jQuery("#carousel-listing  .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
2725    jQuery("#carousel-listing  .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
2726   
2727    jQuery("#carousel-indicators-vertical  li[data-slide-to='"+position+"'] ").addClass('active');
2728    
2729    slideno=position+1;
2730
2731    slidedif=slideno*84;
2732    
2733
2734    if( slidedif > 336){
2735        tomove=336-slidedif;
2736        tomove=tomove;
2737        jQuery('#carousel-indicators-vertical').css('top',tomove+"px");
2738    }else{
2739        position = jQuery('#carousel-indicators-vertical').css('top',tomove+"px").position();
2740        curentleft = position.top;
2741
2742        if( curentleft < 0 ){
2743            tomove = 0;
2744            jQuery('#carousel-indicators-vertical').css('top',tomove+"px");
2745        }
2746
2747    }
2748}
2749
2750function wpestate_show_capture(){
2751    "use strict";
2752    var  slideno, slidedif, tomove, curentleft, position;
2753    jQuery('#googleMapSlider').hide();
2754    position=parseInt( jQuery('#carousel-listing .carousel-inner .active').index(),10);
2755    jQuery('#carousel-listing  .caption-wrapper span').removeClass('active');
2756    jQuery('#carousel-listing  .carousel-round-indicators li').removeClass('active');
2757    
2758    jQuery("#carousel-listing  .caption-wrapper span[data-slide-to='"+position+"'] ").addClass('active');
2759    jQuery("#carousel-listing  .carousel-round-indicators li[data-slide-to='"+position+"'] ").addClass('active');
2760    slideno=position+1;
2761
2762    slidedif=slideno*146;
2763    if( slidedif > 810){
2764        tomove=810-slidedif;
2765        jQuery('.post-carusel .carousel-indicators').css('left',tomove+"px");
2766    }else{
2767        position = jQuery('.post-carusel .carousel-indicators').css('left',tomove+"px").position();
2768        curentleft = position.left;
2769
2770        if( curentleft < 0 ){
2771            tomove = 0;
2772            jQuery('.post-carusel .carousel-indicators').css('left',tomove+"px");
2773        }
2774
2775    }
2776        
2777}
2778
2779function wpestate_raisePower(x, y) {
2780    "use strict";  
2781    return Math.pow(x, y);
2782} 
2783    
2784
2785function wpestate_adv_search_click(){
2786    "use strict";  
2787   jQuery('.with_search_form_float #adv-search-header-1,.with_search_form_float #adv-search-header-3').on( 'click', function(event) {
2788      
2789        if ( jQuery('#search_wrapper').hasClass('float_search_closed') ){
2790            jQuery('#search_wrapper').removeClass('float_search_closed');  
2791        }else{
2792            jQuery('#search_wrapper').addClass('float_search_closed'); 
2793        }
2794       
2795   });
2796   
2797}
2798
2799///////////////////////////////////////////////////////////////////////////////////////////
2800/////// Contact footer
2801///////////////////////////////////////////////////////////////////////////////////////////
2802function wpestate_contact_footer_starter(){
2803    "use strict";  
2804    jQuery('#btn-cont-submit').on( 'click', function(event) {
2805        var contact_name, contact_email, contact_phone, contact_coment, agent_email, property_id, nonce, ajaxurl;
2806        contact_name    =   jQuery('#foot_contact_name').val();
2807        contact_email   =   jQuery('#foot_contact_email').val();
2808        contact_phone   =   jQuery('#foot_contact_phone').val();
2809        contact_coment  =   jQuery('#foot_contact_content').val();
2810        nonce           =   jQuery('#contact_footer_ajax_nonce').val();
2811        ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
2812        
2813          jQuery('#footer_alert-agent-contact').empty();
2814        if(ajaxcalls_vars.use_gdpr==='yes'){
2815            if ( !jQuery('#wpestate_agree_gdprfooter').is(':checked') ){
2816                jQuery('#footer_alert-agent-contact').empty().append(ajaxcalls_vars.gdpr_terms);
2817                return;
2818            }
2819        }
2820        
2821        
2822        jQuery.ajax({
2823            type: 'POST',
2824            dataType: 'json',
2825            url: ajaxurl,
2826            data: {
2827                'action'    :   'wpestate_ajax_contact_form_footer',
2828                'name'      :   contact_name,
2829                'email'     :   contact_email,
2830                'phone'     :   contact_phone,
2831                'contact_coment'   :   contact_coment,
2832                'propid'    :   property_id,
2833                'nonce'     :   nonce
2834            },
2835            success: function (data) {
2836         
2837                if (data.sent) {
2838                    jQuery('#foot_contact_name').val('');
2839                    jQuery('#foot_contact_email').val('');
2840                    jQuery('#foot_contact_phone').val('');
2841                    jQuery('#foot_contact_content').val('');
2842                }
2843                jQuery('#footer_alert-agent-contact').empty().append(data.response);
2844            },
2845            error: function (errorThrown) {
2846               
2847            }
2848        });
2849        
2850
2851        
2852    });
2853}
2854
2855
2856
2857function wpestate_filter_invoices(){
2858    "use strict";
2859    var ajaxurl, start_date, end_date, type, status;
2860    start_date  = jQuery('#invoice_start_date').val();
2861    end_date    = jQuery('#invoice_end_date').val();
2862    type        = jQuery('#invoice_type').val();
2863    status      = jQuery('#invoice_status').val();
2864    var nonce = jQuery('#wpestate_invoices_actions').val();
2865    ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
2866    jQuery.ajax({
2867        type: 'POST',
2868        url: ajaxurl,
2869        dataType: 'json',
2870        data: {
2871            'action'        :   'wpestate_ajax_filter_invoices',
2872            'start_date'    :   start_date,
2873            'end_date'      :   end_date,
2874            'type'          :   type,
2875            'status'        :   status,
2876            'security'      :   nonce
2877        },
2878        success: function (data) {
2879         
2880            jQuery('#container-invoices').empty().append(data.results);
2881            jQuery('#invoice_confirmed').empty().append(data.invoice_confirmed);
2882            //enable_invoice_actions();
2883    
2884        },
2885        
2886        error: function (errorThrown) {
2887       
2888        }
2889    });//end ajax
2890}
2891 
2892function estate_splash_slider(){
2893    if(jQuery("#splash_slider_wrapper").length>0){
2894       
2895    }
2896} 
2897 
2898function estate_sidebar_slider_carousel(){
2899    "use strict";  
2900    var owl = jQuery("#owl-featured-slider").data('owlCarousel');
2901    jQuery(".owl-featured-slider").owlCarousel({
2902        rtl:true,
2903        navigation : true, // Show next and prev buttons
2904        slideSpeed : 300,
2905        paginationSpeed : 400,
2906        singleItem:true,
2907        navigationText : ["<div class='nextleft'>
2907<i class='demo-icon icon-left-open-big'></i></div>","<div class='nextright'><i class='demo-icon icon-right-open-big'></i></div>"],
2908
2909    });
2910      
2911} 
2912
2913function estate_start_lightbox(){
2914    "use strict";  
2915    var jump_slide;
2916    jQuery("#owl-demo").owlCarousel({
2917        rtl:true,
2918        loop:true,
2919        navigation : true, // Show next and prev buttons
2920        slideSpeed : 300,
2921        paginationSpeed : 400,
2922        items:1,
2923        navigationText : ["<div class='nextleft'><i class='demo-icon icon-left-open-big'></i></div>","<div class='nextright'><i class='demo-icon icon-right-open-big'></i></div>"],
2924        responsiveClass:true,
2925        responsive:false
2926
2927    });
2928
2929    jQuery('.lightbox_trigger').on( 'click', function(event) {
2930
2931        event.preventDefault();
2932        jQuery('.lightbox_property_wrapper').show();
2933        jump_slide=parseInt( jQuery(this).attr('data-slider-no') );
2934        var owl = jQuery("#owl-demo").data('owlCarousel');
2935        owl.jumpTo(jump_slide-1);
2936    });
2937
2938    jQuery('.lighbox-image-close').on( 'click', function(event) {
2939        event.preventDefault();  
2940        jQuery('.lightbox_property_wrapper').hide();
2941    });
2942}
2943   
2944   
2945function estate_start_lightbox_floorplans(){
2946    "use strict";  
2947    var jump_slide;
2948      
2949    jQuery('.lightbox_trigger_floor').on( 'click', function(event) {
2950        event.preventDefault();
2951        jQuery('.lightbox_property_wrapper_floorplans').show();
2952        jQuery('.master_header').css('z-index','0');
2953        jQuery('.container').css('z-index','1');
2954        jQuery('.header_media').css('z-index',1);
2955    });
2956
2957    jQuery('.lighbox-image-close-floor').on( 'click', function(event) {
2958        event.preventDefault();
2959         jQuery('.master_header').css('z-index','100');
2960        jQuery('.container').css('z-index','2');
2961        jQuery('.header_media').css('z-index',3);
2962        jQuery('.lightbox_property_wrapper_floorplans').hide();
2963    });
2964
2965
2966   jQuery("#owl-demo-floor").owlCarousel({
2967        rtl:true,
2968        navigation : true, // Show next and prev buttons
2969        slideSpeed : 300,
2970        paginationSpeed : 400,
2971        singleItem:true,
2972        navigationText : ["<div class='nextleft'><i class='demo-icon icon-left-open-big'></i></div>","<div class='nextright'><i class='demo-icon icon-right-open-big'></i></div>"],
2973
2974    });
2975}
2976
2977
2978
2979function wpestate_anime(selector) {
2980    "use strict";  
2981    function wpestate_GridLoaderFx(el, options) {
2982        this.el = el;
2983        this.items = this.el.querySelectorAll('.listing_wrapper');
2984    }
2985
2986    wpestate_GridLoaderFx.prototype.effects = {
2987            'wpestate': {
2988                    animeOpts: {
2989                            duration: function(t,i) {
2990                                    return 300 + i*75;
2991                            },
2992                            easing: 'easeOutExpo',
2993                            delay: function(t,i) {
2994                                    return i*50;
2995                            },
2996                            opacity: {
2997                                    value: [0,1],
2998                                    easing: 'linear'
2999                            },
3000                            scale: [0,1]	
3001                    }
3002            },
3003
3004    };
3005
3006    wpestate_GridLoaderFx.prototype._render = function(effect) {
3007
3008            this._resetStyles();
3009
3010            var self = this,
3011                    effectSettings = this.effects[effect],
3012                    animeOpts = effectSettings.animeOpts;
3013
3014            if( effectSettings.perspective != undefined ) {
3015                    [].slice.call(this.items).forEach(function(item) { 
3016                            item.parentNode.style.WebkitPerspective = item.parentNode.style.perspective = effectSettings.perspective + 'px';
3017                    });
3018            }
3019
3020            if( effectSettings.origin != undefined ) {
3021                    [].slice.call(this.items).forEach(function(item) { 
3022                            item.style.WebkitTransformOrigin = item.style.transformOrigin = effectSettings.origin;
3023                    });
3024            }
3025
3026            if( effectSettings.lineDrawing != undefined ) {
3027                    [].slice.call(this.items).forEach(function(item) { 
3028                            // Create SVG.
3029                            var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'),
3030                                    path = document.createElementNS('http://www.w3.org/2000/svg', 'path'),
3031                                    itemW = item.offsetWidth,
3032                                    itemH = item.offsetHeight;
3033
3034                            svg.setAttribute('width', itemW + 'px');
3035                            svg.setAttribute('height', itemH + 'px');
3036                            svg.setAttribute('viewBox', '0 0 ' + itemW + ' ' + itemH);
3037                            svg.setAttribute('class', 'grid__deco');
3038                            path.setAttribute('d', 'M0,0 l' + itemW + ',0 0,' + itemH + ' -' + itemW + ',0 0,-' + itemH);
3039                            path.setAttribute('stroke-dashoffset', anime.setDashoffset(path));
3040                            svg.appendChild(path);
3041                            item.parentNode.appendChild(svg);
3042                    });
3043
3044                    var animeLineDrawingOpts = effectSettings.animeLineDrawingOpts;
3045                    animeLineDrawingOpts.targets = this.el.querySelectorAll('.grid__deco > path');
3046                    anime.remove(animeLineDrawingOpts.targets);
3047                    anime(animeLineDrawingOpts);
3048            }
3049
3050            if( effectSettings.revealer != undefined ) {
3051                    [].slice.call(this.items).forEach(function(item) { 
3052                            var revealer = document.createElement('div');
3053                            revealer.className = 'grid__reveal';
3054                            if( effectSettings.revealerOrigin != undefined ) {
3055                                    revealer.style.transformOrigin = effectSettings.revealerOrigin;
3056                            }
3057                            if( effectSettings.revealerColor != undefined ) {
3058                                    revealer.style.backgroundColor = effectSettings.revealerColor;
3059                            }
3060                            item.parentNode.appendChild(revealer);
3061                    });
3062
3063                    var animeRevealerOpts = effectSettings.animeRevealerOpts;
3064                    animeRevealerOpts.targets = this.el.querySelectorAll('.grid__reveal');
3065                    animeRevealerOpts.begin = function(obj) {
3066                            for(var i = 0, len = obj.animatables.length; i < len; ++i) {
3067                                    obj.animatables[i].target.style.opacity = 1;
3068                            }
3069                    };
3070                    anime.remove(animeRevealerOpts.targets);
3071                    anime(animeRevealerOpts);
3072            }
3073
3074            if( effectSettings.itemOverflowHidden ) {
3075                    [].slice.call(this.items).forEach(function(item) {
3076                            item.parentNode.style.overflow = 'hidden';
3077                    });
3078            }
3079
3080            animeOpts.targets = effectSettings.sortTargetsFn && typeof effectSettings.sortTargetsFn === 'function' ? [].slice.call(this.items).sort(effectSettings.sortTargetsFn) : this.items;
3081            anime.remove(animeOpts.targets);
3082            anime(animeOpts);
3083    };
3084
3085    wpestate_GridLoaderFx.prototype._resetStyles = function() {
3086            this.el.style.WebkitPerspective = this.el.style.perspective = 'none';
3087            [].slice.call(this.items).forEach(function(item) {
3088                    var gItem = item.parentNode;
3089                    item.style.opacity = 0;
3090                    item.style.WebkitTransformOrigin = item.style.transformOrigin = '50% 50%';
3091                    item.style.transform = 'none';
3092
3093                    var svg = item.parentNode.querySelector('svg.grid__deco');
3094                    if( svg ) {
3095                            gItem.removeChild(svg);
3096                    }
3097
3098                    var revealer = item.parentNode.querySelector('.grid__reveal');
3099                    if( revealer ) {
3100                            gItem.removeChild(revealer);
3101                    }
3102
3103                    gItem.style.overflow = '';
3104            });
3105    };
3106
3107    window.wpestate_GridLoaderFx = wpestate_GridLoaderFx;
3108
3109    var body = document.body,
3110            grids = [].slice.call(document.querySelectorAll(selector)),
3111            currentGrid = 0,
3112            loaders = [],
3113            loadingTimeout;
3114
3115    var  gridsx = jQuery(selector);
3116
3117    function init() {
3118        imagesLoaded(body, function() {
3119            loaders.push(new wpestate_GridLoaderFx(grids[0])); 
3120            applyFx();
3121        });
3122
3123    }
3124
3125
3126    function applyFx() {
3127
3128            clearTimeout(loadingTimeout);
3129            loadingTimeout = setTimeout(function() {
3130                loaders[0]._render('wpestate');
3131            }, 10);
3132    }
3133
3134    init();
3135}
3136
3137
3138function wpestate_property_list_sh(ajax_loader,ajax_filters){
3139    "use strict";  
3140
3141    var    ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';  
3142    jQuery(ajax_loader).on( 'click', function(event) {
3143        var container               =   jQuery(this).parent().parent();
3144        var type                    =   container.attr('data-type');
3145        var category_ids            =   container.attr('data-category_ids');
3146        var action_ids              =   container.attr('data-action_ids');
3147        var city_ids                =   container.attr('data-city_ids');
3148        var area_ids                =   container.attr('data-area_ids');
3149        var state_ids               =   container.attr('data-state_ids');
3150        var number                  =   container.attr('data-number');
3151        var align                   =   container.attr('data-align');
3152        var show_featured_only      =   container.attr('data-show_featured_only');
3153        var random_pick             =   container.attr('data-random_pick');
3154        var featured_first          =   container.attr('data-featured_first');
3155        var page                    =   container.attr('data-page');
3156        var align                   =   container.attr('data-align');
3157        var row_number              =   container.attr('data-row-number');
3158        page=parseInt(page);
3159        page=page+1;
3160        container.attr('data-page',page);
3161        container.find('.wpestate_listing_sh_loader').show();
3162      
3163        page=parseInt(page);
3164        var nonce = jQuery('#wpestate_ajax_filtering').val();
3165        jQuery.ajax({
3166        type: 'POST',
3167        url: ajaxurl,
3168        data: {
3169            'action'                :   'wpestate_load_recent_items_sh',
3170            'type'                  :   type,
3171            'category_ids'          :   category_ids,
3172            'action_ids'            :   action_ids,
3173            'city_ids'              :   city_ids,
3174            'area_ids'              :   area_ids,
3175            'state_ids'             :   state_ids,
3176            'number'                :   number,
3177            'align'                 :   align,
3178            'show_featured_only'    :   show_featured_only,
3179            'random_pick'           :   random_pick,
3180            'featured_first'        :   featured_first,
3181            'page'                  :   page,
3182            'row_number'            :   row_number,
3183            'security'              :   nonce
3184        },
3185        
3186          
3187        success: function (data) { 
3188        
3189             
3190           if(data!==''){
3191                var new_container='just_container_'+Math.floor((Math.random() * 100) + 1);
3192                container.find('.wpestate_listing_sh_loader').hide();
3193                container.find('.wpestate_listing_sh_loader').before('<div class="just_container_flex '+new_container+'">'+data+'</div>');
3194                wpestate_restart_js_after_ajax();
3195                var new_div=container.attr('id');
3196                new_div="#"+new_div+" ."+new_container;
3197                var new_div_height = new_div+' .property_listing';
3198                wpestate_anime(new_div);
3199            //    setTimeout(function() {      jQuery(new_div_height).matchHeight();}, 900);
3200                  
3201                jQuery('.col-md-12.listing_wrapper .property_unit_custom_element.image').each(function(){
3202                    jQuery(this).parent().addClass('wrap_custom_image'); 
3203                });
3204                var wrap_image = parseInt( jQuery('.wrap_custom_image').width());
3205      
3206                if(wrap_image!=0){
3207                   jQuery('.col-md-12>.property_listing_custom_design').css('padding-left',wrap_image); 
3208                }
3209            
3210            
3211            }else{
3212                container.find('.wpestate_listing_sh_loader').hide();
3213                jQuery(ajax_loader).hide();
3214            }
3215        },
3216        error: function (errorThrown) {
3217            
3218        }
3219    });//end ajax     
3220        
3221        
3222    });
3223    
3224    
3225    jQuery(ajax_filters).on( 'click', function(event) {
3226        var container   =   jQuery(this).parent().parent();
3227        var taxid       =   jQuery(this).attr('data-taxid');
3228        var taxonomy    =   jQuery(this).attr('data-taxonomy');
3229    
3230        jQuery(this).parent().parent().find('.wpestate_item_list_sh').show();
3231   
3232        switch(taxonomy) {
3233            case 'property_category':
3234                
3235                var category_ids            =   container.attr('data-category_ids');
3236                category_ids = wpestate_replace_tax_id(jQuery(this),category_ids,taxid);
3237                container.attr('data-category_ids',category_ids);
3238                
3239                break;
3240            case 'property_action_category':
3241                
3242                var action_ids            =   container.attr('data-action_ids');
3243                action_ids = wpestate_replace_tax_id(jQuery(this),action_ids,taxid);
3244                container.attr('data-action_ids',action_ids);
3245                
3246                break;
3247            case 'property_city':
3248                
3249                var city_ids            =   container.attr('data-city_ids');
3250                city_ids = wpestate_replace_tax_id(jQuery(this),city_ids,taxid);
3251                container.attr('data-city_ids',city_ids);
3252                
3253                break;
3254            case 'property_area':
3255                
3256                var area_ids            =   container.attr('data-area_ids');
3257                area_ids = wpestate_replace_tax_id(jQuery(this),area_ids,taxid);
3258                container.attr('data-area_ids',area_ids);
3259                
3260                break;
3261            case 'property_county_state':
3262                
3263                
3264                var state_ids            =   container.attr('data-state_ids');
3265                state_ids = wpestate_replace_tax_id(jQuery(this),state_ids,taxid);
3266                container.attr('data-state_ids',state_ids);
3267                
3268                break;
3269        }
3270        container.attr('data-page',0);
3271        jQuery(this).toggleClass('tax_active');
3272        
3273        container.find('.listing_wrapper').remove();
3274        container.find('.wpestate_item_list_sh').trigger('click');
3275    
3276    });
3277    
3278
3279    function wpestate_replace_tax_id(acesta,tax_ids,taxid){
3280        if(!acesta.hasClass('tax_active')){
3281            if ( tax_ids.indexOf(taxid) >= 0){
3282            }else{
3283                tax_ids=tax_ids+taxid+",";
3284            }
3285        }else{
3286            var to_replace=taxid+",";
3287            tax_ids=tax_ids.replace(to_replace , "");
3288        }
3289        return tax_ids;        
3290                
3291    }
3292    
3293}
3294
3295 function wpestate_open_menu(){
3296    "use strict";  
3297    jQuery('#user_menu_u.user_loged').on( 'click', function(event) {
3298        jQuery('#wpestate_header_shoping_cart').fadeOut(400);
3299        if( jQuery('#user_menu_open').is(":visible")){
3300            jQuery('#user_menu_open').removeClass('iosfixed').fadeOut(400); 
3301            jQuery('.navicon-button').removeClass('opensvg');
3302        }else{
3303            jQuery('#user_menu_open').fadeIn(400); 
3304            jQuery('.navicon-button').addClass('opensvg');
3305        }     
3306        event.stopPropagation();
3307    });
3308}
3309
3310
3311function wpestate_contact_us_shortcode(){
3312    "use strict";  
3313    jQuery('#btn-cont-submit_sh').on( 'click', function(event) {
3314        var parent,contact_name, contact_email, contact_phone, contact_coment, agent_email, property_id, nonce, ajaxurl;
3315        contact_name    =   jQuery('#foot_contact_name_sh').val();
3316        contact_email   =   jQuery('#foot_contact_email_sh').val();
3317        contact_phone   =   jQuery('#foot_contact_phone_sh').val();
3318        contact_coment  =   jQuery('#foot_contact_content_sh').val();
3319        nonce           =   jQuery('#contact_footer_ajax_nonce_sh').val();
3320        ajaxurl         =   ajaxcalls_vars.admin_url + 'admin-ajax.php';
3321        parent          =   jQuery(this).parent();
3322        if(ajaxcalls_vars.use_gdpr==='yes'){
3323            if ( !jQuery('#wpestate_agree_gdpr').is(':checked') ){
3324                jQuery('#footer_alert-agent-contact_sh').empty().append(ajaxcalls_vars.gdpr_terms);
3325                return;
3326            }
3327        }
3328        
3329        
3330        jQuery.ajax({
3331            type: 'POST',
3332            dataType: 'json',
3333            url: ajaxurl,
3334            data: {
3335                'action'    :   'wpestate_ajax_contact_form_footer',
3336                'name'      :   contact_name,
3337                'email'     :   contact_email,
3338                'phone'     :   contact_phone,
3339                'contact_coment'   :   contact_coment,
3340                'propid'    :   property_id,
3341                'nonce'     :   nonce
3342            },
3343            success: function (data) {
3344         
3345                if (data.sent) {
3346                    jQuery('#foot_contact_name_sh').val('');
3347                    jQuery('#foot_contact_email_sh').val('');
3348                    jQuery('#foot_contact_phone_sh').val('');
3349                    jQuery('#foot_contact_content_sh').val('');
3350                }
3351                jQuery('#footer_alert-agent-contact_sh').empty().append(data.response);
3352            },
3353            error: function (errorThrown) {
3354               
3355            }
3356        });
3357    });
3358	
3359}
3360 function wpestate_enable_stripe_booking_prop(){
3361
3362        jQuery('.wpestate_stripe_booking_prop').unbind();
3363        jQuery('.wpestate_stripe_booking_prop').on('click',function(){
3364            var parent=jQuery(this).parent();
3365            var modalid=jQuery(this).attr('data-modalid');
3366            
3367            jQuery('#'+modalid).show();
3368            jQuery('#'+modalid+' .wpestate_stripe_form_1').show();
3369            wpestate_start_stripe(0,modalid);
3370        });
3371        
3372    jQuery('.close_stripe_form').on('click',function(){
3373        jQuery('.wpestate_stripe_form_wrapper').hide();
3374        jQuery('.wpestate_stripe_form_1').hide();
3375    });
3376    }

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.