var atemFile = new Array('more','normal');

function TabMenu(trgObj) {



	for (i=0;i<atemFile.length;i++) {

		if (trgObj !== atemFile[i]) {

			var subMenuElm = document.getElementById(atemFile[i] + '-target');

			hideElement(subMenuElm);

		}

	}

	var subMenuElm = document.getElementById(trgObj + '-target');

	showElement(subMenuElm);

}	



function showElement(obj) {

	obj.style.display = 'block';

}

function hideElement(obj) {

	obj.style.display = 'none';

}



function chkall(input1,input2)

{

    var objForm = document.forms[input1];

    var objLen = objForm.length;

    for (var iCount = 0; iCount < objLen; iCount++)

    {

        if (input2.checked == true)

        {

            if (objForm.elements[iCount].type == "checkbox")

            {

                objForm.elements[iCount].checked = true;

            }

        }

        else

        {

            if (objForm.elements[iCount].type == "checkbox")

            {

                objForm.elements[iCount].checked = false;

            }

        }

    }

}



function Del(input1,input2)

{

	var objForm = document.forms[input1];

	var objLen = objForm.length;

	var itemSel=0;

	document.forms[input1]._delete.value='yes';

	for(i=0;i<objLen;i++)

	{

		if(objForm.elements[i].type=="checkbox" && objForm.elements[i].checked==true)

		{

			itemSel++;

		}

	}

	if(itemSel==0)

	{

		alert("データを選んで下さい。")

		return false;

	}

	else

	{

		if(!confirm("このデータを削除してもよろしいですか？")){

			return false;

		}

	}

	objForm.submit();

}



function Update(input1,input2,input3)

{

	var objForm = document.forms[input1];

	var objLen = objForm.length;

	var itemSel=0;

	document.forms[input1]._update.value='yes';

	document.forms[input1].status.value='yes';

	for(i=0;i<objLen;i++)

	{

		if(objForm.elements[i].type=="checkbox" && objForm.elements[i].checked==true)

		{

			itemSel++;

		}

	}

	if(itemSel==0)

	{

		alert("データを選んで下さい。");

		document.forms[input1].status.value='no';

		return false;

	}

	objForm.submit();

}

