Adding inline javascript to add toggle functionality to index nodes