File: /home/dh_hwg2wc/fnaluxury.com/wp-content/themes/houzez/js/custom.min.js
var houzezThemeGlobal={};function houzezSetCookie(e,a,t){var o=new Date;o.setTime(o.getTime()+864e5*t);var r="expires="+o.toUTCString();document.cookie=e+"="+a+";"+r+";path=/"}function houzezGetCookie(e){for(var a=e+"=",t=decodeURIComponent(document.cookie).split(";"),o=0;o<t.length;o++){for(var r=t[o];" "==r.charAt(0);)r=r.substring(1);if(0==r.indexOf(a))return r.substring(a.length,r.length)}return""}function fave_processing_modal(e){var a='<div class="modal fade" id="fave_modal" tabindex="-1" role="dialog" aria-labelledby="faveModalLabel" aria-hidden="true"><div class="modal-dialog"><div class="modal-content"><div class="modal-body houzez_messages_modal">'+e+"</div></div></div></div></div>";jQuery("body").append(a),jQuery("#fave_modal").modal()}function fave_processing_modal_close(){jQuery("#fave_modal").modal("hide")}function houzez_grid_image_gallery(){if(1==houzez_vars.disable_property_gallery){var e=houzez_vars.grid_gallery_behaviour,a=houzez_vars.houzez_rtl;a="yes"==a,jQuery(".hz-item-gallery-js").each(function(){if(!jQuery(this).hasClass("houzez-gallery-loaded")&&jQuery(this).data("images")){var t=jQuery(this),o=jQuery(this).find("a.listing-featured-thumb").attr("href"),r=jQuery(this).find("a.listing-featured-thumb").attr("target"),s=jQuery(this).data("images"),i='<div class="listing-gallery-wrap '+e+'"><div class="houzez-listing-carousel">';s.forEach(function(e,a){i+='<div class="item"><a target="'+r+'" href="'+o+'"><img src="'+e.image+'" alt="'+e.alt+'" class="img-fluid"></a></div>'}),i+="</div></div>",jQuery(this).find(".listing-image-wrap .listing-thumb").append(i),t.find(".houzez-listing-carousel").slick({rtl:a,autoplay:!1,lazyLoad:"ondemand",infinite:!1,speed:300,slidesToShow:1,arrows:!0,prevArrow:'<button type="button" class="slick-prev slick-arrow"></button>',nextArrow:'<button type="button" class="slick-next slick-arrow"></button>',adaptiveHeight:!1}),is_listing_gallery_slider=!0,jQuery(this).addClass("houzez-gallery-loaded")}})}jQuery(".switch-btn").on("click",function(){jQuery(".hz-item-gallery-js .houzez-listing-carousel").slick("refresh")})}function houzez_listing_lightbox(ajaxurl,processing_text,houzez_rtl,userID){jQuery(".hz-show-lightbox-js").on("click",function(){var $parents,listing_id=jQuery(this).data("listid"),preview_loader=jQuery(this).parents(".item-wrap").find(".preview_loader");jQuery.ajax({type:"post",url:ajaxurl,data:{action:"load_lightbox_content",listing_id:listing_id},beforeSend:function(){preview_loader.empty().append('<div class="houzez-overlay-loading"><div class="overlay-placeholder"><div class="loader-ripple spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div></div>')},complete:function(){preview_loader.empty()},success:function(e){jQuery("#hz-listing-model-content").html(e),jQuery("#houzez-listing-lightbox").modal("show"),jQuery(".lightbox-slider").not(".slick-initialized").slick({rtl:houzez_rtl,lazyLoad:"ondemand",infinite:!0,speed:300,slidesToShow:1,arrows:!0,adaptiveHeight:!0}),jQuery("#houzez-listing-lightbox").on("shown.bs.modal",function(e){jQuery(".lightbox-slider").slick("setPosition"),jQuery(".lightbox-slider").slick("refresh")}),jQuery(".btn-expand").on("click",function(){jQuery(".lightbox-gallery-wrap").toggleClass("lightbox-gallery-full-wrap"),jQuery(".lightbox-slider").slick("setPosition")}),jQuery(".btn-email").on("click",function(){jQuery(".lightbox-form-wrap").toggleClass("lightbox-form-wrap-show")}),houzez_init_add_favorite(ajaxurl,userID),houzez_init_remove_favorite(ajaxurl,userID)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})})}function houzez_init_add_favorite(e,a){jQuery(".add-favorite-js").on("click",function(t){t.preventDefault();var o=jQuery(this),r=jQuery(this).attr("data-listid");return add_to_favorite(e,r,o,a),!1})}function houzez_init_remove_favorite(e,a){jQuery(".remove_fav").on("click",function(){var t=jQuery(this),o=jQuery(this).attr("data-listid");add_to_favorite(e,o,t,a),t.parents("tr").remove()})}function add_to_favorite(ajaxurl,listID,curnt,userID){if(0===parseInt(userID,10)||void 0==userID)0!=houzez_vars.add_to_favorite_login_required?(jQuery("#login-register-form").modal("show"),jQuery(".login-form-tab").addClass("active show"),jQuery(".modal-toggle-1.nav-link").addClass("active")):add_to_favorite_without_login(curnt);else{var $parents,preview_loader=curnt.parents(".item-wrap").find(".preview_loader");jQuery.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"houzez_add_to_favorite",listing_id:listID},beforeSend:function(){preview_loader.empty().append('<div class="houzez-overlay-loading"><div class="overlay-placeholder"><div class="loader-ripple spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div></div>')},complete:function(){preview_loader.empty()},success:function(e){e.added?curnt.children("i").addClass("text-danger"):curnt.children("i").removeClass("text-danger"),preview_loader.empty()},complete:function(){},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}}function add_to_favorite_without_login(e){var a=houzezGetCookie("houzez_favorite_listings");a=a&&a.length?a.split(","):[];var t=e.data("listid"),o=a.indexOf(t.toString());if(-1==o){a.push(t.toString()),houzezSetCookie("houzez_favorite_listings",a.join(","),30),jQuery("span.frvt-count").html(""),jQuery("span.frvt-count").html(a.length);for(var r=0;r<a.length;r++)jQuery('.add-favorite-js[data-listid="'+a[r]+'"] i').addClass("text-danger"),jQuery('.add-favorite-js[data-listid="'+a[r]+'"]').addClass("remove-favorite")}else a.splice(o,1),houzezSetCookie("houzez_favorite_listings",a.join(","),30),jQuery("span.frvt-count").html(""),jQuery("span.frvt-count").html(a.length),jQuery('.add-favorite-js[data-listid="'+t.toString()+'"] i').removeClass("text-danger"),jQuery('.add-favorite-js[data-listid="'+t.toString()+'"]').removeClass("remove-favorite");return jQuery("a.favorite-btn").attr("href",houzez_vars.favorite_url+"?ids="+a),!1}function houzez_check_favourites(e){if(0===parseInt(e,10)||void 0==e){var a=houzezGetCookie("houzez_favorite_listings");if(jQuery("a.favorite-btn").attr("href",houzez_vars.favorite_url+"?ids="+a),a&&a.length){if((a=a.split(",")).length){for(var t=0;t<a.length;t++)jQuery('.add-favorite-js[data-listid="'+a[t]+'"] i').addClass("text-danger"),jQuery('.add-favorite-js[data-listid="'+a[t]+'"]').addClass("remove-favorite");jQuery("span.frvt-count").html(""),jQuery("span.frvt-count").html(a.length)}}else a=[]}}function add_to_compare(e,a,t,o,r,s,i,n){jQuery("a.compare-btn").attr("href",e+"?ids="+houzezGetCookie("houzez_compare_listings"));var i=houzezGetCookie("houzez_compare_listings");if(i.length>0&&jQuery(".compare-property-label").fadeIn(1e3),i&&i.length){if((i=i.split(",")).length){for(var l=0;l<i.length;l++)jQuery('.houzez_compare[data-listing_id="'+i[l]+'"] i').removeClass("icon-add-circle").addClass("icon-subtract-circle"),jQuery('.houzez_compare[data-listing_id="'+i[l]+'"]').attr("title",r),jQuery('.houzez_compare[data-listing_id="'+i[l]+'"]').tooltip("hide").attr("data-original-title",r);jQuery(".compare-property-label").find(".compare-count").html(i.length)}}else i=[];jQuery(".houzez_compare").on("click",function(i){i.preventDefault();var l=houzezGetCookie("houzez_compare_listings");l=l&&l.length?l.split(","):[];var c=jQuery(this).data("listing_id"),d=l.indexOf(c.toString()),p=jQuery(this).parents(".item-wrap").find("img").attr("src");return -1==d?l.length>=n?alert(s):(jQuery(".compare-wrap").append('<div class="compare-item remove-'+c+'"><a href="" class="remove-compare remove-icon" data-listing_id="'+c+'"><i class="houzez-icon icon-remove-circle"></i></a><img class="img-fluid" src="'+p+'" width="200" height="150" alt="Thumb"></div>'),l.push(c.toString()),houzezSetCookie("houzez_compare_listings",l.join(","),30),jQuery(this).attr("title",r),jQuery(this).find("i").removeClass("icon-add-circle").addClass("icon-subtract-circle"),jQuery(".compare-property-label").find(".compare-count").html(l.length),jQuery("a.compare-btn").attr("href",e+"?ids="+houzezGetCookie("houzez_compare_listings")),jQuery(".compare-property-label").fadeIn(1e3),jQuery(this).toggleClass("active"),jQuery(".compare-property-active").addClass("compare-property-active-push-toleft"),jQuery("#compare-property-panel").addClass("compare-property-panel-open"),jQuery(this).tooltip("dispose").tooltip("show"),remove_from_compare(l,a,t,o,r)):(jQuery("div.remove-"+c).remove(),jQuery(this).attr("title",o),jQuery(this).find("i").removeClass("icon-subtract-circle").addClass("icon-add-circle"),l.splice(d,1),houzezSetCookie("houzez_compare_listings",l.join(","),30),jQuery(".compare-property-label").find(".compare-count").html(l.length),jQuery("a.compare-btn").attr("href",e+"?ids="+houzezGetCookie("houzez_compare_listings")),jQuery(this).tooltip("dispose").tooltip("show"),l.length>0?(jQuery(".compare-property-label").fadeIn(1e3),jQuery(this).toggleClass("active"),jQuery(".compare-property-active").addClass("compare-property-active-push-toleft"),jQuery("#compare-property-panel").addClass("compare-property-panel-open")):jQuery(".compare-property-label").fadeOut(1e3)),!1})}function remove_from_compare(e,a,t,o,r){jQuery(".remove-compare").on("click",function(a){a.preventDefault(),"object"==typeof e&&(e=e.toString()),e&&e.length?(e=e.split(",")).length&&jQuery(".compare-property-label").find(".compare-count").html(e.length):e=[],1==e.length&&jQuery(".compare-property-label").fadeOut(1e3);var t=jQuery(this).data("listing_id"),r=e.indexOf(t.toString());e.splice(r,1),houzezSetCookie("houzez_compare_listings",e.join(","),30),jQuery(".compare-property-label").find(".compare-count").html(e.length),jQuery(".compare-"+t).attr("title",o),jQuery(".compare-"+t).tooltip("hide").attr("data-original-title",o),jQuery(".compare-"+t).find("i").removeClass("icon-subtract-circle").addClass("icon-add-circle"),jQuery(this).parents(".compare-item").remove()})}function houzez_grid_call_to_action(){jQuery(".hz-call-popup-js").on("click",function(){var e=jQuery(this).data("model-id");jQuery("#"+e).appendTo("body"),jQuery("#"+e).modal("show")}),jQuery(".hz-email-popup-js").on("click",function(){var e=jQuery(this).data("model-id");jQuery("#"+e).appendTo("body"),jQuery("#"+e).modal("show")})}!function($){"use strict";var calDoughnutChart,countryRef,stateRef,cityRef,areasRef,$win=$(window),popupSliderLoaded=!1,houzezStickyTop=0,adminBarHeight=0,ajaxurl=houzez_vars.admin_url+"admin-ajax.php",compare_url=houzez_vars.compare_url,houzez_rtl=houzez_vars.houzez_rtl,userID=houzez_vars.user_id,wp_is_mobile=houzez_vars.wp_is_mobile,houzez_is_splash=houzez_vars.houzez_is_splash,prop_detail_nav=houzez_vars.prop_detail_nav,search_position=houzez_vars.search_position,is_singular_property=houzez_vars.is_singular_property,transparent_logo=houzez_vars.transparent_logo,is_transparent=houzez_vars.is_transparent,is_top_header=houzez_vars.is_top_header,houzez_date_language=houzez_vars.houzez_date_language,compare_add_icon=houzez_vars.compare_add_icon,add_compare_text=houzez_vars.add_compare_text,compare_remove_icon=houzez_vars.compare_remove_icon,remove_compare_text=houzez_vars.remove_compare_text,compare_limit=houzez_vars.compare_limit,compare_page_not_found=houzez_vars.compare_page_not_found,g_recaptha_version=houzez_vars.g_recaptha_version,for_rent=houzez_vars.for_rent,for_rent_price_slider=houzez_vars.for_rent_price_slider,search_price_range_min=parseInt(houzez_vars.search_min_price_range),search_price_range_max=parseInt(houzez_vars.search_max_price_range),search_price_range_min_rent=parseInt(houzez_vars.search_min_price_range_for_rent),search_price_range_max_rent=parseInt(houzez_vars.search_max_price_range_for_rent),get_min_price=parseInt(houzez_vars.get_min_price),get_max_price=parseInt(houzez_vars.get_max_price),currency_position=houzez_vars.currency_position,decimals=houzez_vars.decimals,decimal_point_separator=houzez_vars.decimal_point_separator,thousands_separator=houzez_vars.thousands_separator,currency_symb=houzez_vars.currency_symbol,is_halfmap=parseInt(houzez_vars.is_halfmap),houzez_reCaptcha=parseInt(houzez_vars.houzez_reCaptcha),prev_text=houzez_vars.prev_text,next_text=houzez_vars.next_text,keyword_search_field=houzez_vars.keyword_search_field,keyword_autocomplete=houzez_vars.keyword_autocomplete,autosearch_text=houzez_vars.autosearch_text,login_redirect_type=houzez_vars.redirect_type,login_redirect=houzez_vars.login_redirect,login_loading=houzez_vars.login_loading,paypal_connecting=houzez_vars.paypal_connecting,processing_text=houzez_vars.processing_text,is_edit_property=houzez_vars.is_edit_property,property_gallery_popup_type=houzez_vars.property_gallery_popup_type,simple_logo=houzez_vars.simple_logo,retina_logo=houzez_vars.retina_logo,mobile_logo=houzez_vars.mobile_logo,retina_logo_mobile=houzez_vars.retina_logo_mobile,retina_logo_mobile_splash=houzez_vars.retina_logo_mobile_splash,custom_logo_splash=houzez_vars.custom_logo_splash,retina_logo_splash=houzez_vars.retina_logo_splash,is_listing_gallery_slider=!1,top_banner_wrap_height=0,top_banner_wrap=$(".top-banner-wrap "),header_area=$(".header-main-wrap"),advanced_search_nav=$(".advanced-search-nav"),desktop_header_search_enabled=advanced_search_nav.data("sticky"),elementor_location_header=$(".elementor-location-header"),header_area_height=header_area.innerHeight(),elementor_location_header_height=elementor_location_header.innerHeight(),advanced_search_nav_height=advanced_search_nav.innerHeight(),header_nav=$("#header-section"),houzez_nav_sticky_height=header_nav.innerHeight(),only_nav_sticky=header_nav.data("sticky");houzezThemeGlobal.$body=$("body"),houzezThemeGlobal.$document=$(document),houzezThemeGlobal.$window=$(window),houzezThemeGlobal.houzezEleAddAction=function(e,a){houzezThemeGlobal.$window.on("elementor/frontend/init",function(){elementorFrontend.isEditMode()&&elementorFrontend.hooks.addAction(e,a)})};var houzez_is_mobile=/ipad|iphone|ipod|android|blackberry|webos|iemobile|windows phone/i.test(navigator.userAgent.toLowerCase());"yes"==prop_detail_nav&&is_singular_property&&(only_nav_sticky=0),null==elementor_location_header_height&&(elementor_location_header_height=0),null==header_area_height&&(header_area_height=0),null==advanced_search_nav_height&&(advanced_search_nav_height=0),houzez_rtl="yes"==houzez_rtl,1!==only_nav_sticky||(houzezStickyTop=houzez_nav_sticky_height,wp_is_mobile||(desktop_header_search_enabled=0));var houzezProductsTabs,alreadyProcessed,make_search_sticky_position=header_area_height+advanced_search_nav_height,searchStickyPlus=100,search_under_navigation=!0;wp_is_mobile&&(make_search_sticky_position+=40),$(document).ready(function(){top_banner_wrap_height=top_banner_wrap.innerHeight(),"under_banner"==search_position&&(make_search_sticky_position=header_area_height+top_banner_wrap_height,searchStickyPlus=0,wp_is_mobile&&(searchStickyPlus=60),is_transparent&&(searchStickyPlus=60),search_under_navigation=!1),null!=(adminBarHeight=$("#wpadminbar").innerHeight())&&(houzezStickyTop+=adminBarHeight)}),$(document).ready(function(){$("#video-background").length>0&&$("#video-background").data("vide").getVideoObject().play()}),document.addEventListener("DOMContentLoaded",function(){var e=[].slice.call(document.querySelectorAll(".houzez-lazyload"));if("IntersectionObserver"in window){let a=new IntersectionObserver(function(e,t){e.forEach(function(e){if(e.isIntersecting){let t=e.target;t.src=t.dataset.src,t.dataset.srcset&&(t.srcset=t.dataset.srcset),t.classList.remove("houzez-lazyload"),a.unobserve(t)}})});e.forEach(function(e){a.observe(e)})}}),(""!==retina_logo||""!=retina_logo_splash||""!=retina_logo_mobile||""!=retina_logo_mobile_splash)&&2==window.devicePixelRatio&&(""!=retina_logo&&$(".logo-desktop img").attr("src",retina_logo),""!=retina_logo_splash&&$(".logo-splash img").attr("src",retina_logo_splash),""!=retina_logo_mobile&&$(".logo-mobile img").attr("src",retina_logo_mobile)),$(".all-reviews").on("click",function(e){$(".hz-review-tab").trigger("click")}),$(function(){var e=$("#scroll-top");$(window).on("scroll",function(){if($(this).scrollTop()>300){e.fadeIn("fast").css("display","block");return}e.fadeOut("fast")}),e.on("click",function(e){e.preventDefault(),$("html, body").animate({scrollTop:0},"slow")})}),$(".tour-day-form-slide-arrow.next").click(function(e){$(".property-schedule-tour-day-form-slide").addClass("end"),$(".property-schedule-tour-day-form-slide").removeClass("start")}),$(".tour-day-form-slide-arrow.prev").click(function(e){$(".property-schedule-tour-day-form-slide").addClass("start"),$(".property-schedule-tour-day-form-slide").removeClass("end")}),alreadyProcessed=!1,$(".houzez-products-tabs-js").each(function(){var $this=$(this),$html_container=$this.find(".houzez-tab-content"),$products_cache=[];$this.find("ul.property-nav-tabs li").on("click",function(e){e.preventDefault();var $this=$(this),settings=$this.data("json"),data_index=$this.index();if(!(alreadyProcessed||$this.find("a").hasClass("active"))){if(alreadyProcessed=!0,$products_cache[data_index]){setTimeout(function(){$html_container.html($products_cache[data_index].html),alreadyProcessed=!1},300);return}$.ajax({url:ajaxurl,data:{action:"houzez_get_properties_tab_content",settings:settings},dataType:"json",method:"POST",beforeSend:function(){$html_container.empty().append('<div id="houzez-map-loading"><div class="mapPlaceholder"><div class="loader-ripple spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div></div>')},success:function(e){$products_cache[data_index]=e,$html_container.html(e.html),houzez_init_add_favorite(ajaxurl,userID),houzez_init_remove_favorite(ajaxurl,userID),houzez_listing_lightbox(ajaxurl,processing_text,houzez_rtl,userID),houzez_grid_image_gallery(),houzez_grid_call_to_action(),compare_for_ajax(),$('[data-toggle="tooltip"]').tooltip()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){alreadyProcessed=!1}})}})});var initPhotoSwipeFromDOM=function(e){for(var a=function(e){for(var a,t,o,r,s=e.childNodes,i=s.length,n=[],l=0;l<i;l++)1===(a=s[l]).nodeType&&(o=(t=a.children[0]).getAttribute("data-size").split("x"),r={src:t.getAttribute("href"),w:parseInt(o[0],10),h:parseInt(o[1],10)},a.children.length>1&&(r.title=a.children[1].innerHTML),t.children.length>0&&(r.msrc=t.children[0].getAttribute("src")),r.el=a,n.push(r));return n},t=function e(a,t){return a&&(t(a)?a:e(a.parentNode,t))},o=function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1;var a=t(e.target||e.srcElement,function(e){return e.tagName&&("FIGURE"===e.tagName.toUpperCase()||"DIV"===e.tagName.toUpperCase())});if(a){for(var o,r,i=a.parentNode,n=a.parentNode.childNodes,l=n.length,c=0,d=0;d<l;d++)if(1===n[d].nodeType){if(n[d]===a){r=c;break}c++}return r>=0&&s(r,i),!1}},r=function(){var e=window.location.hash.substring(1),a={};if(e.length<5)return a;for(var t=e.split("&"),o=0;o<t.length;o++){if(t[o]){var r=t[o].split("=");!(r.length<2)&&(a[r[0]]=r[1])}}return a.gid&&(a.gid=parseInt(a.gid,10)),a},s=function(e,t,o,r){var s,i,n,l=document.querySelectorAll(".pswp")[0];if(n=a(t),(i={galleryUID:t.getAttribute("data-pswp-uid"),getThumbBoundsFn:function(e){var a=n[e].el.getElementsByTagName("img")[0],t=window.pageYOffset||document.documentElement.scrollTop,o=a.getBoundingClientRect();return{x:o.left,y:o.top+t,w:o.width}}}).closeOnScroll=!1,i.bgOpacity=.95,i.showHideOpacity=!1,i.history=!1,r){if(i.galleryPIDs){for(var c=0;c<n.length;c++)if(n[c].pid==e){i.index=c;break}}else i.index=parseInt(e,10)-1}else i.index=parseInt(e,10);!isNaN(i.index)&&(o&&(i.showAnimationDuration=0),(s=new PhotoSwipe(l,PhotoSwipeUI_Default,n,i)).init())},i=document.querySelectorAll(e),n=0,l=i.length;n<l;n++)i[n].setAttribute("data-pswp-uid",n+1),i[n].onclick=o;var c=r();c.pid&&c.gid&&s(c.pid,i[c.gid-1],!0,!0)};if("photoswipe"==property_gallery_popup_type&&is_singular_property&&initPhotoSwipeFromDOM(".houzez-photoswipe"),2==window.devicePixelRatio&&transparent_logo&&(""!=retina_logo_splash&&(custom_logo_splash=retina_logo_splash),""!=retina_logo&&(simple_logo=retina_logo)),only_nav_sticky&&!wp_is_mobile&&(houzez_sticky_nav(),$(".compare-table").length>0)){var compare_top_margin=advanced_search_nav.outerHeight();$(".compare-table thead th").css("top",compare_top_margin+25)}function houzez_sticky_nav(){$(window).scroll(function(){var e=$(window).scrollTop(),a=$("#wpadminbar").height(),t=0,o=header_nav.outerHeight();if(t=o,0!=is_top_header){var r=$(".top-bar-wrap").height();t+=r}0!==only_nav_sticky&&(transparent_logo&&$(".logo-splash img").attr("src",simple_logo),"null"==a&&(a=0),e>header_area_height?(header_nav.addClass("sticky-nav-area"),header_nav.css("top",a),transparent_logo&&(header_area.removeClass("header-transparent-wrap"),$(".top-banner-wrap").css("margin-top","-"+t+"px"),$("body.houzez-header-elementor .content-wrap").css("margin-top","-"+t+"px"),$("#main-wrap > div.elementor").css("margin-top","-"+t+"px")),e>=header_area_height+20&&(header_nav.addClass("houzez-in-view"),$("#main-wrap").css("margin-top",o))):(header_nav.removeClass("sticky-nav-area"),header_nav.removeAttr("style"),transparent_logo&&(header_area.addClass("header-transparent-wrap"),$(".top-banner-wrap").css("margin-top",0),$("body.houzez-header-elementor .content-wrap").css("margin-top",0),$("#main-wrap > div.elementor").css("margin-top",0),$(".logo-splash img").attr("src",custom_logo_splash)),e<=header_area_height+20&&header_nav.removeClass("houzez-in-view"),$("#main-wrap").css("margin-top",0)))})}function houzez_sticky_search(){$(window).scroll(function(){var e=$(window).scrollTop(),a=$("#wpadminbar").height(),t=advanced_search_nav.outerHeight(),o=advanced_search_nav.data("hidden");"null"==a&&(a=0),e>=make_search_sticky_position?(advanced_search_nav.addClass("sticky-search-area"),o&&advanced_search_nav.removeClass("search-hidden"),wp_is_mobile||advanced_search_nav.css("top",a),e>=make_search_sticky_position+searchStickyPlus&&(advanced_search_nav.addClass("houzez-in-view"),o||$("#main-wrap").css("padding-top",t))):(advanced_search_nav.removeClass("sticky-search-area"),advanced_search_nav.removeAttr("style"),e<=make_search_sticky_position+20&&advanced_search_nav.removeClass("houzez-in-view"),o&&advanced_search_nav.addClass("search-hidden"),o||$("#main-wrap").css("padding-top",0))})}function houzez_mobile_sticky_nav(){$(window).scroll(function(){var e=$(window).scrollTop(),a=0,t=0,o=header_mobile.outerHeight();if(t=o,is_top_header){var r=$(".top-bar-wrap").height();t+=r}0!==mobile_sticky_nav&&("null"==a&&(a=0),e>header_area_height?(header_mobile.addClass("sticky-nav-area"),e>=header_area_height+20&&(header_mobile.addClass("houzez-in-view"),$("#main-wrap").css("margin-top",o))):(header_mobile.removeClass("sticky-nav-area"),header_mobile.removeAttr("style"),e<=header_area_height+20&&header_mobile.removeClass("houzez-in-view"),$("#main-wrap").css("margin-top",0)))})}desktop_header_search_enabled&&houzez_sticky_search();var addCommas=function(e){for(var a=(e+="").split("."),t=a[0],o=a.length>1?"."+a[1]:"",r=/(\d+)(\d{3})/;r.test(t);)t=t.replace(r,"$1,$2");return t+o},thousandSeparator=e=>{if("number"!=typeof e)return e;for(var a=(e+="").split("."),t=a[0],o=a.length>1?"."+a[1]:"",r=/(\d+)(\d{3})/;r.test(t);)t=t.replace(r,"$1"+thousands_separator+"$2");return t+o};function number_format(e){var a,t,o,r,s,i,n,l;return t=decimal_point_separator,o=thousands_separator,isNaN(a=Math.abs(a))&&(a=2),t=t||",",o=o||".",l=(s=(s=(r=parseInt(e=(+e||0).toFixed(a))+"").length)>3?s%3:0)?r.substr(0,s)+o:"",l+(i=r.substr(s).replace(/(\d{3})(?=\d)/g,"$1"+o))+(n=a?t+Math.abs(e-r).toFixed(a).replace(/-/,0).slice(2):"")}function calculateMonthlyPayment(e,a,t){let o=a/12/100,r=12*t;return 0===o?e/r:e*(o*Math.pow(1+o,r))/(Math.pow(1+o,r)-1)}function parseInput(e){let a=$(e).val();if(!a)return 0;let t=a.replace(/[^0-9.]/g,""),o=parseFloat(t);return isNaN(o)?0:o}function mortgage_calucaltion_section(){let e=parseInput("#homePrice"),a=parseInput("#downPaymentPercentage"),t=parseInput("#annualInterestRate"),o=parseInput("#loanTermInYears"),r=parseInput("#annualPropertyTaxRate"),s=parseInput("#annualHomeInsurance"),i=parseInput("#monthlyHOAFees"),n=parseInput("#pmi"),l=e*(a/100),c=e-l,d=calculateMonthlyPayment(c,t,o),p=e*(r/100)/12,u=s/12,h=l/e<.2,m=h?c*(n/100)/12:0,f=d+p+u+i+m,g=e-l,v=number_format(l),z=number_format(g),y=number_format(d),b=number_format(p),w=number_format(u),k=h?number_format(m):"",_=number_format(i),C=number_format(f);$("#downPaymentResult").html(currencyFormate(v)),$("#loadAmountResult").html(currencyFormate(z)),$("#monthlyMortgagePaymentResult").html(currencyFormate(y)),$("#monthlyPropertyTaxResult").html(currencyFormate(b)),$("#monthlyHomeInsuranceResult").html(currencyFormate(w)),h?($(".rslt-pmi").show(),$("#monthlyPMIResult").html(currencyFormate(k))):$(".rslt-pmi").hide(),$("#monthlyHOAResult").html(currencyFormate(_)),$("#m_monthly_val").html(currencyFormate(C));let x=[{label:"Monthly Mortgage Payment",value:d,color:"#ff6384"},{label:"Property Tax",value:p,color:"#36a2eb"},{label:"Home Insurance",value:u,color:"#ffce56"},{label:"HOA",value:i,color:"#c2d500"},];h&&x.push({label:"PMI",value:m,color:"#4bc0c0"}),updateChart(x)}$("#houzez-calculator-form").length>0&&($("#houzez-calculator-form input").on("input",()=>{mortgage_calucaltion_section()}),mortgage_calucaltion_section());let inputElements=document.querySelectorAll("#calculator-form input");function updateChart(e){let a=$("#mortgage-calculator-chart")[0].getContext("2d");window.myChart&&window.myChart.destroy(),window.myChart=new Chart(a,{type:"doughnut",data:{datasets:[{data:e.map(e=>e.value),backgroundColor:e.map(e=>e.color)}]},options:{cutoutPercentage:85,responsive:!1,tooltips:!1}})}function currencyFormate(e){var a;return""==currency_position||""==currency_symb?e:a="after"===currency_position?e+""+currency_symb:currency_symb+""+e}if(inputElements.forEach(e=>{e.addEventListener("input",()=>{formatInputValue(e),updateResults()})}),houzez_listing_lightbox(ajaxurl,processing_text,houzez_rtl,userID),$(window).on("load",function(){houzez_grid_image_gallery(),houzez_grid_call_to_action()}),$("#stats-property-cities").length>0){var chartData=$("#stats-property-cities").data("chart"),ctx=document.getElementById("stats-property-cities").getContext("2d");new Chart(ctx,{type:"doughnut",data:{datasets:[{data:chartData,backgroundColor:["rgba(255, 99, 132, 0.5)","rgba(54, 162, 235, 0.5)","rgba(255, 206, 86, 0.5)","rgba(75, 192, 192, 0.5)"],borderColor:["rgba(255 ,99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)"],borderWidth:1}]},options:{cutoutPercentage:60,responsive:!1,tooltips:!1}})}if($("#stats-property-status").length>0){var chartData=$("#stats-property-status").data("chart"),ctx=document.getElementById("stats-property-status").getContext("2d");new Chart(ctx,{type:"doughnut",data:{datasets:[{data:chartData,backgroundColor:["rgba(255, 99, 132, 0.5)","rgba(54, 162, 235, 0.5)","rgba(255, 206, 86, 0.5)","rgba(75, 192, 192, 0.5)"],borderColor:["rgba(255 ,99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)"],borderWidth:1}]},options:{cutoutPercentage:60,responsive:!1,tooltips:!1}})}if($("#stats-property-types").length>0){var chartData=$("#stats-property-types").data("chart"),ctx=document.getElementById("stats-property-types").getContext("2d");new Chart(ctx,{type:"doughnut",data:{datasets:[{data:chartData,backgroundColor:["rgba(255, 99, 132, 0.5)","rgba(54, 162, 235, 0.5)","rgba(255, 206, 86, 0.5)","rgba(75, 192, 192, 0.5)"],borderColor:["rgba(255 ,99, 132, 1)","rgba(54, 162, 235, 1)","rgba(255, 206, 86, 1)","rgba(75, 192, 192, 1)"],borderWidth:1}]},options:{cutoutPercentage:60,responsive:!1,tooltips:!1}})}var houzez_login_modal=function(){jQuery("#login-register-form").modal("show"),jQuery(".login-form-tab").addClass("active show"),jQuery(".modal-toggle-1.nav-link").addClass("active")};$("#houzez-login-btn").on("click",function(e){e.preventDefault();var a=$(this);houzez_login(a)}),$("#houzez-register-btn").on("click",function(e){e.preventDefault();var a=$(this);houzez_register(a)});var houzez_login=function(currnt){var $form=currnt.parents("form"),$messages=$("#hz-login-messages");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:$form.serialize(),beforeSend:function(){currnt.find(".houzez-loader-js").addClass("loader-show")},complete:function(){currnt.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){e.success?($messages.empty().append('<div class="alert alert-success" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>"),window.location.replace(e.redirect_to)):$messages.empty().append('<div class="alert alert-danger" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>"),currnt.find(".houzez-loader-js").removeClass("loader-show"),1==houzez_reCaptcha&&($form.find(".g-recaptcha-response").remove(),"v3"==g_recaptha_version?houzezReCaptchaLoad():houzezReCaptchaReset())},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},houzez_register=function(currnt){var $form=currnt.parents("form"),$messages=$("#hz-register-messages");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:$form.serialize(),beforeSend:function(){currnt.find(".houzez-loader-js").addClass("loader-show")},complete:function(){currnt.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){e.success?($messages.empty().append('<div class="alert alert-success" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>"),setTimeout(function(){$('a[href="#login-form-tab"]').tab("show")},2e3)):$messages.empty().append('<div class="alert alert-danger" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>"),currnt.find(".houzez-loader-js").removeClass("loader-show"),1==houzez_reCaptcha&&($form.find(".g-recaptcha-response").remove(),"v3"==g_recaptha_version?houzezReCaptchaLoad():houzezReCaptchaReset())},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})};$("#houzez_forgetpass").on("click",function(){var user_login=$("#user_login_forgot").val(),security=$("#fave_resetpassword_security").val(),$this=$(this),$messages=$("#reset_pass_msg");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"houzez_reset_password",user_login:user_login,security:security},beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){e.success?$messages.empty().append('<div class="alert alert-success" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>"):$messages.empty().append('<div class="alert alert-danger" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}),$("#houzez_reset_password").length>0&&$("#houzez_reset_password").click(function(e){e.preventDefault();var a=$(this),t=$('input[name="rp_login"]').val(),o=$('input[name="rp_key"]').val(),r=$('input[name="pass1"]').val(),s=$('input[name="pass2"]').val(),i=$('input[name="fave_resetpassword_security"]').val(),n=$("#reset_pass_msg_2");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:{action:"houzez_reset_password_2",rq_login:t,password:r,confirm_pass:s,rp_key:o,security:i},beforeSend:function(){a.find(".houzez-loader-js").addClass("loader-show")},complete:function(){a.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){e.success?(n.empty().append('<div class="alert alert-success" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>"),jQuery("#oldpass, #newpass, #confirmpass").val("")):n.empty().append('<div class="alert alert-danger" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.msg+"</div>")},error:function(e){}})}),$(".hz-facebook-login").on("click",function(){var e=$(this);houzez_login_via_facebook(e)});var houzez_login_via_facebook=function(current){var $messages=$(".hz-social-messages");$.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"houzez_facebook_login_oauth"},beforeSend:function(){$messages.empty().append('<div class="alert alert-success" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+login_loading+"</div>"),current.find(".houzez-loader-js").addClass("loader-show")},complete:function(){current.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){e.success?window.location.replace(e.url):$messages.empty().append('<div class="alert alert-danger" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+e.message+"</div>")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})};$(".hz-google-login").on("click",function(){var e=$(this);houzez_login_via_google(e)});var properties_module_section,houzez_login_via_google=function(current){var $form=current.parents("form"),$messages=$("#hz-login-messages");$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_google_login_oauth"},beforeSend:function(){$messages.empty().append('<div class="alert alert-success" role="alert"><i class="houzez-icon icon-check-circle-1 mr-1"></i>'+login_loading+"</div>"),current.find(".houzez-loader-js").addClass("loader-show")},complete:function(){current.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){window.location.replace(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})};$("#properties_module_section").length>0&&$("body").on("click",".fave-load-more a",function(e){e.preventDefault();var $this=$(this),$wrap=$this.closest("#properties_module_section").find("#module_properties"),prop_limit=$this.data("prop-limit"),paged=$this.data("paged"),card_version=$this.data("card"),type=$this.data("type"),status=$this.data("status"),state=$this.data("state"),city=$this.data("city"),country=$this.data("country"),area=$this.data("area"),label=$this.data("label"),user_role=$this.data("user-role"),featured_prop=$this.data("featured-prop"),offset=$this.data("offset"),sortby=$this.data("sortby");$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_loadmore_properties",prop_limit:prop_limit,paged:paged,card_version:card_version,type:type,status:status,state:state,city:city,country:country,area:area,label:label,user_role:user_role,featured_prop:featured_prop,sort_by:sortby,offset:offset},beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){if("no_result"==e){$this.closest("#properties_module_section").find(".fave-load-more").fadeOut("fast").remove();return}$this.closest("#properties_module_section").find("#module_properties").append(e),$this.data("paged",paged+1),$this.find("i").remove(),houzez_init_add_favorite(ajaxurl,userID),houzez_init_remove_favorite(ajaxurl,userID),houzez_listing_lightbox(ajaxurl,processing_text,houzez_rtl,userID),houzez_grid_image_gallery(),houzez_grid_call_to_action(),compare_for_ajax(),$('[data-toggle="tooltip"]').tooltip()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})});var property_status_changed=function(e,a){e==for_rent?(a.find(".prices-for-all").addClass("hide"),a.find(".prices-for-all select").attr("disabled","disabled"),a.find(".prices-only-for-rent").removeClass("hide"),a.find(".prices-only-for-rent select").removeAttr("disabled","disabled"),a.find(".prices-only-for-rent select").selectpicker("refresh")):(a.find(".prices-only-for-rent").addClass("hide"),a.find(".prices-only-for-rent select").attr("disabled","disabled"),a.find(".prices-for-all").removeClass("hide"),a.find(".prices-for-all select").removeAttr("disabled","disabled"),a.find(".prices-for-all select").selectpicker("refresh"))};$(".status-js").on("change",function(e){var a=$(this).val(),t=$(this).parents("form");property_status_changed(a,t)}),$(".status-tab-js").on("click",function(){var e=$(this).data("val"),a=$(this).parents("form");property_status_changed(e,a)});var selected_status=$(".status-js").val();if(selected_status==for_rent){var $form=$(".houzez-search-form-js");property_status_changed(selected_status,$form)}else{var $form=$(".houzez-search-form-js");property_status_changed("dummy",$form)}var selected_status_tab=$(".status-tab-js").val();if(selected_status_tab==for_rent){var $tab_form=$(".houzez-search-builder-form-js");property_status_changed(selected_status_tab,$tab_form)}else{var $tab_form=$(".houzez-search-builder-form-js");property_status_changed(selected_status_tab,$tab_form)}var price_range_search=function(e,a){if($(".price-range").slider({range:!0,min:e,max:a,values:[e,a],slide:function(e,a){if("after"==currency_position)var t=thousandSeparator(a.values[0])+currency_symb,o=thousandSeparator(a.values[1])+currency_symb;else var t=currency_symb+thousandSeparator(a.values[0]),o=currency_symb+thousandSeparator(a.values[1]);$(".min-price-range-hidden").val(a.values[0]),$(".max-price-range-hidden").val(a.values[1]),$(".min-price-range").text(t),$(".max-price-range").text(o)},stop:function(e,a){},change:function(e,a){}}),"after"==currency_position)var t=thousandSeparator($(".price-range").slider("values",0))+currency_symb,o=thousandSeparator($(".price-range").slider("values",1))+currency_symb;else var t=currency_symb+thousandSeparator($(".price-range").slider("values",0)),o=currency_symb+thousandSeparator($(".price-range").slider("values",1));$(".min-price-range").text(t),$(".max-price-range").text(o),$(".min-price-range-hidden").val($(".price-range").slider("values",0)),$(".max-price-range-hidden").val($(".price-range").slider("values",1))};function insertParam(e,a){e=encodeURI(e),a=encodeURI(a);for(var t,o=document.location.search.substr(1).split("&"),r=o.length;r--;)if((t=o[r].split("="))[0]==e){t[1]=a,o[r]=t.join("=");break}r<0&&(o[o.length]=[e,a].join("=")),document.location.search=o.join("&")}$(".price-range").length>0&&1!=is_halfmap&&($(".status-js").val()==for_rent_price_slider?price_range_search(search_price_range_min_rent,search_price_range_max_rent):price_range_search(search_price_range_min,search_price_range_max),$(".status-js").on("change",function(){$(this).val()==for_rent_price_slider?price_range_search(search_price_range_min_rent,search_price_range_max_rent):price_range_search(search_price_range_min,search_price_range_max)}),$(".status-tab-js").on("click",function(){$(this).data("val")==for_rent_price_slider?price_range_search(search_price_range_min_rent,search_price_range_max_rent):price_range_search(search_price_range_min,search_price_range_max)})),$(".houzez-status-tabs li a").on("click",function(e){e.preventDefault();var a=$(this).data("val");$("#search-tabs").val(a);var t=$(".houzez-search-form-js");property_status_changed(a,t)}),$("#sort_properties").on("change",function(){var e="sortby",a=$(this).val();insertParam(e,a)}),$("#insights_filter").on("change",function(){var e="listing_id",a=$(this).val();insertParam(e,a)}),$("#houzez-gmap-full").on("click",function(){var e=$(this);e.hasClass("active")?(e.removeClass("active"),e.parents(".map-wrap").removeClass("houzez-fullscreen-map")):(e.parents(".map-wrap").addClass("houzez-fullscreen-map"),e.addClass("active"))}),$(".houzez_agent_property_form").on("click",function(e){e.preventDefault();var $result,$form_wrap,$this=$(this),$form=$this.parents("form");$result=$this.parents(".property-form-wrap").find(".form_messages");var $is_bottom=$(".is_bottom").val();"bottom"==$is_bottom&&($result=$form.find(".form_messages")),$result.empty(),$.ajax({url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},success:function(e){e.success?($form.find('input[name="name"], input[name="mobile"], input[name="email"]').val(""),$form.find("textarea").val(""),"bottom"==$is_bottom?$result.empty().append('<div class="alert alert-success alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'):$result.empty().append('<p class="success text-success"><i class="fa fa-check"></i> '+e.msg+"</p>")):"bottom"==$is_bottom?$result.empty().append('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'):$result.empty().append('<p class="error text-danger"><i class="fas fa-times"></i> '+e.msg+"</p>"),$this.find(".houzez-loader-js").removeClass("loader-show"),1==houzez_reCaptcha&&($form.find(".g-recaptcha-response").remove(),"v3"==g_recaptha_version?houzezReCaptchaLoad():houzezReCaptchaReset()),""!=houzez_vars.agent_redirection&&e.success&&setTimeout(function(){window.location.replace(houzez_vars.agent_redirection)},500)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")}})}),$(".msg-login-required").on("click",function(){$(".modal-toggle-1").addClass("active"),jQuery(".login-form-tab").addClass("active show")}),$(".houzez-send-message").on("click",function(e){e.preventDefault();var $result,$form_wrap,$this=$(this),$form=$this.parents("form");$result=$this.parents(".property-form-wrap").find(".form_messages");var $is_bottom=$(".is_bottom").val();"bottom"==$is_bottom&&($result=$form.find(".form_messages")),$result.empty();var property_id=$('input[name="listing_id"]').val(),message=$form.find(".hz-form-message").val(),security=$('input[name="property_agent_contact_security"]').val();$.ajax({url:ajaxurl,data:{action:"houzez_start_thread",property_id:property_id,message:message,start_thread_form_ajax:security},method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},success:function(e){e.success?($form.find('input[name="name"], input[name="mobile"], input[name="email"]').val(""),$form.find("textarea").val(""),"bottom"==$is_bottom?$result.empty().append('<div class="alert alert-success alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'):$result.empty().append('<p class="success text-success"><i class="fa fa-check"></i> '+e.msg+"</p>")):"bottom"==$is_bottom?$result.empty().append('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'):$result.empty().append('<p class="error text-danger"><i class="fas fa-times"></i> '+e.msg+"</p>"),$this.find(".houzez-loader-js").removeClass("loader-show"),1==houzez_reCaptcha&&($form.find(".g-recaptcha-response").remove(),"v3"==g_recaptha_version?houzezReCaptchaLoad():houzezReCaptchaReset()),""!=houzez_vars.agent_redirection&&setTimeout(function(){window.location.replace(houzez_vars.agent_redirection)},500)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")}})}),$(".start_thread_message_form").on("click",function(e){e.preventDefault();var a=$(this),t=a.parents("form");t.find(".form_messages"),$.ajax({url:ajaxurl,data:t.serialize(),method:t.attr("method"),dataType:"JSON",beforeSend:function(){a.find(".houzez-loader-js").addClass("loader-show")},success:function(e){a.find(".houzez-loader-js").removeClass("loader-show"),window.location.replace(e.url)},complete:function(){a.find(".houzez-loader-js").removeClass("loader-show")}})}),$("#contact_realtor_btn").on("click",function(e){e.preventDefault();var current_element=$(this),$this=$(this),$form=$this.parents("form");jQuery.ajax({type:"post",url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},success:function(e){e.success?$(".form_messages").empty().append('<div class="alert alert-success alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'):$(".form_messages").empty().append('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'),$this.find(".houzez-loader-js").removeClass("loader-show"),1==houzez_reCaptcha&&($form.find(".g-recaptcha-response").remove(),"v3"==g_recaptha_version?houzezReCaptchaLoad():houzezReCaptchaReset())},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")}})}),$("#invoice_status, #invoice_type").change(function(){houzez_invoices_filter()}),$("#startDate, #endDate").focusout(function(){houzez_invoices_filter()});var houzez_invoices_filter=function(){var inv_status=$("#invoice_status").val(),inv_type=$("#invoice_type").val(),startDate=$("#startDate").val(),endDate=$("#endDate").val();$.ajax({url:ajaxurl,dataType:"json",type:"POST",data:{action:"houzez_invoices_ajax_search",invoice_status:inv_status,invoice_type:inv_type,startDate:startDate,endDate:endDate},success:function(e){e.success&&$("#invoices_content").empty().append(e.result)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})};if(0!=keyword_autocomplete){ajaxCount=0,auto_complete_container=$(".auto-complete"),lastLenght=0,$(".houzez-keyword-autocomplete").keyup(function(){var e=$(this),a=e.data("type"),t=e.parents("form");if("banner"==a)var o=$("#houzez-auto-complete-banner");else var o=t.find(".auto-complete");var r=$(this).val(),s=(r=$.trim(r)).length;s>=2&&s!=lastLenght?(lastLenght=s,o.fadeIn(),$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_get_auto_complete_search",key:r},beforeSend:function(){1==++ajaxCount&&o.html('<ul class="list-group"><li class="list-group-item"><i class="fa fa-spinner fa-spin fa-fw"></i> '+autosearch_text+"</li></ul>")},success:function(e){0==--ajaxCount&&(o.show(),""!=e&&o.empty().html(e).bind())},error:function(e){0==--ajaxCount&&o.html('<ul class="list-group"><li class="list-group-item"><i class="fa fa-spinner fa-spin fa-fw"></i> '+autosearch_text+"</li></ul>")}})):s!=lastLenght&&o.fadeOut()}),auto_complete_container.on("click","li",function(){$(".houzez-keyword-autocomplete").val($(this).data("text")),auto_complete_container.fadeOut()}).bind()}function setAutoCompleteResultPosition(){var e=$(".top-banner-wrap").innerHeight(),a=$(".banner-caption").innerHeight(),t=e-(e-a)/2;$("#houzez-auto-complete-banner").css("top",t)}$(".save_search_click").on("click",function(e){e.preventDefault();var $this=$(this),search_args=$('input[name="search_args"]').val(),security=$('input[name="houzez_save_search_ajax"]').val(),search_URI=$('input[name="search_URI"]').val();0===parseInt(userID,10)?houzez_login_modal():$.ajax({url:ajaxurl,data:{action:"houzez_save_search",search_args:search_args,search_URI:search_URI,houzez_save_search_ajax:security},method:"POST",dataType:"JSON",beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},success:function(e){e.success&&$(".save_search_click").attr("disabled",!0)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")}})}),$(".schedule_contact_form").on("click",function(e){e.preventDefault();var $this=$(this),$form=$this.parents("form"),$result=$form.find(".form_messages");$.ajax({url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},success:function(e){e.success?($form.find('input[name="name"], input[name="phone"], input[name="email"]').val(""),$form.find("textarea").val(""),$result.empty().append('<div class="alert alert-success alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'),""!=e.redirect_to&&setTimeout(function(){window.location.replace(e.redirect_to)},500)):$result.empty().append('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>')},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")}})}),$(window).on("load",function(){setAutoCompleteResultPosition()}),$win.on("resize",function(){setAutoCompleteResultPosition()}),$(".houzez-print").length>0&&$(".houzez-print").on("click",function(e){var propID,printWindow;e.preventDefault(),propID=$(this).attr("data-propid"),printWindow=window.open("","Print Me","width=800 ,height=842"),$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_create_print",propid:propID},success:function(e){printWindow.document.write(e),printWindow.document.close(),printWindow.focus()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})});var review_likes=function(){$(".hz-like-dislike-js").on("click",function(e){e.preventDefault();var hideMessage,$this=jQuery(this),$parent=$this.parents(".likes-container-js");if($this.hasClass("already-voted"))$parent.find(".vote-msg").text($this.data("msg")).show(),setTimeout(function(){$parent.find(".vote-msg").hide()},3e3);else{var review_id=$this.data("id"),type=$this.data("type");$.ajax({type:"post",url:ajaxurl,dataType:"JSON",data:{action:"reviews_likes_dislikes",type:type,review_id:review_id},beforeSend:function(){$parent.find(".vote-msg").empty(),$parent.find(".houzez-loader-js").addClass("loader-show"),"likes"==type?$(".review-dislike-button a").removeClass("already-voted"):"dislikes"==type&&$(".review-like-button a").removeClass("already-voted")},success:function(e){e.success&&($parent.find(".likes-count").text(e.likes),$parent.find(".dislikes-count").text(e.dislikes)),$parent.find(".vote-msg").text(e.msg).show(),setTimeout(function(){$parent.find(".vote-msg").hide()},3e3),$this.addClass("already-voted")},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$parent.find(".houzez-loader-js").removeClass("loader-show")}})}})};review_likes(),$("#submit-review").on("click",function(e){e.preventDefault();var $this=$(this),$form=$this.parents("form"),$result=$form.find(".form_messages");$.ajax({url:ajaxurl,data:$form.serialize(),method:$form.attr("method"),dataType:"JSON",beforeSend:function(){$this.find(".houzez-loader-js").addClass("loader-show")},success:function(e){e.success?($result.empty().append('<div class="alert alert-success alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'),window.location.replace(e.review_link)):$result.empty().append('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>')},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){$this.find(".houzez-loader-js").removeClass("loader-show")}})});var listing_review_ajax=function(sortby,listing_id,paged){var review_container=$("#houzez_reviews_container"),review_post_type=$('input[name="review_post_type"]').val();$.ajax({type:"post",url:ajaxurl,data:{action:"houzez_ajax_review",sortby:sortby,listing_id:listing_id,review_post_type:review_post_type,paged:paged},beforeSend:function(){review_container.empty().append('<div id="houzez-map-loading"><div class="mapPlaceholder"><div class="loader-ripple spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div></div>'),$("html, body").animate({scrollTop:$("#property-review-wrap").offset().top-50},"slow")},success:function(e){review_container.empty(),review_container.html(e),review_likes()},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)},complete:function(){}})};function houzezSelectFilter(e,a,t="",o=""){var r=e.data("target"),s=e.find(":selected").data("ref");"yes"==o&&(r=t,s=a),$("select."+r).val(""),null==s?$("select."+r).find("option").each(function(){console.log("inside undefined"),$(this).removeAttr("disabled hidden")}):$("select."+r).find("option").each(function(){var e=$(this).data("belong"),a=$(this).val();s!=e&&""!=a?($(this).prop("disabled",!0),$(this).prop("hidden",!0)):($(this).prop("disabled",!1),$(this).prop("hidden",!1))}),$("select."+r).selectpicker("refresh")}if($("#sort_review").length>0&&$("#sort_review").on("change",function(){var e=$(this).val(),a=$('input[name="listing_id"]').val(),t=1;$("#review_paged").val(t),$("#review_prev").attr("disabled",!0),$("#review_next").attr("disabled",!1),listing_review_ajax(e,a,t)}),$("#review_next").length>0&&$("#review_next").on("click",function(e){e.preventDefault(),$("#review_prev").removeAttr("disabled");var a=$("#sort_review").val(),t=$("#total_pages").val(),o=$('input[name="listing_id"]').val(),r=$("#review_paged").val();r=Number(r)+1,$("#review_paged").val(r),r==t&&$(this).attr("disabled",!0),listing_review_ajax(a,o,r)}),$("#review_prev").length>0&&$("#review_prev").on("click",function(e){e.preventDefault(),$("#review_next").removeAttr("disabled");var a=$("#sort_review").val(),t=$('input[name="listing_id"]').val(),o=$("#review_paged").val();o=Number(o)-1,$("#review_paged").val(o),o<=1&&$(this).attr("disabled",!0),listing_review_ajax(a,t,o)}),$(".houzezSelectFilter").on("change",function(){var e=$(this);houzezSelectFilter(e)}),$(".houzez-search-form-js").length>0||$("#location").length>0){if(is_edit_property?(countryRef=$("#country").data("country"),stateRef=$("#countyState").data("state"),cityRef=$("#city").data("city"),areasRef=$("#neighborhood").data("area")):(countryRef=houzez_vars.s_country,stateRef=houzez_vars.s_state,cityRef=houzez_vars.s_city,areasRef=houzez_vars.s_areas),($(".houzez-country-js").length>0||$("#country").length>0)&&""!=countryRef){var countryFilter=$(".houzezCountryFilter");houzezSelectFilter(countryFilter,countryRef,"houzezSecondList","yes"),$(window).load(function(){$(".houzezSecondList").val(stateRef),$("select.houzezSecondList").selectpicker("refresh")})}if(($(".houzez-state-js").length>0||$("#countyState").length>0)&&""!=stateRef){var stateFilter=$(".houzezStateFilter");houzezSelectFilter(stateFilter,stateRef,"houzezThirdList","yes"),$(window).load(function(){$(".houzezThirdList").val(cityRef),$("select.houzezThirdList").selectpicker("refresh")})}if(($(".houzez-city-js").length>0||$("#city").length>0)&&""!=cityRef){var cityFilter=$(".houzezCityFilter");houzezSelectFilter(cityFilter,cityRef,"houzezFourthList","yes"),$(window).load(function(){$(".houzezFourthList").val(areasRef),$("select.houzezFourthList").selectpicker("refresh")})}}$("#houzez_mortgage_calculate").length>0&&$("#houzez_mortgage_calculate").click(function(e){e.preventDefault();var a,t,o=houzez_vars.monthly_payment,r=houzez_vars.weekly_payment,s=houzez_vars.bi_weekly_payment,i=houzez_vars.currency_symbol,n=0,l=0,c=0,d=0,p=0,u=0,h=0,m=0,f=0,g=$("#mc_term_years").val();if(a=$("#mc_payment_period").val(),n=$("#mc_total_amount").val().replace(/,/g,""),l=$("#mc_down_payment").val().replace(/,/g,""),p=n-l,c=parseInt($("#mc_term_years").val(),10)*a,h=Math.pow(1+(u=(d=parseFloat($("#mc_interest_rate").val(),10))/(100*a)),-c),f=(m=p*(u/(1-h)))*a,""!=$("#mc_term_years").val()&&""!=$("#mc_total_amount")&&""!=$("#mc_down_payment")&&""!=$("#mc_interest_rate")){var v=m*g*a,z=v+parseInt(l);"12"==a?t=o:"26"==a?t=s:"52"==a&&(t=r),"after"==currency_position?($("#mortgage_mwbi").html("<strong>"+t+"</strong>: <span>"+Math.round(100*m)/100+i+"</span>"),$("#amount_financed").html(Math.round(100*p)/100+i),$("#mortgage_pay").html(Math.round(100*m)/100+i),$("#annual_cost").html(Math.round(100*f)/100+i),$("#balance_payable_with_interest").html(Math.round(100*v)/100+i),$("#total_with_down_payment").html(Math.round(100*z)/100+i)):($("#mortgage_mwbi").html("<strong>"+t+"</strong>: <span>"+i+Math.round(100*m)/100+"</span>"),$("#amount_financed").html(i+Math.round(100*p)/100),$("#mortgage_pay").html(i+Math.round(100*m)/100),$("#annual_cost").html(i+Math.round(100*f)/100),$("#balance_payable_with_interest").html(i+Math.round(100*v)/100),$("#total_with_down_payment").html(i+Math.round(100*z)/100)),$("#cal_years").html(g),$(".mortgage-details").show()}});var beds_baths=function(e,a,t){$("."+e).on("click",function(o){o.preventDefault();var r=parseInt($("."+t).val())||0;if("btn_count_plus"==e||"btn_beds_plus"==e)r++;else{if(0==r)return;r--}$("."+a).text(r),$("."+t).val(r)})};function paypal_option(e){$(e).attr("checked")?$(e).parents(".payment-method-block").next(".recurring-payment-wrap").slideDown():$(e).parents(".payment-method-block").next(".recurring-payment-wrap").slideUp()}beds_baths("btn_count_plus","baths_count","bathrooms"),beds_baths("btn_count_minus","baths_count","bathrooms"),beds_baths("btn_beds_plus","beds_count","bedrooms"),beds_baths("btn_beds_minus","beds_count","bedrooms"),$(".btn-apply").on("click",function(e){e.preventDefault(),$(".advanced-search-v3 .btn-group .dropdown-menu").removeClass("show")}),$(".clear-baths").on("click",function(e){e.preventDefault(),$(".baths_count").text("0"),$(".bathrooms").val("")}),$(".clear-beds").on("click",function(e){e.preventDefault(),$(".beds_count").text("0"),$(".bedrooms").val("")}),$(".clear-checkboxes").on("click",function(e){e.preventDefault(),$(this).parents(".btn-group").find('input[type="checkbox"]').prop("checked",!1).attr("checked",!1)}),$(".method-select input").on("change",function(){$(this).is(":checked")?($(".recurring-payment-wrap").slideUp(),$(this).parents(".payment-method-block").next(".recurring-payment-wrap").slideDown()):$(".recurring-payment-wrap").slideUp()}),paypal_option(".paypal-method"),paypal_option(".stripe-method"),$("button.stripe-button-el span").prepend('<i class="fa fa-credit-card"></i>'),$("#stripe_package_recurring").click(function(){$(this).attr("checked")?$(".houzez_payment_form").append('<input type="hidden" name="houzez_stripe_recurring" id="houzez_stripe_recurring" value="1">'):$("#houzez_stripe_recurring").remove()}),$(".prop_featured").on("change",function(){var e,a,t,o=houzez_vars.currency_symbol,r=houzez_vars.currency_position,s=parseFloat($("#submission_price").text()),i=parseFloat($("#submission_featured_price").text());return e=s+i,"after"===r?(t=s+""+o,a=e+""+o):(t=o+""+s,a=o+""+e),$(this).is(":checked")?($("#submission_total_price").text(a),$("#featured_pay").val(1),$('input[name="pay_ammout"]').val(100*e),$("#houzez_listing_price").val(e)):($("#submission_total_price").text(t),$("#featured_pay").val(0),$('input[name="pay_ammout"]').val(100*s),$("#houzez_listing_price").val(s)),!1}),$("#houzez_complete_order").on("click",function(e){var a,t,o,r,s,i;e.preventDefault(),t=$("input[name='houzez_payment_type']:checked").val(),s=$("input[name='featured_pay']").val(),i=$("input[name='is_upgrade']").val(),a=$("input[name='relist_mode']").val(),r=$("#houzez_property_id").val(),o=$("#houzez_listing_price").val(),"paypal"==t?(fave_processing_modal(paypal_connecting),paypal_per_listing_payment(r,s,i,a)):"stripe"==t?(fave_processing_modal(processing_text),stripe_per_listing_payment(r,s,i,a)):"direct_pay"==t&&(fave_processing_modal(processing_text),bank_transfer_per_listing(r,o))});var ajaxCount,auto_complete_container,lastLenght,selected_status_adv_search,houzezAutoComplete,areaSwitcherList,currencySwitcherList,paypal_per_listing_payment=function(property_id,is_prop_featured,is_prop_upgrade,relist_mode){$.ajax({type:"post",url:ajaxurl,data:{action:"houzez_property_paypal_payment",prop_id:property_id,is_prop_featured:is_prop_featured,is_prop_upgrade:is_prop_upgrade,relist_mode:relist_mode},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},stripe_per_listing_payment=function(property_id,is_prop_featured,is_prop_upgrade,relist_mode){$.ajax({type:"post",url:ajaxurl,dataType:"JSON",data:{action:"houzez_property_stripe_payment",prop_id:property_id,is_prop_featured:is_prop_featured,is_prop_upgrade:is_prop_upgrade,relist_mode:relist_mode},success:function(e){e.status?window.location.href=e.paymeny_link:alert(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},bank_transfer_per_listing=function(e,a){var t=$('input[name="featured_pay"]').val(),o=$('input[name="is_upgrade"]').val();jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_direct_pay_per_listing",prop_id:e,is_featured:t,is_upgrade:o},success:function(e){window.location.href=e},error:function(e){}})},houzez_stripe_package_payment=function(houzez_package_id,is_stripe_recurring){$.ajax({type:"POST",url:ajaxurl,dataType:"JSON",data:{action:"houzez_stripe_package_payment",package_id:houzez_package_id,is_stripe_recurring:is_stripe_recurring},success:function(e){e.status?window.location.href=e.paymeny_link:alert(e.message)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},houzez_paypal_package_payment=function(houzez_package_price,houzez_package_name,houzez_package_id){$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_paypal_package_payment",houzez_package_price:houzez_package_price,houzez_package_name:houzez_package_name,houzez_package_id:houzez_package_id},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},houzez_recuring_paypal_package_payment=function(houzez_package_price,houzez_package_name,houzez_package_id){jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_recuring_paypal_package_payment",houzez_package_name:houzez_package_name,houzez_package_id:houzez_package_id,houzez_package_price:houzez_package_price},success:function(e){window.location.href=e},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})},direct_bank_transfer_package=function(e,a,t){jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_direct_pay_package",selected_package:e},success:function(e){window.location.href=e},error:function(e){}})},houzez_free_membership_package=function(e){jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_free_membership_package",selected_package:e},success:function(e){window.location.href=e},error:function(e){}})},houzez_membership_data=function(e){var a=$("input[name='houzez_payment_type']:checked").val(),t=$("input[name='houzez_package_price']").val(),o=$("input[name='houzez_package_id']").val(),r=$("#houzez_package_name").text();if("paypal"==a)fave_processing_modal(paypal_connecting),$("#paypal_package_recurring").is(":checked")?houzez_recuring_paypal_package_payment(t,r,o):houzez_paypal_package_payment(t,r,o);else if("stripe"==a){fave_processing_modal(processing_text);var s=$("#houzez_stripe_recurring").is(":checked");houzez_stripe_package_payment(o,s)}else"direct_pay"==a?(fave_processing_modal(processing_text),direct_bank_transfer_package(o,t,r)):(fave_processing_modal(processing_text),houzez_free_membership_package(o));return!1},houzez_register_user_with_membership=function(currnt){var $form=currnt.parents("form"),$messages=$("#packmem-msgs");$.ajax({type:"post",url:ajaxurl,dataType:"json",data:$form.serialize(),beforeSend:function(){currnt.find(".houzez-loader-js").addClass("loader-show")},complete:function(){currnt.find(".houzez-loader-js").removeClass("loader-show")},success:function(e){e.success?houzez_membership_data(currnt):($("html, body").animate({scrollTop:$(".frontend-submission-page").offset().top},"slow"),$messages.empty().append('<div class="alert alert-danger alert-dismissible fade show" role="alert">'+e.msg+'<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button></div>'))},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})};if($("#houzez_complete_membership").on("click",function(e){e.preventDefault();var a=$(this);if(0===parseInt(userID,10)||void 0==userID){houzez_register_user_with_membership(a);return}houzez_membership_data(a)}),$("#area-switcher-list-js").length>0&&$("#area-switcher-list-js > li").on("click",function(e){var selectedAreaCode=$(this).data("area-code");if(selectedAreaCode){$("#houzez-switch-to-area").val(selectedAreaCode);var houzez_switch_to_area=$("#houzez-switch-to-area").val();fave_processing_modal(processing_text),$.ajax({url:ajaxurl,dataType:"JSON",method:"POST",data:{action:"houzez_switch_area",switch_to_area:houzez_switch_to_area},success:function(e){e.success?window.location.reload(!0):console.log(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}}),$("#hz-currency-switcher-list").length>0&&$("#hz-currency-switcher-list > li").on("click",function(e){var selectedCurrencyCode=$(this).data("currency-code");if(selectedCurrencyCode){$("#houzez-switch-to-currency").val(selectedCurrencyCode);var houzez_switch_to_currency=$("#houzez-switch-to-currency").val();fave_processing_modal(processing_text),$.ajax({url:ajaxurl,dataType:"JSON",method:"POST",data:{action:"houzez_currency_converter",currency_converter:selectedCurrencyCode},success:function(e){e.success?window.location.reload(!0):console.log(e)},error:function(xhr,status,error){var err=eval("("+xhr.responseText+")");console.log(err.Message)}})}}),$('[data-toggle="tooltip"]').tooltip(),$(".advanced-search-dropdown").on("click",function(e){e.stopPropagation()}),$(".agent-show-onClick").on("click",function(e){$(this).toggleClass("agent-phone-hidden")}),$(".dropdown-menu span.dropdown-toggle").on("click",function(e){return $(this).next().hasClass("show")||$(this).parents(".dropdown-menu").first().find(".show").removeClass("show"),$(this).next(".dropdown-menu").toggleClass("show"),$(this).parents("li.nav-item.dropdown.show").on("hidden.bs.dropdown",function(e){$(".dropdown-submenu .show").removeClass("show")}),!1}),$.fn.nodoubletapzoom=function(){$(this).bind("touchstart",function e(a){var t=a.timeStamp,o=$(this).data("lastTouch")||t,r=t-o,s=a.originalEvent.touches.length;$(this).data("lastTouch",t),!r||r>500||s>1||(a.preventDefault(),$(this).trigger("click").trigger("click"))})},$(".nav-mobile").length>0){var smm_transform=256;houzez_rtl&&(smm_transform=-256);var slideout_left=new Slideout({panel:document.getElementById("main-wrap"),menu:document.getElementById("nav-mobile"),padding:smm_transform,tolerance:70,side:"left",easing:"cubic-bezier(.32,2,.55,.27)"});slideout_left.disableTouch()}if($("#main-wrap").length>0){var smd_transform=256;houzez_rtl&&(smd_transform=-256);var slideout_right=new Slideout({panel:document.getElementById("main-wrap"),menu:document.getElementById("navi-user"),padding:smd_transform,tolerance:70,side:"right",easing:"cubic-bezier(.32,2,.55,.27)"});slideout_right.disableTouch()}$(".toggle-button-left, #nav-mobile .nav-link:not(.dropdown-toggle)").on("click",function(){slideout_left.toggle(),$(".slideout-menu-left").toggleClass("open")}),$(".toggle-button-right").on("click",function(){slideout_right.toggle(),$(".slideout-menu-right").toggleClass("open")}),$(document).on("mouseup",function(e){var a=$(".nav-mobile"),t=$(".toggle-button-left"),o=$("#nav-mobile"),r=$(".toggle-button-right"),s=$("#navi-user");!a.is(e.target)&&0===a.has(e.target).length&&o.hasClass("open")&&!t.is(e.target)&&0===t.has(e.target).length&&(slideout_left.toggle(),$(".slideout-menu-left").toggleClass("open")),!a.is(e.target)&&0===a.has(e.target).length&&s.hasClass("open")&&!r.is(e.target)&&0===r.has(e.target).length&&(slideout_right.toggle(),$(".slideout-menu-right").toggleClass("open"))}),$(function(){$(".distance-range").length>0&&$(".distance-range").slider()});var header_parallax=$(".parallax");function setSectionHeight(){var e=$(window).innerHeight()-header_area_height;e-=advanced_search_nav_height,e-=elementor_location_header_height,$(window).width()>=767?$(".half-map-left-wrap, .half-map-right-wrap").css("height",e):($(".map-on-right .half-map-right-wrap").css("height",e),$(".map-on-right .half-map-left-wrap").css("height","100vh"),$(".map-on-left .half-map-right-wrap").css("height",e),$(".map-on-left .half-map-left-wrap").css("height","100vh"))}header_parallax.length>0&&header_parallax.parallaxBackground({parallaxBgPosition:"center center",parallaxBgRepeat:"no-repeat",parallaxBgSize:"cover",parallaxSpeed:"0.25"}),$(document).ready(function(){$(".mobile-search-nav").click(function(){$("#overlay-search-advanced-module").toggleClass("open")})}),$(document).ready(function(){$(".overlay-search-module-close, .overly_is_halfmap .half-map-search-js-btn").click(function(){$("#overlay-search-advanced-module").toggleClass("open")})}),setSectionHeight(),$win.on("resize",function(){setSectionHeight()}),$(".switch-btn").on("click",function(){$(".switch-btn").removeClass("active"),$(this).addClass("active"),$(this).hasClass("btn-list")?$(".listing-view").removeClass("grid-view").addClass("list-view"):$(this).hasClass("btn-grid")&&$(".listing-view").removeClass("list-view").addClass("grid-view")}),$(document).ready(function(){$(".show-compare-panel").click(function(){$(this).toggleClass("active"),$(".compare-property-active").addClass("compare-property-active-push-toleft"),$("#compare-property-panel").addClass("compare-property-panel-open")}),$(".close-compare-panel").click(function(){$(this).toggleClass("active"),$(".compare-property-active").removeClass("compare-property-active-push-toleft"),$("#compare-property-panel").removeClass("compare-property-panel-open")})});var property_banner_slider=$(".property-slider");if(property_banner_slider.length>0){var autoplay=property_banner_slider.data("autoplay"),slider_loop=property_banner_slider.data("loop"),slider_speed=property_banner_slider.data("speed"),s_loop=!1;1==slider_loop&&(s_loop=!0),property_banner_slider.slick({rtl:houzez_rtl,autoplay:autoplay,autoplaySpeed:slider_speed,lazyLoad:"ondemand",infinite:s_loop,speed:300,slidesToShow:1,arrows:!0,adaptiveHeight:!0})}var property_detail_gallery=$("#property-gallery-js");property_detail_gallery.length>0&&property_detail_gallery.lightSlider({rtl:houzez_rtl,gallery:!0,item:1,thumbItem:8,slideMargin:0,speed:500,adaptiveHeight:!0,auto:!1,loop:!0,prevHtml:'<button type="button" class="slick-prev slick-arrow"></button>',nextHtml:'<button type="button" class="slick-next slick-arrow"></button>',onSliderLoad:function(){property_detail_gallery.removeClass("cS-hidden")}});var lightbox_slider_js=$("#lightbox-slider-js");lightbox_slider_js.length>0&&(lightbox_slider_js.slick({rtl:houzez_rtl,lazyLoad:"ondemand",infinite:!0,speed:300,slidesToShow:1,arrows:!0,adaptiveHeight:!0}),$(".houzez-trigger-popup-slider-js").on("click",function(e){e.preventDefault();var a=parseInt($(this).data("slider-no"));setTimeout(function(){lightbox_slider_js.slick("slickGoTo",a-1)},200)}));var listing_slider_variable_width=$(".listing-slider-variable-width");listing_slider_variable_width.length>0&&(listing_slider_variable_width.slick({rtl:houzez_rtl,lazyLoad:"ondemand",infinite:!0,speed:300,slidesToShow:1,centerMode:!0,variableWidth:!0,arrows:!0,adaptiveHeight:!0}),$(".property-detail-v5 #pills-gallery-tab").on("click",function(){listing_slider_variable_width.hasClass("hz-slick-refreshed")||setTimeout(function(){listing_slider_variable_width.slick("setPosition"),listing_slider_variable_width.slick("refresh"),listing_slider_variable_width.addClass("hz-slick-refreshed")},0)}));var testimonials_slider_v1=$(".testimonials-slider-wrap-v1");testimonials_slider_v1.length>0&&testimonials_slider_v1.slick({rtl:houzez_rtl,lazyLoad:"ondemand",infinite:!0,autoplay:!0,speed:300,slidesToShow:1,arrows:!0,adaptiveHeight:!0,dots:!0,appendArrows:".testimonials-module-slider-v1",prevArrow:'<button type="button" class="slick-prev btn-primary-outlined">'+prev_text+"</button>",nextArrow:'<button type="button" class="slick-next btn-primary-outlined">'+next_text+"</button>"});var testimonials_slider_v2=$(".testimonials-slider-wrap-v2");testimonials_slider_v2.length>0&&testimonials_slider_v2.slick({rtl:houzez_rtl,lazyLoad:"ondemand",infinite:!0,autoplay:!0,speed:300,slidesToShow:3,arrows:!0,adaptiveHeight:!0,dots:!0,appendArrows:".testimonials-module-slider-v2",prevArrow:'<button type="button" class="slick-prev btn-primary-outlined">'+prev_text+"</button>",nextArrow:'<button type="button" class="slick-next btn-primary-outlined">'+next_text+"</button>",responsive:[{breakpoint:992,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:769,settings:{slidesToShow:1,slidesToScroll:1}}]});var partners_carousel=$(".partners-slider-wrap");partners_carousel.length>0&&partners_carousel.slick({rtl:houzez_rtl,lazyLoad:"ondemand",infinite:!0,speed:300,slidesToShow:4,arrows:!0,adaptiveHeight:!0,dots:!0,appendArrows:".partners-module-slider",prevArrow:$(".partner-prev-js"),nextArrow:$(".partner-next-js"),responsive:[{breakpoint:992,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:769,settings:{slidesToShow:1,slidesToScroll:1}}]});var widget_featured_carousel=$(".widget-featured-property-slider");widget_featured_carousel.length>0&&widget_featured_carousel.slick({rtl:houzez_rtl,speed:300,slidesToShow:1,arrows:!0,adaptiveHeight:!0,dots:!0,responsive:[{breakpoint:992,settings:{slidesToShow:1,slidesToScroll:1}},{breakpoint:769,settings:{slidesToShow:1,slidesToScroll:1}}]}),$(document).ready(function(){$(".btn-expand").click(function(){$(".lightbox-gallery-wrap").toggleClass("lightbox-gallery-full-wrap"),$("#lightbox-slider-js").slick("refresh")}),$(".btn-email").click(function(){$(".lightbox-form-wrap").toggleClass("lightbox-form-wrap-show")})});var houzez_listing_nav=$(".property-navigation-wrap");function setCalendarCellHeight(){var e=$(".block-availability-calendars .search-calendar li").innerWidth();$(".block-availability-calendars .search-calendar li").css("height",e),$(".block-availability-calendars .search-calendar li").css("line-height",e+"px")}houzez_listing_nav.length>0&&($(document).scroll(function(){var e=$(this).scrollTop();houzez_listing_nav.css("top",houzezStickyTop),e>300?houzez_listing_nav.fadeIn(250):houzez_listing_nav.fadeOut(0)}),$(".property-navigation-item a.target").click(function(e){e.preventDefault(),$("html, body").animate({scrollTop:$($(this).attr("href")).offset().top-84},500)}),$(window).on("scroll",function(){$(".property-section-wrap").each(function(){if($(window).scrollTop()>=$(this).offset().top-86){var e=$(this).attr("id");$(".target").removeClass("active"),$('.target[href="#'+e+'"]').addClass("active")}else 0>=$(window).scrollTop()&&$(".target").removeClass("active")})})),setCalendarCellHeight(),$win.on("resize",function(){setCalendarCellHeight()}),$(".login-link a").on("click",function(){$(".modal-toggle-1").addClass("active"),$(".modal-toggle-2").removeClass("active"),$(".register-form-tab").removeClass("active").removeClass("show"),$(".login-form-tab").addClass("active").addClass("show")}),$(".register-link a").click(function(){$(".modal-toggle-2").addClass("active"),$(".modal-toggle-1").removeClass("active"),$(".register-form-tab").addClass("active").addClass("show"),$(".login-form-tab").removeClass("active").removeClass("show")}),$(".db_input_date").length>0&&$(".db_input_date").datepicker({format:"yyyy-mm-dd",clearBtn:!0,autoclose:!0,language:houzez_date_language}),houzez_is_mobile||$(".deals-table-wrap").length>0&&$(".deals-table-wrap").overlayScrollbars({overflowBehavior:{x:"scroll",y:"scroll"}});var listing_nav_area_height=$(".property-navigation-wrap").innerHeight();function resizeMasonryItem(e){var a=document.getElementsByClassName("masonry")[0],t=parseInt(window.getComputedStyle(a).getPropertyValue("grid-row-gap")),o=parseInt(window.getComputedStyle(a).getPropertyValue("grid-auto-rows")),r=Math.ceil((e.querySelector(".masonry-content").getBoundingClientRect().height+t)/(o+t));e.style.gridRowEnd="span "+r}function resizeAllMasonryItems(){for(var e=document.getElementsByClassName("masonry-brick"),a=0;a>e.length;a++)resizeMasonryItem(e[a])}if(null==listing_nav_area_height&&(listing_nav_area_height=0),$(".houzez_sticky").length>0&&$(".houzez_sticky").theiaStickySidebar({additionalMarginTop:houzezStickyTop+advanced_search_nav_height+listing_nav_area_height,minWidth:768,updateSidebarHeight:!1}),$(".page-template-blog-masonry").length>0){var waitForImages=function(){for(var e=document.getElementsByClassName("masonry-brick"),a=0;a<e.length;a++)imagesLoaded(e[a],function(e){resizeMasonryItem(e.elements[0])})};["load","resize"].forEach(function(e){window.addEventListener(e,resizeAllMasonryItems)}),waitForImages()}var splash_slider_wrap=$(".splash-slider-wrap");function getWindowWidth(){return Math.max($(window).width(),window.innerWidth)}function getWindowHeight(){return Math.max($(window).height(),window.innerHeight)}splash_slider_wrap.length>0&&splash_slider_wrap.slick({rtl:houzez_rtl,lazyLoad:"ondemand",adaptiveHeight:!0,autoplay:!0,infinite:!0,speed:300,fade:!0,slidesToShow:1,arrows:!1}),houzez_init_add_favorite(ajaxurl,userID),houzez_init_remove_favorite(ajaxurl,userID),houzez_check_favourites(userID),$(".houzez-woocommerce-pay").on("click",function(e){e.preventDefault();let a=$(this).data("listid"),t=$(this).data("featured");fave_processing_modal(processing_text),$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_perlist_woo_pay",listing_id:a,is_featured:t},success:function(e){!1!=e.success?window.location.href=houzez_vars.woo_checkout_url:jQuery("#fave_modal").modal("hide")},error:function(e){}})}),$(".houzez-woocommerce-package").on("click",function(e){if(e.preventDefault(),0===parseInt(userID,10)||void 0==userID)jQuery("#login-register-form").modal("show"),jQuery(".login-form-tab").addClass("active show"),jQuery(".modal-toggle-1.nav-link").addClass("active");else{let a=$(this).data("packid");fave_processing_modal(processing_text),$.ajax({type:"POST",url:ajaxurl,data:{action:"houzez_woo_pay_package",package_id:a},success:function(e){!1!=e.success?window.location.href=houzez_vars.woo_checkout_url:jQuery("#fave_modal").modal("hide")},error:function(e){}})}});var setTopBannerFullScreen=function(){var e=0,a=0,t=0,o=0,r=$(window).innerHeight(),s=$("#wpadminbar"),i=$(".top-bar-wrap"),n=s.outerHeight();a=r-header_area_height,header_area.hasClass("header-transparent-wrap")?(i.length&&(t=i.outerHeight()),o=getWindowHeight()-(t+n)):(header_area.length&&advanced_search_nav.length&&!advanced_search_nav.hasClass("search-hidden")?e=parseInt(header_area_height)+parseInt(advanced_search_nav_height):header_area.length&&(e=parseInt(header_area_height)),o=getWindowHeight()-(e+n)),$(".top-banner-wrap-fullscreen").css("height",o)};function compare_for_ajax(){var e=houzezGetCookie("houzez_compare_listings");add_to_compare(compare_url,compare_add_icon,compare_remove_icon,add_compare_text,remove_compare_text,compare_limit,e,4),remove_from_compare(e,compare_add_icon,compare_remove_icon,add_compare_text,remove_compare_text)}!houzez_is_splash&&$(".top-banner-wrap-fullscreen").length>0&&($(document).ready(function(){setTopBannerFullScreen()}),$(window).on("resize",function(){setTopBannerFullScreen()})),$(document).ready(function(){$(".compare-property-label").on("click",function(){$(this).toggleClass("active"),$(".compare-property-active").addClass("compare-property-active-push-toleft"),$("#compare-property-panel").addClass("compare-property-panel-open")}),$(".close-compare-panel").on("click",function(){$(this).toggleClass("active"),$(".compare-property-active").removeClass("compare-property-active-push-toleft"),$("#compare-property-panel").removeClass("compare-property-panel-open")});var e=houzezGetCookie("houzez_compare_listings");add_to_compare(compare_url,compare_add_icon,compare_remove_icon,add_compare_text,remove_compare_text,compare_limit,e,4),remove_from_compare(e,compare_add_icon,compare_remove_icon,add_compare_text,remove_compare_text)}),$(".houzez-onepage-mode .header-main-wrap .main-nav li.nav-item a.nav-link").on("click",function(e){var a=$(this).attr("href");window.history.pushState({houzezTheme:!0},"",a)})}(jQuery);