function switchPreferencesBlockVisibility(blockId){
	
	var currentVisibility = document.getElementById('subContainer_' + blockId).style.display;
	
	if(currentVisibility == 'none'){
		document.getElementById('subContainer_' + blockId).style.display = "block";
		document.getElementById('ControllerImage_' + blockId).src = "/images/switch_minus.png";
		
	}
	else{
		
		document.getElementById('subContainer_' + blockId).style.display = "none";
		document.getElementById('ControllerImage_' + blockId).src = "/images/switch_plus.png";
		
	}	
	
}

function toggleCheckBoxes(blockId){
	
	// Set to on or off?
	var targetState;
	
	if(document.getElementById('ControllerCheckBox_' +blockId).checked == true){
		targetState = true;	
	}
	else{
		targetState = false;	
	}
	
	
	var collection = document.getElementById('subContainer_' + blockId).getElementsByTagName('INPUT');
	
	for (var x=0; x<collection.length; x++) {
		if (collection[x].type.toUpperCase()=='CHECKBOX'){
			
			//collection[x].checked = true;
		
			if(targetState == true){
				collection[x].checked = true;
			}
			else{
				collection[x].checked = false;
			}
		}
	}
}
	

