//----------------------------------------------------------------------
// Form Validation의 Alert용 글로벌변수
// 		-true: Multi Alert
// 		-false: Single Alert(Classic), default
//----------------------------------------------------------------------
var IS_MULTI_ALERT = false;
function setIsMultiAlert(f){
	this.IS_MULTI_ALERT = f;
}

//----------------------------------------------------------------------
// 사이트 도메인 변수 (jsp 에서는 Constants 를 사용하고 script 변수는 되도록 쓰지 않도록 한다.)
//----------------------------------------------------------------------
var DOMAIN_BIZ114 		= "www.gbiz114.or.kr"; 		//정책통합사이트	
var DOMAIN_GSBC 		= "www.gsbc.or.kr"; 		//경기중소기업종합지원센터

var __protocol__ = "http:";
try {
	__protocol__ = location.protocol;
	if (__protocol__ == null || typeof(__protocol__) == 'undefined' || __protocol__ == "") __protocol__ = 'http:';
} catch (e) {
	__protocol__ = "http:";
}

function addCommas(nStr_) {
	var nStr = nStr_ + '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1)) {
		x1 = x1.replace(rgx, '$1' + ',' + '$2');
	}
	return x1 + x2;
}

//----------------------------------------------------------------------

//----------------------------------------------------------------------
// 검색기간 셋팅
//		@param fromObj - 시작일자 폼객체
//		@param toObj - 종료일자 폼객체(오늘날짜로 셋팅)
//		@param term - 오늘을 기준으로 차이일수(+/-)
//		@return 시작일자(YYYY-MM-DD), 종료일자(YYYY-MM-DD)
//----------------------------------------------------------------------
function setSearchDateByTerms(fromObj, toObj, term){
 	var toDate = new Date();
 	var toYear, toMonth, toDay;					 	
 	toYear = toDate.getFullYear();
 	toMonth = toDate.getMonth()+1;
 	toMonth = (toMonth<10)? '0'+toMonth : toMonth;
 	toDay = toDate.getDate();
 	toDay = (toDay<10)? '0'+toDay : toDay;
 	toObj.value = toYear + "-" + toMonth + "-" + toDay;

 	if("undefined" == typeof(term)){
	 	fromObj.value = toYear + "-" + toMonth + "-01";
 	} else{
 		var fromDate;
 		var fromYear, fromMonth, fromDay;
 		fromDate = addDay(toYear, toMonth, toDay, term);
 		fromYear = fromDate.getFullYear();
 		fromMonth = fromDate.getMonth()+1;
 		fromMonth = (fromMonth<10)? '0'+fromMonth : fromMonth;
 		fromDay = fromDate.getDate();
 		fromDay = (fromDay<10)? '0'+fromDay : fromDay;
 		fromObj.value = fromYear + "-" + fromMonth + "-" + fromDay;
 	}
}
// @private
function addDay(yyyy, mm, dd, pDay){
    var oDate;
    dd = dd*1 + pDay*1;
    mm--;
    oDate = new Date(yyyy, mm, dd);
    return oDate;
}

//----------------------------------------------------------------------
// 통합회원 페이지호출
//		@param what - 페이지아이디(Required)
//			-로그인: LOGIN
//			-로그아웃: LOGOUT
//			-회원가입: REGISTER
//			-회원수정: PERMEMBER, BIZMEMBER
//			-아이디/비밀번호찾기: IDPWD
//			-회원탈퇴: SECEDE
//		@param where - 로그인처리후 opener가 이동될 페이지(Optional)
//			-포워딩페이지가 존재 할 경우 반드시 URL인코딩되야 함
//			-자바 URL인코딩: java.net.URLEncoder.encode(forwardUrl);
//			-ex) doIntegrateMemberPage('LOGIN', escape('/POLMR0100N.do?param=1'));
//		@description: 로그인 처리후 Opener의 함수를 호출하는 경우
//			-함수명은 반드시 "callback"의 Prefix를 가져야 함
//			-파라미터는 회원명으로 고정: 콜백함수 호출시 회원명을 넘겨줌
//			-ex) doIntegrateMemberPage('LOGIN', 'callbackTestFunction');
//		@description: where가 없을경우는 opener를 새로고침 처리
//----------------------------------------------------------------------
function doIntegrateMemberPage(what, where){

	if(what == "") return;
	
	var ALL_WINDOWS = "wLOGIN|wLOGOUT|wIDPWD|wREGISTER|wPERMEMBER|wBIZMEMBER";		//추가시 수정해야 함.
	var WIDTH_SCROLL = 796;
	var WIDTH_NOSCROLL = 780;
	var SCROLLING_YES = "1";
	var SCROLLING_NO = "0";	
	
	var url = "";
	var wName = "";
	var width = "";
	var height = "";
	var scrolling = "";
	
	switch(what){
		case "LOGIN": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRLG0000N.do"; wName = "w" + what; width = WIDTH_NOSCROLL; height = 500; scrolling = SCROLLING_NO; break;
		case "LOGOUT": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRLG0300N.do"; wName = "w" + what; width = WIDTH_NOSCROLL; height = 500; scrolling = SCROLLING_NO; break;
		case "IDPWD": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRLS0000N.do"; wName = "w" + what; width = WIDTH_NOSCROLL; height = 560; scrolling = SCROLLING_YES; break;
		case "REGISTER": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRSG0100N.do"; wName = "w" + what; width = WIDTH_SCROLL; height = 700; scrolling = SCROLLING_YES; break;
		case "SECEDE": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRSG1000N.do"; wName = "w" + what; width = WIDTH_NOSCROLL; height = 560; scrolling = SCROLLING_NO; break;
		case "PERMEMBER": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRSG2700N.do"; wName = "w" + what; width = WIDTH_SCROLL; height = 700; scrolling = SCROLLING_YES; break;
		case "BIZMEMBER": url = ""+__protocol__+"//" + DOMAIN_BIZ114 + "/MBRSG2800N.do"; wName = "w" + what; width = WIDTH_SCROLL; height = 700; scrolling = SCROLLING_YES; break;
		default : alert("파라미터 정보가 올바르지 않습니다."); return;
	}
	
	if(where != "") url += "?destinationUrl=" + where;
	
	//현재 팝업화면은 닫고
	if(window.name != "" && ALL_WINDOWS.indexOf(window.name) > -1) self.close();
		
	//요청받은 팝업을 새로연다.
	var win = openPopup(url, wName, width, height, scrolling);
	if(win) win.focus();
}

//----------------------------------------------------------------------
// G-PIN인증요청
//----------------------------------------------------------------------
function requestGPINAuth(){
	wWidth = 360;
    wHight = 120;

    wX = (window.screen.width - wWidth) / 2;
    wY = (window.screen.height - wHight) / 2;

    var w = window.open("http://www.gbiz114.or.kr/Sample-AuthRequest.jsp", "gPinLoginWin", "directories=no,toolbar=no,left="+wX+",top="+wY+",width="+wWidth+",height="+wHight);
    if(w) w.focus();
}
function requestGPINAuthByGSBC(){
	wWidth = 360;
    wHight = 120;

    wX = (window.screen.width - wWidth) / 2;
    wY = (window.screen.height - wHight) / 2;

    var w = window.open("http://www.gbiz114.or.kr/Sample-AuthRequest.jsp?siteId=SITE0000000010", "gPinLoginWin", "directories=no,toolbar=no,left="+wX+",top="+wY+",width="+wWidth+",height="+wHight);
    if(w) w.focus();
}

//----------------------------------------------------------------------
// 사업자등록번호 유효성검사
//		@param bsmno - 사업자번호(하이픈생략)
//		@return true|false
//----------------------------------------------------------------------
function validateBsmNo(bsmno){
	if(bsmno.length != 10) return;
	
	var checkSum = 0;
	checkSum += parseInt(bsmno.substring(0,1)); 
	checkSum += parseInt(bsmno.substring(1,2)) * 3 % 10; 
	checkSum += parseInt(bsmno.substring(2,3)) * 7 % 10; 
	checkSum += parseInt(bsmno.substring(3,4)) * 1 % 10; 
	checkSum += parseInt(bsmno.substring(4,5)) * 3 % 10; 
	checkSum += parseInt(bsmno.substring(5,6)) * 7 % 10; 
	checkSum += parseInt(bsmno.substring(6,7)) * 1 % 10; 
	checkSum += parseInt(bsmno.substring(7,8)) * 3 % 10; 
	checkSum += Math.floor(parseInt(bsmno.substring(8,9)) * 5 / 10);
	checkSum += parseInt(bsmno.substring(8,9)) * 5 % 10; 
	checkSum += parseInt(bsmno.substring(9,10));
	
	return (checkSum % 10) == 0;
}

//----------------------------------------------------------------------
//주민등록번호 유효성검사 (내국인,외국인)
//		@param ihidnum - 주민등록번호(하이픈생략)
//		@return true|false
//----------------------------------------------------------------------

function validateRno(ihidnum){
	
	if(kor_no_chksum(ihidnum) || fgn_no_chksum(ihidnum)){
		return true;
	}else{
		return false;
	}
	
}
//----------------------------------------------------------------------
// 주민등록번호 유효성검사 (내국인)
//		@param ihidnum - 주민등록번호(하이픈생략)
//		@return true|false
//----------------------------------------------------------------------
function kor_no_chksum(ihidnum){
	
	fmt = /^\d{6}[1234]\d{6}$/;
	if(!fmt.test(ihidnum)){
		return false;
	}
	
	birthYear = (ihidnum.charAt(7) <= "2") ? "19" : "20";
	birthYear += ihidnum.substr(0, 2);
	birthMonth = ihidnum.substr(2, 2) - 1;
	birthDate = ihidnum.substr(4, 2);
	birth = new Date(birthYear, birthMonth, birthDate);
	
	if( birth.getYear() % 100 != ihidnum.substr(0, 2) ||
	    birth.getMonth() != birthMonth ||
	    birth.getDate() != birthDate) {
	    return false;
	}
	
	var arrDivide = [2, 3, 4, 5, 6, 7, 8, 9, 2, 3, 4, 5];            	
	var checkdigit = 0;            	
	for(var i=0;i<ihidnum.length-1;i++){
		checkdigit += parseInt(ihidnum.charAt(i)) * parseInt(arrDivide[i]);
	}
	checkdigit = (11 - (checkdigit%11))%10;
	if(checkdigit != ihidnum.charAt(12)){
		return false;
	}else{
		return true;
	}
}

//----------------------------------------------------------------------
//주민등록번호 유효성검사 (외국인)
//		@param ihidnum - 주민등록번호(하이픈생략)
//		@return true|false
//----------------------------------------------------------------------
function fgn_no_chksum(ihidnum) {
    var sum = 0;
    var odd = 0;
    
    buf = new Array(13);
    for (i = 0; i < 13; i++) buf[i] = parseInt(ihidnum.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;
    }
    else {
        return true;
    }
}



//----------------------------------------------------------------------
// 팝업로그인
//----------------------------------------------------------------------
function popupLogin(){
	var url = "/MBRLG0002P.do";
	openPopup(url, "wPopupLogin", 675, 460, "no");
}

//----------------------------------------------------------------------
// 첨부파일 보기
//		@param val - 파일아이디
//----------------------------------------------------------------------
function attachmentView(val){
	var url = "/MBRSG3201P.do?fileId=" + val;
	openPopup(url, "wAttachmentView", 1, 1, "1");
}

//----------------------------------------------------------------------
// 금액입력필드 표시변환
//		@param val - 실제입력된값
//		@return 금액형식값(3자리콤마)
//----------------------------------------------------------------------
function getCurrencyValue(val_){
	var val = "" + val_;
	var objRegExp = new RegExp('(-?[0-9]+)([0-9]{3})'); 
	try{
		while(objRegExp.test(val)){
	   		val = val.replace(objRegExp, '$1,$2');
	   	}
	} catch(e){ }
 	return val;
}
function getNoneCurrencyValue(val){
	return val.replaceAll(",", "");
}

//----------------------------------------------------------------------
// 전화번호, 팩스번호, 핸드폰번호 유효성체크
//		-허용되는 문자열: 숫자, -(하이픈)
//		@param val - 원본문자열
//----------------------------------------------------------------------
function isPhoneNumber(val){
	if(val == "") return false;
	var tempstr = "0123456789-";
	for(var i=0; i<val.length; i++){
		if(tempstr.indexOf(val.charAt(i)) == -1){
			return false;
		}
	}
	return true;
}

//----------------------------------------------------------------------
// 시작페이지로 설정
//----------------------------------------------------------------------
function setStartPage(obj, url){
	obj.style.behavior="url(#default#homepage)";
	obj.setHomePage(url);
}

//----------------------------------------------------------------------
// 즐겨찾기추가
//		@param url - URL
//		@param title - 즐겨찾기제목
//----------------------------------------------------------------------
function addFavorite(url, title) {
	var bookmarkurl = url;
	var bookmarktitle = title;
	
	if (window.sidebar&&window.sidebar.addPanel)
		window.sidebar.addPanel(bookmarktitle, bookmarkurl,"");
	else 
		if (document.all) window.external.AddFavorite(bookmarkurl,bookmarktitle);
}

//----------------------------------------------------------------------
// 여부필드 컨버터
//		-Y: 예, N: 아니오
//----------------------------------------------------------------------
function decodeYesNo(v){
	document.write((v=="Y")? "예":"아니오");
}

//----------------------------------------------------------------------
//체크박스 선택확인
//		@param obj - 체크박스 배열객체
//----------------------------------------------------------------------
function checkSelected(obj){
	with(obj){		
        var chkCnt=0;
        if(typeof(obj)=="undefined"){
        	//검색결과없음
        } else{
	        if(typeof(obj.length)=="undefined"){	//단일
	        	if(obj.checked) chkCnt++;
	        } else{	//복수
	        	for(i=0; i<obj.length; i++){
		        	if(obj[i].checked) chkCnt++;
		        }
	        }
        }
        
        if(chkCnt==0){
        	alert("선택된 항목이 없습니다.");
        	return false;
        }
	}
	
	return true;
}

