| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- //手机版判断
- function is_mobile() {
- var regex_match = /(nokia|iphone|android|motorola|^mot-|softbank|foma|docomo|kddi|up.browser|up.link|htc|dopod|blazer|netfront|helio|hosin|huawei|novarra|CoolPad|webos|techfaith|palmsource|blackberry|alcatel|amoi|ktouch|nexian|samsung|^sam-|s[cg]h|^lge|ericsson|philips|sagem|wellcom|bunjalloo|maui|symbian|smartphone|midp|wap|phone|windows ce|iemobile|^spice|^bird|^zte-|longcos|pantech|gionee|^sie-|portalmmm|jigs browser|hiptop|^benq|haier|^lct|operas*mobi|opera*mini|320x320|240x320|176x220)/i;
- var u = navigator.userAgent;
- if (null == u) {
- return true;
- }
- var result = regex_match.exec(u);
- if (null == result) {
- return false
- } else {
- return true
- }
- }
- function gourl(x){location.href=x;}
- //顶部搜索
- var nsi=1;
- function topover(){
- document.getElementById("topdiv").style.display="";
- }
- function topout(){
- document.getElementById("topdiv").style.display="none";
- }
- function topjconc(x,y){
- nsi=x;
- document.getElementById("topnwd").innerHTML=y;
- topout();
- }
- function topftj(){
- if((document.topf1.topt.value).replace("/\s/","")==""){alert("请输入搜索关键词");document.topf1.topt.focus();return false;}
- topf1.action="../search/index.php?admin="+nsi;
- }
- //下拉菜单
- function leftmenuover(){
- document.getElementById("leftmenu").style.display="";
- if(document.getElementById("leftnone")){yhifdis(1);}
- }
- function leftmenuout(){
- if(!document.getElementById("leftnone")){document.getElementById("leftmenu").style.display="none";}else{yhifdis(0);}
- }
- function yhmenuover(x){
- document.getElementById("yhmenu"+x).className="menu1 menu2";
- document.getElementById("rmenu"+x).style.display="";
- }
- function yhmenuout(x){
- document.getElementById("yhmenu"+x).className="menu1";
- document.getElementById("rmenu"+x).style.display="none";
- }
- //等待
- function tjwait(){
- document.getElementById("tjbtn").style.display="none";
- document.getElementById("tjing").style.display="";
- }
- //弹窗
- function tangc(x){
- if(1==x){document.getElementById("bghui").style.display="";document.getElementById("openw").style.display="";}
- else if(0==x){document.getElementById("bghui").style.display="none";document.getElementById("openw").style.display="none";}
- document.getElementById("bghui").style.width="100%";
- st=Math.max(document.documentElement.scrollTop,document.body.scrollTop);
- if(!+[1,]){
- document.getElementById("bghui").style.height=document.body.clientHeight;
- document.getElementById("openw").style.left=document.body.clientWidth/2-151;
- document.getElementById("openw").style.top=st+200;
- }else{
- document.getElementById("bghui").style.height=document.documentElement.clientHeight;
- document.getElementById("openw").style.left=document.documentElement.clientWidth/2-151;
- document.getElementById("openw").style.top=window.document.body.offsetHeight/2-170+st;
- }
- }
- function objdis(x,y){
- if(0==x){document.getElementById(y).style.display="none";}
- else if(1==x){document.getElementById(y).style.display="";}
- }
- //登录验证
- var xmlHttpses = false;
- try {
- xmlHttpses = new ActiveXObject("Msxml2.XMLHTTP");
- } catch (e) {
- try {
- xmlHttpses = new ActiveXObject("Microsoft.XMLHTTP");
- } catch (e2) {
- xmlHttpses = false;
- }
- }
- if (!xmlHttpses && typeof XMLHttpRequest != 'undefined') {
- xmlHttpses = new XMLHttpRequest();
- }
- function userCheckses(){
- url =document.getElementById("webhttp").innerHTML+"tem/sesCheck.php";
- xmlHttpses.open("get", url, true);
- xmlHttpses.onreadystatechange = updatePageses;
- xmlHttpses.send(null);
- }
- function updatePageses() {
- if (xmlHttpses.readyState == 4) {
- response = xmlHttpses.responseText;
- response=response.replace(/[\r\n]/g,'');
- if(response=="0"){document.getElementById("notlogin").style.display="";document.getElementById("yeslogin").style.display="none";return false;}
- else{
- r=response.split(" ");
- document.getElementById("yeslogin").style.display="";
- document.getElementById("notlogin").style.display="none";
- document.getElementById("yesuid").innerHTML=r[0];
- if(r[1]=="yes"){document.getElementById("dontqd").style.display="";document.getElementById("needqd").style.display="none";}
- else{document.getElementById("dontqd").style.display="none";document.getElementById("needqd").style.display="";}
- return false;
- }
- }
- }
- //头部下拉导航
- function lover(x){
- document.getElementById("topu1l"+x).className="l"+x+" l"+x+"h";document.getElementById("umenu"+x).style.display="";
- }
- function lout(x){
- document.getElementById("topu1l"+x).className="l"+x;document.getElementById("umenu"+x).style.display="none";
- }
- //回到顶部
- function gotoTop(acceleration,stime){acceleration=acceleration||0.1;stime=stime||10;var x1=0;var y1=0;var x2=0;var y2=0;var x3=0;var y3=0;if(document.documentElement){x1=document.documentElement.scrollLeft||0;y1=document.documentElement.scrollTop||0;}
- if(document.body){x2=document.body.scrollLeft||0;y2=document.body.scrollTop||0;}
- var x3=window.scrollX||0;var y3=window.scrollY||0;var x=Math.max(x1,Math.max(x2,x3));var y=Math.max(y1,Math.max(y2,y3));var speeding=1+ acceleration;window.scrollTo(Math.floor(x/speeding),Math.floor(y/speeding));if(x>0||y>0){var run="gotoTop("+ acceleration+", "+ stime+")";window.setTimeout(run,stime);}}
|