//Maurice Murphy custom.js
document.addEventListener("DOMContentLoaded", function () {
const company = account_info.website_owner_type==="company";
const office = account_info.website_owner_type==="entity";
const team = account_info.website_owner_type==="entity"&& account_info.is_team_site===true;
const agent = account_info.website_owner_type === "user";
kvCorrections();
credits();
//If in site editor disable aos slide in effect
if ( (window.location.href.indexOf("?editkey=") > -1) ) {
$("#aos-stylesheet").attr("disabled", "disabled");
}
//If not in site editor...
if ( !(window.location.href.indexOf("?editkey=") > -1) ) {
if (agent && !account_info.secondarylogo.includes("null")) {
$('#home-bodycontent .cover-title-inner').html(`
`).show();
} else {
$('#home-bodycontent .cover .cover-title').css('top','48%');
$('#home-bodycontent .cover-title-inner').html('');
$('#home-bodycontent .cover-title-inner').append($('#hero-title-inner')).show();
}
$('#home-bodycontent #custom-quick-search #quick-search-title').after('');
//If you have testimonials and custom testimonials section exists
if ( $('#testimonials-carousel').length && $('#testimonials-wrapper').length ) {
//Remove unnecessary markup
$('#testimonials h1').remove();
$('#testimonials .carousel-control').remove();
//Clone testimonials and add them to custom section on home page
$('#testimonials-wrapper .content').prepend($('#testimonials'));
//Remove default Testimonials section from bottom on home page
$('.header-transparent #testimonials-carousel').remove();
$('#testimonials-carousel #testimonials').removeClass('fade-in').addClass('slide').attr('data-interval','20000');
} else {
//If no testimonials, remove custom testimonial section on home page
$('#testimonials-wrapper').remove();
}
$('#home-bodycontent #about').addClass('skew skew-top skew-bottom background-white section-inverse p-t-2 p-b-3');
$('#home-bodycontent #about .container').attr('data-aos','fade-up');
$('#home-bodycontent #latest-blogs').addClass('skew skew-top skew-bottom section-inverse');
$('#home-bodycontent #latest-blogs .col-lg-6:nth-child(even)').attr('data-aos','fade-right');
$('#home-bodycontent #latest-blogs .col-lg-6:nth-child(odd)').attr({'data-aos':'fade-left', 'data-aos-delay':'300'});
//Areas We Cover
$('#home-bodycontent div h1:contains("Areas We Cover")').closest('div.p-t-3.p-b-3.background-white').attr('id','areas-we-cover');
$('#home-bodycontent #areas-we-cover').addClass('skew skew-top');
$('#home-bodycontent #areas-we-cover .container').addClass('p-t-3').attr('data-aos','fade-up');
//Add footer assets
$('#footer .footer-top-right').append('');
}
AOS.init();
//Initialize owl carousel for new build partner images
if ( $('.partner-carousel').length) {
var script = document.createElement("script");
script.type = "text/javascript";
script.innerHTML = 'jQuery(document).ready(function($){$(".partner-carousel").owlCarousel({ \
loop:true,\
margin:10, \
autoplay:true, \
autoplayTimeout:3000, \
autoplayHoverPause:true, \
loop:true, \
nav:false, \
responsiveClass:true,\
responsive:{\
0:{\
items:3 \
},\
576:{\
items:3 \
},\
768:{\
items:4 \
},\
992:{\
items:6 \
},\
1200:{\
items:8 \
}\
}\
})\
});';
document.body.appendChild(script);
}
if ( $('#newhomesource-search').length) {
document.getElementById("HomeSearchBtnWidget").onclick=function(event){var searchText=document.getElementById("SearchTextWidget").value;if(searchText===""||typeof(searchText)=="undefined"){document.querySelector("#home-search-form #WidgetSearchValidationError").style.display='block';window.event.preventDefault();}else{document.querySelector("#home-search-form #WidgetSearchValidationError").style.display='none';}};
}
function kvCorrections() {
$('#quick_header_search').attr('aria-label','Search By Area');
$('#horizontal-search #location_search').attr('aria-label','Search By Area');
$('#horizontal-search #qs-submit').attr('aria-label','Submit');
$('.footer-bottom .nav .nav-item:nth-child(5) img').attr('alt','Equal Housing Opportunity');
} //END KVCORRECTIONS
function credits() {
var year = new Date().getFullYear();
$(`
`).appendTo(".footer-bottom");
} //END CREDITS
});