// this is to dynamically hide all sub forms. If javascript is disabled, they will all open, thus
// maintaining usability and graceful degradation.
document.write('<style type="text/css">.subCheckBoxes { display:none; }</style>');

// this code checks to see if a checkbox is text and subsequently shows the div with the id given to it
function showMe (it, box) {
    if(ExpandAndColapse == true)
    {
	    var vis = (box.checked) ? "block" : "none";
	    document.getElementById(it).style.display = vis;
	}
	else
	{
	    document.getElementById(it).style.display = 'block';
	}
}

// this code checks to see if the hyperlink onclick is fired and subsequently shows the div with the id given to it
function showMe (it) {
	var vis = document.getElementById(it).style.display
	if (vis == "block") { document.getElementById(it).style.display = "none"; }
	else { document.getElementById(it).style.display = "block"; }
}

//  this code fires on the click of the checkbox
function showMeCheckboxClick(control, it) {
    document.getElementById(it).style.display = 'block';
    
    $(control).parent().find(':checkbox').each(function()
    {
        if(this.id != control.id)
        {
            this.checked = control.checked;
        }
    });
}
