currentLayer = "";
arrDocument = new Array();
noOfDocument = 0;

function hideData(whichData) {
	if (whichData!="") {
		if (document.getElementById) {
			// this is the way the standards work
			document.getElementById(whichData).style.display = "none";
		}
		else if (document.all) {
			// this is the way old msie versions work
			document.all[whichData].style.display = "none";
		}
		else if (document.layers) {
			// this is the way nn4 works
			document.layers[whichData].display = "none";
		}
	}
}

function showData(whichData,whatData) {

	if (whichData!="") {
		
		if (whatData=="a") {
			if (currentLayer!="") {
				hideData(currentLayer);
				hideData("o"+currentLayer);
				showData("c"+currentLayer,"q");
			}
			currentLayer = whichData;
		}		
		
		if (document.getElementById) {
			// this is the way the standards work
			document.getElementById(whichData).style.display = "block";
		}
		else if (document.all) {
			// this is the way old msie versions work
			document.all[whichData].style.display = "block";
		}
		else if (document.layers) {
			// this is the way nn4 works
			document.layers[whichData].display = "block";
		}
		
	}
}

function hideAllLayers() {
	
	for (var i = 0; i < noOfDocument; i++) {
		if (document.getElementById) {
			document.getElementById("h_q"+arrDiary[i]).style.display = "none";
			document.getElementById("oh_q"+arrDiary[i]).style.display = "none";
			document.getElementById("ch_q"+arrDiary[i]).style.display = "block";
		}
		else if (document.all) {
			document.all["h_q"+arrDiary[i]].style.display = "none";
			document.all["oh_q"+arrDiary[i]].style.display = "none";
			document.all["ch_q"+arrDiary[i]].style.display = "block";
		}
		else if (document.layers) {
			document.layers["h_q"+arrDiary[i]].display = "none";
			document.layers["oh_q"+arrDiary[i]].display = "none";
			document.layers["ch_q"+arrDiary[i]].display = "block";
		}
	}
} 

function showAllLayers() {
	
	for (var i = 0; i < noOfDocument; i++) {
		if (document.getElementById) {
			document.getElementById("h_q"+arrDiary[i]).style.display = "block";
			document.getElementById("oh_q"+arrDiary[i]).style.display = "block";
			document.getElementById("ch_q"+arrDiary[i]).style.display = "none";
		}
		else if (document.all) {
			document.all["h_q"+arrDiary[i]].style.display = "block";
			document.all["oh_q"+arrDiary[i]].style.display = "block";
			document.all["ch_q"+arrDiary[i]].style.display = "none";
		}
		else if (document.layers) {
			document.layers["h_q"+arrDiary[i]].display = "block";
			document.layers["oh_q"+arrDiary[i]].display = "block";
			document.layers["ch_q"+arrDiary[i]].display = "none";
		}
	}
} 
