/******************************************************************************
* Functions for expanding threads 
******************************************************************************/

function actionMenu(x,el) {
	expandIt(el);
	for (j=1; j<=x; j++) {
		Eltemp="m"+j
		if (Eltemp != el){
			whichEl = eval(Eltemp + "Child");
			whichEl.style.display = "none";
			img = eval("i" + Eltemp);
			img.src = "gifs/plus.gif";
		}
	}
}

function showAll() {
	for (i=firstInd; i<document.layers.length; i++) {
		whichEl = document.layers[i];
		whichEl.visibility = "show";
	}
}
/////////////////////////

	function getIndex(el) {
         ind = null;
         for (i=0; i<document.layers.length; i++) {
             whichEl = document.layers[i];
             if (whichEl.id == el) {
                 ind = i;
                 break;
             }
         }
         return ind;
     }



	function arrange() {
		nextY = document.layers[firstInd].pageY + document.layers[firstInd].document.height;
    	for (i=firstInd+1; i<document.layers.length; i++) {
			whichEl = document.layers[i];
            //alert("whichEl pagey: " + whichEl.pageY); 
			 if (whichEl.visibility != "hide") {
             	whichEl.pageY = nextY;
                nextY += whichEl.document.height;
             }
         }
     }



	function initIt(){
		//if (!ver4) return;
		
    	if (NS4) {
			for (i=0; i<document.layers.length; i++) {
        		whichEl = document.layers[i];
            	if (whichEl.id.indexOf("Child") != -1) whichEl.visibility = "hide";
			}
			arrange();
		}
        else {
            divColl = document.all.tags("DIV");
            for (i=0; i<divColl.length; i++) {
                 whichEl = divColl(i);
                 if (whichEl.className == "child") whichEl.style.display = "none";
    		}
		}
	}

	function expandIt(el) {
    	if (!ver4) return;
     	if (IE4) {
	 		whichEl = eval(el + "Child");
         	img = eval("i" + el);
			//img = event.srcElement;
         	if (whichEl.style.display == "none") {
            	whichEl.style.display = "block";
             	img.src = "gifs/minus.gif";        
         	}
         	else {
            	whichEl.style.display = "none";
             	img.src = "gifs/plus.gif";
         	}
     	}
     	else {
        	whichEl = eval("document." + el + "Child");
         	whichIm = eval("document." + el + "Parent.document.images['i" + el +"']");
         	if (whichEl.visibility == "hide") {
            	whichEl.visibility = "show";
             	whichIm.src = "gifs/minus.gif";
         	}
         	else {
            	whichEl.visibility = "hide";
             	whichIm.src = "gifs/plus.gif";
         	}
         	arrange();
     	}
	}

	function expandAll() {
         //if (!ver4) return;
         newSrc = (isExpanded) ? "gifs/plus.gif" : "gifs/minus.gif";
		 newBigSrc = (isExpanded) ? "gifs/bigplus.gif" : "gifs/bigminus.gif";
		if (NS4) {
             //document.images["imEx"].src = newSrc;
             //document.images["imBigEx"].src = newBigSrc;
			 
			 for (i=firstInd; i<document.layers.length; i++) {
                 whichEl = document.layers[i];
                 if (whichEl.id.indexOf("Parent") != -1) {
					whichEl.document.images["imEx"].src = newSrc;
				 }
				 if (whichEl.id.indexOf("End") != -1) {			
					whichEl.document.images["imBigEx"].src = newBigSrc;
				 }
                 if (whichEl.id.indexOf("Child") != -1) {
                     whichEl.visibility = (isExpanded) ? "hide" : "show";
                 }
             }

             arrange();
             if (isExpanded) scrollTo(0,document.layers[firstInd].pageY);
         }
         else {
             divColl = document.all.tags("DIV");
             for (i=0; i<divColl.length; i++) {
                 if (divColl(i).className == "child") {
                     divColl(i).style.display = (isExpanded) ? "none" : "block";
                 }
             }
             imColl = document.images.item("imEx");
             for (i=0; i<imColl.length; i++) {
                 imColl(i).src = newSrc;
				 //document.write("i" + imColl.length);
             }
			 imBigColl = document.images.item("imBigEx");
             for (i=0; i<imBigColl.length; i++) {
                 imBigColl(i).src = newBigSrc;
             }
         }
         
         isExpanded = !isExpanded;
     }

function closeAll(x,el) {
if (IE4) {
//x=number of colls

	//img_el = eval("i" + el);
	//if (img_el.src == "gifs/minus.gif")
	//	{
	//	exit;
	//	}
	divColl = document.all.tags("DIV");
	for (j=1; j<=x; j++) {
		
		Eltemp="m"+j
		whichEl = eval(Eltemp + "Child");
		whichEl.style.display = "none";
		img = eval("i" + Eltemp);
		img.src = "gifs/plus.gif";
		}
	}
else 
	{
	return;
	}
}

