var c=0,limit=4; function doCheck(obj) { obj.checked?c++:c--; if(c>limit){ obj.checked=false; alert("您只能选择4门课程!"); c--; } } if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))){ if(window.location.href.indexOf("?agent=n")<0){ try{ if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){ document.getElementById("picp").href="css/stylep.css"; }else if(/iPad/i.test(navigator.userAgent)){ }else{ document.getElementById("picp").href="css/stylep.css"; } }catch(e){} } }