//----------------------------------------------------------------------
// 우편번호찾기
//		@param frm - 폼객체
// 		@param zip1 - 우편번호 앞자리 오브젝트명
// 		@param zip2 - 우편번호 뒷자리 오브젝트명
// 		@param addr - 기본주소 오브젝트명
//----------------------------------------------------------------------
function findZip(frm, zip1, zip2, addr){
	var url = "/MBRSG0600P.do";
	var t = "wZipCode";

	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['zip1Obj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"zip1Obj\"/>"));
	}
	frm.elements['zip1Obj'].value = zip1;

	if (frm.elements['zip2Obj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"zip2Obj\"/>"));
	}
	frm.elements['zip2Obj'].value = zip2;

	if (frm.elements['addrObj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"addrObj\"/>"));
	}
	frm.elements['addrObj'].value = addr;
	
	with(frm){
		openPopup("", t, 720, 410, "yes");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
// 회원아이디 중복체크
// 		@param frm - 폼객체
//----------------------------------------------------------------------
function checkDspId(frm){
	var url = "/MBRSG0500P.do";
	var t = "wIdCheck";
	with(frm){
		if(dspId.value != ""){
			var val = dspId.value;
			//길이체크
			if(val.length < 6 || val.length > 20){
				alert("아이디를 6자 이상 20자 이하로 입력하세요.");
				dspId.focus();
				return;
			}
			//포멧체크
			var validChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
			for(var i=0; i<val.length; i++){
				if(validChars.indexOf(val.charAt(i)) == -1){
					alert("아이디를 영문 또는 숫자로 입력하세요.");
					dspId.focus();
					return;
				}
			}			
		}
		openPopup("", t, 444, 280, "no");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
// GSBC 회원아이디 중복체크
//		@param frm - 폼객체
//----------------------------------------------------------------------
function genCheckDspId(frm){
	var url = ""+__protocol__+"//" + DOMAIN_GSBC + "/GENSG0500P.do";
	var t = "wGenIdCheck";
	with(frm){
		if(id.value != ""){
			var val = id.value;
			//길이체크
			if(val.length < 4 || val.length > 13){
				alert("아이디를 4자 이상 13자 이하로 입력하세요.");
				id.focus();
				return;
			}
			//포멧체크
			var validChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
			for(var i=0; i<val.length; i++){
				if(validChars.indexOf(val.charAt(i)) == -1){
					alert("아이디를 영문 또는 숫자로 입력하세요.");
					id.focus();
					return;
				}
			}			
		}
		openPopup("", t, 444, 280, "no");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
// 신청서컴포넌트찾기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//----------------------------------------------------------------------
function findApldcCmpnt(frm, idId, idNm, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0101P.do?idId="+idId+"&idNm="+idNm+"&callbackfn="+callbackfn+"";
	var t = "wApldcCmpnt";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 600, 460, "no");
		target = t;
		action = url;
		submit();
	}
}


//----------------------------------------------------------------------
// 변경이력보기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param titleNm - 타이틀명
//		@param titleVal - 타이틀
//		@param trgtTblNm - 대상테이블명 
//		@param trgtKey : 조회키 (PK 를 알파벳 오더로 "key1=value1;key2=value2;...keyN=valueN;" 형태로 엮은 것)
//----------------------------------------------------------------------
function showChangeHistory(frm, titleNm, titleVal, chngTrgtTblNm, chngTrgtKey){
	var url = "/COMCH0100P.do";
	var t = "wChngHis";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['titleNm'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"titleNm\"/>"));
	}
	frm.elements['titleNm'].value = titleNm;
	
	if (frm.elements['titleVal'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"titleVal\"/>"));
	}
	frm.elements['titleVal'].value = titleVal;
	
	if (frm.elements['chngTrgtTblNm'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"chngTrgtTblNm\"/>"));
	}
	frm.elements['chngTrgtTblNm'].value = chngTrgtTblNm;
	
	if (frm.elements['chngTrgtKey'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"chngTrgtKey\"/>"));
	}
	frm.elements['chngTrgtKey'].value = chngTrgtKey;

	with(frm){
		openPopup("", t, 600, 460, "no");
		target = t;
		action = url;
		submit();
	}
}

function showSprtAplHistory(frm, trgtRnno, mbrId){
	var url = "/PMSCM0114P.do";
	var t = "wSprtAplHis";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['insttId'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"insttId\"/>"));
	}
	frm.elements['insttId'].value = '';

	if (frm.elements['siteId'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"siteId\"/>"));
	}
	frm.elements['siteId'].value = '';

	if (frm.elements['trgtRnno'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"trgtRnno\"/>"));
	}
	frm.elements['trgtRnno'].value = trgtRnno;
	
	if (frm.elements['mbrId'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"mbrId\"/>"));
	}
	frm.elements['mbrId'].value = mbrId;

	if (frm.elements['bsyr'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"bsyr\"/>"));
	}
	frm.elements['bsyr'].value = '';

	with(frm){
		openPopup("", t, 600, 460, "no");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//파일다운로드
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param fileId - 파일아이디
//----------------------------------------------------------------------
function downloadFile(frm, fileId){
	var url = "/comFileDownload.do";

	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['fileId'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"fileId\"/>"));
	}
	frm.elements['fileId'].value = fileId;
	
	with(frm){
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//작업그룹검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findOprrGrp(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';
	
	var url = "/PMSCM0000P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//회원검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 멀티선택인지, 단껀선택인지 구분값(multi, single)
//      @param mbrGubun - 회원검색팝업을 개인, 기업, 관리자로 확정해서 오픈할경우 넘기는 값 // P(개인)/B(기업)/M(관리자)
//----------------------------------------------------------------------
function findPmsMbr(frm, idId, idNm, gubun, mbrGubun, callbackfn, parInsttId, parSiteId){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (mbrGubun == undefined) mbrGubun = '';
	if (callbackfn == undefined) callbackfn = '';
	if (parInsttId == undefined) parInsttId = '';
	if (parSiteId == undefined) parSiteId = '';
	
	var url = "/PMSCM0107P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&mbrGubun="+mbrGubun+"&callbackfn="+callbackfn+"&parInsttId="+parInsttId+"&parSiteId="+parSiteId+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//기업검색 팝업창 열기
//-frm: 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//-idId: 사업자번호가 들어갈 오브젝트명(불필요시 "")
//-idNm: 기업명이 들어갈 오브젝트명(불필요시 "")
//-gubun: 기업검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findCompany(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0108P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//기관검색 팝업창 열기
//-frm: 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//-idId: 기관ID가 들어갈 오브젝트명(불필요시 "")
//-idNm: 기관명이 들어갈 오브젝트명(불필요시 "")
//-gubun: 기관검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findInstt(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0109P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}


//----------------------------------------------------------------------
//사업분류조회 팝업창 열기
//-frm: 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//-idCd: 분류코드가   들어갈 오브젝트명(불필요시 "")
//-idCdPth: 분류코드명의 Path가 들어갈 오브젝트명(불필요시 "")
//-bunryu: 각 분류별 구분값 (1:분야별, 2:대상별, 3:유형별, 4:테마별, 5:지역별)
//----------------------------------------------------------------------
function findBunryu(frm, idCd, idCdPth, bunryu, callbackfn, curSel){
	if (idCd == undefined) idCd = '';
	if (idCdPth == undefined) idCdPth = '';
	if (bunryu == undefined) bunryu = '';
	if (callbackfn == undefined) callbackfn = '';
	if (curSel == undefined) curSel = '';

	var url = "/PMSCM0110P.do?idCd="+idCd+"&idCdPth="+idCdPth+"&bunryu="+bunryu+"&callbackfn="+callbackfn+"&curSel="+curSel+"";
	var t = "wPmsMbr";

	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 500, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//지원대상조건 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findSprtTrgt(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0111P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//제약조건 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findRstrct(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0112P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//안내문구 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findGuide(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM1112P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//가산점부여조건 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findAdpt(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0113P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//사업 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findSprtBs(frm, idId, idNm, gubun, callbackfn, applcTrgtSe, parIgnoreChrgrYn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';
	if (applcTrgtSe == undefined) applcTrgtSe = '';
	if (parIgnoreChrgrYn == undefined) parIgnoreChrgrYn = '';

	var url = "/PMSCM0001P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"&parApplcTrgtSe="+applcTrgtSe+"&parIgnoreChrgrYn="+parIgnoreChrgrYn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

// 20110830 ymw 추가
//----------------------------------------------------------------------
//사업 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findSprtBs2(frm, idId, idNm, gubun, callbackfn, applcTrgtSe, parIgnoreChrgrYn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';
	if (applcTrgtSe == undefined) applcTrgtSe = '';
	if (parIgnoreChrgrYn == undefined) parIgnoreChrgrYn = '';

	var url = "/PMSCM0001P2.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"&parApplcTrgtSe="+applcTrgtSe+"&parIgnoreChrgrYn="+parIgnoreChrgrYn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//차수 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findSprtBsOrd(frm, idId, idNm, gubun, callbackfn, parApplcTrgtSe, parSprtTrgtSe, parIgnoreChrgrYn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';
	if (parApplcTrgtSe == undefined) parApplcTrgtSe = '';
	if (parSprtTrgtSe == undefined) parSprtTrgtSe = '';
	if (parIgnoreChrgrYn == undefined) parIgnoreChrgrYn = '';

	var url = "/PMSCM0002P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"&parApplcTrgtSe="+parApplcTrgtSe+"&parSprtTrgtSe="+parSprtTrgtSe+"&parIgnoreChrgrYn="+parIgnoreChrgrYn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//프로세스템플릿 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findPrcTmpl(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0100P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//신청서스템플릿 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findApldcTmpl(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0102P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//신청서스템플릿 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findEvlpTmpl(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0103P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//신청서 검색 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//		@param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findApldc(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0104P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//평가지 검색 팝업창 열기
// @param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
// @param idId - id 가 들어갈 오브젝트명(불필요시 "")
// @param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
// @param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findEvlp(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/PMSCM0105P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}
	
	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//평가자 검색 팝업창 열기
// @param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
// @param idId - id 가 들어갈 오브젝트명(불필요시 "")
// @param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
// @param gubun - 회원검색창에서 멀티선택인지, 단껀선택인지 구분값(multi, single)
//----------------------------------------------------------------------
function findEvlr(frm, idId, idNm, gubun, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';
	
	var url = "/PMSCM0106P.do?idId="+idId+"&idNm="+idNm+"&gubun="+gubun+"&callbackfn="+callbackfn+"";
	var t = "wPmsMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
	openPopup("", t, 500, 520, "Y");
	target = t;
	action = url;
	submit();
	}
}

//----------------------------------------------------------------------
//신청이력 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param aplId - 신청아이디
//----------------------------------------------------------------------
function showAplHistory(frm, aplId){
	var url = "/PMSPS0400N.do?parAplId="+aplId+"";
	var t = "wHistory";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 900, 520, "yes");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//신청메모등록 팝업창 열기
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param aplId - 신청아이디
//----------------------------------------------------------------------
function regAplMmo(frm, aplId){
	var url = "/PMSPS0292N.do?parAplId="+aplId+"";
	var t = "wRegMmo";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 600, 520, "yes");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
// 예약 달력 열기
//  @param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//  @param jobSe - 시설(F), 장비(E)
//  @param calSe - 제한일달력(1), 사용자신청(2), 관리자신청(3), 예약현황(4)
//  @param trgtId - 시설(장비)아이디
//  @param rcptNo - 시설(장비)접수번호. 신규("")/변경(특정값)
//  @param repYn - 반복(Y), 단일(N)
//  @param lndYn - 임대(Y), 방문(N)
//  @param srchYm - 특정 달부터 표시하고자할 때. 현재 달을 표시할 경우 공백
//  @param callbackfn - fnLndAplDateInfo() 이외 사용시. 변경하지 않을 경우 생략가능
//  @param rsvrUntSe - 예약단위구분 - 1:시간, 2:오전/오후/야간, 3:일. 4: 주
//----------------------------------------------------------------------
function popRsvrCal(frm, jobSe, calSe, trgtId, rcptNo, repYn, lndYn, srchYm, callbackfn, rsvrUntSe, aplLst){
	if (callbackfn == undefined) callbackfn = '';

	var url = "/POLCM0000P.do";
	var t = "wRsvrCal";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['jobSe'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"jobSe\"/>"));
	}
	frm.elements['jobSe'].value = jobSe;

	if (frm.elements['calSe'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"calSe\"/>"));
	}
	frm.elements['calSe'].value = calSe;

	if (frm.elements['trgtId'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"trgtId\"/>"));
	}
	frm.elements['trgtId'].value = trgtId;
	
	if (frm.elements['rcptNo'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"rcptNo\"/>"));
	}
	frm.elements['rcptNo'].value = rcptNo;

	if (frm.elements['repYn'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"repYn\"/>"));
	}
	frm.elements['repYn'].value = repYn;

	if (frm.elements['lndYn'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"lndYn\"/>"));
	}
	frm.elements['lndYn'].value = lndYn;

	if (frm.elements['srchYm'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"srchYm\"/>"));
	}
	frm.elements['srchYm'].value = srchYm;

	if (frm.elements['callbackfn'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"callbackfn\"/>"));
	}
	frm.elements['callbackfn'].value = callbackfn;

	if (frm.elements['rsvrUntSe'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"rsvrUntSe\"/>"));
	}
	frm.elements['rsvrUntSe'].value = rsvrUntSe || '';

	if (frm.elements['aplLst'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"aplLst\"/>"));
	}
	frm.elements['aplLst'].value = aplLst || '';

	with(frm){
		openPopup("", t, 720, 629, "no");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//	startsWith + endsWith
//----------------------------------------------------------------------
String.prototype.startsWith = function(str){
	return (this.match("^"+str)==str);
}
String.prototype.endsWith = function(str){
	return (this.match(str+"$")==str);
}

//----------------------------------------------------------------------
//	문자열 치환
//----------------------------------------------------------------------
String.prototype.trim = function(){
	return this.replace(/(^\s*)|(\s*$)/gi, "");
}

//----------------------------------------------------------------------
// 문자열 치환
//----------------------------------------------------------------------
String.prototype.replaceAll = function(str1, str2){
	var temp_str = "";

  	if(this.trim() != "" && str1 != str2){
	    temp_str = this.trim();

    	while (temp_str.indexOf(str1) > -1){
			temp_str = temp_str.replace(str1, str2);
    	}
  	}

	return temp_str;
}

//----------------------------------------------------------------------
//문자열 비교
//----------------------------------------------------------------------
String.prototype.equals = function (str) {
	return str == this;
}

//----------------------------------------------------------------------
//테이블명, 필드명 등 '_' 가 있는 문자열을 자바변수 형태로 변경
//----------------------------------------------------------------------
String.prototype.toCamelCase = function () {
	var len = this.length;
	var str = '';
	var ch;
	var upper = false;
	for (var i = 0; i < len; i ++) {
		ch = this.charAt(i);
		if (ch == '_') {
			upper = true;
			continue;
		}
		str += upper ? ch.toUpperCase() : ch.toLowerCase();
		upper = false;
	}
	return str;
}

//----------------------------------------------------------------------
// 팝업창을 화면 가운데로 띄움
// 		@param u - URL
//		@param t - Target Name
//		@param w - Width
//		@param h - Height
//		@param s - Scrollbar Option[Y, N]
//----------------------------------------------------------------------
function openPopup(u, t, w, h, s){
	var opt="height=" + h + ",innerHeight=" + h + ",width=" + w + ",innerWidth=" + w;
  	if(window.screen) { 
    		var ah = screen.availHeight - 30;
    		var aw = screen.availWidth - 10;
    		var xc = (aw - w) / 2; 
    		var yc = (ah - h) / 2; 
    		opt += ",left=" + xc + ",screenX=" + xc; 
    		opt += ",top=" + yc + ",screenY=" + yc; 
    		opt += ",scrollbars=" + s;
  	}

	var win = window.open(u,t,opt);
	if(win) win.focus();
}

//----------------------------------------------------------------------
// 팝업창 사이즈 자동조절
//----------------------------------------------------------------------
function autoResizePopup() {
	var winW, winH, sizeToW, sizeToH;
	if ( parseInt(navigator.appVersion) > 3 ) {
 		if ( navigator.appName=="Netscape" ) {
  			winW = window.innerWidth;
			winH = window.innerHeight;
 		}
 		if ( navigator.appName.indexOf("Microsoft") != -1 ) {
  			winW = document.body.scrollWidth;
  			winH = document.body.scrollHeight;
 		}
	}
	sizeToW = 0;
	sizeToH = 0;
	if ( winW > 600 ) {
		sizeToW = 600 - document.body.clientWidth;
	} else if ( Math.abs(document.body.clientWidth - winW ) > 3 ) {
		sizeToW = winW - document.body.clientWidth;
	}
	if ( winH > 680 ) {
		sizeToH = 680 - document.body.clientHeight;
	} else if ( Math.abs(document.body.clientHeight - winH) > 4 ) {
		sizeToH = winH - document.body.clientHeight;
	}
	if ( sizeToW != 0 || sizeToH != 0 )
		window.resizeBy(sizeToW, sizeToH);

}


//----------------------------------------------------------------------
//* 내용 : select tag 내 항목중 주어진 값과 일치하는 항목을 선택된 상태로 변경
//* 입력 :
//*   formName - select 가 속해있는 form 의 아이디
//*   selectName - select 의 아이디
//*   text - select 의 아이템과 비교할 값
//*   over - 비교하지 않고 건너뛸 아이템의 수 ("선택하세요" 등의 항목). default:0
//*   invalue - value 의 비교 여부.  default:-1
//*     -1:항목의 text(눈에 보이는 값)로 비교,
//*     -1 이 아닐 경우:value 를 "|" 로 split 해서 나오는 값의 invalue 순서의 값과 비교
//*   match : 일치로 검색할지의 여부. default:false
//*     true : 비교대상과 동일할 경우 찾은 것으로 함
//*     false : 비교대상과 비교적 일치할 경우(크거나 같을 경우?) 찾은 것으로 함
//*   head : 비교문자열(text) 의 앞에 추가로 붙여 비교할 문자열. default:""
//*   tail : 비교문자열(text) 의 뒤에 추가로 붙여 비교할 문자열. default:""
//*     select 의 값은 head+text+tail 과 비교 되어 진다.
//*   justreturn - 찾은 값만 얻고 선택은 하지 않을지의 여부. default:false
//*     true - 찾았어도 선택은 하지 않는다.
//*   returndefault : 찾지 못했을 경우의 return 값. default:""
//* 반환 : 선퇵된 항목의 값
//----------------------------------------------------------------------
function searchSelect(formName,selectName,text,over,invalue,match,head,tail,justreturn,returndefault) {
	/*
	'' objSel - select object
	'' iOver - <- over
	'' iInValue - <- invalue
	'' bMatch - <- match
	'' aValue - temporary - value 를 "|" 로 split 한 배열
	'' szHead - <- head
	'' szTail - <- tail
	'' bJustReturn - <- justreturn
	'' szReturnDefault - <- returndefault
	'' szReturn - 반환할 값
	*/
	var objSel;
	var iOver;
	var iInValue;
	var bMatch;
	var aValue;
	var szHead,szTail;
	var bJustReturn;
	var szReturnDefault;
	var szReturn;
	/*
	'' 파라미터를 정돈한다. (입력안 된 것은 default 로,내부변수의 형식에 맞도록 변경)
	*/
	if (typeof(justreturn)!='undefined') bJustReturn=justreturn; else bJustReturn=false;
	if (typeof(returndefault)!='undefined') szReturnDefault=returndefault; else szReturnDefault='';
	if (formName=='') formName="_no form_"
	if (selectName=='') selectName="_no select_"
	if (document.forms(formName)==null) return szReturnDefault;
	if (document.forms(formName).elements(selectName)==null) return szReturnDefault;
	if (typeof(over)!='undefined') iOver=over; else iOver=0;
	if (typeof(invalue)!='undefined') iInValue=invalue; else iInValue=-1;
	if (typeof(match)!='undefined') bMatch=match; else bMatch=false;
	if (typeof(head)!='undefined') szHead=head; else szHead='';
	if (typeof(tail)!='undefined') szTail=tail; else szTail='';

	/*
	'' return 값을 default 값으로 설정한다.
	*/
	szReturn=szReturnDefault;

	/*
	'' head+text+tail 을 붙여 찾을 문자열을 만든다.
	*/
	text=szHead+text+szTail;

	/*
	'' object 를 얻는다. (안되면 바로 오류가 나므로 따로 체크하지는 않는다.)
	*/
	objSel=document.forms(formName).elements(selectName);

	/*
	'' i - iterator. select 의 option index
	*/
	var i;

	/*
	'' option 을 over 갯수만큼 스킵한 것 부터 돌면서 조건에 해당하는 항목을 찾는다.
	*/
	for (i=iOver;i<objSel.options.length;i++) {
		if (iInValue==-1) {
			/*
			'' invalue 가 -1 일 경우 text 에 대한 비교를 한다.
			*/
			if (bMatch) {
				/*
				'' 일치 비교일때는 일치하는 항목을 찾는다.
				*/
				if (objSel.options[i].text==text) {
					if (!bJustReturn) objSel.selectedIndex=i;
					szReturn=objSel.options[i].value;
					break;
				}
			} else {
				/*
				'' 일치 비교가 아닐때는 비교하는 항목보다 크거나 같은 항목을 찾는다.
				*/
				if (objSel.options[i].text>=text) {
					if (!bJustReturn) objSel.selectedIndex=i;
					szReturn=objSel.options[i].value;
					break;
				}
			}
		} else {
			/*
			'' invalue 가 -1 이 아닐 경우 value 를 "|" 로 쪼개고 이것의 invalue 에 해당하는 값을 비교한다.
			*/
			aValue=(objSel.options[i].value+'||||||||||||||').split('||');
			if (bMatch) {
				/*
				'' 일치 비교일때는 일치하는 항목을 찾는다.
				*/
				if (aValue[iInValue]==text) {
					if (!bJustReturn) objSel.selectedIndex=i;
					szReturn=objSel.options[i].value;
					break;
				}
			} else {
				/*
				'' 일치 비교가 아닐때는 비교하는 항목보다 크거나 같은 항목을 찾는다.
				*/
				if (aValue[iInValue]>=text) {
					if (!bJustReturn) objSel.selectedIndex=i;
					szReturn=objSel.options[i].value;
					break;
				}
			}
		}
	}

	return szReturn;
}

//----------------------------------------------------------------------
//* 내용 : select 에 선택 값을 돌려준다.
//*   (select object 의 value 를 가져 오는 것과 달리
//*   multi select 일 경우 선택된 모든 항목의 값을 "," 로 묶어 돌려 준다)
//* 입력 :
//*   objForm - select object 가 있는 form 의 아이디
//*   objRadio - select object 의 아이디 (이름이 안 맞지만 이해하기를.)
//*   dV - 선택된 값이 없을 경우 default 값. default:-1
//* 반환 : "," 로 엮인 선택된 항목의 value 들
//* 주의 : 선택은 됬지만 값이 없을 경우는 처리 대상에서 제외된다.
//----------------------------------------------------------------------
function getSelectValue(objForm,objRadio,dV) {

	/*
	'' defaultValue - 선택된 항목이 없을 경우 설정할 값
	*/
	var defaultValue;
	if (getSelectValue.arguments.length>=3) defaultValue=dV;
	else defaultValue=-1;

	/*
	'' iSellCode - return 할 값
	*/
	var iSellCode;

	/*
	'' 입력된 값을 정돈한다.
	*/
	iSellCode=defaultValue;
	if (objForm=='') objForm="_no form_"
	if (objRadio=='') objRadio="_no radio_"
	if (document.forms(objForm)==null) return iSellCode;
	if (document.forms(objForm).elements(objRadio)==null) return iSellCode;

	/*
	'' i - iterator
	'' len - option 의 수
	'' val - return 할 값
	*/
	var i,len,val;

	/*
	'' option 의 갯수를 얻고 return 할 값을 초기화 한다.
	*/
	len=document.forms(objForm).elements(objRadio).options.length;
	val='';
	/*
	'' 각 option 에 대해
	*/
	for (i=0;i<len;i++) {
		if (document.forms(objForm).elements(objRadio).options[i].selected&&document.forms(objForm).elements(objRadio).options[i].value!='') {
			/*
			'' 선택되어 있고 값이 있다면 return 할 값에 추가한다. (값이 여럿일 경우 "," 로 분리한다.)
			*/
			if (val!='') val+=',';
			val+=document.forms(objForm).elements(objRadio).options[i].value;
		}
	}
	if (val!='') iSellCode=val;
	return iSellCode;
}

//----------------------------------------------------------------------
//* 내용 : 라디오버튼의 결과값을 확인
//* 입력 :
//*   objForm - 라디오버튼이 속한 폼의 이름
//*   objRadio - 라디오버튼의 이름
//*   dV - 선택항목이 없을 경우의 리턴값
//*   bAddIndex - true 일경우 return 값에 순서를 "|" 로 구분에 추가 시킨다.
//*     (몇번째 radio 를 선택했는지 알고 싶을때 사용)
//* 반환 : 선택항목지정시 선택된 값, 미지정시 dV
//* 주의 : bAddIndex 가 true 일 경우 찾은 것이 없으면 index 에 "" 이 간다.
//*   radio 가 아니더라도 값을 얻을 수 있는 것이면 값을 반환한다.
//----------------------------------------------------------------------
function getRadioValue(objForm,objRadio,dV,bAddIndex) {

	/*
	'' defaultValue - 찾은 것이 없을 경우 return 할 값 <- dV
	'' iSellCode - return 값
	'' bNoItem - 찾은 항목이 있는지의 여부 (같은 이름을 가진 radio 가 여러개 있는지 확인하기 위해 사용됨)
	'' bAddIdnex_ - <- bAddIndex
	*/
	var defaultValue;
	var iSellCode,bNoItem,bAddIndex_;

	/*
	'' 파라미터를 조정한다.
	*/
	if (getRadioValue.arguments.length>=3) defaultValue=dV;
	else defaultValue=-1
	iSellCode=defaultValue;
	if (objForm=='') objForm="_no form_"
	if (objRadio=='') objRadio="_no radio_"
	if (document.forms(objForm)==null) return iSellCode;
	if (document.forms(objForm).elements(objRadio)==null) return iSellCode;
	if (typeof(bAddIndex)!='undefined') bAddIndex_=bAddIndex; else bAddIndex_=false;
	if (bAddIndex_) iSellCode='|'+iSellCode;

	/*
	'' i - iterator
	*/
	var i;
	bNoItem=true;
	/*
	'' radio 가 몇개가 될지는 모른다(지금은 알것 같지만...) 따라서 적당한 수(1000)으로 제한하여 검색한다.
	*/
	for (i=0;i<1000;i++) {
		/*
		'' 항목이 없으면 멈춘다.
		*/
		if (document.forms(objForm).elements(objRadio)[i]==null) break;
		/*
		'' index 로 구분되는 항목이 존재한다면 같은 이름의 radio 가 여럿 존재한다는 것이다.
		*/
		bNoItem=false;
		/*
		'' checked 된 항목을 찾았을 경우 값을(필요하다면 인덱스도) 반환값으로 설정한다.
		*/
		if (document.forms(objForm).elements(objRadio)[i].checked) {
			iSellCode=document.forms(objForm).elements(objRadio)[i].value;
			if (bAddIndex_) iSellCode=i+'|'+iSellCode;
			break;
		}
	}
	/*
	'' bNoItem 이 true 인것은 radio 가 한개이거나 없다는 것이다.
	*/
	if (bNoItem) {
		/*
		'' 한 개일 경우 type 이 radio 인지(제대로만 한다면 check 할 필요 없다.) checked 된지 확인하여 반환값을 결정한다.
		*/
		if (document.forms(objForm).elements(objRadio)!=null) {
			if (document.forms(objForm).elements(objRadio).type!='radio') {
				iSellCode=document.forms(objForm).elements(objRadio).value;
				if (bAddIndex_) iSellCode=0+'|'+iSellCode;
			}
			if (document.forms(objForm).elements(objRadio).checked) {
				iSellCode=document.forms(objForm).elements(objRadio).value;
				if (bAddIndex_) iSellCode=0+'|'+iSellCode;
			}
		}
	}
	return iSellCode;
}

//----------------------------------------------------------------------
//* 내용 : 체크박스의 결과값을 확인
//*   같은 이름이 여럿일때도 사용가능함
//* 입력 :
//*   objForm - 체크버튼이 속한 폼의 이름
//*   objRadio - 체크버튼의 이름 (이름이 이상해도 이해하기를.)
//*   dV - 체크되지 않았을 경우의 리턴값
//* 반환 : 체크시 선택된 값, 미체크시 dV
//*   checkbox 가 아니더라도 값을 얻을 수 있는 것이면 값을 반환한다.
//*   똑같은 이름의 checkbox 가 있을 경우 앞쪽에 위치한 체크든 항목의 값을 return
//----------------------------------------------------------------------
function getCheckValue(objForm,objRadio,dV) {
	/*
	'' defaultValue - 체크된 항목이 없을 경우 사용할 값 <- dV
	'' iSellCode - return 값
	'' bNoItem - 같은 이름의 항목이 여럿인지의 여부 (true 일 경우 하나만 존재하는 것을 의미)
	*/
	var defaultValue;
	var iSellCode,bNoItem;

	/*
	'' 입력값 등을 초기화 한다.
	*/
	if (getCheckValue.arguments.length>=3) defaultValue=dV;
	else defaultValue=-1
	iSellCode=defaultValue;
	if (objForm=='') objForm="_no form_"
	if (objRadio=='') objRadio="_no radio_"
	if (document.forms(objForm)==null) return iSellCode;
	if (document.forms(objForm).elements(objRadio)==null) return iSellCode;

	/*
	'' i - iterator
	*/
	var i;
	bNoItem=true;
	/*
	'' 같은 이름을 가진 항목 1000개에 대해 처리한다.
	*/
	for (i=0;i<1000;i++) {
		if (document.forms(objForm).elements(objRadio)[i]==null) break;
		/*
		'' 한개라도 발견되면 같은 이름을 가진 것이 여럿인 것이다.
		*/
		bNoItem=false;
		/*
		'' 체크된 것을 발경하면 끝낸다.
		*/
		if (document.forms(objForm).elements(objRadio)[i].checked) {
			iSellCode=document.forms(objForm).elements(objRadio)[i].value;
			break;
		}
	}
	/*
	'' 같은 이름을 가진 것이 하나 밖에 없다면 또는 없다면
	*/
	if (bNoItem) {
		/*
		'' 있을 경우
		*/
		if (document.forms(objForm).elements(objRadio)!=null) {
			/*
			'' checkbox 가 아닐 경우는 값을,
			'' checkbox 일 경우는 check 되어있을때의 값을(안되어 있으면 default) 를 설정한다.
			*/
			if (document.forms(objForm).elements(objRadio).type!='checkbox') iSellCode=document.forms(objForm).elements(objRadio).value;
			if (document.forms(objForm).elements(objRadio).checked) {
				iSellCode=document.forms(objForm).elements(objRadio).value;
			}
		}
	}
	return iSellCode;
}

//----------------------------------------------------------------------
//* 내용 : 체크박스에 할당된 값을 얻는다.
//*   같은 이름을 가진 체크박스가 여럿일때 유용하다.
//* 입력 :
//*   formname - form name
//*   itemname - checkbox name (같은 역할을 하는 것은 같은 이름으로 만든다.)
//*   idx - value 중의 위치 (value 는 '|' 로 묶여 있다. 이로 구분된 인덱스를 말한다.) default:0
//*   needall - check 여부에 관계없이 넣을 것인가.
//*     false 일 경우 check 된 항목의 값들을 "|" 로 묶어 반환한다.
//*     true 일 경우 check 되지 않은 항목의 값도 얻는다. (모든 값을 얻고자 할때 사용)
//*   getfrom - 값을 얻을 아이템의 이름,
//*     check 된 항목의 값을 checkbox 자체가 아닌 다른 항목의 값에서 얻을 수 있도록 한다.
//*     null 이거나 '' 일 경우 itemname 을 사용한다.
//*   exceptdisabled - true 일 경우. disabled 된 항목을 확인 항목에서 제외시킨다.
//* 반환 : "|" 로 구분된 지정된(선택된) 항목의 값
//----------------------------------------------------------------------
function getCheckValues(formname,itemname,idx,needall,getfrom,exceptdisabled) {
	/*
	'' szCodes - 리턴 값
	'' bNeedAll - <- needall
	'' iIdx - <- idx
	'' szValue - checkbox 의 값. "|" 로 구분된 항목중 idx 번째의 값
	'' szGetFrom - <- getfrom
	'' bExceptDisabled - <- exceptdisabled
	*/
	var szCodes,bNeedAll,iIdx,szValue,szGetFrom,bExceptDisabled;

	/*
	'' 변수 초기화 및 입력된 사항을 점검
	*/
	szCodes='';
	iIdx=0;
	if (typeof(idx)!='undefined') iIdx=idx;
	bNeedAll=false;
	if (typeof(needall)!='undefined') bNeedAll=needall;
	szGetFrom=itemname
	if (typeof(getfrom)!='undefined') {
		if (getfrom!=null&&getfrom!='') szGetFrom=getfrom;
	}
	bExceptDisabled=false;
	if (typeof(exceptdisabled)!='undefined') bExceptDisabled=exceptdisabled;
	
	if (document.all[formname].elements[itemname]==null) ;
	else
		/*
		'' 항목이 있을 경우 처리한다.
		*/
		if (document.all[formname].elements[itemname].length==null) {
			/*
			'' checkbox 가 하나일 경우의 처리
			*/
			szValue=(document.all[formname].elements[szGetFrom].value+'||||').split('|')[iIdx+0];
			/*
			'' 값이 없으면 리턴할 것이 없으므로 무시한다.
			*/
			if (szValue!='') {
				/*
				'' bExceptDisabled 가 true 일 경우 disabled 된 항목은 무시한다.
				*/
				if (!bExceptDisabled||!document.all[formname].elements[itemname].disabled) {
					/*
					'' bNeedAll 이 true 이면 항상 그렇지 않으면 checked 일 경우 값을 얻는다.
					*/
					if (bNeedAll) {
						szCodes=szValue;
					} else {
						if (document.all[formname].elements[itemname].checked) {
							szCodes=szValue;
						}
					}
				}
			}
		} else {
			/*
			'' checkbox 가 여럿 일 경우 각 cjeckbox 에 대해 확인을 하고
			'' 얻은 값을 "|" 로 묶는다.
			*/
			for (i=0;i<document.all[formname].elements[itemname].length;i++) {
				szValue=(document.all[formname].elements[szGetFrom][i].value+'||||').split('|')[iIdx+0];
				if (szValue!='') {
					if (!bExceptDisabled||!document.all[formname].elements[itemname][i].disabled) {
						if (bNeedAll) {
							if (szCodes!='') szCodes+='|';
							szCodes+=szValue;
						} else {
							if (document.all[formname].elements[itemname][i].checked) {
								if (szCodes!='') szCodes+='|';
								szCodes+=szValue;
							}
						}
					}
				}
			}
		}
	return szCodes;
}

//----------------------------------------------------------------------
//* 내용 : 같은 이름을 갖는 체크박스를 모두 checked(위 입력) 된 상태로 만든다.
//* 입력 :
//*   formname - form name
//*   itemname - item name (check box 의 이름)
//*   checked - 만들고 싶은 상태
//----------------------------------------------------------------------
function selectAllCheck(formname,itemname,checked) {
	if (document.all[formname].elements[itemname]==null) ;
	else
		/*
		'' 항목이 하나일 경우는 해당 항목을 변경하고 여럿일 경우 모두 변경한다.
		*/
		if (document.all[formname].elements[itemname].length==null) {
			if (!document.all[formname].elements[itemname].disabled) document.all[formname].elements[itemname].checked=checked;
		} else {
			for (i=0;i<document.all[formname].elements[itemname].length;i++) {
				if (!document.all[formname].elements[itemname][i].disabled) document.all[formname].elements[itemname][i].checked=checked;
			}
		}
}

//----------------------------------------------------------------------
//* 내용 : select 의 값을 선택. 없을 경우 디폴트 저정
//* 입력 :
//*   obj - object. string 일 경우 이름으로 찾음
//*   val - 설정값
//*   def - val 이 options 에 없을 경우 설정할 디폴트. 이 것도 없다면 첫번째 항목으로 설정
//----------------------------------------------------------------------
function setSelect(obj, val, def, valfunc) {
	if (typeof(obj) == 'string') {
		obj = document.all[obj];
	}
	if (obj == null) {
		return ;
	}

	var options = obj.options;
	if (options == null) {
		return ;
	}
	
	var lenOpt = options.length;
	var candi = 0;
	var value;
	for (var i = 0; i < lenOpt; i ++) {
		value = valfunc == undefined ? options[i].value : valfunc(options[i].value);
		if (value == val) {
			obj.selectedIndex = i;
			return ;
		}
		if (value == def) {
			candi = i;
		}
	}
	obj.selectedIndex = candi;
}

//----------------------------------------------------------------------
//* 내용 : 객체의 style.display 값을 변경한다. (table, tr, td 등 안에 다른 객체가 있을 경우 사용. IE 에서 제대로 지워지지 않는 경우가 있음.)
//* 입력 :
//*   obj - 설정을 바꿀 객체
//*   display - 설정 값 (true/false)
//* 주의 : 내부에 다른 객체를 컨트롤 하고 있을 경우 사용할 수 없음
//*       skipsetdisplay 를 yes 로 설정하면 빼고 처리함.
//*       <button class="imgbutton_51" skipsetdisplay="yes" onclick="javascript:addEvlpTmplCmpsItm()"><img src="<%=request.getContextPath()%>/images/gsbc/bicon_03.gif" width="15" height="12">추가</button>
//----------------------------------------------------------------------
function setDisplay(obj, display) {
	if (obj.skipsetdisplay == "yes") return ;
	
	if (display) {
		var nodes = obj.childNodes;
		var lenNodes = 0;
		if (nodes) {
			lenNodes = nodes.length;
		}

		for (var i = 0; i < lenNodes; i ++) {
			setDisplay(nodes[i], display);
		}

		try {
			obj.style.display = '';
		} catch (e) {}

	} else {
		var nodes = obj.childNodes;
		var lenNodes = 0;
		if (nodes) {
			lenNodes = nodes.length;
		}

		for (var i = 0; i < lenNodes; i ++) {
			setDisplay(nodes[i], display);
		}

		try {
			obj.style.display = 'none';
		} catch (e) {}

	}
}

//----------------------------------------------------------------------
//* 내용 : 객체의 style.background 값을 변경한다. (table, tr, td 등 안에 다른 객체가 있을 경우 사용. IE 에서 제대로 지워지지 않는 경우가 있음.)
//* 입력 :
//*   obj - 설정을 바꿀 객체
//*   color - 설정 값
//* 주의 : 내부에 다른 객체를 컨트롤 하고 있을 경우 사용할 수 없음
//----------------------------------------------------------------------
function setBackground(obj, color) {
	var nodes = obj.childNodes;
	var lenNodes = 0;
	if (nodes) {
		lenNodes = nodes.length;
	}

	for (var i = 0; i < lenNodes; i ++) {
		setBackground(nodes[i], color);
	}

	try {
		obj.style.background = color;
	} catch (e) {}
}

function __html2title(html) {
	return html.replace(/<[^>]*>/g, "")
		.replace("&nbsp;", " ")
		.replace("&apos;","'")
		.replace("&quot;","\"")
		.replace("&amp;","&")
		.replace("&lg;",">")
		.replace("&gt;","<")
		;
}

//----------------------------------------------------------------------
// 문자열의 길이를 byte 수로 계산
// ex) "123가나다".byte() //* 9 return
//----------------------------------------------------------------------
function __byte(str) {
	var cnt = 0;
	for (var i = 0; i < str.length; i++) {
		if (str.charCodeAt(i) > 127)
			cnt += 2;
		else
			cnt++;
	}
	return cnt;
}
String.prototype.byteLength = function () {
	var cnt = 0;
	var len = this.length;
	for (var i = 0; i < len; i++) {
		if (this.charCodeAt(i) > 127)
			cnt += 2;
		else
			cnt++;
	}
	return cnt;
}

//----------------------------------------------------------------------
// style sheet class 가  "ellipsis" 인 항목의 title 자동생성을 위한 helper 지정
// ellipsis 이고 title 이 지정되어 있지 않을 경우 내부의 innerHTML 을 사용하여 title 을 자동 생성한다.
// 태그에 maxchars 가 지정되어 있을 경우 maxchars 이상이 될 경우에만 title 을 생성한다.
// ex) tblMainList 테이블 밑에 있는 모든  ellipsis 사용 항목에 title 지정
//	__loader__.appendUserLoader(
//		function () {
//			setEllipsisHelper(document.all['tblMainList']);
//		}
//		);
//----------------------------------------------------------------------
function setEllipsisHelper(obj) {
	if (obj == null) {
		return ;
	}
	
	var oldonmouseover = obj.onmouseover;
	var oldonmouseout = obj.onmouseout;
	
	obj.onmouseover = function () {
		if (event.srcElement.className.indexOf('ellipsis') != -1 && event.srcElement.title == ''
			&& event.srcElement.tagName != 'TABLE'
			&& event.srcElement.tagName != 'TR'
			&& event.srcElement.tagName != 'TH'
			) {
			var title = __html2title(event.srcElement.innerHTML);
			if (event.srcElement.maxchars != undefined) {
				if (__byte(title) > event.srcElement.maxchars) {
					event.srcElement.title=title;
				}
			} else
			if (event.srcElement.scrollWidth > event.srcElement.clientWidth) {
				event.srcElement.title=title;
			}
		}
		/*
		if (event.srcElement.className.indexOf('ellipsis') != -1) {
			event.srcElement.className=event.srcElement.className.replaceAll('ellipsis', 'hovertitle');
		}
		*/
		if (oldonmouseover != null) {
			oldonmouseover();
		}
	}
	
	obj.onmouseout = function () {
		/*
		if (event.srcElement.className.indexOf('hovertitle') != -1) {
			event.srcElement.className=event.srcElement.className.replaceAll('hovertitle', 'ellipsis');
		}
		*/
		if (oldonmouseout != null) {
			oldonmouseout();
		}
	}
}

//----------------------------------------------------------------------
//* ajax 호출을 위한 class
//* 생성자 파라미터
//*   url
//*   postParam - post 방식으로 호출할 경우 전달될 파라미터. null 일 경우 get 방식으로 동작함.
//*     ex) "id=xxx&name=yyy" 
//*   callbackFn - async 방식으로 호출할 경우 callback function. null 일 경우 sync 방식으로 동작함.
//*     한 개의 파라미터가 필요하며 이 파라미터에는 this pointer 가 전달된다.
//*     ex) function (obj) { alert(obj.responseText); }
//* 메쏘드
//*   setProcIdx(procIdx) - procIdx 설정(procIdx 는 사용하는 곳에서 정해진 값으로 마지막으로 보낸 call 인지 확인하는 데 사용할 수 있다.
//*   getProcIdx()
//*   setRequestHeader(key, value) - request header 설정. ajax 객체의 setRequestHeader 와 동일
//*   call(onlySucc) - 설정된 파라미터로 호출시도. onlySucc - async 방식일 때 성공시에만 callback 을 호출함(생략가능. 생략시 true).
//*     sync 방식일 경우 return 값은 성공여부.
//*     async 방식일 경우 성공시에 callbackFn 이 호출됨. (onlySucc 에 false 일 경우 무조건 호출됨)
//*   abort() - ajax 객체의 abort() 과 동일
//*   getResponseXML() - 성공후 처리해야 되며. ajax 객체의 responseXML 과 동일
//*   getResponseText() - 성공후 처리해야 되며. ajax 객체의 responseText 과 동일
//*   getResponseHeader(header) - ajax 객체의 getResponseHeader(header) 과 동일
//*   getAllResponseHeaders() - ajax 객체의 getAllResponseHeaders() 과 동일
//----------------------------------------------------------------------
function AjaxCall(url, postParam, callbackFn) {
	this.obj = null;
	this.url = url;
	this.postParam = postParam;
	this.callbackFn = callbackFn;
	this.onlySucc = true;
	this.procIdx = 0;

	var tthis = this;
	
	if (this.obj == null) {
		if (window.XMLHttpRequest) {
			this.obj = new XMLHttpRequest();
		} else if (window.ActiveXObject) {
			this.obj = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	
	if (this.postParam == "") {
		this.postParam = null;
	}
	
	//* private
	this.callback__ = function () {
		if (tthis.callbackFn != null) {
			if (tthis.obj.readyState == 4) {
				if (tthis.obj.status == 200) {
					tthis.callbackFn(tthis);
					return ;
				}
			}

			if (! tthis.onlySucc) {
				tthis.callbackFn(tthis);
			}
		}
	};
	
	this.setProcIdx = function (procIdx) {
		this.procIdx = procIdx;
	}
	
	this.getProcIdx = function () {
		return this.procIdx;
	}
	
	this.setRequestHeader = function (key, value) {
		this.obj.setRequestHeader(key, value);
	};
	
	this.call = function (onlySucc) {
		var method = (this.postParam == null ? "GET" : "POST"); 
		var sync = (this.callbackFn == null);
		var rval;

		if (onlySucc == undefined || onlySucc != false) {
			this.onlySucc = true; 
		} else {
			this.onlySucc = false;
		}
		
		//* open 하면 값이 없어 질수 있으므로 초기화는 open 뒤에
		this.obj.open(
			method,
			this.url,
			!sync
			);
		
		this.obj.onreadystatechange = (sync ? function () {} : this.callback__);

		if (method == "POST") {
			this.obj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charaset=UTF-8");
		}

		this.obj.send(this.postParam);
		
		if (sync) {
			if (this.obj.readyState == 4) {
				if (this.obj.status == 200) {
					return true;
				}
			}
			
			return false;
		}
		
		return true;
	};
	
	this.abort = function () {
		this.obj.abort();
	};
	
	this.getResponseText = function () {
		return this.obj.responseText;
	};

	this.getResponseXML = function () {
		return this.obj.responseXML;
	};
	
	this.getResponseHeader = function (header) {
		this.obj.getResponseHeader(header);
	};
	
	this.getAllResponseHeaders = function () {
		return this.obj.getAllResponseHeaders();
	};
}

//----------------------------------------------------------------------
//* 특정 객체에 문자열을 입력
//* 파라미터
//*   obj - 대상객체
//*   str - 쓰여질 문자열
//----------------------------------------------------------------------
function typeIn(obj, str) {
	if (typeof(obj) == 'string') {
		obj = document.all[obj];
	}
	if (obj == null) {
		return false;
	}

	obj.focus();

	var range = document.selection.createRange();
	if (range.parentElement() === obj) {
		range.text = str;
	}	

	obj.focus();

	return }

//----------------------------------------------------------------------
//* window.onload 를 통합 관리하기 위한 class
//* 개별로 사용하지 않고 __loader__ 를 통해 사용한다.
//* 생성자 파라미터
//*   wnfn - 항상 window.onload
//* 메쏘드
//*   appendSysLoader(function); // 공통 loader 에 onload 등록. user loader 보다 먼저 실행됨.
//*   appendUserLoader(function); // user loader 에 onload 등록. <= 각 jsp 내에서는 이것만 사용하도록 합니다.
//----------------------------------------------------------------------
function __Loader(wnfn) {
	this.oldonload = wnfn;
    this.sysLoader = new Array();
    this.userLoader = new Array();
    this.called = false;
    
    //* private
    this.getSysLoader__ = function() {
        return this.sysLoader;
    };
    
    //* private
    this.getUserLoader__ = function() {
        return this.userLoader;
    };
    
    this.appendSysLoader = function(fn) {
    	this.sysLoader[this.sysLoader.length] = fn;
    };
    
    this.appendUserLoader = function(fn) {
    	this.userLoader[this.userLoader.length] = fn;
    };
    
    this.setOldOnload = function (wnFn) {
    	this.oldonload = wnFn;
    };

    //* private
    this.doLoaders__ = function() {
    	if (this.called) return ;
        this.called = true;
        
    	for (var i = 0; i < this.sysLoader.length; i ++) {
    		if (this.sysLoader[i] != null) {
    			this.sysLoader[i]();
    		}
    	}
    	for (var i = 0; i < this.userLoader.length; i ++) {
    		if (this.userLoader[i] != null) {
    			this.userLoader[i]();
    		}
    	}
    	if (this.oldonload != null) {
    		this.oldonload();
    	}
    };
}

//----------------------------------------------------------------------
//*  window.onload 를 통합 관리하기 위한 __Loader 객체
//*  window.onload 를 사용하지 않도록 변경 (3/16)
//----------------------------------------------------------------------
function __init__() {
	__loader__.doLoaders__();
}
/*
var __loader__ = new __Loader(window.onload);
function __newonload__() {
	__init__();
}
window.onload = __newonload__;
*/

var __loader__ = new __Loader(null);
(function (f){//(C)webreflection.blogspot.com
	var a,b=navigator.userAgent,d=document,w=window,
	c="__onContent__",e="addEventListener",o="opera",r="readyState",
	s="<scr".concat("ipt defer src='//:' on",r,"change='if(this.",r,"==\"complete\"){this.parentNode.removeChild(this);",c,"()}'></scr","ipt>");
	w[c]=(function(o){return function(){w[c]=function(){};for(a=arguments.callee;!a.done;a.done=1)f(o?o():o)}})(w[c]);
	if(d[e])d[e]("DOMContentLoaded",w[c],false);
	if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))
	(function(){/loaded|complete/.test(d[r])?w[c]():setTimeout(arguments.callee,1)})();
	else if(/MSIE/i.test(b)){
		document.onreadystatechange =
			function () {
				if (document.readyState == 'complete') {
					document.onreadystatechange = null;
					w[c]();
				}
			};
	}//d.write(s);
	})(function () {__init__()});

//* IE8 버튼 클릭후 submit 되는 현상 수정
__loader__.appendSysLoader(
	function () {
		try {
			var flen = document.forms.length;
			for (var f = 0; f < flen; f++) {
				var elen = document.forms[f].length;
				for (var i = 0; i < elen; i++) {
					if (document.forms[f][i].tagName.toLowerCase() == "button") {
						document.forms[f][i].__old_onclick_by_sys_loader__ = document.forms[f][i].onclick;
						document.forms[f][i].onclick = 
							function () {
								if (this.__old_onclick_by_sys_loader__ != null) {
									this.__old_onclick_by_sys_loader__();
								}
								event.returnValue = false;
							};
					}
				}
			}
		} catch (e) {}
	}
	);

function getElementByIdName(target, idName) {
	var obj = null;
	if (target.getElementById) {
		obj = target.getElementById(idName);
	}
	if (obj == null) {
		if (target.getElementByName) {
			obj = target.getElementByName(idName);
		}
		if (obj != null) {
			obj = obj[0];
		}
		if (obj == null) {
			if (target.all) {
				obj = target.all[idName];
			}
		}
	}
	return obj;
}

/**  
 ** EX) 폼에 아래 두개 폼필드를 삽입. [인풋필드, 온클릭함수.]
 ** <input name="occHpeDt" id="occHpeDt" type="text" value="2009-01-01" readonly  />
 ** onclick="drawCalendarPop('change_date', 'occHpeDt');"
 ** <img src="<c:url value='/images/gsbc/bicon_18.gif'/>" class="btnMargin" align="absmiddle" border="0" >달력</button>
 **
 **  args 설명..
 **  methodName  : 'change_date' 달력jsp에서 내부적으로 재귀호출될함수명. 
 **  vId         : '달력에서 선택한  날짜를  리턴 받을 JSP Form field 객체 ID명 or Name 명'
 **/
function drawCalendarPop(methodName , vId) {
	var obj = getElementByIdName(document, vId);
	if (obj == null) {
		return ;
	}
	
	var vYYmm = obj.value;
//	var goUrl = "/GETCALENDARPOPUP.do?methodName="+methodName+"&vFormId="+vId+"&vDate="+vYYmm;
//	var attributes = 'status=no,resizable=no,scrollbars=no,left=250,top=150,width=520px,height=400px';
//	var myPopup = window.open(goUrl, "newWin", attributes);
 
	var url = "/GETCALENDARPOPUP.do";
	var t = "newWin";
	
	frm = "frmDrawCalendarPop";
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['methodName'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"methodName\"/>"));
	}
	frm.elements['methodName'].value = methodName;

	if (frm.elements['vFormId'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"vFormId\"/>"));
	}
	frm.elements['vFormId'].value = vId;

	if (frm.elements['vDate'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"vDate\"/>"));
	}
	frm.elements['vDate'].value = vYYmm;
	
	with(frm){
		openPopup("", t, 520, 400, "no");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//* 오른쪽 마우스 금지
//----------------------------------------------------------------------
/*
var message="";

function clickIE() {
　if (document.all) {
　　(message);return false;
　}
}

function clickNS(e) {
　if(document.layers||(document.getElementById&&!document.all)) {
　　if (e.which==2||e.which==3) {
　　　(message);return false;
　　}
　}
}

if (document.layers) {
　document.captureEvents(Event.MOUSEDOWN);
　document.onmousedown=clickNS;
}
else{
　document.onmouseup=clickNS;
　document.oncontextmenu=clickIE;
}
document.oncontextmenu=new Function("return false")
*/

//----------------------------------------------------------------------
//* 화면 인쇄
//----------------------------------------------------------------------
var printForHtmlContent;
var tempPrintId;
var __printheader = ""; 
var __printtailer = "";

function printDiv (printArea, targetWindow, header, tailer) {
	var focusing = true;
	if (typeof(targetWindow) == 'undefined' || targetWindow == null) {
		targetWindow = window;
		focusing = false;
	}
	
	__printheader = (typeof(header) != 'undefined' && header != null) ? header : "<table border=0 align=center><tr><td>";
	__printtailer = (typeof(tailer) != 'undefined' && tailer != null) ? tailer : "</td></tr></table>";
	
	if (document.all && window.print) {
		tempPrintId = printArea;
		targetWindow.onbeforeprint = beforeDivs;
		targetWindow.onafterprint = afterDivs;
		if (focusing) {
			targetWindow.focus();
		}
		targetWindow.print();
	}
}

function beforeDivs () {
	if (document.all) {
		var rng = document.body.createTextRange( );
		if (rng!=null) {
			//alert(rng.htmlText);
			printForHtmlContent = rng.htmlText;
			rng.pasteHTML(__printheader + eval("document.all['" + tempPrintId + "']").innerHTML + __printtailer);
		}
	}
}

function afterDivs () {
	if (document.all) {
		var rng = document.body.createTextRange( );
		if (rng!=null) {
			rng.pasteHTML(printForHtmlContent);
		}
	}
}

//----------------------------------------------------------------------
//* 스크롤에 따라 움직이는 개체 생성  class
//* 생성자 파라미터
//*   적용할개체 - 보통 DIV 태그, 문자열일 경우 document.all 로 가져온다. 
//*   스크롤시 X축여백 - 양수일 경우 왼쪽, 음수일 경우 우측에 붙인다. 
//*   최좌측시 X축여백 - 항상 양수로 쓰며, 이 값 이하로는 스크롤에 영향 받지 않는다. 이 값이 스크롤시X출여백과 같으면 X좌표가 고정된다.
//*   스크롤시 Y축여백 - 상동
//*   최상단시 Y축여백 - 상동
//*   미끄러지는속도:작을수록빠름..기본5
//*   빠르기:작을수록부드러움..기본50 (msec)
//* 메쏘드
//*   setProperties(MarginX , LeftLimit , MarginY , TopLimit , Step , Delay); // 생성시 입력한 값 바꿀 때 사용. null 입력시 해당항목은 변경 안 됨.
//*   Run() <= 직접 실행하지 말 것 !!!
//----------------------------------------------------------------------
function Floating ( FloatingObj , MarginX , LeftLimit , MarginY , TopLimit , Step , Delay ) {
	this.FloatingObj = FloatingObj;
	if (typeof(this.FloatingObj) == 'string') {
		this.FloatingObj = document.all[this.FloatingObj];
	}
	
	this.FloatingObj.floatingObj = this;
	
	this.MarginX = (MarginX) ? MarginX : 0;
	this.LeftLimit = (LeftLimit) ? LeftLimit : 0;
	this.MarginY = (MarginY) ? MarginY : 0;
	this.TopLimit = (TopLimit) ? TopLimit : 0;
	this.Step = (Step) ? Step : 5;
	this.Delay = (Delay) ? Delay : 50;
	this.FloatingObj.style.position = "absolute";
	this.Body = null;
	this.setTimeOut = null;

	this.setProperties = function (MarginX , LeftLimit , MarginY , TopLimit , Step , Delay) {
		if (MarginX != null) this.MarginX = MarginX;
		if (LeftLimit != null) this.LeftLimit = LeftLimit;
		if (MarginY != null) this.MarginY = MarginY;
		if (TopLimit != null) this.TopLimit = TopLimit;
		if (Step != null) this.Step = Step;
		if (Delay != null) this.Delay = Delay;
	};

	this.Run();
}

Floating.prototype.Run = function () {
	this.Body = document.documentElement.scrollTop > document.body.scrollTop ? document.documentElement : document.body;
	var This = this;
	var FloatingObjLeft = (this.FloatingObj.style.left) ? parseInt(this.FloatingObj.style.left,10) : this.FloatingObj.offsetLeft;
	var FloatingObjTop = (this.FloatingObj.style.top) ? parseInt(this.FloatingObj.style.top,10) : this.FloatingObj.offsetTop;
	var FloatingObjWidth = (this.FloatingObj.style.width) ? parseInt(this.FloatingObj.style.width,10) : this.FloatingObj.offsetWidth;
	var FloatingObjHeight = (this.FloatingObj.style.height) ? parseInt(this.FloatingObj.style.height,10) : this.FloatingObj.offsetHeight;
	
	var clientWidth = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
	var clientHeight = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
	var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
	var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
	var scrollHeight = Math.max(clientHeight, document.body.scrollHeight);
	var scrollWidth = Math.max(clientWidth, document.body.scrollWidth);
//alert("FloatingObjTop:"+FloatingObjTop+",FloatingObjHeight:"+FloatingObjHeight+",clientHeight:"+clientHeight+",scrollTop:"+scrollTop+",document.documentElement.clientHeight:,"+document.documentElement.clientHeight+",document.body.clientHeight:"+document.body.clientHeight+"")
	if (this.MarginX >= 0) {
		if (this.MarginX == this.LeftLimit) {
			this.FloatingObj.style.left = this.MarginX + "px" ;
		} else {
			var DocLeft = scrollLeft + this.MarginX;
			var MoveX = Math.abs(FloatingObjLeft - DocLeft);
	
			if ( DocLeft > this.LeftLimit ) {
				if ( FloatingObjLeft < DocLeft ) {
					this.FloatingObj.style.left = FloatingObjLeft + Math.ceil( MoveX/this.Step ) + "px" ;
				} else {
					this.FloatingObj.style.left = DocLeft + "px" ;
				}
			} else {
					this.FloatingObj.style.left = this.LeftLimit + "px" ;
			}
		}
	} else {
		var DocLeft = scrollLeft + clientWidth - FloatingObjWidth + this.MarginX;
		var MoveX = Math.abs(FloatingObjLeft - DocLeft);

		if (scrollWidth - (DocLeft + FloatingObjWidth) > this.LeftLimit ) {
			if ( FloatingObjLeft < DocLeft ) {
				this.FloatingObj.style.left = FloatingObjLeft + Math.ceil( MoveX/this.Step ) + "px" ;
			} else {
				this.FloatingObj.style.left = DocLeft + "px" ;
			}
		} else {
				this.FloatingObj.style.left = (scrollWidth - FloatingObjWidth - this.LeftLimit) + "px" ;
		}
	}
	
	if (this.MarginY >= 0) {
		if (this.MarginY == this.TopLimit) {
			this.FloatingObj.style.top = this.MarginY + "px" ;
		} else {
			var DocTop = scrollTop + this.MarginY;
			var MoveY = Math.abs(FloatingObjTop - DocTop);
	
			if ( DocTop > this.TopLimit ) {
				if ( FloatingObjTop < DocTop ) {
					this.FloatingObj.style.top = FloatingObjTop + Math.ceil( MoveY/this.Step ) + "px" ;
				} else {
					this.FloatingObj.style.top = DocTop + "px" ;
				}
			} else {
					this.FloatingObj.style.top = this.TopLimit + "px" ;
			}
		}
	} else {
		var DocTop = scrollTop + clientHeight - FloatingObjHeight + this.MarginY;
		var MoveY = Math.abs(FloatingObjTop - DocTop);
		
		if (scrollHeight - (DocTop + FloatingObjHeight) > this.TopLimit ) {
			if ( FloatingObjTop < DocTop ) {
				this.FloatingObj.style.top = FloatingObjTop + Math.ceil( MoveY/this.Step ) + "px" ;
			} else {
				this.FloatingObj.style.top = DocTop + "px" ;
			}
		} else {
				this.FloatingObj.style.top = (scrollHeight - FloatingObjHeight - this.TopLimit) + "px" ;
		}
	}
	/* 레이어 위치 표시 (삭제해도 무방)
	document.getElementById('rTop').innerHTML = 'FloatingObjTop:'+FloatingObjTop+'<br />DocTop:'+DocTop +'<br />MoveY:'+MoveY ;
	*/
	window.clearTimeout(this.setTimeOut);
	this.setTimeOut = window.setTimeout(
		function () {
			This.Run();
		},
		this.Delay
	);
}

//----------------------------------------------------------------------
//* 배너 스크롤  class
//* 속성
//*   type : 스크롤 방향 구분(1:수직 스크롤, 2:수평 스크롤)
//*   leftRightDirection : 수평 스크롤 방향 구분(1:왼쪽, 2:오른쪽)
//*   pausemouseover : 마우스 포인터 over 시 스크롤 정지 여부(true:정지, false:정지 안함)
//*   layerwidth : 스크롤내용이 보여지는 영역 가로 사이즈
//* 사용법
//* var bannerScroll_1 = new BannerScroll(); 
//* bannerScroll_1.name = "bs_1"; 
//* bannerScroll_1.type = 2; 
//* bannerScroll_1.pausemouseover = true; 
//* bannerScroll_1.add("배너1");
//* bannerScroll_1.add("배너2");
//* bannerScroll_1.add("배너3");
//* bannerScroll_1.start();
//----------------------------------------------------------------------
function BannerScroll() {
	this.version = "0.1";
	this.name = "bannerScroll";
	this.item = new Array();
	this.itemcount = 0;
	this.currentspeed = 0;
	this.scrollspeed = 20;
	this.pausedelay = 1000;
	this.pausemouseover = false;
	this.stop = false;
	this.type = 2;
	this.leftRightDirection = 1;
	this.layerwidth = 100;
	this.height = 100;
	this.width = 100;
	this.stopHeight = 0;

	this.add = function() {
		var text = arguments[0];
		this.item[this.itemcount] = text;
		this.itemcount = this.itemcount + 1;
	};

	this.start = function() {
	    this.display();
	    this.currentspeed = this.scrollspeed;
	    setTimeout(this.name+'.scroll()',this.currentspeed);
	};

	this.display = function() {
	    document.write('<div id="'+this.name+'" style="height:'+this.height+'px; width:'+this.layerwidth+'px; position:relative;overflow:hidden;z-index:1" onmouseover="'+this.name+'.mouseover();" onmouseout="'+this.name+'.mouseout();">');
	
	    for (var i = 0; i < this.itemcount; i++) {
			if ( this.type == 1) {
			    document.write('<div id="'+this.name+'item'+i+'" style="left:0px; width:'+this.width+'px; position:absolute;top:'+(this.height*i+1)+'px;">');
			    document.write(this.item[i]);
			    document.write('</div>');
			} else if ( this.type == 2 ) {
			    document.write('<div id="'+this.name+'item'+i+'" style="left:'+(this.width*i+1)+'px; width:'+this.width+'px; position:absolute; top:0px;">');
			    document.write(this.item[i]);
			    document.write('</div>');
			}
	    }
	 
	    document.write('</div>');
	};

	this.scroll = function()
	{
		this.currentspeed = this.scrollspeed;
	 
		if( !this.stop ) {
			for (i = 0; i < this.itemcount; i++) {
			    obj = document.getElementById(this.name+'item'+i).style;
	                
	            if( this.type == 1 ) {
	            	obj.top = parseInt(obj.top) - 2;
	                     
					if( parseInt(obj.top) <= this.height*(-1) ) {
						obj.top = this.height * (this.itemcount-1);
						this.currentspeed = this.pausedelay;
					}
	                     
	                //if ( parseInt(obj.top) == 0 || ( this.stopHeight > 0 && this.stopHeight - parseInt(obj.top) == 0 ) )
				} else if ( this.type == 2 ) {
					if (this.leftRightDirection == 1) {
						obj.left = parseInt(obj.left) - 1;

						if ( parseInt(obj.left) <= this.width*(-1) )
						{
						    obj.left = parseInt(obj.left) + (this.width * (this.itemcount));
						    this.currentspeed = this.pausedelay;
						}
					} else {
						obj.left = parseInt(obj.left) + 1;

						if ( parseInt(obj.left) >= this.layerwidth )
						{
						    obj.left = parseInt(obj.left) - (this.width * (this.itemcount));
						    this.currentspeed = this.pausedelay;
						}
					}
				}
			}
		}
	     
		window.setTimeout(this.name+".scroll()",this.currentspeed);
	};
     
	this.mouseover = function() {
		if ( this.pausemouseover )
		{
			this.stop = true;
	    }
	};
     
	this.mouseout = function ()
	{
		if ( this.pausemouseover )
		{
			this.stop = false;
		}
	};
}

function SelectItem(value, text) {
	this.text = text;
	this.value = value;
	this.text = text;
	this.getValue = function () {
		return this.value;
	};
	this.getText = function () {
		return this.text;
	};
}

//----------------------------------------------------------------------
//기관소속 사이트 리스트 (ajax)
// @param obj - 대상 site 콤보
// @param insttId - 기관 아이디
// @param defVal - 디폴트 항목의 값
// @param defTxt - 디폴트 항목의 내용
// @param hlist - 디폴트 항목과 ajax로 가져온 항목 사이에 추가할 항목의 리스트. (SelectItm 의 Array 이어야 함.)
//----------------------------------------------------------------------
function setSiteList(obj, insttId, defVal, defTxt, hlist) {
	if (typeof(obj) == 'string') {
		obj = document.all[obj];
	}
	
	var ac1 = new AjaxCall("/COMSI1300J.ajax?insttId="+insttId+""/*url*/, ""/*postParam*/, null); 
	if (ac1.call()) {
		var sites = (ac1.getResponseText() + "//R~").split("//R~");
		var sitePart;
		var lenList;
		var ele;

		var lenOption = obj.length;

		var setSiteList_lastVal = obj.value;

		try {
			for (var i = lenOption - 1; i >= 0; i --) {
				obj.remove(0);
			}
		} catch (e) {}
			
		if (defTxt != '') {
			ele = document.createElement("option");
			ele.value = defVal;
			ele.text = defTxt;
			try {
				obj.add(ele, null);
			} catch (e) {
				obj.add(ele, -1);
			}
		}

		if (hlist != null) {
			lenList = hlist.length;
			for (var i = 0; i < lenList; i ++) {
				ele = document.createElement("option");
				ele.value = hlist[i].getValue();
				ele.text = hlist[i].getText();
				try {
					obj.add(ele, null);
				} catch (e) {
					obj.add(ele, -1);
				}
			}
		}
		
		lenList = sites.length;
		for (var i = 0; i < lenList; i ++) {
			if (sites[i] == '') {
				continue;
			}
			sitePart = (sites[i] + "//F~").split("//F~");
			if (sitePart[0] == '' || sitePart[1] == '') {
				continue;
			}

			ele = document.createElement("option");
			ele.value = sitePart[0];
			ele.text = sitePart[1];
			try {
				obj.add(ele, null);
			} catch (e) {
				obj.add(ele, -1);
			}
		}

		setSelect(obj, setSiteList_lastVal, "");
	}
}

function getSiteMainUrl(siteId) {
	if (siteId == null || siteId == '') {
    	return '';
	}
	var ac1 = new AjaxCall("/COMSI1400J.ajax?siteId="+siteId+""/*url*/, ""/*postParam*/, null); 
	if (ac1.call()) {
		var fields = (ac1.getResponseText() + '//F~').split('//F~');
		// 0 - siteId
		// 1 - siteNm
		// 2 - mainSiteUrl
		if (fields.length < 3) return '';
		return fields[2];
	}
	return '';
}

/* 배포 페이지 TOP에 포함될 함수(페이지에 스크롤을 없앤다) */
function resizeIntegratedFrame(height, iframeName) {
	var iframe = document.getElementById(iframeName == undefined ? 'distributionIframe' : iframeName);
	if (iframe != null) {
		iframe.setAttribute('height', height);
	}
}

/* 배포 페이지 TOP에 포함될 함수 */
function refreshTop(mbrNm) {
	// 로그인과 회원가입 버튼을 로그아웃과 회원정보수정 버튼으로 수정한다.
	var getObj = document.getElementById("loginTopDiv");
	
	if (getObj != null) {
		var htmlStr = "";
		htmlStr += "<a href=\"http://" + DOMAIN_BIZ114 + "/MBRLG0300N.do?siteId=SITE0000000010\" onfocus=\"imgChg(this);return false;\" onblur=\"this.onfocus();\" onmouseover=\"this.onfocus();\" onmouseout=\"this.onfocus();\" title=\"로그아웃\"><img src=\"/images/gsbc/main/spot_logout_off.gif\" alt=\"로그아웃\" width=\"33\" height=\"10\" class=\"btn\"/></a>";		
		htmlStr += "<img src=\"/images/gsbc/main/spot_line.gif\" alt=\"\" width=\"11\" height=\"10\" class=\"btn\"/>";
		htmlStr += "<a href=\"/GENSG2700N.do?mmnu_id=MBRSG2700N.do\" onfocus=\"imgChg(this);return false;\" onblur=\"this.onfocus();\" onmouseover=\"this.onfocus();\" onmouseout=\"this.onfocus();\" title=\"회원정보수정\"><img src=\"/images/gsbc/main/spot_membModify_off.gif\" alt=\"회원정보수정\" width=\"47\" height=\"10\" class=\"btn\"/></a>";
		getObj.innerHTML = htmlStr;
	}
}

/* 배포 페이지를 호출하는 함수 */
function callRefreshTop(mbrNm) {
	if (window.parent != null && typeof(__referer__) == 'string' && __referer__.indexOf('/') != -1) {
		var frameName = 'hiddenFrameForLoginTopDiv';
		var frame = document.getElementById(frameName);
		if (frame == null) {
			frame = document.createElement("<iframe id=\"" + frameName + "\" name=\""+frameName+"\" src=\"\" width=0 height=0/>");
			if (frame != null) {
				document.appendChild(frame);
			}
		}
		if (frame != null) {
			frame.src = __url_refresh_top__ + '&mbrNm=' + mbrNm;
		}
	}
}

/* 배포 페이지를 호출하는 함수 */
var callResizeMeTargetFrame = 'distributionIframe'; //* 각 페이지에서 바꿔 쓸 수 있음
var callResizeMeExactSize = false;
function callResizeMe() {
	if (window.parent != null && typeof(__referer__) == 'string' && __referer__.indexOf('/') != -1) {
		var frameName = 'hiddenframeforresizing';
		var frame = document.getElementById(frameName);
		if (frame == null) {
//			frame = document.createElement("<iframe id=\"" + frameName + "\" name=\""+frameName+"\" src=\"\" width=0 height=0/>");
			frame = document.createElement("IFRAME");
			if (frame != null) {
				frame.id = frameName;
				frame.name = frameName;
				frame.src = "";
				frame.width = 0;
				frame.height = 0;
				document.body.appendChild(frame);
			}
		}
		if (frame != null) {
			frame.src = __url_for_resizing__ + '&height=' + (Math.max(document.body.offsetHeight, document.body.scrollHeight) + (callResizeMeExactSize ? 0 : 40)) + '&frameName=' + callResizeMeTargetFrame + '';
		}
	}
}

/* 배포 페이지를 호출하는 함수 */
__loader__.appendUserLoader(
	function () {
		try {
			callResizeMe();
		} catch (e) {}
	}
	);

function BarGraphEle__(line, name, value, bgcolor, showName) {
	this.line = line;
	this.name = name;
	this.value = value;
	this.bgcolor = bgcolor;
	this.showName = showName;
	this.getLine = function () {
		return this.line;
	};
	this.getName = function () {
		return this.name;
	};
	this.getValue = function () {
		return this.value;
	};
	this.getBgcolor = function () {
		return this.bgcolor;
	};
	this.getShowName = function () {
		return this.showName;
	};
}

//----------------------------------------------------------------------
//* 수정일자 : 2011-08-25
//* 수정자명 : DBVISION
//*
//* 막대그래프 생성을 위한 class
//*
//* 생성자 파라미터
//*   없음
//* 메쏘드
//*   addEle(line, name, value, bgcolor, showName); // 항목을 생성
//*     line - 표시위치
//*     name - 범례 표시 명칭
//*     value - 값 (100 기준으로 맞춰줄 필요 없음 )
//*     bgcolor - 그래프 색상
//*     showName - 범례 표시여부
//*   drawGraph(divName, barWidth, barHeight, curr); // 그래프를 그린다.
//*     divName - 그래프가 들어갈 div 명. div 의 뒷 부분에 추가된다.
//*     barWidth - 넚이
//*     barHeight - 높이
//*     curr - 돈을 넘겨준다
//* 예제
//*     var bg = new BarGraph();
//*     bg.addEle(0, "test1", 1000, "#8e8e8a", true);
//*     bg.addEle(0, "test2", 100, "#aeaeaa", true);
//*     bg.addEle(0, "test3", 500, "#cececa", true);
//*     bg.addEle(1, "test4", 1000, "", true);
//*     bg.addEle(1, "test5", 100, "", true);
//*     bg.drawGraph("testDiv", 500, 30, 1000);
//----------------------------------------------------------------------
function BarGraph() {
	this.gele = new Array();
	this.addEle = function (line, name, value, bgcolor, showName) {
		this.gele[this.gele.length] = new BarGraphEle__(line, name, parseInt("0"+value,10), bgcolor, showName);
	};
	this.drawGraph = function(divName, barWidth, barHeight, curr) {
		var tableName = divName+"_table";
		var tableName2 = divName+"_table2";
		var divele = document.all[divName];
		var tblele = document.all[tableName];
		var tblele2 = document.all[tableName2];
		if (divele == null) {
			return ;
		}
		if (tblele != null) {
			tblele.removeNode(true);
		}
		if (tblele2 != null) {
			tblele2.removeNode(true);
		}
		var ditms = 0;
		var line = 0;
		var tmparr = new Array();
		var lineTotalValue;
		var ot = null;
		var or = null;
		var od = null;
		var oi = null;
		var graph_cell = null;
		var text_cell = null;
		var itemsWidth;
		var itemWidth;		
		while (ditms != this.gele.length) {
			tmparr.length = 0;
			lineTotalValue = 0;
			for (var i = 0; i < this.gele.length; i ++) {
				if (this.gele[i].getLine() != line) {
					continue;
				}
				ditms ++;
				tmparr[tmparr.length] = this.gele[i];
				lineTotalValue += this.gele[i].getValue();
			}
			if (tmparr.length != 0) {
				if (ot == null) {
					ot = document.createElement("<TABLE width=\"747\" id=\""+tableName+"\" class=\"TblTypeNone\">");
					divele.appendChild(ot);
				} else {
					or = ot.insertRow(-1);
					or.height = 3;
				}
				if (ot == null) {
					return ;
				}
				or = ot.insertRow(-1);
				od = document.createElement("TR");				
				od.style.whiteSpace = 'nowrap';
				od.style.height = barHeight + 'px';
				od.style.textAlign = 'right';
				
				/* 지역 및 금액 표시될 셀 속성 */				
				text_cell = or.insertCell();
				text_cell.style.whiteSpace = 'nowrap';
				text_cell.style.height = barHeight + 'px';
				text_cell.style.width = '20%';
				text_cell.style.textAlign = 'left';				
				
				/* 그래프가 표시될 셀 속성 */
				graph_cell = or.insertCell();   
				graph_cell.style.whiteSpace = 'nowrap';
				graph_cell.style.height = barHeight + 'px';
				graph_cell.style.width = '80%';
				graph_cell.style.textAlign = 'left';
				
				
				or.appendChild(od);
				itemsWidth = 0;
				for (var i = 0; i < tmparr.length; i ++) {		
					/* var text = (tmparr[i].getName()).substring(0, 4);
					if(text.equals("사용금액") || text.equals("사용예정") || text.equals("신청가능")){
					//if(line.equals("40")){
						BarGraph2();
					}else{ */
					itemWidth = (lineTotalValue / curr)*99; //그래프 길이.. 현재 98%퍼센트로 마춰져 있음..
					graph = document.createElement("<IMG align=\"left\" src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:"+barHeight+"px; width:"+itemWidth+"% \">");							
					text = document.createElement("<IMG  src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:10px; width:10px\">");
					graph_cell.appendChild(graph);					
					text_cell.appendChild(text);
					text_cell.appendChild(document.createTextNode(" " + tmparr[i].getName() + "  " ));				
					itemsWidth += itemWidth;
				}
			}
			line ++;
		}
	};
}


function BarGraph2() {
	this.gele = new Array();
	this.addEle = function (line, name, value, bgcolor, showName) {
		this.gele[this.gele.length] = new BarGraphEle__(line, name, parseInt("0"+value,10), bgcolor, showName);
	};
	this.drawGraph = function(divName, barWidth, barHeight) {
		var tableName = divName+"_table";
		var tableName2 = divName+"_table2";
		var divele = document.all[divName];
		var tblele = document.all[tableName];
		var tblele2 = document.all[tableName2];
		if (divele == null) {
			return ;
		}
		if (tblele != null) {
			tblele.removeNode(true);
		}
		if (tblele2 != null) {
			tblele2.removeNode(true);
		}
		var ditms = 0;
		var line = 0;
		var tmparr = new Array();
		var lineTotalValue;
		var ot = null;
		var or = null;
		var od = null;
		var oi = null;
		var itemsWidth;
		var itemWidth;
		while (ditms != this.gele.length) {
			tmparr.length = 0;
			lineTotalValue = 0;
			for (var i = 0; i < this.gele.length; i ++) {
				if (this.gele[i].getLine() != line) {
					continue;
				}
				ditms ++;
				tmparr[tmparr.length] = this.gele[i];
				lineTotalValue += this.gele[i].getValue();
			}
			if (tmparr.length != 0) {
				if (ot == null) {
					ot = document.createElement("<TABLE id=\""+tableName+"\" class=\"TblTypeNone\">");
					divele.appendChild(ot);
				} else {
					or = ot.insertRow(-1);
					or.height = 3;
				}
				if (ot == null) {
					return ;
				}
				or = ot.insertRow(-1);
				od = document.createElement("TD");
				od.style.whiteSpace = 'nowrap';
				od.style.height = barHeight + 'px';				
				or.appendChild(od);
				itemsWidth = 0;
				for (var i = 0; i < tmparr.length; i ++) {
					itemWidth = lineTotalValue == 0 ? 0 : (barWidth * tmparr[i].getValue()) / lineTotalValue;
					if (lineTotalValue == 0) {
						oi = document.createElement("<IMG src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:#000000;height:"+barHeight+"px; width:"+((i + 1) == tmparr.length ? (barWidth - itemsWidth) : itemWidth)+"px\">");
					} else {
						oi = document.createElement("<IMG src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:"+barHeight+"px; width:"+((i + 1) == tmparr.length ? (barWidth - itemsWidth) : itemWidth)+"px\">");
					}
					itemsWidth += itemWidth;
					od.appendChild(oi);
				}
			}
			line ++;
		}

		ot = null;
		ditms = 0;
		line = 0;
		while (ditms != this.gele.length) {
			tmparr.length = 0;
			for (var i = 0; i < this.gele.length; i ++) {
				if (this.gele[i].getLine() != line) {
					continue;
				}
				ditms ++;
				if (this.gele[i].getShowName() == false) {
					continue;
				}
				tmparr[tmparr.length] = this.gele[i];
			}
			if (tmparr.length != 0) {
				if (ot == null) {
					ot = document.createElement("<TABLE id=\""+tableName2+"\" class=\"TblTypeNone\">");
					divele.appendChild(ot);
					or = ot.insertRow(-1);
					or.height = 5;
				} else {
					or = ot.insertRow(-1);
					or.height = 3;
				}
				if (ot == null) {
					return ;
				}
				or = ot.insertRow(-1);
				od = document.createElement("<TD valign=\"absmiddle\">");
				od.style.height = barHeight + 'px';
				or.appendChild(od);
				for (var i = 0; i < tmparr.length; i ++) {					
					oi = document.createElement("<IMG src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:10px; width:10px\">");
					od.appendChild(oi);
					od.appendChild(document.createTextNode(" " + tmparr[i].getName() + "  " ));
				}
			}
			line ++;
		}
	};
}
function BarGraph3() {
	this.gele = new Array();
	this.addEle = function (line, name, value, bgcolor, showName) {
		this.gele[this.gele.length] = new BarGraphEle__(line, name, parseInt("0"+value,10), bgcolor, showName);
	};
	this.drawGraph = function(divName, barWidth, barHeight, curr) {
		var tableName = divName+"_table";
		var tableName2 = divName+"_table2";
		var divele = document.all[divName];
		var tblele = document.all[tableName];
		var tblele2 = document.all[tableName2];
		if (divele == null) {
			return ;
		}
		if (tblele != null) {
			tblele.removeNode(true);
		}
		if (tblele2 != null) {
			tblele2.removeNode(true);
		}
		var ditms = 0;
		var line = 0;
		var tmparr = new Array();
		var lineTotalValue;
		var ot = null;
		var or = null;
		var od = null;
		var oi = null;
		var graph_cell = null;
		var text_cell = null;
		var itemsWidth;
		var itemWidth;		
		while (ditms != this.gele.length) {
			tmparr.length = 0;
			lineTotalValue = 0;
			for (var i = 0; i < this.gele.length; i ++) {
				if (this.gele[i].getLine() != line) {
					continue;
				}
				ditms ++;
				tmparr[tmparr.length] = this.gele[i];
				lineTotalValue += this.gele[i].getValue();
			}
			if (tmparr.length != 0) {
				if (ot == null) {
					ot = document.createElement("<TABLE width=\"747\" id=\""+tableName+"\" class=\"TblTypeNone\">");
					divele.appendChild(ot);
				} else {
					or = ot.insertRow(-1);
					or.height = 3;
				}
				if (ot == null) {
					return ;
				}
				or = ot.insertRow(-1);
				od = document.createElement("TR");				
				od.style.whiteSpace = 'nowrap';
				od.style.height = barHeight + 'px';
				od.style.textAlign = 'right';								
				
				/* 그래프가 표시될 셀 속성 */
				graph_cell = or.insertCell();   
				graph_cell.style.whiteSpace = 'nowrap';
				graph_cell.style.height = barHeight + 'px';
				graph_cell.style.width = '100%';
				graph_cell.style.textAlign = 'left';
				
				
				or.appendChild(od);
				itemsWidth = 0;
				for (var i = 0; i < tmparr.length; i ++) {
					itemWidth = (lineTotalValue / curr)*30; //그래프 길이.. 현재 98%퍼센트로 마춰져 있음..
					graph = document.createElement("<IMG align=\"left\" src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:"+barHeight+"px; width:"+itemWidth+"% \">");						
					
					graph_cell.appendChild(graph);														
					itemsWidth += itemWidth;
				}
			}
			line ++;
		}
	};
}
/* 원본소스 */
/* function BarGraph() {
		this.gele = new Array();
		this.addEle = function (line, name, value, bgcolor, showName) {
			this.gele[this.gele.length] = new BarGraphEle__(line, name, parseInt("0"+value,10), bgcolor, showName);
		};
		this.drawGraph = function(divName, barWidth, barHeight) {
			var tableName = divName+"_table";
			var tableName2 = divName+"_table2";
			var divele = document.all[divName];
			var tblele = document.all[tableName];
			var tblele2 = document.all[tableName2];
			if (divele == null) {
				return ;
			}
			if (tblele != null) {
				tblele.removeNode(true);
			}
			if (tblele2 != null) {
				tblele2.removeNode(true);
			}
			var ditms = 0;
			var line = 0;
			var tmparr = new Array();
			var lineTotalValue;
			var ot = null;
			var or = null;
			var od = null;
			var oi = null;
			var itemsWidth;
			var itemWidth;
			while (ditms != this.gele.length) {
				tmparr.length = 0;
				lineTotalValue = 0;
				for (var i = 0; i < this.gele.length; i ++) {
					if (this.gele[i].getLine() != line) {
						continue;
					}
					ditms ++;
					tmparr[tmparr.length] = this.gele[i];
					lineTotalValue += this.gele[i].getValue();
				}
				if (tmparr.length != 0) {
					if (ot == null) {
						ot = document.createElement("<TABLE id=\""+tableName+"\" class=\"TblTypeNone\">");
						divele.appendChild(ot);
					} else {
						or = ot.insertRow(-1);
						or.height = 3;
					}
					if (ot == null) {
						return ;
					}
					or = ot.insertRow(-1);
					od = document.createElement("TD");
					od.style.whiteSpace = 'nowrap';
					od.style.height = barHeight + 'px';				
					or.appendChild(od);
					itemsWidth = 0;
					for (var i = 0; i < tmparr.length; i ++) {
						itemWidth = lineTotalValue == 0 ? 0 : (barWidth * tmparr[i].getValue()) / lineTotalValue;
						if (lineTotalValue == 0) {
							oi = document.createElement("<IMG src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:#000000;height:"+barHeight+"px; width:"+((i + 1) == tmparr.length ? (barWidth - itemsWidth) : itemWidth)+"px\">");
						} else {
							oi = document.createElement("<IMG src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:"+barHeight+"px; width:"+((i + 1) == tmparr.length ? (barWidth - itemsWidth) : itemWidth)+"px\">");
						}
						itemsWidth += itemWidth;
						od.appendChild(oi);
					}
				}
				line ++;
			}

			ot = null;
			ditms = 0;
			line = 0;
			while (ditms != this.gele.length) {
				tmparr.length = 0;
				for (var i = 0; i < this.gele.length; i ++) {
					if (this.gele[i].getLine() != line) {
						continue;
					}
					ditms ++;
					if (this.gele[i].getShowName() == false) {
						continue;
					}
					tmparr[tmparr.length] = this.gele[i];
				}
				if (tmparr.length != 0) {
					if (ot == null) {
						ot = document.createElement("<TABLE id=\""+tableName2+"\" class=\"TblTypeNone\">");
						divele.appendChild(ot);
						or = ot.insertRow(-1);
						or.height = 5;
					} else {
						or = ot.insertRow(-1);
						or.height = 3;
					}
					if (ot == null) {
						return ;
					}
					or = ot.insertRow(-1);
					od = document.createElement("<TD valign=\"absmiddle\">");
					od.style.height = barHeight + 'px';
					or.appendChild(od);
					for (var i = 0; i < tmparr.length; i ++) {
						oi = document.createElement("<IMG src=\"/images/gsbc/img_clarity.gif\" border=\"0\" style=\"padding:0px;margin:0px;border:0px;background:"+tmparr[i].getBgcolor()+";height:10px; width:10px\">");
						od.appendChild(oi);
						od.appendChild(document.createTextNode(" " + tmparr[i].getName() + "  " ));
					}
				}
				line ++;
			}
		};
	} */

//----------------------------------------------------------------------
//날짜텍스트에 날짜를 더함.
//	@param cur - 날짜(yyyyMMdd). 구분자가 있어도 숫자만 취함.
//	@param add - 더할 날짜.
//	@param sep_ - 구분자. 날짜를 더한후 다시 텍스트로 만들기 위해 사용
//	@return 변경된 날짜텍스트
//ex) addDate('2010/02/28', 2, '-') => '2010-03-02'
//----------------------------------------------------------------------
function addDate(cur,add,sep_) {
	var v;
	var sep='';
	v=cur.replace(/[^0-9]/g,'');
	if (typeof(sep_)!='undefined') sep=sep_;
	if (v.length!=8) v=cur;
	else {
		var d=new Date(parseInt(v.substr(0,4),10),parseInt(v.substr(4,2),10)-1,parseInt(v.substr(6,2),10)+parseInt(add));
		var yy=d.getYear();
		if (yy>99) yy='0000'+yy; else yy='0000'+(1900+yy);
		var mm='00'+(d.getMonth()+1);
		var dd='00'+d.getDate();
     yy=yy.substr(yy.length-4,4);
     mm=mm.substr(mm.length-2,2);
     dd=dd.substr(dd.length-2,2);
		v=yy+sep+mm+sep+dd;
	}
	return v;
}

function lpad(s,len,c){
	s = '' + s;
	c = c || '0';
	while (s.length < len) s = c + s;
	return s;
}

function rlz(s){ //* remove leading zero
	var i;
	s = '' + s;
	len = s.length;
	for (i = 0; i < len; i ++) {
		if (s.charAt(i) != '0') break;
	}
	return s.substring(i);
}

//----------------------------------------------------------------------
//날짜구간을 ',' 로 합쳐진 문자열로 변경
//	@param bgnDt - 시작일
//	@param endDt - 종료일
//	@return 합쳐진 문자열
//ex) makeDateStr('20100601', '20100217')
//----------------------------------------------------------------------
function makeDateStr(bgnDt, endDt) {
	if (bgnDt > endDt) {
		var temp = bgnDt;
		bgnDt = endDt;
		endDt = temp;
	}
	var dt = new Date(parseInt(bgnDt.substring(0, 4)), parseInt(bgnDt.substring(4, 6)) - 1, parseInt(rlz(bgnDt.substring(6, 8))));
	var ymd;
	var rslt = '';
	do {
		ymd = '' + dt.getFullYear() + lpad(dt.getMonth() + 1, 2) + lpad(dt.getDate(), 2);
		if (ymd > endDt) {
			break;
		}
		rslt += (rslt == '' ? '' : ',') + ymd;
		dt.setDate(dt.getDate() + 1);
	} while (true);
	return rslt;
}

//----------------------------------------------------------------------
//반올림
//	@param value - 반올림 전 숫자
//	@param iFloat - 소숫점 이하 자릿수
//	@return 변경된 숫자
//ex) round(10.12345, 4) => 10.1235
//----------------------------------------------------------------------
function round(value,iFloat) {
	var pow;
	if (!isNaN(value)) {
		pow=Math.pow(10,iFloat);
		value=Math.round(value*pow)/pow;
		return value;
	} else return 0;
}


//----------------------------------------------------------------------
//설문조사
// @param qstnId - 설문아이디
// @param qstnrId - 설문지아이디
// @param aplId - 신청아이디
// @param mbrId - 회원아이디
// @param popupYn - true : 팝업, false : 바닥
// @param backingUri - 팝업일 경우 javascript(opener 의 함수를 호출), 바닥일 경우 해당 페이지로
//----------------------------------------------------------------------
function survey(qstnId, qstnrId, aplId, mbrId, popupYn, backingUri) {
	
	var url = "/COMQT2000N.do?qstnId="+qstnId+"&qstnrId="+qstnrId+"&aplId="+aplId+"&mbrId="+mbrId+"&popupYn="+popupYn+"&backingUri="+backingUri+"";
	
	openPopup(url, "", 800, 700, "yes");
	
	
}

//----------------------------------------------------------------------
//설문참여내용보기
//@param qstnId - 설문아이디
//@param qstnrId - 설문지아이디
//@param cstmrKey - 고객키
//----------------------------------------------------------------------
function surveyView(qstnId,qstnrId,cstmrKey) {
	
	var url = "/COMQT1300N.do?qstnrId="+qstnrId+"&qstnId="+qstnId+"&cstmrKey="+cstmrKey+"";
	
	openPopup(url, "", 800, 700, "yes");
	
	
}

//----------------------------------------------------------------------
//설문지조회
//		@param frm - 폼객체(object 일 경우 해당 객체 사용, 문자열일 경우 찾거나 만듬.)
//		@param idId - id 가 들어갈 오브젝트명(불필요시 "")
//		@param idNm - 이름이 들어갈 오브젝트명(불필요시 "")
//----------------------------------------------------------------------
function findQstnr(frm, idId, idNm, callbackfn){
	if (idId == undefined) idId = '';
	if (idNm == undefined) idNm = '';
	if (callbackfn == undefined) callbackfn = '';

	var url = "/COMQT1700N.do?idId="+idId+"&idNm="+idNm+"&callbackfn="+callbackfn+"";
	var t = "wApldcCmpnt";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 800, 530, "yes");
		target = t;
		action = url;
		submit();
	}
}




