$.fn.clickbox=$.fn.clickbox||function(){return this};var shareListingOnFacebook=function(){var loc=window.location.href,hash=loc.indexOf("#"),url=loc.substring(0,-1!=hash?hash:loc.length),fbUrl="https://www.facebook.com/sharer.php?u="+encodeURIComponent(url+"?ts=fb");if(window.open(fbUrl,"_blank","resizable=1,toolbar=0,status=0,width=626,height=436,noopener noreferrer"),url.split("/propertyid/").length>1){var propertyId=url.split("/propertyid/")[1].slice(0,-1),mlsId=url.split("/mlsid/")[1].split("/")[0];$.post("/ajax/prospectlisting/fbevent/",{propertyId:propertyId,mlsId:mlsId})}};function openGetMoreInfo(){new URL(window.location.href).searchParams.has("getMoreInfo")&&setTimeout((()=>{var getMoreInfo=document.getElementById("js-get-more-info-listing");null!=getMoreInfo&&getMoreInfo.click()}),6e3)}function scrollToElement(toElementId,offsetTop){$("html, body").animate({scrollTop:$("#"+toElementId).offset().top-offsetTop},800)}$((function(){$("#recentSalesBlock").on("click",(function(e){scrollToElement("RecentSales",0)})),$("#featuredListingsBlock").on("click",(function(e){scrollToElement("FeaturedListings",0)})),$("#searchtype").on("change",(function(){$(this).closest("form").trigger("submit")})),$("#addListing",".view-listing-buttons").on("click",(function(e){e.preventDefault(),$("body").append('<form id="jsAddListingForm" action ="'+this.href+'" method="post"><input type="hidden" name="formredirect" value="'+(window.location.pathname+window.location.hash)+'" /></form>').find("#jsAddListingForm").trigger("submit")})),$(document).on("click",".js-listingdetail-view-link",(function(event){if(!(event.currentTarget.className.indexOf("favorite")>-1)){event.preventDefault();var url=$(this).attr("href");url||(url=$(this).attr("data-link")),url&&(document.location.href=url)}})),$("#propertytypeSelect").on("change",(function(e){e.preventDefault();var locationUrl="/featuredlistings/",propertytype=$("#propertytypeSelect").val();propertytype&&(locationUrl+="propertytype/"+propertytype+"/"),window.location.href=window.location.protocol+"//"+location.host+locationUrl})),"loading"==document.readyState?document.addEventListener("DOMContentLoaded",openGetMoreInfo):openGetMoreInfo()}));