var OBJ_POPUP = null; var OBJ_STATUS = null; var winMsg = ""; var g_disableList = new Array(0); //----Show create window pop function showWindowStatus(msg) { // Button control을 Disable var nStep; for( nStep = 0; nStep < document.all.length; nStep++ ) { if( document.all[nStep].type == "button" && document.all[nStep].disabled == false ) { g_disableList.push( nStep ); document.all[nStep].disabled = true; } } LOCK_FLAG = "1"; document.oncontextmenu=new Function("return false"); oPopup = window.createPopup(); var oPopupBody = oPopup.document.body; winMsg = msg var htmlsrc = "\n" + "" + "" + "\n"+ "" + "" + "\n"+ "" + "" + "\n"+ "
" + "" + winMsg + "" + "
" + "
"; oPopupBody.innerHTML = htmlsrc; var x = parseInt( document.body.offsetWidth ) / 2 - 230 / 2; var y = parseInt( document.body.offsetHeight ) / 2 - 130 / 2; oPopup.show( x, y, 230, 130, document.body); OBJ_STATUS = oPopup; } function hideWindowStatus() { // disable 시킨 control을 다시 활성화 while( g_disableList.length > 0 ) { document.all[g_disableList.pop()].disabled = false; } if(OBJ_STATUS) { LOCK_FLAG = "0"; document.oncontextmenu=new Function("return true"); OBJ_STATUS.hide(); } } //----Extraction left string function Left(SourceStr, FindStr) { Index = SourceStr.indexOf(FindStr); if(Index < 0) { return (""); }else{ return (SourceStr.substring(0, Index)); } } //-----Extraction right string function Right(SourceStr, FindStr) { Index = SourceStr.indexOf(FindStr); if(Index < 0) { return (""); }else{ Len = SourceStr.length; return(SourceStr.substring(Index+FindStr.length, Len)); } } //----Elimination empty string value function Trim(SourceStr) { newStr = SourceStr.replace(/ /gi, ""); return (newStr); } //----Elimination left empty string value function LTrim(value) { var pos = 0; for(var i=0; i < value.length; i++) { if(value.substr(i,1) != " " && value.charCodeAt(i) != 13 && value.charCodeAt(i) != 10 ) { pos = i; break; } } return (value.substring(pos, value.length)); } function RTrim(value) { var pos = 0; for(var i=value.length-1; i >= 0; i--) { if(value.substr(i,1) != " " && value.charCodeAt(i) != 13 && value.charCodeAt(i) != 10 ) { pos = i; break; } } return (value.substring(0, pos+1)); } //----특정문자열로 split한 값중 특정번째 값 function Word(value, sep, index) { if(value == "" || value == null) return ""; var lists = value.split(sep); if(index == -1) { return (lists[lists.length-1]); } else { if (lists.length-1 < index) return ""; return (lists[index]); } } function getParameter (strValue, parameterName, sep) { strValue = RTrim(LTrim(strValue)); var lists = strValue.split(sep); for (var i=0; i < lists.length; i++) { if (Left(lists[i], "=").toLowerCase() == parameterName.toLowerCase()) { return (Right(lists[i], "=")); } } return ""; } //---CreatePopup function openPopup(winLeft, winTop, winWidth, winHeight, htmlstr) { var oPopup = window.createPopup(); var oPopBody = oPopup.document.body; oPopBody.onblur = new Function(""); oPopBody.style.backgroundColor = "#FFFFFF"; oPopBody.style.border = "1px solid #D2D2D2"; oPopBody.scroll = "yes"; oPopBody.style.scrollbarFaceColor = "#ECECEC"; oPopBody.style.scrollbarShadowColor = "#F5F4F4"; oPopBody.style.scrollbarHighlightColor = "#F5F4F4"; oPopBody.style.scrollbar3dLightColor = "#F5F4F4"; oPopBody.style.scrollbarDarkShadowColor = "#FFFFFF"; oPopBody.style.scrollbarTrackColor = "#F5F4F4"; oPopBody.style.scrollbarArrowColor = "#808080"; oPopBody.innerHTML = htmlstr; //x,y,width,height oPopup.show(winLeft, winTop, winWidth, winHeight, document.body); OBJ_POPUP = oPopup; } function hidePopup(){ if (OBJ_POPUP){OBJ_POPUP.hide();} } //----Diplay action button's event status function toggleActionBtn(BtnObj,Flag){ switch(Flag){ case "0" : //moveout BtnObj.style.backgroundColor = "#DCDCDC"; BtnObj.style.borderWidth = "1px"; BtnObj.style.borderStyle ="solid"; BtnObj.style.borderColor = "#CFCFCF"; BtnObj.style.color = "#000000"; break; case "1" : //mouseover BtnObj.style.backgroundColor = "#D3D3D3"; BtnObj.style.borderTopColor = "#EBEBEB"; BtnObj.style.borderRightColor = "#ACACAC"; BtnObj.style.borderBottomColor = "#8F8F8F"; BtnObj.style.borderLeftColor = "#E3E3E3"; BtnObj.style.color = "#000000"; break; case "2" : //mousedown BtnObj.style.backgroundColor = "#ACACAC"; BtnObj.style.borderTopColor = "#707070"; BtnObj.style.borderRightColor = "#BDBDBD"; BtnObj.style.borderBottomColor = "#CFCFCF"; BtnObj.style.borderLeftColor = "#868686"; BtnObj.style.color = "#FFFFFF"; break; } } // 보기에서 마우스 오버시 색상설정 function ITEM_onmouseover(me) { me.style.backgroundColor = "#eff3ff"; } // 보기에서 마우스 아웃시 색상설정 function ITEM_onmouseout(me) { me.style.backgroundColor = "white"; } function toggleAllCheckBox( me, checkBoxName ) { if( document.all[checkBoxName] && !document.all[checkBoxName].length ) { document.all[checkBoxName].checked = me.checked; return; } count = document.all[checkBoxName].length; for( i = 0; i < count; i++ ) { document.all[checkBoxName][i].checked = me.checked; } } function open_cal(field, dbname, inDate) { fieldname = field; var left = (screen.width-175)/2; var top = (screen.height-191)/2; now = new Date(); year = now.getYear(); month = now.getMonth(); day = now.getDate(); winPath = dbname + "/frmCalendar?OpenForm"+"&FieldName=" + fieldname + "&inDate=" + inDate; Cal_Win=window.open(winPath,"","width=171,Height=210,left=" +left+ ", top=" +top); Cal_Win.focus(); } function replace(str,text,by) { var value; value = str.toString(); var strLength=value.length, txtLength=text.length; if((strLength == 0) || (txtLength == 0)) return value; var z= value.indexOf(text); if((!z)&&(text !=value.substring(0,txtLength))) return value; if(z == -1) return value; var newstr = value.substring(0,z) + by; if(z+txtLength < strLength) newstr += replace(value.substring(z+txtLength,strLength),text,by); return newstr; } function removeComma(aStr) { var aNum = ""; for (i = 0; i < aStr.length; i++) if (aStr.charAt(i) != ',') aNum += aStr.charAt(i); return aNum; } function displayComma(control) { var sign; var number = control.value; if (number.substring(0,1) == '-') { sign = '-'; number = number.substring(1, number.length); } else sign = ''; if(number.substring(0,1) =='0') number = number.substring(0, number.length); number = replace(number,',', ''); if(number.length<= 3){ number = replace(number,',', ''); var output1 = number; control.value=sign+output1; }else{ var dot = '.'; var head = ""; var tail = ""; var dotPos = number.indexOf(dot); if(dotPos==-1){ head = number; }else{ head = number.substring(0, dotPos); tail = number.substring(dotPos, number.length); if( tail != "." ) { tail = "" + ( Math.round( parseFloat( "0" + tail ) * 100 ) / 100 ); tail = tail.substring(1, tail.length); if ( tail == "" ) { tail = ".0"; } } } var mod = head.length%3; var output =(mod ==0?'':(head.substring(0,mod))); for(z=0;z 127) return true; else return false; else return false; } function fixIt(str, limit) { var len=0; var new_str=""; var max = limit; for(var i=0; i < str.length; i++) { if (len > max) return new_str+".."; if (isKorean(escape(str.substr(i,1))) == true) len += 2; else len += 1; new_str += str.substr(i,1); } return new_str; } function onlyDigitKey( event ) { if (((event.keyCode<45)||(event.keyCode>57)) && event.keyCode != 8 ) { event.returnValue=false; } } function onlyTimeKey( event ) { if (((event.keyCode<45)||(event.keyCode>57)) && event.keyCode != 8 && event.keyCode != 186 && event.keyCode != 9 ) { event.returnValue=false; } } function sortMultiItem( sString ) { var tmpString = sString; var tmpList = tmpString.split( "`}" ); var i = 0; var key = ''; var keyString = ''; var count = tmpList.length; if ( tmpString == '' ) { return tmpString; } for ( i = 0; i < count; i++ ) { var col1 = tmpList[i].split( "`{" ); for( j = i + 1; j < count; j++ ) { var col2 = tmpList[j].split( "`{" ); if( LTrim(col1[0]) > LTrim(col2[0]) ) { keyString = tmpList[j]; tmpList[j] = tmpList[i]; tmpList[i]=keyString; col1 = tmpList[i].split( "`{" ); } } } return tmpList.join("`}"); } function sortMultiItemDate( sString ) { var tmpString = sString; var tmpList = tmpString.split( "`}" ); var i = 0; var key = ''; var keyString = ''; var count = tmpList.length; if ( tmpString == '' ) { return tmpString; } for ( i = 0; i < count; i++ ) { var col1 = tmpList[i].split( "`{" ); for( j = i + 1; j < count; j++ ) { var col2 = tmpList[j].split( "`{" ); if( Date.parse( LTrim( col1[0] ) ) > Date.parse( LTrim( col2[0] ) ) ) { keyString = tmpList[j]; tmpList[j] = tmpList[i]; tmpList[i]=keyString; col1 = tmpList[i].split( "`{" ); } } } return tmpList.join("`}"); } function getNowString() { var today = new Date(); var nYear = today.getFullYear(); var nMonth = today.getMonth() + 1; var nDate = today.getDate(); var strAMPM = "AM"; var nHour = today.getHours(); var nMin = today.getMinutes(); var nSec = today.getSeconds(); if( nMonth < 10 ) { nMonth = "0" + nMonth; } if( nDate < 10 ) { nDate = "0" + nDate; } if( nHour >= 12 ) { nHour -= 12; strAMPM = "PM"; } if( nHour <= 0 ) { nHour = 12; } if( nHour < 10 ) { nHour = "0" + nHour; } if( nMin < 10 ) { nMin = "0" + nMin; } if( nSec < 10 ) { nSec = "0" + nSec; } return nYear + "-" + nMonth + "-" + nDate + " " + strAMPM + " " + nHour + ":" + nMin + ":" + nSec; } function getDateString( nYear, nMonth, nDate ) { if( nMonth < 10 ) { nMonth = "0" + nMonth; } if( nDate < 10 ) { nDate = "0" + nDate; } return nYear + "-" + nMonth + "-" + nDate; } function QueryXML( strURL, bDisplayError ) { var xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP"); xmlHTTP.open( "GET", strURL, 0 ); xmlHTTP.send(); var strResult = xmlHTTP.responseText; var strCode = ""; var strMessage = ""; var nPos = strResult.indexOf( "`^" ); if( nPos< 0 ) { strCode = "error"; strMessage = strResult; } else { strCode = strResult.substr( 0, nPos ); strMessage = strResult.substr( nPos+2, strResult.length - nPos - 2); } if( strCode != "ok" && bDisplayError ) { alert( strMessage ); return false; } return true; } /* setCookie 설 명 : 쿠키 정보를 입력 받아 브라우저에 저장한다. 입 력 : name = 쿠키 키 이름 value = 쿠키 키의 값 expires = 쿠키 삭제 일시 (입력값은 Date 함수 객체이며, 실제 저장할 때는 GMT 포멧으로 변환됨) path = 쿠키 적용 경로 domain = 쿠키 저용 도메인 secure = 쿠키 전송시 보안 사항. HTTPS일때 해당 출 력 : 없음 */ function setCookie (name, value, expires, path, domain, secure) { // cookie string var cs = name + "=" + escape(value) + ( (expires) ? "; expires=" + expires.toGMTString() : "") + ( (domain) ? "; domain=" + domain : "") + ( (path) ? "; path=" + path : "") + ( (secure) ? "; secure" : ""); document.cookie = cs; } /* getDelayDay 설 명 : 수를 입력하여 그 수만큼 날짜를 뒤로 세팅해 Date 객체를 리턴 용 도 : 쿠키를 셋팅할 때 날짜를 뒤로 하기 위해 입 력 : 날짜 수 출 력 : Date의 객체 */ function getDelayDay(day) { expires = new Date(); expires.setTime(expires.getTime() + 24 * 60 * 60 * day * 1000); return expires; } /* getCookie 설 명 : 쿠키 정보에서 해당하는 키 이름의 값을 리턴한다. 주 의 : setCookie에서 인코딩을 하고 getCookie 에서 디코딩을 한다 이 때, 키 이름은 En/Decoding 하지 않고 그 값만 적용한다. 입 력 : 쿠키 이름 출 력 : 쿠키 이름에 해당하는 값 */ function getCookie (name) { // cookie string var cs = document.cookie; var prefix = name + "="; // cookie's Start Index of the information of it. var cSI = cs.indexOf(prefix); if (cSI == -1) { return null; } // Find cookie's End Index of the information of the cookie. var cEI = cs.indexOf(";", cSI + prefix.length); // If it din't find the CEI, then set it to the end of the cs if (cEI == -1) { cEI = cs.length; } // Decode the value of the cookie's return unescape(cs.substring(cSI + prefix.length, cEI)); } /* deleteCookie 설 명 : 쿠키 정보에서 해당하는 키와 값을 삭제한다. 방 법 : 해당 쿠키 정보에 유효 시간을 현재 시간으로 세팅한다. 입 력 : 쿠키 키 이름 */ function deleteCookie (name) { var expires = new Date(); var value = getCookie(name); document.cookie = name + "=" + value + "; expires=" + expires.toGMTString(); } function upisGetEditAppletData(){ var form = document.forms[0]; for(i=0;i/gi, ""); form.elements[i].value = form.elements[i].value.replace(//gi, ""); } } catch(e) {window.status='Editor applet did not finish loading.';} } if(form.elements[i].webEditor != null) { form.elements[i].value = form.elements[i].webEditor.getText("text//html"); form.elements[i].value = form.elements[i].value.replace(/<\/FORM*>/gi, ""); form.elements[i].value = form.elements[i].value.replace(//gi, ""); } } return true; }