// forms.js

<!--

var max_options = 20;
// hey, i know this is lame, but so are javascript and php.  if you make the 
// checkbox an array that javascript understands, then php doesn't understand.
// if you make it so php understands, then javascript doesn't understand.
// so we get to create X number of individual variables in php.  isn't 
// that fun?


function uncheckFirst(fieldname)
{
	var thisname = "document." + fieldname + "0";
	eval(thisname).checked = false ;
}


function uncheckRest(fieldname)
{
	for (i = 1; i < max_options; i++) {
		var thisname = "document." + fieldname + i;
		if (eval(thisname)){
			eval(thisname).checked = false ;
		}
	}
}

// Use compareChecks when one of the checkboxes MUST be checked;  this function
//   looks at all the checkboxes called WHATEVER0...WHATEVER19, and if one of
//   them is not checked, it checks the first one (WHATERVER0).
function compareChecks(fieldname)
{
	var something_is_checked = false;
	var thisname;
	
	for (i = 0; i < max_options; i++){
		thisname = "document." + fieldname + i;
		if ((eval(thisname)) && (eval(thisname).checked)) {
		    something_is_checked = true;
		}
	}
	
	if (!something_is_checked) {
		thisname = "document." + fieldname + "0";
		eval(thisname).checked = true ;	
	}
}




//-->
