/* ±âº»ÀûÀÎ ÇÔ¼ö */
/* 1.ÁÖ¹Î¹øÈ£Ã¼Å©*/
function isCivilNo(it){
	var idtot=0;
	var idadd="234567892345";
	
	for (var i=0; i<12; i++) {
		idtot = idtot+parseInt(it.substring(i,i+1))*parseInt(idadd.substring(i,i+1));
	}
	idtot=11-(idtot%11);
	if (idtot==10) {
		idtot=0;
	} else if(idtot==11) {
		idtot=1;
	}
	if (parseInt(it.substring(12,13))!=idtot) 
		return false;

	return true;
}

/*2.¹®ÀÚ¿­ Ã¼Å©*/
function stringcheck(Str){
	for(i=0; i < Str.length; i++){
		if(!((Str.charAt(i) >= "0" && Str.charAt(i) <= "9") || (Str.charAt(i) >= "A" && Str.charAt(i) <= "Z")
			|| (Str.charAt(i) >= "a" && Str.charAt(i) <= "z") || (Str.charAt(i) == "-") || Str.charAt(i) == " ")){
			return false;
		}
	}
	return true;
}		


/*2-1.¿µ¹® Ã¼Å© - ¿µ¹®¸í*/
function is_english(Str){
	for(var i=0; i < Str.length; i++){
		if(!((Str.charAt(i) >= "A" && Str.charAt(i) <= "Z") || (Str.charAt(i) >= "a" && Str.charAt(i) <= "z") || Str.charAt(i) == " ")){
			return false;
		}
	}
	return true;
}

/*2-1.¿µ¹® Ã¼Å© - Ç÷¾×Çü*/
function is_english2(Str){
	for(var i=0; i < Str.length; i++){
		if(!((Str.charAt(i) >= "A" && Str.charAt(i) <= "Z") || (Str.charAt(i) >= "a" && Str.charAt(i) <= "z") || Str.charAt(i) == "-" || Str.charAt(i) == "+")){
			return false;
		}
	}
	return true;
}

/*3.ÇÑ±ÛÃ¼Å© */
function is_hangul(val)
{
	if(val.length==0) return false;
		for (var i = 0; i < val.length; i++){
			if (val.charCodeAt(i) != 32 && (val.charCodeAt(i)  < 44032 || val.charCodeAt(i) > 55203))
				return false;}
		return  true;
}


/* 4.ÁÖ¹Îµî·Ï¹øÈ£ ÀÔ·Â Æ÷Ä¿½º ÀÌµ¿  */

function movefocus(x){
  if(x.jumin1.value.length == 6){
	x.jumin2.focus();
  }
}


/*5.¿£ÅÍÃ¼Å© */
function entercheck(x,FuncName){
	if(event.keyCode == 13)
		FuncName(x);
}


/*6.À©µµ¿ì ¿ÀÇÂ */
function openwin(url,objname,width,height,top,left,scroll){
	window.open(url, objname, "directories=no,location=no,menubar=no,resizable=no,scrollbars=" +scroll + ",status=no,titlebar=no,toolbar=no,width=" + width + ",height=" + height + ",top=" + top + ",left=" + left).focus();
}


/*7.¼ýÀÚÀÔ·Â Ã¼Å©*/
function isDigit(val)
{
	var valid = true;
	var cmp = "0123456789";

	for (var i=0; i<val.length; i++) {
		if (cmp.indexOf(val.charAt(i)) < 0) {
			valid = false;
			break;
		}
	}
	return valid;
}

/*7-2.¼ýÀÚÀÔ·Â Ã¼Å©*/
function isDigit2(val)
{
	var valid = true;
	var cmp = "0123456789.";

	for (var i=0; i<val.length; i++) {
		if (cmp.indexOf(val.charAt(i)) < 0) {
			valid = false;
			break;
		}
	}
	return valid;
}

/*7-3.¼ýÀÚÀÔ·Â Ã¼Å©*/
function isDigit3(val)
{
	var valid = true;
	var cmp = "0123456789:/";

	for (var i=0; i<val.length; i++) {
		if (cmp.indexOf(val.charAt(i)) < 0) {
			valid = false;
			break;
		}
	}
	return valid;
}

/*8.±ÛÀÚ¼ö Á¦ÇÑ Ã¼Å©*/
function is_range(val, min, max)
{
	var val_len = val.length;
	var temp;
	for(i = 0; i < val_len; i++) {
		temp = val.charAt(i);
		if(escape(temp).length > 4) val_len++;
	}
	if ((val_len < min) || (val_len > max))	return false;
	else return true;
}


/*9.floatÇü Ã¼Å©*/
function is_float(val)
{
	var index = -1;
	var num1="",num2="",temp="";
	if (val.length==0) return false;
	for(i = 0; i < val.length; i++) {
		temp = val.charAt(i);		
			
		if (temp==".")
		{
			if (index==-1) index = i;
			else
				return false;
		}	
		else
		{
			if (index ==-1)	num1 = num1 + temp;
			else num2 = num2 + temp;
		}					
	}	
	if (!is_number(num1)) return false;
	if (!is_number(num2) && (num2 != "")) return false;
	return true;	
}


