
	function obtienePrefijo(thestring)
	{
		for (i = 0; i < thestring.length; i++) {
			ch = thestring.substring(i, i+1);
			if (ch >= "0" && ch <= "9")
			{
				return thestring.substring(0,i);
			}
		}
		return '';
	}
	
	function estableceEstiloCapa(id, property, action){
		if (document.getElementById) 
			eval("document.getElementById('" + id + "').style."+property+"='" + action + "'");
		else if (document.layers)
			eval("document." + id + "."+property+"='" + action + "'");
		else if (document.all)
			eval("document.all." + id + ".style."+property+"='" + action + "'");

	} 


	function getCapa(idCapa){ 
		capa=null;
		if (document.getElementById && document.getElementById(idCapa)==null) return null;
		if (document.layers) capa = eval("document." + idCapa);
		else if (document.all) capa = eval(idCapa + ".style");
		else if (document.getElementById) capa = eval('document.getElementById("'+idCapa+'").style');
		
		return capa;
	}
	
	
	function despliegaLinea(nombre){ 
		variable = true;
		prefijo = obtienePrefijo(nombre);
		for (i=0;i<100;i++)
		{
			nombreaux=prefijo+i;
			var obj = getCapa(nombreaux);
			if (!obj)
				continue;

			/*if ((nombreaux == nombre) && (obj.display != 'none'))
				variable=false;*/

			estableceEstiloCapa(nombreaux, "display", (document.layers) ? "hide" : "none" );
		
		}
		if (variable) {
			var obj = getCapa(nombre);
			if (!obj)
				return false;

/*			estableceEstiloCapa(nombre, "visibility", "visible" );
			estableceEstiloCapa(nombre, "display", "block" );*/
			estableceEstiloCapa(nombre, "display", (document.layers) ? "show" : "block" );

		}
		return false;
	}
	function desplegarTodos (){
		prefijo = obtienePrefijo(nombre);
		for (i=0;i<100;i++)
		{
			nombreaux=prefijo+i;
			var obj = getCapa(nombreaux); 
			//obj.visibility = (document.layers) ? "show" : "visible";
			estableceEstiloCapa(nombreaux, "display", (document.layers) ? "show" : "block" );
//			obj.display = 'block';
		}
	}


