	// top menu
	function menu(idx){
		switch(idx){			
			case 1:	//	치과계동정
				//window.location.href="/job.do?method=job_hunt_news&menu_code=23&idx=2";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=15977&menu_code=10&idx=2&bbs_union=news&order_gb=16";
				window.location.href="/bbs.do?method=list&bbs_cfg_no=15977&bbs_union=news&order_gb=16&menu_code=1010&idx=2";
				break;
			case 2: // 열린마당 
				//window.location.href="/news/news.do?method=today_news&menu_code=10&idx=0";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=15977&menu_code=10&idx=2&bbs_union=news&order_gb=16";
				if($F('mem_job_cd') != "" && parseInt($F('mem_job_cd').substr(0,1))>1){
					window.location.href="/bbs.do?method=list&bbs_cfg_no=46&menu_code=3410&idx=2";
				}else{
					window.location.href="/bbs.do?method=list&bbs_cfg_no=45&menu_code=3410&idx=2";
				}
				break;
			case 3:	// 덴플Job
				//window.location.href="/live/live.do?method=doMain&menu_code=11";
				//window.location.href="/job.do?method=job_hunt_news&menu_code=23&idx=2";
				window.location.href="/job.do?method=job_hunt_news&menu_code=231000&idx=2";
				break;
			case 4:	// 임상Vod
				//window.location.href="/clinic.do?method=clinic_main&menu_code=12&idx=0";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1210&idx=2";
				window.location.href="/live/live.do?method=doMain&menu_code=11";
				break;
			/*case 5:	// 논문 Journal
				window.location.href="/journal.do?method=journal_main&menu_code=13&idx=0";
				break;*/
			case 5:	// 임상UCC
				//window.location.href="/aic.do?method=aic_main&menu_code=14&idx=0";
				//window.location.href="/com/community.do?method=ncListDetail&srch_code=1";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=12&idx=2";
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1210&idx=2";
				break;
			case 6:	//	SW/보험
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=14&menu_code=3111&idx=2";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=29749&menu_code=32";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=29749&menu_code=3210&idx=2&bbs_union=insure_info&order_gb=16";
				//window.location.href="/bbs.do?method=list&menu_code=3210&idx=2&bbs_cfg_no=77&bbs_union=sw_info&order_gb=16";
				
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=29870&menu_code=3210&order_gb=16";
				window.location.href="/bbs.do?method=list&bbs_cfg_no=29870&menu_code=3210";
				break;
			case 7:	// 까페/블로그
				//window.location.href="/part.do?method=part_main&menu_code=18&idx=0";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=80&menu_code=1811&idx=0&bbs_union=part";
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=14&menu_code=31&idx=2&bbs_union=life&order_gb=16";
				window.location.href="/com/community.do?method=ncListDetail&srch_code=1&menu_code=20";
				break;
			case 8:	// 오픈마켓
				//window.location.href="/aic.do?method=insure_main&menu_code=27";
				window.location.href="/bbs.do?method=list&bbs_cfg_no=16&menu_code=3310&bbs_union=market&order_gb=16";
				break;
			case 9: // 덴탈블로그
				//window.location.href="/dentallife/dental_life.do?method=lifeMain&idx=4";
				window.location.href="/com/community.do?method=ncListDetail&srch_code=1";
				break;
		}
	}
	
	// sub menu
	function sub_menu1(idx){	// 덴플 Job
		switch(idx){
			case 1:	//	채용소식
				//window.location.href="/news/news.do?method=today_news&menu_code=1010";
				alert("준비중");
				break;
			case 2:	// 인재소식
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1011&category="+encodeURI('세미나소식');
				alert("준비중");
				break;
			case 3:	// 채용/인재 검색
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1012&category="+encodeURI('행사일정');
				alert("준비중");
				break;
			case 4:	// 채용/인재 등록
				//window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1013&category="+encodeURI('치과경영');
				alert("준비중");
				break;
		}
	}
	
	function sub_menu2(idx){	// Today News
		switch(idx){
			case 1:	//	오늘의 새소식
				window.location.href="/news/news.do?method=today_news&menu_code=1010";
				break;
			case 2:	// 세미나 소식
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1011&category="+encodeURI('세미나소식');
				break;
			case 3:	// 행사 일정
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1012&category="+encodeURI('행사일정');
				break;
			case 4:	// 치과 경영
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1013&category="+encodeURI('치과경영');
				break;
			case 5:	// 보험소식
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1014&category="+encodeURI('보험소식');
				break;
			case 6:	// 대학/병원
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1015&category="+encodeURI('대학/병원');
				break;
			case 7:	//	치과위생/기공사
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1016&category="+encodeURI('치과위생/기공사');
				break;
		}
	}
	function sub_menu3(idx){	// Live Surgery
		alert(idx);
		switch(idx) {
			case 1:		// 전체
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1110&type=Vod";
				break;
			case 2:		// 상악전치
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1111&type=Vod&part_cd=101";
				break;
			case 3:		// 하악전치
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1112&type=Vod&part_cd=102";
				break;
			case 4:		// 상악구치
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1113&type=Vod&part_cd=103";
				break;
			case 5:		// 하악구치
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1114&type=Vod&part_cd=104";
				break;
			case 6:		// 완전무치
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1115&type=Vod&part_cd=106";
				break;
			case 7:		// 복합결손
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1116&type=Vod&part_cd=105";
				break;
			case 8:		// 임플란트외
				window.location.href = "/live/live.do?method=doLiveList&menu_code=1117&type=Vod&field_cd=103";
				break;
		}
	}
	function sub_menu4(idx){	// 임상 UCC
		switch(idx){
			case 1:	//	신규임상UCC
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1210&idx=2";
				break;
			case 2:	// 추천임상UCC
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1211&category="+encodeURI('세미나소식');
				break;
			case 3:	// 전체
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1212&category="+encodeURI('행사일정');
				break;
			case 4:	// 임플란트
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1213&category="+encodeURI('임플란트');
				break;
			case 5:	// 구강외과
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1214&category="+encodeURI('구강외과');
				break;
			case 6:	// 보철
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1215&category="+encodeURI('보철');
				break;
			case 7:	//	치주
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1216&category="+encodeURI('치주');
				break;
			case 8:	//	보존/근관
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1217&category="+encodeURI('보존/근관');
				break;
			case 9:	//	교정
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1218&category="+encodeURI('교정');
				break;
			case 10:	//	교합
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1219&category="+encodeURI('교합');
				break;
			case 11:	//	소아치과
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1220&category="+encodeURI('소아치과');
				break;
			case 12:	//	심미
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1221&category="+encodeURI('심미');
				break;
			case 13:	//	기타 임상 동영상
				window.location.href="/bbs.do?method=list&bbs_cfg_no=17&menu_code=1222&category="+encodeURI('기타');
				break;
		}
	}
	function sub_menu5(idx){	// 논문 Journal
		switch(idx){
			case 1:	//	교환요청
				window.location.href="/bbs.do?method=list&bbs_cfg_no=18&menu_code=1310&category="+encodeURI('교환요청');
				break;
			case 2:	// 리뷰코너
				window.location.href="/bbs.do?method=list&bbs_cfg_no=18&menu_code=1311&category="+encodeURI('리뷰');
				break;
			case 3:	// 추천코너
				window.location.href="/bbs.do?method=list&bbs_cfg_no=18&menu_code=1312&category="+encodeURI('추천');
				break;
			case 4:	// 임상논문/포스터
				window.location.href="/bbs.do?method=list&bbs_cfg_no=42&menu_code=1313";
				break;
			case 5:	// 지식검색 서비스
				window.location.href="/journal/search_knowledge.vm";
				break;
		}
	}
	function sub_menu6(idx){	// AIC
		switch(idx){
			case 1:	//	최근소식
				window.location.href="/bbs.do?method=list&bbs_cfg_no=47&menu_code=1410&idx=2";
				break;
			case 2:	// AIC 소개
				window.location.href="/admin/contents.do?method=preview&menu_code=1411&con_no=66&idx=3";
				break;
			case 3:	// 임플란트 연수회
				window.location.href="/admin/contents.do?method=preview&menu_code=1412&con_no=75&idx=4";
				break;
			case 4:	// 보험청구 연수회
				window.location.href="/admin/contents.do?method=preview&menu_code=1413&con_no=81&idx=5";
				break;
			case 5:	// 화상 세미나
				window.location.href="/admin/contents.do?method=preview&menu_code=1414&con_no=132&idx=6";
				break;
			case 6:	// ATC 소개
				window.location.href="/admin/contents.do?method=preview&menu_code=1415&con_no=127&idx=7";
				break;
			case 7:	//	등록안내
				window.location.href="/admin/contents.do?method=preview&menu_code=1416&con_no=133&idx=8";
				break;
			case 8:	//	AIC 커뮤니티
				window.location.href="/com/aic_com.do?method=aicMain";
				break;
		}
	}
	function sub_menu7(idx){	//	Life UCC
		switch(idx){
			case 1:	//	우리가 만드는 덴탈세상
				window.location.href="/bbs.do?method=list&bbs_cfg_no=14&menu_code=1610";
				break;
			case 2:	// 포토에세이
				window.location.href="/bbs.do?method=list&bbs_cfg_no=28&menu_code=1611";
				break;
			case 3:	// 한줄의 발견
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1612";
				break;
			case 4:	// 공감댓글
				window.location.href="/bbs.do?method=list&bbs_cfg_no=42&menu_code=1613";
				break;
		}
	}
	function sub_menu8(idx){	// 참여광장
		switch(idx){
			case 1:	//	구인구직
				window.location.href="/news/news.do?method=today_news&menu_code=1810";
				break;
			case 2:	// 임대/매매
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1811";
				break;
			case 3:	// 중고장비매매
				window.location.href="/bbs.do?method=list&bbs_cfg_no=24&menu_code=1812";
				break;
			case 4:	// 상제품 홍보
				window.location.href="/bbs.do?method=list&bbs_cfg_no=16&menu_code=1813";
				break;
			case 5:	// 설문조사
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1814";
				break;
			case 6:	// 핫이벤트
				window.location.href="/bbs.do?method=list&bbs_cfg_no=7&menu_code=1815";
				break;
		}
	}
	function sub_menu9(idx){// Software
		switch(idx){
			case 1:	//	최근소식
				window.location.href="/bbs.do?method=list&menu_code=2410&idx=2&bbs_cfg_no=77";
				break;
			case 2:	// 두번에
				window.location.href="/product.do?method=doobunae_main&idx=3&menu_code=2411";
				break;
			case 3:	// 하나로 OK
				window.location.href="/product.do?method=hanaro_main&idx=4&menu_code=2412";
				break;
			case 4:	// Vceph
				window.location.href="/product.do?method=vceph_main&idx=5&menu_code=2413";
				break;
			case 5:	// FAQ
				window.location.href="/bbs.do?method=list&bbs_cfg_no=11&menu_code=2414";
				break;
			case 6:	// Q&A
				window.location.href="/bbs.do?method=list&bbs_cfg_no=10&menu_code=2415";
				break;
			case 7:	// DOWNLOAD
				window.location.href="/bbs.do?method=list&bbs_cfg_no=36&menu_code=2416";
				break;
			case 8:	// 고객상담
				window.location.href="/mem/member.do?method=onlineForm&menu_code=2417";
				break;
		}
	}

	function FormatNumber3(num){
        num=new String(num);
        num=num.replace(/,/gi,"");
        return FormatNumber2(num);
	}

	// chart
	function chart_view(movie,width,height,location,bgcolor) {
		var html = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + width + "' height='" + height + "' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0' border='0'>";
		html += "<param name='MOVIE' value='" + movie + "' />";
		html += "<PARAM NAME=bgcolor VALUE=" + bgcolor + ">";
		html += "</object>";
		
		location.innerHTML = html;
	}

	// SheetLoad
	function SheetLoad() {
		var html = "<OBJECT ID='Sheet' CLASSID='CLSID:C838E9DA-1625-4E14-8B37-C6706B43C423' CODEBASE='/sheet/IBSheet.CAB#version=2,6,0,0'><param name='ConfigXml' value='/sheet/IBSheetConfig.xml'><param name='UseUTF8' value='true'></OBJECT>";
		document.write(html);
	}

	// SheetLoad
	function SheetLoad1() {
		var html = "<OBJECT ID='Sheet1' CLASSID='CLSID:C838E9DA-1625-4E14-8B37-C6706B43C423' CODEBASE='/sheet/IBSheet.CAB#version=2,6,0,0'><param name='ConfigXml' value='/sheet/IBSheetConfig.xml'><param name='UseUTF8' value='true'></OBJECT>";
		document.write(html);
	}

	// SheetLoad
	function SheetLoad2() {
		var html = "<OBJECT ID='Sheet2' CLASSID='CLSID:C838E9DA-1625-4E14-8B37-C6706B43C423' CODEBASE='/sheet/IBSheet.CAB#version=2,6,0,0'><param name='ConfigXml' value='/sheet/IBSheetConfig.xml'><param name='UseUTF8' value='true'></OBJECT>";
		document.write(html);
	}

	// SheetLoad
	function SheetLoad3() {
		var html = "<OBJECT ID='Sheet3' CLASSID='CLSID:C838E9DA-1625-4E14-8B37-C6706B43C423' CODEBASE='/sheet/IBSheet.CAB#version=2,6,0,0'><param name='ConfigXml' value='/sheet/IBSheetConfig.xml'><param name='UseUTF8' value='true'></OBJECT>";
		document.write(html);
	}
	
	// SheetLoad
	function SheetLoad4() {
		var html = "<OBJECT ID='Sheet4' CLASSID='CLSID:C838E9DA-1625-4E14-8B37-C6706B43C423' CODEBASE='/sheet/IBSheet.CAB#version=2,6,0,0'><param name='ConfigXml' value='/sheet/IBSheetConfig.xml'><param name='UseUTF8' value='true'></OBJECT>";
		document.write(html);
	}		
	// IBSheet 를 위한 레이블
	function getLabel(arr){
		var label = "";
		for(var i=0;i<arr.length;i++){
			label += "|";
			label += arr[i];
		}
		return label.substring(1);
	}

	// obj 널 체크
	function fnIsNull(oInput) {
	    if(fnTrim(oInput.value) == "" || oInput.value == null){
	        return false;
	    }
	    return true; 
	}
	
    var iIEYes = 0;
    var strAppName = navigator.appName;
    var strVersion = navigator.appVersion;

    if((strAppName.indexOf('마이크로소프트') >= 0 || strAppName.indexOf('Microsoft') >= 0) && strVersion.indexOf('4.0') >= 0 ){
        iIEYes = 1;
    }

	// 지정된 객체의 문자열 계산
    function fnCheckByte(strInput){
       var i;
       var strLen;
       var strByte;
       strLen = strInput.length;

       // IE4.0 이상
       if(iIEYes == 1){
           for(i=0, strByte=0; i<strLen; i++){
               if(strInput.charAt(i) >= ' ' && strInput.charAt(i) <= '~' )
                   strByte++;
               else
                   strByte += 2;
           }
           return strByte;
       // Netscape일 경우
       }else{
           return strLen;
       }
    }
	
	// 숫자여부 체크
    function fnIsNumber(oField,oName){
        var strValue = "" + oField.value;

        if ( strValue.charAt(0) == "-" ) {    //숫자가 (-)인 경우...
            strValue = strValue.substring(1);
        }

       for (var i = 0 ; i < strValue.length ; i++ ) {
            var AChar = strValue.charAt(i);

            if (AChar < "0" || AChar > "9") {
                alert(oName+"는(은) 숫자로 입력해 주십시오!");

                oField.focus();
                return false;
                break;
            }
        }
        return true;
    }    

	// 날짜형식 체크
    function fnCheckDate(oInput,strInput) {

        var strYear = "";
        var strMonth = "";
        var strDay = "";
        var i;

        if (fnTrim(strInput) == "") return;

        for(i=0;i<8;i++){
            var cValue = strInput.charAt(i);

            if(cValue < '0' || cValue > '9'){
                alert('날짜형식에 맞는지 확인하세요!');
                oInput.focus();
                oInput.select();
                return false;
            }

            if (i<4)                  strYear += cValue;
            else if (i >= 4 && i < 6) strMonth += cValue;
            else if (i >= 6)          strDay += cValue;
        }

        var strMon    = strMonth;
        var strTmpMon = parseInt(strMon,10);
        var strTmpDay = parseInt(strDay,10);

        if (strTmpMon < 1 || strTmpMon > 12 || strTmpDay < 1 || strTmpDay > 31) {
            alert("날짜가 잘못 입력되었습니다.")
            oInput.focus();
            oInput.select();
            return false;
        }

        if (strTmpMon != 2) {
            if (strTmpMon == 4 || strTmpMon == 6
                    || strTmpMon == 9 || strTmpMon == 11) {
                if (strTmpDay > 30) {
                    alert("날짜가 30일을 초과할수가 없습니다.")
                    oInput.focus();
                    oInput.select();
                    return(false);
                }
            }else if (strTmpMon == 1 || strTmpMon == 3 || strTmpMon == 5
                        || strTmpMon == 7 || strTmpMon == 8
                        || strTmpMon == 10 || strTmpMon == 12) {
                if (strTmpDay > 31) {
                    alert("날짜가 31일을 초과할수가 없습니다.")
                    oInput.focus();
                    oInput.select();
                    return(false);
                }
            }
        }else {
            var iYear       = parseInt(strYear);
            var iLeapYrTest = iYear % 4;
            var strMaxDay;

            if ((iYear%400== 0) || ((iYear%4==0)&&(iYear%100 !=0))) {
                strMaxDay = 29;
            }else {
                strMaxDay = 28;
            }

            if (strTmpDay > strMaxDay) {
                alert("날짜가 " + strMaxDay +"일을 초과할수가 없습니다.")
                oInput.focus();
                oInput.select();
                return(false);
            }
        }
        return(true);
    }

    // Null 유무 체크
    function fnIsNullValu(oInput) {
        if(oInput.value == null || oInput.value.replace(/\ /gi,'') == ""){
            return false;
        }
        return true;
    }
        
     // 넘어온 두날짜 사이에 차이나는 일수를 돌려줌(시작일도 포함)
    function fnCheckDayDiffB(strFromDate,strToDate) {
        var strTmpPrevDate = new Date( parseInt(Number(strFromDate.substring(0,4))),
                                    parseInt(Number(strFromDate.substring(4,6)))-1,
                                    parseInt(Number(strFromDate.substring(6)))-1 );
        var strTmpNextDate = new Date( parseInt(Number(strToDate.substring(0,4))),
                                    parseInt(Number(strToDate.substring(4,6)))-1,
                                    parseInt(Number(strToDate.substring(6))) );
    
        var strDiffDay = (strTmpNextDate - strTmpPrevDate)/(3600*24*1000);
    
        return strDiffDay;
    }    

	// 공백문자열 리턴
    function fnTrim(strInput){
        
        var strReturn = "";

        if (strInput == "") {
            return "";
        }
        
        var cValue;
        var i;
        var iCnt;
        
        if (typeof(strInput) == "number") {
            strReturn = strInput.toString();
        } else {
            iCnt = strInput.length;
            
            for(i=0; i < iCnt; i++) {
            
                cValue = strInput.charAt(i);
                
                if(cValue != ' '){
                    
                   strReturn += cValue;
                }
            }
        }
        
        return strReturn;
    }

    // 스크롤바가 있는 윈도우
    function fnOpenScrWin(strUrl,strTitle,iWidth,iHeight,iTop,iLeft){
        var strFeatures  = "scrollbars=yes,width=" + iWidth;
            strFeatures += ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft+",resizable=yes";
        window.open(strUrl,strTitle,strFeatures);
    }

	// 윈도우 팝업
	  function fnOpenWindow(strUri, iWidth, iHeight, iTop, iLeft, strPosMode, strTarget){
	
	      var iCount = arguments.length;
	      var saArray= new Array();
	
	      if (iCount <= 4 ){
	          var strMsg = "팝업창 호출을 위한 인수의 갯수가 충분하지 않습니다.\n\nParameter를 확인하시기 바랍니다.";
	          alert(strMsg);
	          return;
	      }
	
	      var strPosTop  = "";
	      var strPosLeft = "";
	      var strCenter  = "";
	      var strParam   = "";
	
	      // 팝업위치 지정
	      if (strPosMode == 1){
	          strPosTop  = iTop;
	          strPosLeft = iLeft;
	      }else if (typeof(strPosMode) == "undefined" || strPosMode == '') {
	          var iWsize = window.screen.width;
	          var iHsize = window.screen.height;
	
	          strPosTop  = (iHsize/2) - (iHeight/2);
	          strPosLeft = (iWsize/2) - (iWidth/2);
	      }
	      
	      // 파라미터가 정의되지 않았을 경우 
	      if (typeof(oParams) == "undefined" ) {
	          strParam = "_blank"; 
	      }else {
	          // Target지정(Target지정 파라미터를 넘기지 않을경우 strTaskUri값으로 Target지정)
	          var div_str = oParams[1].split(".");    //strTaskUri에 jsp가 올경우도 고려			
	          var div_str2 = div_str[0].split("/");
	          var ilength = div_str2.length
	          //strParam = div_str2[ilength-1];
	          strParam = div_str2[ilength-1]+SESSIONID;
	      }    
	      
	      // Target을 직접 지정한경우    
	      if (typeof(strTarget) != "undefined") {
	          if ( strTarget != "" ) {
	              //strParam = strTarget;
	              strParam = strTarget+SESSIONID;
	          }
	      }
	      
	      // Target 윈도우명에 '.'이 들어가면 오류발생
	      strParam = strParam.replace(/\./g,"");
	
	      var strFeatures  = "width="+iWidth+"px, height="+iHeight+"px, top=";
	          strFeatures += strPosTop+"px, left="+strPosLeft+"px, status=no, help=no, resizable=no, scrollbars=no,";
	          strFeatures += "toolbar=no, location=no, menubar=no, directories=no";
	      var pop_win = window.open(strUri, strParam, strFeatures);
	      pop_win.focus();
	}
	
