').html(data.Message).text();\n $processing.hide();\n $copy.html(message);\n $response.show();\n if ($response.length !== 0) {\n $response[0].scrollIntoView({ block: 'center', behavior: 'smooth' });\n }\n },\n url: action,\n });\n }\n\n function onSubmit(e) {\n var success = Validation.validateForm(e);\n Utility.log('onSubmit submission', e);\n\n if (success) {\n sendSuccessTrackingObject(false);\n send(e.target);\n }\n\n e.preventDefault();\n return false;\n }\n\n function toogleZipCodeRequired(e) {\n var checkbox = e.target;\n\n if (checkbox.checked && $zipInput && !$zipInput.hasClass(requiredClass)) {\n $zipInput.addClass(requiredClass);\n $zipInput.attr(requiredAttr, requiredAttr);\n } else if ($zipInput) {\n $zipInput.removeClass(requiredClass);\n $zipInput.removeAttr(requiredAttr);\n $zipInput.siblings(errorTextClass).html('');\n $zipInput.parent().removeClass(errorStateClass);\n }\n }\n\n function initSelectors(element) {\n $element = $(element);\n $input = $element.find('input');\n $form = $element.find('form');\n $processing = $element.find(processingClass);\n $body = $element.find(bodyClass);\n $copy = $element.find(copyClass);\n $response = $element.find(responseClass);\n $messages = $element.find(messagesClass);\n $submitButton = $(element).find(submBtn);\n $contactDealerCheck = $(element).find(contactDealerCheck);\n $zipInput = $(element).find(zipInput);\n }\n\n function bindEvents(element) {\n initSelectors(element);\n\n $($input, $form)\n .on('keypress', Validation.onKeypress)\n .on('keyup', Validation.onKeyup)\n .on('focus', Validation.onFocus)\n .on('blur', Validation.onBlur);\n\n $form.on('submit', onSubmit);\n\n $contactDealerCheck.change(toogleZipCodeRequired);\n }\n\n function init(element) {\n bindEvents(element);\n }\n\n return {\n init: init,\n };\n};\n","var Acr = Acr || {};\n\nAcr.SignUp = function () {\n var $signUp;\n var $signUpForm;\n var $signUpBody;\n var $signUpProcessing;\n var $signUpResponse;\n var $signUpResponseCopy;\n var $signUpFormInputs;\n var $signUpFormCheckboxes;\n var $signUpSubmitBtn;\n var $signUpZipCodeInput;\n var $signUpZipCodeField;\n var $signUpZipCodeFieldError;\n var $dynamicModelTracking;\n const formSelectorClass = '.js-acr-sign-up-form';\n const bodySelectorClass = '.js-acr-sign-up-body';\n const processingSelectorClass = '.js-acr-sign-up-processing';\n const responseSelectorClass = '.js-acr-sign-up-response';\n const responseCopySelectorClass = '.js-acr-sign-up-copy';\n const inputSelectorClass = '.js-acr-sign-up-input';\n const checkboxSelectorClass = '.js-acr-sign-up-checkbox';\n const submitBtnSelectorClass = '.js-acr-sign-up-submit';\n const requiredClass = 'acr-required';\n const requiredAttr = 'required';\n const conditionalRequiredAttr = 'data-conditional-required';\n const conditionalRequiredCountAttr = 'data-conditional-required-count';\n const formSubmitTracking = 'data-form-submit-tracking';\n const formCheckboxTracking = 'data-form-checkbox-tracking';\n const fieldErrorClass = 'acr-form-element-error';\n const fieldErrorMessage = '.acr-sign-up__error';\n const errorFieldAttr = 'data-error-text';\n const zipCodeRegex = '[zipcode]';\n\n function sendSuccessTrackingObject(isSuccess) {\n var stringObject = $signUpSubmitBtn.hasAttribute(formSubmitTracking) ? $signUpSubmitBtn.getAttribute(formSubmitTracking) : '';\n if (Acr.TrackingManager && stringObject) {\n try {\n var object = JSON.parse(stringObject.split(\"'\").join('\"'));\n\n if ($dynamicModelTracking && object) {\n object.Model = $dynamicModelTracking.Model;\n }\n\n if (isSuccess && object) {\n object.dynamic_variables[0].search += ' success';\n }\n\n Acr.TrackingManager.clickActivity(object);\n } catch (err) {\n console.warn('ERROR AT TRACKING OBJECT: ' + err);\n }\n }\n }\n\n function send(form) {\n const method = form.getAttribute('method');\n const url = form.getAttribute('action');\n const data = getFormElements(form);\n\n sendSuccessTrackingObject(false);\n\n let beforeSend = function () {\n $signUpProcessing.classList.add('show');\n $signUpBody.classList.add('hide');\n };\n\n const request = new XMLHttpRequest();\n request.open(method, url, true);\n request.onload = function (data) {\n const response = JSON.parse(data.currentTarget.response);\n\n if (response.Status === 'success') {\n sendSuccessTrackingObject(true);\n }\n\n $signUpProcessing.classList.remove('show');\n $signUpResponseCopy.innerHTML += response.Message;\n $signUpResponse.classList.add('show');\n };\n request.setRequestHeader('Content-Type', 'application/json');\n beforeSend();\n request.send(data);\n }\n\n function getFormElements(form) {\n var dataJSON = {};\n dataJSON.checkboxes = [];\n\n const formElements = form.elements;\n Array.prototype.forEach.call(formElements, function (element) {\n if (element.nodeName === 'INPUT') {\n if (element.type === 'checkbox') {\n var checkboxElement = {};\n checkboxElement.name = element.name;\n checkboxElement.value = element.checked;\n dataJSON.checkboxes.push(checkboxElement);\n\n if (element.hasAttribute(formCheckboxTracking) && element.checked) {\n var stringObject = element.getAttribute(formCheckboxTracking);\n var checkboxTracking = JSON.parse(stringObject.split(\"'\").join('\"'));\n\n if (!$dynamicModelTracking) {\n $dynamicModelTracking = checkboxTracking;\n } else {\n $dynamicModelTracking.Model.model_name += ';' + checkboxTracking.Model.model_name;\n\n if (!$dynamicModelTracking.Model.model_year.includes(checkboxTracking.Model.model_year)) {\n $dynamicModelTracking.Model.model_year += ';' + checkboxTracking.Model.model_year;\n }\n\n if (!$dynamicModelTracking.Model.body_style.includes(checkboxTracking.Model.body_style)) {\n $dynamicModelTracking.Model.body_style += ';' + checkboxTracking.Model.body_style;\n }\n }\n\n }\n } else {\n dataJSON[element.name] = element.value;\n }\n }\n });\n\n return JSON.stringify(dataJSON);\n }\n\n function onSubmit(e) {\n e.preventDefault();\n var success = Validation.validateForm(e);\n Utility.log('onSubmit submission', e);\n\n // validate zip code\n if (ValidateZipCode()) {\n let successZipCode = function () {\n $signUpZipCodeFieldError.innerText = '';\n\n if ($signUpZipCodeField.classList.contains(fieldErrorClass)) {\n $signUpZipCodeField.classList.remove(fieldErrorClass);\n }\n\n if (success) {\n send(e.target);\n }\n };\n\n let errorZipCode = function () {\n var errorMsj = $signUpZipCodeInput.getAttribute(errorFieldAttr);\n $signUpZipCodeFieldError.innerText = errorMsj;\n\n if (!$signUpZipCodeField.classList.contains(fieldErrorClass)) {\n $signUpZipCodeField.classList.add(fieldErrorClass);\n }\n };\n\n Utility.validateZipcode($signUpZipCodeInput.value, successZipCode, errorZipCode);\n } else if (success) {\n send(e.target);\n }\n }\n\n function ValidateZipCode() {\n var validateZipCode = false;\n\n if (!$signUpZipCodeInput) {\n return validateZipCode;\n }\n\n if ($signUpZipCodeInput.value !== '') {\n validateZipCode = true;\n }\n\n return validateZipCode;\n }\n\n function OnChangeCheckbox(evt) {\n var checkbox = evt.target;\n var dataConditionRequired = checkbox.getAttribute(conditionalRequiredAttr);\n var inputRequiredIds = dataConditionRequired.split(',');\n\n inputRequiredIds.forEach(function (inputId) {\n var inputRequired = document.getElementById(inputId);\n if (inputRequired) {\n var hasRequiredCount = inputRequired.hasAttribute(conditionalRequiredCountAttr);\n var isRequired = inputRequired.hasAttribute(requiredAttr);\n if (isRequired && !hasRequiredCount) {\n return;\n }\n\n var countRequired = hasRequiredCount ? inputRequired.getAttribute(conditionalRequiredCountAttr) : 0;\n if (checkbox.checked) {\n inputRequired.classList.add(requiredClass);\n inputRequired.setAttribute(requiredAttr, requiredAttr);\n countRequired++;\n inputRequired.setAttribute(conditionalRequiredCountAttr, countRequired);\n } else {\n countRequired--;\n if (countRequired === 0) {\n inputRequired.classList.remove(requiredClass);\n inputRequired.removeAttribute(requiredAttr);\n inputRequired.removeAttribute(conditionalRequiredCountAttr);\n } else {\n inputRequired.setAttribute(conditionalRequiredCountAttr, countRequired);\n }\n }\n }\n });\n }\n\n function initSelectors(element) {\n $signUp = element;\n $signUpForm = $signUp.querySelector(formSelectorClass);\n $signUpBody = $signUp.querySelector(bodySelectorClass);\n $signUpProcessing = $signUp.querySelector(processingSelectorClass);\n $signUpResponse = $signUp.querySelector(responseSelectorClass);\n $signUpResponseCopy = $signUpResponse.querySelector(responseCopySelectorClass);\n $signUpFormInputs = $signUpForm.querySelectorAll(inputSelectorClass);\n $signUpFormCheckboxes = $signUpForm.querySelectorAll(checkboxSelectorClass);\n $signUpSubmitBtn = $signUp.querySelector(submitBtnSelectorClass);\n }\n\n function bindEvents() {\n $signUpFormInputs.forEach(function (inputText) {\n inputText.addEventListener('keypress', Validation.onKeypress);\n inputText.addEventListener('keyup', Validation.onKeyup);\n inputText.addEventListener('focus', Validation.onFocus);\n inputText.addEventListener('blur', Validation.onBlur);\n\n if (inputText.getAttribute('data-regexkey') === zipCodeRegex) {\n $signUpZipCodeInput = inputText;\n $signUpZipCodeField = $signUpZipCodeInput.parentElement;\n $signUpZipCodeFieldError = $signUpZipCodeField.querySelector(fieldErrorMessage);\n }\n });\n\n $signUpFormCheckboxes.forEach(function (checkbox) {\n var dataConditionRequired = checkbox.getAttribute(conditionalRequiredAttr);\n if (dataConditionRequired) {\n var checkboxElement = document.getElementById(checkbox.id);\n checkboxElement.addEventListener('change', OnChangeCheckbox, false);\n }\n });\n\n $signUpForm.addEventListener('submit', onSubmit);\n }\n\n function init(element) {\n initSelectors(element);\n bindEvents(element);\n }\n\n return {\n init: init,\n };\n};\n","var Acr = Acr || {};\n\nAcr.CampaignManager = (function () {\n var campaignKeyNames;\n var Utility;\n\n function saveCampaignInCookie() {\n for (var i = 0; i < campaignKeyNames.length; i++) {\n if (Utility.getUrlParameterValue(campaignKeyNames[i])) {\n Utility.setCookie('campaignName', Utility.getUrlParameterValue(campaignKeyNames[i]), 0);\n }\n }\n }\n\n function init() {\n campaignKeyNames = ['cid', 'cmpid'];\n Utility = window.Utility || {};\n saveCampaignInCookie();\n }\n\n /**\n * Set the campaign name based on a URL attribute.\n * @param {String} text data to append the campaing name obtained from the URL.\n * @return {String} formatted data with the campaign name appended.\n */\n function appendCampaignName(text) {\n var result = text;\n var campaignNameValue = Utility.getCookie('campaignName');\n if (campaignNameValue) {\n result += '&campaignName=' + campaignNameValue;\n }\n return result;\n }\n\n\n return {\n init: init,\n appendCampaignName: appendCampaignName,\n };\n}());\n","Acr = window.Acr || {};\n\nAcr.DeepLinking = (function () {\n var Utility = window.Utility || {};\n var navHelperInitialized = false;\n var hasDeepLink = false;\n\n var calculateOffset = function (elementScrollTo, isOnLoad = false) {\n Utility = Utility || window.Utility;\n Utility.log('DeepLinking.js scrollDeepLink');\n\n const wrapper = Utility.getFirstElementFromClass('wrapper');\n const mainNav = Utility.getFirstElementFromClass('acr-nav');\n const stickyNav = Utility.getFirstElementFromClass('acr-sticky-nav');\n const mlpHeader = Utility.getFirstElementFromClass('mlp-nav');\n const grayCompNav = Utility.getFirstElementFromClass('rzf-gry-navigation-links-container');\n\n // Getting current header, stickynav and navbar height\n const offsetMainNav = mainNav ? mainNav.offsetHeight : 0;\n const offsetMlpNav = mlpHeader ? mlpHeader.offsetHeight : 0;\n var offsetStickyNav = 0;\n\n // Getting gray component nav size\n const grayCompNavList = grayCompNav ? grayCompNav.firstElementChild : null;\n const offsetGrayCompNav = grayCompNavList ? grayCompNavList.offsetHeight : 0;\n\n // Set size of main header\n var offsetMainHeader = offsetMainNav;\n if ((offsetMlpNav || offsetGrayCompNav) && !wrapper.classList.contains('expanded-nav')) {\n offsetMainHeader = 0;\n }\n\n // Checkig for sticky nav only on desktop, due to on mobile as it started expanded it generate unnecesary space\n if (stickyNav) {\n const stickyItem = stickyNav.querySelector('.acr-sticky-nav__item');\n const stickyItemHeight = stickyItem ? stickyItem.offsetHeight : 0;\n offsetStickyNav = !Utility.isDesktop() ? stickyNav.offsetHeight + stickyItemHeight : stickyNav.offsetHeight;\n }\n\n var offset = elementScrollTo.offsetTop - offsetMainHeader - offsetMlpNav - offsetGrayCompNav - offsetStickyNav;\n if (isOnLoad) {\n offset -= offsetMainHeader;\n }\n\n return offset;\n };\n\n var inPageDeepLink = function (deepLinkTo, offsetParam, navSelectorParam) {\n if (deepLinkTo) {\n const hashSelector = !Utility.isIE11() ? '[id=\"' + deepLinkTo + '\" i]' : '[id=\"' + deepLinkTo + '\"]';\n const elementScrollTo = document.querySelector(hashSelector);\n\n if (elementScrollTo) {\n var offset = calculateOffset(elementScrollTo);\n var navSelector = navSelectorParam.replace('.', '');\n const navSelectorItem = Utility.getFirstElementFromClass(navSelector);\n const navSelectorSize = navSelectorItem\n ? navSelectorItem.offsetHeight\n : 0;\n offset -= navSelectorSize;\n\n Utility.scrollTo(offset, 750);\n }\n }\n };\n\n var deepLink = function (initial, isOnLoad = false) {\n // Search for deeplink parameter to activate the deep linking functionality\n const params = new URLSearchParams(window.location.search);\n const deepLinkParam = params.get('deeplink');\n\n // Search for hash to support old functionality\n const hash = window.location.hash.replace('#', '');\n const deepLinkTo = hash || deepLinkParam;\n\n if (deepLinkTo) {\n const hashSelector = !Utility.isIE11() ? '[id=\"' + deepLinkTo + '\" i]' : '[id=\"' + deepLinkTo + '\"]';\n const elementScrollTo = document.querySelector(hashSelector);\n\n if (elementScrollTo && initial) {\n hasDeepLink = true;\n const offset = calculateOffset(elementScrollTo, isOnLoad);\n if (isOnLoad) {\n Utility.scrollTo(offset, 1000);\n } else {\n Utility.scrollTo(offset, 750);\n }\n }\n }\n\n if (!navHelperInitialized) {\n navHelperInitialized = true;\n Acr.NavHelper.init();\n }\n };\n\n var initDeepLinkEvent = function () {\n // Add event listener for internal hash links in the same page\n var btns = document.querySelectorAll('[data-deep-link]');\n btns.forEach(function (btn) {\n btn.addEventListener('click', function (evt) {\n evt.preventDefault();\n var internalDeepLink = evt.currentTarget.dataset.deepLink;\n const hashSelector = !Utility.isIE11() ? '[id=\"' + internalDeepLink + '\" i]' : '[id=\"' + internalDeepLink + '\"]';\n const elementScrollTo = document.querySelector(hashSelector);\n if (elementScrollTo) {\n const offset = calculateOffset(elementScrollTo);\n Utility.scrollTo(offset, 750);\n } else {\n window.location = evt.currentTarget.href;\n }\n });\n });\n };\n\n var initByElement = function (deeplinkTo) {\n if (deeplinkTo) {\n const offset = calculateOffset(deeplinkTo);\n Utility.scrollTo(offset, 750);\n }\n };\n\n var getTabIdHashElement = function (tabContainer) {\n var hashTab = null;\n if (location.hash) {\n const hash = location.hash.replace('#', '');\n const hashSelector = !Utility.isIE11() ? '.js-tab-link[tab-id=\"' + hash + '\" i]' : '.js-tab-link[tab-id=\"' + hash + '\"]';\n hashTab = tabContainer.querySelector(hashSelector);\n\n if (hashTab) {\n initByElement(tabContainer);\n }\n }\n return hashTab;\n };\n\n var init = function () {\n // Reset scroll top - Prevent automatic browser scroll on refresh\n history.scrollRestoration = 'manual';\n window.addEventListener('unload', function () {\n if (hasDeepLink) {\n window.scrollTo(0, 0);\n }\n });\n\n initDeepLinkEvent();\n\n Utility.log('DeepLinking.js inited');\n\n try {\n if (document.readyState === 'interactive') {\n deepLink(true, true);\n } else {\n document.onreadystatechange = function () {\n if (document.readyState === 'interactive') {\n deepLink(true, true);\n }\n };\n }\n } catch (e) {\n Utility.error(e.message);\n }\n };\n\n return {\n init: init,\n inPageDeepLink: inPageDeepLink,\n initByElement: initByElement,\n getTabIdHashElement: getTabIdHashElement,\n };\n}());\n","var IconSwitch = (function () {\n\n\n Utility.log('IconSwitch.js loaded');\n\n\n function init() {\n\n Utility.log('IconSwitch.js inited');\n\n try {\n\n var iconList;\n\n iconList = $('.acr-icon-change-js');\n\n bindEvent(iconList);\n\n\n } catch (e) {\n Utility.error(e.message);\n }\n }\n\n function bindEvent(iconList) {\n for (var x = 0; x < iconList.length; x++) {\n var item;\n item = iconList[x];\n if (item.dataset.acrIconChangeH) {\n var inSvg;\n var outSvg;\n\n inSvg = item.dataset.acrIconChangeH;\n outSvg = $(item).find('.acr-icon use').attr('xlink:href');\n bindHover(item, inSvg, outSvg);\n }\n }\n }\n\n function bindHover(element, inSvg, outSvg) {\n var $element;\n\n $element = $(element);\n $element.on('mouseenter', function () {\n $element.find('.acr-icon use').attr('xlink:href', inSvg);\n\n });\n $element.on('mouseleave', function () {\n $element.find('.acr-icon use').attr('xlink:href', outSvg);\n });\n }\n\n // Expose the following variables and functions\n return {\n init: init,\n };\n}());\n","var Acr = Acr || {};\n\n/**\n * @desc Checks for Pre Hidden elements and sets the functionality to show the hidden component\n*/\nAcr.ShowPreHiddenComponents = (showRightNow = true) => {\n const preHiddenElements = document.querySelectorAll('[pre-hidden]');\n\n preHiddenElements.forEach((preHiddenElement) => {\n const duration = preHiddenElement.getAttribute('pre-hidden') || 3000;\n if (showRightNow) {\n preHiddenElement.removeAttribute('pre-hidden');\n } else {\n setTimeout(() => {\n preHiddenElement.removeAttribute('pre-hidden');\n }, duration);\n }\n }); \n};\n\nAcr.ShowPreHiddenComponents(false);\n","var ResponsiveBackground = (function () {\n var currentBreakpoint;\n\n Utility.log('ResponsiveBackground.js loaded');\n\n /* * **************************************************************************\n * EXECUTE\n * Loops through the elements in the site that contain the class name of\n * 'acr-responsive-background-behavior' and runs the render() function.\n * The function expects to get 6 images from the data attributes of the\n * element in the form of 'data-img-small-1x' The size identifiers are\n * small, medium and large. The pixel dfensity identifier is 1 and 2.\n * For example you can setup this responsive background behavior like this:\n
\n *************************************************************************** */\n function execute() {\n var $element;\n\n $('.acr-responsive-background-behavior[responsified!=\"true\"]:not(.shown)')\n .each(function () {\n // Will only execute if the element is in view, i.e.: lazy loading\n if (Utility.isElementInView(this, false, 300)\n // Don't Lazy Load while on Sitecore's Experience Editor\n || window.location.href.match(/sc_mode/) !== null) {\n $element = $(this);\n\n render(this);\n\n $element.addClass('shown');\n\n if ($element.hasClass('acr-responsive-background-setheight')) {\n setHeight(this);\n } else if (Grid && $element.hasClass('hmc-grid-100')) {\n Grid.resize();\n }\n\n if ($element.hasClass('broadcast-image-load')) {\n broadcastImageLoad(this, $element.data('type'));\n }\n }\n });\n }\n\n function render(element, attribute) {\n try {\n var bkg;\n\n var currentBreakpoint;\n\n var currentRatio;\n\n var attr = '';\n\n var $element;\n\n $element = $(element);\n\n\n if (attribute) {\n if (Object.prototype.toString.call(attribute) === '[object String]') {\n attr = attribute;\n } else {\n Utility.error('ResponsiveBackground.apply(selector, attribute) is '\n + 'expecting a String as an attribute but received a '\n + Object.prototype.toString.call(attribute));\n }\n } else {\n currentBreakpoint = Utility.getCurrentBreakpoint();\n currentRatio = currentBreakpoint.ratio;\n\n // TODO: REMOVE THIS IF WHEN RETINA APPROACH BECOMES GLOBAL\n if ($(element).data('retina') === 'off') {\n currentBreakpoint.ratio = 1;\n }\n\n attr = 'data-img-' + currentBreakpoint.breakpoint + '-'\n + currentBreakpoint.ratio + 'x';\n }\n\n // get the data attribute from the section element\n bkg = $element.attr(attr);\n\n if (bkg) {\n // check to make sure the image isn't the same so we're not\n // unnecessarily calling the css() function from jQuery\n if ($element.data('acrVarCurrentResponsiveBkg') !== bkg) {\n $element.data('acrVarCurrentResponsiveBkg', bkg);\n\n $element.css('background-image', 'url(\\'' + bkg + '\\')');\n }\n }\n } catch (e) {\n Utility.error(e.message);\n }\n }\n\n /* * **************************************************************************\n * SETHEIGHT\n * If the element has the class \"acr-responsive-background-setheight\n * then set its height automatically remaining the image aspect ratio\n \n *************************************************************************** */\n function setHeight(element) {\n try {\n var width; var height; var widthEle; var heightEle; var\n ratio;\n\n var imageSrc = element\n .style\n .backgroundImage\n .replace(/url\\((['\"])?(.*?)\\1\\)/gi, '$2')\n .split(',')[0];\n\n var image;\n\n if (imageSrc && imageSrc !== '') {\n image = new Image();\n\n image.onload = function () {\n width = image.width;\n\n height = image.height;\n\n ratio = width / height;\n\n widthEle = $(element).width();\n\n heightEle = Math.floor(widthEle / ratio);\n\n if (heightEle !== $(element).height()) {\n $(element).css({\n height: heightEle + 'px',\n });\n }\n };\n\n image.src = imageSrc;\n }\n } catch (e) {\n Utility.error(e.message);\n }\n }\n\n function broadcastImageLoad(element, type) {\n try {\n var image;\n var imageSrc = element\n .style\n .backgroundImage\n .replace(/url\\((['\"])?(.*?)\\1\\)/gi, '$2')\n .split(',')[0];\n\n if (imageSrc && imageSrc !== '') {\n image = new Image();\n\n image.onload = function () {\n $(document).trigger(type, imageSrc);\n };\n\n image.src = imageSrc;\n }\n } catch (e) {\n Utility.error(e.message);\n }\n }\n\n function init() {\n try {\n // only call resize function every 250ms if multiple resize events are\n // detected so that the browser doesn't freeze from overloaded event calls\n var resizeFunc = Utility.debounce(function () {\n var checkBreakpoint = Utility.getCurrentBreakpoint();\n\n if (checkBreakpoint.breakpoint !== currentBreakpoint) {\n $('.acr-responsive-background-behavior[responsified!=\"true\"]')\n .removeClass('shown');\n\n currentBreakpoint = checkBreakpoint.breakpoint;\n\n execute();\n }\n }, 250);\n\n // onscroll - debounced 100ms\n $(window).on('scroll', Utility.debounce(function () {\n execute();\n }, 100));\n\n $(window).resize(resizeFunc); // add resize handler to window\n\n execute();\n } catch (e) {\n Utility.error('ResponsiveBackground.init() can only be called after '\n + 'DOMContentLoaded Event is triggered. Try calling from Main.js ready '\n + 'function. Error: ' + e.message);\n }\n }\n\n // Expose the following variables and functions\n return {\n execute: execute,\n setHeight: setHeight,\n init: init,\n };\n}());\n","var Acr = Acr || {};\n\n/**\n * @desc Gets the Trim Package Names info from window.Acr.TrimPackageNamesData\n*/\nAcr.TrimPackageNames = (function () {\n function getTrimPackageName(modelId) {\n return Acr.TrimPackageNamesData[modelId] || '';\n }\n\n return {\n getTrimPackageName: getTrimPackageName,\n };\n\n}());\n","var Acr = Acr || {};\n\nAcr.YouTubeManager = (function () {\n var players = [];\n var videoCount = 0;\n var APILoaded = false;\n var videoPercentages;\n\n window.setVideoPercentages = function () {\n videoPercentages = [100, 75, 50, 25, 10];\n };\n\n function loadAPI() {\n if (!APILoaded) {\n var tag = document.createElement('script');\n tag.src = 'https://www.youtube.com/iframe_api';\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n APILoaded = true;\n }\n }\n\n function initPlayers() {\n var options = {\n bladeContainerSelector: '[video-blade]',\n triggerSelector: '[video-trigger]',\n instanceIdAttribute: 'video-id',\n instanceSourceAttribute: 'video-source',\n targetAreaSelector: '[video-target]',\n targetAreaWrapperSelector: '[video-target-container]',\n targetAreaCloseSelector: '[video-action-close]',\n };\n var playerElements = $(options.bladeContainerSelector);\n if (playerElements.length) {\n for (var i = 0; i < playerElements.length; i++) {\n\n var blade = $(playerElements[i]);\n var trigger = blade.find(options.triggerSelector);\n var close = blade.find(options.targetAreaCloseSelector);\n var target = blade.find(options.targetAreaSelector);\n var container = blade.find(options.targetAreaWrapperSelector);\n\n var thisPlayer = new YouTubePlayerObject(\n trigger.attr(options.instanceSourceAttribute),\n close, target, container, 0,\n );\n thisPlayer.init();\n players.push(thisPlayer);\n\n }\n }\n }\n\n function YouTubePlayerObject(sourceId, closeButton, componentTarget, componentContainer, autoplay) {\n var player = this;\n player.id = 'youTubeEmbed_' + sourceId + '_' + videoCount;\n player.sourceId = sourceId;\n player.autoplay = autoplay;\n\n player.$closeButton = closeButton;\n player.$componentTarget = componentTarget;\n player.$componentContainer = componentContainer;\n\n player.playerObject = null;\n player.initialized = false;\n player.options = { videoOpenClass: 'video-open' };\n videoCount += 1;\n\n player.init = function () {\n // Append dummy div and assign ID\n var videoDomElement = $('', { id: player.id });\n player.$componentContainer.append(videoDomElement);\n // Initialize IFRAME Embedding using YT API\n if (typeof (YT) !== 'undefined') {\n player.playerObject = new YT.Player(player.id, {\n videoId: player.sourceId,\n height: '100%',\n width: '100%',\n playerVars: {\n modestbranding: 1,\n rel: 0,\n showinfo: 0,\n wmode: 'opaque',\n iv_load_policy: 3,\n autoplay: player.autoplay,\n },\n events: {\n onReady: player.onPlayerReady,\n onStateChange: onPlayerStateChange,\n },\n });\n\n player.initialized = true;\n }\n };\n\n player.onPlayerReady = function () {\n player.bindEvents();\n };\n\n player.bindEvents = function () {\n if (player.$closeButton) {\n player.$closeButton.on('click', function (event) {\n player.$componentTarget.removeClass(player.options.videoOpenClass);\n player.stop();\n });\n }\n };\n\n player.pause = function () {\n clearInterval(window.percentageInterval);\n if (player.playerObject.pauseVideo) {\n player.playerObject.pauseVideo();\n }\n };\n\n player.stop = function () {\n clearInterval(window.percentageInterval);\n window.setVideoPercentages();\n if (player.playerObject.stopVideo) {\n player.playerObject.stopVideo();\n }\n };\n }\n\n function onPlayerStateChange(event) {\n\n // checks if tracking data is present\n if ($(event.target.getIframe()).parent().attr('data-video-tracking')) {\n var trackingData = JSON.parse($(event.target.getIframe()).parent().attr('data-video-tracking')\n .split(\"'\")\n .join('\"'));\n\n if (trackingData['Video Metadata'].video_title) { trackingData['Video Metadata'].video_title = event.target.getVideoData().title; }\n if (trackingData['Video Metadata'].video_event_duration) { trackingData['Video Metadata'].video_event_duration = event.target.getDuration(); }\n if (trackingData['Video Metadata'].video_id) {\n trackingData['Video Metadata'].video_id = event.target.getVideoData().video_id;\n trackingData['Video Metadata'].video_link = event.target.getVideoUrl();\n }\n // deleting video_milestone attribute for play/pause events\n if (trackingData['Video Metadata'].video_milestone) { delete trackingData['Video Metadata'].video_milestone; }\n\n // Video Play\n if (event.data === YT.PlayerState.PLAYING) {\n if (trackingData['Video Metadata'].video_action) { trackingData['Video Metadata'].video_action = 'Play'; }\n if (window.Acr && window.Acr.TrackingManager) {\n triggerClickActivity(trackingData);\n }\n clearInterval(window.percentageInterval);\n\n // Interval to check the percentages watched on the video\n window.percentageInterval = setInterval(function () {\n var currentPercentage = event.target.getCurrentTime() * 100 / event.target.getDuration();\n if (videoPercentages.length > 0 && videoPercentages[videoPercentages.length - 1] <= currentPercentage) {\n var videoCheckpoint = getCheckpointPercentage(currentPercentage);\n trackingData['Video Metadata'].video_milestone = Math.floor(currentPercentage) + '%';\n trackingData['Video Metadata'].video_action = 'milestone';\n if (window.Acr && window.Acr.TrackingManager) {\n triggerClickActivity(trackingData);\n }\n }\n }, 200);\n } else if (event.data === YT.PlayerState.PAUSED) { // video pause\n if (trackingData['Video Metadata'].video_action) { trackingData['Video Metadata'].video_action = 'Paused'; }\n if (window.Acr && window.Acr.TrackingManager) {\n triggerClickActivity(trackingData);\n }\n clearInterval(window.percentageInterval);\n } else if (event.data === YT.PlayerState.ENDED) { // video end\n // sending 100% checkpoint event\n trackingData['Video Metadata'].video_action = 'milestone';\n trackingData['Video Metadata'].video_milestone = '100%';\n if (window.Acr && window.Acr.TrackingManager) {\n triggerClickActivity(trackingData);\n }\n clearInterval(window.percentageInterval);\n window.setVideoPercentages();\n event.target.stopVideo();\n }\n }\n }\n\n function getCheckpointPercentage(currentPercentage) {\n var checkpointPorcentage = 0;\n for (var i = videoPercentages.length - 1; i >= 0; i--) {\n if (currentPercentage > videoPercentages[i]) {\n checkpointPorcentage = videoPercentages.pop();\n } else {\n return checkpointPorcentage;\n }\n }\n }\n\n function triggerClickActivity(object) {\n if (window.Acr && window.Acr.TrackingManager) {\n window.Acr.TrackingManager.sendTrackingActivity(JSON.parse(JSON.stringify(object)));\n }\n }\n function init() {\n loadAPI();\n initPlayers();\n window.setVideoPercentages();\n }\n\n return {\n init: init,\n YouTubePlayerObject: YouTubePlayerObject,\n onPlayerStateChange: onPlayerStateChange,\n };\n}());\n","var WayPoints = (function () {\n function init() {\n $(document).ready(function () {\n // Basic Animation directions\n\n $(' .acr-fdown').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-down');\n }, {\n offset: '100%',\n });\n });\n\n $(' .acr-ftop ').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-top');\n }, {\n offset: '100%',\n });\n });\n\n $(' .acr-fbottom-scatter').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-up-scatter');\n }, {\n offset: '100%',\n });\n });\n\n $(' .acr-fbottom-scatter-short').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-up-scatter-short');\n }, {\n offset: '100%',\n });\n });\n\n $(' .acr-fbottom ').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-up');\n }, {\n offset: '100%',\n });\n });\n\n\n $('.acr-fleft').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-left');\n }, {\n offset: '100%',\n });\n });\n\n $('.acr-fright').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-right');\n }, {\n offset: '100%',\n });\n });\n\n\n // special to underline in headdings\n $(' .acr-underheading.acr-fcenter').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('acr-fill-from-center');\n }, {\n offset: '100%',\n });\n });\n\n $(' .acr-fcenter-is-grey').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('acr-fill-from-center-is-grey');\n }, {\n offset: '100%',\n });\n });\n\n // Use of stagger (ie: Headings - staggering header + underline\n $(' .acr-fbottom-scatter .acr-stagger').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-up-scatter');\n }, {\n offset: '100%',\n });\n });\n\n $(' .acr-ftop .acr-stagger').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-top');\n }, {\n offset: '100%',\n });\n });\n\n $('.acr-fbottom .acr-stagger').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-up');\n }, {\n offset: '100%',\n });\n });\n\n $('.acr-fleft .acr-stagger').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-left');\n }, {\n offset: '100%',\n });\n });\n\n $('.acr-fright .acr-stagger').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-right');\n }, {\n offset: '100%',\n });\n });\n\n // Vehicle Line Up gallery specific\n $('.acr-scattered .acr-lineup').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in');\n }, {\n offset: '100%',\n });\n });\n\n // Vehicle Line Up gallery *DIRECTIONAL\n $('.acr-scattered .acr-lineup.ftop').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-top');\n }, {\n offset: '100%',\n });\n });\n\n // Vehicle Line Up gallery specific\n $('.acr-scattered .acr-lineup.fbottom').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-in-bottom');\n }, {\n offset: '100%',\n });\n });\n\n // shopiing tools\n $('.acr-fade-zoom').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('acr-fade-in');\n }, {\n offset: '100%',\n });\n });\n\n // Keystory trigger Zoomit\n $('.key-image').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('zoomit');\n }, {\n offset: '70%',\n });\n });\n\n $('.key-headline').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('zoom-it-2');\n }, {\n offset: '100%',\n });\n });\n\n $('.acr-fade-scale').each(function () {\n $(this).waypoint(function () {\n $(this.element).addClass('animated acr-fade-scale-up');\n }, {\n offset: '100%',\n });\n });\n\n\n });\n }\n\n return {\n init: init,\n };\n}());\n","/**\n * Looks for modules in the page and initialize them if they are ready.\n * @param {HTMLElement} $root [optional] Parent root to look for modules. If not given, uses the document.\n */\nfunction initializeModules($root) {\n const jsModuleClass = 'js-module';\n var $parentNode = $root || document;\n var $modules = $parentNode.getElementsByClassName(jsModuleClass);\n var Acr = window.Acr || {};\n\n Acr.Modules = {};\n for (var modulesIndex = 0; modulesIndex < $modules.length; modulesIndex++) {\n var $module = $modules[modulesIndex];\n\n if ($module.dataset.moduleStarted !== 'true') {\n var loadModule = $module.dataset.moduleLoad;\n if (loadModule !== 'false') {\n var moduleName = $module.dataset.module;\n var moduleId = (modulesIndex + 1).toString();\n\n $module.dataset.moduleStarted = 'true';\n $module.dataset.moduleId = moduleId;\n if (moduleName) {\n var newModule = new Acr[moduleName]($module);\n if (newModule.init) {\n newModule.init($module);\n Acr.Modules[moduleId] = newModule;\n }\n }\n }\n }\n }\n}\n","var Main = (function () {\n console.log('Main.js loaded');\n\n var Utility = window.Utility || {};\n\n var Acr = window.Acr || {};\n\n // Zipgate components\n const zipgateElement = document.getElementsByClassName('js-zipgate')[0];\n if (zipgateElement) {\n Acr.zipgateComponent = new Acr.Zipgate();\n Acr.zipgateComponent.init(zipgateElement);\n }\n\n document.addEventListener('DOMContentLoaded', function () {\n Utility.log('DOMContentLoaded event fired');\n\n // Global Modules\n Acr.LazyLoadingHelper.init();\n Acr.DeferLoadingHelper.init();\n\n // New module Manager\n initializeModules();\n\n // Deprecated: call modules in this way is deprecated\n\n SlickOverride.init();\n\n Utility.enableActive();\n\n Acr.YouTubeManager.init();\n\n Acr.CampaignManager.init();\n\n WayPoints.init();\n\n SelectBox.init();\n\n Disclaimer.init();\n\n Acr.ShoppingTools.init();\n\n Acr.DeepLinking.init();\n\n Validation.init();\n\n Modals.init();\n\n Chart.init();\n\n FeatureModal.init();\n\n Acr.boxParallax.init();\n\n Acr.SignUpForEmails.init();\n\n TextSVGTiles.init();\n\n SearchCTA.init();\n\n RaqTool.initForms();\n\n RaqTool.initDealerInfo();\n\n RaqTool.initDisclaimers();\n\n OffersTool.init();\n\n FormEmailSignup.init();\n\n DealerLocatorTool.init();\n\n RequestBrochure.init();\n\n EmailSubscription.init();\n\n Acr.LanguageSelector.init();\n\n });\n\n // Expose the following variables and functions\n return {};\n}());\n"]}