//Ã¼Å©¹Ú½º Á¦¾î
function chkBox(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 0){
		for(var i=0; i<obj.length; i++){
			if(i != ind){
				obj[i].checked = false;
			}
		}
	}
}


//Ã¼Å©¹Ú½º Á¦¾î
function chkBoxCh(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 0){
		for(var i=0; i<obj.length; i++){
			if(i != ind){
				obj[i].checked = false;
			}
		}
	}
}

//Ã¼Å©¹Ú½º Á¦¾î
function chkBoxThisCh(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 0){
		if(obj[ind].checked == true){
			obj[ind].checked = false;
		}else{
			obj[ind].checked = true;
		}
	}else{
		if(obj.checked == true){
			obj.checked = false;
		}else{
			obj.checked = true;
		}
	}
}

//Ã¼Å©¹Ú½º Á¦¾î
function chkBoxThis(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 0){
		for(var i=0; i<obj.length; i++){
			if(i != ind){
				obj[i].checked = false;
			}else{
				obj[i].checked = true;
			}
		}
	}
}

//Ã¼Å©¹Ú½º ¼±ÅÃ ÇØÁ¦
function notChkBox(o){
	var obj = eval(o);
	if(obj.length > 0){
		for(var i=0; i<obj.length; i++){
			obj[i].checked = false;
		}
	}
}

//Ã¼Å©¹Ú½º
function chkAll(o){
	var obj = eval("document.all."+o);
	
	if(obj != null){
		if(obj.length > 1){
			for(var i=0; i<obj.length;i++){
				if(document.all.allChk.checked){
					obj[i].checked = true;
				}else{
					obj[i].checked = false;
				}
			}
		}else{
			if(document.all.allChk.checked){
				obj.checked = true;
			}else{
				obj.checked = false;
			}
		}
	}

}

//·¹ÀÌ¾î Á¦¾î
function lyCon(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 1){
		for(var i=0; i<obj.length; i++){
			if(i == ind){
				obj[i].style.display = "block";
			}else{
				obj[i].style.display = "none";
			}
		}
	}else{
		if(obj.style.display == "none"){
			obj.style.display = "block";
		}else{
			obj.style.display = "none";
		}
	}
}


//·¹ÀÌ¾î Á¦¾î
function lyConS(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 1){
		for(var i=0; i<obj.length; i++){
			if(i == ind){
				if(obj[i].style.display == "none"){
					obj[i].style.display = "block";
				}else{
					obj[i].style.display = "none";
				}
			}else{
				obj[i].style.display = "none";
			}
		}
	}else{
		if(obj.style.display == "none"){
			obj.style.display = "block";
		}else{
			obj.style.display = "none";
		}
	}
}

//·¹ÀÌ¾î Á¦¾î
function lySelfOpenClose(o,ind){
	var obj = eval("document.all."+o);
	if(obj.length > 1){
		if(obj[ind].style.display == "none"){
			obj[ind].style.display = "block";
		}else{
			obj[ind].style.display = "none";
		}
	}else{
		if(obj.style.display == "none"){
			obj.style.display = "block";
		}else{
			obj.style.display = "none";
		}
	}
}

//·¹ÀÌ¾î Á¦¾î
function lyConOpenClose(o){
	var obj = eval("document.all."+o);
	if(obj != null){
		if(obj.style.display == "none"){
			obj.style.display = "block";
		}else{
			obj.style.display = "none";
		}
	}
}

//·¹ÀÌ¾î ¾ø¾Ö±â
function lyHidden(o){
	var obj = eval("document.all."+o);
	if(obj != null){
		obj.style.display = "none";
	}
}


//Ã¼Å©»óÅÂ
function chkState(o){
	var obj = eval("document.all."+o);
	var chkFlag = false;

	if(obj != null){
		if(obj.length > 1){
			for(var i=0; i<obj.length;i++){
				if(obj[i].checked){
					chkFlag = true;
					break;
				}
			}
		}else{
			if(obj.checked){
				chkFlag = true;
			}
		}
	}

	return chkFlag;
}

