// JavaScript Document
var currentid="";

arrow1= new Image(16,16); 
arrow2= new Image(16,16); 
arrow1.src="images/mnuClosed.png";
arrow2.src="images/mnuOpened.png";

/*
function getElem(id){
	if( document.getElementById ){ // this is the way the standards work
		elem = document.getElementById( id );
	}
	else if( document.all ){ // this is the way old msie versions work
		elem = document.all[id];
	}
	else if( document.layers ){ // this is the way nn4 works
		elem = document.layers[id];
	}
	return elem;
	
}
*/
function closeOpened(cat){
	elem=getElem(currentid);
	elem.style.display='none';
    imgName= currentid+"Arrow";
    
    img= getElem(imgName);
    img.src=arrow1.src;
    img.alt="Expand "+ cat;
}
function showSubs(id, cat){
	var elem, vis;
    cat = escape(cat);
	if(currentid!=""){	closeOpened(cat); }
    if(currentid!=id){
	    currentid=id;
	    elem=getElem(id);
	    vis = elem.style;
	      // if the style.display value is blank we try to figure it out here
	    if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined){
		    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
	    }
	    vis.display = (vis.display==''||vis.display=='block')?'none':'block';
          
        img= getElem(id+"Arrow");
        img.src=arrow2.src;
        img.alt="Collapse "+ cat;
    }
    else{
         currentid="";
    }
}

