'; } if (!reviewer) { msg += '- Please enter a display name'; } if (msg !== '') { this.addAlert('failure', msg); } else { return true; } } return false; }, request: function() { var $ = jQuery; if (this.validate()) { var data = this.data.get(); var params = { action: 'newStoreReview', review: base.prepareJsonUrl(data) }, ajaxurl = '/wp-admin/admin-ajax.php'; $.post(ajaxurl, params, base.bind(this, this.requestResponse)); } }, requestResponse: function(response) { this.addAlert('success', response); this.form.reset(); }, addAlert: function(type, msg) { var alertPanel = new AlertPanel({ type: type, msg: msg }); alertPanel.setup(this.alertContainer); }, addRatingContainer: function() { var layout = { className: 'stars-container', children: [] }; var ratings = 5, self = this; for (var i = ratings; i > 0; i--) { var number = i, id = 'ratingStar' + number, starInput = { tag: 'input', type: 'radio', id: id, name: 'modal-rating', value: number, checked: (number === 5), change: function() { self.data.set('rating', this.value) } }, starLabel = { tag: 'label', 'aria-label': number + ' stars', for: id, innerHTML: '' }; layout.children.push(starInput); layout.children.push(starLabel); } return layout; }, addDataInput: function() { return { tag: 'input', type: 'text', autocomplete: 'off', className: 'name-reviewer val', bind: 'reviewer', required: true, placeholder: 'John D.' }; }, addDataReview: function() { return { tag: 'textarea', name: 'review', autocomplete: 'off', className: 'review-message val', bind: 'review', required: true, placeholder: 'What did you think?' }; }, getTitle: function() { return 'Leave a Review'; } }); var AlertPanel = base.Component.extend( { render: function() { return { className: this.getPanelClass(), innerHTML: this.msg }; }, getPanelClass: function() { return this.type === 'success' ? 'saveSuccess' : 'saveFailure'; }, msgTimeOut: function (fade) { var self = this; window.setTimeout(function() { bpApp.animate.hide(self.panel, 'fadeOut', 500, function() { self.destroy(); } ); }, fade); } }); var VideoPanel = Modal.extend( { modalClassName: 'video-panel', addBodyContent: function() { return { tag: 'iframe', src: this.src, allow: 'autoplay' }; } });	(function(f,g){var n=jQuery("#nav-scroll-container")[0],m=new f.Navigation;m.setup(n);f.addModule({setup:function(){var a=jQuery("#sticky-header")[0];if(a){var b=400,d=jQuery("#sticky-scroll-height");d[0]&&(b=d.height());new f.scrollHeader(a,"sticky",b)}this.addEvents()},addEvents:function(){var a=this;jQuery("#main-nav-toggle").on("click",function(){a.toggleNav();document.body.classList.toggle("menu-open")})},navHidden:!0,toggleNav:function(){var a=jQuery(".top-banner-row"),b=jQuery("#main-nav-toggle"), d=jQuery("#main-nav-container"),c=jQuery(".bottom-bar"),e=jQuery(".bottom-bar.inner");!0===this.navHidden?(this.navHidden=!1,a.addClass("opened nav-d"),d.addClass("open"),b.addClass("nav-close"),c.addClass("nav-d"),767>jQuery(g).width()?e.css({bottom:"60px",position:"fixed"}):e.css("position","fixed"),m.selectPrimaryGroup()):(this.navHidden=!0,a.removeClass("opened nav-d"),d.removeClass("open"),b.removeClass("nav-close"),c.removeClass("nav-d"),e.css({position:"relative",bottom:"0px"}))}});var l=f.addModule({create:function(a, b){switch(a||"controller"){case "controller":this.controller(b);break;case "office":this.office(b);break;case "reviews":this.reviews(b)}},controller:function(a){var b=jQuery("#slides")[0];if(!b)return!1;var d=b.querySelectorAll(".single-slide");d=this.getStart(d);var c=this.tryProp(a,"animationIn")||"fadeIn",e=this.tryProp(a,"animationOut")||"fadeOut";a=this.tryProp(a,"duration")||7E3;(new f.SlideController({onNumber:d,defaultPathUrl:"",duration:a,animationIn:c,animationOut:e})).setup(b)},tryProp:function(a, b){if(a)return a[b]},getStart:function(a){return Math.round(Math.random()*(a.length-1))},createSlideShow:function(a,b,d,c,e){a=jQuery("#"+a)[0];e=this.getStart(c);b=new f.SlideShow({onNumber:e,defaultPathUrl:b,slides:c,setAsBg:d,duration:7E3});b.setup(a);return b},addSlide:function(a,b,d,c,e,h,k){return{title:d,content:c,className:e,image:a,alt:b,url:h,crumbContent:k}},office:function(a,b){this.createSlideShow(b||"tour","/images/slideshow/",!1,a)},reviews:function(a){this.createSlideShow("reviews", "",!1,a)}});g.DefaultSlider=function(a){l.create("controller",a)};g.OfficeSlider=function(a,b){l.office(a,b)};g.ReviewSlider=function(a){if(a)for(var b=0,d=a.length;bh&&(h=100);e.height=h},addEvents:function(){var e=this;jQuery(this.element).on("load resize",function(){e.setHeight()})}}),b=document.querySelectorAll(".services-iframe"),d=b.length,c=0;c