var fileName = location.pathname.substring(location.pathname.lastIndexOf('\/')+1);
 if (top.location == self.location)
{
 fileName = fileName.substring(0, fileName.lastIndexOf('.'));
 self.location.replace("index.php?fnn=" + fileName)
} 



/* lastIndexOf('\/')+1 Geef de positie precies 1 teken voorbij de positie van het laatste / teken in de string. Dat wordt gebruikt om uit de volledige http://www.andersites.nl/agenda.php tekst de naam van het bestandje te vissen, dus het resultaat is dat je agenda.php als tekst hebt, die je gebruikt om mee te geven
fileName = fileName.substring(0, fileName.lastIndexOf('.'));
Haalt de extensie .php weg */
