var links = document.querySelectorAll('a');
var toggle = function() {
var showed = this.querySelector('.show');
var closed = this.querySelector('.close');
showed.className = 'close';
closed.className = 'show';
};
for (var i = 0; i < links.length; i++) {
links[i].onclick = toggle;
}