jQuery(document).ready(function(){stickyHeader();loadShowcaseImages();smoothScroll();switchPlans();mimicDomainTyping();if(!isTouchDevice()){paralax();}
autoplayVideo();fixWidows();showToolTips();toggleMobileNavigation();});jQuery(window).load(function(){fixPlanHeights();fixBenefitsHeight();fixProductsHeight();fixFeaturesLineBreak();});jQuery(window).resize(function(){fixPlanHeights();fixBenefitsHeight();fixProductsHeight();fixFeaturesLineBreak();});function stickyHeader(){var lp_container='.lp-headline .lp-container';var lp_cta='#headline-cta';if(jQuery('.lp-headline').hasClass('is-theme-com-org')){lp_container='.lp-container-copy';lp_cta='.lp-container-copy h1';}
var waypoints=jQuery(lp_container).waypoint({handler:function(direction){if(direction==='down'){jQuery('.masterbar').toggleClass('is-invisible is-transparent');}
if(direction==='up'){jQuery('.masterbar ').toggleClass('is-invisible is-transparent');}}});jQuery(lp_cta).waypoint(function(){jQuery('.masterbar ').toggleClass('is-fixed');},{offset:'-70px'});}
function switchPlans(){jQuery('.plan-view-switcher a').on('click',function(){jQuery(this).removeClass('is-active');jQuery(this).siblings().addClass('is-active');jQuery('.plans-compare').each(function(){jQuery(this).toggleClass('is-active');});return false;});}
jQuery('body').on('click',function(){if(window.tooltipOpen){hideToolTip();}
hideMobileNavigation();});function paralax(){var $window=jQuery(window);jQuery('section[data-type="background"]').each(function(){var $bgobj=jQuery(this);jQuery(window).scroll(function(){var yPos=-($window.scrollTop()/$bgobj.data('speed'));var coords='50% '+yPos+'%';$bgobj.css({backgroundPosition:coords});});});}
function smoothScroll(){var offset=45;if(isTouchDevice())
offset=0;jQuery('.is-local-anchor').on('click',function(e){e.preventDefault();var target=this.hash;var target=jQuery(target);var distance=target.offset().top-offset;jQuery('html, body').stop().animate({'scrollTop':distance},900,'swing');});}
function loadShowcaseImages(){var hasWebpSupport=false,isRetina=false;fileExtension='.jpg',retina='';isRetina=hasRetinaSupport();if(jQuery('html').hasClass('webp')){fileExtension='.webp';}
jQuery('.showcase-examples img, .showcase-browser img').each(function(index,element){fileURL=jQuery(element).attr('data-img-url');if(isRetina&&jQuery(element).hasClass('has-2x'))
retina='-2x';else{retina='';}
jQuery(element).attr('src',fileURL+retina+fileExtension);});}
function hasRetinaSupport(){var mediaQuery="(-webkit-min-device-pixel-ratio: 1.5),\
	        (min--moz-device-pixel-ratio: 1.5),\
	        (-o-min-device-pixel-ratio: 3/2),\
	        (min-resolution: 1.5dppx)";if(window.devicePixelRatio>1)
return true;if(window.matchMedia&&window.matchMedia(mediaQuery).matches)
return true;return false;}
function isTouchDevice(){return'ontouchstart'in window||'onmsgesturechange'in window;};function mimicDomainTyping(){if(jQuery('.lp-domains').length){var inview=new Waypoint.Inview({element:jQuery('#domains')[0],enter:function(direction){animateDomain()}});}}
function animateDomain(){jQuery(".lp-domains__domain-url").typed({stringsElement:jQuery('#domain-strings'),typeSpeed:30,backDelay:2000,backSpeed:10,loop:true,loopCount:3});}
function isIE(){var nav=navigator.userAgent.toLowerCase();return(nav.indexOf('msie')!=-1)?parseInt(nav.split('msie')[1]):false;}
function isApple(){return!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform);}
function autoplayVideo(){if(jQuery('.video-overlay').length){if(!isApple()&&!(isIE()&&isIE()<9)&&window.innerWidth>680){var videoURL=jQuery('.video-overlay').attr('data-file');videoElement='<video autoplay loop >';videoElement+='<source src="'+videoURL+'.mp4" type="video/mp4">';videoElement+='<source src="'+videoURL+'.webm" type="video/webm">';videoElement+='<source src="'+videoURL+'.ogv" type="video/ogv">';videoElement+='</video>';jQuery('.video-overlay').append(videoElement);}
else{var fallbackclass=jQuery('.lp-headline').attr('data-fallbackclass');jQuery('.lp-headline').addClass(fallbackclass);}}}
function fixWidows(){jQuery("h2,h3,h4,.no-widows,.description p, .lp-benefits__illustration p").each(function(){var string=jQuery(this).html();string=string.replace(/ ([^ ]*)$/,'&nbsp;$1');jQuery(this).html(string);});}
function fixPlanHeights(){setHeight(".plans-table .plan-header.adjust-height");setHeight(".plans-table .pre-features p:first-child");setHeight(".plans-table .pre-features");}
function fixProductsHeight(){setHeight('.lp-segment__description',980);setHeight('.lp-offers-column h3',980);setHeight('.lp-offers-partners div',980);}
function setHeight(targetElementsClass,breakpoint){breakpoint=breakpoint||660;if(jQuery(window).width()>breakpoint){var highestBox=0,currentHeight=0;jQuery(targetElementsClass).each(function(){currentHeight=jQuery(this).outerHeight(true);if(currentHeight>highestBox){highestBox=currentHeight;}});jQuery(targetElementsClass).each(function(){jQuery(this).css({"min-height":highestBox+"px"});});}
else{jQuery(targetElementsClass).each(function(){jQuery(this).css({"min-height":0});});}}
function showToolTips(){var topDistance=0,rightDistance=0,leftDistance=0,tooltipHeight=0,tooltipWidth=0;var tooltipId,tooltipContent;jQuery("body").on("click",function(){hideToolTip();});jQuery(".features-list__item-tooltip").each(function(){jQuery(this).on("click",function(e){if(jQuery(this).hasClass("is-active")){hideToolTip();}
else{hideToolTip();jQuery(this).addClass("is-active");tooltipId=jQuery(this).attr('id');tooltipContent=featureTooltips[tooltipId];jQuery(".features-list__item-tooltip-content").text(tooltipContent);tooltipHeight=jQuery(".features-list__item-tooltip-container").height();tooltipWidth=jQuery(".features-list__item-tooltip-container").width();topDistance=jQuery(this).offset().top-tooltipHeight/2-2;leftDistance=jQuery(this).offset().left+18;rightDistance=jQuery(window).width()-(jQuery(this).offset().left+jQuery(this).outerWidth());if(rightDistance<300){leftDistance=leftDistance-tooltipWidth-37;jQuery(".features-list__item-tooltip-container").addClass("is-reversed");jQuery(".features-list__item-tooltip-container").offset({top:topDistance,left:leftDistance});jQuery(".features-list__item-tooltip-container").css({opacity:1});}
else{jQuery(".features-list__item-tooltip-container").removeClass("is-reversed");jQuery(".features-list__item-tooltip-container").offset({top:topDistance,left:leftDistance});jQuery(".features-list__item-tooltip-container").css({opacity:1});}}
e.stopPropagation();});});}
function hideToolTip(){jQuery(".features-list__item-tooltip.is-active").each(function(){jQuery(this).removeClass("is-active");});jQuery(".features-list__item-tooltip-container").offset({top:-100,left:-500});jQuery(".features-list__item-tooltip-container").css({opacity:0});}
function fixFeaturesLineBreak(){var feature_list_class='features-list';var featureLists=document.getElementsByClassName(feature_list_class);var colCount=0;var rowCount=0;jQuery('.'+feature_list_class).each(function(index,list){++colCount;rowCount=list.children.length>rowCount?list.children.length:rowCount;});for(var iRow=0;iRow<rowCount;++iRow){var maxHeight=0;for(var iCol=0;iCol<colCount;++iCol){if(iRow<featureLists[iCol].children.length){var h=featureLists[iCol].children[iRow].offsetHeight;maxHeight=h>maxHeight?h:maxHeight;}}
for(var iCol=0;iCol<colCount;++iCol){if(iRow<featureLists[iCol].children.length){featureLists[iCol].children[iRow].style.minHeight=maxHeight+'px';}}}}
function toggleMobileNavigation(){var menuToggle=jQuery('#masterbar__menu-toggle');jQuery(menuToggle).on('click',function(e){jQuery(menuToggle).toggleClass('toggled-on');jQuery('#masterbar__links').toggleClass('toggled-on');jQuery('#wpcom-logo').toggleClass('toggled-on');e.stopPropagation();});}
function hideMobileNavigation(){if(jQuery('#masterbar__menu-toggle').hasClass('toggled-on')){jQuery('#masterbar__menu-toggle').removeClass('toggled-on');jQuery('#masterbar__links').removeClass('toggled-on');jQuery('#wpcom-logo').removeClass('toggled-on');}}
function hijackLogoClicks(){jQuery('#wpcom-logo').on('click',function(e){e.stopPropagation();});}
function fixBenefitsHeight(){if(jQuery(window).width()>660){var rowHeight=0,currentItemHeight=0;listIndex=0;itemIndex=0;var elementHeights,featureLists,listItems;featureLists=jQuery('.lp-benefits__list');elementHeights=new Array();for(var i=0,length=featureLists.length;i<length;i++){listItems=featureLists[i].children;for(var j=0,lengthItems=listItems.length;j<lengthItems;j++){currentItemHeight=listItems[j].offsetHeight;if(elementHeights[itemIndex]){if(elementHeights[itemIndex]<currentItemHeight){elementHeights[itemIndex]=currentItemHeight;}}else{elementHeights.push(currentItemHeight);}
itemIndex++;}
listIndex++;itemIndex=0;}
listIndex=0;itemIndex=0;for(var i=0,length=featureLists.length;i<length;i++){listItems=featureLists[i].children;for(var j=0,lengthItems=listItems.length;j<lengthItems;j++){listItems[j].style.minHeight=elementHeights[itemIndex]+"px";itemIndex++;}
listIndex++;itemIndex=0;}}}