// JavaScript Document
var ref = document.location.href; 
ref = ref.substr( 7 ); 
var lista = ref.split( "/" ); 
lista.shift(); 
var path = '/'; //'http://'+lista.shift()+'/'; 

for( var i = 0; i < lista.length; i++ ) 
  if( lista[i].match( /^(inicio|index)\.(php|html?)/ ) ) 
    lista[i] = ""; 

lista.unshift( "inicio.html" ); 

var buffer = new Array(); 

for( var i = 0; i < lista.length; i++ ) { 
  if( normal( lista[i] ) == "" ) continue; 
  if( lista[i].indexOf(".") == -1 ) 
    path += lista[i]+'/'; 
  if( i == lista.length-1 ) 
    buffer.push( normal( lista[i] ) ); 
  else 
    buffer.push( '<a class="blanco" href="'+path+'">'+normal( lista[i] )+'</a>' ); 
} 


document.write( buffer.join( " > " ) ); 

function normal( string ) { 
  string = string.replace( /[^a-z0-9_].*/gi, "" ); 
  string = string.replace( /^\d+_/, "" ); 
  string = string.replace( /nnn/g, "ñ" ); 
  
  var s = string.split( "_" ); 
  for( var i = 0; i < s.length; i++ ) 
    if( s[i].length > 1 ) 
      s[i] = s[i].charAt(0).toUpperCase() + s[i].substr( 1 ); 
  return s.join( " " ); 
} 

