//incluye el conjunto de funciones generales
document.write ("<script language='javascript' src='/on/io/js/funciones.js'></script>");

//Esta función crea tres variables globales en la página desde la que se llame, llamadas "path_in" que contiene el path pasado como parámetro, "path" que contiene el path a mostrar en la pagina actual y "path_out" que contiene el path a pasar a otras páginas
//Requiere un parámetro (texto_path_pagina_act) que contiene el texto representativo de la página actual
//Si se quiere que se encadenen los path, la variable que se pase como parámetro que contenga el path se debe llamar "path" (.html?path=...) normalmente (.html?path=escape(path_out))
//Si la página actual no recibe un parámetro llamado "path" no mostrará path en la página actual ya que sólo mostraría un elemento en el path que hace referecia a la página actual y además no enlazable
function generar_paths (texto_path_pagina_act){
	if (texto_path_pagina_act == null)
		texto_path_pagina_act = "página actual";

  var path_in = getParametro('path');
	if (path_in == null) path_in = "";

  
  ///////////////////////////
  //Prueba desarrollo
  //path_in="/lm/es/priv/seg00/servlet/LMIVRServlet|||Selecci&oacute;n del n&uacute;mero de tel&eacute;fono|||/lm/es/priv/seg00/servlet/LMIVRServlet|||Todos los tel&eacute;fonos|||/lm/es/priv/seg00/servlet/LMIVRServlet|||Lista de Servicios 881969688|||Dominios, correo y espacio web";
  //path_in="/lm/es/priv/seg00/servlet/LMIVRServlet|||Selecci&oacute;n del n&uacute;mero de tel&eacute;fono|||/lm/es/priv/seg00/servlet/LMIVRServlet|||Todos los tel&eacute;fonos|||/lm/es/priv/seg00/servlet/LMIVRServlet|||Lista de Servicios 881969688|||/lm/es/priv/seg00/servlet/LMIVRServlet|||Dominios, correo y espacio web";
  ///////////////////////////
  //INICIO 218626 ON.RF.001
  try
  {     
     if (path_in != "")
	 {
		//INICIO ON_PCAMBIO_642
		
		while (path_in.indexOf('++++')!=-1)
		{
			path_in = path_in.replace("++++","=");
		}	 		
		
		while (path_in.indexOf('+++')!=-1)
		{
			path_in = path_in.replace("+++","&");
		}	 

		while (path_in.indexOf('||||')!=-1)
		{
			path_in = path_in.replace("||||","acute;");
		}	 		
		//FIN ON_PCAMBIO_642
		
        var tokens = path_in.split("|||");
        path_in = "";
        
        for(var i=0; i<tokens.length; i++)
        {
          if (i == tokens.length-1 && (i % 2 == 0))
          {
            path_in += "<span class=\"texto3_1\"> "+ tokens[i] +"</span>";
          }
          else
          {
            if (i % 2 == 0)
            {
              path_in += "<a href=\""+ tokens[i] +"\" class=\"texto3_4\">";
              //path_in += "<a href=\"http://10.223.8.100:9606"+ tokens[i] +"\" class=\"texto3_4\">";
            }
            else
            {
              path_in += tokens[i] + "  > </a>";
            }
          }
        }
      }
      else
      {
        path_in = getParametro('path');
        if (path_in == null) path_in = "";
      }
  }
  catch(e)
  {
    path_in = getParametro('path');
    if (path_in == null) path_in = "";
  }
////FIN 218626 ON.RF.001
	//paths por defecto
	path = "";
	path_out = "<a href='"+encodeURIComponent(window.location.protocol+"//"+window.location.host+window.location.pathname)+escape(window.location.search)+"' class='texto3_4'>" + texto_path_pagina_act + " &gt; </a>";
  //path_out = "<a href='"+encodeURIComponent("http:"+"//10.223.8.100:9606/"+window.location.pathname)+escape(window.location.search)+"' class='texto3_4'>" + texto_path_pagina_act + " &gt; </a>";
	//si recibimos un path, cambiamos los path por defecto para incluir el path recibido
	if (path_in != "") {
		path_in  = unescape(path_in);
		path	 = path_in + "<span class='texto3_1'> " + texto_path_pagina_act + "</span>"
		path_out = path_in + path_out;
	}

	path_out = escape (path_out);
}


function mantener_path (pagina){

document.location.href = pagina + '?path=' + escape(path_in);

}
