PageSourceSearch

https://debecgallery.com/preload/js/util.js?v=1790410051

js debecgallery.com collected 2026-09-26 08:08:03 UTC 60,130 bytes, 1,928 lines download raw bytes

1var browser = new Object;
2if (navigator.userAgent.match(/msie/i) ) {
3	browser.type = 'IE';
4	browser.verIE = navigator.userAgent.match(/msie ([0-9]+)/i)[1];
5} else if ( navigator.userAgent.match(/rv:[0-9]+\.[0-9]+\)/i) ) {
6	browser.type = 'IE';
7	browser.verIE = navigator.userAgent.match(/rv:([0-9]+\.[0-9]+)\)/i)[1];
8} else if (navigator.userAgent.match(/chrome/i)) {
9	browser.type = 'CHROME';
10} else if (navigator.userAgent.match(/firefox/i)) {
11	browser.type = 'FF';
12} else {
13	browser.type = 'ETC';
14}
15
16var frm = {
17	checkbox : {
18		exist : function(itemname) {
19			var item;
20			itemname = itemname.replace(/\[\]$/, '');
21			item = document.getElementsByName(itemname+'[]');
22			for(var i=0; i<item.length; i++) {
23				if (item[i].checked == true) return true;
24			}
25			return false;
26		},
27		checkall : function(chkbox, itemname) {
28			var item;
29			item = document.getElementsByName(itemname + '[]');
30			for(var i=0; i<item.length; i++) {
31				if (item[i].disabled == true) continue;
32				item[i].checked = chkbox.checked;
33			}
34		}
35	},
36	text : {
37		basekey : [37,38,39,40, 9, 8, 46, 16, 17, 18, 35, 36, 20],	// 기본키 arrow, tab, backspace, delete, shift, ctrl, alt, end, home, capslock
38		numkey : [48,49,50,51,52,53,54,55,56,57, 96,97,98,99,100,101,102,103,104,105],	// 숫자키
39		noinput : function(e) {
40			var avail = [9,16,17,18,20];	// tab, shift, ctrl, alt, capslock
41			e = e ? e : window.event;
42			if (!avail.exist(e.keyCode)) {
43				try {
44					e.preventDefault();
45					e.stopPropagation();
46				} catch (ee) {
47					e.returnValue = null;
48				}
49			}
50		},
51		asint : function(allownegative, e) {
52			var avail = frm.text.numkey.concat(frm.text.basekey);
53			e = e ? e : window.event;
54			if (allownegative) {
55				avail.push(109);
56				avail.push(189);
57			}
58			if (!avail.exist(e.keyCode)) {
59				try {
60					e.preventDefault();
61					e.stopPropagation();
62				} catch (ee) {
63					e.returnValue = null;
64				}
65			}
66		},
67		asfloat : function(allownegative, e) {
68			var avail = frm.text.numkey.concat(frm.text.basekey);
69			e = e ? e : window.event;
70			avail.push(110);	// . key
71			avail.push(190);	// . key
72			if (allownegative) {
73				avail.push(109);
74				avail.push(189);
75			}
76			if (!avail.exist(e.keyCode)) {
77				try {
78					e.preventDefault();
79					e.stopPropagation();
80				} catch (ee) {
81					e.returnValue = null;
82				}
83			}
84		},
85		asalpha : function(e) {
86			var i, avail;
87			// 알파벳 대소문자
88			var alphacode = [];
89			for (i=65; i<=90; i++) {
90				alphacode.push(i);
91			}
92			avail = alphacode.concat(frm.text.basekey);
93
94			e = e ? e : window.event;
95			if (!avail.exist(e.keyCode)) {
96				try {
97					e.preventDefault();
98					e.stopPropagation();
99				} catch (ee) {
100					e.returnValue = null;
101				}
102			}
103		},
104		asalnum : function(e) {
105			var i, avail;
106			// 알파벳 대소문자
107			var alnumcode = [];
108			for (i=65; i<=90; i++) {
109				alnumcode.push(i);
110			}
111			avail = alnumcode.concat(frm.text.basekey, frm.text.numkey);
112
113			e = e ? e : window.event;
114			if (!avail.exist(e.keyCode)) {
115				try {
116					e.preventDefault();
117					e.stopPropagation();
118				} catch (ee) {
119					e.returnValue = null;
120				}
121			}
122		},
123		asid : function(e) {
124			var i, avail;
125			// 알파벳 대소문자
126			var alnumcode = [];
127			for (i=65; i<=90; i++) {
128				alnumcode.push(i);
129			}
130			avail = alnumcode.concat(frm.text.basekey, frm.text.numkey);
131			
132			avail.push(189);	// - key
133			e = e ? e : window.event;
134			if (!avail.exist(e.keyCode)) {
135				try {
136					e.preventDefault();
137					e.stopPropagation();
138				} catch (ee) {
139					e.returnValue = null;
140				}
141			} else {
142				if (e.keyCode == 189) {	// - 키 입력시 shift 눌렸는지 확인
143					if (!e.shiftKey) {
144						try {
145							e.preventDefault();
146							e.stopPropagation();
147						} catch (ee) {
148							e.returnValue = null;
149						}
150						return false;
151					}
152				}
153			}
154		}
155	},
156	select : {
157		add : function(sbox, val, text, idx) {
158			var option = new Option(text, val, true);
159			if (idx == null || idx == undefined) idx = sbox.options.length;
160			sbox.options[idx] = option;
161		},
162		remove : function(sbox, idx) {
163			if(idx != 0 && !idx) return;
164			sbox.options[idx] = null;
165		},
166		clear : function(sbox, spos) {
167			if (!spos) spos = 0;
168			var i;
169			while(1) {
170				try {
171					if (sbox.options.length > spos) {
172						sbox.options[spos] = null;
173					} else {
174						break;
175					}
176				} catch (e) {
177					break;
178				}
179			}
180		}
181	},
182	getRadioVal: function(name) {
183		var items, i, n;
184		items = document.getElementsByName(name);
185		n = items.length;
186		for(i=0; i<n; i++) {
187			if (items[i].checked) {
188				return items[i].value;
189			}
190		}
191		return false;
192	},
193	checkRequiredItems: function(form) {
194		if (!form) return false;
195		var list, i, n, tags, namelist=[], chklist=[], tagname, type, item;
196		tags = ['input', 'select', 'textarea'];
197		list = $(form).find(".required");
198		n = list.length;
199		for(i=0; i<n; i++) {
200			tagname = list[i].tagName.toLowerCase();
201			if (!tags.exist(tagname)) continue;
202			if (!list[i].name) continue;
203			if (namelist.exist(list[i].name)) continue;
204			type = tagname == 'input' ? list[i].type : '';
205			chklist.push({"name":list[i].name, "tag":tagname, "type":type, "title":list[i].title})
206			namelist.push(list[i].name);
207		}
208
209		n = chklist.length;
210		if (!n) return true;
211		
212		for(i=0; i<n; i++) {
213			item = chklist[i];
214			if (item.type == 'checkbox') {
215				if (!frm.checkbox.exist(item.name)) {
216					return fail(item.title + ' 항목은 필수입력항목입니다.');
217				}
218			} else if (item.type == 'radio') {
219				if (!frm.getRadioVal(item.name)) {
220					return fail(item.title + ' 항목은 필수입력항목입니다.');
221				}
222			} else {
223				if (form[item.name].value.isblank()) {
224					return fail(item.title + ' 항목은 필수입력항목입니다.');
225				}
226			}
227		}
228		return true;
229	}
230}
231
232var cookie = {
233	set : function(name, value, expiredays) {
234		var todayDate = new Date();
235		todayDate.setDate( todayDate.getDate() + expiredays );
236		document.cookie = name + "=" + escape( value ) + "; path=/; expires=" +     todayDate.toGMTString() + ";";
237	},
238	get : function(name) {
239		var nameOfCookie, endOfCookie, x=0, y;
240		nameOfCookie = name + "=";
241		while ( x <= document.cookie.length ) {
242			y = (x+nameOfCookie.length);
243			if ( document.cookie.substring( x, y ) == nameOfCookie ) {
244				if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 ) endOfCookie = document.cookie.length;
245				return unescape( document.cookie.substring( y, endOfCookie ) );
246			}
247			x = document.cookie.indexOf( " ", x ) + 1;
248			if ( x == 0 ) break;
249		}
250		return "";
251	}
252}
253
254
255var jscreen = {
256	matt : null,
257	freeze : function() {
258		if (!jscreen.matt) {
259			jscreen.matt = document.createElement('div');
260			document.body.appendChild(jscreen.matt);
261		}
262		jscreen.matt.style.position = 'absolute';
263		jscreen.matt.style.left = '0px';
264		jscreen.matt.style.top = '0px';
265		jscreen.matt.style.width = document.documentElement.scrollWidth + 'px';
266		jscreen.matt.style.height = document.documentElement.scrollHeight + 'px';
267		jscreen.matt.style.display = 'block';
268		jscreen.matt.style.backgroundColor = 'white';
269		jscreen.matt.style.opacity = '.7';
270		jscreen.matt.style.filter = 'alpha(opacity=70)';
271	},
272	thaw : function() {
273		try {jscreen.matt.style.display = 'none';}catch(e){}
274	}
275}
276
277// DIV Dragger
278var dragger = {
279	ids:[],
280	dx:null,
281	dy:null,
282	obj:null,
283	active:false,
284	zindex:10000,
285	add : function(id) {
286		var o = document.getElementById(id);
287		if (!dragger.exist(id)) {
288			dragger.ids.push({'id':id, 'idx':dragger.zindex++});
289		}
290		try {
291			o.attachEvent('onmousedown', dragger.mousedownHdl);
292			o.attachEvent('onmouseup', dragger.mouseupHdl);
293		} catch (e) {
294			o.addEventListener('mousedown', dragger.mousedownHdl, false);
295			o.addEventListener('mouseup', dragger.mouseupHdl, false);
296		}
297	},
298	exist : function(id) {
299		var n, i, exist=false;
300		n = dragger.ids.length;
301		for (i=0; i<n; i++) {
302			if (dragger.ids[i].id == id) {
303				return true;
304			}
305		}
306		return false;
307	},
308	isDraggable : function(id) {
309		return (dragger.inArray(id, dragger.ids));
310	},
311	isDragArea : function(e) {
312		var obj, dobj, offset, dy, dobj_id, scrolltop;
313		obj = (browser.type == 'IE')? e.srcElement : e.target;
314		dobj = dragger.getDragObj(obj);
315		if (dobj) {
316			dobj_id = dobj.id;
317		} else {
318			dobj_id = '';
319		}
320		
321		try {
322			scrolltop = (browser.type == 'IE') ? document.documentElement.scrollTop : document.body.scrollTop;
323		} catch (ee) {}
324		if (!dragger.isDraggable(dobj_id)) return;
325		offset = dragger.getPosition(dobj);
326		dy = e.clientY - offset[1] + scrolltop;
327		if (dy >= 30) {
328			obj.style.cursor = 'default';
329			return false;
330		}
331		obj.style.cursor = 'move';
332		return true;
333	},
334	mousedownHdl : function(e) {
335		if (dragger.active) return;
336		if (!e) e = window.event;
337		if (!dragger.isDragArea(e)) return;
338		if (!dragger.checkbtn(e)) return;
339		var id, offset, obj;
340		obj = (browser.type == 'IE')? e.srcElement : e.target;
341		dragger.obj = dragger.getDragObj(obj);
342		id = dragger.obj.id;
343		dragger.reOrderZindex(id);
344		offset = dragger.getPosition(dragger.obj);
345		dragger.dx = e.clientX - offset[0];
346		dragger.dy = e.clientY - offset[1];
347		dragger.active = true;
348	},
349	mousemoveHdl : function(e) {
350		if (!e) e = window.event;
351		if (!dragger.active) {
352			dragger.isDragArea(e);
353			return;
354		}
355		if (!dragger.checkbtn(e)) return;
356		dragger.putMatt();
357		dragger.obj.style.left = e.clientX - dragger.dx + 'px';
358		dragger.obj.style.top = e.clientY - dragger.dy + 'px';
359	},
360	mouseupHdl : function() {
361		dragger.active = false;
362		dragger.removeMatt();
363		dragger.obj = null;
364		dragger.dx = null;
365		dragger.dy = null;
366
367		return;
368	},
369	checkbtn : function(e) {
370		if (!e) e = window.event;
371		if (navigator.appName.match(/netscape/i)) {if (e.which == 1) return true;} else {if (e.button == 1) return true;}
372		return false;
373	},
374	getDragObj : function(o) {
375		try {
376			if (!o.id || !dragger.inArray(o.id, dragger.ids) ) o = dragger.getDragObj(o.offsetParent);
377			return o;
378		} catch (ee) {}
379	},
380	inArray : function(val, arr) {
381		var i, n;
382		n = arr.length;
383		for(i=0; i<n; i++) {
384			if (val == arr[i].id) return true;
385		}
386		return false;
387	},
388	reOrderZindex : function(id) {
389		if (!dragger.isDraggable(id)) return;
390		var i, n, t, idx;
391		// zIndex 순으로 정렬
392		dragger.ids = dragger.ids.sort(dragger.sortCmp);
393
394		// 현재 선택된 아이디의 색인찾기
395		n = dragger.ids.length;
396		for (i=0; i<n; i++) {
397			if (dragger.ids[i].id == id) {idx = i;break;}
398		}
399		t = idx;
400		idx++;
401		for (i=idx; i<n; i++) {
402			dragger.ids[i].idx--;
403			document.getElementById(dragger.ids[i].id).style.zIndex = dragger.ids[i].idx;
404		}
405		dragger.ids[t].idx = 10000 + n;
406		document.getElementById(dragger.ids[t].id).style.zIndex = dragger.ids[t].idx;
407	},
408	sortCmp : function(a,b) {
409		return (a.idx - b.idx);
410	},
411	putMatt : function() {
412		var bg;
413		bg = document.getElementById('dragger_matt');
414		if ( bg == null) {
415			bg = document.createElement('div');
416			bg.id = 'dragger_matt';
417			document.body.appendChild(bg);
418			bg.style.position='absolute';
419			bg.style.top='0px';
420			bg.style.left='0px';
421			bg.style.backgroundColor='white';
422			bg.style.opacity='.7';
423			bg.style.filter='alpha(opacity=70)';
424			bg.style.zIndex = 9999;
425		}
426		bg.style.width=document.documentElement.scrollWidth + 'px';
427		bg.style.height=document.documentElement.scrollHeight + 'px';
428		bg.style.display='block';
429	},
430	removeMatt : function() {
431		try{document.getElementById('dragger_matt').style.display = 'none';}catch(e){}
432	},
433	getPosition : function(o) {
434		var t, x = 0, y = 0;
435		t = o;
436		while (true) {try{x += t.offsetLeft;}catch(e){}try{t = t.offsetParent;}catch (e) {break;}}
437		t = o;
438		while (true) {try{y += t.offsetTop;}catch (e) {}try {t = t.offsetParent;} catch (e) {break;}}
439		return new Array(x,y);
440	},
441	addEvent : function() {
442		try {
443			document.attachEvent('onmousemove', dragger.mousemoveHdl);
444		} catch(err){
445			window.addEventListener('mousemove', dragger.mousemoveHdl, false);
446		}
447	}
448};
449dragger.addEvent();
450
451
452
453// EventListener
454function addEvent(evName, func) {
455	if (evName == 'load') {
456		$(document).ready(func);
457	} else {
458		try {
459			return window.attachEvent('on' + evName, func);
460		} catch (e) {
461			return window.addEventListener(evName, func, false);
462		}
463	}
464}
465
466
467// =============  기존객체에 메소드 추가 ==============
468String.prototype.trim = function() {
469	// 긴 문자열에도 적용하기 위해 정규식 대신 아래 코드 사용
470	var str = this.replace(/^\s*/, '');
471	if (!str) return str;
472	for (var i = str.length - 1; i > 0; i--) {
473		if (/\S/.test(str.charAt(i))) {
474			str = str.substring(0, i + 1);
475			break;
476		}
477	}
478	return str;
479}
480String.prototype.isblank = function() {
481	return !this.trim() ? true : false;
482}
483String.prototype.isimage = function() {
484	var ext = this.split('.').pop().toLowerCase();
485	return ext.match(/^(jpg|jpeg|gif|png)$/);
486}
487String.prototype.isalnum = function() {
488	return this.match(/^[a-z0-9]+$/i);
489}
490String.prototype.isint = function() {
491	return this.match(/^-?[0-9]+$/);
492}
493String.prototype.isfloat = function() {
494	return this.match(/^-?[0-9]+\.?[0-9]+$/);
495}
496String.prototype.forid = function() {
497	return this.match(/^[a-z0-9_]+$/i);
498}
499String.prototype.stripTag = function() {
500	var s = this;
501	while (s.match(/<[^>]+>/g)) {
502		s = s.replace(/<[^>]+>/g, '');
503	}
504	return s;
505}
506String.prototype.br2nl = function() {
507	var s;
508	s = this.replace(/<br>/ig, "\n");
509	s = s.replace(/<br \/>/ig, "\n");
510	return s;
511}
512Array.prototype.exist = function(val) {
513	for ( var i in this) { if (val == this[i]) return true; }
514	return false;
515}
516Array.prototype.shuffle = function() {
517	var o, i, j, x;
518	o = this;
519	for(j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);
520	return o;
521}
522
523// ================ Single Functions =================
524function getPos(o) {
525	var t, x = 0, y = 0;
526	t = o;
527	while (true) {try{x += t.offsetLeft;}catch(e){}try{t = t.offsetParent;}catch (e) {break;}}
528	t = o;
529	while (true) {try{y += t.offsetTop;}catch (e) {}try {t = t.offsetParent;} catch (e) {break;}}
530	return {'x':x, 'y':y};
531}
532
533function getCenterPos(obj) {
534	var w, h, x, y, stop, sleft, cwidth, cheight, retval;
535	w = obj.offsetWidth;
536	h = obj.offsetHeight;
537	
538	sleft = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;
539	stop = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
540	cwidth = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
541	cheight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
542	
543	x = sleft + Math.floor((cwidth - w) / 2);
544	y = stop + Math.floor((cheight - h) / 2);
545	
546	if (x < 1) x = 1;
547	if (y < 1) y = 1;
548	retval = {"x":x, "y":y};
549	return retval;
550}
551
552function checkDate(datestr) {
553	if (!datestr.match(/^[0-9]{4}-[0-9]?[0-9]?-[0-9]?[0-9]$/)) return false;
554	return true;
555}
556function getFileExt(filename) {
557	if (filename.isblank()) return '';
558	return filename.split('.').pop().toLowerCase();
559}
560function fail(msg) { alert(msg); return false; }
561
562function matchVal(str, vars) {
563	var i, n, k, search;
564	if (typeof vars == 'string') vars = [vars];
565	n = vars.length;
566	for(i=0; i<n; i++) {
567		k = i + 1;
568		search = '{{_val' + k + '_}}';
569		str = str.replace(search, vars[i]);
570	}
571	return str;
572}
573
574function checkEmail(email, allowEmpty) {
575	if (allowEmpty) {
576		if (email.isblank()) return true;
577	} else {
578		if (email.isblank()) return false;
579	}
580	return email.match(/^[a-zA-Z0-9_\-]+@[a-zA-Z0-9_\-]+.[a-zA-Z0-9_\-\.]+$/);
581}
582
583function addCommaNum(num) {
584	var nums, numstr, i, n, cnt;
585	if ( typeof num != 'number' ) num = parseInt(num);
586	num = num.toString();
587	
588	n = num.length;
589	
590	if (n <= 3) return num;
591	nums = num.split('');
592	numstr = '';
593	cnt = 0;
594	for(i=0; i<n; i++) {
595		if (cnt == 3) {
596			numstr = ',' + numstr;
597			cnt = 0;
598		}
599		numstr = nums.pop() + '' + numstr;
600		cnt++;
601	}
602	return numstr;
603}
604
605function cancelBubble(e) {
606	if (!e) e = window.event;
607	e.cancelBubble = true;
608}
609
610// jquery draggable 
611function addDraggable(id) {
612	$('#'+id).draggable();
613}
614
615// 이메일 조합
616function joinEmail(o_id, o_domain, o_target) {
617	var id, domain;
618	if (o_id.value.isblank()) return false;
619	if (o_domain.value.isblank()) return false;
620	o_target.value = o_id.value.trim() + '@' + o_domain.value.trim();
621	return true;
622}
623
624// 전화번호 조합
625function joinPhonenumber(o_t1, o_t2, o_t3, o_target) {
626	if (o_t1.value.isblank() || !o_t1.value.match(/^[0-9]+$/)) return false;
627	if (o_t2.value.isblank() || !o_t2.value.match(/^[0-9]+$/)) return false;
628	if (o_t3.value.isblank() || !o_t3.value.match(/^[0-9]+$/)) return false;
629	o_target.value = o_t1.value.trim() + '' + o_t2.value.trim() + '' + o_t3.value.trim();
630	return true;
631}
632
633function go_url(url) {
634	document.location.href = url;
635}
636
637function redirect(url) {
638	document.location.replace(url);
639}
640
641function getById(id) {
642	return document.getElementById(id);
643}
644
645function getByName(name) {
646	var list = getListByName(name);
647	if (!list) return false;
648	return list[0];
649}
650
651function getListByName(name) {
652	return document.getElementsByName(name)
653}
654
655// 관리자 퀵메뉴 =====================================
656adminQm = {
657	box:null,
658	setQm : function() {
659		try { if (isAdminPage) return; } catch (ee) {}
660		if (!isAdmin) return;
661		if (isMobile) return;
662		var box = document.getElementById('adminquickmenu');
663		if (!box) return;
664		box.style.display = 'block';
665		box.style.left = '0px';
666		box.style.top = '-23px';
667		box.style.zIndex = '9999';
668		adminQm.box = box;
669		$(adminQm.box).mouseenter(adminQm.show);
670		$(adminQm.box).mouseleave(adminQm.hide);
671	},
672	show : function() {
673		adminQm.box.style.top = '-3px';
674	},
675	hide : function() {
676		adminQm.box.style.top = '-23px';
677	}
678}
679addEvent('load', adminQm.setQm);
680
681// ==================================================
682
683// Color Picker
684
685/**
686* 색상 선택기
687* 실행방법
688* jColorPicker(position, arg, func);
689* position : {'x':xPos|null|false, 'y':yPos|null|false, 'center':ture|false};
690* arg : {'styleName':'styleName', 'id':'targetId', 'dest':'destCode', 'color':'colorCode'};
691* 		styleName 	: color, backgroundColor 스타일명
692* 		id 			: 실시간으로 컬러를 적용할 개체의 ID
693* 		dest		: 에디터용 (어느항목의 컬러를 변경할것인지 지정 (forecolor, backcolor 등)
694* 		color		: 컬러교환 (원래의 컬러값을 받아오고 적용수행시 이 변수에 값을 넣어서 전달)
695* func : 완료시 수행할 함수의 포인터
696*/
697function colorPicker() {
698   var me = this;
699   me.imgdir;
700   me.box;
701   me.arg;
702   me.func;
703
704   me.init = function() {
705	   // 개체 생성
706	   var box, div_container, div_ctable, div_info, div_grad, div_btn;
707	   var r, c, grad_img, htmlstr;
708	   var div_color, div_code, div_prev, imgOk, imgClose;
709
710	   var colortable = {
711			   0:['#ffffff','#fafafa','#efefef','#d7d7d7','#cccccc','#c0c0c0','#aaaaaa'],
712			   1:['#999999','#888888','#777777','#666666','#444444','#333333','#000000'],
713			   2:['#ffcccc','#ff6666','#ff0000','#cc0000','#990000','#660000','#330000'],
714			   3:['#ffcc99','#ff9966','#ff9900','#ff6600','#cc6600','#993300','#663300'],
715			   4:['#ffff99','#ffff66','#ffcc66','#ffcc33','#cc9933','#996633','#663333'],
716			   5:['#ffffcc','#ffff33','#ffff00','#ffcc00','#999900','#666600','#333300'],
717			   6:['#99ff99','#66ff99','#33ff33','#33cc00','#009900','#006600','#003300'],
718			   7:['#99ffff','#33ffff','#66cccc','#00cccc','#339999','#336666','#003333'],
719			   8:['#ccffff','#66ffff','#33ccff','#3366ff','#3333ff','#000099','#000066'],
720			   9:['#ccccff','#9999ff','#6666cc','#6633ff','#6600cc','#333399','#330099'],
721			   10:['#ffccff','#ff99ff','#cc66cc','#cc33cc','#993399','#663366','#330033']
722			};
723
724	   me.imgdir = url_base + '/preload/image/colorpicker';
725
726	   box = document.createElement('div');
727	   box.style.position = 'absolute';
728	   box.id = 'jscp_box';
729	   box.style.padding = '3px';
730	   box.style.width = '385px';
731	   box.style.height = '213px';
732	   box.style.background = "url('" + me.imgdir + "/bg.jpg')";
733
734	   div_container = document.createElement('div');
735	   div_container.style.cursor = 'default';
736	   div_container.position = 'relative';
737	   div_container.style.marginTop = '0px';
738	   div_container.style.width = '382px';
739	   div_container.style.height = '194px';
740
741	   div_ctable = document.createElement('div');
742	   div_ctable.style.position = 'absolute';
743	   div_ctable.style.left = '13px';
744	   div_ctable.style.top = '28px';
745	   div_ctable.style.width = '165px';
746	   div_ctable.style.border = '1px #cccccc solid';
747	   div_ctable.style.padding = '8px';
748	   div_ctable.style.textAlign = 'center';
749
750	   htmlstr = '';
751	   for (r=0; r<7; r++) {
752		   for (c=0; c<11; c++) {
753			   htmlstr += '<div onmousemove="jColorPicker.swatchMove(this)" onclick="jColorPicker.swatchColor(this)" style="position:relative; float:left; font-size:1px; width:12px; height:13px; margin:1px; background-color:' + colortable[c][r] + '; cursor:pointer; border-right:1px black solid; border-bottom:1px black solid;"></div>';
754		   }
755	   }
756	   div_ctable.innerHTML = htmlstr;
757	   div_ctable.style.display = 'inline';
758
759	   div_grad = document.createElement('div');
760	   div_grad.style.position = 'absolute';
761	   div_grad.style.left = '200px';
762	   div_grad.style.top = '28px';
763	   div_grad.innerHTML = '<img width=170 height=153 src="' + me.imgdir + '/color.jpg" onclick="jColorPicker.gradClick(event)" onmousemove="jColorPicker.gradMove(event)" style="cursor:pointer; border:1px #cccccc solid;" />';
764
765	   div_color = document.createElement('div');
766	   div_color.id = 'jscp_preview_color';
767	   div_color.style.position = 'absolute';
768	   div_color.style.top = '164px';
769	   div_color.style.left = '15px';
770	   div_color.style.width = '94px';
771	   div_color.style.height = '16px';
772	   div_color.style.border = '1px #d7d7d7 solid';
773	   div_color.style.cursor = 'default';
774	   div_color.style.backgroundColor = 'white';
775
776	   div_code = document.createElement('div');
777	   div_code.id = 'jscp_preview_code';
778	   div_code.style.position = 'absolute';
779	   div_code.style.top = '164px';
780	   div_code.style.left = '114px';
781	   div_code.style.width = '60px';
782	   div_code.style.height = '16px';
783	   div_code.style.border = '1px #d7d7d7 solid';
784	   div_code.style.backgroundColor = 'white';
785	   div_code.style.fontFamily = 'Courier New';
786	   div_code.style.fontSize = '9pt';
787	   div_code.innerHTML = '#FFFFFF';
788
789	   div_prev = document.createElement('div');
790	   div_prev.id = 'jscp_preview_grad';
791	   div_prev.style.position = 'absolute';
792	   div_prev.style.top = '164px';
793	   div_prev.style.left = '176px';
794	   div_prev.style.width = '16px';
795	   div_prev.style.height = '16px';
796	   div_prev.style.border = '1px #d7d7d7 solid';
797	   div_prev.style.cursor = 'default';
798	   div_prev.style.backgroundColor = 'white';
799
800	   div_btn = document.createElement('div');
801	   div_btn.style.position = 'absolute';
802	   div_btn.style.textAlign = 'center';
803	   div_btn.style.left = '10px';
804	   div_btn.style.top = '186px';
805	   div_btn.style.width = '100%';
806	   div_btn.style.height = '22px';
807
808	   //imgOk = '<img src="' + me.imgdir + '/btn_apply.png" onclick="jColorPicker.applyColor()" />';
809	   //imgClose = '<img src="' + me.imgdir + '/btn_close.png" onclick="jColorPicker.cancel()" style="margin-left:50px;" />';
810	   imgClose = '<img src="' + me.imgdir + '/btn_close.png" onclick="jColorPicker.cancel()" />';
811
812	   //div_btn.innerHTML = imgOk + imgClose;
813	   div_btn.innerHTML = imgClose;
814
815	   div_container.appendChild(div_ctable);
816	   div_container.appendChild(div_grad);
817	   div_container.appendChild(div_color);
818	   div_container.appendChild(div_code);
819	   div_container.appendChild(div_prev);
820	   div_container.appendChild(div_btn);
821
822	   box.appendChild(div_container);
823	   document.body.appendChild(box);
824
825	   me.box = box;
826	   me.box.style.display = 'none';
827
828	   dragger.add('jscp_box');
829
830   };
831
832   me.show = function(position, arg, func) {
833	   var x, y;
834	   me.arg = arg;
835	   me.func = func;
836
837	   me.box = document.getElementById('jscp_box');
838	   me.box.style.display = 'block';
839	   dragger.reOrderZindex(me.box.id);
840	   if (position.center == true) {
841		   var pos = me.getCenter();
842		   x = pos[0];
843		   y = pos[1];
844	   } else {
845		   x = position.x;
846		   y = position.y;
847	   }
848	   me.box.style.left = x + 'px';
849	   me.box.style.top = y + 'px';
850
851	   if (arg.color) {
852		   var color = me.toHex(arg.color);
853		   document.getElementById('jscp_preview_color').style.backgroundColor = color;
854		   document.getElementById('jscp_preview_code').innerHTML = color;
855	   }
856
857   };
858
859   me.getCenter = function() {
860	   var w, h, pw, ph, x, y, retval;
861
862	   w = me.box.offsetWidth;
863	   h = me.box.offsetHeight;
864
865	   x = Math.floor(document.documentElement.scrollLeft + (document.documentElement.clientWidth - w) / 2);
866	   y = Math.floor(document.documentElement.scrollTop + (document.documentElement.clientHeight - h) / 2);
867
868	   retval = new Array(x,y);
869	   return retval;
870   };
871
872   me.swatchColor = function(o) {
873	   var pvcolor, pvcode, color;
874
875	   pvcolor = document.getElementById('jscp_preview_color');
876	   pvcode = document.getElementById('jscp_preview_code');
877
878	   color = o.style.backgroundColor;
879
880	   pvcolor.style.backgroundColor = color;
881	   pvcode.innerHTML = me.toHex(color);
882
883	   if (me.arg.id) {
884		   var styleName = me.arg.styleName;
885		   document.getElementById(me.arg.id).style[me.arg.styleName] = me.toHex(color);
886	   }
887
888	   me.applyColor();
889   };
890
891   me.swatchMove = function(o) {
892	   var color = me.toHex(o.style.backgroundColor);
893	   try {
894		   document.getElementById('jscp_preview_grad').style.backgroundColor = color;
895		   document.getElementById('jscp_preview_code').innerHTML = color;
896	   } catch (e) {}
897   }
898
899   me.gradClick = function(event) {
900	   if (!event) event = window.event;
901	   var color = me.getPxColor(event);
902	   document.getElementById('jscp_preview_color').style.backgroundColor = color;
903	   document.getElementById('jscp_preview_code').innerHTML = color;
904
905	   if (me.arg.id) {
906		   var styleName = me.arg.styleName;
907		   document.getElementById(me.arg.id).style[me.arg.styleName] = color;
908	   }
909
910	   me.applyColor();
911
912   };
913
914   me.gradMove = function(event) {
915	   if (!event) event = window.event;
916	   var color = me.getPxColor(event);
917	   try {
918		   document.getElementById('jscp_preview_grad').style.backgroundColor = color;
919		   document.getElementById('jscp_preview_code').innerHTML = color;
920	   } catch (e) {}
921   };
922
923   me.getPxColor = function(event) {
924	   var hsv = new Object();
925	   var h, y, x, el;
926
927	   if (event.srcElement) {
928		   el = event.srcElement;
929		   h = el.offsetHeight;
930		   y = event.offsetY;
931		   x = event.offsetX;
932	   } else {
933		   el = event.target;
934		   h = el.offsetHeight;
935		   y = event.layerY;
936		   x = event.layerX;
937	   }
938
939	   hsv.h = 360 * x / el.offsetWidth;
940
941	   if ( y > h/2 ) {
942		   hsv.s = 1.0;
943		   hsv.v = 2 * (h - y) / h;
944	   } else {
945		   hsv.v = 1.0;
946		   hsv.s = y / (h / 2);
947	   }
948
949	   var rgb = me.hsvToRgb(hsv);
950
951	   var r, g, b;
952	   r = Math.round(rgb.r * 255);
953	   g = Math.round(rgb.g * 255);
954	   b = Math.round(rgb.b * 255);
955
956	   r = (!isNaN(r))? r : 0;
957	   g = (!isNaN(g))? g : 0;
958	   b = (!isNaN(b))? b : 0;
959
960	   var rgbcode = 'rgb(' + r + ', ' + g + ', ' + b + ')';
961	   return me.toHex(rgbcode);
962
963   };
964
965   me.hsvToRgb = function(hsv) {
966	   var rgb = new Object();
967	   var i, f, p, q, t;
968
969	   if ( hsv.s == 0 ) {
970		   // achromatic (grey)
971		   rgb.r = rgb.g = rgb.b = hsv.v;
972		   return rgb;
973	   }
974
975	   hsv.h /= 60;	// sector 0 to 5
976	   i = Math.floor( hsv.h );
977	   f = hsv.h - i;	// factorial part of h
978	   p = hsv.v * ( 1 - hsv.s );
979	   q = hsv.v * ( 1 - hsv.s * f );
980	   t = hsv.v * ( 1 - hsv.s * ( 1 - f ) );
981
982	   switch( i ) {
983	   case 0:
984		   rgb.r = hsv.v;rgb.g = t;rgb.b = p;break;
985	   case 1:
986		   rgb.r = q;rgb.g = hsv.v;rgb.b = p;break;
987	   case 2:
988		   rgb.r = p;rgb.g = hsv.v;rgb.b = t;break;
989	   case 3:
990		   rgb.r = p;rgb.g = q;rgb.b = hsv.v;break;
991	   case 4:
992		   rgb.r = t;rgb.g = p;rgb.b = hsv.v;break;
993	   default:	// case 5:
994		   rgb.r = hsv.v;rgb.g = p;rgb.b = q;break;
995	   }
996
997	   return rgb;
998   };
999
1000   me.applyColor = function(event) {
1001	   me.box.style.display = 'none';
1002	   var color = document.getElementById('jscp_preview_code').innerHTML;
1003	   if (me.func != null) {
1004		   me.arg.color = color;
1005		   me.func();
1006	   }
1007	   return;
1008   };
1009
1010   me.cancel = function() {
1011	   if (me.arg.id) {
1012		   var styleName = me.arg.styleName;
1013		   document.getElementById(me.arg.id).style[me.arg.styleName] = me.arg.color;
1014	   }
1015	   me.box.style.display = 'none';
1016   };
1017
1018   me.toHex = function(code) {
1019	   if (code.substr(0,1) == '#') return code.toUpperCase();
1020	   var patt, buff, r, g, b;
1021
1022	   patt = RegExp(/rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)/);
1023
1024	   buff = patt.exec(code);
1025	   r = parseInt(buff[1]).toString(16);
1026	   g = parseInt(buff[2]).toString(16);
1027	   b = parseInt(buff[3]).toString(16);
1028
1029	   if (r.length < 2) r = '0' + r;
1030	   if (g.length < 2) g = '0' + g;
1031	   if (b.length < 2) b = '0' + b;
1032
1033	   var ret = '#' + r.toUpperCase() + g.toUpperCase() + b.toUpperCase();
1034	   return ret;
1035   };
1036
1037};
1038var jColorPicker = new colorPicker();
1039addEvent('load', jColorPicker.init);
1040
1041/**
1042* 문자 선택기
1043* 실행방법
1044* jCharTable(position, arg, func);
1045* position : {'x':xPos|null|false, 'y':yPos|null|false, 'center':ture|false};
1046* arg : {'chars':''};
1047* 		chars : 선택한 문자열을 전달할 개체
1048* func : 완료시 수행할 함수의 포인터
1049*/
1050
1051function chartable() {
1052   var me = this;
1053   me.arg;
1054   me.box;
1055   me.imgdir;
1056   me.browser;
1057   me.arg;
1058   me.func;
1059
1060   me.init = function() {
1061	   var chars = {
1062			   0 : ['{','}','〔','〕','〈','〉','《','》','「','」','『','』','【','】','‘','’','“','”','、','。','·','‥','…','§','※','☆','★','○','●','◎','◇','◆','□','■','△','▲','▽','▼','◁','◀','▷','▶','♤','♠','♡','♥','♧','♣','⊙','◈','▣','◐','◑','▒','▤','▥','▨','▧','▦','▩','±','×','÷','≠','≤','≥','∞','∴','°','′','″','∠','⊥','⌒','∂','≡','≒','≪','≫','√','∽','∝','∵','∫','∬','∈','∋','⊆','⊇','⊂','⊃','∪','∩','∧','∨','¬','⇒','⇔','∀','∃','´','~','ˇ','˘','˝','˚','˙','¸','˛','¡','¿','ː','∮','∑','∏','♭','♩','♪','♬','㉿','→','←','↑','↓','↔','↕','↗','↙','↖','↘','㈜','№','㏇','™','㏂','㏘','℡','♨','☏','☎','☜','☞','¶','†','‡','®','ª','º','♂','♀'],
1063			   1 : ['½','⅓','⅔','¼','¾','⅛','⅜','⅝','⅞','¹','²','³','⁴','ⁿ','₁','₂','₃','₄','Ⅰ','Ⅱ','Ⅲ','Ⅳ','Ⅴ','Ⅵ','Ⅶ','Ⅷ','Ⅸ','Ⅹ','ⅰ','ⅱ','ⅲ','ⅳ','ⅴ','ⅵ','ⅶ','ⅷ','ⅸ','ⅹ','₩','$','¥','£','€','℃','Å','℉','¢','¤','‰','㎕','㎖','㎗','ℓ','㎘','㏄','㎣','㎤','㎥','㎦','㎙','㎚','㎛','㎜','㎝','㎞','㎟','㎠','㎡','㎢','㏊','㎍','㎎','㎏','㏏','㎈','㎉','㏈','㎧','㎨','㎰','㎱','㎲','㎳','㎴','㎵','㎶','㎷','㎸','㎹','㎀','㎁','㎂','㎃','㎄','㎺','㎻','㎼','㎽','㎾','㎿','㎐','㎑','㎒','㎓','㎔','Ω','㏀','㏁','㎊','㎋','㎌','㏖','㏅','㎭','㎮','㎯','㏛','㎩','㎪','㎫','㎬','㏝','㏐','㏓','㏃','㏉','㏜','㏆'],
1064			   2 : ['㉠','㉡','㉢','㉣','㉤','㉥','㉦','㉧','㉨','㉩','㉪','㉫','㉬','㉭','㉮','㉯','㉰','㉱','㉲','㉳','㉴','㉵','㉶','㉷','㉸','㉹','㉺','㉻','ⓐ','ⓑ','ⓒ','ⓓ','ⓔ','ⓕ','ⓖ','ⓗ','ⓘ','ⓙ','ⓚ','ⓛ','ⓜ','ⓝ','ⓞ','ⓟ','ⓠ','ⓡ','ⓢ','ⓣ','ⓤ','ⓥ','ⓦ','ⓧ','ⓨ','ⓩ','①','②','③','④','⑤','⑥','⑦','⑧','⑨','⑩','⑪','⑫','⑬','⑭','⑮','㈀','㈁','㈂','㈃','㈄','㈅','㈆','㈇','㈈','㈉','㈊','㈋','㈌','㈍','㈎','㈏','㈐','㈑','㈒','㈓','㈔','㈕','㈖','㈗','㈘','㈙','㈚','㈛','⒜','⒝','⒞','⒟','⒠','⒡','⒢','⒣','⒤','⒥','⒦','⒧','⒨','⒩','⒪','⒫','⒬','⒭','⒮','⒯','⒰','⒱','⒲','⒳','⒴','⒵','⑴','⑵','⑶','⑷','⑸','⑹','⑺','⑻','⑼','⑽','⑾','⑿','⒀','⒁','⒂'],
1065			   3 : ['ㄱ','ㄲ','ㄳ','ㄴ','ㄵ','ㄶ','ㄷ','ㄸ','ㄹ','ㄺ','ㄻ','ㄼ','ㄽ','ㄾ','ㄿ','ㅀ','ㅁ','ㅂ','ㅃ','ㅄ','ㅅ','ㅆ','ㅇ','ㅈ','ㅉ','ㅊ','ㅋ','ㅌ','ㅍ','ㅎ','ㅏ','ㅐ','ㅑ','ㅒ','ㅓ','ㅔ','ㅕ','ㅖ','ㅗ','ㅘ','ㅙ','ㅚ','ㅛ','ㅜ','ㅝ','ㅞ','ㅟ','ㅠ','ㅡ','ㅢ','ㅣ','ㅥ','ㅦ','ㅧ','ㅨ','ㅩ','ㅪ','ㅫ','ㅬ','ㅭ','ㅮ','ㅯ','ㅰ','ㅱ','ㅲ','ㅳ','ㅴ','ㅵ','ㅶ','ㅷ','ㅸ','ㅹ','ㅺ','ㅻ','ㅼ','ㅽ','ㅾ','ㅿ','ㆀ','ㆁ','ㆂ','ㆃ','ㆄ','ㆅ','ㆆ','ㆇ','ㆈ','ㆉ','ㆊ','ㆋ','ㆌ','ㆍ','ㆎ'],
1066			   4 : ['Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ','Υ','Φ','Χ','Ψ','Ω','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ','υ','φ','χ','ψ','ω','Æ','Ð','Ħ','IJ','Ŀ','Ł','Ø','Œ','Þ','Ŧ','Ŋ','æ','đ','ð','ħ','I','ij','ĸ','ŀ','ł','ł','œ','ß','þ','ŧ','ŋ','ʼn','Б','Г','Д','Ё','Ж','З','И','Й','Л','П','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я','б','в','г','д','ё','ж','з','и','й','л','п','ф','ц','ч','ш','щ','ъ','ы','ь','э','ю','я'],
1067			   5 : ['ぁ','あ','ぃ','い','ぅ','う','ぇ','え','ぉ','お','か','が','き','ぎ','く','ぐ','け','げ','こ','ご','さ','ざ','し','じ','す','ず','せ','ぜ','そ','ぞ','た','だ','ち','ぢ','っ','つ','づ','て','で','と','ど','な','に','ぬ','ね','の','は','ば','ぱ','ひ','び','ぴ','ふ','ぶ','ぷ','へ','べ','ぺ','ほ','ぼ','ぽ','ま','み','む','め','も','ゃ','や','ゅ','ゆ','ょ','よ','ら','り','る','れ','ろ','ゎ','わ','ゐ','ゑ','を','ん','ァ','ア','ィ','イ','ゥ','ウ','ェ','エ','ォ','オ','カ','ガ','キ','ギ','ク','グ','ケ','ゲ','コ','ゴ','サ','ザ','シ','ジ','ス','ズ','セ','ゼ','ソ','ゾ','タ','ダ','チ','ヂ','ッ','ツ','ヅ','テ','デ','ト','ド','ナ','ニ','ヌ','ネ','ノ','ハ','バ','パ','ヒ','ビ','ピ','フ','ブ','プ','ヘ','ベ','ペ','ホ','ボ','ポ','マ','ミ','ム','メ','モ','ャ','ヤ','ュ','ユ','ョ','ヨ','ラ','リ','ル','レ','ロ','ヮ','ワ','ヰ','ヱ','ヲ','ン','ヴ','ヵ','ヶ'],
1068			   6 : ['─','│','┌','┐','┘','└','├','┬','┤','┴','┼','━','┃','┏','┓','┛','┗','┣','┳','┫','┻','╋','┠','┯','┨','┷','┿','┝','┰','┥','┸','╂','┒','┑','┚','┙','┖','┕','┎','┍','┞','┟','┡','┢','┦','┧','┩','┪','┭','┮','┱','┲','┵','┶','┹','┺','┽','┾','╀','╁','╃','╄','╅','╆','╇','╈','╉','╊']
1069			   };
1070	   var div_container, div_tab, div_input, htmlstr;
1071	   var i,k,v;
1072	   var div_symbols = new Array();
1073
1074	   me.browser = (navigator.appName != 'Netscape') ? 'ie' : 'mozilla';
1075
1076	   me.imgdir = url_base + '/preload/image/chartable';
1077	   me.box = document.createElement('div');
1078	   me.box.id = 'jsct_box';
1079	   me.box.style.position = 'absolute';
1080	   me.box.style.width = '391px';
1081	   me.box.style.height = '219px';
1082	   me.box.style.background = "url('" + me.imgdir + "/bg.png') no-repeat";
1083
1084	   div_container = document.createElement('div');
1085	   div_container.style.position = 'relative';
1086	   div_container.style.cursor = 'default';
1087	   div_container.style.width = me.box.style.width;
1088	   div_container.style.height = me.box.style.height;
1089	   me.box.appendChild(div_container);
1090
1091	   div_tab = document.createElement('div');
1092	   div_tab.style.position = 'absolute';
1093	   div_tab.style.height = '20px';
1094	   div_tab.style.width = '381px';
1095	   div_tab.style.left = '5px';
1096	   div_tab.style.top = '20px';
1097	   div_container.appendChild(div_tab);
1098
1099	   if (language == 'korean') {
1100			var tabs = {
1101						0:['기호', 'jsct_symbol_tab'],
1102						1:['단위', 'jsct_unit_tab'],
1103						2:['원문자', 'jsct_circle_tab'],
1104						3:['한글','jsct_korean_tab'],
1105						4:['라틴','jsct_latin_tab'],
1106						5:['일본어','jsct_japan_tab'],
1107						6:['박스문자', 'jsct_line_tab']
1108			};
1109	   } else {
1110			var tabs = {
1111						0:['Symbol', 'jsct_symbol_tab'],
1112						1:['Unit', 'jsct_unit_tab'],
1113						2:['Circle', 'jsct_circle_tab'],
1114						3:['Korean','jsct_korean_tab'],
1115						4:['Latin','jsct_latin_tab'],
1116						5:['Japan','jsct_japan_tab'],
1117						6:['BoxBullet', 'jsct_line_tab']
1118			};
1119	   }
1120
1121	   htmlstr = '';
1122	   for (i=0; i<7; i++) {
1123		   htmlstr += '<div id="' + tabs[i][1] + '" onclick="jCharTable.switchTab(\'' + tabs[i][1] + '\')" style="float:left; font-size:8pt; letter-spacing:-1px; height:20px; text-align:left; padding:3px; cursor:pointer; border:1px #d7d7d7 solid; background-color:#efefef;">' + tabs[i][0] + '</div>';
1124	   }
1125	   div_tab.innerHTML = htmlstr;
1126
1127	   for (i=0; i<7; i++) {
1128		   div_symbols[i] = document.createElement('div');
1129		   div_symbols[i].id = tabs[i][1].replace('_tab', '');
1130		   div_symbols[i].style.position = 'absolute';
1131		   div_symbols[i].style.display = 'none';
1132		   div_symbols[i].style.top = '40px';
1133		   div_symbols[i].style.left = '6px';
1134		   div_symbols[i].style.width = '380px';
1135		   div_symbols[i].style.height = '150px';
1136		   div_symbols[i].style.backgroundColor = '#efefef';
1137		   //div_symbols[i].style.border = '1px #d7d7d7 solid';
1138		   div_container.appendChild(div_symbols[i]);
1139
1140		   htmlstr = '';
1141		   for (k=0; k<chars[i].length; k++ ) {
1142			   htmlstr += "<div onmouseover=\"this.style.backgroundColor='#e7e7e7'\" onmouseout=\"this.style.backgroundColor='white'\" style=\"float:left; width:16px; height:16px; padding-top:2px; text-align:center; background-color:white; font-family:굴림체; font-size:13px; margin:-1px 0px 0px -1px; border:1px #d7d7d7 solid; cursor:pointer;\" onclick=\"jCharTable.addChar('" + chars[i][k] + "')\">" + chars[i][k] + "</div>";
1143		   }
1144		   div_symbols[i].innerHTML = htmlstr;
1145
1146	   }
1147
1148	   div_input = document.createElement('div');
1149	   div_input.style.position = 'absolute';
1150	   div_input.style.left = '5px';
1151	   div_input.style.top = '194px';
1152	   div_input.style.width = '381px';
1153	   div_input.style.height = '16px';
1154
1155	   htmlstr = '<input type="text" id="jsct_input" style="width:314px; height:16px; border:1px #d7d7d7 solid; font-family:굴림체; font-size:9pt; background-color:white; vertical-align:middle;" />';
1156	   htmlstr += '<img src="' + me.imgdir + '/btn_apply.png" style="margin-left:1px; cursor:hand; vertical-align:middle;" onclick="jCharTable.applyChars()" />';
1157	   htmlstr += '<img src="' + me.imgdir + '/btn_close.png" style="margin-left:1px; cursor:hand; vertical-align:middle;" onclick="jCharTable.cancel()" />';
1158	   div_input.innerHTML = htmlstr;
1159
1160	   div_container.appendChild(div_input);
1161
1162	   document.body.appendChild(me.box);
1163
1164	   me.box.style.display = 'none';
1165
1166	   dragger.add('jsct_box');
1167
1168   };
1169
1170   me.addChar = function(ch) {
1171	   document.getElementById('jsct_input').value += ch;
1172   };
1173
1174   me.applyChars = function() {
1175	   me.arg.chars = document.getElementById('jsct_input').value;
1176	   me.func();
1177	   me.cancel();
1178   };
1179
1180   me.cancel = function() {
1181	   me.box.style.display = 'none';
1182   };
1183
1184   me.switchTab = function(tabid) {
1185
1186	   var tabidlist = new Array('jsct_symbol_tab', 'jsct_unit_tab', 'jsct_circle_tab', 'jsct_korean_tab', 'jsct_latin_tab', 'jsct_japan_tab', 'jsct_line_tab');
1187	   var contidlist = new Array('jsct_symbol', 'jsct_unit', 'jsct_circle', 'jsct_korean', 'jsct_latin', 'jsct_japan', 'jsct_line');
1188	   var el, id;
1189
1190	   for (i=0; i<7; i++) {
1191		   document.getElementById(tabidlist[i]).style.borderBottomColor = '#cccccc';
1192		   document.getElementById(tabidlist[i]).style.backgroundColor = '#efefef';
1193		   document.getElementById(contidlist[i]).style.display = 'none';
1194	   }
1195
1196	   el = document.getElementById(tabid);
1197	   el.style.borderBottomColor = 'white';
1198	   el.style.backgroundColor = 'white';
1199
1200	   id = el.id.replace('_tab', '');
1201	   document.getElementById(id).style.display = 'inline';
1202   };
1203
1204   me.show = function(position, arg, func) {
1205	   var x,y;
1206	   me.arg = arg;
1207	   me.func = func;
1208	   me.box.style.display = 'block';
1209	   dragger.reOrderZindex(me.box.id);
1210	   if (position.center == true) {
1211		   var pos = me.getCenter();
1212		   x = pos[0];
1213		   y = pos[1];
1214	   } else {
1215		   x = position.x;
1216		   y = position.y;
1217	   }
1218	   me.box.style.left = x + 'px';
1219	   me.box.style.top = y + 'px';
1220	   me.switchTab('jsct_symbol_tab');
1221   };
1222
1223   me.getCenter = function() {
1224	   var w, h, pw, ph, x, y, retval;
1225
1226	   w = me.box.offsetWidth;
1227	   h = me.box.offsetHeight;
1228
1229	   if (browser.type == 'IE') {
1230			x = Math.floor(document.documentElement.scrollLeft + (document.documentElement.clientWidth - w) / 2);
1231			y = Math.floor(document.documentElement.scrollTop + (document.documentElement.clientHeight - h) / 2);
1232	   } else {
1233			x = Math.floor(document.body.scrollLeft + (document.documentElement.clientWidth - w) / 2);
1234			y = Math.floor(document.body.scrollTop + (document.documentElement.clientHeight - h) / 2);
1235	   }
1236
1237	   retval = new Array(x,y);
1238	   return retval;
1239   };
1240
1241};
1242var jCharTable = new chartable();
1243// addEvent('load', jCharTable.init);	// IE7에서 이 개체로 인해 페이지로딩이 느려져 사용하지 않음.
1244
1245
1246function addDatePicker(id) {
1247	if (id.substr(0,1) == '.') {
1248		$( id ).datepicker({
1249			changeMonth: true,
1250			changeYear: true,
1251			closeText: '닫기',
1252			prevText: '이전달',
1253			nextText: '다음달',
1254			currentText: '오늘',
1255			yearRange: 'c-100:c+10',
1256			monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
1257			monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
1258			dayNames: ['일','월','화','수','목','금','토'],
1259			dayNamesShort: ['일','월','화','수','목','금','토'],
1260			dayNamesMin: ['일','월','화','수','목','금','토'],
1261			dateFormat: 'yy-mm-dd',
1262			showMonthAfterYear: true
1263		});
1264	} else {
1265		$( "#"+id ).datepicker({
1266			changeMonth: true,
1267			changeYear: true,
1268			closeText: '닫기',
1269			prevText: '이전달',
1270			nextText: '다음달',
1271			currentText: '오늘',
1272			yearRange: 'c-100:c+10',
1273			monthNames: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
1274			monthNamesShort: ['1월','2월','3월','4월','5월','6월','7월','8월','9월','10월','11월','12월'],
1275			dayNames: ['일','월','화','수','목','금','토'],
1276			dayNamesShort: ['일','월','화','수','목','금','토'],
1277			dayNamesMin: ['일','월','화','수','목','금','토'],
1278			dateFormat: 'yy-mm-dd',
1279			showMonthAfterYear: true
1280		});
1281	}
1282}
1283
1284var jtoast = {
1285	box: null,
1286	show: function(msg) {
1287		if (jtoast.box == null) {
1288			jtoast.box = document.createElement('div');
1289			jtoast.box.style.position = 'absolute';
1290			jtoast.box.style.backgroundColor = '#777';
1291			jtoast.box.style.padding = '4px 30px';
1292			jtoast.box.style.color = '#fff';
1293			jtoast.box.style.display = 'none';
1294			document.body.appendChild(jtoast.box);
1295		}
1296		var offset;
1297		jtoast.box.innerHTML = msg;
1298		jtoast.box.style.display = '';
1299		offset = getCenterPos(jtoast.box);
1300		jtoast.box.style.display = 'none';
1301		jtoast.box.style.top = offset.y + 'px';
1302		jtoast.box.style.left = offset.x + 'px';
1303		$(jtoast.box).show("fade");
1304		window.setTimeout(jtoast.hide, 1000);
1305	},
1306	hide: function() {
1307		$(jtoast.box).hide("fade");
1308	}
1309}
1310
1311
1312/**
1313 * Common Widget Functions
1314 */
1315
1316// Popup Widget
1317
1318var jpopup = {
1319	list: [],
1320	add: function(wgsn, popup_id) {
1321		var popup = {"sn":wgsn, "id":popup_id};
1322		if (jpopup.exist(popup_id)) return;
1323		jpopup.list.push(popup);
1324	},
1325	exist: function(popup_id) {
1326		var i,n;
1327		n = jpopup.list.length;
1328		for(i=0; i<n; i++) {
1329			if (jpopup.list[i].id == popup_id) {
1330				return true;
1331			}
1332		}
1333		return false;
1334	},
1335	view: function() {
1336		var i, n, cookie_id, box_id, box;
1337		n = jpopup.list.length;
1338		for(i=0; i<n; i++) {
1339			cookie_id = 'popup_' + jpopup.list[i].id;
1340			if (cookie.get(cookie_id) != 1) {
1341				box_id = 'popup_' + jpopup.list[i].sn + '_' + jpopup.list[i].id;
1342				box = document.getElementById(box_id);
1343				box.style.display = 'block';
1344				document.body.appendChild(box);
1345				box.style.zIndex = 9999;
1346				dragger.add(box_id);
1347			}
1348		}
1349	},
1350	hidetoday: function(wgsn, popup_id) {
1351		var cookie_id = 'popup_' + popup_id;
1352		cookie.set(cookie_id, 1, 1);
1353		jpopup.close(wgsn, popup_id);
1354	},
1355	close: function(wgsn, popup_id) {
1356		document.getElementById('popup_'+wgsn+'_'+popup_id).style.display = 'none';
1357	}
1358}
1359addEvent('load', jpopup.view);
1360
1361/* EDITOR 호출 함수
1362 *   에디터 생성, 에디터에서 결과값 추출, 에디터에 HTML 삽입
1363 *   에디터를 CKEDITOR로 교체하면서 기존 함수 그대로 사용하기 위한 인터페이스임
1364 */
1365function editor() {
1366	var me = this;
1367	me.editor = null;
1368	me.boxid = null;
1369	me.sEditors = [];
1370	me.init = function(boxid, toolbar) {
1371		var tarea, height;
1372		tarea = document.getElementById(boxid);
1373		me.boxid = boxid;
1374		if (tarea) {
1375			height = $('#'+boxid).height();
1376			if (!height) height=300;
1377		} else {
1378			height = 300;
1379		}
1380		if (editor_name == 'ckeditor') {
1381			me.initCKEditor(boxid, toolbar, height);
1382		} else if (editor_name == 'smarteditor') {
1383			me.initSmartEditor(boxid, toolbar);
1384		}
1385	};
1386	me.initInline = function(boxId) {
1387		me.editor = CKEDITOR.inline(boxId, {toolbar:'Basic'});
1388	},
1389	me.initCKEditor = function(boxid, toolbar, height) {
1390		if (!toolbar) toolbar = 'Basic';
1391		me.editor = CKEDITOR.replace(boxid, {toolbar:toolbar, height:height});
1392	};
1393	me.initSmartEditor = function(boxid, toolbar) {
1394		var skin;
1395		if (!toolbar) toolbar = '';
1396		if (toolbar.match(/upload$/i)) {
1397			skin = url_base + "/editor/smarteditor/SmartEditorJasinUploadSkin.html";
1398		} else {
1399			skin = url_base + "/editor/smarteditor/SmartEditorJasinSkin.html";
1400		}
1401		nhn.husky.EZCreator.createInIFrame({
1402			oAppRef: me.sEditors,
1403			elPlaceHolder: boxid,
1404			sSkinURI: skin,
1405			htParmas : {
1406				bUseToolbar : true,
1407				bUseVerticalResizer: true,
1408				bUseModeChanger: true,
1409				fOnBeforeUnload: function() {}
1410			},
1411			fOnAppLoad: function () {
1412				//예제 코드
1413				//oEditors.getById["ir1"].exec("PASTE_HTML", ["로딩이 완료된 후에 본문에 삽입되는 text입니다."]);
1414			},
1415			fCreator: "createSEditor2"
1416		});
1417	};
1418	me.setUploader = function(uploadurl, tempsession, org_id, callback) {
1419		editUploader.uploadurl = uploadurl;
1420		editUploader.tempsession = tempsession;
1421		editUploader.org_id = org_id;
1422		editUploader.callback = callback ? callback : 'parent.editUploader.addToDoc';
1423		editUploader.editor = me.editor;
1424	};
1425	me.getSubmitContent = function() {
1426		if (editor_name == 'ckeditor') {
1427			return me.editor.getData();
1428		} else if (editor_name == 'smarteditor') {
1429			me.sEditors.getById[me.boxid].exec("UPDATE_CONTENTS_FIELD", []);
1430			return me.sEditors.getById[me.boxid].getIR();
1431		}
1432	},
1433	me.pasteHtml = function(html) {
1434		if (editor_name == 'ckeditor') {
1435			me.editor.insertHtml(html);
1436		} else if (editor_name == 'smarteditor') {
1437			me.sEditors.getById[me.boxid].exec("PASTE_HTML", [html]);
1438		}
1439	}
1440}
1441
1442// 에디터 이미지첨부
1443var editUploader = {
1444	editor: null,
1445	uploadurl: '',
1446	tempsession: '',
1447	org_id: '',
1448	callback: '',
1449	show: function() {
1450		var html, div, sh, sw, w, h, x, y, form;
1451		
1452		if (!editUploader.uploadurl
1453			|| (!editUploader.tempsession && !editUploader.org_id)
1454			) return fail('업로드정보가 설정되지 않아서 이미지첨부 기능을 사용할 수 없습니다.');
1455		
1456		div = document.getElementById('juploadBox');
1457		if (div) {
1458			$(div).remove();
1459		}
1460		$.ajax({
1461			type: 'post',
1462			async: false,
1463			url: url_base + '/editor/ckeditor/plugins/jupload/uploadform.html',
1464			beforeSend: function() {},
1465			success: function(resp) {
1466				html = resp;
1467			},
1468			error: function(rdata, status, err) {},
1469			complete: function() {}
1470		});
1471
1472		div = document.createElement('div');
1473		div.id = 'juploadBox';
1474		$(div).html(html);
1475		document.body.appendChild(div);
1476
1477		$('#juploadBox').css({
1478			position: 'fixed',
1479			backgroundColor: '#fff',
1480			border: '1px #777 solid',
1481			boxShadow: '2px 2px 5px #333',
1482			display: 'none',
1483			left: '100px',
1484			top: '100px',
1485			width: '300px',
1486			zIndex: 999
1487		});
1488
1489		$("#juploadBox .title").css({
1490			position: 'relative',
1491			padding: '8px 0 8px 5px',
1492			textAlign: 'left',
1493			fontSize: '14px',
1494			backgroundColor: '#eee',
1495			color: '#000',
1496		});
1497		$("#juploadBox .close").css({
1498			position: 'absolute',
1499			top: '8px',
1500			right: '8px',
1501			color: '#000',
1502			fontSize: '14px',
1503			cursor: 'pointer'
1504		});
1505		$("#juploadBox .close").on("click", function() {
1506			$('#juploadBox').remove();
1507		});
1508
1509		$("#juploadBox .innerbox").css({
1510			padding: '20px 10px',
1511			textAlign: 'center'
1512		});
1513
1514		$('#jupload_file').on("change", function() {
1515			if (!this.value) return;
1516			form.submit();
1517			this.value = '';
1518			$('#juploadBox').hide();
1519		});
1520
1521		form = $('#juploadForm').get(0);
1522		form.action = editUploader.uploadurl + '?key=' + Math.random();
1523		form.temp_session.value = editUploader.tempsession;
1524		form.org_id.value = editUploader.org_id;
1525		form.callback.value = editUploader.callback;
1526
1527		$('#juploadBox').show();
1528		$('#juploadBox').draggable();
1529
1530		sw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
1531		sh = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
1532		w = document.getElementById('juploadBox').offsetWidth;
1533		h = document.getElementById('juploadBox').offsetHeight;
1534		x = Math.floor( (sw - w) / 2 );
1535		y = Math.floor( (sh - h) / 2 );
1536		
1537		$('#juploadBox').css({left:x+'px', top:y+'px'});
1538	},
1539	addToDoc: function(imageinfo) {
1540		
1541	}
1542}
1543
1544
1545// 사이트의 언어 지정
1546function setLanguage(lang, nexturl) {
1547    $.ajax({
1548        type: 'post',
1549		async: true,
1550		url: url_base + '/base/RmtSetLang',
1551		data: 'lang=' + lang,
1552		beforeSend: function() {},
1553		success: function(response) {
1554            if (response == 'ok') {
1555                if (!nexturl) {
1556				    window.location.reload();
1557                } else {
1558                    window.location.href = nexturl;
1559                }
1560			} else {
1561    		    alert('fail');
1562			}
1563		},
1564		error: function(rdata, status, err) {},
1565		complete: function() {}
1566	});
1567}
1568
1569// Captcha Image Reload
1570function reloadCaptcha(img_id) {
1571	var url, ts, img;
1572	ts = new Date().getTime();
1573	url = url_base + '/base/RmtCaptcha?strnum=5&ts=' + ts;
1574	img = document.getElementById(img_id);
1575	img.src = url;
1576}
1577
1578
1579// View Dialog
1580function view_dlg(id) {
1581	var dlg, offset;
1582	dlg = document.getElementById(id);
1583	document.body.appendChild(dlg);
1584	dlg.style.display = 'block';
1585	offset = getCenterPos(dlg);
1586	dlg.style.left = offset.x + 'px';
1587	dlg.style.top = offset.y + 'px';
1588	
1589	dragger.add(id);
1590}
1591function hide_dlg(id) {
1592	document.getElementById(id).style.display = 'none';
1593}
1594
1595// Login Handler by AJAX
1596
1597var login = {
1598	lang_en: {
1599		'missing':'{{_val1_}} Item not input.',
1600		'error':'Error occured.',
1601		'error_comm':'Server Communication error',
1602		'notrecommend':'Not recommended in public PC',
1603		'enter_id':'enter ID',
1604		'enter_passwd':'enter Password',
1605		'mismatch':'mismatch ID or Password',
1606		'rejected':'is rejected ID'
1607	},
1608	lang_kr: {
1609		'missing':'{{_val1_}} 항목이 입력되지 않았습니다',
1610		'error':'오류가 발생되었습니다.',
1611		'error_comm':'서버와의 통신이 실패했습니다.',
1612		'notrecommend':'공공장소의 PC에서는 사용을 권장하지 않습니다',
1613		'enter_id':'아이디를 입력해주세요',
1614		'enter_passwd':'비밀번호를 입력해주세요',
1615		'mismatch':'정보가 일치하지 않습니다',
1616		'rejected':'차단된 아이디입니다'
1617	},
1618	lang: null,
1619	alertMsg: function(chkbox) {
1620		if (language == 'korean') {
1621			login.lang = login.lang_kr;
1622		} else {
1623			login.lang = login.lang_en;
1624		}
1625		if (!chkbox.checked) return;
1626		alert(login.lang.notrecommend);
1627	},
1628	exec: function(form) {
1629		if (language == 'korean') {
1630			login.lang = login.lang_kr;
1631		} else {
1632			login.lang = login.lang_en;
1633		}
1634		if (form.login_id.value.isblank()) return fail(login.lang.enter_id);
1635		if (form.login_pw.value.isblank()) return fail(login.lang.enter_passwd);
1636		if (isApp) {
1637			form.token.value = App.getPairData("registration_id");
1638		}
1639		var formdata;
1640		if (isSecurePage) {
1641			formdata = jsecure.serializeFormData(form);
1642		} else {
1643			formdata = $(form).serialize();
1644		}
1645		$.ajax({
1646			type: 'post',
1647			async: false,
1648			url: url_base + '/member/RmtLogin',
1649			data: formdata,
1650			dataType: 'json',
1651			beforeSend: function() {
1652				jscreen.freeze();
1653			},
1654			success: function(response) {
1655				jscreen.thaw();
1656				if (!response) {
1657					alert(login.lang.error);
1658					return;
1659				}
1660				switch (response.state) {
1661					case 'ok':
1662						if (form.autologin && form.autologin.checked == true) {
1663							cookie.set('jc_autologin_id', response.uid, 30);
1664						}
1665						if (form.rememberid && form.rememberid.checked == true) {
1666							cookie.set('jc_remember_id', response.user_id, 30);
1667						}
1668						if (isApp) {
1669							try {
1670								// 앱과의 연동이 필요한 경우
1671								// appLogin 함수는 필요에 따라 생성하여 사용해야 함.
1672								// response 에는 회원의 uid, user_id, password 값이 들어있음
1673								member.appLogin(form, response);
1674							} catch (ee) {}
1675						}
1676						var url = !response.url.isblank() ? response.url : url_base + '/'; 
1677						document.location.replace(url);
1678						break;
1679					case 'mismatch':
1680						alert(login.lang.mismatch);
1681						break;
1682					case 'reject':
1683						alert(login.lang.rejected);
1684						break;
1685					default:
1686				}
1687			},
1688			error: function(rdata, status, err) {
1689				jscreen.thaw();
1690				alert(login.lang.error);
1691			},
1692			complete: function() {
1693				jscreen.thaw();
1694			}
1695		});
1696	},
1697	logout: function() {
1698		var msg;
1699		if (language == 'korean') {
1700			msg = '로그아웃하시겠습니까?';
1701		} else {
1702			msg = 'Are you sure you want to log-out?';
1703		}
1704		if (!confirm(msg)) return;
1705		$.ajax({
1706			type: 'post',
1707			async: false,
1708			url: url_base + '/member/RmtLogout',
1709			beforeSend: function() {
1710				jscreen.freeze();
1711			},
1712			success: function(response) {
1713				jscreen.thaw();
1714				if (response == 'ok') {
1715					try {
1716						App.logout();
1717					} catch (e) {
1718						window.location.reload();
1719					}
1720				} else {
1721					alert('error');
1722				}
1723			},
1724			error: function(rdata, status, err) {
1725				jscreen.thaw();
1726				alert('error');
1727			},
1728			complete: function() {
1729				jscreen.thaw();
1730			}
1731		});
1732	}
1733}
1734
1735
1736/* Daum 우편번호 API */
1737var daumPostal = {
1738	wrapper: null,
1739	foldPostcode: function() {
1740		daumPostal.wrapper.style.display = 'none';
1741	},
1742	view: function(post_id, addr_id, wrapper_id) {
1743		daumPostal.wrapper = document.getElementById(wrapper_id);
1744		var currentScroll = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
1745		new daum.Postcode({
1746			oncomplete: function(data) {
1747                // 검색결과 항목을 클릭했을때 실행할 코드를 작성하는 부분.
1748
1749                // 각 주소의 노출 규칙에 따라 주소를 조합한다.
1750                // 내려오는 변수가 값이 없는 경우엔 공백('')값을 가지므로, 이를 참고하여 분기 한다.
1751                var fullAddr = data.address; // 최종 주소 변수
1752                var extraAddr = ''; // 조합형 주소 변수
1753
1754                // 기본 주소가 도로명 타입일때 조합한다.
1755                if(data.addressType === 'R'){
1756                    //법정동명이 있을 경우 추가한다.
1757                    if(data.bname !== ''){
1758                        extraAddr += data.bname;
1759                    }
1760                    // 건물명이 있을 경우 추가한다.
1761                    if(data.buildingName !== ''){
1762                        extraAddr += (extraAddr !== '' ? ', ' + data.buildingName : data.buildingName);
1763                    }
1764                    // 조합형주소의 유무에 따라 양쪽에 괄호를 추가하여 최종 주소를 만든다.
1765                    fullAddr += (extraAddr !== '' ? ' ('+ extraAddr +')' : '');
1766                }
1767
1768                // 우편번호와 주소 정보를 해당 필드에 넣는다.
1769                document.getElementById(post_id).value = data.zonecode; //5자리 새우편번호 사용
1770                document.getElementById(addr_id).value = fullAddr;
1771
1772                // iframe을 넣은 element를 안보이게 한다.
1773                // (autoClose:false 기능을 이용한다면, 아래 코드를 제거해야 화면에서 사라지지 않는다.)
1774                daumPostal.wrapper.style.display = 'none';
1775
1776                // 우편번호 찾기 화면이 보이기 이전으로 scroll 위치를 되돌린다.
1777                document.body.scrollTop = currentScroll;
1778            },
1779            // 우편번호 찾기 화면 크기가 조정되었을때 실행할 코드를 작성하는 부분. iframe을 넣은 element의 높이값을 조정한다.
1780            onresize : function(size) {
1781                daumPostal.wrapper.style.height = size.height+'px';
1782            },
1783            width : '100%',
1784            height : '100%'
1785		}).embed(daumPostal.wrapper);
1786		daumPostal.wrapper.style.display = 'block';
1787	}
1788	
1789}
1790
1791var tipText = {
1792	init: function(selector) {
1793		$(selector).css({"color":"#a5a5a5"});
1794		$(selector).on("focus", function() {
1795			if (this.value == this.title) {
1796				this.value = '';
1797			}
1798			this.style.color = '#444';
1799		});
1800		$(selector).on("blur", function() {
1801			this.value = this.value.trim();
1802			if (!this.value) {
1803				this.value = this.title;
1804			}
1805			this.style.color = '#a5a5a5';
1806		});
1807	}
1808}
1809
1810
1811// Ajax 호출 응답 리턴(동기식)
1812function hdlCall(url, data, restype) {
1813	var retval=false, dataType;
1814	dataType = restype ? restype : 'text';
1815	$.ajax({
1816        type: 'post',
1817		async: false,
1818		url: url_base + url,
1819		data: data,
1820		dataType: dataType,
1821		beforeSend: function() {},
1822		success: function(resp) {
1823			retval = resp;
1824		},
1825		error: function(rdata, status, err) {},
1826		complete: function() {}
1827	});
1828	return retval;
1829}
1830
1831
1832var dialog = {
1833	id: null,
1834	dlg: null,
1835	show: function(id) {
1836		var dlg, offset, zindex;
1837		if (!dialog.id || id != dialog.id) {
1838			dialog.dlg = document.getElementById(id);
1839			document.body.appendChild(dialog.dlg);
1840			dialog.id = id;
1841		}
1842		jscreen.freeze();
1843		zindex = jscreen.matt.style.zIndex;
1844		$(dialog.dlg).show();
1845		$(dialog.dlg).css({"z-index":zindex + 1});
1846		offset = getCenterPos(dialog.dlg);
1847		dialog.dlg.style.left = offset.x + 'px';
1848		dialog.dlg.style.top = offset.y + 'px';
1849		$(dialog.dlg).draggable();
1850		$(dialog.dlg).find(".close").on("click", dialog.close);
1851	},
1852	close: function(id) {
1853		try {
1854			$('#' + id).hide();
1855		} catch(e) {
1856			try {
1857				$(dialog.dlg).hide();
1858			} catch (e) {}
1859		}
1860		jscreen.thaw();
1861	}
1862}
1863
1864var snsshare = {
1865	naver: function(title, url) {
1866		var requrl;
1867		requrl = 'http://blog.naver.com/openapi/share?url=' + encodeURIComponent(url) + '&title=' + encodeURIComponent(title);
1868		window.open(requrl, '', 'width=600, height=600, scrollbars=yes, resizable=yes');
1869	},
1870	fb: function(title, url) {
1871		var requrl;
1872		requrl = 'https://www.facebook.com/dialog/share?app_id=' + fb_app_id;
1873		requrl += '&display=popup&href=' + encodeURIComponent(url);
1874		window.open(requrl, '', 'width=600, height=600, scrollbars=yes, resizable=yes');
1875	},
1876	googleplus: function(title, url) {
1877		var requrl;
1878		requrl = 'https://plus.google.com/share?url=' + encodeURIComponent(url);
1879		window.open(requrl, '', 'width=600, height=600, scrollbars=yes, resizable=yes');
1880	},
1881	twitter: function(title, url) {
1882		var requrl;
1883		requrl = 'https://twitter.com/share?text=' + encodeURIComponent(title) + '&url=' + encodeURIComponent(url);
1884		window.open(requrl, '', 'width=600, height=600, scrollbars=yes, resizable=yes');
1885	},
1886	kakaolink: function(title, url, image, width, height) {
1887		if (!isMobile) {
1888			alert('모바일기기에서 이용해주세요');
1889			return;
1890		}
1891		
1892		try {
1893			Kakao.Link.createDefaultButton({
1894				container: '#kakao-link-btn',
1895				objectType: 'feed',
1896				content: {
1897					title: title,
1898					description: title,
1899					imageUrl: image,
1900					link: {
1901						mobileWebUrl: url,
1902						webUrl: url
1903					}
1904				},
1905				buttons: [
1906					{
1907						title: '웹으로 보기',
1908						link: {
1909							mobileWebUrl: url,
1910							webUrl: url
1911						}
1912					},
1913					{
1914						title: '앱으로 보기',
1915						link: {
1916							mobileWebUrl: url,
1917							webUrl: url
1918						}
1919					}
1920				]
1921			});
1922		} catch (e) {
1923			console.log(e);
1924			alert('카카오링크가 작동하지 않습니다');
1925		}
1926		
1927	}
1928}

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.