function ShowObject(ME_COMMENT) {
	document.write(ME_COMMENT.text);
	ME_COMMENT.id = "";
}
	
	function MM_swapImgRestore() { //v3.0
	var i, x, a = document.MM_sr;
	for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) {
		x.src = x.oSrc;
	}
}
function MM_preloadImages() { //v3.0
	var d = document;
	if (d.images) {
		if (!d.MM_p) {
			d.MM_p = new Array();
		}
		var i, j = d.MM_p.length, a = MM_preloadImages.arguments;
		for (i = 0; i < a.length; i++) {
			if (a[i].indexOf("#") != 0) {
				d.MM_p[j] = new Image;
				d.MM_p[j++].src = a[i];
			}
		}
	}
}
function MM_findObj(n, d) { //v4.01
	var p, i, x;
	if (!d) {
		d = document;
	}
	if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
		d = parent.frames[n.substring(p + 1)].document;
		n = n.substring(0, p);
	}
	if (!(x = d[n]) && d.all) {
		x = d.all[n];
	}
	for (i = 0; !x && i < d.forms.length; i++) {
		x = d.forms[i][n];
	}
	for (i = 0; !x && d.layers && i < d.layers.length; i++) {
		x = MM_findObj(n, d.layers[i].document);
	}
	if (!x && d.getElementById) {
		x = d.getElementById(n);
	}
	return x;
}
function MM_swapImage() { //v3.0
	var i, j = 0, x, a = MM_swapImage.arguments;
	document.MM_sr = new Array;
	for (i = 0; i < (a.length - 2); i += 3) {
		if ((x = MM_findObj(a[i])) != null) {
			document.MM_sr[j++] = x;
			if (!x.oSrc) {
				x.oSrc = x.src;
			}
			x.src = a[i + 2];
		}
	}
}

