var NS4;
var IE4;
if (document.all) {
IE4 = true;
NS4 = false;
} else {
IE4 = false;
NS4 = true;
}
var isWin = (navigator.appVersion.indexOf("Win") != -1)
var UserAgentNameString = navigator.userAgent.toLowerCase();
var isIE = (UserAgentNameString.indexOf("msie") != -1) && (UserAgentNameString.indexOf("opera") == -1) && (UserAgentNameString.indexOf("webtv") == -1);
var frmMinHeight; // = 350;
var applyMinSize = false;
var frmMaxWidth;
var frmMaxHeight;
var applyMaxSize = false;
function setMinSize(width, height) {
frmMinWidth = width;
frmMinHeight = height
applyMinSize = true;
}
function setMaxSize(width, height) {
frmMaxWidth = width;
frmMaxHeight = height
applyMaxSize = true;
}
function resizeIframe(name) {
if (name == null || name == "" || name == '[object]') {
name = "myframeapps";
}
//alert(name);
try {
if (IE4) {
var oBody = document.frames(name).document.body;
} else {
var oBody = document.getElementById(name).contentDocument.body;
}
var oIFrame = document.getElementById(name);
var frmWidth = oBody.scrollWidth;
var frmHeight = oBody.scrollHeight;
if (applyMinSize) {
//frmWidth = Math.max(frmWidth, frmMinWidth);
frmHeight = Math.max(frmHeight, frmMinHeight);
}
if (applyMaxSize) {
//frmWidth = Math.min(frmWidth, frmMaxWidth);
frmHeight = Math.min(frmHeight, frmMaxHeight);
}
oIFrame.style.height = frmHeight;
//oIFrame.style.width = frmWidth;
//alert(frmHeight);
} catch (e) {}
}
function parentResizeIframe(name) {
if (parent && parent != this && parent.resizeIframe != null) {
parent.resizeIframe(name);
}
}
function addLoadEvent(func){
/**
var oldonload = window.onload;
if(typeof window.onload != "function"){
window.onload = func;
}
else{
window.onload = function(){
oldonload();
func();
}
}
/*/
if (window.addEventListener) {
window.addEventListener("load", func, false);
} else if (window.attachEvent) {
window.attachEvent("onload", func);
} else {
window.onload = func;
}
/**/
}
function autoBlur() {
if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG")
document.body.focus();
}
document.onfocusin=autoBlur;
/*
* ±â´É¼³¸í : iframeÀÇ ºÎ¸ðâ ÀÚµ¿¸®»çÀÌ¡
*/
function autoResizeiFrame() {
/**/
parentResizeIframe(self.name);
widnowScrollTop();
/*/
if (parent.document.getElementById("myframeapps")) {
var contentfr = parent.document.getElementById("myframeapps");
//FIREFOX
if (contentfr.contentDocument && contentfr.contentDocument.body.offsetHeight) {
contentfr.height = contentfr.contentDocument.body.offsetHeight+16;
//IE
} else if (contentfr.Document && contentfr.Document.body.scrollHeight) {
self.resizeTo(document.body.scrollWidth , document.body.scrollHeight);
}
}
/**/
}
function autoResizeiFrameS() {
/**/
var fnm = self.name;
parentResizeIframe(fnm);
/*/
var obj;
if(parent != null) {
obj = parent.document.all[self.name];
if(obj != null) {
obj.style.pixelHeight = self.document.body.scrollHeight;
}
}
/**/
}
function autoResizeOnlyiFrame() {
/**/
var fnm = self.name;
parentResizeIframe(fnm);
/*/
var obj;
if(parent != null) {
obj = parent.document.all[self.name];
if(obj != null) {
obj.style.pixelHeight = self.document.body.scrollHeight;
}
}
/**/
}
/*
* ±â´É¼³¸í : »ó´ÜÀ¸·Î ½ºÅ©·Ñ¸µ
* ºÎ°¡¼³¸í : IFrame³»¿¡¼ ÆäÀÌÁö À̵¿½Ã ÆäÀÌÁö À§Ä¡°¡ Áß°£ºÎÅÍ º¸ÀÌ´Â °Í ¹æÁöÇϱâ À§ÇØ...
*/
function windowScrollTop() {
window.scrollTo(0,0);
}
function widnowScrollTop() {
try { parent.scrollTo(0,0); } catch(e) {}
}
/*
* ±â´É¼³¸í : ÆË¾÷
* ÆÄ¶ó¹ÌÅÍ : URL, ÆË¾÷À̸§, ¿ÞÂÊÀ§Ä¡, »ó´ÜÀ§Ä¡, ÆË¾÷°¡·Î»çÀÌÁî, ÆË¾÷¼¼·Î»çÀÌÁî, Åø¹Ù, ¸Þ´º¹Ù, »óŹÙ, ½ºÅ©·Ñ¹Ù, ¸®»çÀÌ¡, ·ÎÄÉÀ̼ǹÙ
*/
function popup_window_common(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable, location) {
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
location_str = location ? 'yes' : 'no';
var mdWindow = null;
mdWindow = window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str+',location='+location_str);
if(!mdWindow){
alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.");
return;
}
mdWindow.focus();
}
/*
* ±â´É¼³¸í : ÆË¾÷
* ÆÄ¶ó¹ÌÅÍ : URL
*/
function popup_window_common2(url) {
var mdWindow = null;
mdWindow = window.open(url);
if(!mdWindow){
alert("ÆË¾÷Â÷´ÜÀ» ÇØÁ¦ÇØÁÖ¼¼¿ä.");
return false;
}
mdWindow.focus();
}
/*
* ·Î±×ÀÎ
* ÆÄ¶ó¹ÌÅÍ : ·Î±×ÀÎ/·Î±×¾Æ¿ô in,out), Ÿ°Ù(_self, _parent)
*/
function login(flag, targetwindow) {
var this_location = self.location.href;
if (self.hiddenFrame != null && self.hiddenFrame != 'undefined') {
this_location = parent.location.href;
}
if (flag == 'in') {
if(self.hiddenFrame == null || self.hiddenFrame == 'undefined') {
self.location.href = '/apps/login.do?doprocess=loginform&loginUrl=' + this_location;
} else {
parent.location.href = '/content/mn800/mn800_010.jsp?doprocess=loginform&loginUrl=' + this_location;
}
} else {
if(self.hiddenFrame == null || self.hiddenFrame == 'undefined') {
parent.location.href = '/apps/login.do?doprocess=logout&loginUrl=' + this_location;
} else {
self.location.href = '/apps/login.do?doprocess=logout&loginUrl='+ this_location;
}
}
}
/*
function Login(state) {
if (state == 'out') {
var logouturl = '/apps/login.do?doprocess=logout';
self.location.href = logouturl;
} else {
var loginurl = document.location.href;
for (i=0; i<10; i++) {
if (loginurl.indexOf('&') > -1)
loginurl = loginurl.replace('&','!');
else
break;
}
var loginurl = '/content_kor/login/login.jsp?loginUrl='+loginurl;
self.location.href = loginurl;
}
}
*/
/*
* URL À̵¿
* Ÿ°Ù, URL
*/
function moveUrl(targetwindow, moveurl) {
targetwindow.location.href = moveurl;
}
/*
* ±â´É¼³¸í : Ç÷¡½¬ »ðÀÔ
* ÆÄ¶ó¹ÌÅÍ : ÆÄÀϰæ·Î, °¡·Î, ¼¼·Î, ¾ÆÀ̵ð, ¹è°æ»ö, À©µµ¿ì¸ðµå
*/
function insertFlash(url, w, h, id, bg, win){
document.write(makeFlashTags(url, w, h, id, bg, win));
}
function makeFlashTags(url, w, h, id, bg, win) {
var flashStr=
"";
return flashStr;
}
/*
* ±â´É¼³¸í : ½ºÅ©¸³Æ® »ðÀÔ
* ÆÄ¶ó¹ÌÅÍ : ½ºÅ©¸³Æ®
*/
function insertScript(val){
document.write(val);
}
/*
* ±â´É¼³¸í : ÅØ½ºÆ® Area Validater (ajax)
* ÆÄ¶ó¹ÌÅÍ : chkFrm : üũÇÒ ÆûÀ̸§
maxSize : ÃÖ´ë°ª
rtnFrm : ÇöÀç ¹®ÀÚ±æÀ̸¦ Ç¥ÇöÇÒ Æû
*/
function countByte(chkFrm, maxSize, rtnFrm) {
var str = chkFrm.value;
var paramName1 = encodeURIComponent("maxSize"); // euc-kr ÀÎÄÚµù
var paramValue1 = encodeURIComponent(maxSize); // euc-kr ÀÎÄÚµù
var paramName2 = encodeURIComponent("inputStr"); // euc-kr ÀÎÄÚµù
var paramValue2 = encodeURIComponent(str); // euc-kr ÀÎÄÚµù
var url = '/common/etc/calculateByte.jsp?' +paramName1+ '=' +paramValue1+ '&' +paramName2+ '='+paramValue2;
request.open("GET", url, true);
request.onreadystatechange = function() {
if (request.readyState == 4) {
if (request.status == 200) {
var response = request.responseText;
if (rtnFrm!=null) {
rtnFrm.value = response;
}
} else {
alert("Error: status code is " + request.status);
}
}
}
request.send(null);
if(rtnFrm.value > maxSize) {
chkFrm.blur();
chkFrm.focus();
alert("ÀԷ¹üÀ§¸¦ ÃʰúÇÏ¿´½À´Ï´Ù.");
countChar(chkFrm, maxSize, rtnFrm);
}
}
/*
* ±â´É¼³¸í : ÅØ½ºÆ® Area Validater
* ÆÄ¶ó¹ÌÅÍ : chkFrm : üũÇÒ ÆûÀ̸§
maxSize : ÃÖ´ë°ª
rtnFrm : ÇöÀç ¹®ÀÚ±æÀ̸¦ Ç¥ÇöÇÒ Æû
*/
function checkChar(chkfrm, chksize, rtnfrm){
var str, msg;
var len = 0;
var temp;
var count = 0;
msg = chkfrm.value;
str = new String(msg);
len = str.length;
for (k=0 ; k 4) {
count += 3;
} else if (temp == '\r' && str.charAt(k+1) == '\n') { // \r\nÀÏ °æ¿ì
count += 2;
} else if (temp != '\n') {
count++;
}
}
rtnfrm.value = count;
if(count > chksize) {
chkfrm.blur();
chkfrm.focus();
alert(chksize + "Byte ±îÁö¸¸ µî·ÏÀÌ °¡´ÉÇÕ´Ï´Ù.");
countChar(chkfrm, chksize, rtnfrm);
}
}
/*
* ±â´É¼³¸í : ÅØ½ºÆ® Area Validater (¹®ÀÚ±æÀÌ Ä«¿îÆ®)
* ÆÄ¶ó¹ÌÅÍ : chkFrm : üũÇÒ ÆûÀ̸§
maxSize : ÃÖ´ë°ª
rtnFrm : ÇöÀç ¹®ÀÚ±æÀ̸¦ Ç¥ÇöÇÒ Æû
*/
function countChar(chkfrm, chksize, rtnfrm) {
var str,msg;
var len=0;
var temp;
var count;
count = 0;
msg = chkfrm.value;
str = new String(msg);
len = str.length;
for(k=0 ; k 4) {
count += 3;
} else if (temp == '\r' && str.charAt(k+1) == '\n') { // \r\nÀÏ °æ¿ì
count += 2;
} else if(temp != '\n') {
count++;
}
if(count > chksize) {
str = str.substring(0,k);
break;
}
}
chkfrm.value = str;
checkChar(chkfrm, chksize, rtnfrm);
}
// ¹ýÀιøÈ£ Á¡°Ë (¼ýÀÚ¸¸À¸·Î ÆÄ¶ó¹ÌÅ͸¦ ¹Þ¾ÒÀ»¶§)
function gf_chkCorpNo(value){
var data = value;
var digit = 0;
if(data.length != 12) {
return false;
} else {
sumMod = 0;
summode += parseInt(data.substring(0 ,1 )) * 1;
summode += parseInt(data.substring(1 ,2 )) * 2;
summode += parseInt(data.substring(2 ,3 )) * 1;
summode += parseInt(data.substring(3 ,4 )) * 3;
summode += parseInt(data.substring(4 ,5 )) * 1;
summode += parseInt(data.substring(5 ,6 )) * 2;
summode += parseInt(data.substring(6 ,7 )) * 1;
summode += parseInt(data.substring(7 ,8 )) * 2;
summode += parseInt(data.substring(8 ,9 )) * 1;
summode += parseInt(data.substring(9 ,10)) * 2;
summode += parseInt(data.substring(10,11)) * 1;
summode += parseInt(data.substring(11,12)) * 2;
digit = 10 - (summode % 10) > 9 ? 0 : 10 - (summode % 10);
if (parseInt(data.substring(12,13)) != digit) {
return false;
}
}
return true;
}
// Àç¿Ü±¹ÀÎ ¹øÈ£ üũ
function checkForeignNo(fgnno) {
var sum=0;
var odd=0;
buf = new Array(13);
for(i=0; i<13; i++) { buf[i]=parseInt(fgnno.charAt(i)); }
odd = buf[7]*10 + buf[8];
if(odd%2 != 0) { return false; }
if( (buf[11]!=6) && (buf[11]!=7) && (buf[11]!=8) && (buf[11]!=9) ) {
return false;
}
multipliers = [2,3,4,5,6,7,8,9,2,3,4,5];
for(i=0, sum=0; i<12; i++) { sum += (buf[i] *= multipliers[i]); }
sum = 11 - (sum%11);
if(sum >= 10) { sum -= 10; }
sum += 2;
if(sum >= 10) { sum -= 10; }
if(sum != buf[12]) { return false }
return true;
}
// ÁֹιøÈ£ üũ
function checkJuminNo(juminno) {
if(juminno=="" || juminno==null || juminno.length!=13) {
return false;
}
var jumin1 = juminno.substr(0,6);
var jumin2 = juminno.substr(6,7);
var yy = jumin1.substr(0,2); // ³âµµ
var mm = jumin1.substr(2,2); // ¿ù
var dd = jumin1.substr(4,2); // ÀÏ
var genda = jumin2.substr(0,1); // ¼ºº°
var msg, ss, cc;
// ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
if (!isNumeric(jumin1)) {
alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// ±æÀ̰¡ 6ÀÌ ¾Æ´Ñ °æ¿ì
if (jumin1.length != 6) {
alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// ù¹øÂ° ÀÚ·á¿¡¼ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ±âº» ±¸¼º °Ë»ç
if (yy < "00" || yy > "99" ||
mm < "01" || mm > "12" ||
dd < "01" || dd > "31") {
alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// ¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀ» ÀÔ·ÂÇÑ °æ¿ì
if (!isNumeric(jumin2)) {
alert("Áֹεî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ¼ýÀÚ·Î ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// ±æÀ̰¡ 7ÀÌ ¾Æ´Ñ °æ¿ì
if (jumin2.length != 7) {
alert("Áֹεî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// ¼ºº°ºÎºÐÀÌ 1 ~ 4 °¡ ¾Æ´Ñ °æ¿ì
if (genda < "1" || genda > "4") {
alert("Áֹεî·Ï¹øÈ£ µÞÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// ¿¬µµ °è»ê - 1 ¶Ç´Â 2: 1900³â´ë, 3 ¶Ç´Â 4: 2000³â´ë
cc = (genda == "1" || genda == "2") ? "19" : "20";
// ù¹øÂ° ÀÚ·á¿¡¼ ¿¬¿ùÀÏ(YYMMDD) Çü½Ä Áß ³¯Â¥ Çü½Ä °Ë»ç
if (isYYYYMMDD(parseInt(cc+yy), parseInt(mm), parseInt(dd)) == false) {
alert("Áֹεî·Ï¹øÈ£ ¾ÕÀÚ¸®¸¦ ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
// Check Digit °Ë»ç
if (!isSSN(jumin1, jumin2)) {
alert("ÀÔ·ÂÇÑ Áֹεî·Ï¹øÈ£¸¦ °ËÅäÇÑ ÈÄ, ´Ù½Ã ÀÔ·ÂÇϼ¼¿ä.");
return false;
}
return true;
}
// »ç¾÷ÀÚµî·Ï¹øÈ£ üũ
function checkBizNo(vencod) {
var sum = 0;
var getlist =new Array(10);
var chkvalue =new Array("1","3","7","1","3","7","1","3","5");
for(var i=0; i<10; i++) { getlist[i] = vencod.substring(i, i+1); }
for(var i=0; i<9; i++) { sum += getlist[i]*chkvalue[i]; }
sum = sum + parseInt((getlist[8]*5)/10);
sidliy = sum % 10;
sidchk = 0;
if(sidliy != 0) { sidchk = 10 - sidliy; }
else { sidchk = 0; }
if(sidchk != getlist[9]) { return false; }
return true;
}
function isYYYYMMDD(y, m, d) {
switch (m) {
case 2: // 2¿ùÀÇ °æ¿ì
if (d > 29) return false;
if (d == 29) {
// 2¿ù 29ÀÇ °æ¿ì ´çÇØ°¡ À±³âÀÎÁö¸¦ È®ÀÎ
if ((y % 4 != 0) || (y % 100 == 0) && (y % 400 != 0))
return false;
}
break;
case 4: // ÀÛÀº ´ÞÀÇ °æ¿ì
case 6:
case 9:
case 11:
if (d == 31) return false;
}
// Å« ´ÞÀÇ °æ¿ì
return true;
}
function isNumeric(s) {
for (i=0; i "9") return false;
}
return true;
}
function isLeapYear(y) {
if (y < 100)
y = y + 1900;
if ( (y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0) ) {
return true;
} else {
return false;
}
}
function getNumberOfDate(yy, mm) {
month = new Array(29,31,28,31,30,31,30,31,31,30,31,30,31);
if (mm == 2 && isLeapYear(yy)) mm = 0;
return month[mm];
}
function isSSN(s1, s2) {
n = 2;
sum = 0;
for (i=0; i', '>');
result = this.replace(result, '#', '#');
result = this.replace(result, '"', '"');
result = this.replace(result, '\'', ''');
return result;
}
// ÁÂ¿ì°ø¹é ¾ø¾Ö±â
String.prototype.trim = function() { return this.replace(/(^\s+)|(\s+$)/g, ""); }
// ¿ÞÂʰø¹é ¾ø¾Ö±â
String.prototype.ltrim = function() { return this.replace(/^\s+/g, ""); }
// ¿À¸¥ÂÊ °ø¹é ¾ø¾Ö±â
String.prototype.rtrim = function() { return this.replace(/\s+$/g, ""); }
String.prototype.cut = function(len, tail) {
var str = this;
var l = 0;
for (var i=0; i 128) ? 2 : 1;
if (l > len) return str.substring(0,i) + tail;
}
return str;
}
String.prototype.bytes = function() {
var str = this;
var l = 0;
for (var i=0; i 128) ? 2 : 1;
}
return l;
}
// ű׸¸ Á¦°Å
String.prototype.stripTags = function() {
var result = this;
var pos1 = result.indexOf('<');
if(pos1 == -1) return result;
var pos2 = result.indexOf('>', pos1);
if(pos2 == -1) return result;
return result.substr(0, pos1) + result.substr(pos2+1).stripTags();
}
var fullURL = location.href;
var splitIndex = fullURL.indexOf('/',7);
var currentHost = "";
if(splitIndex != -1) {
currentHost = fullURL.substring(0, splitIndex);
} else {
currentHost = fullURL;
}
function truncateSelfHost(strValue, tURL) {
urlRe = /([\/|\?|\||\.|\*|\^|$|\+|\(|\)|\[|\]|\{|\}|\-])/g;
tURL = tURL.replace(urlRe, "\$1");
eval("repRe = /("+tURL+")/gi");
strValue = strValue.replace(repRe, "");
return strValue;
}
function truncateSelfURL(strValue, tURL) {
urlRe = /([\/|\?|\||\.|\*|\^|$|\+|\(|\)|\[|\]|\{|\}|\-])/g;
tURL = tURL.replace(urlRe, "\$1");
eval("repRe = /(]*>)/gi");
strValue = strValue.replace(repRe, "$1$3");
return strValue;
}
function truncateEditorURL(strValue) {
return truncateSelfURL(strValue, currentHost+"/common/editor/editor.jsp");
}
function editorSave(strValue) {
temp = strValue;
temp = truncateEditorURL(temp);
temp = truncateSelfURL(temp, fullURL);
temp = truncateSelfHost(temp, currentHost);
return temp;
}
// frame ¾È¿¡¼ F5¸¦ ´·¶À» ¶§ ¸ÞÀÎȸéÀ¸·Î °¡´Â °ÍÀ» ¹æÁöÇÑ´Ù.
if (NS4) {
document.captureEvents(Event.KEYDOWN)
document.onkeydown = trapRefresh;
} else if (IE4) {
document.onkeydown = trapRefresh;
}
function trapRefresh(e) {
var event;
if (window.event) event = window.event;
else event = e;
if (event.keyCode == 116) {
if (window.event) {
event.keyCode = 0;
}
event.cancelBubble = true;
event.returnValue = false;
document.location.reload();
}
}
function hideStatus() {
try {
window.status = '';
} catch(e) {
}
return true;
}
if(document.layers) {
try { document.captureEvents(Event.mouseover | Event.mouseout); } catch(e) {}
}
try {
document.onmouseover=hideStatus;
document.onmouseout=hideStatus;
} catch(e) {
}
function isBrowserIE7() {
var is_ie = false;
if(isIE) {
try {
bid = "msie ";
s = UserAgentNameString.indexOf(bid, 0) + bid.length;
e = UserAgentNameString.indexOf(";", s);
v = UserAgentNameString.substring(s, e);
vi = parseInt(v);
if(vi > 6) {
is_ie = true;
}
} catch(e) {}
}
return is_ie;
}
function fitWindowWithImage(ivo) {
iWidth = (NS4)?window.innerWidth:document.body.clientWidth;
iHeight = (NS4)?window.innerHeight:document.body.clientHeight;
iWidth = ivo.width - iWidth + 40;
iHeight = ivo.height - iHeight + 40;
window.resizeBy(iWidth, iHeight);
}