
function option_input()
	{
		with(document.bodyFrm)
		{
			if(etcEmail.value != "")
			{
				m_email2.options[0] = new Option(etcEmail.value,"@"+etcEmail.value,1,1);
			}
		}
	}


function return_email_input(str)
	{
		document.bodyFrm.etcEmail.value = str;
	}

function email_input()
	{
		window.open('/include/search/search_mail.asp','email', 'toolbar=0,status=0,menubars=0,scrollbars=no,resizable=0,location=0,directories=0,width=367,height=180');
	}


function email_select()
	{
		with(document.bodyFrm)
		{
			if(m_email2.value == "etc")
			{
				email_input();
			}
		}
	}	

function MailCheck(ObjMail)
{

	if (ObjMail.search(/(\S+)@(\S+)\.(\S+)/) == -1 ) 
	{
	    return false;    
	}
	return true;
}


//Ã·ºÎÆÄÀÏ º¸±â
function image_view(fd, i)
{
	window.open ("/include/image_view_name.asp?fd=" + fd + "&fname=" + i,"img", "width=100, height=100");
}


function inputsName(str)
	{
		with(document.bodyFrm)
		{
		

			var split_var = str.split(":");
				


			s_name.value = split_var[0];
			s_id.value = str[1];

		}
	}


/// ¿µ¹®°ú ¼ýÀÚ¸¸ ÀÔ·Â ¹Þ°Ô
function onlyNumberalpha( str, m ) {

   var flag = false;
   var onlyNumberalpha= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 -";
  
   for(i=0; i<str.value.length;i++) {

	 if(onlyNumberalpha.indexOf(str.value.substring(i, i+1)) == -1){	
		alert("Please enter 4~20 of small letters and Arabic numbers for " + m);
		str.focus();	
		flag = true;
		break;
	  }
	  
    }
    return flag;
   
}   




/// ¼ýÀÚ¸¸ ÀÔ·Â ¹Þ°Ô
function onlyNumber( str, m ) {
   var flag = false;
   var onlyNumber= "1234567890";
  
   for(i=0; i<str.value.length;i++) {

	 if(onlyNumber.indexOf(str.value.substring(i, i+1)) == -1){	
		alert("Please enter 4~20 of numbers for" + m);
		str.focus();	
		flag = true;
		break;
	  }
	  
    }
    return flag;
   
}   



/// ÀÚ¸®¼ö Ã¼Å©
function CheckLen( str, start, end, strK ) {
	var flag = false;

	if ( str.value.length < start && str.value.length < end ) {
			alert(strK + "Àº(´Â)" +start + "~" + end + "ÀÚ ÀÌ³»·Î ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À");
			str.focus();	
			flag = true;
   }

   return flag;
}


function input_Addr(z, a)
	{		
		
		with(document.bodyFrm)
		{
			var str = z.split("-");
			h_zip1.value = str[0];
			h_zip2.value = str[1];
			address.value = a;
			address.focus();
		}
	}

function inputId(str)
	{
		with(document.bodyFrm)
		{
			m_id.value = str;
			idCheckVal.value = 1;
		}
	}

// ÁÖ¼Ò ÀÔ·Â
function open_addr()
	{
		window.open("/include/search/search_addr.asp","","toolbar=0,status=0,menubars=0,scrollbars=no,resizable=0,location=0,directories=0,width=351,height=400")
	}

//ÀÚ³àÃ£±â
function go_soncheck()
	{
		window.open("/include/search/sonsearch.asp","","toolbar=0,status=0,menubars=0,scrollbars=no,resizable=0,location=0,directories=0,width=351,height=410")
	}


// ¾ÆÀÌµð Áßº¹ È®ÀÎ
function idInsertCheck(f)
	{
		var str;
		with(f)	
		{
			
			if(m_id.value.length < 4 || m_id.value.length > 20 || m_id.value == "")
				{	
					alert("Please enter 4~20 of small letters and Arabic numbers for member¡¯s I.D.");
					m_id.select();
					m_id.focus();
					return false;
				}

			if(m_id.value.indexOf(" ") >= 0)
				{
					alert("There must not be any blank in member¡¯s I.D.");
					m_id.select();
					m_id.focus();
					return false;
				}
			if(m_id.value.toLowerCase() == "guest" || m_id.value.toLowerCase() == "admin")
				{							-
					alert('"' + m_id.value + '"Sorry but you can not use this as your I.D.');
					m_id.select();
					m_id.focus();
					return false;
				}

		var RegExp = /[^\w]/;
		str = m_id.value;

			if (RegExp.test(str))
				{
					alert("Only 4~12 of small letters and Arabic numbers are available.");
					m_id.select();
					m_id.focus();
					return false;
				}
				
	window.open("/include/search/search_id.asp?m_id=" + m_id.value,"","toolbar=0,status=0,menubars=0,scrollbars=no,resizable=0,location=0,directories=0,width=330,height=200")
		}
}




function member_division (d)
{
	document.all.teacher.style.display = "none";
	document.all.student.style.display = "none";
	document.all.parent.style.display = "none";
	
	if (d == 99 )	//ÀçÇÐ»ý
	{
	document.all.student.style.display = "" ;
	}
	else if (d == 30)		//±³Á÷¿ø
	{
	document.all.teacher.style.display = "";
	}
	else if (d == 40)		//ÇÐºÎ¸ð
	{
	document.all.parent.style.display = "";
	}
}



