///////// ¿ø°ÝÈÆ·Ã±³À° ºä¾î /////////
function viewer_remote(lec_idx,idx)
{
	window.open('/Inc/lecture_view/gisa_sil/chap01/01.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=900,height=640,left=0,top=0');
}
///////// ¿ø°ÝÈÆ·Ã±³À° ºä¾î /////////


///////// ¿ø°ÝÈÆ·Ã±³À° ºä¾î /////////
function remote720404(lec_idx,idx)
{
	window.open('/Inc/lecture_view/gisa_sil/chap01/01.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=900,height=640,left=0,top=0');
}
///////// ¿ø°ÝÈÆ·Ã±³À° ºä¾î /////////


///////// ¿ø°ÝÈÆ·Ã±³À° ºä¾î /////////
function remote720404_sample(lec_idx,idx)
{
	window.open('/Inc/lecture_view/gisa_sil/chap01_sample/01.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=900,height=640,left=0,top=0');
}
///////// ¿ø°ÝÈÆ·Ã±³À° ºä¾î /////////




///////// °­ÀÇ ºä¾î /////////

function viewer_640480(p_idx,lec_idx,idx,a_code)
{
	window.open('/Inc/lecture_view/view640480.asp?p_idx='+p_idx+'&lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code,'view','width=935,height=722,left=0,top=0');
}

function viewer_720404(p_idx,lec_idx,idx,a_code,CH)
{
	window.open('/Inc/lecture_view/view720404.asp?p_idx='+p_idx+'&lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code+'&CH='+CH,'view','width=1000,height=580,left=0,top=0');
}

function viewer_800600(p_idx,lec_idx,idx,a_code)
{
	window.open('/Inc/lecture_view/view800600.asp?p_idx='+p_idx+'&lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code,'view','width=836,height=684,left=0,top=0');
}
///////// °­ÀÇ ºä¾îº¸±â /////////


///////// ½Ç¹ö¶óÀÌÆ® ºä¾îº¸±â /////////
function viewer_silverlight_640480(p_idx,lec_idx,idx,a_code,CH)
{
	window.open('/Inc/silverlight/silverlight_view_640480.asp?p_idx='+p_idx+'&lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code+'&CH='+CH,'view','width=640,height=480,left=0,top=0');
}

function viewer_silverlight_720404(p_idx,lec_idx,idx,a_code,CH)
{
	window.open('/Inc/silverlight/silverlight_view_720404.asp?p_idx='+p_idx+'&lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code+'&CH='+CH,'view','width=720,height=404,left=0,top=0,scrollbars=1');

}

function viewer_silverlight_800600(p_idx,lec_idx,idx,a_code,CH)
{
	window.open('/Inc/silverlight/silverlight_view_800600.asp?p_idx='+p_idx+'&lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code+'&CH='+CH,'view','width=800,height=600,left=0,top=0');
}
///////// ½Ç¹ö¶óÀÌÆ® ºä¾îº¸±â /////////





///////// ±¸°­ÀÇ ºä¾î /////////
function old_viewer_640480(lec_idx,idx,a_code)
{
	window.open('/Inc/lecture_view/old_lecture_view640480.asp?lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code,'view','width=955,height=663,left=0,top=0');
}

function old_viewer_720404(lec_idx,idx,a_code)
{
	window.open('/Inc/lecture_view/old_lecture_view720404.asp?lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code,'view','width=1000,height=580,left=0,top=0');
}

function old_viewer_800600(lec_idx,idx,a_code)
{
	window.open('/Inc/lecture_view/old_lecture_view800600.asp?lec_idx='+lec_idx+'&idx='+idx+'&a_code='+a_code,'view','width=825,height=750,left=0,top=0');
}
///////// ±¸°­ÀÇ ºä¾îº¸±â /////////



///////// old°­ÀÇ ºä¾î /////////
function viewer_old640480(lec_idx,idx)
{
	window.open('/Inc/lecture_view/lecture_oldview640480.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=642,height=550,left=0,top=0');
}

function viewer_old720404(lec_idx,idx)
{
	window.open('/Inc/lecture_view/lecture_oldview720404.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=722,height=505,left=0,top=0');
}

function viewer_old800600(lec_idx,idx)
{
	window.open('/Inc/lecture_view/lecture_oldview800600.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=800,height=630,left=0,top=0');
}
///////// old°­ÀÇ ºä¾î /////////


///////// ¼ÀÇÃ°­ÁÂ ºä¾î /////////

//function view_sample_640480(lec_idx,idx)
//{
//	window.open('/Inc/lecture_view/lecture_view_sample_640480.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=955,height=663,left=0,top=0');
//}


function viewer_sample_640480(lec_idx,idx)
{
	window.open('/Inc/lecture_view/view_sample640480.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=935,height=722,left=0,top=0');
}

//function viewer_sample_720404(lec_idx,idx)
//{
//	window.open('/Inc/lecture_view/lecture_view_sample_720404.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=1000,height=580,left=0,top=0');
//}


function viewer_sample_720404(lec_idx,idx)
{
	window.open('/Inc/lecture_view/view_sample720404.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=1000,height=630,left=0,top=0');
}

function viewer_sample_800600(lec_idx,idx)
{
	window.open('/Inc/lecture_view/view_sample800600.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=836,height=784,left=0,top=0');
}
///////// ¼ÀÇÃ°­ÁÂ ºä¾îº¸±â /////////


///////// ±¸°­ÀÇ ¼ÀÇÃ°­ÁÂ ºä¾î /////////
function old_viewer_sample_640480(lec_idx,idx)
{
	window.open('/Inc/lecture_view/old_lecture_view_sample_640480.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=955,height=663,left=0,top=0');
}

function old_viewer_sample_720404(lec_idx,idx)
{
	window.open('/Inc/lecture_view/old_lecture_view_sample_720404.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=1000,height=580,left=0,top=0');
}

function old_viewer_sample_800600(lec_idx,idx)
{
	window.open('/Inc/lecture_view/old_lecture_view_sample_800600.asp?lec_idx='+lec_idx+'&idx='+idx,'view','width=825,height=750,left=0,top=0');
}
///////// ±¸°­ÀÇ ¼ÀÇÃ°­ÁÂ ºä¾îº¸±â /////////

///////// Àå¹Ù±¸´Ï /////////

//±³Àç°¡ ¾øÀ»¶§
function cart_action(lec_idx,biz) 
{

	var biz;
	var lec_idx;
	var frm = document.buyfrm;
	var a_book_id;

	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_biz='+biz,'view','width=390,height=250,left=100,top=100');
//	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_book_id='+a_book_id,'view','width=390,height=250,left=100,top=100');

}

//±³Àç°¡ 1±ÇÀÏ¶§
function cart_action1(lec_idx,biz) 
{
	var biz;
	var lec_idx;
	var frm = document.buyfrm;
	var a_book_id;


	a_book_id = frm.bookbox.value;
	if (frm.bookbox.checked==true)
	{
	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_book_id='+a_book_id+'&a_biz='+biz,'view','width=390,height=250,left=100,top=100');
	}
	else
	{
	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_biz='+biz,'view','width=390,height=250,left=100,top=100');
	}
}

//±³Àç°¡ 2±ÇÀÏ¶§
function cart_action2(lec_idx) 
{
	var biz;
	var lec_idx;
	var frm = document.buyfrm;

	var a_book_id;
	a_book_id0 = frm.bookbox[0].value
	a_book_id1 = frm.bookbox[1].value

	if (frm.bookbox[0].checked==true && frm.bookbox[1].checked==true)
	{
	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_book_id='+a_book_id0+","+a_book_id1+'&a_biz='+biz,'view','width=390,height=250,left=100,top=100');
	}
	else if (frm.bookbox[0].checked==true)
	{
	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_book_id='+a_book_id0+'&a_biz='+biz,'view','width=390,height=250,left=100,top=100');
	}
	else if (frm.bookbox[1].checked==true)
	{
	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_book_id='+a_book_id1+'&a_biz='+biz,'view','width=390,height=250,left=100,top=100');
	}
	else
	{
	window.open('pop_cart.asp?lec_idx='+lec_idx+'&a_biz='+biz,'view','width=390,height=250,left=200,top=200');
	}
}
///////// Àå¹Ù±¸´Ï /////////

function check_bookadd() 
{
	var frm = document.buyfrm;
	
	var lprice = frm.lec_price.value;
	var bprice = frm.book_price.value; 

	if (frm.bookbox.checked == true)
	{
	sumprice = parseInt(lprice) + parseInt(bprice) ;
	var finalStr = comma(sumprice)
	frm.lecture_buy_price.value=finalStr+ " ¿ø " ;
	frm.real_price.value = sumprice;
	}

	else
	{
	sumprice = parseInt(lprice)   ; 
	var finalStr = comma(sumprice)
	frm.lecture_buy_price.value=finalStr + " ¿ø " ;
	frm.real_price.value = sumprice;
	}
}

//±âº»°¡°Ý
function check_buy_price() {
	var frm = document.buyfrm;
	var lprice = frm.lec_price.value;
	var finalStr = comma(lprice)
	frm.lecture_buy_price.value=finalStr + " ¿ø " ;
	frm.real_price.value = lprice;
}

// °¡°Ý¿¡ ÄÞ¸¶ºÙÀÌ±â
function comma(sumprice){
	var str = sumprice+'';
	var leng = str.length;
	var finalStr = '';
	var pos = 1;
	var comma = '';

	for(leng; leng>0; leng--){
		try{
			if(pos>3){
				pos = 1;
			}

		if(pos==3){
			if(str.length>1){
			comma = ',';
			}else{
			comma = '';
			}
		}else{
			comma = '';
		}

		finalStr = comma+str.substr(str.length-1)+finalStr;
		str = str.substr(0,str.length-1);

		pos++;
		}catch (e){
		alert(e);
		}
	} 
	return finalStr;
}


function order_partn(){
	var frm = document.Cartfrm;
	var lecitem;

	if(frm.lec_idx.length>1)
	{
		for(var i=0; i < frm.lec_idx.length; i++)
		{
			if (frm.lec_idx[i].checked == true)
			{
				lecitem="Y";	
			}  
		}
	}
	else
	{
		if (frm.lec_idx.checked == true)
		{
			lecitem="Y";	
		}  
	}

	if (lecitem == "Y")
	{
		frm.action = "/all/order_buy.asp";
		frm.submit();
	}
	else
	{
		alert("ÇÏ³ª ÀÌ»óÀÇ °­ÀÇ¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.");
		return false; 
	}
}

///////// ±³Àç°¡ ¾øÀ»¶§ °áÀç¼±ÅÃ ////////
function shop_result1()
{
	var theForm = document.order_buy;
	var frmSpace = /^\s/;
	var str = ""
	for (i=0; i<theForm.paytype.length; i++)
	{
		if(theForm.paytype[i].checked == true) 
		{
		str = theForm.paytype[i].value
		}
	}

	if(str == "")
	{
	alert('°áÀç ¹æ¹ýÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.');
	theForm.paytype[0].focus();
	return false;
	}

	else if (str == "Card")
	{
		theForm.action="http://pg.dacom.net/card/cardAuthAppInfo.jsp";
//		theForm.action="http://pg.dacom.net:7080/card/cardAuthAppInfo.jsp";
		window.open("","Card","width=330, height=430, status=no, scrollbars=no,resizable=no, menubar=no");
		theForm.target = "Card";
		theForm.submit();
	}

	else if (str == "Mobile")
	{
		theForm.action= "http://pg.dacom.net/wireless/wirelessAuthAppInfo1.jsp";
		window.open("", "Mobile", "width=330, height=430, scrollbars=no,status=no, resizable=no,menubar=no");
		theForm.target = "Mobile";
		theForm.submit();
	}

	else if (str == "OnLineBank")
	{
		theForm.action= "http://pg.dacom.net/transfer/transferSelectBank.jsp";
		window.open("", "OnLineBank", "width=330, height=430, scrollbars=no,status=no, resizable=no,menubar=no");
		theForm.target = "OnLineBank";
		theForm.submit();
	}

	else if (str == "Bank") 
	{
		if(theForm.cash_back[0].checked)
		{
			if(theForm.user_type.value=="")
			{
				alert('¿ëµµ¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.');
				theForm.user_type.focus();
				return false;
			}

			if(theForm.selectno.value=="")
			{
				alert('ÀÔ·Â¹øÈ£¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.');
				theForm.selectno.focus();
				return false;
			}

			if(theForm.social_business_no.value=="")
			{
				alert('¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
				theForm.social_business_no.focus();
				return false;
			}
		}

		theForm.action= "/all/order_buy_proc.asp";
		theForm.submit();
	}
}

///////// ±³Àç°¡ ÀÖÀ»¶§ °áÀç¼±ÅÃ ////////
function shop_result2()
{
	var theForm = document.order_buy;
	var frmSpace = /^\s/;

	if(theForm.receiver.value=="")
	{
		alert('¼ö·ÉÀÎÀ» ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		theForm.receiver.focus();
		return false;
	}
	if(theForm.producttype.value=="")
	{
		alert('¿ìÆí¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		theForm.producttype.focus();
		return false;
	}
	if(theForm.buyeraddress.value=="")
	{
		alert('ÁÖ¼Ò¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
		theForm.buyeraddress.focus();
		return false;
	}

	if(theForm.receiverphone.value==""){
	alert('¿¬¶ô¹øÈ£¸¦ ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇÏ½Ê½Ã¿À.');
	theForm.receiverphone.focus();
	return false;
	}
	
//	if(theForm.buyerssn.value==""){
//	alert('ÈÞ´ëÆù¹øÈ£¸¦ ¿Ã¹Ù¸£°Ô ÀÔ·ÂÇÏ½Ê½Ã¿À.');
//	theForm.buyerssn.focus();
//	return false;
//	}

	var str = ""
	for (i=0; i<theForm.paytype.length; i++)
	{
		if(theForm.paytype[i].checked == true) 
		{
		str = theForm.paytype[i].value
		}
	}

	if(str == "")
	{
	alert('°áÀç ¹æ¹ýÀ» ¼±ÅÃÇØ ÁÖ¼¼¿ä.');
	theForm.paytype[0].focus();
	return false;
	}

	else if (str == "Card")
	{
		theForm.action="http://pg.dacom.net/card/cardAuthAppInfo.jsp";
//		theForm.action="http://pg.dacom.net:7080/card/cardAuthAppInfo.jsp";
		window.open("","Card","width=330, height=430, status=no, scrollbars=no,resizable=no, menubar=no");
		theForm.target = "Card";
		theForm.submit();
	}

	else if (str == "Mobile")
	{
		theForm.action= "http://pg.dacom.net/wireless/wirelessAuthAppInfo1.jsp";
		window.open("", "Mobile", "width=330, height=430, scrollbars=no,status=no, resizable=no,menubar=no");
		theForm.target = "Mobile";
		theForm.submit();
	}

	else if (str == "OnLineBank")
	{
		theForm.action= "http://pg.dacom.net/transfer/transferSelectBank.jsp";
		window.open("", "OnLineBank", "width=330, height=430, scrollbars=no,status=no, resizable=no,menubar=no");
		theForm.target = "OnLineBank";
		theForm.submit();
	}

	else if (str == "Bank") 
	{
		if(theForm.cash_back[0].checked)
		{
			if(theForm.user_type.value=="")
			{
				alert('¿ëµµ¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.');
				theForm.user_type.focus();
				return false;
			}

			if(theForm.selectno.value=="")
			{
				alert('ÀÔ·Â¹øÈ£¸¦ ¼±ÅÃÇØÁÖ¼¼¿ä.');
				theForm.selectno.focus();
				return false;
			}

			if(theForm.social_business_no.value=="")
			{
				alert('¹øÈ£¸¦ ÀÔ·ÂÇØÁÖ¼¼¿ä.');
				theForm.social_business_no.focus();
				return false;
			}
		}

		theForm.action= "/all/order_buy_proc.asp";
		theForm.submit();
	}
}
///////// °áÁ¦¼±ÅÃ ////////



function ansStep1(str){
	var theForm = document.form;
	var frmSpace = /^\s/;
	var str

	theForm.action = "/inc/lecture_view/gisa_sil/chap01/04_iframe_al.asp?Input_Type="+str
	theForm.submit();
}


function ansStep2(str){
	var theForm = document.form;
	var frmSpace = /^\s/;
	var str

	theForm.action = "/inc/lecture_view/gisa_sil/chap01/04_iframe.asp?Input_Type="+str
	theForm.submit();
}
