

function allclose() {

var controls = document.getElementsByTagName('UL') ;
	for (i=0; i < controls.length; i++){

		var ctrl=controls[i];

		if(ctrl.tagName=="UL" && ctrl.id.indexOf("sub_menu_")!=-1){	
			xDisplay(controls[i], "none");
			}
	//	}
	}
}
 
function openMenu(id){
var controls = document.getElementsByTagName('UL') ;
	for (i=0; i < controls.length; i++){
	var ctrl=controls[i];
	if(ctrl.tagName=="UL" && ctrl.id.indexOf("sub_menu_")!=-1 && (controls[i].id.length>10 || id.length==10)){
		xDisplay(ctrl, "none");//controls[i].style.display = "none";

		}
	}
	ctrl=document.getElementById(id);
	xVisibility(document.getElementById(id));
	if (xDisplay(ctrl) == ""){//if (document.getElementById(id).style.display == "block"){
		xDisplay(ctrl, "none");//document.getElementById(id).style.display = "none";
	}else{
		xDisplay(ctrl, "");//document.getElementById(id).style.display = "block"; 
	}
}

function thisclose(id, close){
//alert(id);
	ctrl=document.getElementById(id);
	//if(ctrl.tagName=="UL" && ctrl.id.indexOf("sub_menu_")!=-1)
	//{
if(close==null){
	xVisibility(ctrl);
		if (document.getElementById(id).style.display == "block"){
		document.getElementById(id).style.display = "none";
	}else{
		document.getElementById(id).style.display = "block"; 
	}
	
}else{
	xVisibility(ctrl, close);
}

	//alert(xVisibility(document.getElementById(id)));
		//document.getElementById(id).style.display = "block"; 
	//}
	//else{
//	if (document.getElementById(id).style.display == "block"){
//		document.getElementById(id).style.display = "none";
//	}else{
//		document.getElementById(id).style.display = "block"; 
////	}
//	}
}
function thisclose2(id, close){
//alert(id);
	ctrl=document.getElementById(id);

	xVisibility(ctrl, true);
ctrl.style.display = "block"; 
}
