if ( typeof( Xic_menutables ) == "undefined" ){
	var Xic_menutables = new Array();
	Xic_menutables[0]="menu";
}
if ( typeof( Xic_rowsprefix ) == "undefined" ){
	var Xic_rowsprefix = "menu_";
}
if ( typeof( Xic_menucolapse ) == "undefined" ){
	var Xic_menucolapse = 1;
}
var Xic_expand_menu_first_run=1;
function Show_Hide_Rows( node, menu_id ){
	for ( var swri = 0 ; swri < node.childNodes.length; swri++){
		var child = node.childNodes[swri];
		if ( (!child) || (child.nodeName != "TR") ) continue;
		var child_id = null;
		for ( var j = 0 ; j < child.childNodes.length ; j ++ ){
			inner_child = child.childNodes[j];
			if ( inner_child.nodeName.toUpperCase() == "TD" ){
				if ( inner_child.hasAttributes ){
					if ( inner_child.hasAttributes("NAME") ){ child_id = inner_child.getAttribute("NAME"); }
				} else{ child_id = inner_child.getAttribute("NAME"); }
			}
		}
		if ( (! child_id )||( child_id.indexOf('menu_') != 0 ) ) continue;
		if ( child_id == menu_id ){
			if (( Xic_menucolapse >= 1 )&&(!Xic_expand_menu_first_run)) { child.style.display =(child.style.display=="")?"none":""; } 
			else { child.style.display =""; }
		} else { child.style.display = "none"; }
	}
}
function Show_Hide_GetAll( menu_show ){
	aux_tables= new Array();
	if ( typeof(Xic_menutables) == "string" ){ aux_tables[0]=Xic_menutables; }
	else{ aux_tables = Xic_menutables; }
	for ( k = 0 ; k < aux_tables.length ; k++ ){
		this_table = document.getElementById(aux_tables[k]);	
		if ( ! this_table ) continue;
		table_nodes = this_table.childNodes;
		for ( j = 0 ; j < table_nodes.length ; j ++ ){
			node = table_nodes[j];
			if ( node.nodeName.toUpperCase() == "TBODY" ){
				Show_Hide_Rows(node,menu_show); 
			}
		}
	}
	Xic_expand_menu_first_run=0;
}
function Show_Hide( menu_item ){
	if ( ! menu_item ) return;
	if ( menu_item.hasAttributes ){
		if ( menu_item.hasAttributes("NAME") ){ name = menu_item.getAttribute("NAME"); }
	}else{ name = menu_item.getAttribute("NAME"); }
	if ( ( ! name ) || ( name.length <= 0 ) ) { return;	}	
	Show_Hide_GetAll(name);
}
function initial_All_Hide( menu_show ){
	Show_Hide_GetAll(menu_show);
}

