",{text:t}))}),$(".contact-alert").parent().removeClass("hide")}function a(){var e=$(".errors");e.empty(),$(".contact-alert").parent().addClass("hide")}var t="";window.recaptchaCallback=function(){grecaptcha.render("recaptcha",{sitekey:"6Ld_jBUTAAAAAB1LBn2Tky2uq5E0yC7xnCzbWdqR",callback:function(e){t=e,$("#recaptcha").hide()}})},$.fn.serializeObject=function(){"use strict";var e={},a=function(a,t){var n=e[t.name];"undefined"!=typeof n&&null!==n?$.isArray(n)?n.push(t.value):e[t.name]=[n,t.value]:e[t.name]=t.value};return $.each(this.serializeArray(),a),e},$("#contact").on({focus:function(){$(this).parent().addClass("active")},blur:function(){$(this).parent().removeClass("active")}},"input, textarea"),$("#contact-submit").on("click",function(t){var n=$("#contact").serializeObject(),c=[];return a(),""==n.name.trim()&&c.push("Please leave your name."),(""==n.email.trim()||""==n.phone.trim())&&c.push("Please leave an email or phone number."),""==n.message.trim()&&c.push("Please leave a small message."),3==c.length&&(c=["Please fill out the entire form."]),c.length?(e(c),!1):(n.url=window.location.href,$.ajax({url:"/contact",method:"post",data:$.param(n),dataType:"json",cache:!1,success:function(a){return a.success?($("#contact").addClass("hide"),$(".contact-title").addClass("hide"),void $("#contact-thankyou").removeClass("hide")):void e([a.message])},error:function(a,t){e(["We couldn't send your contact form. Please email sales@realtytci.com."])}}),!1)})},1e3)});