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(v) { v = v+""; var arr = v.split("."); if(arr.length > 1) { var str = arr[0]; }else{ var str =v; } str = ""+str+""; var retValue = ""; for(i=0; i 0 && (i%3)==0) { retValue = str.charAt(str.length - i -1) + "," + retValue; } else { retValue = str.charAt(str.length - i -1) + retValue; } } if(arr.length > 1) { return retValue +"." +arr[1]; } else { return retValue; } } function number_replace(obj,rep) { var retval = obj.replace(/,/gi,""); return retval; } // 새 창 function popup_window(url, winname, opt) { window.open(url, winname, opt); } // 폼메일 창 function popup_formmail(url) { opt = 'scrollbars=yes,width=417,height=385,top=10,left=20'; popup_window(url, "wformmail", opt); } // , 를 없앤다. function no_comma(data) { var tmp = ''; var comma = ','; var i; for (i=0; i= screen.width) { winl = 0; h = (parseInt)(w * (h / w)); } if (h >= screen.height) { wint = 0; w = (parseInt)(h * (w / h)); } var js_url = "