var maxselected=2;

function checkbox_checker()
{

// set var checkbox_choices to zero
var checkbox_choices = 0;

var checks = document.getElementById('checkbox_limit_2').getElementsByTagName('input');
	for (var i=0; i<checks.length; i++) {
		if (checks[i].checked)
			{ checkbox_choices = checkbox_choices + 1; }
	}


if (checkbox_choices > maxselected )
{
// If there were more than three selections made display an alert box
msg="You're limited to only "+maxselected+" selections.\n"
msg=msg + "You have made " + checkbox_choices + " selections.\n"
msg=msg + "Please remove " + (checkbox_choices-maxselected) + " selection(s)."
alert(msg)
return (false);
}


if (checkbox_choices < maxselected )
{
// If there were less then selections made display an alert box
alert("Please make "+maxselected+" selections. \n" + checkbox_choices + " entered so far.")
return (false);
}

// If three were selected then display an alert box stating input was OK
// alert(" *** Valid input of "+maxselected+" outfielders was entered. ***");
return (true);
}