/*'#################################################################################
' Inputs :
'		(strFormName)		: the name of the current form
'		(strCheckboxNames)	: the collective name of all the checkboxes
'		(blnStatus)			: boolean which determines if box should be ticked
'
' Actions :
'		sets the checkboxes ticked or unticked
'
' Outputs : 
'################################################################################# */
function SetChecked(strFormName, strCheckboxNames, blnStatus) 
{
	var theForm = eval('document.'+strFormName)

    for (i=0,n=theForm.elements.length;i<n;i++)
		if (theForm.elements[i].name.indexOf(strCheckboxNames) !=-1)
            theForm.elements[i].checked = eval(blnStatus);
}

/*'#################################################################################
' Inputs :
'		(strFormName)		: the name of the current form
'		(strCheckboxNames)	: the collective name of all the checkboxes
'
' Actions :
'		checks to see if any checkboxes are ticked
'
' Outputs : TRUE if there is at least on box ticked
'		   FALSE if no checkboxes are ticked
' ################################################################################# */
function anyChecked(strFormName, strCheckboxNames) 
{
	var theForm = eval('document.'+strFormName)
	var anyChecked = false

	    for (i=0,n=theForm.elements.length;i<n;i++)
	        if (theForm.elements[i].name.indexOf(strCheckboxNames) !=-1)
	            if (theForm.elements[i].checked==true)
					return true;
	return false;
            
}


/*'#################################################################################
' Inputs :
'		(strFormName)		: the name of the current form
'		(strCheckboxNames)	: the collective name of all the checkboxes
'		(strMessage)        : the message to be displayed
'
' Actions :
'		checks to see if none of the checkboxes are ticked
'
' Outputs : TRUE if there is at least on box ticked
'		   FALSE if no checkboxes are ticked
' ################################################################################# */
function noneChecked(strFormName, strCheckboxNames, strMessage) 
{
	var theForm = eval('document.'+strFormName)
	var anyChecked = false
	var counter = 0

	    for (i=0,n=theForm.elements.length;i<n;i++)
	        if (theForm.elements[i].name.indexOf(strCheckboxNames) !=-1)
	        
	            if (theForm.elements[i].checked==true)
					return true;
				else
					counter = counter + 1
						
	if(counter == n)
	{
		alert(strMessage)
		return false;	
	}
		
	return false;
		            
}