if (typeof(COMMON_JS) == 'undefined') { // 한번만 실행 var COMMON_JS = true; // 전역 변수 var errmsg = ""; var errfld; // 필드 검사 function check_field(fld, msg) { if ((fld.value = trim(fld.value)) == "") error_field(fld, msg); else clear_field(fld); return; } // 필드 오류 표시 function error_field(fld, msg) { if (msg != "") errmsg += msg + "\n"; if (!errfld) errfld = fld; fld.style.background = "#BDDEF7"; } // 필드를 깨끗하게 function clear_field(fld) { fld.style.background = "#FFFFFF"; } function trim(s) { var t = ""; var from_pos = to_pos = 0; for (i=0; i=0; i--) { if (s.charAt(i-1) == ' ') continue; else { to_pos = i; break; } } t = s.substring(from_pos, to_pos); // alert(from_pos + ',' + to_pos + ',' + t+'.'); return t; } // 자바스크립트로 PHP의 number_format 흉내를 냄 // 숫자에 , 를 출력 function number_format(data) { var tmp = ''; var number = ''; var cutlen = 3; var comma = ','; var i; len = data.length; mod = (len % cutlen); k = cutlen - mod; for (i=0; i \n"; js_url += " \n"; js_url += " \n"; var settings; settings ='width='+w+','; settings +='height='+h+','; settings +='top='+wint+','; settings +='left='+winl+','; settings +='scrollbars=no,'; settings +='resizable=yes,'; settings +='status=no'; win=window.open("","image_window",settings); win.document.open(); win.document.write (" \n \n\n"); var size = "이미지 사이즈 : "+w+" x "+h; win.document.write (""+size+" \n"); if(w >= screen.width || h >= screen.height) { win.document.write (js_url); var click = "ondblclick='window.close();' style='cursor:move'"; } else var click = "onclick='window.close();' style='cursor:pointer'"; win.document.write (" \n"); win.document.write (" \n\n"); win.document.write (" \n"); win.document.write ("
"); win.document.write (""); win.document.close(); if(parseInt(navigator.appVersion) >= 4){win.window.focus();} } // a 태그에서 onclick 이벤트를 사용하지 않기 위해 function win_open(url, name, option) { var popup = window.open(url, name, option); popup.focus(); } var last_id = null; function menu(id) { if (id != last_id) { if (last_id != null) document.getElementById(last_id).style.display = "none"; document.getElementById(id).style.display = "block"; last_id = id; } else { document.getElementById(id).style.display = "none"; last_id = null; } } function textarea_decrease(id, row) { if (document.getElementById(id).rows - row > 0) document.getElementById(id).rows -= row; } function textarea_original(id, row) { document.getElementById(id).rows = row; } function textarea_increase(id, row) { document.getElementById(id).rows += row; } // 글숫자 검사 function check_byte(content, target) { var i = 0; var cnt = 0; var ch = ''; var cont = document.getElementById(content).value; for (i=0; i 4) { cnt += 2; } else { cnt += 1; } } // 숫자를 출력 document.getElementById(target).innerHTML = cnt; return cnt; } // 브라우저에서 오브젝트의 왼쪽 좌표 function get_left_pos(obj) { var parentObj = null; var clientObj = obj; //var left = obj.offsetLeft + document.body.clientLeft; var left = obj.offsetLeft; while((parentObj=clientObj.offsetParent) != null) { left = left + parentObj.offsetLeft; clientObj = parentObj; } return left; } // 브라우저에서 오브젝트의 상단 좌표 function get_top_pos(obj) { var parentObj = null; var clientObj = obj; //var top = obj.offsetTop + document.body.clientTop; var top = obj.offsetTop; while((parentObj=clientObj.offsetParent) != null) { top = top + parentObj.offsetTop; clientObj = parentObj; } return top; } function flash_movie(src, ids, width, height, wmode) { var wh = ""; if (parseInt(width) && parseInt(height)) wh = " width='"+width+"' height='"+height+"' "; return ""; } function obj_movie(src, ids, width, height, autostart) { var wh = ""; if (parseInt(width) && parseInt(height)) wh = " width='"+width+"' height='"+height+"' "; if (!autostart) autostart = false; return ""; } function doc_write(cont) { document.write(cont); } /** 코드복사 */ function Clipboard_mem_copy(obj_value ,Messages) { window.clipboardData.setData('Text',obj_value); alert(Messages); } }