function ismobile() { var ua = navigator.userAgent.toLowerCase(); var w = screen.width; var h = screen.height; var m = false; if (ua.indexOf("iphone") > -1) { m = true; } else if(ua.indexOf("android") > -1) { if (w == 480 || h == 480 || ua.indexOf("mobile") > -1) { m = true; } } return m; } function getMobileCookie(name) { var start = document.cookie.indexOf(name + "="); var len = start + name.length + 1; if ((!start) && (name != document.cookie.substring(0, name.length))) { return null; } if (start == -1) return null; var end = document.cookie.indexOf(";", len); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(len, end)); } if (ismobile() && getMobileCookie("disablemobile") != "true") { window.location = "/mobile/"; }