// Functions for the find section. Using the "find namespace

var find = {
	
	//selects or deselects all boxes
	toggleSelect: function(allBox, boxSetName, theForm)
	{
		 boxArray = document.forms[theForm].elements[boxSetName]; 
		 boxCount =  boxArray.length
		
		if(allBox.checked)
			{
				 
				
				 for(var i = 0; i < boxCount; i++)
				 	{
				 		boxArray[i].checked = true;
				 	}
			}
		else
			{
				 for(var i = 0; i < boxCount; i++)
				 	{
				 		boxArray[i].checked = false;
				 	}
			}
	},
	
	//unchecks teh all box if one of the boxes is unchecked.
	uncheckAllBox: function(theBox, allBox)
	{
	
		if(!theBox.checked)
			{
				document.getElementById(allBox).checked = false;
			}
	},
	
	clearOptional: function(field)
		{
			if(field.value = "Optional")
				{
					field.value = "";
					field.style.color = "#000000";
				}
		}
}
