/**
* Toggle Checkbox input fields
**/
function toggleAll(formName, fieldName)
{
    //Iterate through the form elements
    for(i = 0; i < formName.elements.length; i++)
    {
        //Ensure that the element is a checkbox with the correct name
        if ( (formName.elements[i].type == "checkbox") &&
             (formName.elements[i].name == fieldName) )
        {
            //Decide whether to toggle the element on or off
            if (formName.elements[i].checked == false)
            {
                formName.elements[i].checked=true;
            }
            else
            {
                formName.elements[i].checked=false;
            }
        }
    }
}

/**
* Check all Checkbox elements with the specified Field name
**/
function checkAll(formName, fieldName)
{
    //Iterate through the form elements
    for(i = 0; i < formName.elements.length; i++)
    {
        //Ensure that the element is a checkbox with the correct name
        if ( (formName.elements[i].type == "checkbox") &&
             (formName.elements[i].name == fieldName) )
        {
            formName.elements[i].checked=true;
        }
    }
}
/**
* Uncheck all Checkbox elements with the specified Field name
**/
function uncheckAll(formName, fieldName)
{
    //Iterate through the form elements
    for(i = 0; i < formName.elements.length; i++)
    {
        //Ensure that the element is a checkbox with the correct name
        if ( (formName.elements[i].type == "checkbox") &&
             (formName.elements[i].name == fieldName) )
        {
            formName.elements[i].checked=false;
        }
    }
}

/**
/**
* Toggle Checkbox input fields
**
function toggleAll(fieldName)
{
alert(fieldName);
    //Iterate through the elements
    for (i = 0; i < fieldName.length; i++)
    {
alert(fieldName[i]);
        //Invert the selections
        if (fieldName[i].checked == true)
        {
            fieldName[i].checked = false;
        }
        else
        {
            fieldName[i].checked = true;
        }
    }
}
**/