
var ns6 = document.getElementById&&!document.all?1:0
var head = "display:''";
var folder = '';

function expandit_b(curobj){
	folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+2].style
	if (folder.display=="none") folder.display=""
	else folder.display="none"
}

function expandithome(id){
	cierratodos();
	//folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex].style
	folder = document.getElementById(""+id+"").style;
	if (folder.display=="none") folder.display="";
	else folder.display="none";
}

function expandit(id, fijo){
	if(fijo == 0){
		expandithome(id);
	}
	else{
		cierratodos();
		//folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex].style
		folder = document.getElementById(""+id+"").style;
		folderopen = document.getElementById(""+fijo+"").style;
		if (folder.display=="none"){
			folder.display = "";
		}
		else{
			folder.display = "none";
		}
		folderopen.display="";
	}
}

function expandeocontrae(id, prefijo){
	if(ns6 == 1){
		folder = document.getElementById(id).style;
	}
	else{
		folder = eval(id+".style");
	}
	if(folder.display == "none"){
		if(prefijo != ""){
			contraetodos(prefijo);
		}
		folder.display = "";
	}
	else{
		contraetodos(prefijo);
		folder.display = "none";
	}
}

function expande(id, prefijo){
	contraetodos(prefijo);
	folder = document.getElementById(id);
	// folder.class = "act"
	folder.style.display = "";
} // fin función expande

function contraetodos(prefijo){
	var i = 0;
	while(true){
		id = prefijo + i;
		if(document.getElementById(id) != undefined){
			// document.getElementById(id).class ="act"
			document.getElementById(id).style.display = "none";
		}
		else{
			return(true);
		} // fin condición
		i++;
	} // fin iteración
} // fin función contraetodos

function cierratodos(){
	id=1;
	folder = document.getElementById(""+id+"").style;
	folder.display = "none";
	id=2;
	folder = document.getElementById(""+id+"").style;
	folder.display = "none";
	id=3;
	folder = document.getElementById(""+id+"").style;
	folder.display = "none";
}

contraetodos();

function mostrar(nombreCapa){
	document.getElementById(nombreCapa).style.visibility = "visible";
}
 
function ocultar(nombreCapa){
	document.getElementById(nombreCapa).style.visibility = "hidden"; 
}


////////////////Nuevas Ramon //////////////////

function decoloreatodos(prefijo, excepcion){
	var i = 0;
	while(true){
		id = prefijo + i;
		//alert(id);
		if(id != excepcion){
			if(document.getElementById(id) != undefined){
				// document.getElementById(id).class ="act"
					chBGImage(document.getElementById(id), '');
			}
			else{
				return(true);
			} // fin condición
		}
		i++;
	} // fin iteración
} // fin función decoloreatodos

function chMOver(obj, estado){
	// estado 1: nivel 1 selected
	// estado 2: nivel 1 NONselected
	// estado 3: nivel 2 selected
	// estado 4: nivel 2 NONselected
	switch(estado){
		case 1:
			// nothing
		break;
		case 2:
			chBGImage(obj, 'images/li_hover.gif');
		break;
		case 3:

		break;
		case 4:

		break;
	} // fin condición
} // fin función

function chMOut(obj, estado, idsubmenu){
	// estado 1: nivel 1 selected
	// estado 2: nivel 1 NONselected
	// estado 3: nivel 2 selected
	// estado 4: nivel 2 NONselected
	switch(estado){
		case 1:
			// nothing
		break;
		case 2:
			var submenu = document.getElementById(idsubmenu);
			if(submenu.style.display == "none"){
				chBGImage(obj, '');
			}
		break;
		case 3:

		break;
		case 4:

		break;
	} // fin condición
} // fin función

function intercambiarExpansionById(id) {

	try {
		if(document.getElementById(id).style.display == "none") {
			document.getElementById(id).style.display = "";
		} else{
			document.getElementById(id).style.display = "none";
		}
	}
	catch(e){
		// alert(e);
	}
}

function chObjectExpansion(obj) {
	try{
		if(obj.style.display == "none") {
			obj.style.display = "";
		}
		else{
			obj.style.display = "none";
		}
	}
	catch(e){
		// alert(e);
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
		  ventana=window.open(theURL,winName,features);
		  ventana.focus();
}
		
