// Ä«Å×°í¸® ¼±ÅÃ ÀÔ·Â
function ck(){
	//if ((document.frm.C1.value == "0") || (document.frm.C2.value == "0") || (document.frm.C3.value == "0")|| (document.frm.C4.value == "0"))
	if ((document.frm.C1.value == "0") || (document.frm.C2.value == "0") || (document.frm.C3.value == "0") )
	{
		alert("ºÐ·ù 4°³¸¦ ´Ù ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		return false;
	}

	var viewValue = document.frm.C1.options[document.frm.C1.selectedIndex].text + '/' + document.frm.C2.options[document.frm.C2.selectedIndex].text + '/' + document.frm.C3.options[document.frm.C3.selectedIndex].text  + '/' + document.frm.C4.options[document.frm.C4.selectedIndex].text
	var ValueValue = document.frm.C1.value + '|' + document.frm.C2.value + '|' + document.frm.C3.value  + '|' + document.frm.C4.value 
 	//for (var i=0; i<document.frm.cat.options.length; i++){ 
		if(document.frm.cat.value == ValueValue){ 
			alert("ÀÌ¹Ì µî·ÏµÈ ºÐ·ùÀÔ´Ï´Ù.");
			return false;
		}
	//}

	document.frm.cat.value=   viewValue;
	document.frm.catcode.value = ValueValue;

}
function eck(){   // ÀÏÂ÷Ä«Å×°í¸® Á¤º¸¸¸ Àü´Þ
	 if  (document.frmSearch.C1.value == "0")  	 {
	 	alert("ºÐ·ù¸¦  ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
	 	return false;
	 }
 
var viewValue = document.frmSearch.C1.options[document.frmSearch.C1.selectedIndex].text + '>' + document.frmSearch.C2.options[document.frmSearch.C2.selectedIndex].text + '>' + document.frmSearch.C3.options[document.frmSearch.C3.selectedIndex].text  + '>' + document.frmSearch.C4.options[document.frmSearch.C4.selectedIndex].text
	var ValueValue = document.frmSearch.C1.value + '|' + document.frmSearch.C2.value + '|' + document.frmSearch.C3.value  + '|' + document.frmSearch.C4.value 
 //	var viewValue = document.frmSearch.C1.options[document.frmSearch.C1.selectedIndex].text  
 //		var ValueValue = document.frmSearch.C1.value  
 

	document.frmSearch.cat.value=   viewValue;
	document.frmSearch.catcode.value = ValueValue;
	//document.frm.hiCount.value = document.frm.hiCount.value*1 + 1;
 // alert  (viewValue)
}
function scmck(){   // ÀÏÂ÷Ä«Å×°í¸® Á¤º¸¸¸ Àü´Þ
	 if  (document.frm.C1.value == "0")  	 {
	 	alert("ºÐ·ù¸¦  ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
	 	return false;
	 }
 
var viewValue = document.frm.C1.options[document.frm.C1.selectedIndex].text + '>' + document.frm.C2.options[document.frm.C2.selectedIndex].text + '>' + document.frm.C3.options[document.frm.C3.selectedIndex].text  + '>' + document.frm.C4.options[document.frm.C4.selectedIndex].text
	var ValueValue = document.frm.C1.value + '|' + document.frm.C2.value + '|' + document.frm.C3.value  + '|' + document.frm.C4.value 
 //	var viewValue = document.frm.C1.options[document.frm.C1.selectedIndex].text  
 //		var ValueValue = document.frm.C1.value  
 

	document.frm.cat.value=   viewValue;
	document.frm.catcode.value = ValueValue;
	//document.frm.hiCount.value = document.frm.hiCount.value*1 + 1;
 // alert  (viewValue)
}

// Ä«Å×°í¸® »èÁ¦
function delck()
{
	var y = document.frm.cat.options.length*1
	for (var i=0; i<y; i++){ 

		k = y*1 - i - 1
		if(document.frm.cat.options[k].selected == true){
			document.frm.cat.options[k] = null;
		}
	}

	document.frm.hiCount.value = document.frm.cat.options.length;
}
function edelck()
{
	var y = document.frm.cat; 
	y.value ="";  
}

function chk()
{
	var form = document.frm;
}


//**************************************
// ¼ýÀÚ ÀÔ·Â Ã¼Å© ÇÔ¼ö
//**************************************
function isNumber(obj) {
    if (isNaN(obj.value)) {
        alert("¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖ½À´Ï´Ù.");
        obj.focus();
        obj.select();
    }
}


function ChkMoney()
{
	var lec_price = document.frm.lec_price.value;
	var lec_dis = document.frm.lec_dis.value;
	var lec_sale = document.frm.lec_sale.value;

	if(lec_price == "") lec_price = 0;
	if(lec_dis == "") lec_dis = 0;
	if(lec_sale == "") lec_sale = 0;

	if(CheckNum(lec_price) == false) 
	{
		alert("ÆÇ¸Å°¡¸¦ ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		document.frm.lec_price.focus();
		document.frm.lec_price.select();
		return false;
	}

	if(CheckNum(lec_dis) == false) 
	{
		alert("¸¶ÁøÀ²Àº ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä.");
		document.frm.lec_dis.focus();
		document.frm.lec_dis.select();
		return false;
	}

	if(lec_price == 0) lec_sale = 0;
	else lec_sale = parseInt(lec_price) - ((parseInt(lec_price)/100)*parseInt(lec_dis))
     lec_sale = parseInt(lec_sale/100 )*100;
	 document.frm.lec_sale.value = lec_sale ;
}



function CheckNum(Data) {
	var nochk='01234567890.'

	for (i=0; i<Data.length; i++){
	if(nochk.indexOf(Data.substring(i,i+1)) < 0)
	{
		return false;
		}
	}//for Á¾·á
}

function OpenCodeCHK(wid,hei)
{
	var winl = (screen.width - wid) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
	var wint = (screen.height - hei) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ

	var lec_code = document.frm.lec_code.value;

	if(lec_code == "")
	{
		alert('°­ÀÇÄÚµå¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä');
		document.frm.lec_code.focus();
		return;
	}

	window.open('Lecture_CodeChk.asp?lec_code='+lec_code,'lec_code','top='+wint+',left='+winl+',width='+wid+',height='+hei+',scrollbars=no');
}

// °­»ç°Ë»ö
function find_teach() 
{
	var cp_id = document.frm.cp_id.value;
	var winl = (screen.width - 470) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
	var wint = (screen.height - 300) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ
	window.open("Lecture_Find_Teach.asp?cp_id="+cp_id,"findteacher","width=470,height=300,scrollbars=yes,top="+wint+",left="+winl);
}

// ±³Àç°Ë»ö
function find_book() 
{
	var winl = (screen.width - 620) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
	var wint = (screen.height - 400) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ
	window.open("Lecture_Find_Book.asp","findbook","width=637ss,height=400,scrollbars=yes,top="+wint+",left="+winl);
}

// CP °Ë»ö
function find_cp() 
{
	var winl = (screen.width - 470) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
	var wint = (screen.height - 300) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ
	window.open("Lecture_Find_CP.asp","findteacher","width=470,height=300,scrollbars=yes,top="+wint+",left="+winl);
}


function chk_lecture()
{
	var form = document.frm; 
	 var y = form.cat.value;
	if (y==""){
		alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä")
		return;
	}
	  
 

	if(form.lec_title.value == "")
	{
		alert("°­ÀÇ¸íÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_title.focus();
		return false;
	}

	if(form.lec_type.value == "")
	{
		alert("¼ö°­ ±â°£À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_type.focus();
		return false;
	}

	if(form.lec_sum.value == "")
	{
		alert("ÀüÃ¼°­ÀÇ ¼ö¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_sum.focus();
		return false;
	}

	if(form.lec_date.value == "")
	{
		alert("ÀüÃ¼ °­ÀÇ½Ã°£À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_date.focus();
		return false;
	}

	if(form.lec_price.value == "")
	{
		alert("°­ÀÇ ¿ø°¡¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_price.focus();
		return false;
	}

	if(form.lec_sale.value == "")
	{
		alert("°­ÀÇ ÆÇ¸Å°¡¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_sale.focus();
		return false;
	}

	if(form.lec_teach_code.value == "")
	{
		alert("´ã´ç °­»ç¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä");
 		return false;
	}

	//if(form.lec_book.value == "")
	//{
	//	alert("»ç¿ë ±³Àç¸¦ ÇÏ³ªÀÌ»ó ¼±ÅÃÇÏ¼Å¾ß ÇÕ´Ï´Ù.");
		//form.lec_book.focus();
	//	return false;
	//}
/*
	if(form.media_server.value == "")
	{
		alert("¹Ìµð¾î ¼­¹ö ÁÖ¼Ò¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		form.media_server.focus();
		return false;
	}

	if(form.media_start.value == "")
	{
		alert("ÇØ´ç °­ÀÇÀÇ °Ô½ÃÁöÁ¡À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.media_start.focus();
		return false;
	}

	if(form.media_fold.value == "")
	{
		alert("¿µ»ó ÆÄÀÏÀÌ À§Ä¡ÇÑ Æú´õ¸íÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.media_fold.focus();
		return false;
	}
*/
	
	
	var content = myeditor.outputBodyHTML();		

	form.lec_intro.value = content;

	if(form.lec_intro.value == "")
	{
		alert("»ó¼¼³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		//form.lec_intro.focus();
		return;
	}
	
	
	//if(form.lec_intro.value == "")
	//{
	//	alert("°­ÀÇ ¼Ò°³±ÛÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
	//	form.lec_intro.focus();
	//	return false;
	//}
	/*if(form.lec_detail.value == "")
	{
		alert("°­ÀÇ ¸ñÂ÷À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_detail.focus();
		return false;
	}
	if(form.lec_special.value == "")
	{
		alert("°­ÀÇ Æ¯Â¡À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_special.focus();
		return false;
	}*/

    form.submit();
}

// °ø±¸°­ÀÇ ±¸¼º Æû ½ºÅ©¸³Æ®
function chk_glecture()
{
	var form = document.frm;
 	 var y = form.cat.value;
	if (y==""){
		alert("Ä«Å×°í¸®¸¦ ¼±ÅÃÇØ ÁÖ¼¼¿ä")
		return;
	}
 

	if(form.lec_title.value == "")
	{
		alert("°­ÀÇ¸íÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_title.focus();
		return false;
	}

	if(form.lec_type.value == "")
	{
		alert("¼ö°­ ±â°£À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_type.focus();
		return false;
	}

	if(form.lec_sum.value == "")
	{
		alert("ÀüÃ¼°­ÀÇ ¼ö¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_sum.focus();
		return false;
	}

	if(form.lec_date.value == "")
	{
		alert("ÀüÃ¼ °­ÀÇ½Ã°£À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_date.focus();
		return false;
	}

	if(form.lec_price.value == "")
	{
		alert("°­ÀÇ ¿ø°¡¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_price.focus();
		return false;
	}

	if(form.lec_sale.value == "")
	{
		alert("°­ÀÇ ÆÇ¸Å°¡¸¦ ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_sale.focus();
		return false;
	}
 

	if(form.lec_intro.value == "")
	{
		alert("°­ÀÇ ¼Ò°³±ÛÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_intro.focus();
		return false;
	}
/*	if(form.lec_detail.value == "")
	{
		alert("°­ÀÇ ¸ñÂ÷À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_detail.focus();
		return false;
	}
	if(form.lec_special.value == "")
	{
		alert("°­ÀÇ Æ¯Â¡À» ÀÔ·ÂÇØ ÁÖ¼¼¿ä");
		form.lec_special.focus();
		return false;
	}
*/
    form.submit();
}

function send_code()
{
	place = document.frmSearch;	
	place.submit();
}

function list_search() {
 
   document.frmSearch.submit();
}


function fnPageSend(cPage)
{
	document.form.page.value = cPage;
	document.form.submit();
}


function funcAllCheck(obj)
{
	if(obj.id == "chkAll"){
		//obj.id = "chkNotAll";
			
		if(form.seqs.length){
			for(var i=0; i < form.seqs.length; i++){
				form.seqs[i].checked = true;
			}
		}
		else{
			form.seqs.checked = true;
		}
	}
	else{
		//obj.id = "chkAll";
			
		if(form.seqs.length){
			for(var i=0; i < form.seqs.length; i++){
				form.seqs[i].checked = false;
			}
		}
		else{
			form.seqs.checked = false;
		}
	}
}


function funcDelNote()
{
	var form = document.forms['form'];
	var obj;
	var cnt = 0;
	var seq = 0;
	var read = "";
	var save = "";
	var checked = false;
	
	if(form.seqs.length){
		cnt = form.seqs.length;
	}
	else{
		cnt = 1;
	}

	for(var i=0; i < cnt; i++){
		if(cnt > 1){
			obj = form.seqs[i];
		}
		else{
			obj = form.seqs;
		}

		if(obj.checked){ 
			checked = true;
		}
	}

	if(checked){
		var delOK = confirm("¼±ÅÃÇÏ½Å  Á¤º¸°¡ »èÁ¦ µË´Ï´Ù.\n\nÁ¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?");

		if(delOK){
			
			form.action = "book_chk_delete.asp";
			form.submit();
		}
	}
	else{
		alert("¼±ÅÃµÈ Ç×¸ñÀÌ ¾ø½À´Ï´Ù. ÇÏ³ª ÀÌ»ó ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}
}

 

//°­ÀÇ¼öÁ¤
function edit(lec_idx)
{ 
	document.form.action = "Lecture_edit.asp?mode=edit&lec_idx="+lec_idx;
	document.form.submit();
}
//°­ÀÇ¼öÁ¤
function editnew(lec_idx)
{ 
	document.form.action = "/G_lms/lecture/control.asp?mode=edit&lec_idx="+lec_idx;
	document.form.submit();
}

//°­ÀÇ»èÁ¦
function del(lec_code)
{
	if(confirm("¼±ÅÃÇÏ½Å °­ÀÇ Á¤º¸°¡ »èÁ¦µÇ¸ç º¹±¸ ÇÏ½Ç ¼ö ¾ø½À´Ï´Ù. \n\nÁ¤¸» »èÁ¦ÇÏ½Ã°Ú½À´Ï±î?")==0)
	{
		//alert("ÀÛ¾÷À» Ãë¼ÒÇÕ´Ï´Ù.");
		return;
	}
	else
	{
		document.form.lec_code.value = lec_code;
		document.form.action = "Lecture_Delete.asp";
		document.form.submit();
	}
}

//°­ÀÇÆÄÀÏµî·Ï
function MediaForm(lec_idx,lec_title)
{ 
	window.open("Lecture_Media_Form.asp?lec_idx="+lec_idx+"&lec_title="+lec_title,'LMF','scrollbars=yes,width=800,height=650');
 
}

//°­ÀÇ»ó¼¼º¸±â
function view(lec_idx)
{
	window.open('/Zero_admin/Lecture/Lecture_Detail.asp?lec_idx='+lec_idx,'LectureDetail','scrollbars=yes,width=705,height=650');

}

//±³Àç»ó¼¼º¸±â
//±³Àç»èÁ¦
function bookview(seq,bkid)
{
	window.open('book_view.asp?seq='+seq+'&bkid='+bkid,'BookDetail','scrollbars=yes,width=705,height=650');

}
//ÀÌ¹ÌÁö µî·Ï
 function FileUp(formname,name1,name2,dir,wid,hei)
	{
		var winl = (screen.width - wid) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
		var wint = (screen.height - hei) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ 

		window.open('/Common/UpLoad_Form.asp?formname='+formname+'&name1='+name1+'&name2='+name2+'&dir='+dir,'imgselect','top='+wint+',left='+winl+',width='+wid+',height='+hei+',scrollbars=yes');
	}

	//scm ÀÌ¹ÌÁö °³º° µî·Ï 
//'frm','lec_img3','<%=lec_idx%>','lecture',500,280
 function oneFileUp(formname,name1,lec_idx,dir,wid,hei)
	{
		 
		var winl = (screen.width - wid) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
		var wint = (screen.height - hei) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ 

		window.open('/Common/oneUpLoad_Form.asp?formname='+formname+'&name1='+name1+'&lec_idx='+lec_idx+'&dir='+dir,'imgselect','top='+wint+',left='+winl+',width='+wid+',height='+hei+',scrollbars=yes');
	}
	//scm °­ÀÇ ÀÌ¹ÌÁö ¼¼°³ ½æ³×ÀÏ µî·Ï
 function threeFileUp(formname,name1,lec_idx,dir,wid,hei)
	{
		var winl = (screen.width - wid) / 2;     //  430 : ¶Ù¿ï Ã¢ÀÇ Æø
		var wint = (screen.height - hei) / 2;   //  550 : ¶Ù¿ï Ã¢ÀÇ ³ôÀÌ 

		window.open('/Common/oneUpLoad_Form.asp?formname='+formname+'&name1='+name1+'&lec_idx='+lec_idx+'&dir='+dir,'imgselect','top='+wint+',left='+winl+',width='+wid+',height='+hei+',scrollbars=yes');
	}
//°ü¸®ÀÚ °øµ¿±¸¸Å °­ÀÇ ¼±ÅÃ °ª ³Ñ±â±â
function sel_lecture()
{
	var form = document.forms['form'];
	var obj;
	var cnt = 0;
	var seq = 0;
	var read = "";
	var save = "";
	var checked = false;
	
	if(form.seqs.length){
		cnt = form.seqs.length;
	}
	else{
		cnt = 1;
	}

	for(var i=0; i < cnt; i++){
		if(cnt > 1){
			obj = form.seqs[i];
		}
		else{
			obj = form.seqs;
		}

		if(obj.checked){ 
			checked = true;
		}
	}

	if(checked){
		var delOK = confirm("¼±ÅÃÇÏ½Å °­ÀÇ°¡ °øµ¿±¸¸Å·Î µî·ÏµË´Ï´Ù.\n\n µî·Ï ÇÏ½Ã°Ú½À´Ï±î?");

		if(delOK){
			
			form.action = "G_control_sel.asp?mode=add";
			form.submit();
		}
	}
	else{
		alert("¼±ÅÃµÈ °­ÀÇ°¡ ¾ø½À´Ï´Ù. ÇÏ³ª ÀÌ»ó ¼±ÅÃÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù.");
	}
}

//1Â÷ Ä«Å×°í¸®
function GetInfo()
{
	var C1 = document.frm.C1.options[document.frm.C1.selectedIndex].value;
	var pageUrl = "/Common/Lecture_C2_Search.asp?C1=" + C1; 
	var xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
	xmlRequest.Open("POST", pageUrl, false);
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 
	xmlRequest.onreadystatechange = function() {CallBack(xmlRequest)};;
	xmlRequest.Send(null);
	
	return xmlRequest;	
 }

function CallBack(xmlRequest)
{
	if (xmlRequest == null || xmlRequest.readyState != 4) return;
	
	if(xmlRequest.responseText.length == 0)
	{
		document.frm.C2.options.length = 0;
		document.frm.C2.options[0] = new Option("µî·ÏºÐ·ù¾øÀ½","0");
		document.frm.C3.options.length = 0;
		document.frm.C3.options[0] = new Option("µî·ÏºÐ·ù¾øÀ½","0");
		document.frm.C4.options.length = 0;
		document.frm.C4.options[0] = new Option("µî·ÏºÐ·ù¾øÀ½","0");
		return;
	}
	
	var vals = xmlRequest.responseText.split(":");

	document.frm.C2.options.length = 0;
	for(var i=0;i<vals.length;i++) 
	{		
		var arr_vals = vals[i].split(".");
		document.frm.C2.options[i] = new Option(arr_vals[1],arr_vals[0]);  
	}
}


//2Â÷Ä«Å×°í¸®
function GetInfo2()
{
	var C1 = document.frm.C1.options[document.frm.C1.selectedIndex].value;
	var C2 = document.frm.C2.options[document.frm.C2.selectedIndex].value;
	var pageUrl = "/Common/Lecture_C3_Search.asp?C1=" + C1 +"&C2=" + C2 ;
 	var xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
	xmlRequest.Open("POST", pageUrl, false);
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlRequest.onreadystatechange = function() {CallBack2(xmlRequest)};;
	xmlRequest.Send(null);
	
	return xmlRequest;			
}

function CallBack2(xmlRequest)
{
	if (xmlRequest == null || xmlRequest.readyState != 4) return;
	if(xmlRequest.responseText.length == 0)
	{
		document.frm.C3.options.length = 0;
		document.frm.C3.options[0] = new Option("µî·ÏºÐ·ù¾øÀ½","0"); 
		document.frm.C4.options.length = 0;
		document.frm.C4.options[0] = new Option("µî·ÏºÐ·ù¾øÀ½","0"); 
		return;
	}
	
	var vals = xmlRequest.responseText.split(":");

	document.frm.C3.options.length = 0;
	for(var i=0;i<vals.length;i++) 
	{		
		var arr_vals = vals[i].split(".");
		document.frm.C3.options[i] = new Option(arr_vals[1],arr_vals[0]);  
	}
}


//3Â÷ Ä«Å×°í¸®
function GetInfo3()
{
	var C1 = document.frm.C1.options[document.frm.C1.selectedIndex].value;
	var C2 = document.frm.C2.options[document.frm.C2.selectedIndex].value;
	var C3 = document.frm.C3.options[document.frm.C3.selectedIndex].value;
//	alert(C1 + C2 + C3)
	var pageUrl = "/Common/Lecture_C4_Search.asp?C1=" + C1 +"&C2=" + C2 +"&C3=" + C3;
	
	var xmlRequest = new ActiveXObject("Microsoft.XMLHTTP");
	xmlRequest.Open("POST", pageUrl, false);
	xmlRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlRequest.onreadystatechange = function() {CallBack3(xmlRequest)};;
	xmlRequest.Send(null);
	
	return xmlRequest;			
}

function CallBack3(xmlRequest)
{
	if (xmlRequest == null || xmlRequest.readyState != 4) return;
	if(xmlRequest.responseText.length == 0)
	{
		
		document.frm.C4.options.length = 0;
		document.frm.C4.options[0] = new Option("µî·ÏºÐ·ù¾øÀ½","0"); 
		return;
	}
	
	var vals = xmlRequest.responseText.split(":");

	document.frm.C4.options.length = 0;
	for(var i=0;i<vals.length;i++) 
	{		
		var arr_vals = vals[i].split(".");
		document.frm.C4.options[i] = new Option(arr_vals[1],arr_vals[0]);  
	}
}

//³¯Â¥ ¼±ÅÃÇÏ±â
 function sel_day(str1,str2){
	window.open ("/G_calendar/calendar_sel.asp?formname="+str1+"&name1="+str2,"seldate","width=170 height=190")
}
 
//°ø±¸ ¹× ÆÐÅ°Áö °­ÀÇ °¡°Ý º¯°æ 
function ChkMoneyPkg(idx) {  //  ¹øÈ£¸¦ ¹Þ¾Æ¼­ 
 
  var plec_price= eval("frm.plec_price"+idx+".value");
  var plec_pricef=  eval("frm.plec_price"+idx);
  var plec_dis= eval("frm.plec_dis"+idx+".value");
  var plec_disf=  eval("frm.plec_dis"+idx );
  var plec_sale= eval("frm.plec_sale"+idx+".value");
  var plec_salef=  eval("frm.plec_sale"+idx );


 
	if(plec_price == "") plec_price = 0;
	if(plec_dis == "") plec_dis = 0;
	if(plec_sale == "") plec_sale = 0;
 
	if(CheckNum(plec_price) == false) 
	{
		alert("ÆÇ¸Å°¡¸¦ ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä."); 
		return false;
	}

	if(CheckNum(plec_dis) == false) 
	{
		alert("¸¶ÁøÀ²Àº ¼ýÀÚ·Î¸¸ ÀÔ·ÂÇØÁÖ¼¼¿ä."); 
		return false;
	}
 
	if(plec_price == 0) plec_sale = 0;
	else plec_sale = parseInt(plec_price) - ((parseInt(plec_price)/100)*parseInt(plec_dis))
     plec_sale = parseInt(plec_sale/100 )*100;
	 plec_salef.value  = plec_sale ;
	 
  
}
 

 