/*
Method: FlashObject
 Param1: SWF path
 Param2: Movie width
 Param3: Movie height
 Param4: BGColor
 Param5: Flashvars (Optional)
*/
function FlashObject(swf, width, height, flashvars)
{
    var strFlashTag = new String();
    
    if (navigator.appName.indexOf("Microsoft") != -1)
    {
        strFlashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        strFlashTag += 'codebase="'+__protocol__+'//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=version=8,0,0,0" width="' + width + '" height="' + height + '">';
        strFlashTag += '<param name="movie" value="' + swf + '"/>';        
        strFlashTag += '<param name="FlashVars" value="' + flashvars + '"/>';
        strFlashTag += '<param name="quality" value="best"/>';
        //strFlashTag += '<param name="bgcolor" value="' + bgcolor + '"/>';
        strFlashTag += '<param name="menu" value="false"/>';
        strFlashTag += '<param name="salign" value="LT"/>';
        strFlashTag += '<param name="scale" value="noscale"/>';
        strFlashTag += '<param name="wmode" value="transparent"/>';
        strFlashTag += '<param name="allowScriptAccess" value="sameDomain"/>';
        strFlashTag += '</object>';
    }
    else
    {
        strFlashTag += '<embed src="' + swf + '" ';
        strFlashTag += 'quality="best" ';
        //strFlashTag += 'bgcolor="' + bgcolor + '" ';
        strFlashTag += 'width="' + width + '" ';
        strFlashTag += 'height="' + height + '" ';
        strFlashTag += 'menu="false" ';
        strFlashTag += 'scale="noscale" ';
        strFlashTag += 'salign="LT" ';
        strFlashTag += 'wmode="transparent" ';
        strFlashTag += 'allowScriptAccess="sameDomain" ';
        strFlashTag += 'type="application/x-shockwave-flash" ';
        strFlashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        strFlashTag += '<param name="FlashVars" value="' + flashvars + '"/>';
        strFlashTag += '</embed>';
    }

 document.write(strFlashTag);
}

