Code
function Checkboxes_CountState(FormName, State) {
	/*
	Purpose
		Used to count the number of checkboxes within a specified form
		that are set to a specified state (true or false).
	Parameters
		FormName (string) = Only checkboxes within this form are counted.
		State (optional boolean) = To count the number of checked checkboxes,
			set this to true. To count unchecked checkboxes, set to false.
			Default: true
	Return (integer)
		Return the total number of checkboxes that are set to the same state as
		indicated by State.
	Version History
		1.00 2009.6.25 Tested by Russ Tanner on IE6/FF3.
	*/
	
	// Default State to true.
	if (typeof State == 'undefined') State = true;
	
	var frm = document.forms[FormName];
	var c = frm.elements.length;
	var r = 0;
	for(var i=0; i<c; i++) {
		if (frm.elements[i].type == 'checkbox') r += (frm.elements[i].checked == State) ? 1 : 0;
	}
	
	return r;
}



The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)