myMoro = { iphoneUrl: '', ipadUrl: '', androidUrl: '', appName: '', appIcon: 'https://mobileroadie.com/img/empty.png', appId: 'koko', platform: '', run: function(type) { var platform = false; if (navigator.userAgent.match(/iPhone|iPad|iPod|Android/i)) { myMoro.platform = platform = navigator.userAgent.match(/iPhone|iPad|iPod|Android/i).toString(); } if (platform && platform.match(/iPhone|iPod/i) && this.iphoneUrl) { landingUrl = this.iphoneUrl; } else if (platform && platform.match(/iPad/i) && this.ipadUrl) { landingUrl = this.ipadUrl; } else if (platform && platform.match(/Android/i) && this.androidUrl) { landingUrl = this.androidUrl; } else { return; } if (this.cookie.get(platform) == 'viewed') { return; } this.cookie.set(platform); eval('this.display.' + type + '(landingUrl, platform)'); }, display: { confirmPopup: function(landingUrl, platform) { var confirmed = confirm("Download " + platform + " app?"); if (confirmed) { // setTimeout is used so that back button will be available. setTimeout(function(){ window.location = landingUrl; },1000); } }, modalPopup: function(landingUrl, platform) { var newMeta = document.createElement('meta'); newMeta.setAttribute("name","viewport"); newMeta.setAttribute("content","width=device-width, height=device-height, initial-scale = 1.0"); document.head.insertBefore(newMeta, document.head.childNodes[0]); var newStylesheet = document.createElement('link'); var baseUrl = 'http://mobileroadie.com'; var isSsl = 'https:' == document.location.protocol; if (isSsl && baseUrl.indexOf('https:') === -1) { baseUrl = baseUrl.replace('http', 'https'); } newStylesheet.setAttribute("href", baseUrl + "/css/clientmodal.css"); newStylesheet.setAttribute("type","text/css"); newStylesheet.setAttribute("rel","stylesheet"); document.body.appendChild(newStylesheet); var modalHtml = escape("
close

We noticed you're on your

Would you like to download the

Download the App
"); var newElement = document.createElement('div'); newElement.id = 'moroAppModalWrap'; document.body.appendChild(newElement); document.getElementById('moroAppModalWrap').innerHTML = unescape(modalHtml); document.getElementById('moroLandingUrl').setAttribute("href", landingUrl); // fix #MRMOBILE-883 and #MRMOBILE-884 document.getElementById('moroAppName').innerHTML = myMoro.appName + ' App?'; iconImg = new Image(); iconImg.src = myMoro.appIcon; document.getElementById('moroAppIcon').style.backgroundImage = 'url(' + myMoro.appIcon + ')'; document.getElementById('moroPhoneType').textContent = myMoro.platform; this.modalToggle(); }, visitMoWeb: function(cookieContainer) { var mowebCount = cookieContainer.cookie.get('moWebClickCount'); if(mowebCount){ cookieContainer.cookie.set('lockMoWebRedirect'); }else{ this.cookie.unset(platform) cookieContainer.cookie.set('moWebClickCount'); } }, modalToggle: function() { var el = document.getElementById("moroAppModalWrap"); el.style.display = (el.style.display == "block") ? "none" : "block"; } }, cookie: { get: function(platform) { var cookieName = 'moroAppDetect' + platform + myMoro.appId + '='; 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(cookieName) == 0) { return c.substring(cookieName.length, c.length); } } return null; }, set: function(platform) { var date = new Date(); date.setTime(date.getTime() + (5*365*24*60*60*1000)); document.cookie = "moroAppDetect" + platform + myMoro.appId + "=viewed; expires=" + date.toGMTString() + "; path=/"; }, unset: function(platform) { var date = new Date(); date.setTime(date.getTime() - (122323604800)); document.cookie = "moroAppDetect" + platform + myMoro.appId + "=; expires=" + date.toGMTString() + "; path=/"; } } }; // checking DOM readiness (http://www.javascriptkit.com/dhtmltutors/domready.shtml) var alreadyrunflag = 0 //flag to indicate whether target function has already been run if (document.addEventListener) { document.addEventListener("DOMContentLoaded", function(){ alreadyrunflag = 1; moroLaunch(); }, false); } else if (document.all && !window.opera) { document.write('