Select Body Type
jQuery(function(){ var timer = 0, x = readCookie('buick_gmc_popup'); checkCookie(); function checkCookie(){ if(!x) { createCookie('buick_gmc_popup','buick_gmc_popup',60); initCheck(); } } function initCheck(){ if(!isMobile()) { var promos = ContextManager.getPromotions() || []; for(var i = 0; i < promos.length; i++){ if(promos[i].title == 'buick_popup'){ popup('images/buick_gmc_popup/b.jpg',6000); } else if(promos[i].title == 'gmc_popup'){ popup('images/buick_gmc_popup/g.jpg',6000); } else if(promos[i].title == 'buick_gmc_popup'){ popup('images/buick_gmc_popup/bg.jpg',6000); } } } } function isMobile() { var lpLayout = ContextManager.getPageLayout(); if (lpLayout.match(/mobile/)) { return true; } return false; } function createCookie(name,value,days) { if (days){ var date = new Date(); date.setTime(date.getTime()+(days*24*60*60*1000)); var expires = "; expires="+date.toGMTString(); } else var expires = ""; document.cookie = name+"="+value+expires+"; path=/"; } function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==' ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); } return null; } function popup(img,delay){ var screenHeight = (Number(jQuery(document).height())+300), topAmount = (Number(jQuery(window).scrollTop()+300)); if (topAmount >= (screenHeight-300)) {topAmount-=300;} jQuery('body').append("
"); jQuery('#buick_gmc_promo_popup_overlay, #buick_gmc_promo_popup').fadeIn(500); timer = setTimeout(function(){destroy()},delay); jQuery('#buick_gmc_promo_popup').click(function(){ destroy(); }); } function destroy(){ clearTimeout(timer); jQuery('#buick_gmc_promo_popup_overlay, #buick_gmc_promo_popup').fadeOut(500,function(){jQuery('#buick_gmc_promo_popup_overlay, #buick_gmc_promo_popup').remove()}); } });