PageSourceSearch

https://www.evergreen-fishing.com/js/pull_change.js

js evergreen-fishing.com collected 2026-10-03 22:03:00 UTC 18,145 bytes, 529 lines download raw bytes

1//JavaScript Document
2var NO;
3var bass_sub;
4var my_option="";
5var my_option_1="";
6var my_option_2="";
7var my_option_bass;
8var my_option_salt;
9var bass_salt;
10var id_name = "category";
11//var bass_salt;
12var b_s_flag;
13
14
15
16
17
18function changeCondition() {
19
20	/* action先の指定 */
21	if (j$("#g_no").val() == 1) {
22//------------------------------------------------------------------------------------ロッド
23		if (j$("#s_no").length){	//シリーズ選択
24			if (j$("#s_no").val() == "") {	//未選択時
25				j$("#vctg_no").val(j$("#g_no").val());
26				document.form1.action = "/goods_list/goods_list_2.php";
27			} else {
28				j$("#vcts_no").val(j$("#s_no").val());
29				j$("#vctg_no").val(j$("#g_no").val());
30				document.form1.action = "/goods_list/goods_list_22rod.php";
31			}
32		} else {	//用途
33			if (j$("#usage_no").val() == "") {	//未選択時
34				j$("#vctg_no").val(j$("#g_no").val());
35				document.form1.action = "/goods_list/goods_list_2.php";
36			} else {
37				j$("#vctg_no").val(j$("#g_no").val());
38				document.form1.action = "/goods_list/goods_list_22rod.php";
39			}
40		}
41
42	} else if (j$("#g_no").val() == 3){
43//------------------------------------------------------------------------------------ライン
44				j$("#vctg_no").val(j$("#g_no").val());
45				document.form1.action = "/goods_list/goods_list_2.php";
46
47	} else if (j$("#g_no").val() == 4){
48//------------------------------------------------------------------------------------ルアー
49		if (j$("#s_no")){	//シリーズ選択
50			if (j$("#s_no").val() == "") {	//未選択時
51				j$("#vctg_no").val(j$("#g_no").val());
52				document.form1.action = "/goods_list/goods_list_2.php";
53			} else {
54				j$("#vcts_no").val(j$("#s_no").val());
55				j$("#vctg_no").val(j$("#g_no").val());
56				document.form1.action = "/goods_list/goods_list_22lure.php";
57			}
58		} else {	//種類
59			if (j$("#kind_no").val() == "") {	//未選択時
60				j$("#vctg_no").val(j$("#g_no").val());
61				document.form1.action = "/goods_list/goods_list_2.php";
62			} else {
63				j$("#vctg_no").val(j$("#g_no").val());
64				document.form1.action = "/goods_list/goods_list_22lure.php";
65			}
66		}
67
68	} else if (j$("#g_no").val() == 6){
69//------------------------------------------------------------------------------------リール
70				j$("#vctg_no").val(j$("#g_no").val());
71				document.form1.action = "/goods_list/goods_list_2.php";
72
73	} else if (j$("#g_no").val() == 8){
74//------------------------------------------------------------------------------------グッズ
75				j$("#vctg_no").val(j$("#g_no").val());
76				document.form1.action = "/goods_list/goods_list_2.php";
77	}
78
79	document.form1.submit();
80}
81
82/////////////////////////////////////////////////////////////////
83var radio_btn;
84var default_selected;
85var default_selected2;
86var my_count = 0;
87/////////////////////////////////////////////////////////////////
88
89var my_submit_btn;
90var my_submit_btn_src;
91
92function btn_copy(){
93	j$("dd#btn").append('<img width="202" height="37" class="btn" id="my_btn" alt="選択されていない項目があります" src="'+my_submit_btn_src+'" />');
94	j$("#btn a:first").hide();
95}
96
97function btn_default(){
98	j$("#btn a:first").show();
99	j$("dd#btn img#my_btn").hide();
100}
101
102j$(function(){
103
104
105	if(j$("#btn a:first").length){
106		my_submit_btn = j$("#btn a:first");
107		my_submit_btn_src = j$("#btn a:first img:first").attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_off$2").toString();
108		btn_copy();
109
110	}
111
112
113//Enterでのsubmit防止
114	function submitStop(e){
115		if (!e) var e = window.event;
116		if(e.keyCode == 13)return false;
117	}
118
119	var list = j$("input[name='keyword']");
120	for(var i=0; i<list.length; i++){
121			list[i].onkeypress = function (event){
122				return submitStop(event);
123			};
124	}
125
126
127//画像のプリロード
128var preLoad = function (url) {
129  jQuery('<img />')
130    .hide()
131    .attr('src', url)
132    .appendTo(document.body)
133    .load(function () { jQuery(this).remove(); })
134    .error(function () { jQuery(this).remove(); });
135}
136
137preLoad('./img/products/tit_select_series.gif');
138preLoad('./img/products/tit_select_syurui.gif');
139preLoad('./img/subnavi/tit_series.gif');
140preLoad('./img/subnavi/tit_syurui.gif');
141preLoad('./img/subnavi/tit_yoto.gif');
142
143if(j$("#g_no").length){
144
145
146	//プルダウンに挿入する<option>タグ生成
147	function my_form(NO,b_s){
148
149
150my_tmp= 0;
151/*
152	if(bass_salt == "salt"){j$("#select").html('<img src="../img/subnavi/tit_search_salt.png" width="95" height="12" />');}
153	else if(bass_salt == "bass"){j$("#select").html('<img src="../img/subnavi/tit_search_bass.png" width="94" height="12" />');}
154*/
155
156	if(b_s){
157		j$("#g_no").html("");
158
159		//console.log("my_txt_"+b_s);
160		for( var i = 0; i < this["my_txt_"+b_s].length; i++ ) {
161
162			if(this["my_val_"+b_s][i]  == NO ){selected = 'selected="selected"';}
163			else{selected = "";}
164
165			this["my_option_"+b_s] = this["my_option_"+b_s] + '<option value="'+this["my_val_"+b_s][i]+'" '+ selected +'>'+this["my_txt_"+b_s][i]+'</option>';
166		}
167
168
169		j$("#g_no").html(this["my_option_"+b_s]);
170
171		document.form1.g_no.length = this["my_txt_"+b_s].length;
172
173		//プルダウンの変化状態の監視→実行
174		j$("g_no").change(function(){
175			my_form(j$("#g_no option:selected").val());
176		});
177
178		this["my_option_"+b_s] ="";
179
180	}
181
182
183	my_option="";
184	my_option_1="";
185
186
187if(j$("#select input:checked").val() == 2){b_s_flag = "_s_";}
188else{b_s_flag = "_b_";}
189
190
191		if(NO == "1"){ //ロッド
192			//用途
193			for( var i = 0; i < this["my_txt"+b_s_flag+"1"].length; i++ ) {
194				if(default_selected  == this["my_val"+b_s_flag+"1"][i] && radio_btn == 1){
195					//選択状態
196					selected = 'selected="selected"';
197					my_tmp= i;
198
199						my_option_2="";
200
201						if(b_s_flag == "_b_"){
202						for(var n=0; n< window["my_txt"+b_s_flag+"1_"+Number(i)].length; n++ ){
203
204							if(default_selected2 == window["my_val"+b_s_flag+"1_"+Number(i)][n]){selected2 = 'selected="selected"';}
205							else{selected2 = '';}
206
207							my_option_2 = my_option_2 + '<option value="'+window["my_val"+b_s_flag+"1_"+Number(i)][n]+'" '+selected2+'>'+window["my_txt"+b_s_flag+"1_"+Number(i)][n]+'</option>';
208						}
209						}
210
211				}
212				else{selected = "";}
213				my_option = my_option + '<option value="'+this["my_val"+b_s_flag+"1"][i]+'" '+ selected +'>'+this["my_txt"+b_s_flag+"1"][i]+'</option>';
214			}
215			//シリーズ
216			for( var i = 0; i < this["my_txt1"+b_s_flag+"1"].length; i++ ) {
217				if(default_selected  == this["my_val1"+b_s_flag+"1"][i] && my_count == 0 && radio_btn == 2){selected = 'selected="selected"';}
218				else{selected = "";}
219				my_option_1 = my_option_1 + '<option value="'+this["my_val1"+b_s_flag+"1"][i]+'" '+ selected +'>'+this["my_txt1"+b_s_flag+"1"][i]+'</option>';
220			}
221			//すでに要素があれば一旦削除
222			if(j$("#radio_li").length){j$("#radio_li").remove();}
223			if(j$("#pull_li").length){j$("#pull_li").remove();}
224			if(j$("#usage_no2").length){j$("#usage_no2").remove();}
225
226
227			if(radio_btn == 2 && my_count == 0){default_check1 = '';default_check2 = 'checked="checked"';}
228			else{default_check1 = 'checked="checked"';default_check2 = '';}
229
230//alert(my_tmp);
231
232			if((b_s_flag == "_b_" && my_tmp != 0)){
233			//input要素を追加
234			j$("#category select:first").after(''+
235			'<p id="radio_li"><label for="r_1"><input style="width:auto;height:auto;border:none;" onClick="r_change(this)" type="radio" name="r" id="r_1" value="1" '+ default_check1 +' /><img src="/img/subnavi/tit_yoto.gif" style="margin-right:15px;" /></label><label for="r_2"><input style="width:auto;height:auto;border:none;" onClick="r_change(this)" type="radio" name="r" id="r_2" value="2" '+ default_check2 +' /><img src="/img/subnavi/tit_series.gif" /></label></p>'+
236			'<p id="pull_li"><img src="/img/products/tit_select_yoto.gif" /><br /><select id="usage_no" name="vctg_no2" onChange="sel(this)">'+my_option+'</select><br /><select id="usage_no2" name="vctg_no3">'+my_option_2+'</select></p>');
237			}
238			else{
239			//input要素を追加
240			j$("#category select:first").after(''+
241			'<p id="radio_li"><label for="r_1"><input style="width:auto;height:auto;border:none;" onClick="r_change(this)" type="radio" name="r" id="r_1" value="1" '+ default_check1 +' /><img src="/img/subnavi/tit_yoto.gif" style="margin-right:15px;" /></label><label for="r_2"><input style="width:auto;height:auto;border:none;" onClick="r_change(this)" type="radio" name="r" id="r_2" value="2" '+ default_check2 +' /><img src="/img/subnavi/tit_series.gif" /></label></p>'+
242			'<p id="pull_li"><img src="/img/products/tit_select_yoto.gif" /><br /><select id="usage_no" name="vctg_no2" onChange="sel(this)">'+my_option+'</select></p>');
243			}
244
245
246//	j$("#s_no,#usage_no,#kind_no").bind("change",function(){
247
248//	});
249
250
251		}
252		else if(NO == "4"){ //ルアー
253
254			//シリーズ
255			for( var i = 0; i < this["my_txt"+b_s_flag+"3"].length; i++ ) {
256				//if(default_selected  == i && my_count == 0){selected = 'selected="selected"';}
257				if(default_selected  == this["my_val"+b_s_flag+"3"][i] && my_count == 0 && radio_btn == 3){selected = 'selected="selected"';}
258				else{selected = "";}
259				my_option = my_option + '<option value="'+this["my_val"+b_s_flag+"3"][i]+'" '+ selected +'>'+this["my_txt"+b_s_flag+"3"][i]+'</option>';
260			}
261			//種類
262
263
264			for( var i = 0; i < this["my_txt3"+b_s_flag+"1"].length; i++ ) {
265				//if(default_selected  == i){selected = 'selected="selected"';}
266				if(default_selected  == this["my_val3"+b_s_flag+"1"][i] && my_count == 0  && radio_btn == 2 ){selected = 'selected="selected"';}
267				else{selected = "";}
268				my_option_1 = my_option_1 + '<option value="'+this["my_val3"+b_s_flag+"1"][i]+'" '+ selected +'>'+this["my_txt3"+b_s_flag+"1"][i]+'</option>';
269			}
270
271
272			//すでに要素があれば一旦削除
273			if(j$("#radio_li")){j$("#radio_li").remove();}
274			if(j$("#pull_li")){j$("#pull_li").remove();}
275
276			if(radio_btn == 2 && my_count == 0){default_check1 = '';default_check2 = 'checked="checked"';}
277			else{default_check1 = 'checked="checked"';default_check2 = '';}
278
279
280			//ソルトルアーの時 -- ラジオボタンは表示しない、シリーズ別のみで検索(外観ã
280¯ã€Œç¨®é¡žåˆ¥ã€ã¨è¡¨ç¤ºï¼‰
281			if(j$("#select input:checked").val() == 2){
282				j$("#category select:first").after(''+
283				'<p id="pull_li"><img src="/img/products/tit_select_syurui.gif" /><br /><select id="s_no" name="s_no">'+my_option_1+'</select></p>');
284
285
286
287			}else{
288			//バスルアーの時 -- ラジオボタンを表示して、種類別・シリーズ別で検索できる
289				j$("#category select:first").after(''+
290				'<p id="radio_li"><label for="r_1"><input style="width:auto;height:auto;border:none;" onClick="r_change(this)" type="radio" name="r" id="r_1" value="3" '+ default_check1 +' /><img src="/img/subnavi/tit_syurui.gif" style="margin-right:15px;" /></label><label for="r_2"><input style="width:auto;height:auto;border:none;" onClick="r_change(this)" type="radio" name="r" id="r_2" value="2" '+ default_check2 +' /><img src="/img/subnavi/tit_series.gif" /></label></p><p id="pull_li"><img src="/img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="vctg_no2">'+my_option+'</select></p>');
291			}
292
293
294		}
295		else if(NO == "6"){ //リール
296
297			//種類
298			for( var i = 0; i < my_txt2.length; i++ ) {
299				if(default_selected  == my_val2[i]){selected = 'selected="selected"';}
300				else{selected = "";}
301				my_option = my_option + '<option value="'+my_val2[i]+'" '+ selected +'>'+my_txt2[i]+'</option>';
302			}
303			//すでに要素があれば一旦削除
304			if(j$("#radio_li")){j$("#radio_li").remove();}
305			if(j$("#pull_li")){j$("#pull_li").remove();}
306
307
308			//input要素を追加
309			/*
310			j$("#category select:first").after(''+
311			'<p id="pull_li"><img src="../img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="kind_no">'+my_option+'</select></p>');
312			*/
313			j$("#category select:first").after(''+
314			'<p id="pull_li"><img src="/img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="vctg_no2">'+my_option+'</select></p>');
315
316
317		}
318		else if(NO == "3"){ //ライン
319
320			//種類
321			for( var i = 0; i < my_txt4.length; i++ ) {
322				if(default_selected  == my_val4[i]){selected = 'selected="selected"';}
323				else{selected = "";}
324				my_option = my_option + '<option value="'+my_val4[i]+'" '+ selected +'>'+my_txt4[i]+'</option>';
325			}
326			//すでに要素があれば一旦削除
327			if(j$("#radio_li")){j$("#radio_li").remove();}
328			if(j$("#pull_li")){j$("#pull_li").remove();}
329
330
331			//input要素を追加
332			/*
333			j$("#category select:first").after(''+
334			'<p id="pull_li"><img src="../img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="kind_no">'+my_option+'</select></p>');
335			*/
336			j$("#category select:first").after(''+
337			'<p id="pull_li"><img src="/img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="vctg_no2">'+my_option+'</select></p>');
338
339		}
340		else if(NO == "8"){ //グッズ
341
342			//種類
343			if(j$("#select input:checked").val() == 1){
344				for( var i = 0; i < my_txt5.length; i++ ) {
345					if(default_selected  == my_val5[i]){selected = 'selected="selected"';}
346					else{selected = "";}
347					my_option = my_option + '<option value="'+my_val5[i]+'" '+ selected +'>'+my_txt5[i]+'</option>';
348				}
349			}
350			else if(j$("#select input:checked").val() == 2){
351				for( var i = 0; i < my_txt6.length; i++ ) {
352					if(default_selected  == my_val6[i]){selected = 'selected="selected"';}
353					else{selected = "";}
354					my_option = my_option + '<option value="'+my_val6[i]+'" '+ selected +'>'+my_txt6[i]+'</option>';
355				}
356			}
357
358
359			//すでに要素があれば一旦削除
360			if(j$("#radio_li")){j$("#radio_li").remove();}
361			if(j$("#pull_li")){j$("#pull_li").remove();}
362
363			//input要素を追加
364			j$("#category select:first").after(''+
365			'<p id="pull_li"><img src="/img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="vctg_no2">'+my_option+'</select></p>');
366
367		}else {
368			//console.log("不足しているパラメータがあります");
369		}
370
371	j$("#s_no,#usage_no,#kind_no").bind("change",function(){
372		if(j$(this).val() == ""){j$("#btn a:first").hide();j$("dd#btn img#my_btn").show();}
373		else{btn_default();}
374	});
375	if(j$("#s_no option:selected,#usage_no option:selected,#kind_no option:selected").val() == ""){j$("#btn a:first").hide();j$("dd#btn img#my_btn").show();}
376	else{btn_default();}
377
378
379	}
380
381
382	//プルダウンの変化状態の監視→実行
383	j$("#g_no").change(function(){
384		my_form(j$("#g_no option:selected").val());
385	});
386
387	//バス - ラジオボタンの変化状態の監視→実行
388	j$("#select input:eq(0)").click(function(){
389		NO = 1; //デフォルトをロッドに戻す
390		if(this.checked == true){my_form(NO,"bass");}
391	});
392	//ソルト - ラジオボタンの変化状態の監視→実行
393	j$("#select input:eq(1)").click(function(){
394		NO = 1; //デフォルトをロッドに戻す
395		if(this.checked == true){my_form(NO,"salt");}
396	});
397
398
399	//デフォルト値がロッドなのでロッド選択状態として1度実行
400
401
402	if( bass_salt=="top"){
403		my_form(NO,"bass");
404	}else{
405		my_form(NO,bass_salt);
406	}
407
408	my_count ++;
409
410
411}
412
413
414
415
416//ラジオボタンの変化状態の初回監視
417if(radio_btn == 1){
418	r_change(document.form1.r[0]);
419} else if (radio_btn == 2) {
420	if(document.getElementById("radio_li") != null){
421		r_change(document.form1.r[1]);
422	}
423} else if (radio_btn == 3) {
424	r_change(document.form1.r[0]);
425}
426
427});
428
429
430
431
432
433function sub_cat(){
434	if(b_s_flag == "_b_"){
435		for( var i = 0; i < window["my_txt"+b_s_flag+"1"].length; i++ ) {
436			if(default_selected  == window["my_val"+b_s_flag+"1"][i]){
437			my_option_2 ="";
438
439			for(var n=0; n< window["my_txt"+b_s_flag+"1_"+Number(i)].length; n++ ){
440
441				if(default_selected2 == window["my_val"+b_s_flag+"1_"+Number(i)][n]){selected2 = 'selected="selected"';}
442				else{selected2 = '';}
443
444				my_option_2 = my_option_2 + '<option value="'+window["my_val"+b_s_flag+"1_"+Number(i)][n]+'" '+selected2+'>'+window["my_txt"+b_s_flag+"1_"+Number(i)][n]+'</option>';
445			}
446			}
447		}
448	}
449	return my_option_2;
450}
451
452
453
454//ラジオボタンの変化状態の監視→実行
455function r_change(my){
456
457
458
459
460	if(my.value == 2){
461
462		j$("#category p:eq(2)").html('<img src="/img/products/tit_select_series.gif" /><br /><select id="s_no" name="s_no">'+my_option_1+'</select>');
463
464	}
465	else if(my.value == 3){
466
467		j$("#category p:eq(2)").html('<img src="/img/products/tit_select_syurui.gif" /><br /><select id="kind_no" name="vctg_no2">'+my_option+'</select>');
468
469	}
470	else{
471//		alert(my_tmp);
472			if(b_s_flag == "_b_" && my_tmp != 0){
473				j$("#category p:eq(2)").html('<img src="/img/products/tit_select_yoto.gif" /><br /><select id="usage_no" name="vctg_no2" onChange="sel(this)">'+my_option+'</select><br /><select id="usage_no2" name="vctg_no3">'+sub_cat()+'</select>');
474			}
475			else{
476				j$("#category p:eq(2)").html('<img src="/img/products/tit_select_yoto.gif" /><br /><select id="usage_no" name="vctg_no2" onChange="sel(this)">'+my_option+'</select>');
477			}
478
479		}
480
481
482	j$("#s_no,#kind_no").bind("change",function(){
483		if(j$(this).val() == ""){j$("#btn a:first").hide();j$("dd#btn img#my_btn").show();}
484		else{btn_default();}
485	});
486
487	if(j$("#s_no option:selected,#usage_no option:selected,#kind_no option:selected").val() == ""){j$("#btn a:first").hide();j$("dd#btn img#my_btn").show();}
488	else{btn_default();}
489
490
491
492}
493
494
495
496
497
498
499
500
501function sel(my_option){
502
503
504//alert(j$("#usage_no option:selected").val());
505
506		if(j$("#usage_no option:selected").val() == ""){
507			if(j$("#usage_no2").length){j$("#usage_no2").remove();}
508		}
509
510		if(my_option.value == ""){j$("#btn a:first").hide();j$("dd#btn img#my_btn").show();}
511		else{btn_default();
512
513		if(j$("#usage_no option:selected").index() != 0 && b_s_flag == "_b_"){
514			my_option_2 ="";
515			for(var n=0; n< window["my_txt"+b_s_flag+"1_"+Number(j$("#usage_no option:selected").index())].length; n++ ){
516				my_option_2 = my_option_2 + '<option value="'+window["my_val"+b_s_flag+"1_"+Number(j$("#usage_no option:selected").index())][n]+'">'+window["my_txt"+b_s_flag+"1_"+Number(j$("#usage_no option:selected").index())][n]+'</option>';
517			}
518		}
519
520
521
522		if(b_s_flag == "_b_" && j$("#usage_no2").length){
523		j$("#usage_no2").html(my_option_2);
524		}
525		else if(b_s_flag == "_b_"){
526		j$("#usage_no").after('<br /><select id="usage_no2" name="vctg_no3">'+my_option_2+'</select>');
527		}
528		}
529}

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.