function completeTr(obj) {
	if (typeof(obj) == 'string') {
		var obj = document.all[obj];
	}
	if ("table".equals(obj.tagName.toLowerCase())) {
		var maxCol = 0;
		var lenRow = obj.rows.length;
		var lenCel;
		var col;
		var colSpan;

		var rowSpans = new Array();
		var lenRowSpans;
		var rowcol;

		for (var i = 0; i < lenRow; i ++) {
			lenCel = obj.rows[i].cells.length;
			col = 0;

			lenRowSpans = rowSpans.length;
			rowcol = 0;
			for (var k = 0; k < lenRowSpans; k ++) {
				if (rowSpans[k] > 0) {
					rowcol ++;
					rowSpans[k] --;
				}
			}

			for (var j = 0; j < lenCel; j ++) {
				colSpan = obj.rows[i].cells[j].colSpan;
				col += ("".equals(colSpan) ? 1 : colSpan);

				if (obj.rows[i].cells[j].rowSpan > 1) {
					rowSpans[rowSpans.length] = obj.rows[i].cells[j].rowSpan - 1;
				}

			}
			col += rowcol;
			if (maxCol < col) {
				maxCol = col;
			}
		}
		for (var i = 0; i < lenRow; i ++) {
			lenCel = obj.rows[i].cells.length;
			col = 0;

			lenRowSpans = rowSpans.length;
			rowcol = 0;
			for (var k = 0; k < lenRowSpans; k ++) {
				if (rowSpans[k] > 0) {
					rowcol ++;
					rowSpans[k] --;
				}
			}

			for (var j = 0; j < lenCel; j ++) {
				colSpan = obj.rows[i].cells[j].colSpan;
				col += ("".equals(colSpan) ? 1 : colSpan);

				if (obj.rows[i].cells[j].rowSpan > 1) {
					rowSpans[rowSpans.length] = obj.rows[i].cells[j].rowSpan - 1;
				}
			}
			col += rowcol;
			if (col < maxCol) {
				if (lenCel > 0) {
					obj.rows[i].cells[lenCel - 1].colSpan += (maxCol - col);
				}
			}
		}
	}

}

