// JavaScript Document
// routines to show and hide text/etc. in layers

var oneType = 'div';
if (thisType) {
	oneType = thisType;
	}
var allOneType = document.getElementsByTagName(oneType);
var allMyElems = new Array()
// change this to the suffix you like
var elemTag = 'TaskList';
if (thisTag) {
	elemTag = thisTag;
	}
var reTag = new RegExp(elemTag + '$');
var alertString = "";
// alertString = 'oneType: ' + oneType + '\nthisType: ' + thisType + '\nelemTag: ' + elemTag + '\nthisTag: ' + thisTag + '\n';
for (i=0;i<allOneType.length;i++) {
	// alertString += 'checking ' + allOneType[i].id + ': ';
	if (allOneType[i].id.match(reTag)) {
		// alertString += allOneType[i].id + '\n';
		allMyElems[allMyElems.length] = allOneType[i];
		}
	}
// alert(alertString);
// need these styles in the style sheet too:
/*
.hideItem {
	display: none;
	visibility: hidden;
}
.showInline {
	display: inline;
	visibility: visible;
}
.showBlock {
	display: block;
	visibility: visible;
}
*/
function toggleElems(aTag) {
	// this needs to match the reTag from above
	var thisLayer = aTag + elemTag;
	for (i=0;i<allMyElems.length;i++) {
		if (allMyElems[i].id == thisLayer) {
			allMyElems[i].className = 'showBlock';
			}
		else {
			allMyElems[i].className = 'hideItem';
			}
		}
	}
function showAllElems() {
	// this needs to match the reTag from above
	for (i=0;i<allMyElems.length;i++) {
		allMyElems[i].className = 'showBlock';
		}
	}
// call this at the foot of the page to be sure the page has loaded
// toggleLayers('');
