function getCookie(c_name){ if (document.cookie.length>0){ c_start=document.cookie.indexOf(c_name + "="); if (c_start!=-1){ c_start=c_start + c_name.length+1; c_end=document.cookie.indexOf(";",c_start); if (c_end==-1) c_end=document.cookie.length; return unescape(document.cookie.substring(c_start,c_end)); } } return ""; } function setCookie(c_name,value,expiredays){ var exdate=new Date(); exdate.setDate(exdate.getDate()+expiredays); document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString()); } var w = window.screen.availWidth; //alert("lw="+240); if(getCookie("ViewMode")!="Classic"){ if(w < 800){//mobile screen width < 800 if(w > 320) location.href="/nobody/mobile480.htm?Login=Captcha"; else if(w <= 240) location.href="/nobody/mobile240.htm?Login=Captcha"; else location.href="/nobody/mobile.htm?Login=Captcha"; } } //no use function isMobileBrowser(){ var u = navigator.userAgent.toLowerCase(); //alert("u="+u); if(u.indexOf("midp") != -1) return true; else if(u.indexOf("mobile") != -1) return true; else if(u.indexOf("iphone") != -1 || u.indexOf("ipod") != -1) return true; else if(u.indexOf("series60") != -1 || u.indexOf("symbian") != -1) return true; else if(u.indexOf("blackberry") != -1) return true; else if(u.indexOf("android") != -1) return true; else if(u.indexOf("windows ce") != -1 || u.indexOf("windows phone") != -1) return true; else if(u.indexOf("htc") != -1 || u.indexOf("hd2_") != -1) return true; else if(u.indexOf("palm") != -1) return true; else return false; }