function CallChain(fnNm) {
	this.fnNm = fnNm;
	this.chain = new Array();
	
	this.getFnNm = function () {
		return this.fnNm;
	};

	this.appendFn = function(fn) {
		this.chain[this.chain.length] = fn;
	};

	this.doChain = function() {
		for (var i = 0; i < this.chain.length; i ++) {
			if (this.chain[i] != null) {
				this.chain[i]();
			}
		}
		if (eval(this.fnNm) != null) {
			eval(this.fnNm() + "()");
		}
	};
}
function CallChains() {
	this.chains = new Array();
	this.appendFn = function (fnNm, fn) {
		var lenChains = this.chains.length;
		var c;
		for (c = 0; c < lenChains; c ++) {
			if (this.chains[c].getFnNm() == fnNm) {
				break;
			}
		}
		if (c == lenChains) {
			this.chains[c] = new CallChain(fnNm);
		}
		this.chains[c].appendFn(fn);
	};
	this.callChain = function (fnNm) {
		var lenChains = this.chains.length;
		var c;
		for (c = 0; c < lenChains; c ++) {
			if (this.chains[c].getFnNm() == fnNm) {
				this.chains[c].doChain();
				return ;
			}
		}
	};
}

var __callchains__ = new CallChains();

/*****************************************************************************
* 이미지 롤오버 함수
*****************************************************************************/
function imgChg(obj){
	var img = null;
	var imgName = null;
	
	// A 객체에서 IMG객체를 추출
	// 접근성을 위해 오버 이미지의 컨트롤은 A에서 이벤트를 걸어 처리되도록 함.
	if(obj != null){
		for(i=0; i<obj.childNodes.length; i++){
			if(obj.childNodes[i].nodeName == "IMG"){
				img = obj.childNodes[i];
			}
		}
	}

	if(img != null){
		imgName = img.src;
		if(imgName.indexOf("_on") > -1){
			img.src = imgName.replace(/_on\.gif/g, "_off.gif");
		}else{
			img.src = imgName.replace(/_off\.gif/g, "_on.gif");
		}
	}
}