// 에디터 불러오기
function editor_load(id) {
	var html = "<OBJECT ID='" + id + "' Style='width:100%; height:100%;' CLASSID='CLSID:D7767597-BCC5-4CCF-9AB1-BB23B6B2B0D0' CODEBASE='/myungin/miwectrl.cab#Version=1,3,1,16'>";
	// 첨부파일의 갯수제한(0이면 무한대로 가능) 
	html = html + "<PARAM NAME='MaxFileCount' Value='0'>";
	// 첨부파일 지정화면을 보이게, 혹은 안보이게(1이면 사용,0이면 사용안함)
	html = html + "<PARAM NAME='ShowAttachView' Value='1'>";
	// 첨부파일 한 개당 업로드 용량제한(KB단위이며 0이면 무한대로 가능, 1MB=1024KB) 
	html = html + "<PARAM NAME='MaxFileSize' Value='0'>";
	// 첨부파일 전체 업로드 용량제한(KB단위이며 0이면 무한대로 가능, 1MB=1024KB) 
	html = html + "<PARAM NAME='MaxTotalSize' Value='0'>";
	// 미리보기를 지원하지 않을 경우 툴바에서 미리보기 ICON을 없앨 필요가 있습니다. Value 가 0이면 없어지고 1이면 보입니다. 
	html = html + "<PARAM NAME='ShowPreview' Value='0'>";
	// 도움말 페이지를 지원하지 않을 경우 툴바에서 도움말 ICON을 없앨 필요가 있습니다. Value 가 0이면 없어지고 1이면 보입니다. 
	html = html + "<PARAM NAME='ShowHelp' Value='0'>";
	// CSS스타일을 URL로 지정
	//html = html + "<PARAM NAME='CSSURL' Value='/css/style.css'>";
	// 에디터 테이블 라인 스타일
	html = html + "<PARAM NAME='TableLineType' Value='0'>";
	// 레이어의 사용여부
	html = html + "<PARAM NAME='ShowInsertLayer' Value='0'>";
	html = html + "</OBJECT>";
	
	document.write(html);
}

