var lock_especial=0;

function Show_Hide_Rows( node, menu_id ){
	var child;
	var children = node.childNodes;
	var aux_id="";
	var child_id="";
	var top_val=-1;
	for ( var swri = 0 ; swri < children.length; swri++){
	
		child = children[swri];
		child_id = null;
		
		if ( child.hasAttributes ){
			if ( child.hasAttributes("ID") ){
				child_id = child.getAttribute("ID");
			}
		}else{
			child_id = child.getAttribute("ID");
		}
		
		if ( ! child_id ) continue;
		
		if ( child_id.indexOf('menu_') != 0 ) continue;
		if ( child_id == menu_id ){
			if ( (aux_id != child_id)||(lock_especial) ){
				child.style.display =""; 
			} else {
				child.style.display =(child.style.display=="")?"none":""; 
			}
		} else { 
			if ( aux_id == child_id ){
				child.style.display = "none";
			}
		}
		aux_id = child_id;
	}
}

function Show_Hide_GetAll( menu_show ){
	var all_nodes = document.getElementsByName("menu");
	var this_table;
	var table_nodes;
	var node;
	var objectId='menu';
	for ( var i = 0 ; i < all_nodes.length ; i++ ){
		this_table = all_nodes[i];
		table_nodes=this_table.childNodes;
		for ( var j = 0 ; j < table_nodes.length ; j ++ ){
			node = table_nodes[j];
			if ( (node.nodeName) && (node.nodeName.toUpperCase() == "TBODY") ){
					Show_Hide_Rows(node,menu_show);
			}
		}
	}
}

function Show_Hide( menu_item ){
	var menu_id,menu_obj, aux_obj;
	
	menu_obj = menu_item;
	while ( menu_obj.tagName.toUpperCase() != "TR" ){
		menu_obj = menu_obj.parentNode;
	}
	menu_id = menu_obj.id;
	if ( menu_id.length <= 0 ) {
		return;
	}	
	Show_Hide_GetAll(menu_id);
}

function initial_All_Hide( menu_show ){
	lock_especial =1;
	Show_Hide_GetAll(menu_show);
	lock_especial =0;
}
