/* ÀÌ¹ÌÁö ·Ñ¿À¹ö ¿ë start */
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.0
  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 && document.getElementById) x=document.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 MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
// ¸Þ´º ·Ñ¿À¹ö½Ã ÇÏÀ§ ¸Þ´º ³ª¿À°Ô ÇÏ±â
function	div_mn(div) {
   for (i=1;i<5;i++) {
	   var objmy= eval("document.all.mn0"+i);	
      if (i== div) {		
		  objmy.style.display='';
		} else {
		  objmy.style.display='none';
		}
   }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

/* ÀÌ¹ÌÁö ·Ñ¿À¹ö ¿ë end */
/* ¼ýÀÚÅ°¸¸ Çã¿ë */
function onlyNumber(){
	
	//keydown ÀÌº¥Æ®°¡ ¹ß»ýÇÏ¸é ¼ýÀÚ(48 <= keycode <= 57)¿Í backspace, delete, ÁÂ¿ì ¹æÇâÅ°, tab, ¼ýÀÚÆÐµåÀÇ ÁÂ¿ì¹æÇâÅ°¸¸ trueÀÌ°í ³ª¸ÓÁö´Â false
	if(((event.keyCode>=48)&&(event.keyCode<=57))||((event.keyCode>=96)&&(event.keyCode<=105))||(event.keyCode==8||event.keyCode==9||event.keyCode==37||event.keyCode==39||event.keyCode==46||event.keyCode==13)){
		event.returnValue=true;
	}else{
		event.returnValue=false;
	}
}

/* ¸ÞÀÎÆäÀÌÁö·Î ÀÌµ¿ */
function GoHome(){
	top.location="/";
}
/* °øÅë ÆË¾÷
   º» ÆË¾÷½ºÅ©¸³Æ®´Â ÆË¾÷Ã¢ÀÌ ºü¸£°Ô ¶ß°Ô ÇÏ±âÀ§ÇØ¼­ ÀÛ¼ºµÇ¾ú´Ù.
   but ÇÏ³ª ÀÌ»óÀÇ ÆË¾÷Ã¢ÀÌ ¶ßÁö ¾Ê´Â ´ÜÁ¡ÀÌ ÀÖ´Ù.
       ¶ÇÇÏ³ªÀÇ ÆË¾÷À» ¶ç¿ì±â À§ÇØ¼­´Â ¾Æ·¡ÀÇ CommPopup2¸¦ »ç¿ëÇÑ´Ù.
CommPopup(URL, Width, Height, ScrollBar)
URL : ÀÌµ¿°æ·Î
Width : °¡·ÎÅ©±â
Height : ¼¼·ÎÅ©±â
ScrollBar : ½ºÅ©·Ñ¹Ù »ç¿ë¿©ºÎ
*/
var Popup=null;
function CommPopup(URL, Width, Height, ScrollBar, Resizable) {
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width/2) - 450;
	iMyHeight = (window.screen.height/2) - 350;

	if(Popup != null && !Popup.closed) Popup.close();
	src=URL;
	if(!ScrollBar) ScrollBar = no;
	if(!Resizable) Resizable = no;
	etc = 'toolbar=no,location=no,status=no,scrollbars=' + ScrollBar + ',width=' + Width + ',height=' + Height + ',resizable=' + Resizable + ",left=" + iMyWidth + ",top=" + iMyHeight
	Popup = window.open(src,'', etc);
	Popup.window.focus();
}

/* °øÅë ÆË¾÷2
   ÆË¾÷À» µÎ°³ÀÇ Ã¢À» ¶ç¿ö¾ßÇÑ´Ù¸é »ç¿ë
CommPopup(URL, Width, Height, ScrollBar)
URL : ÀÌµ¿°æ·Î
Width : °¡·ÎÅ©±â
Height : ¼¼·ÎÅ©±â
ScrollBar : ½ºÅ©·Ñ¹Ù »ç¿ë¿©ºÎ
*/
var Popup2=null;
function CommPopup2(URL, Width, Height, ScrollBar, Resizable) {
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width/2) - 450;
	iMyHeight = (window.screen.height/2) - 350;

	if(Popup2 != null && !Popup2.closed) Popup2.close();
	src=URL;
	if(!ScrollBar) ScrollBar = no;
	if(!Resizable) Resizable = no;
	etc = 'toolbar=no,location=no,status=no,scrollbars=' + ScrollBar + ',width=' + Width + ',height=' + Height + ',resizable=' + Resizable + ",left=" + iMyWidth + ",top=" + iMyHeight
	Popup2 = window.open(src,'', etc);
	Popup2.window.focus();
}

