PageSourceSearch

https://school114.org/product/product.js?v=20261

js school114.org collected 2026-09-24 15:09:35 UTC 32,452 bytes, 1,223 lines download raw bytes

1//관심상품
2$(document).on("click", "a[name=p_heart],a[name=p_heart_view],#btn_heart", function() {
3	if(user_check_id=='') {
4		alert("로그인을 해야만 관심상품에 등록할 수 있습니다");
5		return;
6	}
7	const idx=$(this).data("idx");
8	const link_name=this.name;
9
10	if(link_name=='p_heart') {
11		var css=_ID("p_heart"+idx).className;
12	} else if(link_name=='p_heart_view') {
13		var css=_ID("p_heart_view"+idx).className;
14	} else {
15		var css=_ID("btn_heart").classNmae;
16	}
17
18	var is_ok='';
19	if(css=='p_heart on') {
20		/*
21		var ans=confirm("관심상품을 삭제하시겠습니까?");
22		if(ans==true) {
23
24		} else {
25			return;
26		}
27		*/
28	}
29
30	var param="idx="+idx;
31	//console.log(param);
32
33	$.ajax({
34		url:'/product/x_fav.asp',
35		data:param,
36		type:'post',
37		success:function(data, status, req) {		
38			if(data=='EX') {
39				//alert("관심상품이 삭제되었습니다!");
40				
41
42				if(link_name=='p_heart') { //목록
43					_ID("div_wish"+idx).className='wishsave on';
44					_ID("div_wish"+idx).innerHTML='관심상품이 삭제되었습니다.';
45					setTimeout(do_clear_wish, 1500, idx);
46					_ID("p_heart"+idx).className='p_heart';				
47				} else if(link_name=='p_heart_view') { //상세연관제품
48					_ID("div_wish_view"+idx).className='wishsave on';
49					_ID("div_wish_view"+idx).innerHTML='관심상품이 삭제되었습니다.';
50					setTimeout(do_clear_wish_view, 1500, idx);
51					_ID("p_heart_view"+idx).className='p_heart';				
52				} else {
53					_ID("div_wish"+idx).className='wishsave on';
54					_ID("div_wish"+idx).innerHTML='관심상품에 삭제되었습니다.';
55					setTimeout(do_clear_wish, 1500, idx);
56					_ID("btn_heart").className='heart estimate_down';	
57					_ID("p_heart"+idx).className='p_heart';				
58				}
59				return;
60			} else if(data=='Y') {
61				//alert("관심상품에 저장되었습니다!\n마이페이지에서 확인이 가능합니다");				
62				
63
64				if(link_name=='p_heart') { //목록
65					_ID("div_wish"+idx).className='wishsave on';
66					_ID("div_wish"+idx).innerHTML='관심상품에 저장되었습니다.';
67					setTimeout(do_clear_wish, 1500, idx);
68					_ID("p_heart"+idx).className='p_heart on';				
69				} else if(link_name=='p_heart_view') { //상세
70					_ID("div_wish_view"+idx).className='wishsave on';
71					_ID("div_wish_view"+idx).innerHTML='관심상품에 저장되었습니다.';
72					setTimeout(do_clear_wish_view, 1500, idx);
73					_ID("p_heart_view"+idx).className='p_heart on';				
74				} else {
75					_ID("div_wish"+idx).className='wishsave on';
76					_ID("div_wish"+idx).innerHTML='관심상품에 저장되었습니다.';
77					setTimeout(do_clear_wish, 1500, idx);
78					_ID("btn_heart").className='heart estimate_down on';	
79					_ID("p_heart"+idx).className='p_heart on';				
80				}
81				//do_quick_wish('');
82				//return;
83			}
84		},
85		error:function(req, status, error) {
86			alert(error);
87		}
88	});		
89});
90
91function do_clear_wish(idx) {
92	_ID("div_wish"+idx).className='wishsave';
93}
94
95function do_clear_wish_view(idx) {
96	_ID("div_wish_view"+idx).className='wishsave';
97}
98
99
100//전체해제
101$("#btn_del_all").on("click", function() {
102	
103	const obj=document.f;
104
105	$("input[name=scate]").prop("checked", false);
106	$("input[name=mcate]").prop("checked", false);
107	$("input[name=st]").prop("checked", false);
108	$("input[name=scom]").prop("checked", false);
109	obj.cat2.value='';
110	obj.cat3.value='';
111	obj.sprice[0].checked=true;
112	obj.sp1.value='';
113	obj.sp2.value='';
114	obj.sv.value='';
115
116	$("#div_pick").remove();
117
118	do_xsearch();
119});
120
121//체크박스
122$(document).on("click", "input[name=st],input[name=scom]", function() {
123//$(document).on("click", "input[name=scom]", function() {
124	const idx=$(this).data("idx");
125	const name=$(this).data("name");
126	
127	if(this.checked==true) {
128		$("#div_pick").append("<a href='#null' id='dp"+idx+"'>"+name+" <i class='xi-close' name='x_btn_del' data-idx='"+idx+"'></i></a>");
129	} else {
130		$("#dp"+idx+"").remove();
131	}
132
133	do_search_prd();
134});
135
136//체크박스 삭제
137$(document).on("click", "i[name=x_btn_del]", function() {
138	const idx=$(this).data("idx");
139	const data_type=$(this).data("type");
140
141	$("#dp"+idx+"").remove();
142	if(data_type=='theme') {
143		document.getElementById("st"+idx).checked=false;
144	} else {
145		document.getElementById("scom"+idx).checked=false;
146	}
147
148	do_search_prd();
149});
150
151//분류탭
152$("a[name=bc_info]").on("click", function() {
153	const obj=document.f;
154	const bci=$(this).data("number"); //bc_number
155	const bci2=$(this).data("number2"); //테마 bc_number
156	const bcn=$(this).data("num"); //idx값
157	const n_bcn=obj.bcn.value;
158
159	obj.bcn.value=bcn;
160
161	_ID("product_tab"+n_bcn).className="";
162	_ID("product_tab"+bcn).className="on";
163
164	do_bc_tab(bci, bci2);	
165	obj.cat2.value=''; //이동시 값 초기화
166	obj.cat3.value='';
167	_ID("div_cat_dc").style.display="none"; //하단 카데고리 닫음
168});
169
170function do_bc_tab(bc, bc2) {
171	const obj=document.f;
172	const cc=obj.cat2.value;
173	const param="bc="+bc+"&cc="+cc;
174
175	//console.log(param);
176
177	$.ajax({
178		url:'/product/x_cat_cc.asp',
179		data:param,
180		type:'post',
181		success:function(data, status, req) {		
182			_ID("div_cat_cc").innerHTML=data;
183			obj.cat1.value=bc;
184			
185			do_theme(bc2);
186			do_search_prd();			
187		},
188		error:function(req, status, error) {
189			alert(error);
190		}
191	});	
192}
193
194//카테고리 클릭시
195//$(document).on("click", "input[name=scate],input[name=st]", function() {
196$(document).on("click", "input[name=scate]", function() {
197	const scat=$(this).data("number");
198	const obj=document.f;
199
200	//console.log("scat="+scat);
201
202	obj.cat2.value=scat;
203	obj.cat3.value=''; //하위 카테고리값 초기화
204	do_view_cc(scat);
205	do_search_prd();
206});
207
208//하위 카테고리 클릭시
209$(document).on("click", "input[name=mcate]", function() {
210	const mcat=$(this).data("number");
211	const obj=document.f;
212
213	obj.cat3.value=mcat;
214	do_search_prd();
215});
216
217$(document).on("click", "input[name=sprice]", function() {	
218	do_search_prd();
219});
220
221$("#btn_search,#btn_search2").on("click", function() {	
222	do_search_prd();
223});
224
225$("#sv_etc").on("keyup", function() {	
226	if(event.keyCode==13) {
227		do_search_prd();
228	}
229});
230
231function do_view_cc(c) {
232	const obj=document.f;
233	const ac=obj.cat1.value;
234	const bc=obj.cat2.value;
235	const cat3=obj.cat3.value;
236	const param="ac="+ac+"&bc="+bc+"&cc="+c+"&cat3="+cat3;
237
238	//console.log("do_view_cc");
239
240	$.ajax({
241		url:'/product/x_cat_dc.asp',
242		data:param,
243		type:'post',
244		success:function(data, status, req) {		
245			//console.log(data);
246			_ID("div_cat_dc").style.display="table-row";
247			_ID("div_cat_dc").innerHTML=data;
248			obj.cat3.value=cat3;
249			//do_search_prd();
250		},
251		error:function(req, status, error) {
252			alert(error);
253		}
254	});	
255}
256
257//정렬
258$("a[name=link_asc]").on("click", function() {
259	const asc=$(this).data("asc");
260	const obj=document.f;
261	const n_sn=obj.sn.value;
262	obj.sn.value=asc;
263
264	_ID("li_asc"+n_sn+"").className="";
265	_ID("li_asc"+asc+"").className="active";
266	do_search_prd();
267});
268
269$(document).on("click", "#btn_close", function() {
270	document.getElementById("layer_pop_product").style.display="none";
271	document.getElementById("blockLay").style.display="none";
272	
273	const obj=document.f;
274	const v=obj.v.value;
275	if(v != '') {
276		obj.v.value='';
277	}
278	
279});
280
281$(document).on("click", "a[name=link_product]", function() {
282	if(user_check_id=='') {
283		alert("로그인을 해야만 상세 조회가 가능합니다");
284		return;
285	}
286
287	const number=$(this).data("number");
288	const param="number="+number;
289
290	$.ajax({
291		url:'/product/x_product_view.asp',
292		data:param,
293		type:'get',
294		success:function(data, status, req) {	
295			if(data=='NOPEN') {
296				alert("사이트 표시 상품이 아닙니다");
297				return;
298			} else {
299				document.getElementById("layer_pop_product").style.display="block";
300				document.getElementById("blockLay").style.display="block";
301				_ID("layer_pop_product").innerHTML=data;
302				do_after(number);
303				do_qna(number);
304			}
305		},
306		error:function(req, status, error) {
307			alert(error);
308		}
309	});	
310});
311
312function do_viewp(number) {
313	if(user_check_id=='') {
314		alert("로그인을 해야만 상세 조회가 가능합니다");
315		return;
316	}
317
318	const param="number="+number;
319
320	$.ajax({
321		url:'/product/x_product_view.asp',
322		data:param,
323		type:'get',
324		success:function(data, status, req) {		
325			$(".quick_rproduct").removeClass("active");
326			document.getElementById("layer_pop_product").style.display="block";
327			document.getElementById("blockLay").style.display="block";
328			_ID("layer_pop_product").innerHTML=data;
329			do_after(number);
330			do_qna(number);
331		},
332		error:function(req, status, error) {
333			alert(error);
334		}
335	});	
336}
337
338function do_after(number) {
339	if(user_check_id=='') {
340		alert("로그인을 해야만 후기작성이 가능합니다");
341		return;
342	}
343	const param="number="+number;
344
345	$.ajax({
346		url:'/product/x_after.asp',
347		data:param,
348		type:'get',
349		success:function(data, status, req) {	
350			_ID("product_after").innerHTML=data;
351		},
352		error:function(req, status, error) {
353			alert(error);
354		}
355	});	
356}
357
358function do_qna(number) {
359	if(user_check_id=='') {
360		alert("로그인을 해야만 문의가 가능합니다");
361		return;
362	}
363	const param="number="+number;
364
365	$.ajax({
366		url:'/product/x_qna.asp',
367		data:param,
368		type:'get',
369		success:function(data, status, req) {	
370			_ID("product_qna").innerHTML=data;
371		},
372		error:function(req, status, error) {
373			alert(error);
374		}
375	});
376}
377
378function do_search_prd() {
379	const obj=document.f;
380
381	obj.page.value=1;
382	do_xsearch();
383}
384
385function do_paging(n) {
386	const obj=document.f;
387	const npage=obj.page.value;	
388
389	obj.page.value=n;		
390	do_xsearch();
391	document.getElementById("div_page_"+npage+"").className="";
392	document.getElementById("div_page_"+n+"").className="on";
393}
394
395//더보기
396function do_more_page() {
397	const obj=document.f;
398	let npage=obj.page.value;	
399	npage = parseInt(npage)+1;
400
401	obj.page.value=npage;		
402	do_xsearch_more();
403}
404
405function do_xtotal() {
406	var formData = $("#form").serialize();
407	$.ajax({
408		type : "POST",
409		url : "/product/x_total.asp",
410		cache : false,
411		data : formData,
412		success:function(data, status, req) {
413			document.getElementById("x_total").innerHTML=data;
414		},
415		error:function(req, status, error) {
416			alert(error);
417		}
418	});
419}
420
421function do_xsearch() {
422	const obj=document.f;
423	const lt=obj.lt.value;
424
425	var formData = $("#form").serialize();
426
427
428	$.ajax({
429		type : "POST",
430		url : "/product/x_list.asp",
431		cache : false,
432		data : formData,
433		success:function(data, status, req) {
434			//console.log(data);
435			//history.pushState(formData, '', "content_list.asp?t=<%=t%>")
436			/**	
437			if(lt=='full') {				
438				_ID("x_list").className="product_list";
439			} else {
440				_ID("x_list").className="product_albumlist";
441			}
442			**/
443
444			document.getElementById("x_list").innerHTML=data;
445			
446		},
447		beforeSend:function() {
448			
449			document.getElementById("x_list").innerHTML="<div class='center pt10 pb10'><img src='/images/loading.gif' style='width:60px'></div>";
450		},
451		complete: function() {
452		},
453		error:function(req, status, error) {
454			console.log(error);
455		}
456	});
457}
458
459function do_xsearch_more() {
460	const obj=document.f;
461	const lt=obj.lt.value;
462
463	var formData = $("#form").serialize();
464	$.ajax({
465		type : "POST",
466		url : "/product/x_list.asp",
467		cache : false,
468		data : formData,
469		success:function(data, status, req) {
470			//console.log(data);
471			//history.pushState(formData, '', "content_list.asp?t=<%=t%>")
472			/**	
473			if(lt=='full') {				
474				_ID("x_list").className="product_list";
475			} else {
476				_ID("x_list").className="product_albumlist";
477			}
478			**/
479
480			$("#x_list").append(data);
481		},
482		beforeSend:function() {
483			
484			document.getElementById("x_list_loading").innerHTML="<div class='center'><img src='/images/loading.gif' style='width:60px'></div>";
485		},
486		complete: function() {
487			document.getElementById("x_list_loading").innerHTML="";
488		},
489		error:function(req, status, error) {
490			console.log(error);
491		}
492	});
493}
494
495$("a[name=btn_list_type]").on("click", function() {
496	const obj=document.f;
497	const lt=$(this).data("type");
498	const lt_pre=obj.lt.value;
499
500	obj.lt.value=lt;
501
502	//_ID("link_"+lt_pre).className="btn p_view";
503	//_ID("link_"+lt).className="btn import1 p_view";
504
505	_ID("link_"+lt_pre).className="";
506	_ID("link_"+lt).className="active";
507
508	if(lt=='thumb') {
509		var sv="<option value='16'>4줄</option><option value='40'>10줄</option><option value='120'>30줄</option><option value='200'>50줄</option><option value='400'>100줄</option>"
510	} else {
511		var sv="<option value='16'>16줄</option><option value='40'>40줄</option><option value='120'>120줄</option><option value='200'>200줄</option><option value='400'>400줄</option>"
512	}
513
514	_ID("listsize").innerHTML=sv;
515
516	do_xsearch();
517});
518
519//선택제품 견적담기
520$("#btn_add").on("click", function() {
521	if(user_check_id=='') {
522		alert("로그인을 해야만 견적담기가 가능합니다");
523		return;
524	}
525	const obj=document.f;
526	const est_group=obj.est_group.value;
527
528	if(chk_blank(obj)==false) {
529		return;
530	}
531
532	var formData = $("#form").serialize();
533
534	$.ajax({
535		type : "POST",
536		url : "/product/x_est_add.asp",
537		cache : false,			
538		data : formData,
539		success:function(data, status, req) {	
540
541			if(data=='Y') {
542				alert("추가되었습니다");
543				do_quick_est(est_group);
544				
545				$("#quick_box .areabox").stop().animate({ "width" : "500px" }, 100 , function(){$(this).show()});
546				$("#quick_box .box").css("display" , "none");		
547				$("#quick_box .box_open").css("display" , "block");	
548			} else if(data=='NG') {
549				
550			} else {
551				alert(data);
552			}
553		},
554		error:function(req, status, error) {
555			alert(error);
556		}
557	});
558});
559
560//단일제품 견적담기,선택견적담기
561$(document).on("click", "a[name=btn_add_list],a[name=btn_list_move_est],a[name=btn_list_best_est],a[name=btn_move_history]", function() {
562	//console.log("단일 견적,선택견적담기");
563	var ans1=true;
564	if(ans1==true) {
565		if(user_check_id=='') {
566			alert("로그인을 해야만 견적담기가 가능합니다");
567			return;
568		}
569		var link_name=this.name;	
570
571		if(link_name=='btn_list_best_est' || link_name=='btn_move_history') { //퀵메뉴쪽
572			var obj=document.quick_form;	
573		} else {
574			var obj=document.f;	
575		}
576
577		//여러개담기
578		if(link_name=='btn_list_move_est' || link_name=='btn_list_best_est' || link_name=='btn_move_history') {
579			if(chk_blank(obj)==false) {
580				return;
581			}
582
583			var data_num=$(this).data("num");
584			//console.log("data_num="+data_num);
585			var est_group=data_num;
586			obj.est_group.value=data_num;
587			var total_data_num=$('input:checkbox[name=chk_idx]:checked').length;
588		} else {
589			const product_number=$(this).data("number");
590			var data_num=$(this).data("num");
591			//var est_ea=eval("obj.est_ea"+product_number+".value");
592			edu_add_price=$(this).data("price");
593			
594			obj.est_number.value=product_number;
595			var est_group=eval("obj.est_group"+product_number+".value");
596			var total_data_num=1;
597		}
598
599		if(link_name=='btn_list_best_est' || link_name=='btn_move_history') { //퀵메뉴쪽
600			var formData = $("#quick_form").serialize();
601		} else {
602			var formData = $("#form").serialize();
603		}
604
605		$.ajax({
606			type : "POST",
607			url : "/product/x_est_chk.asp",
608			cache : false,			
609			data : formData,
610			success:function(data, status, req) {	
611				//console.log("data="+data);
612				var chk_err_data='';
613				obj.chk_err_data.value='';
614				if(data=='Y') {
615					if(link_name=='btn_list_best_est' || link_name=='btn_move_history') { //퀵메뉴쪽
616						do_add_est_add_quick(est_group);
617					} else if(link_name=='btn_list_move_est') {
618						do_add_est_add_my(est_group);
619					} else {
620						do_add_est_add(est_group);			
621					}			
622
623					return;
624					
625				} else if(data=='NG') {
626
627				} else if(data=='NS') {
628					alert("재고수량이 부족합니다");
629				} else if(data=='ND') {
630					alert("해당상품이 존재하지 않습니다.\n관리자에게 문의해주세요");				
631				} else {
632					if (data != '')	{
633						
634						var chk_num=0;
635						var split_data=data.split("&*()");
636						var err_name=split_data[0];						
637						var err_data=split_data[1];						
638
639						if (err_data != '')	{
640
641							//console.log(err_data);
642							var split_err_data=err_data.split("!@#$");
643							var split_err_name=err_name.split("!@#$");
644							var data_num=parseInt(split_err_data.length)-1;
645							var name='';
646							var data='';
647
648							for(var i=0;i<data_num;i++) {
649								name=split_err_name[i];
650								data=split_err_data[i];
651
652								var ans=confirm(''+name+' 제품이 담겨있습니다.\n추가하시겠습니까?');
653								if(ans==false) { //추가안해요
654									chk_err_data=chk_err_data+data+",";
655
656									chk_num=parseInt(chk_num)+1;
657								}
658							}
659
660							if (chk_err_data != '')	{
661								chk_err_data=","+chk_err_data;
662								obj.chk_err_data.value=chk_err_data;
663							}
664						}
665					}
666
667					
668					//console.log("est_group:"+est_group);
669
670					//console.log("data_num="+data_num);
671					//console.log("chk_num="+chk_num);
672					//console.log("total_data_num="+total_data_num);
673
674					//전부다 중복되고 추가안하겠다 하면 해당 스크립트 미실행
675					if(chk_num != total_data_num) {
676						if(link_name=='btn_list_best_est' || link_name=='btn_move_history') { //퀵메뉴쪽
677							do_add_est_add_quick(est_group);
678						} else if(link_name=='btn_list_move_est') {
679							do_add_est_add_my(est_group);
680						} else {
681							do_add_est_add(est_group);	
682						}
683					} else {
684						if(link_name=='btn_list_best_est' || link_name=='btn_move_history') { //퀵메뉴쪽
685						} else {
686							$("input:checkbox[name='chk_idx']").prop("checked", false);
687						}
688					}
689				}
690			},
691			error:function(req, status, error) {
692				alert(error);
693			}
694		});
695	} else {
696		if(link_name=='btn_list_best_est' || link_name=='btn_move_history') { //퀵메뉴쪽
697		} else {
698			$("input:checkbox[name='chk_idx']").prop("checked", false);
699		}
700	}
701});
702
703var wb_click="n";
704var edu_add_price='';   // 교육자료몰 btn_add_list 클릭 시 가격 임시 저장 (다른 함수는 참조하지 않음)
705
706//견적함 담기
707function do_add_est_add(est_group) {
708	var formData = $("#form").serialize();
709
710	$.ajax({
711		type : "POST",
712		url : "/product/x_est_add.asp",
713		cache : false,			
714		data : formData,
715		success:function(data, status, req) {	
716			var result=data.substr(0,1);
717			var sp_data=data.split(":");
718			var sum_price=sp_data[1];
719			//console.log("add_est_add="+result);
720			//console.log("add_est_add="+sum_price);
721			if(result=='Y') {
722				wb_click="n";
723				//alert("추가되었습니다");
724				do_quickbox_open();
725				do_quick_est(est_group);
726				$("input:checkbox[name='chk_idx']").prop("checked", false); //체크박스해제
727				$("#c_est"+est_group).removeClass("bin");
728
729				 if(location.pathname.indexOf('product_list_edu.asp') !== -1 && edu_add_price !== undefined && edu_add_price !== '' && Number(edu_add_price) < 100000) {
730                    alert("10만원 이하 주문 시 배송비가 발생합니다.\n본 교육자료는 오렌지팜이 판매만 대행하는 상품으로,\n구매금액 10만원 이하 주문 건에는 별도의 배송비가 부과됩니다.");
731                }
732				
733			} else if(result=='NG') {
734				
735			} else if(result=='ND') {
736				alert("해당상품이 존재하지 않습니다.\n관리자에게 문의해주세요");				
737			} else {
738				console.log(result);
739			}
740		},
741		error:function(req, status, error) {
742			console.log(error);
743		}
744	});
745}
746
747//견적함 담기 (퀵메뉴 없는)
748function do_add_est_add_my(est_group) {
749	var formData = $("#form").serialize();
750
751	$.ajax({
752		type : "POST",
753		url : "/product/x_est_add.asp",
754		cache : false,			
755		data : formData,
756		success:function(data, status, req) {	
757			//console.log("add_est_add="+data);
758			if(data=='Y') {
759				wb_click="n";
760				alert("단종 및 품절제품은 제외하고 이동되었습니다");
761				$("input:checkbox[name='chk_idx']").prop("checked", false); //체크박스해제
762				$("#c_est"+est_group).removeClass("bin");
763				
764			} else if(data=='NG') {
765				
766			} else if(data=='ND') {
767				alert("해당상품이 존재하지 않습니다.\n관리자에게 문의해주세요");				
768			} else {
769				console.log(data);
770			}
771		},
772		error:function(req, status, error) {
773			alert(error);
774		}
775	});
776}
777
778//퀵메뉴쪽
779function do_add_est_add_quick(est_group) {
780	//console.log("est_group:"+est_group);
781	const obj=document.quick_form;
782	const page_type=obj.page_type.value;
783	var formData = $("#quick_form").serialize();
784
785	$.ajax({
786		type : "POST",
787		url : "/product/x_est_add.asp",
788		cache : false,			
789		data : formData,
790		success:function(data, status, req) {	
791			//console.log("add_est="+data);
792			if(data=='Y') {
793				wb_click="n";
794				alert("추가되었습니다");
795				if(page_type=='POPBEST') {
796					self.close();
797					opener.do_quickbox_open();
798					opener.do_quick_est(est_group);
799					opener.$("#c_est"+est_group).removeClass("bin");
800				} else {
801					do_quickbox_open();
802					do_quick_est(est_group);
803					$("#c_est"+est_group).removeClass("bin");
804				}
805				
806			} else if(data=='NG') {
807				
808			} else if(data=='ND') {
809				alert("해당상품이 존재하지 않습니다.\n관리자
809에게 문의해주세요");				
810			} else {
811				console.log(data);
812			}
813		},
814		error:function(req, status, error) {
815			alert(error);
816		}
817	});
818}
819
820//친구견적 추가
821function do_add_friend(et) {
822	const obj=document.quick_form;
823	obj.est_group.value=et;
824
825	var formData = $("#quick_form").serialize();
826
827	$.ajax({
828		type : "POST",
829		url : "/product/x_recomm_copy.asp",
830		cache : false,			
831		data : formData,
832		success:function(data, status, req) {	
833			if(data=='Y') {
834				document.getElementById("lbl_copy_est").innerHTML="견적복사";
835				//wb_click="n";
836				$("#c_est"+et).removeClass("bin");
837				alert("정상적으로 복사되었습니다");
838			}
839		},
840		beforeSend:function() {
841			document.getElementById("lbl_copy_est").innerHTML="복사중입니다. 조금만 기다려주세요";
842		},
843		error:function(req, status, error) {
844			alert(error);
845		}
846	});
847}
848
849//상세보기견적추가
850$(document).on("click", "#btn_add_est_view", function() {
851	if(user_check_id=='') {
852		alert("로그인을 해야만 견적담기가 가능합니다");
853		return;
854	}
855	//var ans1=confirm("견적담기를 하시겠습니까?");
856	//if(ans1==true) {
857		const obj=document.f2;
858
859		const product_number=$(this).data("number");
860		const est_group=eval("obj.est_group"+product_number+".value");
861		if(est_group=='') {
862			alert("견적함을 선택해주세요");
863			eval("obj.est_group"+product_number+".focus()");
864			return;
865		}
866		obj.est_number.value=product_number;
867		var total_data_num=1;
868
869		var formData = $("#form2").serialize();
870
871		$.ajax({
872			type : "POST",
873			url : "/product/x_est_chk.asp",
874			cache : false,			
875			data : formData,
876			success:function(data, status, req) {	
877				if(data=='Y') {
878					wb_click="n";
879					do_add_est_add2(est_group);			
880					return;
881				} else if(data=='NG') {
882					
883				} else if(data=='NS') {
884					alert("재고수량이 부족합니다");
885				} else if(data=='ND') {
886					alert("해당상품이 존재하지 않습니다.\n관리자에게 문의해주세요");				
887				} else {
888					var chk_err_data='';
889					if (data != '')	{
890							
891							var chk_num=0;
892							var split_data=data.split("&*()");
893							var err_name=split_data[0];						
894							var err_data=split_data[1];						
895
896							if (err_data != '')	{
897
898								//console.log(err_data);
899								var split_err_data=err_data.split("!@#$");
900								var split_err_name=err_name.split("!@#$");
901								var data_num=parseInt(split_err_data.length)-1;
902								var name='';
903								var data='';
904
905								for(var i=0;i<data_num;i++) {
906									name=split_err_name[i];
907									data=split_err_data[i];
908
909									var ans=confirm(''+name+' 제품이 담겨있습니다.\n추가하시겠습니까?');
910									if(ans==false) { //추가안해요
911										chk_err_data=chk_err_data+data+",";
912										chk_num=parseInt(chk_num)+1;
913									}
914								}
915
916								if (chk_err_data != '')	{
917									chk_err_data=","+chk_err_data;
918									obj.chk_err_data.value=chk_err_data;
919								}
920							}
921
922							if(chk_num != total_data_num) {
923								console.log("t");
924								do_add_est_add2(est_group);	
925							}
926						}
927				}
928			},
929			error:function(req, status, error) {
930				alert(error);
931			}
932		});
933	//}	 견적담기를 하시겠습니까 문의
934});
935
936function do_add_est_add2(est_group) {
937	var formData = $("#form2").serialize();
938
939	$.ajax({
940		type : "POST",
941		url : "/product/x_est_add.asp",
942		cache : false,			
943		data : formData,
944		success:function(data, status, req) {	
945
946			//if(data=='Y') {
947			if (data.startsWith("Y")) {
948				//alert("추가되었습니다");
949				
950				do_quickbox_open();
951				do_quick_est(est_group);
952				//$("#quick_box .areabox").stop().animate({ "width" : "500px" }, 100 , function(){$(this).show()});
953				//$("#quick_box .box").css("display" , "none");		
954				//$("#quick_box .box_open").css("display" , "block");
955				
956				$("#c_est"+est_group).removeClass("bin");
957			} else if(data=='NG') {
958				
959			} else {
960				alert(data);
961			}
962		},
963		error:function(req, status, error) {
964			alert(error);
965		}
966	});
967}
968
969//수량조절
970$(document).on("click", "a[name=est_icon]", function() {
971	const icon_type=$(this).data("type");
972	const data_number = $(this).data("number");
973	const row = $(this).data("num");
974	const obj=document.f;
975	let est_ea=eval("obj.est_ea"+data_number+".value");
976
977	//console.log(est_ea);
978
979	if(icon_type=='minus') {
980		est_ea=parseInt(est_ea)-1;
981
982		if(est_ea<=0) {
983			est_ea=1;
984		}
985	} else if(icon_type=='add') {
986		est_ea=parseInt(est_ea)+1;
987	}
988
989	eval("obj.est_ea"+data_number+".value="+est_ea);
990});
991
992//수량을 직접 입력
993$(document).on("keyup", ".est_num", function() {
994	const obj=document.f;
995	const est_ea=this.value;
996
997	if(isNaN(est_ea)) {
998		alert("숫자형태로 입력해주세요");
999		this.value=1;
1000		return;
1001	}
1002
1003	if(est_ea!='' && est_ea < 1) {
1004		alert("수량을 1개이상 입력해주세요");
1005		this.value=1;
1006		return;
1007	}
1008});
1009
1010$(document).on("click", "a[name=est_view_icon]", function() {
1011	const icon_type=$(this).data("type");
1012	const data_number = $(this).data("number");
1013	const obj=document.f2;
1014	let est_price=obj.est_price.value;
1015	let est_ea=eval("obj.est_ea"+data_number+".value");
1016
1017	if(icon_type=='minus') {
1018		est_ea=parseInt(est_ea)-1;
1019
1020		if(est_ea<=0) {
1021			est_ea=1;
1022		}
1023	} else if(icon_type=='add') {
1024		est_ea=parseInt(est_ea)+1;
1025	}
1026
1027	eval("obj.est_ea"+data_number+".value="+est_ea);
1028	let est_total=parseInt(est_ea)*parseInt(est_price);
1029	_ID("div_view_total").innerHTML=formatnumber(est_total);
1030});
1031
1032
1033$(document).on("keyup", "#txt_view_ea", function() {
1034	const data_number = $(this).data("number");
1035	const obj=document.f2;
1036	let est_price=obj.est_price.value;
1037	let est_ea=this.value;
1038
1039	
1040	if(est_ea>0) {
1041	
1042		let est_total=parseInt(est_ea)*parseInt(est_price);
1043		_ID("div_view_total").innerHTML=formatnumber(est_total);
1044	}
1045});
1046
1047//한줄평등록 버튼
1048$(document).on("click", "#btn_after", function() {
1049	if(user_check_id=='') {
1050		alert("로그인을 해야만 한줄평등록이 가능합니다");
1051		return;
1052	}
1053	const obj=document.f2;
1054	const number=obj.number.value;
1055
1056	window.open('/product/product_after.asp?p_number='+number,'', 'width=600,height=500,scrollbars=yes');
1057});
1058
1059//상품문의등록 버튼
1060$(document).on("click", "#btn_qna", function() {
1061	if(user_check_id=='') {
1062		alert("로그인을 해야만 문의가 가능합니다");
1063		return;
1064	}
1065	const obj=document.f2;
1066	const number=obj.number.value;
1067
1068	window.open('/product/product_qna.asp?p_number='+number,'', 'width=600,height=500,scrollbars=yes');
1069});
1070
1071function do_review() {
1072	if(user_check_id=='') {
1073		alert("로그인을 해야만 문의가 가능합니다");
1074		return;
1075	}
1076	const obj=document.f2;
1077	const number=obj.number.value;
1078
1079	const param="number="+number;
1080
1081	$.ajax({
1082		url:'/product/x_review.asp',
1083		data:param,
1084		type:'post',
1085		success:function(data, status, req) {		
1086						
1087		},
1088		error:function(req, status, error) {
1089			alert(error);
1090		}
1091	});
1092}
1093
1094$(document).on("click", "a[name=after_info]", function() {
1095	const idx=$(this).data("idx");
1096	const class_name=document.getElementById("after_content_"+idx).className;
1097
1098	if(class_name=="over") {
1099		document.getElementById("after_content_"+idx).className="box";	
1100	} else {
1101		document.getElementById("after_content_"+idx).className="over";	
1102	}
1103});
1104
1105$(document).on("click", "a[name=qna_info]", function() {
1106	const idx=$(this).data("idx");
1107	const class_name=document.getElementById("qna_content_"+idx).className;
1108
1109	if(class_name=="over") {
1110		document.getElementById("qna_content_"+idx).className="box";	
1111	} else {
1112		document.getElementById("qna_content_"+idx).className="over";	
1113	}
1114});
1115
1116$("select[name=cat1]").on("change", function() {
1117	do_search_prd();
1118});
1119
1120function fnMove(seq){
1121	$('.tap_product li').removeClass("on");
1122	$('.fnv' + seq ).addClass("on");
1123} 
1124
1125
1126$(document).on("click", "ul.product_stap li", function() {
1127	var activeTab = $(this).attr('data-tab');
1128	$('ul.product_stap li').removeClass('on');
1129	$('.detail_info').removeClass('on');
1130	$(this).addClass('on');
1131
1132	if (activeTab==='')	{
1133		$('.detail_info').addClass('on');
1134	}
1135	else{
1136		$('#' + activeTab).addClass('on');
1137	}
1138});
1139
1140
1141function do_theme(cat) {
1142	const obj=document.f;
1143
1144	const param="cat="+cat; //테마카테고리 bc
1145
1146	$.ajax({
1147		url:'/product/x_theme.asp',
1148		data:param,
1149		type:'post',
1150		success:function(data, status, req) {
1151			//console.log(data);
1152			_ID("div_body").innerHTML=data;		
1153		},
1154		error:function(req, status, error) {
1155			alert(error);
1156		}
1157	});
1158}
1159
1160$("#listsize").on("click", function() {
1161	console.log("listsize");
1162	do_xsearch();
1163});
1164
1165function do_view_img(img) {
1166	_ID("div_view_img").src = img;
1167}
1168
1169
1170
1171
1172
1173
1174
1175
1176/*********** 유저추천 ****************/
1177function do_recomm(btnRecomm, num) {
1178   var user_check_id = '<%=user_check_id%>';
1179
1180    if (user_check_id == '') {
1181        var ans = confirm("추천은 로그인이 필요합니다\n로그인 페이지로 이동하시겠습니까?");
1182        if (ans == true) {
1183            location.href = '/member/login.asp?refer_url=<%=referchr(now_url)%>';
1184        }
1185        return;
1186    }
1187
1188    var param = "num=" + num;
1189
1190    $.ajax({
1191        url: '/product/x_rec_pro.asp',
1192        data: param,
1193        type: 'post',
1194        success: function(data, status, req) {
1195            if (btnRecomm.classList.contains('on')) {
1196                var cancel = confirm("이미 추천을 하셨습니다.\n추천을 취소하시겠습니까?");
1197                if (cancel) {
1198                    // 취소 처리
1199                    $.ajax({
1200                        url: '/product/x_rec_cancle.asp', // 추천 취소를 위한 URL						
1201                        data: param,
1202                        type: 'post',
1203                        success: function(cancelData) {
1204                            if (cancelData == 'success') {
1205                                btnRecomm.classList.remove('on'); // 'on' 클래스 제거
1206                                alert("추천이 취소되었습니다.");
1207                            }else {
1208								console.error("쿼리 실패:", cancelData); // 실패 시 오류 메시지 출력
1209							}
1210                        }
1211                    });
1212                }
1213            } else {
1214                btnRecomm.classList.add('on'); // 'on' 클래스 추가
1215                //document.getElementById("div_recomm").innerHTML = data; // 필요시 주석 해제
1216            }
1217        },
1218        error: function(req, status, error) {
1219            alert(error);
1220        }
1221    });
1222}
1223//-->

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.