//Ã¼Å©»óÅÂ
function chkStateW(o){
	var obj = eval("document.all."+o);
	var chkFlag = false;

	if(obj != null){
		if(obj.length > 1){
			for(var i=0; i<obj.length;i++){
				if(obj[i].checked){
					chkFlag = true;
					break;
				}
			}
		}else{
			if(obj.checked){
				chkFlag = true;
			}
		}
	}

	return chkFlag;
}

//Ã¼Å©°³¼ö
function chkStateCnt(o){
	var obj = eval("document.all."+o);
	var chkCnt = 0;

	if(obj != null){
		if(obj.length > 1){
			for(var i=0; i<obj.length;i++){
				if(obj[i].checked){
					chkCnt += 1;
				}
			}
		}else{
			if(obj.checked){
				chkCnt += 1;
			}
		}
	}

	return chkCnt;
}

//Ã¼Å©µ¥ÀÌÅÍ
function chkStateData(o){
	var obj = eval("document.all."+o);
	var chkData = "";

	if(obj != null){
		if(obj.length > 1){
			for(var i=0; i<obj.length;i++){
				if(obj[i].checked){
					if(chkData.split(" ").join("") == ""){
						chkData = obj[i].value;
					}else{
						chkData = chkData + "," + obj[i].value;
					}
				}
			}
		}else{
			if(obj.checked){
				chkData = obj.value;
			}
		}
	}

	return chkData;
}


function blankChk(obj, msg) {
	if(obj.value.split(" ").join("") == ""){
		alert(msg);
		obj.focus();
		return 0;
	}else{
		return 1;
	}
}

//Çã¿ë¹®ÀÚ Ã¼Å©
function wordChk(obj,comp,msg){
	var string = obj.value;
	var len=string.length;

	if (len > 0 ){
		for(i=0;i<len;i++){
			if(comp.indexOf(string.substring(i,i+1))<0){
				alert(msg);
				obj.focus();
				obj.select();
				return 0;
			}
		}
	}
	return 1;
}


// ±æÀÌ Ã¼Å©
function lenChk(obj, start, end){
	var string = obj.value;
	var len = string.length;
	
	if(len > 0 ){
		if(len < start || len > end){
			alert("µ¥ÀÌÅÍ´Â "+start+" ¿Í "+end+" »çÀÌ·Î ÀÔ·ÂÇÏ¼¼¿ä");
			obj.focus();
			obj.select();
			return 0;
		}else{
		return 1;
		}
	}
}

//¼ýÀÚÁ¦¾î
function SetNum(obj){
	val=obj.value;
	re=/[^0-9]/gi;
	obj.value=val.replace(re,"");
}


function onlyNumber(){
	if((event.keyCode<48)||(event.keyCode>57))
		event.returnValue=false;
}


//ÇÑ±ÛÃ¼Å©
function isHangul(s) 
{
	var len;
	
	len = s.length;

	for (var i = 0;i < len;i++) {
		if (s.charCodeAt(i) != 32 && (s.charCodeAt(i) < 44032 || s.charCodeAt(i) > 55203))
		return 0;
	}
	return 1;
}

//±ÛÀÚ¼ö Á¦ÇÑ
function textCounter(field, maxlimit)
{
	var str_character;
	var int_char_count;
	var int_contents_length;
	
	int_char_count = 0;
	
	int_contents_length = field.value.length; // ÅØ½ºÆ®¶ó Æû º¯¼ö ÁöÁ¤
	
		
	// ÇÑ±Û°ú ¿µ¹® ¹ÙÀÌÆ®¼ö °è»êÇÏ´Â ºÎºÐ
	for(k=0; k < int_contents_length; k++){
		str_character = field.value.charAt(k);
		if(escape(str_character).length > 4){
			int_char_count += 2;
		}else{
			int_char_count++;
		}
	}

	//if (int_char_count > maxlimit){
	//	alert("Á¦ÇÑÇÑ "+maxlimit+"±ÛÀÚ°¡ ³Ñ½À´Ï´Ù.");
	//	field.value = field.value.substring(0, maxlimit);
		//³²Àº±ÛÀÚ¼ö  Ä«¿îÅÍ ºÎºÐ
	//}else{
		field_cnt.innerHTML = int_char_count;
	//}
}
