//Divisions (DIV) must be labelled with unique IDs or name
function getDiv(name_div) {
	if (name_div == null) {
		alert("No division name given.");
		return;
	}
	var Div = null;
	
	//Code for W3 compatible browsers
	if (document.getElementById) {
		//Determine Div
		Div = document.getElementById(name_div);
	}
	
	//Code for IE browser
	else if (document.all) {
		//Determine Form
		Div = document.all[name_div]; 
	
	} 
	
	//Code for NS4 browser
	else if (document.layers) {
		//Determine Form
		Div = document.name_div; 

	}

	//Return Div Object
	if (Div == null) {
		alert("Division '" + name_div + "' does not exist.");
		return;
	} else {
		return (Div);
	}
}


//Return Display Status of Div
function isHidden(ID_div) {
	var Div	    = getDiv(ID_div);
	var display = Div.style.display;
	if (display == 'none') {
		return(true)
	} else {
		return(false);
	}
}
function isVisible(ID_div) {
	return(!isHidden(ID_div));
}

//Show divisions specified by ID
function showDiv() {
	for (var i = 0; i < arguments.length; i++) {
		var divID = arguments[i];
		var Div   = getDiv(divID);
		Div.style.display = '';
	}
} //function

//Hide divisions specified by ID
function hideDiv() {
	for (var i = 0; i < arguments.length; i++) {
		var divID = arguments[i];
		
		//Exit Loop if Division not defined
		if (divID == null) break;
			
		//Hid Division
		var Div = getDiv(divID);
		Div.style.display = 'none';
	}
} //function

//Toogle (show|hide) divisions specified by ID
function toggleDiv() {
	for (var i = 0; i < arguments.length; i++) {
		var divID = arguments[i];
		//Exit Loop if Division not defined
		if (divID == null) break;
			
		//Toggle Division
		var Div = getDiv(divID);
		if (Div.style.display != 'none') {
			Div.style.display = 'none';
			return -1;
		} else {
			Div.style.display = '';
			return +1;
		} //if
	} //for
} //function



