var AllorNothing = false;

function checkall(obj)
{
	var cntBox = obj.check.length;	

	if (AllorNothing == false) 
	{
		AllorNothing = true;
	}
	else 
	{
		AllorNothing = false;
	}

	if (cntBox >= 2) 
	{
		for (i = 0; i < cntBox; i ++) 
		{
			obj.check[i].checked = AllorNothing;
		}
	} 
	else 
	{
		obj.check.checked = AllorNothing;
	}

}