var ua = navigator.useragent.tolowercase(); var isie = (document.all && window.activexobject && !window.opera) ? true : false; var isgecko = ua.indexof('webkit') != -1; var dmurl = document.location.protocol+'//'+location.hostname+(location.port ? ':'+location.port : '')+'/'; var ckprex = '123456'; if(isie) try {document.execcommand("backgroundimagecache", false, true);} catch(e) {} /* * 智能机浏览器版本信息: * */ var browser={ versions:function(){ var u = navigator.useragent, app = navigator.appversion; return{//移动终端浏览器版本信息 trident: u.indexof('trident') > -1,//ie内核 presto: u.indexof('presto') > -1,//opera内核 webkit: u.indexof('applewebkit') > -1,//苹果、谷歌内核 gecko: u.indexof('gecko') > -1 && u.indexof('khtml') == -1, //火狐内核 mobile: !!u.match(/applewebkit.*mobile.*/)||!!u.match(/applewebkit/),//是否为移动终端 ios: !!u.match(/\(i[^;]+;( u;)? cpu.+mac os x/),//ios终端 android: u.indexof('android') > -1 || u.indexof('linux') > -1, //android终端或者uc浏览器 iphone: u.indexof('iphone') > -1 || u.indexof('mac') > -1, //是否为iphone或者qqhd浏览器 ipad: u.indexof('ipad') > -1,//是否ipad weixin: !!ua.match(/micromessenger/i) == 'micromessenger',//是否为微信 weibo: !!ua.match(/weibo/i) == 'weibo',//是否为新浪微博 qq: !!ua.match(/qq/i) == 'qq',//是否为新浪微博 webapp: u.indexof('safari') == -1//是否web应该程序,没有头部与底部 }; }(), language:(navigator.browserlanguage || navigator.language).tolowercase() } /* console.log("语言版本: "+browser.language); console.log("ie内核: "+browser.versions.trident); console.log("是否为移动终端: "+browser.versions.mobile); console.log("ios终端: "+browser.versions.ios); console.log("android终端: "+browser.versions.android); console.log("是否为iphone: "+browser.versions.iphone); console.log("是否ipad: "+browser.versions.ipad); console.log("是否weixin: "+browser.versions.weixin); console.log(navigator.useragent); */ function dd(i) {return document.getelementbyid(i);} function ds(i) {dd(i).style.display = '';} function dh(i) {dd(i).style.display = 'none';} function dsh(i) {dd(i).style.display = dd(i).style.display == 'none' ? '' : 'none';} function df(i) {dd(i).focus();} function go(u) {window.location = u;} function confirmuri(m,f) {if(confirm(m)) go(f);} function tb(d, t, p, c) { for(var i=1; i<=t; i++) { if(d == i) { if(dd(p+'_t_'+i)) dd(p+'_t_'+i).classname = c+'_2'; if(dd(p+'_c_'+i)) ds(p+'_c_'+i); } else { if(dd(p+'_t_'+i)) dd(p+'_t_'+i).classname = c+'_1'; if(dd(p+'_c_'+i)) dh(p+'_c_'+i); } } } function ext(v) {return v.substring(v.lastindexof('.')+1, v.length).tolowercase();} function set_cookie(n, v, d) { var e = ''; var f = d ? d : 365; e = new date((new date()).gettime() + f * 86400000); e = "; expires=" + e.togmtstring(); document.cookie = ckprex + n + "=" + v + e; } function get_cookie(n) { var v = ''; var s = ckprex + n + "="; if(document.cookie.length > 0) { o = document.cookie.indexof(s); if(o != -1) { o += s.length; end = document.cookie.indexof(";", o); if(end == -1) end = document.cookie.length; v = unescape(document.cookie.substring(o, end)); } } return v; } function del_cookie(n) {var e = new date((new date()).gettime() - 1 ); e = "; expires=" + e.togmtstring(); document.cookie = ckprex + n + "=" + escape("") + e;} function set_local(n, v) {window.localstorage ? localstorage.setitem(ckprex + n, v) : set_cookie(n, v);} function get_local(n) {return window.localstorage ? localstorage.getitem(ckprex + n) : get_cookie(n);} function del_local(n) {window.localstorage ? localstorage.removeitem(ckprex + n) : del_cookie(n);} function substr_count(str, exp) {if(str == '') return 0;var s = str.split(exp);return s.length-1;} function checked_count(id) {var c=0;$('#'+id).find(':checked').each(function(i){c++;});return c;} $(document).ready(function(){ $(window).bind("scroll.back2top", function() { var st = $(document).scrolltop(), winh = $(window).height(); (st > 0) ? $('.back2top').show() : $('.back2top').hide(); if(!window.xmlhttprequest) { $('.back2top').css("top", st + winh - 166);}//ie6 }); $('.back2top').click(function() { $("html, body").animate({scrolltop:0}, 200); }); }); function select_op(i, v) { var o = dd(i); for(var i=0; i/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") if (!partten.exec(s)) { return false; } return true; }