(function(){var mobileMaxWidth=650,desktopViewPadding=30,metaTag=document.querySelector('meta[name="viewport"]'),minPageWidthAttr=metaTag.getAttribute('minpagewidth'),renderMobileView=metaTag.getAttribute('renderMobileView')==='true',minPageWidth=Math.max(parseInt(minPageWidthAttr,10),mobileMaxWidth+1)+desktopViewPadding;function isMobile(){try{var platform=navigator.platform,isApple=!!platform.toLowerCase().match(/(?:iphone|ipad)/),mediaQuery;if(isApple){var isPortrait=window.orientation===0;mediaQuery=(isPortrait?'(max-device-width: ':'(max-device-height: ')+mobileMaxWidth+'px)'}else{mediaQuery='(max-device-width: '+mobileMaxWidth+'px)'}return window.matchMedia(mediaQuery).matches}catch(e){return window.screen.width<=mobileMaxWidth}}function getMetaTagAttributes(){var attributes={};if(metaTag){Array.prototype.slice.call(metaTag.attributes).forEach(function(attr){attributes[attr.name]=attr.value})}return attributes}function removeMetaTag(){if(metaTag&&metaTag.parentNode){metaTag.parentNode.removeChild(metaTag)}}function addMetaTag(content,extraAttributes){var newMetaTag=document.createElement('meta');newMetaTag.setAttribute('name','viewport');newMetaTag.setAttribute('content',content);for(var key in extraAttributes){if(key!=='name'&&key!=='content'){newMetaTag.setAttribute(key,extraAttributes[key])}}document.head.appendChild(newMetaTag)}function determineZoomAbility(){var originalAttributes=getMetaTagAttributes();if(isMobile()&&renderMobileView){var currentContent=metaTag.getAttribute('content');var correctMobileContent='width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=3.0, user-scalable=yes';if(currentContent===correctMobileContent){return}removeMetaTag();addMetaTag(correctMobileContent,originalAttributes)}else{var desktopScale=window.screen.width/minPageWidth;var desktopContent='width='+minPageWidth+', initial-scale='+desktopScale+', maximum-scale=3.0, user-scalable=yes';removeMetaTag();addMetaTag(desktopContent,originalAttributes)}}determineZoomAbility()}());