var boxShownBoxes = new Array();

function boxInitialize( brick, show, hide, group, initialHide ){
	icon = document.getElementById('box_icon_'+brick);
	if (icon != null) {
		icon.show = show;
		icon.hide = hide;
		icon.group = group;
		icon.style.cursor = "pointer";
		box = document.getElementById('box_div_'+brick);
		box.show = 'pccdivisionshow';
		box.hide = 'pccdivisionhide';
		if ( initialHide ) {
			boxToggle( brick );
		} else {
			if ( group ) {
				if ( boxShownBoxes[group] != null ) boxToggle( brick );
				else boxShownBoxes[group] = brick;
			}
		}
	}
}


function boxToggle( brick ){
	icon = document.getElementById('box_icon_'+brick);
	box = document.getElementById('box_div_'+brick);
	if ( icon.src == icon.show ) {
		icon.src = icon.hide;
		box.className = box.show;
		if ( icon.group && boxShownBoxes[icon.group] != null ) boxToggle( boxShownBoxes[icon.group] );
		if ( icon.group ) boxShownBoxes[icon.group] = brick;
	} else {
		icon.src = icon.show;
		box.className = box.hide;
		if ( icon.group && boxShownBoxes[icon.group] == brick ) boxShownBoxes[icon.group] = null;
	}

}