//student_gubun

// ÀÌ¹ÌÁö ÆË¾÷ º¸±â
		function fileView(str)
		{			
			var maxWidth = screen.width;
			var maxHeight = screen.height - 120;
			var objImg = new Image();
			objImg.src = str;
			var objWidth = objImg.width;
			if (objWidth > maxWidth) objWidth = maxWidth;
			
			var objHeight = objImg.height;
			if (objHeight > maxHeight) objHeight = maxHeight;

			if (objHeight >= maxHeight || objWidth >= maxWidth)
			{
				vResize = "yes";
			}
			else
				vResize = "no";
			
			
			var winHandle = window.open("" ,"img","toolbar=no,scrollbars=" + vResize + ",resizable=yes,left=0,top=0,width=1,height=1")
			
			if(winHandle != null)
			{
				
				
				var htmlString = "<html><head><title>ÀÌ¹ÌÁö È®´ëº¸±â</title></head>" 
				
				htmlString += "<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>"
				htmlString += "<table cellspacing=0 cellpadding=0 boarder=0 width=100% height=100%><tr><td align=center valign=center>";
				htmlString += "<a href=javascript:window.close()><img src='" + str + "' border=0 alt=´Ý±â name=viewImg onLoad=javascript:window.resizeTo(parseInt(" + objWidth + ")+40,parseInt(" + objHeight + ")+60)></a>"
				htmlString += "</td></tr></table>";
				htmlString += "</body></html>"
				winHandle.document.open()
				winHandle.document.write(htmlString)
				winHandle.document.close()
			} 
			if(winHandle != null) winHandle.focus()
			return winHandle
		}


// ¸ÞÀÏ º¸³»±â
function mail_write(id)
	{
		properties ='location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=662,height=410,left=0, top=0, scrollbars=no';
		window.open('/message/mail.asp?toId=' + id , 'window',properties);
	}


function mail_write_send(id, toMail)
	{		
		properties ='location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=662,height=410,left=0, top=0, scrollbars=no';
		window.open('/message/mail.asp?toId=' + id+"&yremail="+toMail , 'window',properties);
	}


// È¸¿ø »ó¼¼ Á¤º¸ º¸±â
function friend_zoom(id)
	{
		properties ='location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=413,height=440,left=0, top=0, scrollbars=no';
		window.open('/member_info.asp?toId=' + id , 'member_info',properties);
	}

// ²¿¸®¸» ÆË¾÷ ¸®½ºÆ® Ã¢
function go_tail_pop( tname, idx )
	{
		properties ='location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=600,height=500,left=0, top=0, scrollbars=yes';
		window.open('/include/memo/list.asp?tname=' + tname + '&p_idx=' + idx , 'tail_pop',properties);
	}


// ²¿¸®¸» ÆË¾÷ ¸®½ºÆ® Ã¢
function go_sangdam_pop( tname, idx )
	{
		properties ='location=no, directories=no,resizable=no,status=no,toolbar=no,menubar=no, width=600,height=400,left=0, top=0, scrollbars=yes';
		window.open('/include/memo/sangdam.asp?tname=' + tname + '&p_idx=' + idx , 'tail_sangdam',properties);
	}

//=================================================================== °ø¹éÃ¼Å©
function CheckSpaces(str,m) 
{
    var flag = true;
    var strValue = str.value;
 
    if (strValue!=" ") {
       for (var i=0; i < strValue.length; i++) {
          if (strValue.charAt(i) != " ") {
             flag=false;
             break;
          }
       }
    }
	
	if(flag == true) {
       alert( "Enter the " + m );
       str.focus();
    }
   
    return flag;
}



//=================================================================== ¿£ÅÍÃÆÀ»¶§ ¾×¼Ç
function CheckEnter( str )
{

	if(event.keyCode ==13)
	{ 
		

		if ( str == "go_pw" )
		{
			loginFrm.m_pwd.focus();		
		}

		if ( str == "go_loginCheck" )
		{
			login_check();
		}

		if ( str == "go_search" )
		{
			go_search();
		}

	}
}  




function popupWin(vUrl, vW, vH, vParam)
	{
		//if (vParam == "") vParam = 0;
		if (vH > 768)
		{
			vH = "768";
		}

		if (vW > 1024)
		{
			vW = "1024";
		}

		
		
		var property = "top=1, left=1; toolbar=0,status=0,menubars=0,scrollbars=0,resizable=1,location=0,directories=0,width=" + vW + ",height=" + vH;
		var win = window.open(vUrl, "", property);
		
		win.focus();		
	}



// ÁÖ¹Îµî·Ï ¹øÈ£ Ã¼Å©
function check_jumin(jumin1, jumin2)
	{
		var sum = 0;
		var j = 2;	
		var jumin = jumin1 + jumin2;		
			for(var i = 0;i < 12;i++)
				{
					sum = sum + parseInt(jumin.charAt(i)) * (j++);
						if(j == 10)
								j = 2; 
				}		
	
			var re = 11 - sum % 11;

			if(re > 9 && (re - 10) != parseInt(jumin.charAt(12)))
				return false;				
			if(re < 9 && re != parseInt(jumin.charAt(12)))		
				return false;  		
			if(jumin1.charAt(2) == "0" && jumin1.charAt(3) == "0" ||jumin1.charAt(4) == "0" && jumin1.charAt(5) == "0" ) 
				return false;
			return true;	
	}