//우편번호 팝업화면
function searchZipCode() {
	window.open("/sys/zip_code.vm","zip_code","width=490, height=390");
}

//우편번호 팝업-부모창에 getAddr(zip_code,addr) 형태로 값을 리턴함
//부모창에 getAddr() 자바스크립트 함수 추가필요.
function ZipCode() {
	window.open("/sys/zip.vm","zip_code","width=490, height=390");
}

// Faculty 검색
function searchFaculty() {
	window.open("/common.do?method=doFacultySearch","FacultySearch","width=500, height=350");
}

function addOption(ctrl, opt)
	{
		var len = ctrl.length;
	    ctrl.options[len] = opt;
	}

	function deleteAllOptions(ctrl)
    {
        var len = ctrl.length;
        for (var i = len - 1; i >= 0; i--) {
			ctrl.options[i] = null;
		}
	}  
	
	function set_group1(name1,name2) {
		var obj1         	= document.all[name1];
		var obj2         	= document.all[name2];
		var group1_count  	= arr_group1_cd.length;
		var opt         	= null;

		for(i=0; i<group1_count; i++) {
			opt = new Option(arr_group1_nm[i],arr_group1_cd[i],true);
			addOption(obj1,opt);
		}
	}
	
	function set_group2(name1,name2) {
		var obj1     	= document.all[name1];
		var obj2     	= document.all[name2];
		var lcode   	= obj1[obj1.selectedIndex].value;

		deleteAllOptions(obj2);
		var opt         = new Option('---- 선택하세요 ----','',true);
		addOption(obj2,opt);

		if(lcode != '') {
			var group2_count = eval('arr_group2_cd' + lcode + '.length');
			for(i=0; i<group2_count; i++) {
				opt = new Option(eval('arr_group2_nm' + lcode + '[i]'),eval('arr_group2_cd' + lcode + '[i]'),true);
				addOption(obj2, opt)
			}
		}
	}
	
	//현재시각과 y년 m월 d일 h시 차이나는 Time을 리턴
	function getRelativeTime(y,m,d,h) {
	/*
        var date = new Date();
    
        date.setFullYear(date.getFullYear() + y); //y년을 더함
        date.setMonth(date.getMonth() + m);       //m월을 더함
        date.setDate(date.getDate() + d);         //d일을 더함
        date.setHours(date.getHours() + h);       //h시를 더함
    
        return toTimeString(date);
    */
        return shiftTime(getCurrentTime(),y,m,d,h);
    }	
    
	/**
	* 주어진 Time 과 y년 m월 d일 h시 차이나는 Time을 리턴
	
	* ex) var time = form.time.value; //'20000101000'
	*     alert(shiftTime(time,0,0,-100,0));
	*     => 2000/01/01 00:00 으로부터 100일 전 Time
	*/
	function shiftTime(time,y,m,d,h) { //moveTime(time,y,m,d,h)
	    var date = toTimeObject(time);
	
	    date.setFullYear(date.getFullYear() + y); //y년을 더함
	    date.setMonth(date.getMonth() + m);       //m월을 더함
	    date.setDate(date.getDate() + d);         //d일을 더함
	    date.setHours(date.getHours() + h);       //h시를 더함
	
	    return toTimeString(date);
	}    
	
	/**
	* Time 스트링을 자바스크립트 Date 객체로 변환
	* parameter time: Time 형식의 String
	*/
	function toTimeObject(time) { //parseTime(time)
	    var year  = time.substr(0,4);
	    var month = time.substr(4,2) - 1; // 1월=0,12월=11
	    var day   = time.substr(6,2);
	    var hour  = time.substr(8,2);
	    var min   = time.substr(10,2);
	
	    return new Date(year,month,day,hour,min);
	}	
	
	/**
	* 자바스크립트 Date 객체를 Time 스트링으로 변환
	* parameter date: JavaScript Date Object
	*/
	function toTimeString(date) { //formatTime(date)
	    var year  = date.getFullYear();
	    var month = date.getMonth() + 1; // 1월=0,12월=11이므로 1 더함
	    var day   = date.getDate();
	    var hour  = date.getHours();
	    var min   = date.getMinutes();
	
	    if (("" + month).length == 1) { month = "0" + month; }
	    if (("" + day).length   == 1) { day   = "0" + day;   }
	    if (("" + hour).length  == 1) { hour  = "0" + hour;  }
	    if (("" + min).length   == 1) { min   = "0" + min;   }
	
	    return ("" + year + month + day + hour + min)
	}	
	
	//trim함수
	function trim(str) {
		re=/^\s+|\s+$/g;
		return str.replace(re,'');
	}
	
	function replaceAll(str, searchStr, replaceStr) {
 		while (str.indexOf(searchStr) != -1) {
  			str = str.replace(searchStr, replaceStr);
 		}
 		
 		return str;
	}	
	
	function FormatNumber2(num){
        fl=""
        if(isNaN(num)) { alert("문자는 사용할 수 없습니다.");return 0}
        if(num==0) return num
        
        if(num<0){ 
                num=num*(-1)
                fl="-"
        }else{
                num=num*1 //처음 입력값이 0부터 시작할때 이것을 제거한다.
        }
        num = new String(num)
        temp=""
        co=3
        num_len=num.length
        while (num_len>0){
                num_len=num_len-co
                if(num_len<0){co=num_len+co;num_len=0}
                temp=","+num.substr(num_len,co)+temp
        }
        return fl+temp.substr(1)
	}
	
	function FormatNumber3(num){
        num=new String(num)
        num=num.replace(/,/gi,"")
        return FormatNumber2(num)
	}
	
	function open_url(url,name,width,height) {
		var left = (screen.width - width) / 2;
		var top = (screen.height - height) / 2;
		var env = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top + ",scrollbars=yes,statebars=yes";
		
		remote = window.open(url,name,env);
		remote.focus();
	}
	
	var div_line1_mouseEvent = 1; 
	var div_line2_mouseEvent = 1; 
	
	var banner_count = 0;
	
	function banner_roll(div_id, banner_height, banner_delay, banner_speed, this_height){ 
		if(eval(div_id + "_mouseEvent")){ 
			var div_tag = document.getElementById(div_id); 
			var a_tag, i; 
			this_height++; 
			if(this_height < banner_height){  
				div_tag.style.top = -this_height; 
				setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed); 
			} else { 
				a_tag = div_tag.getElementsByTagName("TABLE"); 
				banner_count++;
				div_tag.appendChild(a_tag[0]); 
				div_tag.style.top = 0; 

				if (banner_count == 1 && div_id == "banner_1") {
					setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0);", 8000); 
				} else {
					setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", 0);", banner_delay); 
				}
			}  
		} else{ 
			setTimeout("banner_roll('" + div_id + "', " + banner_height + ", " + banner_delay + ", " + banner_speed + ", " + this_height + ");", banner_speed); 
		} 

		return true; 
	} 
	
	// 플래쉬불러오기
	function flash_view(movie,width,height,param) {
		var html = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' width='" + width + "' height='" + height + "' codebase='/cab/swflash.cab#version=4,0,0,0' border='0'>";
		html += "<param name=flashvars value='"+param+"'/>";
		html += "<param name='MOVIE' value='" + movie + "' />";
		html += "<param name='quality' value='high'>";
		html +=	"<param name='wmode' value='transparent'>";
		html += "</object>";
		$('div_rcmd').innerHTML = html;
		//document.writeln(html);
	}
	
	//배너 로드
	function load_banner(div_id,position_id) {
		var param = "position_id="+position_id;
           var ajax = new Ajax.Request(
            "/common.do?method=load_banner"
            ,{
            	method : "post"
            	,parameters : param			 	 
            	,onSuccess : function loadResult(result) {
            		var text = result.responseText;
            		//alert(text);
            		var content = text.split('§');
            		eval("window.banner"+position_id+"_mouseEvent = 1;");
           			document.getElementById(div_id).innerHTML = content[0];
            		//alert(content[0]);
            		//alert(content[1]);
            		//alert(content[2]);
            		if(content[1] == "101") {
            			if(content[2] == "110") {
            				setTimeout("banner_roll('banner"+position_id+"', 110, 8000, 30, 0)",8000);
            			} else if(content[2] == "49") {
            				setTimeout("banner_roll('banner"+position_id+"', 50, 8000, 70, 0)",8000);
            			} else if(content[2] == "51") {
            				setTimeout("banner_roll('banner"+position_id+"', 50, 8000, 70, 0)",8000);
            			} else if(content[2] == "100") {
            				setTimeout("banner_roll('banner"+position_id+"', 100, 8000, 30, 0)",8000);
            			}
            		}
            	}		 
            	,onException: bannerException 
            }
           );					 
	}
	
	//Ajax 로직에러시 처리함수
	function bannerException(err) { 
		return;
	}
	
	function vod_view(type,vod_seq,field_cd,part_cd,group1_cd,idx,page,search_type,search_word) {
		var url = "/live/live.do?method=doLiveContent&type=" + type + "&vod_seq=" + vod_seq;
		
		// 메뉴코드 설정
		if (type == "Vod") {
    		if (field_cd == "103") {
    			document.vod_content.menu_code.value = "111016";
    		} else if (part_cd == "101") {
    			document.vod_content.menu_code.value = "111010";
    		} else if (part_cd == "102") {
    			document.vod_content.menu_code.value = "111011";
    		} else if (part_cd == "103") {
    			document.vod_content.menu_code.value = "111012";
    		} else if (part_cd == "104") {
    			document.vod_content.menu_code.value = "111013";
    		} else if (part_cd == "105") {
    			document.vod_content.menu_code.value = "111014";
    		} else if (part_cd == "106") {
    			document.vod_content.menu_code.value = "111015";
    		} else {
    			document.vod_content.menu_code.value = "1110";
    		}
		} else if (type == "OPR") {
			document.vod_content.menu_code.value = "1111";
		} else if (type == "Lecture") {
			if (group1_cd == "102") {
				document.vod_content.menu_code.value = "111211";
			} else if (group1_cd == "103") {
				document.vod_content.menu_code.value = "111212";
			} else if (group1_cd == "104") {
				document.vod_content.menu_code.value = "111213";
			} else if (group1_cd == "105") {
				document.vod_content.menu_code.value = "111214";
			} else if (group1_cd == "106") {
				document.vod_content.menu_code.value = "111214";
			} else {
    			document.vod_content.menu_code.value = "1112";
			}
		}
		
		document.vod_content.idx.value = idx;
		document.vod_content.field_cd.value = field_cd;
		document.vod_content.part_cd.value = part_cd;
		document.vod_content.group1_cd.value = group1_cd;
		document.vod_content.page.value = page;
		document.vod_content.search_type.value = search_type;
		document.vod_content.search_word.value = search_word;		
		document.vod_content.action = url;		
		document.vod_content.submit();
	}
	 
	function image_view(url) {
		window.open('/common.do?method=doImageView&url='+escape(url), 'anc', 'toolbar=0, location=0, directories=0, menubar = 0, status = 0, scrollbar = 0, resizable = 0, locationbars=0');
	}
	
	//배너 팝업
	function banner_popup(url,width, height, scroll_yn) {
		window.open(url,'banner','width='+width+',height='+height+',scrollbar='+scroll_yn);
	}
	
	function player(vod_seq,vod_list_seq) {
		var url = "/player/live.do?method=doPlayer&vod_seq=" + vod_seq + "&vod_list_seq=" + vod_list_seq + "&menu_code=111015";
		var now_url = "/live/live.do?method=doLiveContent&vod_seq=747&list_div=16&page=1&level_cd=&field_cd=101&part_cd=106&surgical_cd=&goods_cd=&product1_cd=&product2_cd=&product3_cd=&search_type=&search_word=&order_type=&type=Vod&group1_cd=&group2_cd=&idx=1&menu_code=111015";
		var width = "750";
		var height = "680";
		var left = (screen.width - width) / 2;
		var top = (screen.height - height) / 2;
		var env = "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top;
		var remote = window.open(url,"VOD_PLAYER",env);
		remote.focus();
	}