function checkIPAD(){ var userAgent = window.navigator.userAgent.toLowerCase(); if (userAgent.indexOf('ipad') != -1 && $.cookie('device')!='pc') { if(window.confirm('There is a iPad version of this page. Are you sure you want to browse the iPad?')){ var url = decodeURIComponent(window.location.pathname); iPadURL = url.replace("/en/pavilion/","/en/pavilion/tab/"); location.href = iPadURL; }else{ $.cookie('device', 'pc',{ path: '/' }); } } } $(function(){ checkIPAD(); });