/*10.¹®ÀÚ¿­ ±æÀÌ Ã¼Å© */
function getlength(val)
{	
	var len = 0;
	var num="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789`~!@#$%^&*()_+|-=\[]{};',./<>? ";
	if(val.length==0) return 0;
	for (var i = 0; i < val.length; i++){	
		if (-1 == num.indexOf(val.charAt(i)))		
			len = len + 2;
		else
			len = len + 1;				
	}	
	return  len;
}


/*11.·¹ÀÌ¾î °ü¸® */
function ShowLayer()
{
	var str;	
	if(document.sendmail.cate.selectedIndex == 0){
		document.all['apply0'].style.display = '';
		document.all['apply1'].style.display = 'none';
		document.all['apply2'].style.display = 'none';
		document.all['apply3'].style.display = 'none';
	}

	else if(document.sendmail.cate.selectedIndex == 1){
		document.all['apply0'].style.display = 'none';
		document.all['apply1'].style.display = '';
		document.all['apply2'].style.display = 'none';
		document.all['apply3'].style.display = 'none';
	}

	else if(document.sendmail.cate.selectedIndex == 2){
		document.all['apply0'].style.display = 'none';
		document.all['apply1'].style.display = 'none';
		document.all['apply2'].style.display = '';
		document.all['apply3'].style.display = 'none';
	}

	else if(document.sendmail.cate.selectedIndex == 3){
		document.all['apply0'].style.display = 'none';
		document.all['apply1'].style.display = 'none';
		document.all['apply2'].style.display = 'none';
		document.all['apply3'].style.display = '';
	}
}


function ShowLayer1(x, div, cnt)
{
	var num;
	var str;
	
	num = parseInt(x.fileno.value)+1;	
	
	for (i=2;i<cnt+1;i++)
	{
		str = "document.all['"+div +i+"'].style.display = 'none';";
		eval(str);				
	}
	for (i=2;i<num+1;i++)
	{
		str = "document.all['"+div +i+"'].style.display = '';";
		eval(str);			
	}	
}


/*12-1.Æ¯¼ö¹®ÀÚ ÀÔ·Â Ã¼Å©*/
function isSpecialChar(val)
{
	var valid = true;
	var cmp = "/:;'-\"\\";

	for (var i=0; i<val.length; i++) {
		if (cmp.indexOf(val.charAt(i)) >= 0) {
			valid = false;
			break;
		}
	}
	return valid;
}


/*12-2.Æ¯¼ö¹®ÀÚ ÀÔ·Â Ã¼Å©*/
function isSpecialChar2(val)
{
	var valid = true;
	var cmp = "/:;'\"\\";

	for (var i=0; i<val.length; i++) {
		if (cmp.indexOf(val.charAt(i)) >= 0) {
			valid = false;
			break;
		}
	}
	return valid;
}


/*13.°ø¹éÃ¼Å© Ã¼Å©*/
function JS_trim(data)
{
  for(var i=0;i<data.length;i++)
  {
  	var digit = data.charAt(i)
  	if ( digit == " ")	continue; 
  	else return 1;
  }
  return -1;
}


//14.ÀÌ¸ÞÀÏ Ã¼Å©
function chkemail(val){
	if ( val.search(/(^\..*)|(.*\.$)/) != -1 || val.search(/\S+@(\S+)\.(\S+)/) == -1 ) {
        alert("ÀüÀÚ¿ìÆíÁÖ¼ÒÀÇ Çü½ÄÀº '°èÁ¤@[È£½ºÆ®|µµ¸ÞÀÎ]'°ú °°ÀÌ ±¸¼ºµÇ¾î¾ß ÇÏ¸ç,\r\n¾çÂÊ¿¡ '.'ÀÌ ±âÀçµÇ¾î¼­´Â ¾ÈµË´Ï´Ù.\r\n\r\n¿¹) kiv@kado.com");
        return false ;
    }
	/*
	var str = val.substring(val.indexOf("@")+1);
	str1 = str.substring(0,7);
	str2 = str.substring(0,4);
	if((str1.toLowerCase() == "hanmail") || (str2.toLowerCase() == "daum")){
		alert("ÇÑ¸ÞÀÏ °èÁ¤Àº µî·ÏÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");		
		return false; 
	}	
	*/
	return true;
}
//È¸¿ø °ü¸® ¸µÅ©
function mem_link(x)
{
	switch(x)
	{
		case 1:
		location.href="member_list.asp?title="+x
		break;

		case 2:
		location.href="member_list.asp?title="+x
		break;

		case 3:
		location.href="member_list.asp?title="+x
		break;

		case 4:
		location.href="member_list.asp?title="+x
		break;

		case 5:
		location.href="member_list.asp?title="+x
		break;

		case 6:
		location.href="team_list.asp?title="+x
		break;

		case 7:
		location.href="office_list.asp?title="+x
		break;
	}
}
