PageSourceSearch

https://taeyoung.com/_lib/functions.js?ver=1791144757

js taeyoung.com collected 2026-10-04 11:12:48 UTC 31,273 bytes, 1,061 lines download raw bytes

1$(document).ready(function(){
2	$("body").on("click", ".remove-btn", function(e){
3		$(this).parent().remove();
4	});
5
6	$("body").on("change", ".file-box input[type='file']", function(e){
7		var idx = $(".file-box input[type='file']").index($(this));
8		var tit = $(this).val();
9		$(".upload-name").eq(idx).val(tit)
10	});
11
12	$('.amount .plus').click(function(){
13		var n = $('.amount .plus').index(this);
14		var qty = $(".amount .qty:eq("+n+")").val();
15		qty = $(".amount .qty:eq("+n+")").val(qty*1+1);
16		$(".amount .qty:eq("+n+")").change();
17	});
18	$('.amount .minus').click(function(){
19		var n = $('.amount .minus').index(this);
20		var qty = $(".amount .qty:eq("+n+")").val();
21		if (qty == 1) {
22			$(".amount .qty:eq("+n+")").val("1");
23		} else {
24			qty = $(".amount .qty:eq("+n+")").val(qty*1-1);
25		}
26		$(".amount .qty:eq("+n+")").change();
27	});
28
29	$(document).on("change",".fileField",function(){
30		$(this).parent().find(".fileFieldChk").prop("checked",true);
31	});
32
33	$(document).on("change",".bbsFileField",function(){
34		$(this).parent().parent().parent().find(".bbsFileFieldChk").prop("checked",true);
35	});
36
37	$(document).on("change keyup input",".onlyNumber",function(){
38		var x = $(this).val();
39		x =x.replace(/[^0-9]/gi,"");
40		var restr = x.toString();
41		$(this).val(restr)
42	});
43
44	$(document).on("change keyup input",".onlyPer",function(){
45		var str= "" + $(this).val().replace(/,/gi,''); // 콤마 제거 
46		str = str.replace(/[^0-9-.]/gi,"");
47		var regx = new RegExp(/(-?\d+)(\d{3})/); 
48		var bExists = str.indexOf(".",0); 
49		var strArr = str.split('.'); 
50
51		if (bExists > -1){
52			$(this).val(strArr[0] + "." + strArr[1]);
53		}else{
54			$(this).val(strArr[0]);
55		} 
56	});
57
58	$(document).on("change keyup input",".onlyPrice",function(){
59		var str= "" + $(this).val().replace(/,/gi,''); // 콤마 제거 
60		str = str.replace(/[^0-9-.]/gi,"");
61		var regx = new RegExp(/(-?\d+)(\d{3})/); 
62		var bExists = str.indexOf(".",0); 
63		var strArr = str.split('.'); 
64		while(regx.test(strArr[0])){ 
65			strArr[0] = strArr[0].replace(regx,"$1,$2"); 
66		} 
67		if (bExists > -1){
68			$(this).val(strArr[0] + "." + strArr[1]);
69		}else{
70			$(this).val(strArr[0]);
71		} 
72	});
73
74	$("body").on("change", ".file_wrap>input[type=file]", function(){
75		var idx = $(".file_wrap>input[type=file]").index($(this));
76		var val = this.value;
77		$(".file_route").eq(idx).html(val);
78	});
79
80	$("body").on("click", ".file_route", function(){
81		var idx = $(".file_route").index($(this));
82		var val = "";
83		$(".file_wrap>input[type=file]").eq(idx).val("");
84		$(".file_route").eq(idx).html(val);
85	});
86
87	$("#HKeditorContent img").each(function(){
88		$(this).css("max-width","100%")
89	});
90
91	$(document).on("change",".eDomailSelector",function(e){
92		var val = $(this).val();
93		var obj = $(this).parents().find(".eDomain");
94		if (val==""){
95			obj.val("");
96			obj.focus();
97		}else{
98			obj.val(val);
99		}
100	});
101});
102
103/*비동기 기본 셋팅*/
104$.ajaxSetup({
105	type: "POST",
106	async: true,
107	dataType:"html",
108	beforeSend : function(){
109		popupLoadingOpen();
110	},
111	success:function() {
112		layerModalClose();
113	},
114	error:function(request,status,error) {
115		alert("code:"+request.status+"\n"+"message:"+request.responseText+"\n"+"error:"+error);
116		//alert("데이터 처리중 오류가 발생했습니다.\n다시 시도해 주세요.");
117		layerModalClose();
118	}
119});
120
121function pagePrint(){
122	var bodyCon = $("#printArea").html();
123    var W = 600;
124    var H = 500;
125
126	var features = "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=" 
126+ W + ",height=" + H + ",left=0,top=0";
127	var PrintPage = window.open("/board/printContent.asp","print",features);
128}
129
130/* 심플모달 시작 */
131function layerModalOpen(data){
132	var obj = null;
133
134	if (typeof(data) == "string") {
135		if (!document.getElementById("simplemodal_div")) {
136			$("<div>", {"id": "simplemodal_div"})
137				.html("<span id='simplemodal_span'></span>")
138				.appendTo(document.body)
139				.hide();
140		}
141
142		obj = $("#simplemodal_div").find("#simplemodal_span").html(data);
143	} else {
144		obj = data;
145	}
146	$(obj).modal({
147		zIndex: 20000,
148		overlayId: "simplemodal-overlay",
149		containerId: "simplemodal-container",
150		overlayClose:false,
151		autoResize:true,
152		escClose: false,
153		autoPosition:true,
154		close : false
155	});
156}
157
158/* 팝업로딩 */
159function popupLoadingOpen(){
160	layerModalOpen("<div class=\"loading\"><img src=\"/images/loading.gif\" alt=\"Loading\"></div>");
161	$("#simplemodal-overlay").css("background","none");
162}
163
164/* 심플모달 닫기 */
165function layerModalClose() {
166	$("#simplemodal_div, #loading_div").remove();
167	$.modal.close();
168}
169
170/* 레이어 팝업 띄우기 */
171function fnLayerPopupOpen(data){
172	if (!document.getElementById("layerPopupWrap")) {
173		$("<div>", {"id": "layerPopupWrap"}).appendTo(document.body);
174	}
175	$("#layerPopupWrap").html(data).hide();
176
177	var $layerWrap = $(".popWrap");
178	var winW = $(document).width();
179	var winH = $(document).height();
180
181	$layerWrap.prepend('<div class="dimmed"></div>');
182	$(".dimmed").css({"width": winW, "height": winH});
183
184	$("#layerPopupWrap").show();
185	if ( $layerWrap.is(":visible") ) {
186		var popH= ($('.popCon').height()+42)/2;
187		var popW= $('.popCon').width()/2;
188		$(".popCon").css({
189			"top": '50%',
190			"left" : '50%',
191			"margin-top":-popH,
192			"margin-left":-popW
193		});
194	}
195	$layerWrap.find(".btnClose, .btnClose2").on('click', function(e) {
196		e.preventDefault();
197		fnLayerPopupClose();
198	});
199	layerModalClose();
200}
201
202/* 레이어 팝업 닫기 */
203function fnLayerPopupClose(){
204	$(".popWrap").hide();
205	$("#layerPopupWrap").remove();
206}
207
208function isValidEmail( string1, string2 ) {
209	var message = "";
210
211	if( string1 == "" || string2 == "" ) {
212		message = "이메일을 입력해 주시기 바랍니다.";
213		return message;
214	}
215	if( isSpace( string1 + string2 ) ) {
216		messages = "이메일 주소를 빈공간없이 넣어주시기 바랍니다.";
217		return message;
218	}
219	if( -1 == string2.indexOf('.') ) {
220		message = "이메일 형식이 잘못 되었습니다.";
221		return message;
222	}
223	var isEmail = /^[a-zA-Z0-9_+.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,4}$/;
224	if( !isEmail.test(string1 + '@' + string2) ) {
225		message = "이메일 형식이 잘못 되었습니다.";
226		return message;
227	}
228	return message;
229}
230
231function isValidEmailOnce(string) {
232	var message = "";
233
234	if( string == "" ) {
235		message = "이메일을 입력해 주시기 바랍니다.";
236		return message;
237	}
238	if( isSpace( string ) ) {
239		messages = "이메일 주소를 빈공간없이 넣어주시기 바랍니다.";
240		return message;
241	}
242	if( -1 == string.indexOf('.') ) {
243		message = "이메일 형식이 잘못 되었습니다.";
244		return message;
245	}
246	var isEmail = /^[a-zA-Z0-9_+.-]+@([a-zA-Z0-9-]+\.)+[a-zA-Z]{2,4}$/;
247	if( !isEmail.test(string) ) {
248		message = "이메일 형식이 잘못 되었습니다.";
249		return message;
250	}
251	return message;
252}
253
254function uemailListChange(emailDomain){
255	if (emailDomain != "") {
256		$('#email2').val(emailDomain);
257		$('#email2').attr('readonly', true);
258	} else {
259		$('#email2').attr('readonly', false);
260		$('#email2').val('');
261	}
262}
263
264function isSpace( string ) {
265	if(string.search(/\s/) != -1) {
266		return true;
267	} else {
268		return false;
269	}
270}
271
272/* 숫자키만 입력 받을수 있게 설정 */
273function onlyNumber(){
274	$(":input").filter(".onlyNumber")
275
276	.bind("cut copy paste", function(e){
277		 e.preventDefault();
278	}).keypress(function(event){
279		if (event.which && (event.which < 48 || event.which > 57)) {
280			//alert("숫자만 입력 가능합니다.");
281			event.preventDefault();
282		}
283	}).css("imeMode", "disabled")
284}
285
286function openVideo(vodurl){
287	params="vodurl="+vodurl;
288	jQuery.ajax({type:"POST", url:'/sub/ajax_VideoView.asp',data:params,dataType:"html",
289		success:function(msg){
290			document.getElementById("layerVideoDiv").style.display="inline";
291			document.getElementById("listDiv").innerHTML=msg;
292		}
293	});
294}
295function closeVideo(){
296	document.getElementById("layerVideoDiv").style.display="none";
297}
298
299function getSubCate(sort,val){
300	var params = "sort="+sort+"&catecode="+val;
301	$.ajax({type:"POST", url:"/_lib/subCateList.asp",data:params,dataType:"script"
302	}).done(function(data){
303
304	});
305}
306function goProductDetail(){
307	var proidx = $("#sercate3").val()
308	if (proidx==""){
309		alert("3차 분류까지 선택해주세요.");
310		return;
311	}
312
313	location.href="/product/product_view.asp?idx="+proidx;
314}
315function MainItemSearchGo(frm){
316	if ( frm.itemsearchStr.value.length==0 || frm.itemsearchStr.value.length<1 ){
317
318		if (langCode=="kor"){
319			alert("검색어를 입력해주세요.");
320		}else{
321			alert("Please enter your search term.");
322		}
323		frm.itemsearchStr.focus();
324		return ;
325	}
326	frm.submit();
327}
328
329function viewTempPopup(actDiv,temCode,idx){
330	var params = "idx="+idx;
331
332	if(temCode==1){
333		pageName="/library/popskin/pop1.asp"
334	}else if(temCode==2){
335		pageName="/library/popskin/pop2.asp"
336	}else if(temCode==3){
337		pageName="/library/popskin/pop3.asp"
338	}else if(temCode==4){
339		pageName="/library/popskin/pop4.asp"
340	}else if(temCode==5){
341		pageName="/library/popskin/pop5.asp"
342	}else if(temCode==6){
343		pageName="/library/popskin/pop6.asp"
344	}else if(temCode==7){
345		pageName="/library/popskin/pop7.asp"
346	}else if(temCode==8){
347		pageName="/library/popskin/pop8.asp"
348	}else if(temCode==9){
349		pageName="/library/popskin/pop9.asp"
350	}else if(temCode==10){
351		pageName="/library/popskin/pop10.asp"
352	}
353
354	$.ajax({type:"POST", url:pageName,data:params,dataType:"html",
355		success:function(msg){
356			document.getElementById(actDiv).innerHTML=msg;
357		}
358	});
359}
360
361function numOnMask(me){
362	if (event.keyCode<48||event.keyCode>57){//숫자외금지
363		event.returnValue=false;
364	}
365	var tmpH
366	if(me.charAt(0)=="-"){//음수가 들어왔을때 '-'를 빼고적용되게..
367		tmpH=me.substring(0,1);
368		me=me.substring(1,me.length);
369	} //me.indexOf('-')
370	if(me.length > 3){
371		var c=0;
372		var myArray=new Array();
373		for(var i=me.length;i>0;i=i-3){
374			myArray[c++]=me.substring(i-3,i);
375		}
376		myArray.reverse();
377		me=myArray.join(",");
378	}
379	if(tmpH){
380		me=tmpH+me;
381	}
382	return me;
383}
384function numOffMask(me){
385	var tmp=me.split(",");
386	tmp=tmp.join("");
387
388	return tmp;
389}
390function check_value(me){
391	if(me.value!="-"){
392		var myStr=numOffMask(me.value);
393
394		if (isNaN(myStr)) {
395			//alert("숫자만 입력할 수 있습니다.");
396			me.value='';
397		}else{
398			me.value=numOnMask(myStr);
399		}
400	}
401	//me.focus();
402}
403
404function autotab(field){
405	 if (field.getAttribute&&field.value.length==field.getAttribute("maxlength")) {
406		var i;
407		for (i = 0; i < field.form.elements.length; i++)
408			if (field == field.form.elements[i])
409				break;
410		i = (i + 1) % field.form.elements.length;
411		field.form.elements[i].focus();
412		return false;
413	}
414	else
415	return true;
416}
417
418function jumin_check(userNo1,userNo2){
419	a = Array(6);
420	b = Array(7);
421	var f=document.pageForm;
422	var num1, num2, total, tot;
423
424	if(userNo1.length==6 && userNo2.length==7){
425		num1=userNo1;
426		num2=userNo2;
427
428		for(var i=0; i<6; i++){
429			a[i]=parseInt(num1.charAt(i));
430		}
431
432		for(var j=0; j<7; j++){
433			b[j]=parseInt(num2.charAt(j));
434		}
435
436		total = (a[0]*2) + (a[1]*3) + (a[2]*4) + (a[3]*5) + (a[4]*6) + (a[5]*7) + (b[0]*8) + (b[1]*9) + (b[2]*2) + (b[3]*3) + (b[4]*4) + (b[5]*5);
437		tot = 11 - (total % 11);
438		if(tot==11){
439			tot = 1;
440		}else if(tot==10){
441			tot = 0;
442		}
443
444		if(b[6]!=tot){
445			alert("주민번호가 올바르지않습니다.");
446			return(false);
447		}return(true);
448	}else{
449		alert("주민등록번호를 올바로 입력하세요.");
450		return(false);
451	}
452}
453
454function closeLayer(obj){
455	obj.style.visibility='hidden';
456}
457function closetoLayer(obj){
458	setCookie( obj, "done" , 1 );
459	document.all[obj].style.visibility = "hidden";
460}
461
462function openLayer(obj){
463	obj.style.visibility='visible';
464}
465function opentoLayer(obj){
466	setCookie( obj, "done" , 1 );
467	document.all[obj].style.visibility = "visible";
468}
469
470function setCookie( name, value, expiredays ) {
471	var todayDate = new Date();   
472	todayDate = new Date(parseInt(todayDate.getTime() / 86400000) * 86400000 + 54000000);  
473	if ( todayDate > new Date() ){  
474		expiredays = expiredays - 1;  
475	}  
476	todayDate.setDate( todayDate.getDate() + expiredays );   
477	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";"   
478}
479
480function getCookie( name ){
481	var nameOfCookie = name + "=";
482	var x = 0;
483	while ( x <= document.cookie.length ) {
484		var y = (x+nameOfCookie.length);
485		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
486			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length;
487			return unescape( document.cookie.substring( y, endOfCookie ) );
488		}
489		x = document.cookie.indexOf( " ", x ) + 1;
490		if ( x == 0 ) break;
491	}
492	return "";
493}
494
495function getFileExtension( filePath ){
496	var extension = "";
497	var lastIndex = -1;
498		lastIndex = filePath.lastIndexOf('.');
499
500	if ( lastIndex != -1 ){
501		extension = filePath.substring( lastIndex+1, filePath.len );
502	} else{
503		extension = "";
504	}
505		return extension;
506}
507
508function uploadImg_check( value,msg,sort ){
509	var src = getFileExtension(value);
510
511	if(sort==1 && value==""){return true;}
512	if ( src == ""){
513		alert(msg);
514		return false;
515	} else if ( !((src.toLowerCase() == "gif") || (src.toLowerCase() == "jpg") || (src.toLowerCase() == "jpeg") || (src.toLowerCase() == "png")) ) {
516		alert('gif,jpg,png 파일만 업로드 하실 수 있습니다.');
517		return false;
518	}else{return true;}
519}
520
521function uploadImg_check_JPG( value,msg,sort ){
522	var src = getFileExtension(value);
523
524	if(sort==1 && value==""){return true;}
525	if ( src == ""){
526		alert(msg);
527		return false;
528	} else if ( !((src.toLowerCase() == "jpg") || (src.toLowerCase() == "jpeg")) ) {
529		alert('jpg 파일만 업로드 하실 수 있습니다.');
530		return false;
531	}else{return true;}
532}
533
534function uploadFlvImg_check( value,msg,sort ){
535	var src = getFileExtension(value);
536
537	if(sort==1 && value==""){return true;}
538	if ( src == ""){
539		alert(msg);
540		return false;
541	} else if ( !((src.toLowerCase() == "flv")) ) {
542		alert('플래쉬동영상 파일만 업로드 하실 수 있습니다.');
543		return false;
544	}else{return true;}
545}
546
547function popOpen(Width,Height,idx,sTop,sLeft,langsort) {
548	if( getCookie( "pop"+idx ) != "done" ){
549		var Option="left="+sLeft+",top="+sTop+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width="+Width+", height="+parseInt(Height+21);
550		window.open("/popup.asp?idx="+idx,"pop"+idx,Option);
551	}
552}
553
554function mainLoginSend(form) {
555	if(form.userid.value=="") {
556		alert("아이디를 입력해 주십시오.");
557		form.userid.focus();
558		return;
559	}
560	if(form.passwd.value=="") {
561		alert("패스워드를 입력해 주십시오.");
562		form.passwd.focus();
563		return;
564	}
565	form.submit();
566}
567
568function mainLoginInputSendit(form) {
569	if(event.keyCode==13) {
570		mainLoginSend(form);
571	}
572}
573
574function zipcodeck(zip,addr1,addr2) {
575	new daum.Postcode({
576		oncomplete: function(data) {
577			// 팝업에서 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
578
579			// 각 주소의 노출 규칙에 따라 주소를 조합한다.
580			// 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
581			var fullAddr = ''; // 최종 주소 변수
582			var extraAddr = ''; // 조합형 주소 변수
583
584			// 사용자가 선택한 주소 타입에 따라 해당 주소 값을 가져온다.
585			if (data.userSelectedType === 'R') { // 사용자가 도로명 주소를 선택했을 경우
586				fullAddr = data.roadAddress;
587
588			} else { // 사용자가 지번 주소를 선택했을 경우(J)
589				fullAddr = data.jibunAddress;
590			}
591
592			// 사용자가 선택한 주소가 도로명 타입일때 조합한다.
593			if(data.userSelectedType === 'R'){
594				//법정동명이 있을 경우 추가한다.
595				if(data.bname !== ''){
596					extraAddr += data.bname;
597				}
598				// 건물명이 있을 경우 추가한다.
599				if(data.buildingName !== ''){
600					extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName);
601				}
602				// 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다.
603				fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
604			}
605
606			// 우편번호와 주소 정보를 해당 필드에 넣는다.
607			document.getElementById(zip).value = data.zonecode; //5자리 새우편번호 사용
608			document.getElementById(addr1).value = fullAddr;
609
610			// 커서를 상세주소 필드로 이동한다.
611			document.getElementById(addr2).focus();
612		}
613	}).open();
614}
615
616function zipcodeck_getLat(zip,addr1,addr2,jibunaddr1) {
617	new daum.Postcode({
618		oncomplete: function(data) {
619			var fullAddr = '';
620			var fullAddrJiBun = '';
621			var extraAddr = '';
622
623			fullAddr = data.roadAddress;
624			fullAddrJiBun = data.jibunAddress;
625
626			if(data.userSelectedType === 'R'){
627				if(data.bname !== ''){
628					extraAddr += data.bname;
629				}
630				if(data.buildingName !== ''){
631					extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName);
632				}
633				//fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
634			}
635
636			//좌표 GET////////////////
637			var geocoder = new daum.maps.services.Geocoder();						// 주소-좌표 변환 객체를 생성합니다
638
639			geocoder.addressSearch(fullAddr, function(result, status) {				// 주소로 좌표를 검색합니다
640				if (status === daum.maps.services.Status.OK) {
641					//var coords = new daum.maps.LatLng(result[0].y, result[0].x);
642					$("#ncoord_x").val(result[0].y);
643					$("#ncoord_y").val(result[0].x);
644				}else{
645					alert("위/경도 변환에 실패했습니다.\n위/경도가 입력되지 않으면 주문 및 매장 검색이 되지 않습니다.")
646				}
647			});
648			//좌표 GET////////////////
649
650			document.getElementById(zip).value = data.zonecode; //5자리 새우편번호 사용
651			document.getElementById(addr1).value = fullAddr;
652			document.getElementById(addr2).focus();
653			//document.getElementById(jibunaddr1).value = fullAddrJiBun;
654		}
655	}).open();
656}
657
658function itemsearch(){
659	if(document.itemshform.searchstr.value==""){
660		alert("검색하실 제품 단어를 입력하세요.");
661		document.itemshform.searchstr.focus();
662		return;
663	}document.itemshform.submit();
664}
665
666function openModal(width,height,fileUrl,scroll){
667	var OpenFile=fileUrl;
668	var ReturnValue=window.showModalDialog(OpenFile,'','scroll:'+scroll+'; help:no; center:yes; status:no; dialogWidth:'+width+'px; dialogHeight:'+height+'px');
669	if(ReturnValue==1){
670		return true;
671	}
672}
673
674function openWindow(Width,Height,Url,winname,scroll) {
675	var winPosLeft = (screen.width - Width) / 2; // 새창 Y 좌표
676	var winPosTop = (screen.height - Height) / 2; // 새창 X 좌표
677
678	var Option="top="+winPosTop+",left="+winPosLeft+", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+scroll+", resizable=no,width="+Width+", height="+Height;
679	obj = window.open(Url,winname,Option);
680	obj.focus();
681}
682
683function login(rUrl){
684	val = confirm("회원전용 컨텐츠입니다.\n로그인 페이지로 이동하시겠습니까?")
685	if (val){
686		location.href="../member/login.asp?returnURL="+rUrl
687	}
688}
689
690function loginConfirm(msg, rUrl){
691	val = confirm(msg)
692	if (val){
693		location.href="../member/login.asp?returnURL="+rUrl
694	}
695}
696
697function downChk(){
698	alert("다운로드 권한이 없습니다.\n확인후 다시시도해주세요.");
699	return;
700}
701
702function inputSendit(thisform) {
703	if(event.keyCode==13) {
704		thisform.submit();
705	}
706}
707
708function formatNumber(v1,v2){
709	var str=new Array(); //콤마스트링을 조합할 배열
710	v1=String(v1); //숫자를 스트링으로 변환
711	for(var i=1;i<=v1.length;i++){ //숫자의 길이만큼 반복
712		if(i%v2) str[v1.length-i]=v1.charAt(v1.length-i); //자리수가 아니면 숫자만삽입
713		else  str[v1.length-i]=','+v1.charAt(v1.length-i); //자리수 이면 콤마까지 삽입
714	}
715	return str.join('').replace(/^,/,''); //스트링을 조합하여 반환
716}
717
718function regularExp(Str,Patten){
719	var chk
720	if(Patten=="hangle"){chk=/[^ ㄱ-힣]/;}		// 한글,공백 허용
721	else if(Patten=="charcode"){chk=/[^ \wㄱ-힣]/}	// 한영문자,숫자,공백,_ 허용
722	else if(Patten=="intcode"){chk=/[^\d-]/;}	// 숫자,- 허용
723	else{chk=Patten}
724	return chk.test(Str);
725}
726
727function OpenWin_Upload() {
728	window.open("../TextEditor/fileupload.asp","FileUpload","scrollbars=yes,height=470,width=720,top=20,left=50");
729}
730
731function setCookie( name, value, expiredays ){
732  var endDate = new Date();
733  endDate.setDate( endDate.getDate()+ expiredays );
734  document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + endDate.toGMTString() + ";"
735}
736
737function get_Cookie( name ){
738    var nameOfCookie = name + "=";
739    var x = 0;
740    while ( x <= document.cookie.length ){
741        var y = (x+nameOfCookie.length);
742        if ( document.cookie.substring( x, y ) == nameOfCookie ){
743            if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
744                endOfCookie = document.cookie.length;
745            return unescape( document.cookie.substring( y, endOfCookie ) );
746        }
747        x = document.cookie.indexOf( " ", x ) + 1;
748        if ( x == 0 ) break;
749    }
750    return "";
751}
752
753function getCookie( name ){
754	var nameOfCookie = name + "=";
755	var x = 0;
756	while ( x <= document.cookie.length ) {
757		var y = (x+nameOfCookie.length);
758		if ( document.cookie.substring( x, y ) == nameOfCookie ) {
759			if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length;
760			return unescape( document.cookie.substring( y, endOfCookie ) );
761		}
762		x = document.cookie.indexOf( " ", x ) + 1;
763		if ( x == 0 ) break;
764	}
765	return "";
766}
767
768function changeMenu(index){
769	if(index==0){
770		document.all.MenuTable1.style.display='block';
771		document.all.MenuTable2.style.display='none';
772		setCookie( "menuSort", 0 , 1);
773	}else{
774		document.all.MenuTable1.style.display='none';
775		document.all.MenuTable2.style.display='block';
776		setCookie( "menuSort", 1 , 1);
777	}
778}
779
780function vodView(title,url){
781	var Option="top=0, left=0, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars="+scroll+", resizable=no,width=400, height=300";
782	window.open('/player/player.asp?title='+title+'&ViewFileUrl='+url,'player',Option);
783}
784
785function addRowFront() {
786	var html="";
787
788	var cnt = $("input[name=files]").length+1;
789
790	html = html + "<div style='padding-top:3px;'>"
791	html = html + "	<span class=\"file_wrap\">"
792	html = html + "		<input type=\"file\" name='files' onchange=\"javascript:document.getElementById('file_route"+cnt+"').value=this.value\" />"
793	html = html + "	</span>"
794	html = html + "	<input type=\"text\" id=\"file_route"+cnt+"\" style=\"width:50%;\" readonly=\"readonly\" disabled=\"disabled\" title=\"첨부된 파일경로\" />"
795	html = html + "	<input type='hidden' name='filedel_idx' value='0'>"
796	html = html + "</div>"
797
798	$("#attFiles").append(html);
799}
800function addRow_Front() {
801	var fileAddTag = "";
802
803	boxLength = $("#fileArea .file-box").length
804
805	fileAddTag = fileAddTag + "<div class=\"file-box\">"
806	fileAddTag = fileAddTag + "	<a href=\"javascript:;\" class=\"remove-btn\">-</a>"
807	//fileAddTag = fileAddTag + "	<input class=\"upload-name\" placeholder=\"최대 4MB 첨부 가능\" disabled=\"disabled\">"
808	fileAddTag = fileAddTag + "	<input class=\"upload-name\" disabled=\"disabled\">"
809	fileAddTag = fileAddTag + "	<label for=\"ex_filename"+boxLength+"\">파일찾기</label>"
810	fileAddTag = fileAddTag + "	<input type=\"file\" id=\"ex_filename"+boxLength+"\" class=\"upload-hidden\">"
811	fileAddTag = fileAddTag + "</div>"
812
813	var fileAllowCnt = 5 ;
814	if ($("#fileArea .file-box").length>=fileAllowCnt){
815		alert("더이상 추가할수 없습니다.");
816	}else{
817		$("#fileArea").append(fileAddTag);	
818	}
819}
820
821function addRow() {
822	var tbl = document.getElementById("inRow").getElementsByTagName("TBODY")[0];
823	var html1 = "<input name='files' type='file' class='input' style='width:350px'><input type='hidden' name='filedel_idx' value='0'><input type='hidden' name='filesort' value='0'>";
824	var row = document.createElement("tr");
825	var col1 = document.createElement("td");
826	col1.className="HK_noBoarder";
827	row.appendChild(col1);
828	col1.innerHTML = html1;
829	tbl.appendChild(row);
830}
831function changeFilech(cnt,val){
832	var delchk = document.getElementsByName('delchk');
833	var filedel_idx = document.getElementsByName('filedel_idx');
834
835	if(delchk[cnt].checked){filedel_idx[cnt].value=val}
836	else{filedel_idx[cnt].value=""}
837}
838
839function changeFileArea(){
840	if(document.getElementById("fileArea").style.display=="none"){
841		document.getElementById("fileArea").style.display="inline";
842	}else{
843		document.getElementById("fileArea").style.display="none";
844	}
845}
846
847var Drag={
848	"obj":null,
849
850	"init":function(a, aRoot, ee){
851			if (!ee) {
852				a.onmousedown=Drag.start;
853			}
854			a.root = aRoot;
855			if(isNaN(parseInt(a.root.style.left))) { a.root.style.left="0px"; }
856			if(isNaN(parseInt(a.root.style.top))) { a.root.style.top="0px"; }
857			a.root.onDragStart = new Function();
858			a.root.onDragEnd = new Function();
859			a.root.onDrag = new Function();
860
861			if (!!ee) {
862				var b = Drag.obj = a;
863				ee = Drag.fixE(ee);
864				var c = parseInt(b.root.style.top);
865				var d = parseInt(b.root.style.left);
866				b.root.onDragStart(d,c,ee.clientX,ee.clientY);
867				b.lastMouseX = ee.clientX;
868				b.lastMouseY = ee.clientY;
869				document.onmousemove    = Drag.Drag;
870				document.onmouseup      = Drag.end;
871			}
872
873		},
874
875	"start":function(a){
876
877			var b=Drag.obj=this;
878			a=Drag.fixE(a);
879
880			var c = parseInt(b.root.style.top);
881			var d = parseInt(b.root.style.left);
882
883			b.root.onDragStart(d,c,a.clientX,a.clientY);
884
885			b.lastMouseX = a.clientX;
886			b.lastMouseY = a.clientY;
887
888			document.onmousemove    = Drag.Drag;
889			document.onmouseup      = Drag.end;
890			return false;
891		},
892
893	"Drag":function(a){
894			a = Drag.fixE(a);
895			var b = Drag.obj;
896			var c = a.clientY;
897			var d = a.clientX;
898			var e = parseInt(b.root.style.top);
899			var f = parseInt(b.root.style.left);
900			var h,g;
901			h = f + d - b.lastMouseX;
902			g = e + c - b.lastMouseY;
903			b.root.style.left   = h + "px";
904			b.root.style.top    = g + "px";
905			b.lastMouseX        = d;
906			b.lastMouseY        = c;
907			b.root.onDrag(h, g, a.clientX, a.clientY);
908			return false;
909		},
910
911	"end":function(){
912			document.onmousemove    = null;
913			document.onmouseup      = null;
914			Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style.left),parseInt(Drag.obj.root.style.top));
915			Drag.obj = null;
916		},
917
918
919	"fixE":function(a){
920			if(typeof a == "undefined") { a=window.event; }
921			if(typeof a.layerX == "undefined") { a.layerX=a.offsetX; }
922			if(typeof a.layerY == "undefined") { a.layerY=a.offsetY; }
923			return a;
924		}
925};
926
927function hangul_chk(word) {
928	var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-";
929
930	for (i=0; i< word.length; i++){
931		idcheck = word.charAt(i);
932
933		for ( j = 0 ;  j < str.length ; j++){
934			if (idcheck == str.charAt(j)) break;
935
936			if (j+1 == str.length){
937				return false;
938			}
939   		}
940   	}
941   	return true;
942}
943
944function emailDomainSet()	{
945	if ($("#domainSelect").val()==""){
946		$("#emailDomain").val('');
947		$("#emailDomain").focus();
948	}else{
949		$("#emailDomain").val( $("#domainSelect").val() );
950	}
951}
952function demailDomainSet()	{
953	if ($("#ddomainSelect").val()==""){
954		$("#demailDomain").val('');
955		$("#demailDomain").focus();
956	}else{
957		$("#demailDomain").val( $("#ddomainSelect").val() );
958	}
959}
960
961//입력한 글자수를 체크
962function chkByte(obj_name, max_len, span_name, isFirst) {
963	var ls_str     = obj_name.value;      // 이벤트가 일어난 컨트롤의 value 값
964	var pattern = "/\r\n/gm";
965	ls_str = ls_str.replace(pattern,'\n');
966	var li_str_len = ls_str.length;       // 전체길이
967
968	// 변수초기화
969	var li_max      = max_len;  // 제한할 글자수 크기
970	var i           = 0;        // for문에 사용
971	var li_byte     = 0;        // 한글일경우는 2 그밗에는 1을 더함
972	var isHan = true;
973	var li_len      = 0;        // substring하기 위해서 사용
974	var ls_one_char = "";       // 한글자씩 검사한다
975	var ls_str2     = "";       // 글자수를 초과하면 제한할수 글자전까지만 보여준다.
976
977	try {
978		//var objSpan = document.getElementById(span_name);
979
980		for( i = 0; i < li_str_len; i++ ) {
981			// 한글자추출
982			ls_one_char = ls_str.charAt(i);
983
984			if ( escape(ls_one_char).length > 4 ) {    // 한글이면 2를 더한다.
985				li_byte += 1;
986				isHan = true;
987			} else if (ls_one_char == '\n') { // 줄바꿈일경우
988			/*        if (li_str_len.charAt(i-1) != '\r') { // 하지만 밀려서 줄이 바뀐경우가 아닐때
989			          li_byte += 1;
990			          isHan = false;
991			        }*/
992			} else if (ls_one_char == ' ') { // 공백일경우
993
994			} else {                        // 그밗의 경우는 1을 더한다.
995				li_byte++;
996				isHan = false;
997			}
998
999			// 전체 크기가 li_max를 넘지않으면
1000			if( li_byte <= li_max ) {
1001				li_len = i + 1;
1002			} else {
1003				break;
1004			}
1005		}
1006
1007		// 전체길이를 초과하면
1008		if ( li_byte > li_max ) {
1009			alert( li_max + "자를 초과 입력할 수 없습니다.\n초과된 내용은 자동으로 삭제 됩니다. ");
1010			ls_str2 = ls_str.substr(0, li_len);
1011			obj_name.value = ls_str2;
1012
1013			if ( isHan ) li_byte -= 1;
1014			else         li_byte--;
1015		}
1016		if ( isFirst != 'N') {
1017			obj_name.focus();
1018		}
1019		//objSpan.innerHTML = li_byte+"/"+max_len+"자";
1020	} catch(e) {}
1021}
1022
1023// SMS CHECK Function ==============================================================
1024function str_limit_check( obj,obj1, max_len ){
1025	content_length = obj.value.length;
1026	tmp_content = "";
1027	cbyte = 0;
1028	if( !max_len ){	max_len = 80; }
1029        for( i = 0; i < content_length; i++ ){
1030			tmp_char = obj.value.charAt( i );
1031			if( escape( tmp_char ).length > 4){
1032				cbyte += 2;
1033			}
1034			else{ cbyte++; }
1035		if( typeof( document.all[obj1] ) == "object" ){
1036			document.all[obj1].innerHTML = cbyte;
1037		}
1038			if( cbyte <= max_len ){
1039				tmp_content += tmp_char;
1040			}
1041			else{
1042				msg = '메시지는 ' + max_len + ' Byte 이하로 입력해주세요.';
1043				alert( msg );
1044				obj.value = tmp_content;
1045
1046				if( typeof( document.all[obj1] ) == "object" ){
1047					document.all[obj1].innerHTML = cbyte - ( cbyte - max_len );
1048				}
1049		break;
1050		}
1051	}
1052}
1053//==================================================================================
1054
1055function changeareaData(str1,str2){
1056	var params = "areaidx="+str1+"&lccode="+str2+"&objname1=selAreaidx&objname2=areadetailidx";
1057
1058	$.ajax({type:"POST", url:'/_lib/selAreaDetail.asp',data:params,dataType:"script",
1059	}).done(function(msg){
1060	});
1061}

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.