PageSourceSearch

https://yakisobarakuen.com/template/zsy01/js/common.js

js yakisobarakuen.com collected 2026-10-06 20:12:08 UTC 14,785 bytes, 517 lines download raw bytes

1function AJAX(G) {
2	var K = [],
3	$ = this,
4	L = AJAX.__pool__ || (AJAX.__pool__ = []); (function(E) {
5		var D = function() {};
6		E = E ? E: {};
7		var C = ["url", "content", "method", "async", "encode", "timeout", "ontimeout", "onrequeststart", "onrequestend", "oncomplete", "onexception"],
8		A = ["", "", "GET", true, I("GBK"), 3600000, D, D, D, D, D],
9		B = C.length;
10		while (B--) $[C[B]] = _(E[C[B]], A[B]);
11		if (!N()) return false;
12	})(G);
13	function _(_, $) {
14		return _ != undefined ? _: $
15	}
16	function N() {
17		var A, $ = [window.XMLHttpRequest, "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
18		for (var B = 0; B < L.length; B += 1) if (L[B].readyState == 0 || L[B].readyState == 4) return L[B];
19		for (B = 0; B < $.length; B += 1) {
20			try {
21				if (window.XMLHttpRequest) {
22					A = ($[B] && typeof($[B]) == "function" ? new $[B] : new XMLHttpRequest($[B]));
23				}else
24				{
25					A = ($[B] && typeof($[B]) == "function" ? new $[B] : new ActiveXObject($[B]));
26				}	
27				break
28			} catch(_) {
29				A = false;
30				continue
31			}
32		}
33		if (!A) {
34			throw "Cannot init XMLHttpRequest object!";
35			return false
36		} else {
37			L[L.length] = A;
38			
39			return A
40		}
41	}
42	function E($) {
43		return document.getElementById($)
44	}
45	function C($) {
46		var _ = $ * 1;
47		return (isNaN(_) ? 0 : _)
48	}
49	function D($) {
50		return (typeof($) == "string" ? ($ = E($)) ? $: false: $)
51	}
52	function F() {
53		return ((new Date) * 1)
54	}
55	function M($, _) {
56		K[$ + ""] = _
57	}
58	function H($) {
59		return (K[$ + ""])
60	}
61	function J(_, $, B) {
62		return (function A(C) {
63			C = C.replace(/([^\u0080-\u00FF]+)/g,
64			function($0, $1) {
65				return _($1)
66			}).replace(/([\u0080-\u00FF])/g,
67			function($0, $1) {
68				return escape($1).replace("%", "%u00")
69			});
70			for (var E = 0,
71			D = $.length; E < D; E += 1) C = C.replace($[E], B[E]);
72			return (C)
73		})
74	}
75	function I($) {
76		if ($.toUpperCase() == "UTF-8") return (encodeURIComponent);
77		else return (J(escape, [/\+/g], ["%2B"]))
78	}
79	function O(A, B) {
80		if (!A.nodeName) return;
81		var _ = "|" + A.nodeName.toUpperCase() + "|";
82		if ("|INPUT|TEXTAREA|OPTION|".indexOf(_) > -1) A.value = B;
83		else {
84			try {
85				A.innerHTML = B
86			} catch($) {}
87		}
88	}
89	function P(_) {
90		if (typeof(_) == "function") return _;
91		else {
92			_ = D(_);
93			if (_) return (function($) {
94				O(_, $.responseText)
95			});
96			else return $.oncomplete
97		}
98	}
99	function B(_, A, $) {
100		var C = 0,
101		B = [];
102		while (C < _.length) {
103			B[C] = _[C] ? ($[C] ? $[C](_[C]) : _[C]) : A[C];
104			C += 1
105		}
106		while (C < A.length) {
107			B[C] = A[C];
108			C += 1
109		}
110		return B
111	}
112	function A() {
113		var E, C = false,
114		K = N(),
115		J = B(arguments, [$.url, $.content, $.oncomplete, $.method, $.async, null], [null, null, P, null, null, null]),
116		G = J[0],
117		I = J[1],
118		L = J[2],
119		M = J[3],
120		H = J[4],
121		A = J[5],
122		O = M.toUpperCase() == "POST" ? true: false;
123		if (!G) {
124			throw "url is null";
125			return false
126		}
127		var _ = {
128			url: G,
129			content: I,
130			method: M,
131			params: A
132		};
133		if (!O) G += (G.indexOf("?") > -1 ? "&": "?") + "timestamp=" + F();
134		K.open(M, G, H);
135		$.onrequeststart(_);
136		if (O) K.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
137		K.setRequestHeader("X-Request-With", "XMLHttpRequest");
138		E = setTimeout(function() {
139			C = true;
140			K.abort()
141		},
142		$.timeout);
143		var D = function() {
144			if (C) {
145				$.ontimeout(_);
146				$.onrequestend(_)
147			} else if (K.readyState == 4) {
148				clearTimeout(E);
149				_.status = K.status;
150				try {
151					if (K.status == 200) L(K, A);
152					else $.onexception(_)
153				} catch(B) {
154					$.onexception(_)
155				}
156				$.onrequestend(_)
157			}
158		};
159		K.onreadystatechange = D;
160		if (O) K.send(I);
161		else K.send("");
162		if (H == false) D();
163		return true
164	}
165	this.setcharset = function(_) {
166		if (!$.encode) $.encode = I(_)
167	};
168	this.get = function(C, B, _) {
169		return A(C, "", B, "GET", $.async, _)
170	};
171	this.update = function(H, J, _, D, E) {
172		_ = C(_);
173		D = C(D);
174		if (_ < 1) D = 1;
175		var B = function() {
176			A(J, "", H, "GET", $.async, E)
177		},
178		G = F(),
179		I = function($) {
180			B();
181			$--;
182			if ($ > 0) M(G, setTimeout(function() {
183				I($)
184			},
185			_))
186		};
187		I(D);
188		return G
189	};
190	this.stopupdate = function($) {
191		clearTimeout(H($))
192	};
193	this.post = function(D, _, C, B) {
194		return A(D, _, C, "POST", $.async, B)
195	};
196	this.postf = function(O, J, B) {
197		var H = [],
198		L,
199		_,
200		G,
201		I,
202		M,
203		K = arguments.length,
204		C = arguments;
205		O = O ? D(O) : false;
206		if (!O || O.nodeName != "FORM") return false;
207		validfoo = O.getAttribute("onvalidate");
208		validfoo = validfoo ? (typeof(validfoo) == "string" ? new Function(validfoo) : validfoo) : null;
209		if (validfoo && !validfoo()) return false;
210		var E = O.getAttribute("action"),
211		N = O.getAttribute("method"),
212		F = $.formToStr(O);
213		if (F.length == 0) return false;
214		if (N.toUpperCase() == "POST") return A(E, F, J, "POST", true, B);
215		else {
216			E += (E.indexOf("?") > -1 ? "&": "?") + F;
217			return A(E, "", J, "GET", true, B)
218		}
219	};
220	this.formToStr = function(C) {
221		var B = "",
222		E = "",
223		_, A;
224		for (var D = 0; D < C.length; D += 1) {
225			_ = C[D];
226			if (_.name != "") {
227				switch (_.type) {
228				case "select-one":
229					if (_.selectedIndex > -1) A = _.options[_.selectedIndex].value;
230					else A = "";
231					break;
232				case "checkbox":
233				case "radio":
234					if (_.checked == true) A = _.value;
235					break;
236				default:
237					A = _.value
238				}
239				A = $.encode(A);
240				B += E + _.name + "=" + A;
241				E = "&"
242			}
243		}
244		return B
245	}
246}
247//-------------------------------------------------------
248
249
250function checkAll(bool,tagname,name)
251{
252	var checkboxArray;checkboxArray=getElementsByName(tagname,name)
253	for (var i=0;i<checkboxArray.length;i++){checkboxArray[i].checked = bool;}
254}
255
256function checkOthers(tagname,name)
257{
258	var checkboxArray;checkboxArray=getElementsByName(tagname,name)
259	for (var i=0;i<checkboxArray.length;i++){
260		if (checkboxArray[i].checked == false){
261			checkboxArray[i].checked = true;
262		}else if (checkboxArray[i].checked == true){
263			checkboxArray[i].checked = false;
264		}
265	}
266}
267
268function textareasize(obj){
269	if(obj.scrollHeight > 70){
270		obj.style.height = obj.scrollHeight + 'px';
271	}
272}
273
274function set(obj,value){
275	obj.innerHTML = value
276}
277
278function view(id){
279	document.getElementById(id).style.display='inline'	
280}
281
282function hide(id){
283	document.getElementById(id).style.display='none'		
284}
285
286function getScroll(){var t;if(document.documentElement&&document.documentElement.scrollTop){t=document.documentElement.scrollTop;}else if(document.body){t=document.body.scrollTop;}return(t);} 
287
288
289function HtmlEncode(str)
290{   
291	 var s = "";
292	 if(str.length == 0) return "";
293	 s    =    str.replace(/&/g,"&amp;");
294	 s    =    s.replace(/</g,"&lt;");
295	 s    =    s.replace(/>/g,"&gt;");
296	 s    =    s.replace(/ /g,"&nbsp;");
297	 s    =    s.replace(/\'/g,"&#39;");
298	 s    =    s.replace(/\"/g,"&quot;"); 
299	 return   s;   
300}  
301
302function getElementsByName(tag,name){
303    var rtArr=new Array();
304    var el=document.getElementsByTagName(tag);
305    for(var i=0;i<el.length;i++){
306        if(el[i].name==name)
307              rtArr.push(el[i]);
308    }
309    return rtArr;
310}
311
312function closeWin(){
313	document.body.removeChild(document.getElementById("bg")); 
314	document.body.removeChild(document.getElementById("msg"));
315	if(document.getElementById("searchtype"))document.getElementById("searchtype").style.display="";
316}
317
318function openWindow(zindex,width,height,alpha){
319	var iWidth = document.documentElement.scrollWidth; 
320	var iHeight = document.documentElement.clientHeight; 
321	var bgDiv = document.createElement("div");
322	bgDiv.id="bg";
323	bgDiv.style.cssText = "top:0;width:"+iWidth+"px;height:"+document.documentElement.scrollHeight+"px;filter:Alpha(Opacity="+alpha+");opacity:0.3;z-index:"+zindex+";";
324	document.body.appendChild(bgDiv); 
325	var msgDiv=document.createElement("div");
326	msgDiv.id="msg";
327	msgDiv.style.cssText ="z-index:"+(zindex+1)+";width:"+width+"px; height:"+(parseInt(height)-0+29+16)+"px;left:"+((iWidth-width-2)/2)+"px;top:"+(getScroll()+(height=="auto"?150:(iHeight>(parseInt(height)+29+2+16+30)?(iHeight-height-2-29-16-30)/2:0)))+"px";
328	msgDiv.innerHTML="<div class='msgtitle'><div id='msgtitle'></div><img onclick='closeWin()' src='/"+sitePath+"pic/btn_close.gif' /></div><div id='msgbody' style='height:"+height+"px'></div>";
329	document.body.appendChild(msgDiv);
330}
331
332function openWindow2(zindex,width,height,alpha){
333	var iWidth = document.documentElement.scrollWidth; 
334	var bgDiv = document.createElement("div");
335	bgDiv.id="bg";
336	bgDiv.style.cssText = "top:0;width:"+iWidth+"px;height:"+document.documentElement.scrollHeight+"px;filter:Alpha(Opacity="+alpha+");opacity:0.3;z-index:"+zindex+";";
337	document.body.appendChild(bgDiv); 
338	var msgDiv=document.createElement("div");
339	msgDiv.id="msg";
340	msgDiv.style.cssText ="position: absolute;z-index:"+(zindex+1)+";width:"+width+"px; height:"+(height=="auto"?height:(height+"px"))+";";
341	document.body.appendChild(msgDiv);	
342}
343
344function selectTogg(){
345	var selects=document.getElementsByTagName("select");
346	for(var i=0;i<selects.length;i++){
347		selects[i].style.display=(selects[i].style.display=="none"?"":"none");
348	}
349}
350function checkInput(str,type){
351	switch(type){
352		case "mail":
353			if(!/^([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\-|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/gi.test(str)){alert('邮箱填写错误');return false;}
354			break;
355		case "num" :
356			if(isNaN(str)){alert('QQ填写错误');return false;}
357			break;
358	}
359	return true;
360}
361
362function copyToClipboard(txt) {    
363	if(window.clipboardData){    
364		window.clipboardData.clearData();    
365		window.clipboardData.setData("Text", txt);
366		alert('复制成功!')
367	}else{
368		alert('请手动复制!')	
369	}   
370}
371function   getUrlArgs()   
372  {   
373     return  location.pathname;
374  }
375$(function() {
376  $("img.lazy").lazyload();
377 });
378$(document).ready(function(){
379
380    $("ul.aa .bb").hover(function(){
381        $(this).addClass("hover").find("div.cc").show();
382    },function(){
383        $(this).removeClass("hover").find("div.cc").hide();
384    });
385
386});
387function setTab(name,name2,cursel,n){
388 for(i=1;i<=n;i++){
389  var menu=document.getElementById(name+i);
390  var con=document.getElementById(name2+i);
391  menu.className=i==cursel?"on":"";
392  con.style.display=i==cursel?"block":"none";
393 }
394};
395$(document).ready(function(){
396  var qcloud={};
397  $('[_t_nav]').hover(function(){
398    var _nav = $(this).attr('_t_nav');
399    clearTimeout( qcloud[ _nav + '_timer' ] );
400    qcloud[ _nav + '_timer' ] = setTimeout(function(){
401    $('[_t_nav]').each(function(){
402    $(this)[ _nav == $(this).attr('_t_nav') ? 'addClass':'removeClass' ]('nav_hover');
403    });
404    $('#'+_nav).stop(true,true).slideDown(0);
405    }, 0);
406  },function(){
407    var _nav = $(this).attr('_t_nav');
408    clearTimeout( qcloud[ _nav + '_timer' ] );
409    qcloud[ _nav + '_timer' ] = setTimeout(function(){
410    $('[_t_nav]').removeClass('nav_hover');
411    $('#'+_nav).stop(true,true).slideUp(0);
412    }, 0);
413  });
414});
415$(function() {
416  for (var i = 0; i < $("div[name=ee]").length; i++) {
417            var m = $("div[name=ee]").eq(i);
418            if (m.text().length > 170) {
419                m.attr("ee", m.text());
420                m.html(m.text().substr(0, 170) + "...<a name=\"zhankai\" class=\"y\" href=\"javascript:;\">展开</a>");
421            }
422        }
423        $("a[name=zhankai]").on("click", function () {
424            $(this).parent().html($(this).parent().attr("ee") + "<a name=\"yinchang\" class=\"y\" href=\"javascript:;\">隐藏</a>");
425        });
426        $("a[name=yinchang]").on("click", function () {
427            $(this).parent().html($(this).parent().attr("ee").substr(0, 170) + "...<a name=\"zhankai\" class=\"y\" href=\"javascript:;\">展开</a>");
428        });
429 });
430$(function(){
431    $(".sbtn").click(function(){
432        if($(this).hasClass("cur"))
433        {
434            $(".sbtn").removeClass("cur");
435            $(".sy").hide();
436        }
437        else{
438        	$(".sy").show();
439            $(".sbtn").addClass("cur");
440        }
441    })
442    $(".sbtn1").click(function(){
443        if($(this).hasClass("cur"))
444        {
445            $(".sbtn1").removeClass("cur");
446            $(".sy1").hide();
447        }
448        else{
449        	$(".sy1").show();
450            $(".sbtn1").addClass("cur");
451        }
452    })
453    $(".sbtn2").click(function(){
454        if($(this).hasClass("cur"))
455        {
456            $(".sbtn2").removeClass("cur");
457            $(".sy2").hide();
458        }
459        else{
460        	$(".sy2").show();
461            $(".sbtn2").addClass("cur");
462        }
463    })
464});
465function $$(id){return document.getElementById(id);}
466// function Wnew(len){
467//     alert(len);
468//     for(var ui=1; ui<=len; ui++){
469//         var playbox=$$("play_"+ui)
470//         var ulbox=$$("vlink_"+ui),litag=ulbox.getElementsByTagName('li'),isno2,rhtml;
471//         rhtml="";
472//         if(litag.length>25){playbox.className="playlist mb b max_height";}else{playbox.className="playlist mb b";}
473//         for(var uii=litag.length-1;uii>=0;uii--){
474//             if(uii==litag.length-1){isno2='<li class="new">';}else{isno2='<li>';}
475//             rhtml+=isno2+litag[uii].innerHTML+"</li>";
476//         }
477//         rhtml="<ul>"+rhtml+"</ul>";
478//         ulbox.innerHTML=rhtml;
479//     }
480// }
481function Order(o,id,vi){
482    var tag,leng,i,phtml,box,ubox,uhtml,isno,s1,s2
483    box=$$(id);
484    tag=box.getElementsByTagName('li');
485    leng=tag.length;
486    uhtml="";
487    if (o==1){
488      for(i=leng-1;i>=0;i--){
489          if(i==leng-1){isno='<li class="new">';}else{isno='<li>';}
490          uhtml+=isno+tag[i].innerHTML+"</li>";
491      }
492      s1="<em class=\"over\">倒序↓</em>"
493      s2="<em onclick=\"Order(0,'vlink_"+vi+"',"+vi+")\">顺序↑</em>"
494    }else{
495      for(i=leng-1;i>=0;i--){
496          if(i==0){isno='<li class="new">';}else{isno='<li>';}
497          uhtml+=isno+tag[i].innerHTML+"</li>";
498      }
499      s1="<em onclick=\"Order(1,'vlink_"+vi+"',"+vi+")\">倒序↓</em>"
500      s2="<em class=\"over\">顺序↑</em>"
501    }
502    $$(id+"_s1").innerHTML=s1;
503    $$(id+"_s2").innerHTML=s2;
504    uhtml="<ul>"+uhtml+"</ul>";
505    box.innerHTML=uhtml;
506}
507$(function(){ 
508  $(window).scroll(function() {   
509    if($(window).scrollTop() >= 300){
510      $('.gotop').fadeIn(400); 
511    }else{    
512      $('.gotop').fadeOut(400);    
513    }  
514  });
515  $('.gotop').click(function(){
516  $('html,body').animate({scrollTop: '0px'}, 800);}); 
517});

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.