PageSourceSearch

https://www.toptutor.co.kr/common/js/common.js

js toptutor.co.kr collected 2026-10-05 05:23:05 UTC 56,914 bytes, 1,766 lines download raw bytes

1var isIE = (navigator.appName.indexOf("Microsoft") != -1) ? 1 : 0;
2var isSF = navigator.userAgent.toLowerCase().indexOf("safari") != -1;
3
4if(typeof(document.getElementsByClassName) !== "function") {
5	document.getElementsByClassName = function(className) {
6		var arr = [];
7		var ele = document.getElementsByTagName("*");
8		var cnt = ele.length;
9		for(var i=0;i<cnt;i++) {
10			if((" "+ele[i].className+" ").indexOf(" "+className+" ") > -1) {
11				arr.push(ele[i]);
12			}
13		}
14		return arr;
15	};
16}
17function SetCookie(name, value, expires, path, domain, secure) { //expires : 초
18	var date = new Date();
19	date.setSeconds(date.getSeconds() + expires);
20
21	document.cookie= name + "=" + escape(value) + "; path=" + ((path) ? path : "/") +
22	((expires) ? "; expires=" + date.toGMTString() : "") +
23	((domain) ? "; domain=" + domain : "") +
24	((secure) ? "; secure" : "");
25}
26
27function GetCookie(name) {
28	var dc = document.cookie;
29	var prefix = name + "=";
30	var begin = dc.indexOf("; " + prefix);
31	if (begin == -1) {
32		begin = dc.indexOf(prefix);
33		if (begin != 0) return null;
34	} else {
35		begin += 2;
36	}
37	var end = document.cookie.indexOf(";", begin);
38	if (end == -1) {
39		end = dc.length;
40	}
41	return unescape(dc.substring(begin + prefix.length, end));
42}
43
44function DelCookie(name, path, domain)
45{
46    if (GetCookie(name)) {
47        document.cookie = name + "=" +
48            ((path) ? "; path=" + path : "") +
49            ((domain) ? "; domain=" + domain : "") +
50            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
51    }
52}
53
54function OpenDialog(nLink, nWin, nWidth, nHeight, xPos, yPos) {
55	if(typeof nLink == "object") url = nLink.href;
56	else url = nLink;
57	var qResult = window.showModalDialog( url, nWin, "dialogwidth:"+nWidth+"px;dialogheight:"+nHeight+"px;toolbar:no;location:no;help:no;directories:no;status:no;menubar:no;scroll:no;resizable:no");
58}
59
60function OpenWindow(nLink, nTarget, nWidth, nHeight, xPos, yPos) {
61	if(typeof nLink == "object") url = nLink.href;
62	else url = nLink;
63
64	adjX = xPos ? xPos : (window.screen.width/2 - nWidth/2);
65	adjY = yPos ? yPos : (window.screen.height/2 - nHeight/2 - 50);
66	var qResult = window.open( url, nTarget, "width="+nWidth+", height="+nHeight+",left="+adjX+",top="+adjY+",toolbar=no,scrollbars=no,resizable=no");
67	//return qResult;
68}
69
70function OpenWindows(nLink, nTarget, nWidth, nHeight, xPos, yPos) {
71	if(typeof nLink == "object") url = nLink.href;
72	else url = nLink;
73
74	adjX = xPos ? xPos : (window.screen.width/2 - nWidth/2);
75	adjY = yPos ? yPos : (window.screen.height/2 - nHeight/2 - 50);
76	var qResult = window.open( url, nTarget, "width="+nWidth+", height="+nHeight+",left="+adjX+",top="+adjY+",toolbar=no,scrollbars=1,resizable=no");
77	//return qResult;
78}
79
80var GlobalLayers = new Array();
81var TopLayer = "";
82function OpenLayer(nLink, nTarget, nWidth, nHeight, xPos, yPos, scr) {
83	var layerId = new Date().getTime();
84	GlobalLayers.push(layerId);
85	TopLayer = layerId;
86
87	var dim = document.createElement("div");
88	document.body.appendChild(dim);
89	dim.className = "dim-layer";
90	dim.id = "dim-layer" + layerId;
91	dim.style.position = "absolute";
92	dim.style.zIndex = 999999 + GlobalLayers.length;
93	dim.style.background = " url(/html/images/page/opa_bg.png) repeat 0 0";
94//	dim.style.filter = "alpha(opacity=50)";
95//	dim.style.opacity = 0.5;
96	dim.style.top = "0px";
97	dim.style.left = "0px";
98	dim.style.width = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth) + "px";
99	dim.style.height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) + "px";
100	dim.onclick = function() {
101		CloseLayer();
102	}
103
104	var wrap = document.createElement("div");
105	wrap.id = "wrap-layer" + layerId;
106	wrap.style.position = "fixed";
107	wrap.style.zIndex = 999999 + GlobalLayers.length + 1;
108	wrap.style.padding = "0px";
109	wrap.style.background = "#fff";
110//	wrap.style.border = "2px solid #777";
111//	wrap.style.borderRadius = "5px";
112//	wrap.style.boxShadow = "0 0 15px #222";
113//	wrap.style.cursor = "move";
114
115	var ch = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
116	var cw = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth;
117	if(xPos == "left") wrap.style.left = "5px";
118	else if(xPos == "right") wrap.style.right = "5px";
119	if(yPos == "top") wrap.style.top = "5px";
120	else if(yPos == "bottom") wrap.style.bottom = "30px";
121
122	var ay = 40, ax = 38;
123	if(isMobile) { ay = 20; ax = 20; }
124	if((nWidth + "").indexOf("%") != -1) nWidth = nWidth.replace("%", "") * 1 / 100 * cw - ax - 55;
125	if((nHeight + "").indexOf("%") != -1) nHeight = nHeight.replace("%", "") * 1 / 100 * ch - ay - 55;
126
127	if(typeof(yPos) != 'string') wrap.style.top = (typeof(yPos) == 'number' ? yPos : (ch / 2 - nHeight/2 - ay)) + "px";
128	if(typeof(xPos) != 'string') wrap.style.left = (typeof(xPos) == 'number' ? xPos : (cw / 2 - nWidth / 2 - ax)) + "px";
129
130	var btn = document.createElement("div");
131	btn.id = "btn-close" + layerId;
132	btn.style.position = "absolute";
133	if(isMobile) {
134		btn.style.top = "3px";
135		btn.style.right = "10px";
136	} else {
137		btn.style.top = "15px";
138		btn.style.right = "30px";
139	}
140	btn.innerHTML = '<a href="javascript:;" onclick="CloseLayer(); return false;" style="display:block;"><img src="/html/images/page/opa_closed.png" alt="닫기"></a>';
141
142	var frm = document.createElement("iframe");
143	frm.width = nWidth;
144	frm.height = nHeight;
145	frm.frameBorder = 0;
146	if(scr) frm.scrolling = scr;
147	frm.src = nLink;
148	frm.setAttribute("name", nTarget);
149	frm.setAttribute("id", nTarget);
150
151	wrap.appendChild(btn);
152	wrap.appendChild(frm);
153
154	document.body.appendChild(wrap);
155
156	wrap.ondblclick = function() {
157		frm.src = frm.src;
158	}
159
160//	MDrag.init(wrap);
161
162	if(isMobile) {
163		if(!iPhone) addEvent("onresize", function() { try { CloseLayer(); } catch(e) {} });
164	} else {
165		addEvent("onkeydown", keydownListener, document.body);
166	}
167
168}
169function keydownListener(e) {
170	var ev = e || Event;
171	if(ev.keyCode == 27) CloseLayer();
172}
173
174function CloseLayer(callback) {
175	if(callback) { callback(); }
176	/*
177	if(gi("dim-layer" + TopLayer)) gi("dim-layer" + TopLayer).parentNode.removeChild(gi("dim-layer" + TopLayer));
178	if(navigator.userAgent.indexOf("MSIE") != -1) {
179		var ifrm = gi("wrap-layer" + TopLayer).getElementsByTagName("iframe")[0];
180		ifrm.src = "/html/main/closewindow.html";
181	} else {
182		if(gi("wrap-layer" + TopLayer)) gi("wrap-layer" + TopLayer).parentNode.removeChild(gi("wrap-layer" + TopLayer));
183	}
184	*/
185	var ifrm = gi("wrap-layer" + TopLayer).getElementsByTagName("iframe")[0];
186	ifrm.src = "/html/main/closewindow.html?d=" + new Date().getTime();
187
188	deleteEvent("onkeydown", keydownListener, document.body);
189}
190
191
192var MDrag = function(element, tgt) {
193	var self = this;
194	element.style.cursor = "cursor";
195	element.onmousedown = function(e){
196		self.etarget = tgt;
197		var e = window.event || e;
198		var initmousex = e.clientX;
199		var initmousey = e.clientY;
200		var initx = tgt.offsetLeft;
201		var inity = tgt.offsetTop;
202		var width = tgt.offsetWidth;
203		document.onmousemove = function(e) {
204			var e = window.event || e;
205			var distancex = e.clientX - initmousex;
206			var distancey = e.clientY - initmousey;
207			self.etarget.style.left = distancex + initx + "px";
208			self.etarget.style.top = distancey + inity + "px";
209			if(document.selection) document.selection.empty();
210			else window.getSelection().removeAllRanges();
211			return false;
212		}
213		document.onmouseup = function() {
214			self.etarget = null;
215			document.onmousemove = null;
216			document.onmouseup = null;
217		}
218		return false;
219	}
220	return element;
221}
222
223function gi(id, style) {
224	if(style) {
225		var tmp = style.split(":");
226		if(tmp.length == 2) {
227			if(tmp[0] == "className") eval("document.getElementById(id)." + tmp[0] + " = '" + tmp[1] + "'");
228			else eval("document.getElementById(id).style." + tmp[0] + " = '" + tmp[1] + "'");
229		}
230	}
231	return document.getElementById(id);
232}
233
234
235
236
237function ConfirmAction(obj) {
238	if(confirm(obj.name + "하시겠습니까?")) {
239		location.href = obj.href;
240	}
241}
242
243function BtnConfirmGo(obj, url) {
244	var msg;
245	if(typeof obj == "object") msg = obj.value;
246	else msg = obj;
247	if(confirm(msg + "하시겠습니까?")) {
248		location.href = url;
249	}
250}
251
252function Go(url) {
253	location.href = url;
254}
255
256function IfGo(msg, url, url2) {
257	if(confirm(msg)) Go(url);
258	else {
259		if(!url2) return false;
260		else Go(url2);
261	}
262	return true;
263}
264
265function ConfirmCheckGo(f, n, url, msg) {
266    var idx = GetFormValue(f, n);
267    if(idx == "") {
268        alert("선택 항목이 없습니다.");
269    } else {
270        if(confirm(msg)) {
271            location.href = url + idx;
272        }
273    }
274}
275
276function ResizeImage(el, w, h) {
277	var img = new Image();
278	img.src = el.src;
279
280	if(el.width > img.width) el.width = img.width;
281	if(el.height > img.height) el.height = img.height;
282
283	var sheight = el.width * img.height / img.width;
284	var swidth = el.height * img.width / img.height;
285
286	if(swidth < el.width) el.width = swidth;
287	if(sheight < el.height) el.height = sheight;
288}
289
290function ShowLayer(n) {
291	var el = document.getElementById(n);
292	if(el) {
293		el.style.display = 'block';
294	}
295}
296
297function HideLayer(n) {
298	var el = document.getElementById(n);
299	if(el) {
300		el.style.display = 'none';
301	}
302}
303
304function AutoLayer(n) {
305	var el = document.getElementById(n);
306	if(!el) return;
307	if(el.style.display == 'none') {
308		el.style.display = 'block'
309	} else {
310		el.style.display = 'none'
311	}
312}
313
314function validate(el) {
315	return true;
316}
317
318function SetElementValue(element, v, sep) {
319	if(!element) return false;
320	switch(element.type) {
321		case 'text':
322		case 'password':
323		case 'hidden':
324			element.value = v;
325			break;
326		case 'textarea':
327			element.text = v;
328			break;
329		case 'checkbox':
330			if(element.value == v) element.checked = true;
331			break;
332		case 'select-one':
333			for(var i=0; i<element.options.length; i++) if(element.options[i].value == v) element.options[i].selected = true;
334			break;
335		default:
336			if(sep) {
337				var val = v.split(sep);
338				for(var i=0; i<element.length; i++) {
339					for(var j=0; j<val.length; j++) {
340						if(element[i].value == val[j])  element[i].checked = true;
341					}
342				}
343			}
344			else {
345				for(var i=0; i<element.length; i++) {
346					if(element[i].value == v) element[i].checked = true;
347				}
348			}
349			break;
350	}
351}
352
353function SetFormValue(f, n, v, sep) {
354	var f = document.forms[f];
355	if(!f || !f[n]) return false;
356	switch(f[n].type) {
357		case 'text':
358		case 'password':
359		case 'hidden':
360			f[n].value = v;
361			break;
362		case 'textarea':
363			f[n].text = v;
364			break;
365		case 'checkbox':
366			if(f[n].value == v) f[n].checked = true;
367			break;
368		case 'select-one':
369			for(var i=0; i<f[n].options.length; i++) if(f[n].options[i].value == v) f[n].options[i].selected = true;
370			break;
371		default:
372			if(sep) {
373				var val = v.split(sep);
374				for(var i=0; i<f[n].length; i++) {
375					for(var j=0; j<val.length; j++) {
376						if(f[n][i].value == val[j])  f[n][i].checked = true;
377					}
378				}
379			}
380			else {
381				for(var i=0; i<f[n].length; i++) if(f[n][i].value == v) f[n][i].checked = true;
382			}
383			break;
384	}
385}
386
387function GetFormValue(f, n) {
388	var f = document.forms[f];
389	if(!f || !f[n]) return false;
390	switch(f[n].type) {
391		case 'text':
392		case 'file':
393		case 'password':
394		case 'hidden':
395			return f[n].value;
396			break;
397		case 'textarea':
398			return f[n].text;
399			break;
400		case 'checkbox':
401			if(f[n].checked == true) return f[n].value;
402			break;
403		case 'select-one':
404			for(var i=0; i<f[n].options.length; i++) {
405				if(f[n].options[i].selected == true) {
406					return f[n].options[i].value;
407				}
408			}
409			break;
410		default:
411			var arr = new Array();
412			var j = 0;
413			for(var i=0; i<f[n].length; i++) {
414				if(f[n][i].checked == true) {
415					 arr[j] = f[n][i].value;
416					 j++;
417				}
418			}
419			return arr.join(",");
420			break;
421	}
422	return false;
423}
424
425var AUTO_CHECK_STATUS = true;
426
427function AutoCheck(f, n, el) {
428	var f = document.forms[f];
429	if(!f || !f[n]) return;
430	if(el) AUTO_CHECK_STATUS = el.checked;
431	if(typeof(f[n]) == "object") {
432		if(f[n].length > 0) {
433			for(var i=0; i<f[n].length; i++) {
434				f[n][i].checked = AUTO_CHECK_STATUS;
435			}
436		} else {
437			f[n].checked = AUTO_CHECK_STATUS;
438		}
439		if(AUTO_CHECK_STATUS == true) {
440			AUTO_CHECK_STATUS = false;
441		} else {
442			AUTO_CHECK_STATUS = true;
443		}
444	}
445}
446function ToggleCheck(el, name) {
447	var elements = document.getElementsByName(name);
448	for(var i=0; i<elements.length; i++) {
449		elements[i].checked = el.checked;
450	}
451}
452
453function CheckGo(f, n, url, msg, confMsg) {
454	var idx = GetFormValue(f, n);
455	if(idx == "") {
456		alert(msg);
457	} else {
458		if(confMsg && !confirm(confMsg)) return;
459		if(url.indexOf("javascript:") != -1) {
460			eval(url.replace("javascript:", ""));
461		} else {
462			location.href = url + idx;
463		}
464	}
465}
466
467/*
468function CheckGo(f, n, url, msg) {
469	var idx = GetFormValue(f, n);
470	if(idx == "") {
471		alert(msg);
472	} else {
473		location.href = url + idx;
474	}
475}
476*/
477
478function ResizeIframe(n) {
479	var nodes = document.body.childNodes;
480	var preHeight = 0;
481	for(var x in nodes) if(nodes[x].offsetHeight) preHeight += nodes[x].offsetHeight;
482
483	var h;
484	if(el = parent.document.getElementById(n)) {
485		el.height = preHeight;
486		/*
487		if(isIE) h = document.body.scrollHeight + 2;
488		else h = document.documentElement.scrollHeight + 1;
489		*/
490		h = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) + 2;
491		if(h > 10) el.height = h;
492		else el.height = 0;
493	}
494}
495
496function GoNext(fm,pos,size) {
497
498	if(fm.elements[0].name == "PHPSESSID") {
499		pos++;
500	}
501
502	next_pos = pos + 1;
503	value = fm.elements[pos].value;
504	len = value.length;
505	is_num = Number(value);
506
507	if(!is_num) {
508		if((len > 0) && (value != '0') && (value != '00') && (value != '000')) {
509			alert('숫자를 넣어주세요');
510			fm.elements[pos].select();
511			fm.elements[pos].focus();
512			return false;
513		}
514	}
515
516	if(len == size) {
517		fm.elements[next_pos].focus();
518		return true;
519	}
520}
521
522function MoveNext(el, next, size) {
523	var len = el.value.length;
524	if(len == size) {
525		next.focus();
526		return true;
527	}
528}
529
530function IsNumeric(sText)
531{
532   var ValidChars = "0123456789.";
533   var IsNumber=true;
534   var Char;
535
536   for (i = 0; i < sText.length && IsNumber == true; i++) {
537      Char = sText.charAt(i);
538      if (ValidChars.indexOf(Char) == -1) {
539         IsNumber = false;
540      }
541   }
542
543   return IsNumber;
544}
545
546function OnlyNumber(el) {
547	if(!IsNumeric(el.value)) {
548		el.value = "";
549		el.focus();
550	}
551}
552
553function PhotoViewer(el) {
554	var photo = new PhotoLayer();
555	photo.Initialized();
556	photo.doPhotoClick(el);
557}
558
559function DrawBar(cnt, max, color, width) {
560	var percent;
561	if(!width) width = 400;
562	if(max > 0) {
563		percent = Math.floor((cnt / max) * 100);
564	} else {
565		percent = 0;
566	}
567	var other = 100 - percent;
568	document.write("<table align='left' width='" + width + "' cellpadding=0 cellspacing=0 height=10><tr><td width='"+percent+"%' background='../html/images/stat/s_bg_"+color+".gif'></td><td width='"+ other +"%'></td></tr></table>");
569}
570
571/* example : <script>getBarchart(230, 103, "red", "orange", "100%", 20, 2, true);</script> */
572function getBarchart(max, value, color, bgcolor, width, height, point, displayValue, displayAll) {
573    if(!width) width = "100%";
574    if(!height) height = 20;
575    if(!color) color = "#ff0000";
576    if(!bgcolor) bgcolor = "orange";
577    if(!point) point = 0;
578    if(!displayValue) displayValue = false;
579    if(!displayAll) displayAll = false;
580
581    var rate = max > 0 ? (parseInt(value) / max) * 100 : 0;
582
583    var bar = '<table width="' + width + '" cellpadding="0" cellspacing="0" style="table-layout:fixed;">';
584    bar += '<tr>';
585    if(rate > 0) bar += '<td width="' + Math.ceil(rate) + '%"><div style="height:' + (height/2 - 1) + 'px;background:' + color + ';filter:alpha(opacity=50);opacity:0.5;"><!--ie--></div></td>';
586    bar += '<td height="' + (height/2 - 1) + '" bgcolor="' + bgcolor + '"><!--ie--></td>';
587    bar += '</tr>';
588    bar += '<tr>';
589    if(rate > 0) bar += '<td width="' + Math.ceil(rate) + '%"><div style="height:' + (height/2 + 1) + 'px;background:' + color + ';filter:alpha(opacity=100);opacity:1;"><!--ie--></div></td>';
590    bar += '<td height="' + (height/2 + 1) + '" bgcolor="' + bgcolor + '"><!--ie--></td>';
591    bar += '</tr>';
592    bar += '<tr>';
593    if(rate > 0) bar += '<td></td>';
594    bar += '<td align="left" class="_grp_container_">'
595        + ' <div style="position:relative;">'
596        + '     <div class="_grp_tip_" style="position:absolute;top:-' + (height > 10 ? Math.round(height/2) + 5 : height) + 'px;left:1px;font-size:10px;font-family:굴림;">'
597        + '<nobr>' + (displayAll ? (displayValue ? value+ '(' + number_format(rate, point) + '%)' : number_format(rate, point) + '%') : "") + '</nobr>'
598        + '     </div>'
599        + ' </div>'
600        + '</td>'
601        + '</tr>'
602        + '</table>';
603    document.write(bar);
604}
605
606var _patchBarchart = function() {
607    var tds = document.getElementsByTagName("td");
608    for(var i=0; i<tds.length; i++) {
609        if(tds[i].className == "_grp_container_") {
610            var ptip = tds[i];
611            var tip = ptip.getElementsByTagName("div")[1];
612            if(tip.offsetLeft + tip.offsetWidth > ptip.offsetWidth) {
613                tip.style.left = (ptip.offsetWidth - tip.offsetWidth) + "px";
614            }
615        }
616    }
617}
618function patchBarchart() {
619    if(window.attachEvent) window.attachEvent("onload", _patchBarchart);
620    else if(window.addEventListener) window.addEventListener("load", _patchBarchart, false);
621}
622
623function initTinyMCE(theme, toolbar, els) {
624	initEditor(theme, toolbar, els);
625/*
626	var toolbarStr = "insertfile undo redo | fontselect | fontsizeselect | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist | link image ";
627	var statusbarBoolean = false;
628	var menubarBoolean = true;
629	if(theme == "simple") {
630		toolbarStr = "insertfile undo redo | styleselect | forecolor backcolor | bold italic | alignleft aligncenter alignright alignjustify ";
631		statusbarBoolean = false;
632		menubarBoolean = false;
633	}
634
635	tinymce.init({
636		selector: "textarea:not(.mceNoEditor)",
637		plugins: [
638			"advlist autolink lists link charmap print preview anchor",
639			"searchreplace visualblocks code fullscreen",
640			"insertdatetime table contextmenu paste ",
641			"textcolor "
642		],
643		theme: 'modern',
644		skin: "lightgray",
645		toolbar: toolbarStr,
646		font_formats: '도움=Dotum;도움체=DotumChe;굴림=Gulim;굴림체=GulimChe;맑은고딕=Malgun Gothic;Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;AkrutiKndPadmini=Akpdmi-n',
647		content_css : "/html/css/common.css",
648
649		convert_urls: false,
650		menubar: menubarBoolean,
651		statusbar : statusbarBoolean,
652		autosave_ask_before_unload: false,
653		//max_height: 200,
654		min_height: 150,
655		language : "ko_KR"
656	});
657*/
658}
659var Editors = new Array();
660function initEditor(theme, toolbar, els) {
661	
662	var undef;
663	if(toolbar === undef) toolbar = true;
664
665	$(document).ready(function() {
666		var textareas = document.getElementsByTagName("textarea");
667		for(var i=0; i<textareas.length; i++) {
668			if(!textareas[i].getAttribute("id")) textareas[i].setAttribute("id", textareas[i].getAttribute("name"));
669			if(textareas[i].className.indexOf("NoEditor") != -1) continue;
670
671			var myeditor = new cheditor();
672
673			//if(theme == "advanced") myeditor.templatePath = myeditor.config.editorPath + "template_advanced.xml";
674		//	else if(theme == "full") myeditor.templatePath = myeditor.config.editorPath + "template_full.xml";
675		//	else if(theme == "simple") myeditor.templatePath = myeditor.config.editorPath + "template_simple.xml";
676			if(theme == "supersimple") myeditor.templatePath = myeditor.config.editorPath + "template_supersimple.xml";
677			else myeditor.templatePath = myeditor.config.editorPath + "template.xml";
678			//myeditor.config.editorWidth = (textareas[i].offsetWidth - 4)+ "px";
679			myeditor.config.editorWidth = "100%";
680			myeditor.config.editorHeight = textareas[i].offsetHeight + "px";
681			myeditor.config.useImage = false;
682			myeditor.config.useMap = false;
683			myeditor.inputForm = textareas[i].getAttribute("id");
684			//focus
685			myeditor.config.startFocus = textareas[i].getAttribute("focus") != "no"
686			myeditor.run();
687
688			Editors[textareas[i].getAttribute("id")] = myeditor;
689		}
690	});
691	
692	//initTinyMCE(theme, toolbar, els)
693}
694
695	
696function iText(text, tgtName) {
697	if(!tgtName) tgtName = "content";
698	tinymce.execCommand('mceFocus', false, tgtName);
699	tinymce.execCommand('mceInsertContent', false, text);
700}
701function iContent(url, tgtName, width, height) {
702	if(!tgtName) tgtName = "content";
703
704	
705	var editor = Editors[tgtName];
706	if(!editor) {
707		alert("iContent Error :대상을 지정하세요.");
708		return;
709	}
710
711	if(editor.cheditor.mode != "rich") { alert("입력모드로 변경하세요."); return; }
712	//	if(editor.cheditor.mode != "rich") { editor.switchEditorMode("rich"); }
713	
714	var ext = url.substring(url.lastIndexOf(".") + 1, url.length);
715	var widthConv = !width ? 400 : width;
716	var heightConv = !height ? 300 : height;
717
718	var able = true;
719	var img = false;
720	switch (ext.toLowerCase()) {
721		case "gif":
722		case "jpg":
723		case "jpeg":
724		case "png":
725		case "bmp":
726			var img = new Image();
727			img.src = url + "?d=" + (new Date()).getTime();
728			img.onload = function() {
729				if(isNaN(width)) width = 0;
730				if(isNaN(height)) height = 0;
731				var size = { width:this.width, height:this.height };
732				if(!width && !height) {
733					width = 730;
734					if(width > size['width']) width = size['width'];
735					size['height'] = Math.round(size['height'] * (width / size['width']));
736					size['width'] = width;
737				}
738				if(width && !height) {
739					if(width > size['width']) width = size['width'];
740					size['height'] = Math.round(size['height'] * (width / size['width']));
741					size['width'] = width;
742				} else if(!width && height) {
743					if(height > size['height']) height = size['height'];
744					size['width'] = Math.round(size['width'] * (height / size['height']));
745					size['height'] = height;
746				} else if(width && height) {
747					size['width'] = width;
748					size['height'] = height;
749				}
750				width = size['width'];
751				height = size['height'];
752
753				var h = '<img src="'+ url +'" width="' + width + '" height="' + height + '">';
754				
755				if(isIE) editor.insertContents(h);
756				else editor.insertHTML(h);
757				/*
758				tinymce.execCommand('mceFocus', false, tgtName);
759				tinymce.execCommand('mceInsertContent', false, h);
760				*/
761			}
762			img.onerror = function() {
763				alert("파일 삽입에 실패하였습니다.");
764			}
765			return;
766		case "swf":
767			h = '<object width="' + widthConv + '" height="' + heightConv + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">'
768			+ '<param name="src" value="' + url + '" />'
769			+ '<embed width="' + widthConv + '" height="' + heightConv + '" type="application/x-shockwave-flash" src="' + url + '"></embed></object>';
770			break;
771		case "mp4":
772		case "flv":
773			h = '<object width="' + widthConv + '" height="' + heightConv + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">'
774			+ '<param name="src" value="/html/cheditor/moxieplayer.swf" />'
775			+ '<param name="flashvars" value="url=' + url + '" />'
776			+ '<param name="allowfullscreen" value="true" />'
777			+ '<param name="allowscriptaccess" value="true" />'
778			+ '<param name="play" value="true" />'
779			+ '<embed  width="' + widthConv + '" height="' + heightConv + '"  type="application/x-shockwave-flash" src="/html/cheditor/moxieplayer.swf" flashvars="url=' + url + '" allowfullscreen="true" allowscriptaccess="true" play="true" />'
780			+ '</object>';
781			break;
782		case "shockwave":
783			h = '<object width="' + widthConv + '" height="' + heightConv + '" classid="clsid:166b1bca-3f9c-11cf-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0">'
784			+ '<param name="src" value="' + url + '" />'
785			+ '<param name="sound" value="true" />'
786			+ '<param name="progress" value="true" />'
787			+ '<param name="autostart" value="true" />'
788			+ '<param name="swstretchstyle" value="none" />'
789			+ '<param name="swstretchhalign" value="none" />'
790			+ '<param name="swstretchvalign" value="none" />'
791			+ '<embed width="' + widthConv + '" height="' + heightConv + '" type="application/x-director" src="' + url + '" sound="true" progress="true" autostart="true" swstretchstyle="none" swstretchhalign="none" swstretchvalign="none" />'
792			+ '</object>';
793			break;
794		case "mov":
795		case "qt":
796			h = '<object width="' + widthConv + '" height="' + heightConv + '" classid="clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b" co
796debase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0">'
797			+ '<param name="src" value="' + url + '" />'
798			+ '<embed width="' + widthConv + '" height="' + heightConv + '" type="video/quicktime" src="' + url + '" />'
799			+ '</object>';
800			break;
801		case "mpeg":
802		case "wmv":
803		case "wma":
804		case "asf":
805		case "mp3":
806		case "avi":
807		case "wmp":
808			h = '<object classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"'
809			+ ' codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"'
810			+ ' width="' + widthConv + '"'
811			+ ' height="' + heightConv + '">'
812			+ '<param name="URL" value="' + url + '" />'
813			+ '<param name="allowFullScreen" value="true">'
814			+ '<param name="rate" value="1" />'
815			+ '<param name="balance" value="0" />'
816			+ '<param name="currentPosition" value="0" />'
817			+ '<param name="defaultFrame" />'
818			+ '<param name="playCount" value="1" />'
819			+ '<param name="autoStart" value="true" />'
820			+ '<param name="currentMarker" value="0" />'
821			+ '<param name="invokeURLs" value="-1" />'
822			+ '<param name="baseURL" />'
823			+ '<param name="volume" value="50" />'
824			+ '<param name="mute" value="0" />'
825			+ '<param name="uiMode" value="full" />'
826			+ '<param name="stretchToFit" value="0" />'
827			+ '<param name="windowlessVideo" value="0" />'
828			+ '<param name="enabled" value="-1" />'
829			+ '<param name="enableContextMenu" value="-1" />'
830			+ '<param name="fullScreen" value="0" />'
831			+ '<param name="SAMIStyle" />'
832			+ '<param name="SAMILang" />'
833			+ '<param name="SAMIFilename" />'
834			+ '<param name="captioningID" />'
835			+ '<param name="enableErrorDialogs" value="true" />'
836			+ '<embed src="' + url + '" type="application/x-mplayer2" allowFullScreen="true" width="' + widthConv + '" height="' + heightConv + '" autostart="true"></embed>'
837			+ '</object>';
838			break;
839		case "rmp":
840		case "ra":
841		case "rm":
842			h = '<object width="' + widthConv + '" height="' + heightConv + '" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0">'
843			+ '<param name="src" value="' + url + '" />'
844			+ '<embed width="' + widthConv + '" height="' + heightConv + '" type="audio/x-pn-realaudio-plugin" src="' + url + '" />'
845			+ '</object>';
846			break;
847		default:
848			able = false;
849			break;
850	}
851
852	if(able) {
853		
854		if(isIE) editor.insertContents(h);
855		else editor.insertHTML(h);
856		/*
857		tinymce.execCommand('mceFocus', false, tgtName);
858		tinymce.execCommand('mceInsertContent', false, h);
859		*/
860	} else { alert("삽입 할 수 없는 형식입니다."); }
861}
862
863//2015.2.6
864function call(url, id, callback) {
865	var client = false;
866	if(window.ActiveXObject) {
867		try {
868			client = new ActiveXObject("Msxml2.XMLHTTP");
869		} catch(e) {
870			try {
871				client = new ActiveXObject("Microsoft.XMLHTTP");
872			} catch(e) {}
873		}
874	} else {
875		client = new XMLHttpRequest();
876	}
877
878	var el = document.getElementById(id);
879	if(client) {
880		client.onreadystatechange = function() {
881			if(client.readyState == 4) {
882				if(el) {
883					if(isIE && el.tagName.toLowerCase() == "select") {
884						el.innerHTML = client.responseText.replace(/\</g, "&lt;").replace(/\>/g, "&gt;");
885						el.outerHTML = el.outerHTML.replace(/\&lt;/g, "<").replace(/\&gt;/g, ">");
886					} else {
887						if(isIE && client.responseText.indexOf("<script") == 0) {
888						//	setHtml(el, "<span style='display:none;'>&nbsp;</span>" + client.responseText);
889							$(el).html("<span style='display:none;'>&nbsp;</span>" + client.responseText);
890						} else {
891						//	setHtml(el, client.responseText);
892							$(el).html(client.responseText);
893						}
894					}
895				}
896				if(callback) {
897					try {
898						if(typeof callback === "function") {
899							callback(client.responseText);
900						} else if(typeof callback === "string") {
901							eval(callback + "(client.responseText)");
902						}
903					} catch(e) { alert(callback + " 함수가 없습니다."); }
904				}
905			}
906		}
907		var f;
908		if(f = document.forms[url]) {
909			var parameters = "";
910			for(var i=0; i<f.elements.length; i++) {
911				if(f.elements[i].name == "") continue;
912				if(f.elements[i].type == "radio" || f.elements[i].type == "checkbox") {
913					if(f.elements[i].checked == false) continue;
914				}
915				parameters += f.elements[i].name + "=" + encodeURI( f.elements[i].value ) + "&";
916			}
917			if(!f.action) f.action = location.href;
918			client.open('POST', f.action, callback !== false ? true : false);
919			client.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
920			client.setRequestHeader("Content-Length", parameters.length);
921			client.setRequestHeader("Connection", "close");
922			client.send(parameters);
923		} else {
924			client.open("GET", url, callback !== false ? true : false);
925			client.send(null);
926		}
927		if(callback === false) return client.responseText;
928	}
929	function setHtml(el, html) {
930		try {
931			var tmpNode = document.createElement('div');
932			tmpNode.innerHTML = html;
933
934			var scriptNodes = tmpNode.getElementsByTagName('script');
935			var scripts = new Array();
936			while(scriptNodes.length) {
937				var node = scriptNodes[0];
938				scripts.push(node.text);
939				node.parentNode.removeChild(node);
940			}
941			el.innerHTML = tmpNode.innerHTML;
942
943			var head = document.getElementsByTagName('head')[0];
944			while(scripts.length) {
945				var scriptNode = document.createElement('script');
946				scriptNode.type = 'text/javascript';
947				scriptNode.text = scripts.shift();
948				head.appendChild(scriptNode);
949				head.removeChild(scriptNode);
950			}
951		} catch(e) {}
952	}
953}
954
955function docWrite(str) {
956	document.write(str);
957}
958
959function playFlash(filename, width, height, id, trans, params, lock) {
960	id = id ? id : "";
961    document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="'+id+'" align="middle"><param name="allowScriptAccess" value="always" /><param name="movie" value="'+filename+'" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="wmode" value="'+trans+'" />' + (params ? '<param name="FlashVars" value="' + params + '" />' : "") + '<embed src="'+filename + (params ? '?' + params : "") +'" menu="false" quality="high" bgcolor="#ffffff" wmode="' + trans + '" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
962}
963
964function FlashChart(id, width, height, xmlurl, ftype) {
965	var filename = "FlashChart.swf";
966	if(ftype == "mini") filename = "FlashChartMini.swf";
967	playFlash("/Web/lib/js/" + filename, width, height, id, "transparent", "xmlurl=" + escape(xmlurl));
968}
969
970function ToggleLayer(objName, tarName, addX, addY) {
971	var obj = document.getElementById(objName);
972	if(!obj) {
973		alert(objName + ' 레이어가 존재하지 않습니다.');
974		return;
975	}
976
977	var tar = tarName ? document.getElementById(tarName) : null;
978	if(tar) {
979		var curleft = curtop = 0;
980		if (tar.offsetParent) {
981			do {
982				curleft += tar.offsetLeft;
983				curtop += tar.offsetTop;
984			} while (tar = tar.offsetParent);
985		}
986		obj.style.position = "absolute";
987		obj.style.left = curleft + (addX ? parseInt(addX) : 0);
988		obj.style.top = curtop + (addY ? parseInt(addY) : 0);
989	}
990	if(obj.style.display == "none") {
991		obj.style.display = "block";
992	} else {
993		obj.style.display = "none";
994	}
995}
996
997function ImageError(el, url) {
998
999	if(url && url.toUpperCase() == "TEXTMODE") {
1000		if(el) el.parentNode.innerHTML = "<span><table width='" + (el.width * 1) + "' height='" + (el.height * 1)+ "' cellpadding='0' cellspacing='0' style='border:1px solid #f2f2f2;'><tr><td style='font-family:arial;color:#d0d0d0'>No Image.</td></tr></table></span>";
1001	} else {
1002		var noimg = new Image();
1003		noimg.src = url ? url : "../html/images/global/noimage.jpg";
1004		noimg.onerror = function() {
1005			//alert("[개발 Debug] common.js - function ImageError() 오류 : \n" + noimg.src + ' 파일이 존재 하지 않습니다.');
1006			return false;
1007		}
1008		if(el) el.src = noimg.src;
1009	}
1010}
1011
1012function addSelectOption(element, val, txt) {
1013	var opt = element.ownerDocument.createElement("option");
1014	opt.setAttribute("value", val);
1015	opt.appendChild(element.ownerDocument.createTextNode(txt));
1016	element.appendChild(opt);
1017}
1018function removeSelectOption(element, idx) {
1019	var opts = element.getElementsByTagName("option");
1020	if (idx < 0 || idx > (opts.length - 1)) return;
1021	element.removeChild(opts[idx]);
1022}
1023
1024function p(el, type) {
1025	var attributes = new Array(); var i = 0;
1026	for(e in el) {
1027		if(!type && !el[e]) continue;
1028		attributes[i] = e + "=" + el[e];
1029		i++;
1030	}
1031	if(document.body) {
1032		document.body.innerHTML = "<div style='position:absolute;top:10px;left:10px;overflow:auto;width:95%;height:95%;background:#f7f7f7;z-index:100'>" + attributes.join("<br>") + "</div>";
1033	} else {
1034		alert(attributes.join("\n"));
1035	}
1036}
1037
1038function pngfilter(el) {
1039
1040	if (/MSIE (5\.5|6\.0)/.test(navigator.userAgent)) {
1041		// 쓸데 없어 보이지만 중요함
1042		if(el.width != 0) {
1043			el.width = el.width;
1044			el.height = el.height;
1045		}
1046
1047		var img = new Image();
1048		img.src = el.src;
1049		el.src = "../html/css/blank.gif";
1050		el.style.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+ img.src +'",sizingMethod="scale")';
1051	}
1052}
1053
1054function iepngfix(element) {
1055	if (/MSIE (5\.5|6\.0)/.test(navigator.userAgent)) {
1056		if(element) var imgs = element.getElementsByTagName("IMG");
1057		else var imgs = document.getElementsByTagName("IMG");
1058		for(var i=0; i<imgs.length; i++) {
1059			if(imgs[i].src.substring(imgs[i].src.length - 4).toLowerCase() == ".png") {
1060				pngfilter(imgs[i]);
1061			}
1062		}
1063	}
1064}
1065
1066function changeYear(element, d, num, limit) {
1067	if(!element) return;
1068	if(!num) num = 5;
1069	var year = parseInt(element.value * 1);
1070	var org = d ? d : element.value;
1071	if(!year) year = !d ? new Date().getFullYear() : d;
1072	year = parseInt(year * 1);
1073	var head = "";
1074	if(element.options.length > 0) {
1075		head = element.options[0].value == "" ? element.options[0].text : "";
1076	}
1077	var pattern = /[^0-9]/;
1078	var add = "";
1079	if(element.options.length > 1) {
1080		var idx = 0;
1081		for(var i=0; i<element.options.length; i++) {
1082			if(element.options[i].value) { idx = i; break; }
1083		}
1084		add = pattern.test(element.options[idx].text);
1085	}
1086	element.options.length = 0; var j = 0;
1087	if(head) {
1088		element.options[0] = new Option(head, "", false);
1089		j++;
1090	}
1091
1092	var max = year + num;
1093	if(limit && max > limit) max = limit;
1094	for (var i=year-num; i<=max; i++, j++) {
1095		element.options[j] = new Option(i + (add ? "년" : ""), i, false);
1096		if (i == org) element.options[j].selected = true;
1097	}
1098}
1099
1100Offset = function(element) {
1101	this.obj = element;
1102	this.left;
1103	this.top;
1104	this.height;
1105	this.width;
1106	this.centerLeft;
1107	this.getOffset();
1108}
1109Offset.prototype.getOffset = function() {
1110	var obj = this.obj;
1111	var top = left = 0;
1112	if (obj.offsetParent) {
1113		do {
1114			top += obj.offsetTop;
1115			left +=
1116			obj.offsetLeft;
1117		} while(obj = obj.offsetParent);
1118	}
1119	this.left = left;
1120	this.top = top;
1121	this.width = this.obj.offsetWidth;
1122	this.height = this.obj.offsetHeight;
1123	this.centerLeft = this.left + Math.round(this.width/2);
1124}
1125
1126function number_format( number, decimals, dec_point, thousands_sep ) {
1127	if(typeof number == "string") number = number.replace(/,/g, "");
1128    var n = !isNaN(number) ? number * 1.0 : 0.00;
1129
1130    decimals = isNaN(decimals = Math.abs(decimals)) ? 0 : decimals;
1131    var decSeparator = decSeparator == undefined ? "." : dec_point;
1132    var thouSeparator = thouSeparator == undefined ? "," : thousands_sep;
1133    var sign = n < 0 ? "-" : "";
1134    var i = parseInt(n = Math.abs(+n || 0).toFixed(decimals)) + "";
1135    var j = (j = i.length) > 3 ? j % 3 : 0;
1136
1137    return sign + (j ? i.substr(0, j) + thouSeparator : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + thouSeparator) + (decimals ? decSeparator + Math.abs(n - i).toFixed(decimals).slice(2) : "");
1138}
1139
1140function addslashes( str ) {
1141    return str.replace('/(["\'\])/g', "\\$1").replace('/\0/g', "\\0");
1142}
1143
1144function strip_tags(input,allowed){allowed=(((allowed||"")+"").toLowerCase().match(/<[a-z][a-z0-9]*>/g)||[]).join('');var tags=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,commentsAndPhpTags=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return input.replace(commentsAndPhpTags,'').replace(tags,function($0,$1){return allowed.indexOf('<'+$1.toLowerCase()+'>')>-1?$0:'';});}
1145
1146
1147function in_array(needle, haystack, strict) {
1148    var found = false, key, strict = !!strict;
1149    for (key in haystack) {
1150        if ((strict && haystack[key] === needle) || (!strict && haystack[key] == needle)) {
1151            found = true;
1152            break;
1153        }
1154    }
1155    return found;
1156}
1157
1158/*
1159var descpreload = new Image(); descpreload.src = "/html/images/admin/common/s_desc.gif";
1160var ascpreload = new Image(); ascpreload.src = "/html/images/admin/common/s_asc.gif";
1161*/
1162function ListSort(element, ord) {
1163	if(element) {
1164		document.forms['form1']['ord'].value = element.getAttribute("id").replace("CL_", "") + " " + (ord.indexOf(" ASC") != -1 ? "DESC" : "ASC");
1165		document.forms['form1'].submit();
1166	} else {
1167		var arr = ord.split(" ");
1168		var element = document.getElementById("CL_" + arr[0])
1169		if(element && arr.length == 2) {
1170			var arrow = arr[1] == "ASC" ? ' <img src="/_omg/html/images/admin/common/s_asc.gif">' : ' <img src="/_omg/html/images/admin/common/s_desc.gif">';
1171			//var arrow = arr[1] == "ASC" ? ' <i class="icon-caret-up" style="color:red"></i>' : ' <i class="icon-caret-down" style="color:red"></i>';
1172			element.innerHTML = element.innerHTML + arrow;
1173		}
1174	}
1175}
1176
1177function removeAttr(formName, keys, type) {
1178	var f = document.forms[formName];
1179	if(!f) return;
1180	type = !type ? "required" : type;
1181	var arr = keys.replace(/ +/g, "").split(",");
1182
1183	for(var i=0; i<arr.length; i++) {
1184		if(f[arr[i]]) {
1185			var el = f[arr[i]];
1186			if (el.type != "select-one" && el.length > 1) el = el[0];
1187			el.removeAttribute(type);
1188		}
1189	}
1190}
1191function setAttr(formName, keys, type, value) {
1192	var f = document.forms[formName];
1193	if(!f) return;
1194	var arr = keys.replace(/ +/g, "").split(",");
1195	for(var i=0; i<arr.length; i++) {
1196		if(f[arr[i]]) {
1197			var el = f[arr[i]];
1198			if (el.type != "select-one" && el.length > 1) el = el[0];
1199			el.setAttribute(type, value);
1200		}
1201	}
1202}
1203
1204function addEvent(type, func, element) {
1205	type = type.replace("on", "");
1206	if(!element) element = window;
1207	if(element.addEventListener) element.addEventListener(type, func, false);
1208	else if(element.attachEvent) element.attachEvent("on" + type, func);
1209}
1210
1211function deleteEvent(type, func, element) {
1212	type = type.replace("on", "");
1213	if(!element) element = window;
1214	if(element.removeEventListener) element.removeEventListener(type, func, false);
1215	else if(element.detachEvent) element.detachEvent("on" + type, func);
1216}
1217
1218function Player(url, width, height, img, autostart) {
1219	if(!autostart) autostart = "true";
1220	var type = url.substring(url.lastIndexOf(".") + 1, url.length).toLowerCase();
1221	var player = "";
1222	switch(type) {
1223		case "avi" :
1224		case "wmv" :
1225		case "wma" :
1226			player = '<object style="filter:gray();" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"'
1227			+ ' codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"'
1228			+ ' width="' + width + '"'
1229			+ ' height="' + height + '">'
1230			+ '<param name="URL" value="' + url + '" />'
1231			+ '<param name="allowFullScreen" value="true">'
1232			+ '<param name="rate" value="1" />'
1233			+ '<param name="balance" value="0" />'
1234			+ '<param name="currentPosition" value="0" />'
1235			+ '<param name="defaultFrame" />'
1236			+ '<param name="playCount" value="1" />'
1237			+ '<param name="autoStart" value="' + autostart + '" />'
1238			+ '<param name="currentMarker" value="0" />'
1239			+ '<param name="invokeURLs" value="-1" />'
1240			+ '<param name="baseURL" />'
1241			+ '<param name="volume" value="50" />'
1242			+ '<param name="mute" value="0" />'
1243			+ '<param name="uiMode" value="full" />'
1244			+ '<param name="stretchToFit" value="0" />'
1245			+ '<param name="windowlessVideo" value="0" />'
1246			+ '<param name="enabled" value="-1" />'
1247			+ '<param name="enableContextMenu" value="-1" />'
1248			+ '<param name="fullScreen" value="0" />'
1249			+ '<param name="SAMIStyle" />'
1250			+ '<param name="SAMILang" />'
1251			+ '<param name="SAMIFilename" />'
1252			+ '<param name="captioningID" />'
1253			+ '<param name="enableErrorDialogs" value="true" />'
1254			+ '<embed src="' + url + '" type="application/x-mplayer2" allowFullScreen="true" width="' + width + '" height="' + height + '" autostart="' + autostart + '"></embed>'
1255			+ '</object>';
1256			break;
1257		case "mp4" :
1258		case "flv" :
1259			player = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
1260			+ ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"'
1261			+ ' width="' + width + '"'
1262			+ ' height="' + height + '"'
1263			+ '><param name="src" value="/player/player.swf?stretching=exactit&autostart=true&file=' + url + '">'
1264			+ '<param name="allowFullScreen" value="true">'
1265			+ '<param name="stretching" value="exactit">'
1266			+ '<param name="width" value="' + width + '">'
1267			+ '<param name="height" value="' + height + '">'
1268			+ '<param name="autostart" value="true" />'
1269			+ '<param name="bgcolor" value="#ffffff" />'
1270			+ '<param name="wmode" value="transparent" />'
1271			+ '<embed type="application/x-shockwave-flash"'
1272			+ ' src="/player/player.swf?stretching=exactit&autostart=true&file=' + url + '"'
1273			+ ' bgcolor="#ffffff"'
1274			+ ' width="' + width + '"'
1275			+ ' height="' + height + '"'
1276			+ ' salign="TL"'
1277			+ ' scale="noScale"'
1278			+ ' allowScriptAccess="always"'
1279			+ ' allowFullScreen="true"'
1280			+ ' stretching="exactit"'
1281			+ ' type="application/x-shockwave-flash"'
1282			+ ' wmode="transparent"'
1283			+ ' pluginspage="http://www.macromedia.com/go/getflashplayer" />'
1284			+ '</embed></object>';
1285			break;
1286		defalue :
1287			break;
1288	}
1289	document.write(player);
1290}
1291
1292function phoneNumber(el) {
1293	el.value = _phoneNumber(el.value);
1294}
1295function _phoneNumber(value) {
1296	value = value.replace(/[^0-9]/g, "")
1297	var pattern = new RegExp("^(02|[0-9]{3})([0-9]{" + (value.length <= (/^02/.test(value) ? 9 : 10) ? 3 : 4) + "})?([0-9]{4})?");
1298	var arr = value.replace(pattern, "$1-$2-$3").replace(/--/g, "-").split("-");
1299	if(arr[2]) arr[2] = arr[2].substring(0, 4);
1300	return arr.join("-", arr);
1301}
1302function ssNumber(el) {
1303	el.value = _ssNumber(el.value);
1304}
1305function _ssNumber(value) {
1306	value = value.replace(/[^0-9]/g, "")
1307	var pattern = new RegExp("^([0-9]{6})([0-9]{7})?");
1308	var arr = value.replace(pattern, "$1-$2").replace(/--/g, "-").split("-");
1309	if(arr[1]) arr[1] = arr[1].substring(0, 7);
1310	return arr.join("-", arr);
1311}
1312function bizNumber(el) {
1313	el.value = _bizNumber(el.value);
1314}
1315function _bizNumber(value) {
1316	value = value.replace(/[^0-9]/g, "")
1317	var pattern = new RegExp("^([0-9]{3})([0-9]{2})?([0-9]{5})?");
1318	var arr = value.replace(pattern, "$1-$2-$3").replace(/--/g, "-").split("-");
1319	if(arr[2]) arr[2] = arr[2].substring(0, 5);
1320	return arr.join("-", arr);
1321}
1322
1323function toggleTableRow(trElement, display) {
1324	if(!display) display = trElement.style.display == "none" ? "block" : "none";
1325	if(display == "none") {
1326		trElement.style.display = "none";
1327	} else {
1328		try { trElement.style.display = "table-row"; }
1329		catch(e) { trElement.style.display = "block"; }
1330	}
1331}
1332
1333function _setDate(date, ymd) {
1334	ymd = ymd.replace(/-/g, '');
1335	date.setFullYear(ymd.substring(0, 4));
1336	date.setMonth(ymd.substring(4, 6) * 1 - 1);
1337	date.setDate(ymd.substring(6, 8) * 1);
1338	return date;
1339}
1340function addDate(type, diff, d, format) {
1341	var date = _setDate(new Date(), dateFormat(d ? d : new Date()));
1342	type = type.toUpperCase();
1343	if(type == "Y") date.setFullYear(date.getFullYear() + diff);
1344	if(type == "M") date.setMonth(date.getMonth() + diff);
1345	if(type == "D") date.setDate(date.getDate() + diff);
1346	return format ? dateFormat(date) : date;
1347}
1348function dateFormat(date, j) {
1349    if(!j) j = "-";
1350    return date.getFullYear()
1351        + j + ((date.getMonth() + 1 < 10 ? "0" : "") + (date.getMonth() + 1))
1352        + j + ((date.getDate() < 10 ? "0" : "") + date.getDate());
1353}
1354function checkDate(first, last) {
1355	if(first.value && last.value) {
1356		var sdate = new Date(first.value);
1357		var edate = new Date(last.value);
1358		if(edate < sdate) {
1359			var stitle = first.title || first.hname || "시작일";
1360			var etitle = last.title || last.hname || "종료일";
1361			alert(etitle + "은 " + stitle + "보다 같거나 나중이어야 합니다.");
1362			last.focus();
1363		} else {
1364			return true;
1365		}
1366	}
1367	return false;
1368}
1369
1370//DOMloadcomplete
1371var ready = (function () {
1372    var ready_event_fired = false;
1373    var ready_event_listener = function (fn) {
1374        var idempotent_fn = function () {
1375            if (ready_event_fired) { return; }
1376            ready_event_fired = true;
1377            return fn();
1378        }
1379        var do_scroll_check = function () {
1380            if (ready_event_fired) { return; }
1381            try { document.documentElement.doScroll('left'); }
1382            catch(e) { setTimeout(do_scroll_check, 1); return; }
1383            return idempotent_fn();
1384        }
1385        if (document.readyState === "complete") {
1386            return idempotent_fn();
1387        }
1388        if (document.addEventListener) {
1389            document.addEventListener("DOMContentLoaded", idempotent_fn, false);
1390            window.addEventListener("load", idempotent_fn, false);
1391        } else if (document.attachEvent) {
1392           // document.attachEvent("onreadystatechange", idempotent_fn);
1393            window.attachEvent("onload", idempotent_fn);
1394            var toplevel = false;
1395            try { toplevel = window.frameElement == null; } catch (e) {}
1396            if (document.documentElement.doScroll && toplevel) {
1397                return do_scroll_check();
1398            }
1399        }
1400    };
1401    return ready_event_listener;
1402})();
1403
1404
1405$(document).ready(function() {
1406
1407	$(".file01").each(function() {
1408		var a = this;
1409		var x = document.createElement("a");
1410		x.setAttribute("href", "javascript:void(0)");
1411		x.innerHTML = '&nbsp;<img src="/_omg/html/images/admin/btn/btn_x.gif" style="vertical-align:-3px;">';
1412
1413		a.parentNode.insertBefore(x, a.nextSibling);
1414		x.onclick = function() { _goFileDelete(this.previousSibling, this); }
1415	});
1416	$(".image01").each(function() {
1417		var a = this;
1418		a.onmouseover = function() { previewImg(a); }
1419		a.onmouseout = function() { hidePreviewImage(); }
1420	});
1421//	$("input, textarea").placeholder();
1422});
1423function _goFileDelete(a, x) {
1424	if(!confirm("삭제하시겠습니까?")) return;
1425	if(a.getAttribute("del")) {
1426		call(a.getAttribute("del"), "test");
1427		a.parentNode.removeChild(a);
1428		x.parentNode.removeChild(x);
1429	}
1430}
1431
1432
1433/*! http://mths.be/placeholder v2.0.7 by @mathias */
1434/*
1435(function(window, document, $) {
1436
1437	var isInputSupported = 'placeholder' in document.createElement('input');
1438	var isTextareaSupported = 'placeholder' in document.createElement('textarea');
1439	var prototype = $.fn;
1440	var valHooks = $.valHooks;
1441	var propHooks = $.propHooks;
1442	var hooks;
1443	var placeholder;
1444
1445	if (isInputSupported && isTextareaSupported) {
1446
1447		placeholder = prototype.placeholder = function() {
1448			return this;
1449		};
1450
1451		placeholder.input = placeholder.textarea = true;
1452
1453	} else {
1454
1455		placeholder = prototype.placeholder = function() {
1456			var $this = this;
1457			$this
1458				.filter((isInputSupported ? 'textarea' : ':input') + '[placeholder]')
1459				.not('.placeholder')
1460				.bind({
1461					'focus.placeholder': clearPlaceholder,
1462					'blur.placeholder': setPlaceholder
1463				})
1464				.data('placeholder-enabled', true)
1465				.trigger('blur.placeholder');
1466			return $this;
1467		};
1468
1469		placeholder.input = isInputSupported;
1470		placeholder.textarea = isTextareaSupported;
1471
1472		hooks = {
1473			'get': function(element) {
1474				var $element = $(element);
1475
1476				var $passwordInput = $element.data('placeholder-password');
1477				if ($passwordInput) {
1478					return $passwordInput[0].value;
1479				}
1480
1481				return $element.data('placeholder-enabled') && $element.hasClass('placeholder') ? '' : element.value;
1482			},
1483			'set': function(element, value) {
1484				var $element = $(element);
1485
1486				var $passwordInput = $element.data('placeholder-password');
1487				if ($passwordInput) {
1488					return $passwordInput[0].value = value;
1489				}
1490
1491				if (!$element.data('placeholder-enabled')) {
1492					return element.value = value;
1493				}
1494				if (value == '') {
1495					element.value = value;
1496					// Issue #56: Setting the placeholder causes problems if the element continues to have focus.
1497					if (element != safeActiveElement()) {
1498						// We can't use `triggerHandler` here because of dummy text/password inputs :(
1499						setPlaceholder.call(element);
1500					}
1501				} else if ($element.hasClass('placeholder')) {
1502					clearPlaceholder.call(element, true, value) || (element.value = value);
1503				} else {
1504					element.value = value;
1505				}
1506				// `set` can not return `undefined`; see http://jsapi.info/jquery/1.7.1/val#L2363
1507				return $element;
1508			}
1509		};
1510
1511		if (!isInputSupported) {
1512			valHooks.input = hooks;
1513			propHooks.value = hooks;
1514		}
1515		if (!isTextareaSupported) {
1516			valHooks.textarea = hooks;
1517			propHooks.value = hooks;
1518		}
1519
1520		$(function() {
1521			// Look for forms
1522			$(document).delegate('form', 'submit.placeholder', function() {
1523				// Clear the placeholder values so they don't get submitted
1524				var $inputs = $('.placeholder', this).each(clearPlaceholder);
1525				setTimeout(function() {
1526					$inputs.each(setPlaceholder);
1527				}, 10);
1528			});
1529		});
1530
1531		// Clear placeholder values upon page reload
1532		$(window).bind('beforeunload.placeholder', function() {
1533			$('.placeholder').each(function() {
1534				this.value = '';
1535			});
1536		});
1537
1538	}
1539
1540	function args(elem) {
1541		// Return an object of element attributes
1542		var newAttrs = {};
1543		var rinlinejQuery = /^jQuery\d+$/;
1544		$.each(elem.attributes, function(i, attr) {
1545			if (attr.specified && !rinlinejQuery.test(attr.name)) {
1546				newAttrs[attr.name] = attr.value;
1547			}
1548		});
1549		return newAttrs;
1550	}
1551
1552	function clearPlaceholder(event, value) {
1553		var input = this;
1554		var $input = $(input);
1555		if (input.value == $input.attr('placeholder') && $input.hasClass('placeholder')) {
1556			if ($input.data('placeholder-password')) {
1557				$input = $input.hide().next().show().attr('id', $input.removeAttr('id').data('placeholder-id'));
1558				// If `clearPlaceholder` was called from `$.valHooks.input.set`
1559				if (event === true) {
1560					return $input[0].value = value;
1561				}
1562				$input.focus();
1563			} else {
1564				input.value = '';
1565				$input.removeClass('placeholder');
1566				input == safeActiveElement() && input.select();
1567			}
1568		}
1569	}
1570
1571	function setPlaceholder() {
1572		var $replacement;
1573		var input = this;
1574		var $input = $(input);
1575		var id = this.id;
1576		if (input.value == '') {
1577			if (input.type == 'password') {
1578				if (!$input.data('placeholder-textinput')) {
1579					try {
1580						$replacement = $input.clone().attr({ 'type': 'text' });
1581					} catch(e) {
1582						$replacement = $('<input>').attr($.extend(args(this), { 'type': 'text' }));
1583					}
1584					$replacement
1585						.removeAttr('name')
1586						.data({
1587							'placeholder-password': $input,
1588							'placeholder-id': id
1589						})
1590						.bind('focus.placeholder', clearPlaceholder);
1591					$input
1592						.data({
1593							'placeholder-textinput': $replacement,
1594							'placeholder-id': id
1595						})
1596						.before($replacement);
1597				}
1598				$input = $input.removeAttr('id').hide().prev().attr('id', id).show();
1599				// Note: `$input[0] != input` now!
1600			}
1601			$input.addClass('placeholder');
1602			$input[0].value = $input.attr('placeholder');
1603		} else {
1604			$input.removeClass('placeholder');
1605		}
1606	}
1607
1608	function safeActiveElement() {
1609		// Avoid IE9 `document.activeElement` of death
1610		// https://github.com/mathiasbynens/jquery-placeholder/pull/99
1611		try {
1612			return document.activeElement;
1613		} catch (err) {}
1614	}
1615
1616}(this, document, jQuery));
1617*/
1618
1619var agent = navigator.userAgent;
1620var isMobile = false;
1621var mobileKeyWords = new Array("iPhone", "iPod", "iPad", "BlackBerry", "Android", "Windows CE", "LG", "MOT", "SAMSUNG", "SonyEricsson");
1622for(var i=0; i<mobileKeyWords.length; i++) {
1623	if(agent.indexOf(mobileKeyWords[i]) != -1) { isMobile = true; break; }
1624}
1625var iPhone = agent.indexOf("iPhone") != -1;
1626
1627function setPeriodDate() { }
1628
1629
1630var Mobile = {
1631    Android: function() {
1632        return navigator.userAgent.match(/Android/i);
1633    },
1634    BlackBerry: function() {
1635        return navigator.userAgent.match(/BlackBerry/i);
1636    },
1637    iOS: function() {
1638        return navigator.userAgent.match(/iPhone|iPad|iPod/i);
1639    },
1640    Opera: function() {
1641        return navigator.userAgent.match(/Opera Mini/i);
1642    },
1643    Windows: function() {
1644        return navigator.userAgent.match(/IEMobile/i);
1645    },
1646    any: function() {
1647        return (Mobile.Android() || Mobile.BlackBerry() || Mobile.iOS() || Mobile.Opera() || Mobile.Windows());
1648    }
1649};
1650
1651
1652
1653
1654function OpenLayerNoScroll(nLink, nTarget, nWidth, nHeight, xPos, yPos, scr) {
1655
1656	$("body").addClass("noscroll");
1657	
1658	var layerId = new Date().getTime();
1659	GlobalLayers.push(layerId);
1660	TopLayer = layerId;
1661
1662	var dim = document.createElement("div");
1663	document.body.appendChild(dim);
1664	dim.className = "dim-layer";
1665	dim.id = "dim-layer" + layerId;
1666	dim.style.position = "absolute";
1667	dim.style.zIndex = 999999 + GlobalLayers.length;
1668	dim.style.background = " url(/common/images/default/opa_bg.png) repeat 100% 100%";
1669//	dim.style.filter = "alpha(opacity=50)";
1670//	dim.style.opacity = 0.5;
1671	dim.style.top = "0px";
1672	dim.style.left = "0px";
1673	dim.style.width = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth) + "px";
1674	dim.style.height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) + "px";
1675
1676	var wrap = document.createElement("div");
1677	wrap.id = "wrap-layer" + layerId;
1678	wrap.style.position = "fixed";
1679	wrap.style.zIndex = 999999 + GlobalLayers.length + 1;
1680	wrap.style.padding = "0px";
1681	wrap.style.background = "#fff";
1682	
1683//	wrap.style.border = "2px solid #777";
1684//	wrap.style.borderRadius = "5px";
1685//	wrap.style.boxShadow = "0 0 15px #222";
1686//	wrap.style.cursor = "move";
1687
1688	var ch = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight;
1689	var cw = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth;
1690	if(xPos == "left") wrap.style.left = "5px";
1691	else if(xPos == "right") wrap.style.right = "5px";
1692	if(yPos == "top") wrap.style.top = "5px";
1693	else if(yPos == "bottom") wrap.style.bottom = "30px";
1694
1695	var ay = 40, ax = 38;
1696	if(isMobile) { ay = 20; ax = 20; }
1697	if((nWidth + "").indexOf("%") != -1) nWidth = nWidth.replace("%", "") * 1 / 100 * cw - ax - 55;
1698	if((nHeight + "").indexOf("%") != -1) nHeight = nHeight.replace("%", "") * 1 / 100 * ch - ay - 55;
1699
1700	if(typeof(yPos) != 'string') wrap.style.top = (typeof(yPos) == 'number' ? yPos : (ch / 2 - nHeight/2 - ay)) + "px";
1701	if(typeof(xPos) != 'string') wrap.style.left = (typeof(xPos) == 'number' ? xPos : (cw / 2 - nWidth / 2 - ax)) + "px";
1702
1703/*
1704	var btn = document.createElement("div");
1705	btn.id = "btn-close" + layerId;
1706	btn.style.position = "absolute";
1707	btn.style.zIndex = 999999 + GlobalLayers.length + 2;
1708
1709	if(isMobile) {
1710		btn.style.top = "3px";
1711		btn.style.right = "10px";
1712	} else {
1713		btn.style.top = "0px";
1714		btn.style.right = "0px";
1715	}
1716
1717	btn.innerHTML = '<a href="javascript:;" onclick="CloseLayer(); return false;" style="display:block;"><img src="/common/images/cbt/btn_cclose.png" alt="닫기"></a>';
1718	btn.innerHTML = "<button type='button' class='btn_cclose fl_r' onclick='CloseLayer();'><img src='/common/images/cbt/btn_cclose.png' alt='닫기' /></button>";
1719*/
1720	var frm = document.createElement("iframe");
1721	frm.width = nWidth;
1722	frm.height = nHeight;
1723	frm.frameBorder = 0;
1724	frm.scrolling = "no";
1725	frm.src = nLink;
1726	frm.setAttribute("name", nTarget);
1727	frm.setAttribute("id", nTarget);
1728
1729//	wrap.appendChild(btn);
1730	wrap.appendChild(frm);
1731
1732	document.body.appendChild(wrap);
1733
1734	wrap.ondblclick = function() {
1735		frm.src = frm.src;
1736	}
1737
1738	if(isMobile) {	
1739		if(!iPhone) {
1740//			addEvent("onresize", function() { try { CloseLayer(); } catch(e) {} });
1741/*			addEvent("onresize", function() { try {
1742				alert(wrap.style.width);
1743				alert(window.width);
1744			} catch(e) {} });
1745*/
1746		}
1747	} else {
1748		addEvent("onkeydown", keydownListener2, document.body);		
1749	}
1750
1751	addEvent("onresize", function() {
1752		dim.style.width = Math.max(document.body.scrollWidth, document.documentElement.scrollWidth) + "px";
1753		dim.style.height = Math.max(document.body.scrollHeight, document.documentElement.scrollHeight) + "px";
1754		
1755		wrap.style.overflow = "scroll";
1756
1757	});
1758
1759}
1760
1761function keydownListener2(e) {
1762	var ev = e || Event;
1763	
1764//	if(ev.keyCode == 8 || ev.keyCode == 116) { e.returnValue = false; }
1765//	else e.returnValue = true;
1766}

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.