PageSourceSearch

https://ad-com.kr/js_renew/common.js

js ad-com.kr collected 2026-10-09 22:39:43 UTC 15,354 bytes, 483 lines download raw bytes

1if (typeof(COMMON_JS) == 'undefined') { // 한번만 실행
2    var COMMON_JS = true;
3
4    // 전역 변수
5    var errmsg = "";
6    var errfld;
7
8    // 필드 검사
9    function check_field(fld, msg) 
10    {
11        if ((fld.value = trim(fld.value)) == "") 			   
12            error_field(fld, msg);
13        else
14            clear_field(fld);
15        return;
16    }
17
18    // 필드 오류 표시
19    function error_field(fld, msg) 
20    {
21        if (msg != "")
22            errmsg += msg + "\n";
23        if (!errfld) errfld = fld;
24        fld.style.background = "#BDDEF7";
25    }
26
27    // 필드를 깨끗하게
28    function clear_field(fld) 
29    {
30        fld.style.background = "#FFFFFF";
31    }
32
33    function trim(s)
34    {
35        var t = "";
36        var from_pos = to_pos = 0;
37
38        for (i=0; i<s.length; i++)
39        {
40            if (s.charAt(i) == ' ')
41                continue;
42            else 
43            {
44                from_pos = i;
45                break;
46            }
47        }
48
49        for (i=s.length; i>=0; i--)
50        {
51            if (s.charAt(i-1) == ' ')
52                continue;
53            else 
54            {
55                to_pos = i;
56                break;
57            }
58        }	
59
60        t = s.substring(from_pos, to_pos);
61        //				alert(from_pos + ',' + to_pos + ',' + t+'.');
62        return t;
63    }
64
65    // 자바스크립트로 PHP의 number_format 흉내를 냄
66    // 숫자에 , 를 출력
67    function number_format(data) 
68    {
69        
70        var tmp = '';
71        var number = '';
72        var cutlen = 3;
73        var comma = ',';
74        var i;
75       
76        len = data.length;
77        mod = (len % cutlen);
78        k = cutlen - mod;
79        for (i=0; i<data.length; i++) 
80        {
81            number = number + data.charAt(i);
82            
83            if (i < data.length - 1) 
84            {
85                k++;
86                if ((k % cutlen) == 0) 
87                {
88                    number = number + comma;
89                    k = 0;
90                }
91            }
92        }
93
94        return number;
95    }
96
97    // 새 창
98    function popup_window(url, winname, opt)
99    {
100        window.open(url, winname, opt);
101    }
102
103
104    // 폼메일 창
105    function popup_formmail(url)
106    {
107        opt = 'scrollbars=yes,width=417,height=385,top=10,left=20';
108        popup_window(url, "wformmail", opt);
109    }
110
111    // , 를 없앤다.
112    function no_comma(data)
113    {
114        var tmp = '';
115        var comma = ',';
116        var i;
117
118        for (i=0; i<data.length; i++)
119        {
120            if (data.charAt(i) != comma)
121                tmp += data.charAt(i);
122        }
123        return tmp;
124    }
125
126    // 삭제 검사 확인
127    function del(href) 
128    {
129        if(confirm("한번 삭제한 자료는 복구할 방법이 없습니다.\n\n정말 삭제하시겠습니까?")) {
130            if (g4_charset.toUpperCase() == 'EUC-KR') 
131                document.location.href = href;
132            else
133                document.location.href = encodeURI(href);
134        }
135    }
136
137    // 쿠키 입력
138    function set_cookie(name, value, expirehours, domain) 
139    {
140        var today = new Date();
141        today.setTime(today.getTime() + (60*60*1000*expirehours));
142        document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + today.toGMTString() + ";";
143        if (domain) {
144            document.cookie += "domain=" + domain + ";";
145        }
146    }
147
148    // 쿠키 얻음
149    function get_cookie(name) 
150    {
151        var find_sw = false;
152        var start, end;
153        var i = 0;
154
155        for (i=0; i<= document.cookie.length; i++)
156        {
157            start = i;
158            end = start + name.length;
159
160            if(document.cookie.substring(start, end) == name) 
161            {
162                find_sw = true
163                break
164            }
165        }
166
167        if (find_sw == true) 
168        {
169            start = end + 1;
170            end = document.cookie.indexOf(";", start);
171
172            if(end < start)
173                end = document.cookie.length;
174
175            return document.cookie.substring(start, end);
176        }
177        return "";
178    }
179
180    // 쿠키 지움
181    function delete_cookie(name) 
182    {
183        var today = new Date();
184
185        today.setTime(today.getTime() - 1);
186        var value = get_cookie(name);
187        if(value != "")
188            document.cookie = name + "=" + value + "; path=/; expires=" + today.toGMTString();
189    }
190
191    // 이미지의 크기에 따라 새창의 크기가 변경됩니다.
192    // zzzz님께서 알려주셨습니다. 2005/04/12
193    function image_window(img)
194    {
195        var w = img.tmp_width; 
196        var h = img.tmp_height; 
197        var winl = (screen.width-w)/2; 
198        var wint = (screen.height-h)/3; 
199
200        if (w >= screen.width) { 
201            winl = 0; 
202            h = (parseInt)(w * (h / w)); 
203        } 
204
205        if (h >= screen.height) { 
206            wint = 0; 
207            w = (parseInt)(h * (w / h)); 
208        } 
209
210        var js_url = "<script type='text/javascript'> \n"; 
211            js_url += "<!-- \n"; 
212            js_url += "var ie=document.all; \n"; 
213            js_url += "var nn6=document.getElementById&&!document.all; \n"; 
214            js_url += "var isdrag=false;
214 \n"; 
215            js_url += "var x,y; \n"; 
216            js_url += "var dobj; \n"; 
217            js_url += "function movemouse(e) \n"; 
218            js_url += "{ \n"; 
219            js_url += "  if (isdrag) \n"; 
220            js_url += "  { \n"; 
221            js_url += "    dobj.style.left = nn6 ? tx + e.clientX - x : tx + event.clientX - x; \n"; 
222            js_url += "    dobj.style.top  = nn6 ? ty + e.clientY - y : ty + event.clientY - y; \n"; 
223            js_url += "    return false; \n"; 
224            js_url += "  } \n"; 
225            js_url += "} \n"; 
226            js_url += "function selectmouse(e) \n"; 
227            js_url += "{ \n"; 
228            js_url += "  var fobj      = nn6 ? e.target : event.srcElement; \n"; 
229            js_url += "  var topelement = nn6 ? 'HTML' : 'BODY'; \n"; 
230            js_url += "  while (fobj.tagName != topelement && fobj.className != 'dragme') \n"; 
231            js_url += "  { \n"; 
232            js_url += "    fobj = nn6 ? fobj.parentNode : fobj.parentElement; \n"; 
233            js_url += "  } \n"; 
234            js_url += "  if (fobj.className=='dragme') \n"; 
235            js_url += "  { \n"; 
236            js_url += "    isdrag = true; \n"; 
237            js_url += "    dobj = fobj; \n"; 
238            js_url += "    tx = parseInt(dobj.style.left+0); \n"; 
239            js_url += "    ty = parseInt(dobj.style.top+0); \n"; 
240            js_url += "    x = nn6 ? e.clientX : event.clientX; \n"; 
241            js_url += "    y = nn6 ? e.clientY : event.clientY; \n"; 
242            js_url += "    document.onmousemove=movemouse; \n"; 
243            js_url += "    return false; \n"; 
244            js_url += "  } \n"; 
245            js_url += "} \n"; 
246            js_url += "document.onmousedown=selectmouse; \n"; 
247            js_url += "document.onmouseup=new Function('isdrag=false'); \n"; 
248            js_url += "//--> \n"; 
249            js_url += "</"+"script> \n"; 
250
251        var settings;
252
253        if (g4_is_gecko) {
254            settings  ='width='+(w+10)+','; 
255            settings +='height='+(h+10)+','; 
256        } else {
257            settings  ='width='+w+','; 
258            settings +='height='+h+','; 
259        }
260        settings +='top='+wint+','; 
261        settings +='left='+winl+','; 
262        settings +='scrollbars=no,'; 
263        settings +='resizable=yes,'; 
264        settings +='status=no'; 
265
266
267        win=window.open("","image_window",settings); 
268        win.document.open(); 
269        win.document.write ("<html><head> \n<meta http-equiv='imagetoolbar' CONTENT='no'> \n<meta http-equiv='content-type' content='text/html; charset="+g4_charset+"'>\n"); 
270        var size = "이미지 사이즈 : "+w+" x "+h;
271        win.document.write ("<title>"+size+"</title> \n"); 
272        if(w >= screen.width || h >= screen.height) { 
273            win.document.write (js_url); 
274            var click = "ondblclick='window.close();
274' style='cursor:move' title=' "+size+" \n\n 이미지 사이즈가 화면보다 큽니다. \n 왼쪽 버튼을 클릭한 후 마우스를 움직여서 보세요. \n\n 더블 클릭하면 닫혀요. '"; 
275        } 
276        else 
277            var click = "onclick='window.close();' style='cursor:pointer' title=' "+size+" \n\n 클릭하면 닫혀요. '"; 
278        win.document.write ("<style>.dragme{position:relative;}</style> \n"); 
279        win.document.write ("</head> \n\n"); 
280        win.document.write ("<body leftmargin=0 topmargin=0 bgcolor=#dddddd style='cursor:arrow;'> \n"); 
281        win.document.write ("<table width=100% height=100% cellpadding=0 cellspacing=0><tr><td align=center valign=middle><img src='"+img.src+"' width='"+w+"' height='"+h+"' border=0 class='dragme' "+click+"></td></tr></table>");
282        win.document.write ("</body></html>"); 
283        win.document.close(); 
284
285        if(parseInt(navigator.appVersion) >= 4){win.window.focus();} 
286    }
287
288    // a 태그에서 onclick 이벤트를 사용하지 않기 위해
289    function win_open(url, name, option)
290    {
291        var popup = window.open(url, name, option);
292        popup.focus();
293    }
294
295    // 우편번호 창
296    function win_zip(frm_name, frm_zip1, frm_zip2, frm_addr1, frm_addr2)
297    {
298        url = g4_path + "/" + g4_bbs + "/zip.php?frm_name="+frm_name+"&frm_zip1="+frm_zip1+"&frm_zip2="+frm_zip2+"&frm_addr1="+frm_addr1+"&frm_addr2="+frm_addr2;
299        win_open(url, "winZip", "left=50,top=50,width=616,height=460,scrollbars=1");
300    }
301
302    // 쪽지 창
303    function win_memo(url)
304    {
305        if (!url)
306            url = g4_path + "/" + g4_bbs + "/memo.php";
307        win_open(url, "winMemo", "left=50,top=50,width=620,height=460,scrollbars=1");
308    }
309
310    // 포인트 창
311    function win_point(url)
312    {
313        win_open(g4_path + "/" + g4_bbs + "/point.php", "winPoint", "left=20, top=20, width=616, height=635, scrollbars=1");
314    }
315
316    // 스크랩 창
317    function win_scrap(url)
318    {
319        if (!url)
320            url = g4_path + "/" + g4_bbs + "/scrap.php";
321        win_open(url, "scrap", "left=20, top=20, width=616, height=500, scrollbars=1");
322    }
323
324    // 새로운 패스워드 분실 창 : 100902
325    function win_password_lost()
326    {
327        win_open(g4_path + "/" + g4_bbs + "/password_lost.php", 'winPasswordLost', 'left=50, top=50, width=617, height=330, scrollbars=1');
328    }
329
330    // 패스워드 분실 창
331    function win_password_forget()
332    {
333        win_open(g4_path + "/" + g4_bbs + "/password_forget.php", 'winPasswordForget', 'left=50, top=50, width=616, height=500, scrollbars=1');
334    }
335
336    // 코멘트 창
337    function win_comment(url)
338    {
339        win_open(url, "winComment", "left=50, top=50, width=800, height=600, scrollbars=1");
340    }
341
342    // 폼메일 창
343    function win_formmail(mb_id, name, email)
344    {
345		if (g4_charset.toLowerCase() == 'euc-kr')
346	        win_open(g4_path+"/" + g4_bbs + "/formmail.php?mb_id="+mb_id+"&name="+name+"&email="+email, "winFormmail", "left=50, top=50, width=600, height=500, scrollbars=0");
347		else
348	        win_open(g4_path+"/" + g4_bbs + "/formmail.php?mb_id="+mb_id+"&name="+encodeURIComponent(name)+"&email="+email, "winFormmail", "left=50, top=50, width=600, height=480, scrollbars=0");
349    }
350
351    // 달력 창
352    function win_calendar(fld, cur_date, delimiter, opt)
353    {
354        if (!opt)
355            opt = "left=50, top=50, width=240, height=230, scrollbars=0,status=0,resizable=0";
356        win_open(g4_path+"/" + g4_bbs + "/calendar.php?fld="+fld+"&cur_date="+cur_date+"&delimiter="+delimiter, "winCalendar", opt);
357    }
358
359    // 설문조사 창
360    function win_poll(url)
361    {
362        if (!url)
363            url = "";
364        win_open(url, "winPoll", "left=50, top=50, width=616, height=500, scrollbars=1");
365    }
366
367    // 자기소개 창
368    function win_profile(mb_id)
369    {
370        win_open(g4_path+"/" + g4_bbs + "/profile.php?mb_id="+mb_id, 'winProfile', 'left=50,top=50,width=620,height=510,scrollbars=1');
371    }
372
373    var last_id = null;
374    function menu(id)
375    {
376        if (id != last_id)
377        {
378            if (last_id != null)
379                document.getElementById(last_id).style.display = "none";
380            document.getElementById(id).style.display = "block";
381            last_id = id;
382        }
383        else
384        {
385            document.getElementById(id).style.display = "none";
386            last_id = null;
387        }
388    }
389
390    function textarea_decrease(id, row)
391    {
392        if (document.getElementById(id).rows - row > 0)
393            document.getElementById(id).rows -= row;
394    }
395
396    function textarea_original(id, row)
397    {
398        document.getElementById(id).rows = row;
399    }
400
401    function textarea_increase(id, row)
402    {
403        document.getElementById(id).rows += row;
404    }
405
406    // 글숫자 검사
407    function check_byte(content, target)
408    {
409        var i = 0;
410        var cnt = 0;
411        var ch = '';
412        var cont = document.getElementById(content).value;
413
414        for (i=0; i<cont.length; i++) {
415            ch = cont.charAt(i);
416            if (escape(ch).length > 4) {
417                cnt += 2;
418            } else {
419                cnt += 1;
420            }
421        }
422        // 숫자를 출력
423        document.getElementById(target).innerHTML = cnt;
424
425        return cnt;
426    }
427
428    // 브라우저에서 오브젝트의 왼쪽 좌표
429    function get_left_pos(obj)
430    {
431        var parentObj = null;
432        var clientObj = obj;
433        //var left = obj.offsetLeft + document.body.clientLeft;
434        var left = obj.offsetLeft;
435
436        while((parentObj=clientObj.offsetParent) != null)
437        {
438            left = left + parentObj.offsetLeft;
439            clientObj = parentObj;
440        }
441
442        return left;
443    }
444
445    // 브라우저에서 오브젝트의 상단 좌표
446    function get_top_pos(obj)
447    {
448        var parentObj = null;
449        var clientObj = obj;
450        //var top = obj.offsetTop + document.body.clientTop;
451        var top = obj.offsetTop;
452
453        while((parentObj=clientObj.offsetParent) != null)
454        {
455            top = top + parentObj.offsetTop;
456            clientObj = parentObj;
457        }
458
459        return top;
460    }
461
462    function flash_movie(src, ids, width, height, wmode)
463    {
464        var wh = "";
465        if (parseInt(width) && parseInt(height)) 
466            wh = " width='"+width+"' height='"+height+"' ";
467        return "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/s
467hockwave/cabs/flash/swflash.cab#version=6,0,0,0' "+wh+" id="+ids+"><param name=wmode value="+wmode+"><param name=movie value="+src+"><param name=quality value=high><embed src="+src+" quality=high wmode="+wmode+" type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash' "+wh+"></embed></object>";
468    }
469
470    function obj_movie(src, ids, width, height, autostart)
471    {
472        var wh = "";
473        if (parseInt(width) && parseInt(height)) 
474            wh = " width='"+width+"' height='"+height+"' ";
475        if (!autostart) autostart = false;
476        return "<embed src='"+src+"' "+wh+" autostart='"+autostart+"'></embed>";
477    }
478
479    function doc_write(cont)
480    {
481        document.write(cont);
482    }
483}

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.