__loader__.appendSysLoader(
	function () {
		try {
			var lenLinks = document.links.length;
			for (var i = 0; i < lenLinks; i++) {
//				document.links[i].hideFocus = true;
			}
		} catch (e) {}
	}
	);


/*
' ------------------------------------------------------------------
' Function    : fc_chk_byte(aro_name)
' Description : 입력한 글자수를 체크 
' Argument    : Object Name(글자수를 제한할 컨트롤)
' Return      : 
' ------------------------------------------------------------------
*/
function fc_chk_byte(aro_name,ari_max)
{

   var ls_str     = aro_name.value; // 이벤트가 일어난 컨트롤의 value 값
   var li_str_len = ls_str.length;  // 전체길이

   // 변수초기화
   var li_max      = ari_max; // 제한할 글자수 크기
   var i           = 0;  // for문에 사용
   var li_byte     = 0;  // 한글일경우는 2 그밗에는 1을 더함
   var li_len      = 0;  // substring하기 위해서 사용
   var ls_one_char = ""; // 한글자씩 검사한다
   var ls_str2     = ""; // 글자수를 초과하면 제한할수 글자전까지만 보여준다.

   for(i=0; i< li_str_len; i++)
   {
      // 한글자추출
      ls_one_char = ls_str.charAt(i);

      // 한글이면 2를 더한다.
      if (escape(ls_one_char).length > 4)
      {
         li_byte += 2;
      }
      // 그밗의 경우는 1을 더한다.
      else
      {
         li_byte++;
      }

      // 전체 크기가 li_max를 넘지않으면
      if(li_byte <= li_max)
      {
         li_len = i + 1;
      }
   }
   
   // 전체길이를 초과하면
   if(li_byte > li_max)
   {
      alert( li_max + " 글자를 초과 입력할수 없습니다.(한글 :"+(li_max/2)+"자) \n 초과된 내용은 자동으로 삭제 됩니다. ");
      ls_str2 = ls_str.substr(0, li_len);
      aro_name.value = ls_str2;
      
   }
   aro_name.focus();   
}

