



// TGCorp PG 

    /**
        결제 요청 함수 (결제창 호출)
    */
    function reqPayment() {
     //   setSmode(); // 예제 테스트를 위한 함수 (Smode_tmp->Smode)

        if(document.payform.Smode.value!="0002" && document.payform.Smode.value!="0003") 
        { // 현금영수증 직접 전송은 팝업을 이용하지 않음
            TG_PAY = window.open("","TG_PAY", "resizable=no, width=390, height=360");
            TG_PAY.focus();        
            document.payform.target="TG_PAY";
        }
        document.payform.action="https://npg.tgcorp.com/dlp/start.jsp";
    }
    
    /**
        거래시간은 편의상 구매자 PC 시간을 사용합니다.
        실제로는 쇼핑몰 서버의 시간을 사용해야 합니다.
    */
    function setTxTime() {
        var time = new Date();
        var year = time.getYear() + "";
        var month = time.getMonth()+1;
        var date = time.getDate();
        var hour = time.getHours();
        var min = time.getMinutes();
        var sec = time.getSeconds();
        if(month<10) month = "0" + month;
        if(date<10) date = "0" + date;
        if(hour<10) hour = "0" + hour;
        if(min<10) min = "0" + min;
        if(sec<10) sec = "0" + sec;       
        return year + month + date + hour + min + sec;
    }

    /**    
        거래번호(MxIssueNO), 거래일시(MxIssueDate) 생성 예제
        예제에서는 편의상 거래시간을 거래번호로 사용합니다.
        실제로는 쇼핑몰의 고유 주문번호를 사용해야 합니다. 
    */    
    function initValue() {
        var tmp = setTxTime();
         document.payform.MxIssueDate.value = tmp;
    }

    /**
        예제 테스트를 위해, 선택한 결제 수단 값(Smode_tmp)을 Smode에 설정
        실제로, Smode1 ~ Smode8은 hidden으로 설정
    */
    function setSmode() {

        document.payform.Smode.value = document.payform.method.value;

    }

	function set(n) {
	temp = document.apply2ndform.peducd.length  ;        
		for (i=0; i < temp; i++) {   
		document.apply2ndform.peducd[i].checked=n;
		}
	} 

	function set2(n) {
	temp = document.apply2ndform.teducd.length  ;		
 		for (i=0; i < temp; i++) {   
		document.apply2ndform.teducd[i].checked=n;
		} 
	} 

	function Invers(){  // 배울 언어 선택시 가르칠 언어 비활성화
 	temp = document.apply2ndform.peducd.length ;
		for (i=0; i < temp; i++){
		if(document.apply2ndform.peducd[i].checked == 1){set2(0); }  } }

	function Invers2(){ // 가르칠 언어 선택시 배울언어 비활성화
	temp = document.apply2ndform.teducd.length ;
		for (i=0; i < temp; i++){
		if(document.apply2ndform.teducd[i].checked == 1){set(0); }   } }


	function go_checkMin() { // 희망 시간
		var frm = document.apply2ndform;

		document.getElementById("min_txt").innerText  =	frm.eduTime[frm.eduTime.options.selectedIndex].text;
	}

	function day_check(){ // 희망요일

	var frm = document.apply2ndform;

	    frm.day_txt.value= ""
 		if(frm.eduHopeDay[1].checked==1)frm.day_txt.value += "Mon. "
		if(frm.eduHopeDay[2].checked==1)frm.day_txt.value += "Tue. "
		if(frm.eduHopeDay[3].checked==1)frm.day_txt.value += "Wed. "
		if(frm.eduHopeDay[4].checked==1)frm.day_txt.value += "Thu. "
		if(frm.eduHopeDay[5].checked==1)frm.day_txt.value += "Fri. "
		if(frm.eduHopeDay[6].checked==1)frm.day_txt.value += "Sat. "
		if(frm.eduHopeDay[7].checked==1)frm.day_txt.value += "Sun. "

	document.getElementById("day").innerText = frm.day_txt.value;
	}

	 function CheckAll(objChkBox) // 전체선택
	{ 
		bChecked = (objChkBox.checked)?true:false
		for (x=0;x<document.apply2ndform.eduHopeDay.length;x++)
		{
			document.apply2ndform.eduHopeDay[x].checked = bChecked;

		}

		 day_check()
	} 

	function timechk_SH() { // 시작시간 체크

 	var frm = document.apply2ndform;

	var SH = eval("frm.startTime");
 	var Shour = valNum(SH.value);
 
 
	if (Shour=="01" || Shour=="02" ||  Shour=="03" || Shour=="04" || Shour=="05" || Shour=="06" ||  Shour=="24")
	{
		alert("Unavailable Time, please choose again.");
		frm.startTime.value="";
		frm.his_stime.value="";
		frm.my_stime.value="";
		frm.startTime.focus();
	}

		frm.his_stime.value=Shour;
		frm.my_stime.value=Shour;
	}
 
	function timechk_EH() { //종료시간 체크

 	var frm = document.apply2ndform;
 
	var EH = eval("frm.endTime");
 	var Ehour = valNum(EH.value);
 
	if (Ehour=="01" || Ehour=="02" ||  Ehour=="03" || Ehour=="04" || Ehour=="05" || Ehour=="06" ||  Ehour=="24")
	{
		alert("Unavailable Time, please choose again.");
		frm.endTime.value="";
		frm.his_etime.value="";
		frm.endTime.focus();
	}
		frm.his_etime.value=Ehour;
		frm.my_etime.value=Ehour;
	}	
