var xk = function (id) { return "string" == typeof id ? document.getElementById(id) : id; } function rnd() { var rndL = Math.ceil(Math.random()*1000000); return rndL; } //function trim(str){ return str.replace(/ +/,"").replace(/ +$/,"");} function trim(str){ return str.replace(/(^\s*)|(\s*$)/g, "");} function getIEVer() { var ua = navigator.userAgent; if (ua.indexOf("like Gecko") >0 && ua.indexOf("rv:") >0) return parseFloat(navigator.appVersion.split("rv:")[1]); else return parseFloat(navigator.appVersion.split("MSIE ")[1]); } function isIE() { if (navigator.userAgent.indexOf("MSIE") < 0) { return false; } else { var ieVer = getIEVer(); if(ieVer >= 5.0 && ieVer <= 9.0) return true; else return false; } } function isEmail(strMail) { var objReg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; if(strMail.length==0) return false; return (objReg.test(strMail)); } function addSpace(space, bgcolor) { document.write(""); } //var g_xmlHttp; function processReqChange() { return; } function sleep(n) { var start = new Date().getTime(); while(true) if(new Date().getTime()-start>n) break; } var g_tmp_txt; var g_xmlHttp; function compressResult(url, params) { var style = ""; if (params == null || params == "") style = "GET"; else style = "POST"; //var isIeClient = (navigator.userAgent.indexOf("MSIE") >= 0) ? true : false; var ieVer = getIEVer(); if(ieVer >= 5.0 && ieVer <= 9.0) { var len = 0; if (params != null) len = params.length; var result; var XMLHTTP; try { XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP"); if(!XMLHTTP) XMLHTTP = new ActiveXObject("MSXML2.XMLHTTP"); } catch(e) { //alert("XMLHTTPRequest(IE 7)"); return ""; } XMLHTTP.Open(style, encodeURI(url), false); XMLHTTP.setRequestHeader("Content-Length", len); XMLHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); XMLHTTP.Send(params); if(XMLHTTP.readyState==4) { if(document.defaultCharset=="utf-8" && navigator.userLanguage=="zh-cn") { result = unescape(XMLHTTP.responseText); } else { result = XMLHTTP.responseText; } } else { result = ""; } delete XMLHTTP; return result; } else { g_tmp_txt = ""; g_xmlHttp = new XMLHttpRequest(); g_xmlHttp.onreadystatechange = processReqChange; g_xmlHttp.open(style, url, false); g_xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); g_xmlHttp.send(params); if(g_xmlHttp.readyState == 4) { if(g_xmlHttp.status == 200){ g_tmp_txt = g_xmlHttp.responseText; } } delete g_xmlHttp; return g_tmp_txt; } } function parseServerIP(url) { var url2 = url.toLowerCase(); var ik = url2.indexOf("http://") ; if (ik > -1) { url2 = url2.substring(ik + 7, url2.length); } else { ik = url2.indexOf("https://") ; url2 = url2.substring(ik + 8, url2.length); } for(var i = 0; i -1) { url2 = url2.substring(ik + 7, url2.length); } else { defport = 443; ik = url2.indexOf("https://") ; url2 = url2.substring(ik + 8, url2.length); } var x = 0; for(var i = 0; i 0) return url2.substring(x + 1, i); else return defport; } if (url2.charAt(i) == ":") { x = i; } } if (x > 0) { return url2.substring(x + 1, url2.length); } return defport; } function getRequestUrl(url) { var x = 0; var y = url.length; for(var i = url.length - 1; i >= 0; i--) { if (url.charAt(i) == '?') y = i; if (url.charAt(i) == '/') { x = i; for(var j = x + 1; j < y; j++) { if (url.charAt(j) == '#') return url.substring(x + 1, j); } return url.substring(x + 1, y); } } return url; } function getUrlParam(url, paramName)//得到URL里面的某个参数 { if (paramName.indexOf("=") < 0) paramName += "="; var paramPos = url.indexOf(paramName); if (paramPos >= 0) { var startpos = paramPos + paramName.length; var endPos = url.indexOf("&", paramPos); if (endPos >= 0) { return url.substr(startpos, endPos - startpos); }else return url.substr(startpos); }else return ""; } //写cookies函数 function setCookie(name, value, days)//两个参数,一个是cookie的名子,一个是值 { var exp = new Date(); //new Date("December 31, 9998"); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString(); } function getCookie(name)//取cookies函数 { var arr = document.cookie.match(new RegExp("(^| )" + name+"=([^;]*)(;|$)")); if(arr != null) return unescape(arr[2]); return null; } function delCookie(name)//删除cookie { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString(); } function getFileKeys(itemName) { var ik = 0; var fileKeys = new Array(); var file_obj = document.getElementsByName(itemName); for (i=0; i < file_obj.length; i++) { if (!file_obj[i].checked) continue; var val = file_obj[i].value; var t = false; for (j=0; j return false; var s = _htmlTxt.substring(index2 - 8, index2 + 1).toLowerCase(); if (s != "") return false; index = _htmlTxt.indexOf('>', index) + 1; // for(var i = index2 - 9; i > 0; i--) { ch = _htmlTxt.charAt(i); if (ch =='>' || ch =='-' || ch =='/' || ch <= " ") continue; index2 = i + 1; break; } _jsTxts[_jsCount] = _htmlTxt.substring(index, index2); _jsCount++; return true; } function isScript(index) { if (index + 8 >=_htmlTxt.length || _htmlTxt.charAt(index + 1).toLowerCase() != 's') return false; var s = _htmlTxt.substring(index, index + 8).toLowerCase(); var ik = s.indexOf("": if (num_qm % 2 == 0 && num_qm2 % 2 == 0 && x > 0 && getScript(x, i)) x = 0; break; default: break; } } } var _funTxts = new Array(); var _funCount = 0; function getFun(txt, index, index2) { var txt = txt.substring(index, index2 + 1); var x = txt.indexOf("function"); if (x == -1) return; for(var i = 0; i < x; i++) { var ch = txt.charAt(i); if (ch == '\'' || ch == '\"') return; } _funTxts[_funCount] = txt.substring(x, index2 + 1); _funCount++; } //得到函数代码 function splitFunctionTxt(txt) { var num_b = num_e = fi = 0; var x = 0; for(var i = 0; i x) x = v[i].offsetWidth; var y = getMaxWidthOfObject(v[i]); if (y > x) x = y; } return x; } //创建子窗口 function CreateSubWindow() { var _self = this; var _divX = 0; var _divY = 0; var _mouseX = 0; var _MouseY = 0; var _canMoveDiv = false; var _callBackFun = null; var _callBackCloseDivFun = null; var _divObj = null; var _tabObj = null; this.divID = ""; this.bgColor = "#FFFFFF"; this.menuBgImg = "left_menu_bg.png"; this.borderColor = "#C1C4C4"; function winMouseDown(evt) { if(!_divObj) return; evt = evt || window.event; _mouseX = evt.clientX; _mouseY = evt.clientY; _divX = parseInt(_divObj.style.left); _divY = parseInt(_divObj.style.top); _canMoveDiv = true; if(document.all) _tabObj.setCapture(); else document.addEventListener("mousemove", winMove, true); } function winMouseUp(evt) { _canMoveDiv = false; if (document.all) _tabObj.releaseCapture(); else document.removeEventListener("mousemove", winMove, true); } function winMove(evt) { if (_canMoveDiv) { evt = evt || window.event; if ((document.all && evt.button == 1) || evt.button == 0) { _divObj.style.left = (_divX + evt.clientX - _mouseX) + "px"; _divObj.style.top = (_divY + evt.clientY - _mouseY) + "px"; } } } this.removeDiv = function() { if (_divObj != null) { document.body.removeChild(_divObj); _divObj = null; } var fd = document.getElementById("g_opacity_float_div_" + _self.divID); if (fd != null) document.body.removeChild(fd); } function doResult() { if (_callBackFun != null) { if (_callBackFun()) _self.removeDiv(); }else _self.removeDiv(); } function doClose() { _self.removeDiv(); if (_callBackCloseDivFun != null) { _callBackCloseDivFun(); _callBackCloseDivFun = null; } } this.closeAndFree = function() { doClose(); } function createOpacityDiv(id) { var x = document.body.scrollWidth > document.documentElement.clientWidth ? document.body.scrollWidth: document.documentElement.clientWidth; var y = document.body.scrollHeight > document.documentElement.clientHeight ? document.body.scrollHeight: document.documentElement.clientHeight; var fdiv = document.getElementById("g_opacity_float_div_" + _self.divID); if (!fdiv) { fdiv = document.createElement("div"); fdiv.id = "g_opacity_float_div_" + _self.divID; fdiv.style.position = "absolute"; fdiv.style.background = "#616161"; fdiv.style.left = "0px"; fdiv.style.top = "0px"; fdiv.style.width = x + "px"; fdiv.style.height = y + "px"; if(getIEVer() <= 9.0) fdiv.style.filter = "alpha(opacity=50)"; else fdiv.style.opacity = "0.5"; document.body.appendChild(fdiv); /* //解决IE的穿透 if(isIE() || (getIEVer() < 7)) { var objFrame = document.createElement("iframe"); objFrame.id = "g_frame_"+ _self.divID; objFrame.allowtransparency = true; with(objFrame.style) { position = "absolute"; //background = "#616161"; zIndex = "-1"; width = x + "px"; height = y + "px"; left = 0 + "px"; top = 0 + "px"; filter = "alpha(opacity=0)"; } fdiv.appendChild(objFrame); var _frm = window.frames['g_frame_' + _self.divID]; _frm.document.writeln(''); _frm.document.writeln(''); _frm.document.writeln('