PageSourceSearch

http://user.sjwj.com/js/jsfile.js

js sjwj.com collected 2026-10-07 04:07:24 UTC 11,280 bytes, 347 lines download raw bytes

1function strlen(str) {
2    var len;
3    var i;
4    len = 0;
5    for (i = 0; i < str.length; i++) {
6        if (str.charCodeAt(i) > 255) len += 2; else len++;
7    }
8    return len;
9}
10
11function stripscript(s) { 
12    var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]");
13    var rs = ""; 
14    for (var i = 0; i < s.length; i++) { 
15        rs = rs + s.substr(i, 1).replace(pattern, ''); 
16    } 
17    rs = rs.replace(/-/g, "");
18    return rs; 
19}
20
21function CheckInput2() {
22    var reg = /\s/g;
23    var key = document.getElementById("txtKeywords").value;
24    var n = document.getElementById('drop_type').options[document.getElementById('drop_type').selectedIndex].value;
25    key = key.replace(reg, "");
26    key=stripscript(key);
27    
28    if (key == "" || key == "请输入您要搜索的关键字") {
29        alert("请输入您要搜索的关键字");
30        document.getElementById("txtKeywords").focus();
31        return false;
32    }
33    else if (key.indexOf("1=") > -1 || key.indexOf(";") > -1 || key.indexOf("'") > -1
34        || key.indexOf("--") > -1 || key.indexOf("xp_cmdshell") > -1) {
35        alert("请不要输入非法字符!");
36        document.getElementById("txtKeywords").value = "";
37        document.getElementById("txtKeywords").focus();
38        return false;
39    }
40    else {
41        switch (n) {
42            case "n1":
43                window.location.href = "http://so.sjwj.com/Supply-" + encodeURIComponent(key)+".html";
44                break;
45            case "n2":
46                window.location.href = "http://so.sjwj.com/Supply-" + encodeURIComponent(key)+".html";
47                break;
48            case "n3":
49                window.location.href = "http://so.sjwj.com/Company-" + encodeURIComponent(key)+".html";
50                break;
51            case "n4":
52                window.location.href = "http://so.sjwj.com/News-" + encodeURIComponent(key)+".html";
53                break;
54            case "n5":
55                window.location.href = "http://so.sjwj.com/Price-" + encodeURIComponent(key)+".html";
56                break;
57            case "n6":
58                window.location.href = "http://so.sjwj.com/Liter-" + encodeURIComponent(key)+".html";
59                break;
60            case "n7":
61                window.location.href = "http://so.sjwj.com/Show-" + encodeURIComponent(key)+".html";
62                break;
63            case "n8":
64                window.location.href = "http://so.sjwj.com/Job-" + encodeURIComponent(key)+".html";
65                break;
66            case "n9":
67                window.location.href = "http://so.sjwj.com/Questions-" + encodeURIComponent(key)+".html";
68                break;
69            default:
70                window.location.href = "http://so.sjwj.com/Supply-" + encodeURIComponent(key)+".html";
71                break;
72        }
73    }
74}
75
76function checkLogin() {
77    var name = document.getElementById("txtLoginName").value;
78    var pass = document.getElementById("txtPassword").value;
79    var reg = /\s/g;
80    name = name.replace(reg, "");
81    if (name == "") {
82        alert("请输入登录名!");
83        document.getElementById("txtLoginName").focus();
84        return false;
85    }
86    else if (pass == "") {
87        alert("请输入密码!");
88        document.getElementById("txtPassword").focus();
89        return false;
90    }
91    else {
92        return true;
93    }
94}
95
96function CheckMaxLength() {
97    if (strlen(document.getElementById("CPHMain_txtDescription").value) > 255) {
98        alert("最多不超过255个字符");
99        document.getElementById("CPHMain_txtDescription").focus();
100        return false;
101    }
102    else if (strlen(document.getElementById("CPHMain_txtTags").value) > 255) {
103        alert("最多不超过255个字符");
104        document.getElementById("CPHMain_txtTags").focus();
105        return false;
106    }
107    else if (strlen(document.getElementById("CPHMain_txtDemo").value) > 255) {
108        alert("最多不超过255个字符");
109        document.getElementById("CPHMain_txtDemo").focus();
110        return false;
111    }
112    else {
113        return true;
114    }
115}
116
117//切换tab
118function showInfo(name, enty, count) {
119    for (i = 1; i <= count; i++) {
120        var tabnew = document.getElementById(name + i);
121        var newcontent = document.getElementById(name + "_" + i);
122        tabnew.className = i == enty ? "tabon" : "taboff";
123        newcontent.style.display = i == enty ? "block" : "none";
124    }
125}
126
127function EventEnter() {
128    if (event.keyCode == 13)
129        ibtnLogin = document.getElementById('ibtnLogin');
130    if (ibtnLogin != null)
131        ibtnLogin.click();
132}
133
134//不同的textbox绑定不同的button
135function EnterTextBox(button) {
136    if (event.keyCode == 13) {
137        event.keyCode = 9;
138        event.returnValue = false;
139        document.all[button].click();
140    }
141}
142
143function chAll(aa) {
144    var table = document.getElementById(aa);
145    var ch = document.getElementById("chkAll");
146    var elems = table.getElementsByTagName("INPUT");
147    for (var i = 0; i < elems.length; i++) {
148        if (elems[i].type == 'checkbox') {
149            elems[i].checked = ch.checked;
150        }
151    }
152}
153
154function CheckAll(form) {
155    for (var i = 0; i < form.elements.length; i++) {
156        var e = form.elements[i];
157        if (e.name != 'chkAll') {
158            e.checked = form.chkAll.checked;
159        }
160    }
161}
162
163function CheckAll2(CheckAll) {
164    var items = document.getElementsByTagName("input");
165    for (var i = 0; i < items.length; i++) {
166        if (items[i].type == "checkbox") {
167            items[i].checked = CheckAll.checked;
168        }
169    }
170}
171
172function MM_openBrWindow(theURL, winName, features) {
173    window.open(theURL, winName, features + ",top=150,left=300");
174}
175
176function DeleteRow() {
177    var tr = window.event.srcElement;
178    while ((tr.tagName != "TR") && (tr.parentElement != null)) {
179        tr = tr.parentElement;
180    }
181    if (tr.tagName == "TR") {
182        tr.style.display = "none";
183    }
184}
185
186function copyToClipBoard(T) {
187    var clipBoardContent = "";
188    clipBoardContent = document.all(T).value;
189    document.all(T).select()
190    window.clipboardData.setData("Text", clipBoardContent);
191    alert("复制成功,请粘贴到你的网页中增加友情链接!");
192}
193
194function AddFav() {
195    var ua = navigator.userAgent.toLowerCase();
196    var sURL = document.URL;
197    var sTitle = document.title;
198    if (ua.indexOf("msie 8") > -1) {
199        external.AddToFavoritesBar(sURL, sTitle, '');
200    }
201    else {
202        try {
203            window.external.addFavorite(sURL, sTitle);
204        }
205        catch (e) {
206            try {
207                window.sidebar.addPanel(sTitle, sURL, "");
208            }
209            catch (e) {
210                alert("加入收藏失败,请使用Ctrl+D进行添加");
211            }
212        }
213    }
214    return false;
215}
216
217function SetHome(obj) {
218    try {
219        obj.style.behavior = 'url(#default#homepage)';
220        obj.setHomePage(window.location.href);
221    } catch (e) {
222        if (window.netscape) {
223            try {
224                netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
225            }
226            catch (e) {
227                alert("抱歉,此操作被浏览器拒绝!\n\n请在浏览器地址栏输入“about:config”并回车然后将[signed.applets.codebase_principal_support]设置为'true'");
228            }
229        }
230        else {
231            alert("抱歉,您所使用的浏览器无法完成此操作。\n\n您需要手动将该网站设置为首页。");
232        }
233    }
234}
235
236function SetCookie(name, value) {
237    var Days = 30;              //此cookie将被保存30天
238    var exp = new Date();      //new Date("December 31, 9998");
239    exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
240    document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString();
241}
242
243function setCookie(c_name, value, expiredays) {
244    var exdate = new Date();
245    exdate.setDate(exdate.getDate() + expiredays);
246    document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString());
247}
248
249function getCookie(name) {
250    var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
251    if (arr != null)
252        return unescape(arr[2]);
253    return null;
254}
255
256function GetCookie(cookie_name) {
257    var results = document.cookie.match('(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
258    if (results)
259        return (unescape(results[2]));
260    else
261        return null;
262}
263
264function GetCookie2(cookie_name, key) {
265    var results = document.cookie.match('(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
266    if (results)
267        return ((results[2]));
268    else
269        return null;
270}
271
272function delCookie(name) {
273    var exp = new Date();
274    exp.setTime(exp.getTime() - 1);
275    var cval = getCookie(name);
276    if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString();
277}
278
279function closeWindow() {
280    if (window.netscape) {
281        try {
282            netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
283        }
284        catch (e) {
285            alert("被浏览器拒绝!\n请在浏览器地址栏输入'about:config'并回车\n然后将'dom.allow_scripts_to_close_windows'设置为'true'");
286            return;
287        }
288    }
289    window.opener = null;
290    window.open('', '_parent', '');
291    window.close();
292}
293
294function IsDigit() {
295    return ((event.keyCode >= 48) && (event.keyCode <= 57));
296}
297
298function isNum(str) {
299    pattern = /^[0-9]*$/;
300    return pattern.test(str);
301}
302
303function getnewcode(Id) {
304    document.getElementById(Id).src = "http://www.sjwj.com/Controls/ValidateImage.aspx?t=" + (new Date()).getTime();
305}
306
307function getId(objectId) {
308    if (document.getElementById && document.getElementById(objectId)) {
309        // W3C DOM
310        return document.getElementById(objectId);
311    } else if (document.all && document.all(objectId)) {
312        // MSIE 4 DOM
313        return document.all(objectId);
314    } else if (document.layers && document.layers[objectId]) {
315        // NN 4 DOM.. note: this won't find nested layers
316        return document.layers[objectId];
317    } else {
318        return false;
319    }
320}
321
322function setShow(_name) {
323    var _show = document.getElementById(_name);
324    if (_show.style.display == "none")
325        _show.style.display = '';
326    else
327        _show.style.display = 'none';
328}
329
330function FontZoom(fsize) {
331    var ctext = document.getElementById("arctext");
332    ctext.style.fontSize = fsize + "px";
333}
334
335function Request(strName) {
336    var strHref = window.document.location.href;
337    var intPos = strHref.indexOf("?");
338    var strRight = strHref.substr(intPos + 1);
339
340    var arrTmp = strRight.split("&");
341    for (var i = 0; i < arrTmp.length; i++) {
342        var arrTemp = arrTmp[i].split("=");
343        if (arrTemp[0].toUpperCase() == strName.toUpperCase())
344            return arrTemp[1];
345    }
346    return "";
347}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.