function findYPolMember(frm, idMbrId, idBsmNo, idMbrNm, idRno, idMbpNo, idEmail, idCoNm, gubun, mbrGbn, callbackfn){
	if (idMbrId == undefined) idMbrId = '';
	if (idBsmNo == undefined) idBsmNo = '';
	if (idCoNm == undefined) idCoNm = '';
	if (gubun == undefined) gubun = '';
	if (callbackfn == undefined) callbackfn = '';
	
	var url = "/POLYCM002P.do?idMbrId="+idMbrId+"&idBsmNo="+idBsmNo+"&idMbrNm="+idMbrNm+"&idRno="+idRno+"&idMbpNo="+idMbpNo+"&idEmail="+idEmail+"&idCoNm="+idCoNm+"&gubun="+gubun+"&mbrGbn="+mbrGbn+"&callbackfn="+callbackfn+"";
	var t = "wPolMbr";
	
	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	with(frm){
		openPopup("", t, 500, 520, "Y");
		target = t;
		action = url;
		submit();
	}
}


//----------------------------------------------------------------------
//업종찾기
//		@param frm - 폼객체
//		@param codeCd - 코드오브젝트명
//		@param codeNm - 코드명오브젝트명
//----------------------------------------------------------------------
function findIndt(frm, codeCd, codeNm){
	var url = "/MBRMR5100P.do";
	var t = "wIndtCode";

	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['codeCdObj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"codeCdObj\"/>"));
	}
	frm.elements['codeCdObj'].value = codeCd;

	if (frm.elements['codeNmObj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"codeNmObj\"/>"));
	}
	frm.elements['codeNmObj'].value = codeNm;

	
	with(frm){
		openPopup("", t, 450, 430, "yes");
		target = t;
		action = url;
		submit();
	}
}

//----------------------------------------------------------------------
//표준산업분류코드
//		@param frm - 폼객체
//		@param codeCd - 코드오브젝트명
//		@param codeNm - 코드명오브젝트명
//----------------------------------------------------------------------
function findStdIndCls(frm, codeCd, codeNm){
	var url = "/MBRMR5200P.do";
	var t = "wStdIndClsCode";

	if (typeof(frm) == 'string') {
		var frmObj = document.all[frm];
		if (frmObj == null) {
			frmObj = document.createElement("<form id=\""+frm+"\" name=\""+frm+"\" method=\"post\"/>");
			document.appendChild(frmObj);
		}
		frm = frmObj;
	}

	if (frm.elements['codeCdObj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"codeCdObj\"/>"));
	}
	frm.elements['codeCdObj'].value = codeCd;

	if (frm.elements['codeNmObj'] == null) {
		frm.appendChild(document.createElement("<input type=\"hidden\" name=\"codeNmObj\"/>"));
	}
	frm.elements['codeNmObj'].value = codeNm;

	with(frm){
		openPopup("", t, 450, 430, "yes");
		target = t;
		action = url;
		submit();
	}
}

/* 로그인 대소문자 비교 */
function capLock(e){
    var kc = e.keyCode ? e.keyCode : e.which;
    var sk = e.shiftKey ? e.shiftKey : ((kc == 16) ? true : false);

    if (((kc >= 65 && kc <= 90) && !sk) || ((kc >= 97 && kc <= 122) && sk)){
        document.getElementById("capLock").style.display = "block";
    } else {
        document.getElementById("capLock").style.display = "none";
    }
}

/* 로그인 대소문자 비교 안보이게 */
function capLockNotView(){
    document.getElementById("capLock").style.display = "none";
}