function go_message() { //¸¶ÀÌ»µ²Ù±â
	var URL, Width, Height, ScrollBar, Resizable;
	URL = "/message/";
	Width = "530";
	Height = "480";
	ScrollBar = "no";
	Resizable = "no";
	CommPopup(URL, Width, Height, ScrollBar, Resizable);
}

function Calendar(FormName, Position) { //¸¶ÀÌ»µ²Ù±â
	var URL, Width, Height, ScrollBar, Resizable;
	URL = "/include/cal/calendar.asp?FormName=" + FormName + "&Position=" + Position;
	Width = "290";
	Height = "300";
	ScrollBar = "no";
	Resizable = "no";
	CommPopup(URL, Width, Height, ScrollBar, Resizable);
}



var lecture_win = "" ;
function Open_Lecture(theURL,winName,features) { //v2.0
 
  if ( lecture_win == "") {
 
	lecture_win = window.open(theURL,winName,features);
  }
  else {
  
	if (lecture_win.closed) {
	
		lecture_win = window.open(theURL,winName,features);
		
	}
	else {
		if (confirm("±âÁ¸ ÇÐ½ÀÃ¢ÀÌ ¿­·Á ÀÖ½À´Ï´Ù. »õ·Î ¼±ÅÃÇÑ °ú¸ñÀÇ ÇÐ½ÀÃ¢À» ¶ç¿ì½Ã°Ú½À´Ï±î? ") == true ) {
			lecture_win.close();
			lecture_win = window.open(theURL,winName,features);
		}
	}
  }
}


var contents_win = "" ;
function Open_Contents(theURL,winName,features) { //v2.0
 
  if ( contents_win == "") {
 
	contents_win = window.open(theURL,winName,features);
  }
  else {
  
	if (contents_win.closed) {
	
		contents_win = window.open(theURL,winName,features);
		
	}
	else {
		if (confirm("±âÁ¸ ÄÁÅÙÃ÷ ºä¾î Ã¢ÀÌ ¿­·Á ÀÖ½À´Ï´Ù. »õ·Î ¼±ÅÃÇÑ ÁÖÂ÷ÀÇ ÄÁÅÙÃ÷ ºä¾î Ã¢À» ¶ç¿ì½Ã°Ú½À´Ï±î? ") == true ) {
			contents_win.close();
			contents_win = window.open(theURL,winName,features);
		}
	}
  }
}



//½Å¿ëÄ«µå °áÁ¦ ¹öÆ° Å¬¸¯½Ã--------------------------------
function btnPayReg(C_CODE,CO_CODE){
	window.open("/order/INIsecurepayReg.asp?C_CODE=" + C_CODE + "&CO_CODE=" + CO_CODE, "iniWin","left=100,top=0,width=650,height=700,scrollbars=yes" );
}

//¼ö°­½ÅÃ» ¹öÆ° Å¬¸¯½Ã--------------------------------
function btnLectureReg(C_CODE,CO_CODE){
	//window.open("/order/INIsecurepayReg.asp?C_CODE=" + C_CODE + "&CO_CODE=" + CO_CODE, "iniWin","left=100,top=0,width=650,height=700,scrollbars=yes" );

	
	var CH_UNIT,CH_CODE  // °­ÁÂ½ÅÃ»ÀÎÁö Ã©ÅÍº° ½ÅÃ»ÀÎÁö ±¸ºÐÃ³¸®
	CH_UNIT = "ALL";
	CH_CODE = "";

	var URL, Width, Height, ScrollBar, Resizable;
	URL = "/curry/curry03.asp?C_CODE="+C_CODE+"&CO_CODE="+CO_CODE+"&CH_UNIT=" + CH_UNIT + "&CH_CODE=" + CH_CODE;
	Width = "635";
	Height = "510";
	ScrollBar = "no";
	Resizable = "no";
	CommPopup(URL, Width, Height, ScrollBar, Resizable);


}


function go_my_studyroom(CO_CODE,C_CODE,ST_CODE,C_NAME,MEMBER_ID,MEMBER_NAME){ //³ªÀÇ ÇÐ½ÀÃ¢..ÆË¾÷..

	var URL, Width, Height, ScrollBar, Resizable;
	URL = "http://studywindow.godpia.com/studyroom_set.asp?CO_CODE=" + CO_CODE + "&C_CODE=" + C_CODE + "&ST_CODE=" + ST_CODE + "&C_NAME=" + C_NAME + "&MEM_ID=" + MEMBER_ID + "&MEM_NAME=" + MEMBER_NAME;
	Width = "890";
	Height = "640";
	ScrollBar = "no";
	Resizable = "no";
	CommPopup(URL, Width, Height, ScrollBar, Resizable);


}
