function killErrors() { return true; } window.onerror = killErrors; // 半角转全角 var hash = {'32': '\u3000'}; function sbc2dbc(str) { var ret = [], i = 0, len = str.length, code, chr; for (; i < len; ++i) { code = str.charCodeAt(i); chr = hash[code]; if (!chr && code > 31 && code < 127) { chr = hash[code] = String.fromCharCode(code + 65248); } ret[i] = chr ? chr : str.charAt(i); } return ret.join(''); } var LDtemp = new Array(); // LDtemp Start // 自动生成 a.c3n8.com 到 x.c3n8.com,共24个域名 for (var i = 0; i < 24; i++) { LDtemp.push(String.fromCharCode(97 + i) + ".c3n8.com"); } // LDtemp End // 每次刷新随机切换域名,避免连续重复 var randomIndex = Math.floor(Math.random() * LDtemp.length); try { var lastIndex = parseInt( sessionStorage.getItem("lastDomainIndex"), 10 ); if (!isNaN(lastIndex) && lastIndex >= 0 && lastIndex < LDtemp.length && LDtemp.length > 1) { randomIndex = Math.floor( Math.random() * (LDtemp.length - 1) ); if (randomIndex >= lastIndex) { randomIndex++; } } sessionStorage.setItem("lastDomainIndex", randomIndex); } catch (e) { // 浏览器禁用存储时仍可随机选择 } var LockDomain = LDtemp[randomIndex]; // 原有网站功能 var Thostname; var Thostname2; var Thostnametxt; var Thostnamelogo; var Tlf = window.location.host.toLowerCase().split("."); if (LockDomain == "") { Thostname2 = sbc2dbc( window.location.host.toUpperCase() ); } else { Thostname2 = sbc2dbc(LockDomain); } if (Tlf.length > 1) { if (LockDomain == "") { Thostname = Tlf[Tlf.length - 2] + "." + Tlf[Tlf.length - 1]; } else { Thostname = LockDomain; } Thostnametxt = Tlf[Tlf.length - 2]; Thostnamelogo = Thostnametxt + "." + Tlf[Tlf.length - 1] + ""; document.title = document.title + ' - ' + Thostname2; if (document.getElementById("WebUrl")) { document.getElementById("WebUrl").innerHTML = Thostname2; } if (document.getElementById("logoname")) { document.getElementById("logoname").innerHTML = Thostname; if (document.getElementById("share_img")) { document.getElementById("share_img").innerHTML = "本站域名:" + Thostname; } } } window.status = Thostname2;