// Web Utility functions // 문성광, 2006-08-04, 2009-05-26 var WebUtil = new function() { this.getContextPath = function(name) { var path = '/' + location.pathname.split('/')[location.pathname.charAt(0)=='/' ? 1 : 0]; return typeof(name) != 'undefined' ? path + '/' + name : path; }; this.getContextUrl= function(name) { return location.protocol + '//' + location.host + this.getContextPath(name); }; this.getCurrentUrl= function (name) { var path = location.href.substring(0, location.href.lastIndexOf('/') + 1); return typeof(name) != 'undefined' ? path + name : path; }; function setButtons(all, disabled) { function toUpper(value) { return value != null ? value.toUpperCase() : null } for (var i = 0, iend=all.length; i"); } function hasChildMenu(obj) { for (var i=0, iend=obj.childNodes.length; i"); indent(sb, level, prefix); var hasChild = hasChildMenu(node); if (hasChild) { key = "div" + level + "_" + i; if (node.className=='collapsable') sb.append(" "); else if (node.className=='expanded') sb.append(" "); else sb.append(" "); } else sb.append(" "); if (node.getAttribute('src') != null) sb.append("") .append(node.getAttribute('title')).append(""); else sb.append("").append(node.getAttribute('title')).append(""); sb.append(""); if (hasChild) { if (node.className=='collapsable' || node.className=='expanded') sb.append("
"); else sb.append(""); } } else if (node.tagName=='HR') sb.append("
"); } return sb; } $$(id).innerHTML = build(new StringBuffer(), $$(id), 0, typeof(prefix)=='undefined' ? '' : prefix).toString(); var items = document.getElementsByName('item'); for (var i=0, iend=items.length; i 0) { for (var j=0, jend=sels.options.length; j=0; i--) if (!sels[i].disabled && sels[i].selected) sels[i] = null; }; this.getSession = function() { var session = window.top['_im_session_']; if (session == undefined) window.top['_im_session_'] = session = {}; return session; }; this.setSessionValue = function(key, value) { this.getSession()[key] = value; }; this.getSessionValue = function(key, defaultValue) { var value = this.getSession()[key]; return value != undefined ? value : defaultValue; }; /** * 지정한 이름의 checkbox 를 checked 값으로 선택 또는 선택 해제한다. 주로 목록 테이블에서 전체 항목을 선택 또는 선택 해제하는 checkbox 에서 사용한다. *

     *     <input type=checkbox onclick="WebUtil.toggleChecks('chk', this.checked);">
     * 
* @param name checkbox 명 * @param checked 체크 여부 */ this.toggleChecks = function(name, checked) { var chks = document.getElementsByName(name); if (chks != null) for (var i=0, iend=chks.length; i 0 && obj.tagName=='INPUT') { var type = toUpper(obj.type); if (type == 'TEXT' || type == 'HIDDEN' || ((type == 'CHECKBOX' || type == 'RADIO') && obj.checked)) params[obj.name] = obj.value; } } return params; } if (max == null || max == undefined) max = 30; if (optional == null || optional == undefined) optional = false; if (useform == null || useform == undefined) useform = false; if (old != null && old != undefined && !isValid(old, EXPR_STRING, max, '이전 암호', '이전 암호를 입력합니다.')) return false; if (!isValid(pwd, EXPR_STRING, max, '암호', optional ? null : '암호를 입력해야 합니다.')) return false; if (pwd2 != null && pwd2 != undefined && pwd.value != pwd2.value) { alert('입력한 암호가 틀립니다. 다시 입력합니다.'); pwd2.focus(); return false; } if (pwd.value != '') { var params = useform ? buildParam(document.all) : {}; params.id = id; params.pwd = pwd.value; if (old != null && old != undefined) params.old = old.value; if (options != null && options != undefined) for (var key in options) params[key] = options[key]; // get domain org related typed groups var doc = WebUtil.getXMLDocumentByPost('/' + location.pathname.split('/')[location.pathname.charAt(0)=='/' ? 1 : 0] + '/pwdcheck.do', params); var node = doc.selectSingleNode('/result'); var value = node.getAttribute('value'); if (value == 'false') { alert(node.getAttribute('msg')); return false; } } return true; } }; var Xml = new function() { this.loadXmlDoc = function(xml) { if (typeof(XSLTProcessor) =='undefined') { var doc = new ActiveXObject("Microsoft.XMLDOM"); doc.async = false; doc.loadXML(xml); return doc; } else return new DOMParser().parseFromString(xml, "text/xml"); }; this.getXmlDoc = function(method, url, params, headers) { function buildRequestParam(params) { var vals = []; for (var param in params) { var obj = params[param]; if (Object.prototype.toString.call(obj) == '[object Array]') for (var i= 0, iend=obj.length; i