var split_code = ''; var IE = document.all ? true : false; var money_color ='ff6c00'; function open_win(url,win_x,win_y,scroll,win_name) { var src_x = screen.width; var src_y = screen.height; tmp_MSIE = window.navigator.userAgent.indexOf("MSIE"); if(tmp_MSIE && window.navigator.userAgent.indexOf("SV1") > tmp_MSIE) { win_y = win_y + 40; } var x= (src_x - win_x)/2; var y= (src_y - win_y)/2; if(!win_name) var win_name = 'window'; open_name = window.open(url,win_name,'left='+ x +',top='+ y +',width='+ win_x +', height=' + win_y + ', menubar=no, scrollbars=' + scroll +', staus=no, resizable=yes, titlebar=no, toolbar=no, hotkey=0,closeable=no'); open_name.focus(); return open_name; } function move_center(win_x,win_y,left_pos) { var src_x = screen.width; var src_y = screen.height; win_y = win_y + 40; var x= (src_x - win_x)/2; var y= (src_y - win_y)/2; if (left_pos) moveTo(left_pos,y); else moveTo(x,y); window.resizeTo(win_x,win_y); } function setComma(str) { 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; } return retValue; } function LTrim(str) { var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(0)) != -1) { var j=0, i = s.length; while (j < i && whitespace.indexOf(s.charAt(j)) != -1) j++; s = s.substring(j, i); } return s; } function RTrim(str) { var whitespace = new String(" \t\n\r"); var s = new String(str); if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { var i = s.length - 1; // Get length of string while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) i--; s = s.substring(0, i+1); } return s; } function Trim(str) { return RTrim(LTrim(str)); } function get_str_len(str) // ÇÑ±ÛÆ÷ÇÔ ½ÇÁ¦ bytes ¼ö ±¸Çϱâ { var total_len = 0; for (var i=0;i4) total_len += 2; // ÇѱÛÀ̰ųª 2byte ¹®ÀÚÀ̸é... else ++total_len; } return total_len; } function cut_string(string, limit) { var inc = 0; var nbytes = 0; var msg = ""; var msglen = string.length; for (i=0; i 4) inc = 2; else if (ch == '\n') { if (string.charAt(i-1) != '\r') inc = 1; } else if (ch == '<' || ch == '>') inc = 4; else inc = 1; if ((nbytes + inc) > limit) break; nbytes += inc; msg += ch; } return msg; } // base_64 encode/decode; var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; function base64encode(input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; do { chr1 = input.charCodeAt(i++); chr2 = input.charCodeAt(i++); chr3 = input.charCodeAt(i++); enc1 = chr1 >> 2; enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); enc4 = chr3 & 63; if (isNaN(chr2)) { enc3 = enc4 = 64; } else if (isNaN(chr3)) { enc4 = 64; } output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4); } while (i < input.length); return output; } function base64decode(input) { var output = ""; var chr1, chr2, chr3; var enc1, enc2, enc3, enc4; var i = 0; // remove all characters that are not A-Z, a-z, 0-9, +, /, or = input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); do { enc1 = keyStr.indexOf(input.charAt(i++)); enc2 = keyStr.indexOf(input.charAt(i++)); enc3 = keyStr.indexOf(input.charAt(i++)); enc4 = keyStr.indexOf(input.charAt(i++)); chr1 = (enc1 << 2) | (enc2 >> 4); chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); chr3 = ((enc3 & 3) << 6) | enc4; output = output + String.fromCharCode(chr1); if (enc3 != 64) { output = output + String.fromCharCode(chr2); } if (enc4 != 64) { output = output + String.fromCharCode(chr3); } } while (i < input.length); return output; } function reset_file_form(that_form) // input type=file¿¡¼­ Ãë¼Ò ó¸®µÉ °æ¿ì file³»¿ë ¸ðµÎ clear // file ÀÚü¿¡ value °ªÀ» ä¿ï ¼ö ¾øÀ¸¹Ç·Î ¸ðµÎ clear ÇÒ ¼ö ¹Û¿¡ ¾ø´Ù. { var total = that_form.elements.length; var resetVal = Array(); // ÇöÀç ÆûÀÇ °ªÀ» ÀúÀå for(var i=0;ilimit) { alert(limit + ' byte ¸¦ ÃʰúÇÏ¿´½À´Ï´Ù. ÃʰúµÈ ±ÛÂ¥´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.'); that.value = cut_string(that.value, limit); that.value = that.value.replace(/\r\n$/, ""); l = get_str_len(that.value); } // document.all['text_limit_count_disp'].innerHTML = l; var id = 'text_limit_count_disp'+gubun; document.getElementById(id).innerHTML = l; } function is_email_addr(email) { var filter = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; if (filter.test(email)) return 1; return 0; } function is_alpha_num(str) { var check_string = /[A-Za-z0-9]*$/; return (str.match(check_string) == str); } function is_alphabet(str) { var check_string = /[A-Za-z]*$/; return (str.match(check_string) == str); } function is_numeric(str) { var check_string = /[0-9]*$/; return (str.match(check_string) == str); } function is_korean(str) { for(var i=0; i