// intFormIndex : ÇÔ¼ö¿Í ¿¬µ¿ÇÒ formÀ» °¡¸®Å°´Â index
// strCheckBoxName : ÇÔ¼ö¿Í ¿¬µ¿ÇÒ Ã¼Å© ¹Ú½º ÀÌ¸§

var booleancheck = true;

//ÇØ´çµÇ´Â CheckBox¸¦ ¸ðµÎ ¼±ÅÃ ¶Ç´Â ¸ðµÎ ¼±ÅÃÇØÁ¦ 
function CheckAllCheckBox(intFormIndex, strCheckBoxName)
{
	for (i=0;i<document.forms[intFormIndex].elements.length;i++)
		if (document.forms[intFormIndex].elements[i].name == strCheckBoxName)
			document.forms[intFormIndex].elements[i].checked = booleancheck;
	booleancheck = !booleancheck;	
}

//strCheckBoxNameÀÌ¶ó´Â ÀÌ¸§À» °¡Áø CheckBoxÀÇ °³¼ö¸¦ ¸®ÅÏ
function CountCheckBoxNo(intFormIndex, strCheckBoxName)
{
	var intChkCount = 0;
	for (i=0;i<document.forms[intFormIndex].elements.length;i++)
		if (document.forms[intFormIndex].elements[i].name == strCheckBoxName)
				intChkCount++;
	return intChkCount;
}
//ÇØ´çµÇ´Â CheckBox Áß¿¡¼­ ¼±ÅÃµÈ °ÍÀÌ ÇÏ³ªµµ ¾øÀ» ¶§, true¸®ÅÏ, ±×·¸Áö ¾ÊÀ¸¸é false¸®ÅÏ
function CheckSelectNothing(intFormIndex, strCheckBoxName)
{
	var intChkCount = 0;
	for (i=0;i<document.forms[intFormIndex].elements.length;i++)
		if (document.forms[intFormIndex].elements[i].name == strCheckBoxName)
			if (document.forms[intFormIndex].elements[i].checked == true)
				intChkCount++;
	if (intChkCount == 0)
		return true; //¼±ÅÃµÈ °ÍÀÌ ÇÏ³ªµµ ¾øÀ» ¶§, 
	else
		return false; //¼±ÅÃµÈ °ÍÀÌ ÇÏ³ª ÀÌ»óÀÏ ¶§, 
}
//Ã¼Å©¹Ú½º¸¦ °Ë»çÇÏ°í submit
function DoSubmit(intFormIndex, strCheckBoxName)
{
	if (CountCheckBoxNo(intFormIndex, strCheckBoxName) == 0)
		return;
	else if (CheckSelectNothing(intFormIndex, strCheckBoxName) == true)	
		alert(lngCheckAlert);
	else 
		document.forms[intFormIndex].submit();

}
