var FlickFusionExecutor=function(){"use strict";var _mediaHostURL="//ev5.ai/",_verifyHostURL="//ver.ev5.ai/",_ev5Popup="//storage.googleapis.com/gcbimages/s/ev5popup_1_may.min.js",_eceModalPopup="//storage.googleapis.com/gcbimages/s/ece_modal_popup.min.js",_modal_v2_popup="https://ver.ev5.ai/s/ddc/prod/modal_v2.js",_pageStatsServiceURL="https://jobserver-dot-concatlogsbigquery.appspot.com/app/stats/?event_type=",_getRefDomain=window.location.hostname,_getRefURL=encodeURIComponent(window.location.href),_documentTitle=encodeURIComponent(document.title),_referredFrom=encodeURIComponent(document.referrer),_displayButtonThumb,_displayButtonDefault,_button_image_path,_profilesBag={},_filterUnique={},_buttonsCount=0,_buttons_count=document.querySelectorAll("#evs_link")?.length?document.querySelectorAll("#evs_link")?.length:document.querySelectorAll("#ff_link")?.length,_domainName=window.location.hostname,_path=window.location.href,_custom_script_run,_allowDuplicates=false,_showSpanishBtn=false,notAllowInlineDuplicate=true,dataVDP={},dataVLP={},forceConfigRun=false,checkIsVLP,checkIsVDP,isSPA,checkFyuse="0",checkCDK="0",clientKey="11CAA039-28BE-F6C0-A140-3B314BF065AD",checkDDC="0",dom="",clientKeyForTest=clientKey,clientData,siteConfig={VLP:{},VDP:{},EVC:{}},targetElementOnSRP,targetElementOnVDP,includeDDCAPIButtonsOnVDP="",includeDDCAPIButtonsOnVLP="",showDirectModal="1",isDDCFallBackRolled,ignoreGlobleVTBtn,isVinHit=false,aspectRatio,extVlpIndicator,isStock=0,nc_client="0",spanish_button_image_path,defaultSpanishButtonImages={},isFullScreen=false,runNextScript=false,modalEce,_custom_script_on_vin_response,gaTrackingIds,checkFFButton=document.querySelector("#ff_link")?true:false,EVSButton=!checkFFButton?"evs_":"ff_",testClient=getParameterByName("ff_test_client")?getParameterByName("ff_test_client"):getParameterByName("evs_test_client")?getParameterByName("evs_test_client"):"",testVin=getParameterByName("ff_test_vin")?getParameterByName("ff_test_vin"):getParameterByName("evs_test_vin")?getParameterByName("evs_test_vin"):""; // window.is360Video = ""; clientData = {"data":[{"client_fk":"11CAA039-28BE-F6C0-A140-3B314BF065AD","gaid":"UA-53828916-1","video_size":640,"live_video_only":0,"exclusive_btn":"","client_360":"1","client_pano":"1","code_float_player":0,"vid_button":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/ff_play.png","enable_tracking":0,"vdp_btn_img":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/ff_play.png","srp_btn_img":"https:\/\/ev5.ai\/videos\/global\/images\/ff_play.png","veh_test_img":"https:\/\/ev5.ai\/videos\/global\/images\/360_test_drive.png","af_img":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/model_review_orange.png","veh_af":0,"img_360":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/play_video_360.png","img_vdp_360":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/play_video_360.png","img_srp_360":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/play_video_360.png","img_vdp_360_only":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/view_interative_360.png","img_srp_360_only":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/view_interative_360.png","vid_call_img":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/ff_thumb_play_icon.png","thumb_paly_img":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/ff_video_call.png","full_scrn_img":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/popup_full_screen_dark.png","live_vid_img":"\/\/gcbimages.storage.googleapis.com\/vidbtn\/livewalkaround.png","btn_text":"0","srp_btn_text_360_only":"Watch 360 Walkaround","srp_btn_fontsize_360_only":"16","srp_btn_bgcolor_360_only":"grey","srp_btn_textcolor_360_only":"white","srp_btn_text_vid_only":"Watch Video","srp_btn_fontsize_vid_only":"16","srp_btn_bgcolor_vid_only":"grey","srp_btn_textcolor_vid_only":"white","srp_btn_text_vid360":"Watch Video & 360 Walkaround","srp_btn_fontsize_vid360":"16","srp_btn_bgcolor_vid360":"grey","srp_btn_textcolor_vid360":"white","vdp_btn_text_360_only":"Watch 360 Walkaround","vdp_btn_fontsize_360_only":"16","vdp_btn_bgcolor_360_only":"grey","vdp_btn_textcolor_360_only":"white","vdp_btn_text_vid_only":"Watch Video","vdp_btn_fontsize_vid_only":"16","vdp_btn_bgcolor_vid_only":"grey","vdp_btn_textcolor_vid_only":"white","vdp_btn_text_vid360":"Watch Video & 360 Walkaround","vdp_btn_fontsize_vid360":"16","vdp_btn_bgcolor_vid360":"grey","vdp_btn_textcolor_vid360":"white","btn_text_VehFF":"0","srp_btn_img_VehFF":"https:\/\/ev5.ai\/videos\/global\/images\/360_test_drive.png","vdp_btn_img_VehFF":"https:\/\/ev5.ai\/videos\/global\/images\/360_test_drive.png","srp_btn_text_VehFF":"Watch Video","srp_btn_fontsize_VehFF":"16","srp_btn_bgcolor_VehFF":"grey","srp_btn_textcolor_VehFF":"white","vdp_btn_text_VehFF":"Watch Video","vdp_btn_fontsize_VehFF":"16","vdp_btn_bgcolor_VehFF":"grey","vdp_btn_textcolor_VehFF":"white","lp":0,"inline":0,"veh_test":0,"flow_found":"1","vid_call":0,"vid_call_html":"","related_videos":0,"auto_play":0,"img_slider":"2","skip_vid_tab":0,"enable_referer":"1","client_zip":"","spanish_btn_url":"","disp_spanish_btn":"0"}]} // json include siteConfig = {"VDP":{ "VDPIndicator": ".page-vehicle-display-page", "target": ".box-gallery-wrap .details-page-gallerywrap .details-page-row:first-child >div:last-child,.gallery-wrap,.vdp-gallery-wrap .vdp-gallery", "vin": "div[data-vin],a[data-vin]", "vinAttribute":"data-vin", "buttonPos": "bottom", "loadDelay":3000, "siteStyle":"#ff_link{margin-top:10px;text-align:center;}", "vehicleTestButtons" : true, "yearTarget": "input[name=gform_field_values]", "yearRegEx": "model_year=(\\d{4})", "makeTarget": "input[name=gform_field_values]", "makeRegEx": "make=(\\w+-?\\w)", "modelTarget": "input[name=gform_field_values]", "modelRegEx": "model=(\\w+-?\\w)", "trimTarget": "input[name=gform_field_values]", "trimRegEx": "trim=(\\w+-?\\w)" }, "EVC" : { "get_today_price_and_value_your_trade" : { "id" : ".hit-additional-ctas .lightning-custom-cta", "type" : "mutation", }, "get_eprice" : { "id" : ".ctabox-row .cta-button", "type": "mutation" }, "addTradeIn" : { "id" : ".priceAdvisorTradeinBtn", "type": "mutation" }, "allVDPButtons" : { "id" : ".cta-button", "type": "dom" }, "allVDPButtons_mutation" : { "id" : ".cta-button", "type": "mutation" }, "contactForm":{ "id":"#gform_1", "type":"form", "behaviour": 'mutation' } }} // js include _custom_script_run = { runSiteSpecifigScript :true, script : function(videoData, buttonData, getProfileData, dataVLP, dataVDP, checkIsVDP, checkIsVLP){ if(videoData.nv && getProfileData.flow_found){ let buttonWrapper; if(getProfileData.btn_text_VehFF){ let FFButtonName = 'Take A Virtual Test Drive'; if(checkIsVLP && Number(getProfileData.btn_text_VehFF)) FFButtonName = getProfileData.srp_btn_text_VehFF; else if(checkIsVDP && Number(getProfileData.btn_text_VehFF)) FFButtonName = getProfileData.vdp_btn_text_VehFF; let svgData = `
`; if(!window.styleApplied){ let style = document.createElement('style'); style.innerText = ".button-bar-item { width: 100%; } .ff-vr-video-button { width: 100%; } a.ff_button { display: inline-block; width: 100%; text-align: center; padding: 10px 0; margin-top: 5px; margin-bottom: 5px; cursor: pointer; } a.ff_button:hover { opacity: 0.6; } .ff_button_container { margin-top:5px; min-height: 40px; max-height: 50px; } .ff_button_container .btnTextContainer { height: 100%; margin: auto; display: flex; } .ff_button_container .btnTextContainer .btnText { font-size:16px; font-family: sans-serif; text-align: center; margin: auto; padding-right: 5px; } .ff_button_container .cls-1 { fill: #c7262d !important; } .ff_button_container .cls-2 { fill: #ff262d !important; clip-path: unset; } .ff_button_container .cls-3 { fill: #9f262d !important; } .ff_button_container .cls-4 { fill: white !important; } .ff_button_container .cls-5 { fill: white !important; } .ff_button_container .cls-6 { fill: #fff !important; }"; document.head.appendChild(style); window.styleApplied = true; } buttonWrapper = document.createElement("div"); buttonWrapper.innerHTML = svgData; } else{ if(!window.styleApplied){ let style = document.createElement('style'); style.innerText = "[data-web-api-id='flickfusion']{width:100%;} #flick_button{ max-width: 250px; margin: 0 auto; cursor: pointer; display: flex; justify-content: space-between; height: 35px; align-items: center; border-bottom-right-radius: 10px; font-size: 16px; text-align: center; width: 100%; text-decoration: none; border-image: initial; color: rgb(0, 0, 0); border-top-right-radius: 10px; position: relative; } #flick_button .flow_icon{ margin: 0; padding:0; width: 52px !important; height: 33px; position: relative; left: 5px; } #flick_button > div{ flex-grow: 1; margin-left: -7px; border-width: 2px 2px 2px 0px; border-style: solid; border-color: red; border-bottom-right-radius: 10px; border-top-right-radius: 10px; height: 33px; line-height: 30px; box-sizing: border-box;}"; document.head.appendChild(style); window.styleApplied = true; } buttonWrapper = document.createElement("div"); buttonWrapper.id = "flick_button"; let image = document.createElement('img'); image.className = "flow_icon" let button = document.createElement('div'); image.src = '//gcbimages.storage.googleapis.com/vidbtn/360_test_drive.png'; button.innerText = '360 Test Drive'; buttonWrapper.appendChild(image); buttonWrapper.appendChild(button); } buttonData.appendChild(buttonWrapper); buttonData.addEventListener("click", function (e) { e.preventDefault(); e.stopPropagation(); new ConModal({ width: 960, videoPage: 0, iframeUrl: videoData.nv.url + '&referer=' + _getRefDomain + '&h_p=' + _getRefURL + '&h_p_r=' + _referredFrom + '&h_t=' + _documentTitle }); }) } } } if(!siteConfig.VLP)siteConfig.VLP={};if(!siteConfig.VDP)siteConfig.VDP={};if(!Array.isArray(clientData)){if(!runNextScript){window["checkClientData"]=true}}else if(!document.querySelector("#"+EVSButton+"link")){return}if(siteConfig.VLP.isSPA||siteConfig.VDP.isSPA){loadFFScript("https://storage.googleapis.com/gcbimages/s/spa_script.min.js");return}if(siteConfig.EVC&&Object.keys(siteConfig.EVC).length){var trackLeadData=siteConfig.EVC;for(var i=0;i
`;createStyleTagAndAppend(`#${EVSButton}link {position: relative;} .iframe_img_loader {max-width:100%;width:100%;position: absolute;top: 0;left: 0;opacity: 1;transition: opacity 1s ease;display:block;} #${EVSButton}link_iframe {opacity: 0;transition: opacity 1s ease;} #loader-img {position: absolute;top: 0;left: 0;width: 100%;aspect-ratio:16/9;opacity: 1;transition: opacity 1s ease;} #loader-img img{width:auto !important;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);opacity: 1;transition: opacity 1s ease;}`);iframe_img_loader.classList.add("iframe_img_loader");iframe_img_loader.src=thumbnailUrl;buttonData.appendChild(iframe_img_loader);iframe_img_loader.addEventListener("load",(function(){buttonData.appendChild(loaderGif)}));iframeElement.frameBorder=0;iframeElement.scrolling="no";iframeElement.setAttribute("allowFullScreen","");iframeElement.setAttribute("allow","accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture");iframeElement.src=iframeURL;if(videoData.nv&&dataVDP&&dataVDP.changePostionAfter)document.querySelector(dataVDP.changePostionAfter).parentNode.insertBefore(iframeElement,document.querySelector(dataVDP.changePostionAfter).nextSibling);else buttonData.appendChild(iframeElement);if(!iframeElement.src&&iframeElement.getAttribute("data-src")){iframeElement.src=iframeElement.getAttribute("data-src")}if(videoData.nv&&dataVDP&&dataVDP.vehicleTestInline)iframeElement.id=EVSButton+"link_iframe_vt";else iframeElement.id=EVSButton+"link_iframe";iframeElement.addEventListener("load",(function(){createStyleTagAndAppend(`#${EVSButton}link_iframe {opacity: 1;}`);loaderGif.style.cssText="z-index:-999;opacity:0";iframe_img_loader.style.cssText="z-index:-999;opacity:0"}));iframeElement.style.width="1px";iframeElement.style.minWidth="100%";var inlinePlayerOverlay=document.createElement("div");inlinePlayerOverlay.classList.add("flick_overlay_element");inlinePlayerOverlay.style.cssText="display:none;position: fixed; top: 0; bottom: 0; left: 0; right: 0; z-index: 100; width:100%; height:100%;background-color:rgb(0 0 0 / 66%);z-index:99999";buttonData.appendChild(inlinePlayerOverlay);let clearTimeInSec=6;let sendEmbedType=setInterval((function(){sendEmbedTypeFun(iframeElement)}),1e3);setTimeout((()=>{clearInterval(sendEmbedType);sendEmbedType=0}),clearTimeInSec*1e3);window.addEventListener("message",(function(e){try{var data=JSON.parse(e.data);if(data.action==="FFusion_open_popup_inline"){toggleFullScreenModeInline()}if(data.type==="player_4_3"){aspectRatio=.75}if(data.action==="FFusion_open_popup_inline"){isFullScreen=!isFullScreen;document.body.classList.toggle("fFusion_inline_fullscreen_enable");if(isMobile())document.body.classList.toggle("fFusion_inline_fullscreen_is_mobile");toggleFullScreenModeInline()}}catch(e){}}));document.addEventListener("click",(function(e){if(document.body.classList.contains("fFusion_inline_fullscreen_enable")&&document.querySelector("#"+EVSButton+"link iframe")!=e.target){iframeElement.contentWindow.postMessage(JSON.stringify({action:"exitFullScreen"}),"*");isFullScreen=!isFullScreen;document.body.classList.toggle("fFusion_inline_fullscreen_enable");if(isMobile())document.body.classList.toggle("fFusion_inline_fullscreen_is_mobile");toggleFullScreenModeInline()}}));if(videoData.popup&&videoData.popup.type===0||videoData.nv&&videoData.nv.type===0&&dataVDP&&dataVDP.vehicleTestInline){buttonData.style.cssText="position:relative; padding-bottom:60.2%; padding-top:25px; height:0;";iframeElement.style.cssText="position:absolute;top:0; left:0; width:100%; height:100%;"}if(dataVDP&&dataVDP.iframeRegenerateOnResize){window.addEventListener("resize",(function(){var postionTarget=document.querySelector(dataVDP.target);if(window.innerWidth<850){setTimeout((function(){if(!postionTarget.querySelector("#"+EVSButton+"link")){document.querySelector(dataVDP.target).append(sameExistingInlineButton)}}),1200)}else{setTimeout((function(){if(!postionTarget.querySelector("#"+EVSButton+"link")){document.querySelector(dataVDP.target).append(sameExistingInlineButton)}}),1200)}}))}if(checkIsVDP&&dataVDP.inlinePlayer){var iframeWraperClass,iframeWraperStyle,iframeClass,iframeStyle,iframeParentStyle,iframeParentClass;iframeParentClass=targetDeskOrMobile(dataVDP.mobileIframeParentClass,dataVDP.iframeParentClass);iframeParentClass&&(buttonData.className=iframeParentClass);iframeParentStyle=targetDeskOrMobile(dataVDP.mobileIframeParentStyle,dataVDP.iframeParentStyle);iframeParentStyle&&(buttonData.style.cssText=iframeParentStyle);iframeWraperClass=targetDeskOrMobile(dataVDP.mobileIframeWraperClass,dataVDP.iframeWraperClass);iframeWraperClass&&(iframeElement.closest(dataVDP.target).className=iframeWraperClass);iframeWraperStyle=targetDeskOrMobile(dataVDP.mobileIframeWraperStyle,dataVDP.iframeWraperStyle);iframeWraperStyle&&(iframeElement.closest(dataVDP.target).style.cssText=iframeWraperStyle);iframeClass=targetDeskOrMobile(dataVDP.mobileIframeClass,dataVDP.iframeClass);iframeClass&&(iframeElement.className=iframeClass);iframeStyle=targetDeskOrMobile(dataVDP.mobileIframeStyle,dataVDP.iframeStyle);iframeStyle&&(iframeElement.style.cssText="width:1px; min-width:100%;"+iframeStyle)}}window.vehicle_videoData=videoData;return false}function sendEmbedTypeFun(iframeElement){orientationType();iframeElement.contentWindow.postMessage(JSON.stringify({action:"fFusion_from_inline_iframe",parentHeight:window.innerHeight}),"*")}function openLargePopup(modalType){new ConModal({width:960,videoPage:modalType,modalTitle:"Video",iframeUrl:videoData.popup.url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle});var evs_iframe=document.getElementById(EVSButton+"link_iframe");evs_iframe.src=evs_iframe.src+"&disable_auto_play=1"}if(_custom_script_run!==undefined){if(_custom_script_run.add360SpinSingleTab){_custom_script_run.runAddTab360Spin();return false}else if(_custom_script_run.runSiteSpecifigScript){_custom_script_run.script(videoData,buttonData,getProfileData,dataVLP,dataVDP,checkIsVDP,checkIsVLP);if(_custom_script_run.stopProcess){return false}}_button_image_path=_custom_script_run.buttonImage;_displayButtonThumb=generateButton(videoData,buttonData,_custom_script_run,getButtonImagePath,_button_image_path);if(_custom_script_run.appendElement){if(_custom_script_run.replaceAsInlinePlayer){var makeInlinePlayer=buttonData.cloneNode(true);makeInlinePlayer.setAttribute(EVSButton+"inline",1);_custom_script_run.appendElement(buttonData).innerHTML=makeInlinePlayer.outerHTML}if(videoData.thumb&&!_custom_script_run.replaceAsInlinePlayer)_custom_script_run.appendElement(buttonData).appendChild(_displayButtonThumb);if(_custom_script_run.parentElementCSS)_custom_script_run.appendElement(buttonData).style.cssText=_custom_script_run.parentElementCSS;if(_custom_script_run.targetElementSectionForCSS)_custom_script_run.targetElementSectionForCSS(buttonData).style.cssText=_custom_script_run.targetElementSectionCSS;if(_custom_script_run.siteCustomCssInclude){var styleTag=document.createElement("style");styleTag.innerText=_custom_script_run.siteCustomCssInclude;document.head.appendChild(styleTag)}}_displayButtonThumb.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();new ConModal({width:videoData.nv?videoData.nv.button==="AF"?"90%":960:960,videoPage:videoData.thumb.type,modalTitle:"Video",iframeUrl:videoData.thumb.url+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,thumbnailUrl:thumbnailUrl})}))}if(videoData.popup){_displayButtonDefault=generateButton(videoData,buttonData,null,getButtonImagePath,null);if(_custom_script_run!==undefined&&_custom_script_run.showButton===false||checkIsVLP&&dataVLP.showButton===false||checkIsVDP&&dataVDP.showButton===false)return false;else buttonData.appendChild(_displayButtonDefault);defaultSpanishButtonImages={vid360:"//gcbimages.storage.googleapis.com/vidbtn/play_video_bt_spanish.png",vid:"//gcbimages.storage.googleapis.com/vidbtn/cc1_sp_grn.png",only360:"//gcbimages.storage.googleapis.com/vidbtn/espanol.png"};if(videoData.popup.spanish_client_fk){var spanis_profile=_profilesBag[videoData.popup.spanish_client_fk];if(checkIsVLP||!checkIsVDP&&_buttons_count>1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360Button=spanis_profile!=undefined&&spanis_profile.img_srp_360?spanis_profile.img_srp_360:defaultSpanishButtonImages.vid360;spanish_button_image_path=vid360Button}if(videoData.popup.model_type==="vid"){var OnlyVid=spanis_profile!=undefined&&spanis_profile.srp_btn_img?spanis_profile.srp_btn_img:defaultSpanishButtonImages.vid;spanish_button_image_path=OnlyVid}if(Number(videoData.popup.model_type)===360){var only360=spanis_profile!=undefined&&spanis_profile.img_srp_360_only?spanis_profile.img_srp_360_only:defaultSpanishButtonImages.only360;spanish_button_image_path=only360}}}if(checkIsVDP||!checkIsVLP&&_buttons_count===1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360ButtonVdp=spanis_profile!=undefined&&spanis_profile.img_vdp_360?spanis_profile.img_vdp_360:defaultSpanishButtonImages.vid360;spanish_button_image_path=vid360ButtonVdp}if(videoData.popup.model_type==="vid"){var OnlyVidVDP=spanis_profile!=undefined&&spanis_profile.vdp_btn_img?spanis_profile.vdp_btn_img:defaultSpanishButtonImages.vid;spanish_button_image_path=OnlyVidVDP}if(Number(videoData.popup.model_type)===360){var only360VDP=spanis_profile!=undefined&&spanis_profile.img_vdp_360_only?spanis_profile.img_vdp_360_only:defaultSpanishButtonImages.only360;spanish_button_image_path=only360VDP}}}}if(videoData.popup.spanish_url){var _display_spanish_btn=document.createElement("img");_display_spanish_btn.src=getProfileData.spanish_btn_url||spanish_button_image_path;_display_spanish_btn.style.cursor="pointer";var popupWidthSpanish=isLandingPage?"90%":960;var iframeURLSpanish=videoData.popup.spanish_url;_display_spanish_btn.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();new ConModal({width:popupWidthSpanish,videoPage:videoData.popup.type,modalTitle:"Video",iframeUrl:iframeURLSpanish+"&referer="+_getRefDomain+(!isLandingPage?"":"&full_screen=1")+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,fullscreen:videoData.popup.tab===1&&!isLandingPage?true:false,thumbnailUrl:thumbnailUrl});window.vehicle_videoData=videoData}));buttonData.appendChild(_display_spanish_btn)}var iframeURL=videoData.popup.url;let customWidth;if(document.querySelector(dataVLP.VLPIndicator))customWidth=dataVLP.customPopupWidth;else if(document.querySelector(dataVDP.VDPIndicator))customWidth=dataVDP.customPopupWidth;var popupWidth=isLandingPage?"90%":customWidth?customWidth:960;_displayButtonDefault.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();if(videoData.popup.ece==1){modalEce=new ConModalEce({width:"1154px",closeBtn:false,enableMobileFullHeight:true,closeOnOverlayClick:false,iframeUrl:videoData.popup.url+"&referer="+_getRefDomain+(!isLandingPage?"":"&full_screen=1")+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle})}else if(videoData.popup?.modal_v2==1){new ConModalV2({iframeUrl:videoData?.popup?.url+"&modal_embed=1"+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle})}else{if(window.location.href.indexOf("www.mycars.com")>-1){document.body.scrollIntoView()}new ConModal({width:popupWidth,videoPage:videoData.popup.type,modalTitle:"Video",iframeUrl:iframeURL+"&referer="+_getRefDomain+(!isLandingPage?"":"&full_screen=1")+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,fullscreen:videoData.popup.tab===1&&!isLandingPage?true:false,thumbnailUrl:thumbnailUrl})}window.vehicle_videoData=videoData}))}if(videoData.nv){if(Number(getProfileData.flow_found)==1&&videoData.nv.type===0&&!(dataVLP.ignoreFlowFound||dataVDP.ignoreFlowFound))return;var vh_af_queryString="&vin="+videoData.veh_vin+"&year="+videoData.veh_year+"&make="+encodeURIComponent(videoData.veh_make)+"&model="+encodeURIComponent(videoData.veh_model)+"&trim="+encodeURIComponent(videoData.veh_trim)+"&body_type="+encodeURIComponent(videoData.veh_body);var _dislpay_nv_button_img=videoData.nv.button==="VT"?getProfileData.veh_test_img:getProfileData.af_img;if((_buttons_count===1||checkIsVDP)&&getProfileData.vdp_btn_img_VehFF&&ignoreGlobleVTBtn&&!(document.querySelector(extVlpIndicator)||document.querySelector(dataVLP.VLPIndicator))){_dislpay_nv_button_img=getProfileData.vdp_btn_img_VehFF}if(getProfileData.srp_btn_img_VehFF&&ignoreGlobleVTBtn&&(document.querySelector(extVlpIndicator)||document.querySelector(dataVLP.VLPIndicator))){_dislpay_nv_button_img=getProfileData.srp_btn_img_VehFF}var nv_evs_button=generateButton(videoData,buttonData,_custom_script_run,getButtonImagePath,_dislpay_nv_button_img,null,true);nv_evs_button.addEventListener("click",(function(e){e.preventDefault();e.stopPropagation();new ConModal({width:videoData.nv?videoData.nv.button==="AF"?"90%":960:960,videoPage:videoData.nv.type,modalTitle:"Video",iframeUrl:videoData.nv.url+vh_af_queryString+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle,thumbnailUrl:thumbnailUrl});window.vehicle_videoData=videoData}));buttonData.appendChild(nv_evs_button)}buttonData.setAttribute("verified","")};window.addEventListener("orientationchange",(function(){orientationType();if(isFullScreen){setTimeout((function(){toggleFullScreenModeInline()}),200)}}));function orientationType(){if(document.querySelector("#"+EVSButton+"link_iframe"))sendOrientation("#"+EVSButton+"link_iframe");if(document.querySelector("#con-iframe"))sendOrientation("#con-iframe")}function toggleFullScreenModeInline(){if(!isMobile())return;var screenHeight,getWidth,aspectRatioVal;if(aspectRatio==.75){aspectRatioVal=4/3}else{aspectRatioVal=16/9}if(orientationType()==="landscape"){screenHeight=window.innerHeight;getWidth=Math.round(window.innerHeight*aspectRatioVal);document.querySelector("#"+EVSButton+"link_iframe").style.cssText="width:1px; min-width:"+getWidth+"px;"+"height:"+screenHeight+"px;"}else{document.querySelector("#"+EVSButton+"link_iframe").style.cssText=""}if(!isFullScreen){document.querySelector("#"+EVSButton+"link_iframe").style.width="1px";document.querySelector("#"+EVSButton+"link_iframe").style.minWidth="100%"}}function sendOrientation(id){switch(window.orientation){case-90:case 90:document.querySelector(id).contentWindow.postMessage(JSON.stringify({action:"fFusion_from_inline_orientation",value:"landscape"}),"*");return"landscape";default:document.querySelector(id).contentWindow.postMessage(JSON.stringify({action:"fFusion_from_inline_orientation",value:"portrait"}),"*");return"potrait"}}var generateButton=function(videoData,buttonData,options,getButtonImagePath,custom_button_image_path,isFyusePlayer,isVT){var createButton=document.createElement("div"),currentProfile,additionalStylesFromSiteConfig=null;if(!isFyusePlayer)currentProfile=_profilesBag[videoData.client_fk];if(!currentProfile)currentProfile=_profilesBag[clientKey];if(testClient)currentProfile=_profilesBag[clientKeyForTest];if(checkIsVDP&&dataVDP.fixedButtonText)currentProfile.btn_text=1;if(videoData)addJsonLdToHead(videoData.jsonLD,checkIsVDP,dataVDP.isIndex);if(Number(currentProfile.btn_text)==1&&!isVT||isVT&&(videoData.nv&&Number(currentProfile.btn_text_VehFF)==1)){_buttonsCount++;if(_buttonsCount===1)createStyleTagAndAppend("#"+EVSButton+"link a:hover{opacity:0.9}");if(dataVLP&&checkIsVLP){var additionalStylesFromSiteConfig={buttonClass:targetDeskOrMobile(dataVLP.mobileButtonClass,dataVLP.buttonClass),buttonStyle:targetDeskOrMobile(dataVLP.mobileButtonStyle,dataVLP.buttonStyle),buttonParentClass:targetDeskOrMobile(dataVLP.mobileButtonParentClass,dataVLP.buttonParentClass),buttonParentStyle:targetDeskOrMobile(dataVLP.mobileButtonParentStyle,dataVLP.buttonParentStyle),buttonWrapperClass:targetDeskOrMobile(dataVLP.mobileButtonWrapperClass,dataVLP.buttonWrapperClass),buttonWrapperStyle:targetDeskOrMobile(dataVLP.mobileButtonWrapperStyle,dataVLP.buttonWrapperStyle)}}if(dataVDP&&checkIsVDP&&!dataVDP.inlinePlayer){var additionalStylesFromSiteConfig={buttonClass:targetDeskOrMobile(dataVDP.mobileButtonClass,dataVDP.buttonClass),buttonStyle:targetDeskOrMobile(dataVDP.mobileButtonStyle,dataVDP.buttonStyle),buttonParentClass:targetDeskOrMobile(dataVDP.mobileButtonParentClass,dataVDP.buttonParentClass),buttonParentStyle:targetDeskOrMobile(dataVDP.mobileButtonParentStyle,dataVDP.buttonParentStyle),buttonWrapperClass:targetDeskOrMobile(dataVDP.mobileButtonWrapperClass,dataVDP.buttonWrapperClass),buttonWrapperStyle:targetDeskOrMobile(dataVDP.mobileButtonWrapperStyle,dataVDP.buttonWrapperStyle)}}createButton=getDesignedButton(videoData,buttonData,additionalStylesFromSiteConfig,currentProfile,isFyusePlayer,isVT);if(isFyusePlayer)return createButton}else{createButton=document.createElement("img");createButton.style.cursor="pointer";createButton.src=getButtonImagePath(videoData,buttonData,custom_button_image_path,currentProfile,isFyusePlayer)}if(videoData&&videoData.popup&&videoData.popup.alt){createButton.setAttribute("alt",videoData.popup.alt);createButton.setAttribute("title",videoData.popup.alt)}if(options){if(options.buttonText){createButton=document.createElement("span");createButton.innerText=options.buttonText}if(options.buttonCSS){createButton.style.cssText=options.buttonCSS;createButton.style.cursor="pointer"}}if(checkIsVDP&&Number(clientData.data[0].flow_found)&&document.querySelector("#"+EVSButton+"link")&&window.getComputedStyle(document.querySelector("#"+EVSButton+"link")).getPropertyValue("display")!="none"){var cssFFStyle=".ff-vr-video-button{display:none;}";createStyleTagAndAppend(cssFFStyle)}return createButton};function getDesignedButton(videoData,buttonData,additionalStyle,currentProfile,isFyusePlayer,isVT){_buttons_count=document.querySelectorAll("#"+EVSButton+"link").length;if(_buttons_count>1||checkIsVLP){if(videoData.nv&&isVT){return createButtonWithCss(currentProfile.srp_btn_text_VehFF,currentProfile.srp_btn_fontsize_VehFF,currentProfile.srp_btn_textcolor_VehFF,currentProfile.srp_btn_bgcolor_VehFF,additionalStyle,buttonData)}else if(isFyusePlayer){return createButtonWithCss(currentProfile.srp_btn_text_360_only,currentProfile.srp_btn_fontsize_360_only,currentProfile.srp_btn_textcolor_360_only,currentProfile.srp_btn_bgcolor_360_only,additionalStyle,buttonData,isFyusePlayer)}else if(videoData.popup){if(Number(videoData.popup.model_type)===360){return createButtonWithCss(currentProfile.srp_btn_text_360_only,currentProfile.srp_btn_fontsize_360_only,currentProfile.srp_btn_textcolor_360_only,currentProfile.srp_btn_bgcolor_360_only,additionalStyle,buttonData)}else if(videoData.popup.model_type==="vid360"){return createButtonWithCss(currentProfile.srp_btn_text_vid360,currentProfile.srp_btn_fontsize_vid360,currentProfile.srp_btn_textcolor_vid360,currentProfile.srp_btn_bgcolor_vid360,additionalStyle,buttonData)}else if(videoData.popup.model_type==="vid"){return createButtonWithCss(currentProfile.srp_btn_text_vid_only,currentProfile.srp_btn_fontsize_vid_only,currentProfile.srp_btn_textcolor_vid_only,currentProfile.srp_btn_bgcolor_vid_only,additionalStyle,buttonData)}}}if(_buttons_count===1||checkIsVDP){if(videoData.nv&&isVT){return createButtonWithCss(currentProfile.vdp_btn_text_VehFF,currentProfile.vdp_btn_fontsize_VehFF,currentProfile.vdp_btn_textcolor_VehFF,currentProfile.vdp_btn_bgcolor_VehFF,additionalStyle,buttonData)}else if(isFyusePlayer){return createButtonWithCss(currentProfile.vdp_btn_text_360_only,currentProfile.vdp_btn_fontsize_360_only,currentProfile.vdp_btn_textcolor_360_only,currentProfile.vdp_btn_bgcolor_360_only,additionalStyle,buttonData)}else if(videoData.popup){if(videoData.popup.model_type==="vid360"){return createButtonWithCss(currentProfile.vdp_btn_text_vid360,currentProfile.vdp_btn_fontsize_vid360,currentProfile.vdp_btn_textcolor_vid360,currentProfile.vdp_btn_bgcolor_vid360,additionalStyle,buttonData)}else if(videoData.popup.model_type==="vid"){return createButtonWithCss(currentProfile.vdp_btn_text_vid_only,currentProfile.vdp_btn_fontsize_vid_only,currentProfile.vdp_btn_textcolor_vid_only,currentProfile.vdp_btn_bgcolor_vid_only,additionalStyle,buttonData)}else if(Number(videoData.popup.model_type)===360){return createButtonWithCss(currentProfile.vdp_btn_text_360_only,currentProfile.vdp_btn_fontsize_360_only,currentProfile.vdp_btn_textcolor_360_only,currentProfile.vdp_btn_bgcolor_360_only,additionalStyle,buttonData)}}}}function createButtonWithCss(buttonText,fontSize,fontColor,backgroundColor,additionalStyle,buttonData){var buttonDesign=document.createElement("a");var defaultStyles="display:inline-block; padding:5px; cursor:pointer;text-decoration:none;text-align:center;";buttonDesign.href="#";buttonDesign.style.cssText=defaultStyles;if(additionalStyle){if(additionalStyle.buttonStyle){buttonDesign.style.cssText=defaultStyles+additionalStyle.buttonStyle}if(additionalStyle.buttonClass){var makeClassName=additionalStyle.buttonClass.split(" ").toString().replace(/\,/g," ");buttonDesign.className=makeClassName}if(additionalStyle.buttonParentClass){var parentClassName=additionalStyle.buttonParentClass.split(" ").toString().replace(/\,/g," ");buttonData.className=parentClassName}if(additionalStyle.buttonParentStyle){buttonData.style.cssText=additionalStyle.buttonParentStyle}if(additionalStyle.buttonWrapperClass&&buttonData.closest(dataVLP.container)){var buttonWrapperClass=additionalStyle.buttonWrapperClass.split(" ").toString().replace(/\,/g," ");buttonData.closest(dataVLP.container).className=buttonWrapperClass}if(additionalStyle.buttonWrapperStyle&&buttonData.closest(dataVLP.container)){buttonData.style.cssText=additionalStyle.buttonWrapperStyle;buttonData.closest(dataVLP.container).style.cssText=additionalStyle.buttonWrapperStyle}}if(checkIsVDP&&dataVDP.fixedButtonText)buttonText=dataVDP.fixedButtonText;buttonDesign.innerHTML=buttonText||"Watch Vidoe";if(checkIsVLP&&dataVLP.prependIconElement){buttonDesign.innerHTML=dataVLP.prependIconElement+" "+buttonText+""}if(checkIsVDP&&dataVDP.prependIconElement){buttonDesign.innerHTML=dataVDP.prependIconElement+" "+buttonText+""}if(checkIsVLP&&dataVLP.disableDefaultButtonStyles||checkIsVDP&&dataVDP.disableDefaultButtonStyles)return buttonDesign;buttonDesign.style.fontSize=fontSize+"px"||"16px";buttonDesign.style.color=fontColor||"#fff";buttonDesign.style.backgroundColor=backgroundColor;if(additionalStyle&&additionalStyle.buttonStyle&&additionalStyle.buttonStyle.indexOf("background-color")>-1)buttonDesign.style.backgroundColor=additionalStyle.buttonStyle.match(/background-color:\s*([^;}]*)/)[1];return buttonDesign}function getButtonImagePath(videoData,buttonData,custom_button_image_path,currentProfile,isFyusePlayer){_buttons_count=document.querySelectorAll("#"+EVSButton+"link").length;_button_image_path=buttonData.getAttribute(EVSButton+"img")||currentProfile.vid_button;var defaultButtonImages={vid360:`${_mediaHostURL}videos/global/images/play_video_360.png`,vid:`${_mediaHostURL}videos/global/images/ff_play.png`,only360:`${_mediaHostURL}videos/global/images/360_spin.png`};if(checkCDK=="1")defaultButtonImages.vid=`${_mediaHostURL}videos/global/images/video_btn_red.png`;if(isFyusePlayer){if(_buttons_count>1||checkIsVLP){var only360=currentProfile.img_srp_360_only==""?defaultButtonImages.only360:currentProfile.img_srp_360_only;_button_image_path=buttonData.getAttribute(EVSButton+"img")||only360}if(_buttons_count===1||checkIsVDP){var only360VDP=currentProfile.img_vdp_360_only==""?defaultButtonImages.only360:currentProfile.img_vdp_360_only;_button_image_path=only360VDP}return _button_image_path}if(custom_button_image_path){return _button_image_path=custom_button_image_path}if(checkIsVLP||!checkIsVDP&&_buttons_count>1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360Button=currentProfile.img_srp_360==""?defaultButtonImages.vid360:currentProfile.img_srp_360;_button_image_path=buttonData.getAttribute(EVSButton+"img")||vid360Button}if(videoData.popup.model_type==="vid"){var OnlyVid=currentProfile.srp_btn_img==""?defaultButtonImages.vid:currentProfile.srp_btn_img;_button_image_path=buttonData.getAttribute(EVSButton+"img")||OnlyVid}if(Number(videoData.popup.model_type)===360){var only360=currentProfile.img_srp_360_only==""?defaultButtonImages.only360:currentProfile.img_srp_360_only;_button_image_path=buttonData.getAttribute(EVSButton+"img")||only360}}}if(checkIsVDP||!checkIsVLP&&_buttons_count===1){if(videoData.popup){if(videoData.popup.model_type==="vid360"){var vid360ButtonVdp=currentProfile.img_vdp_360==""?defaultButtonImages.vid360:currentProfile.img_vdp_360;_button_image_path=buttonData.getAttribute(EVSButton+"img")||vid360ButtonVdp}if(videoData.popup.model_type==="vid"){var OnlyVidVDP=currentProfile.vdp_btn_img==""?defaultButtonImages.vid:currentProfile.vdp_btn_img;_button_image_path=buttonData.getAttribute(EVSButton+"img")||OnlyVidVDP}if(Number(videoData.popup.model_type)===360){var only360VDP=currentProfile.img_vdp_360_only==""?defaultButtonImages.only360:currentProfile.img_vdp_360_only;_button_image_path=buttonData.getAttribute(EVSButton+"img")||only360VDP}}}if(currentProfile.exclusive_btn){_button_image_path=currentProfile.exclusive_btn}if(checkIsVLP&&dataVLP.thumnailPlayIcon||checkIsVDP&&dataVDP.thumnailPlayIcon)_button_image_path=currentProfile.thumb_paly_img;if(_button_image_path!=""){if(!_button_image_path.match(/\.(jpg|jpeg|png|gif)$/)){_button_image_path=currentProfile.vid_button;console.log("Not Image")}}return _button_image_path}function isHidden(el){if(el instanceof Element){var style=window.getComputedStyle(el);if(style.display==="none")return true;return el.offsetParent===null}return false}function isMobile(){if(navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i))return true;return false}var checkIsMobile=isMobile();function targetDeskOrMobile(mobile,desktop){return checkIsMobile?mobile:desktop}var defaultOptions={timeout:25e3,jsonpCallback:"jsoncallback",jsonpCallbackFunction:null};function generateCallbackFunction(){return"jsonp_"+(new Date).getTime()+"_"+Math.ceil(Math.random()*1e5)}function clearFunction(functionName){try{delete window[functionName]}catch(e){window[functionName]=undefined}}function removeScript(scriptId){var script=document.getElementById(scriptId);if(script){document.getElementsByTagName("head")[0].removeChild(script)}}function fetchJsonp(_url){var options=arguments.length<=1||arguments[1]===undefined?{}:arguments[1];var url=_url;var timeout=options.timeout||defaultOptions.timeout;var jsonpCallback=options.jsonpCallback||defaultOptions.jsonpCallback;var timeoutId=undefined;return new Promise((function(resolve,reject){var callbackFunction=options.jsonpCallbackFunction||generateCallbackFunction();var scriptId=jsonpCallback+"_"+callbackFunction;window[callbackFunction]=function(response){resolve({ok:true,json:function json(){return Promise.resolve(response)}});if(timeoutId)clearTimeout(timeoutId);removeScript(scriptId);clearFunction(callbackFunction)};url+=url.indexOf("?")===-1?"?":"&";var jsonpScript=document.createElement("script");jsonpScript.setAttribute("src",""+url+jsonpCallback+"="+callbackFunction);if(options.charset){jsonpScript.setAttribute("charset",options.charset)}jsonpScript.id=scriptId;document.getElementsByTagName("head")[0].appendChild(jsonpScript);timeoutId=setTimeout((function(){reject(new Error("JSONP request to "+_url+" timed out"));clearFunction(callbackFunction);removeScript(scriptId);window[callbackFunction]=function(){clearFunction(callbackFunction)}}),timeout);jsonpScript.onerror=function(){reject(new Error("JSONP request to "+_url+" failed"));clearFunction(callbackFunction);removeScript(scriptId);if(timeoutId)clearTimeout(timeoutId)}}))}function requestDataJSONP(url,key,callback){var doc=document,head=doc.head,script=doc.createElement("script"),callbackName="f"+Math.round(Math.random()*Date.now());script.setAttribute("src",url+(url.indexOf("?")>0?"&":"?")+key+"="+callbackName);window[callbackName]=function(json){window[callbackName]=undefined;setTimeout((function(){head.removeChild(script)}),0);callback(json)};head.appendChild(script)}async function postData(payload,type){return;const result=await fetch(_pageStatsServiceURL+type,{method:"POST",body:JSON.stringify(payload)});return result.json()}function enableDirectModalShow(videoData){if(!(videoData.nv||videoData.popup))return;var popupURL=videoData.nv?videoData.nv.url:videoData.popup.url;var playerObject,playerURL,validParams=["enable_auto_play","auto_resize","disable_auto_play"];playerObject=generatePlayerURL(getParameterByName("content_type"));playerURL=playerObject.url+getParameterByName(EVSButton+"video_key");validParams.map((param=>{if(getParameterByName(param))playerURL+="&"+param.toString()+"="+getParameterByName(param)}));new ConModal({width:playerObject.width,videoPage:playerObject.type,modalTitle:"Video",iframeUrl:popupURL+"&referer="+_getRefDomain+"&h_p="+_getRefURL+"&h_p_r="+_referredFrom+"&h_t="+_documentTitle});function generatePlayerURL(type){switch(type){case"tabbed":return{url:`${_mediaHostURL}p/pt?video_fkey=`,type:2,width:960};break;case"lp":return{url:`${_mediaHostURL}NLP/?video_fkey=`,type:1,width:"100%"};break;case"video":return{url:`${_mediaHostURL}p/v?auto_resize=1&video_fkey=`,type:0,width:"960"};break;default:return{url:`${_mediaHostURL}p/v?auto_resize=1&video_fkey=`,type:0,width:"960"};break}}}createStyleTagAndAppend(`.fFusion_inline_fullscreen_enable .flick_overlay_element { display:block !important; }.fFusion_inline_fullscreen_enable { overflow: hidden;} #${EVSButton}link_iframe{ width: 1px; min-width: 100%; } .fFusion_inline_fullscreen_enable:not(.fFusion_inline_fullscreen_is_mobile):not(.ff_fullscreen_enabled) #${EVSButton}link[${EVSButton}inline="1"] iframe{ display: flex;z-index:9999999; align-items: center; justify-content: center; overflow: none; position: fixed !important; top: 50% !important; left: 50% !important; width: 100%; max-width: 960px; width: 100% !important; /*max-width: 50% !important;*/ min-width: unset !important; -moz-transform: translateX(-50%) translateY(-50%); -webkit-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); } .fFusion_inline_fullscreen_is_mobile.fFusion_inline_fullscreen_is_mobile:not(.ff_fullscreen_enabled) #${EVSButton}link[${EVSButton}inline="1"] iframe{ position: fixed !important; display: flex; align-items: center; justify-content: center; transform: translate(-50%, -50%); left: 50%; top: 50%; width: unset ; min-width: 100%; overflow: auto; z-index:999999 } #conmodal-loader-gif {position: absolute;top: 0;left: 0;width: 100%;height: 100%;background-image:url("${_mediaHostURL}videos/global/images/loading.gif"); background-position: center;background-repeat: no-repeat;background-size: auto;opacity: 1;transition: opacity 1s ease;z-index:-999;} .popup_loader_img {max-width:640px;opacity: 1;transition: opacity 1s ease;z-index:-999;width:100%;}`);["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","msfullscreenchange"].forEach((eventType=>document.addEventListener(eventType,onFullscreenToggle,false)));function onFullscreenToggle(){document.body.classList.toggle("ff_fullscreen_enabled");if(document.body.classList.contains("fFusion_inline_fullscreen_enable")&&document.body.classList.contains("fFusion_inline_fullscreen_is_mobile")){if(orientationType()==="landscape"){setTimeout((function(){toggleFullScreenModeInline()}),1200)}}}function removeFFSnippetsAddedOnPage(dataVLP){if(dataVLP.removeExistingButtons&&document.querySelector("#"+EVSButton+"link")){var existingFlickButton=document.querySelectorAll("#"+EVSButton+"link");for(var i=0;i