/*
 DESCRIPTION: 	This library is to expand/Collapse brief indexes components on
				/public/layout/flushrightcomponents
             	and /public/layout/flushrightwithoutheader
				If the browser is NS4, then hide the expand all/collapse all title and
				disable the functions.
*/

DOM = (document.getElementById) ? true : false;
IE = (document.all) ? true : false;
IE4 = IE && !DOM;
NS4=(document.layers) ? true : false;

//ExpandAll function is to expand all flush right components through the onClick handler.	       																		-
/*
 The function first gets all the DIVS through document.getElementbyTagName, and then
 finds the className called exChild & exImage. The purpose is to display all of the
 exChild class and hide the exImg class.
*/

function expandall() {
if (DOM) {
divColl = document.getElementsByTagName("DIV");
for (i=0; i<divColl.length; i++) {
	if (divColl.item(i).className == "exChild") {
		divColl.item(i).style.display="block";
		divColl.item(i).style.visibility="visible";
	 }

	if (divColl.item(i).className == "exImg") {
		divColl.item(i).style.display="none";
		divColl.item(i).style.visibility="hidden";
		}
	}
}

if (IE4) {
divColl = document.all.tags("DIV");

for (i=0; i<divColl.length; i++) {
	if (divColl(i).className == "exChild") {
		divColl(i).style.display="block";
		}
	if (divColl(i).className == "exImg") {
		divColl(i).style.display="none";
		}
	}
}

}

//CollapseAll function is to collapse all flush right components through the onClick handler.	       																		-
/*
 The function first gets all the DIVS through document.getElementbyTagName, and then
 finds the className called exChild & exImage. The purpose is to hide all of the
 exChild class and display the exImg class only.
*/

function collapseall() {
if (DOM) {
divColl = document.getElementsByTagName("DIV");
for (i=0; i<divColl.length; i++) {
	if (divColl.item(i).className == "exChild") {
		divColl.item(i).style.display="none";
		divColl.item(i).style.visibility="hidden";
		}

	if (divColl.item(i).className == "exImg") {
		divColl.item(i).style.display="block";
		divColl.item(i).style.visibility="visible";
		}
	}
}

if (IE4) {
divColl = document.all.tags("DIV");
for (i=0; i<divColl.length; i++) {
	if (divColl(i).className == "exChild") {
		divColl(i).style.display="none";
		}

	if (divColl(i).className == "exImg") {
		divColl(i).style.display="block";
		}
	}
}

}

//ExpandIt function is to expand/collapse individual flush right components through the handler.	       																		-
/*
 The function first gets DIV Name by using document.getElementbyID, and then
 finds the className called exChild & exImage. The purpose is to hide all of the
 exChild class and display the exImg class only.
 */

function expandIt(el){
	if (DOM) {
 	imgDisplay=document.getElementById(el + "Image").style
 	childDisplay=document.getElementById(el + "Child").style
		if (childDisplay.visibility=="hidden") {
        		childDisplay.display="block";
        		childDisplay.visibility="visible";
        		imgDisplay.display="none";
        		imgDisplay.visibility="hidden";
		}
		else {
        	childDisplay.display="none";
       	 	childDisplay.visibility="hidden";
        	imgDisplay.display="block";
        	imgDisplay.visibility="visible";
    	}

	}

	if (IE4) {
 	imgDisplay=document.all(el + "Image").style
 	childDisplay=document.all(el + "Child").style
		if (childDisplay.display=="none") {
        	childDisplay.display="block"
			imgDisplay.display="none";
		}
		else {
        	childDisplay.display="none";
			imgDisplay.display="block";
        }
	}

}