var shown_count = 4;
var div_names = new Array('fight', 'magic', 'craft', 'harvest');
function toggleDiv(divid) {
	if (document.getElementById(divid).style.display == 'none') {
		document.getElementById(divid).style.display = 'block';
		shown_count++;
		document.getElementById('show-' + divid).setAttribute('class',
				'highlight');
	} else {
		document.getElementById(divid).style.display = 'none';
		shown_count--;
		document.getElementById('show-' + divid).setAttribute('class',
				'no-highlight');
	}
	document.getElementById('show-none').style.display = (shown_count > 0 ? 'inline'
			: 'none');
	document.getElementById('show-all').style.display = (shown_count < 4 ? 'inline'
			: 'none');
}
function showAllDivs(b) {
	if (b == true) {
		for ( var i in div_names) {
			document.getElementById('main-' + div_names[i]).style.display = 'block';
			document.getElementById('show-main-' + div_names[i]).setAttribute(
					'class', 'highlight');
		}
		document.getElementById('show-all').style.display = 'none';
		document.getElementById('show-none').style.display = 'inline';
		shown_count = 4;
	} else {
		for ( var i in div_names) {
			document.getElementById('main-' + div_names[i]).style.display = 'none';
			document.getElementById('show-main-' + div_names[i]).setAttribute(
					'class', 'no-highlight');
		}
		document.getElementById('show-all').style.display = 'inline';
		document.getElementById('show-none').style.display = 'none';
		shown_count = 0;
	}
}
