I think that it happens that your click handler is called on the first click, but your test ifdoes not work as you expect. This line:
if(node_list[i].style.display == 'none')
... , . : CSS, . , else , .display - 'none'. if .display 'block'.
, , , .display, : http://jsfiddle.net/uLjxp3ha/ (: alert() ).
, stylesheet, , . , .currentStyle .getComputedStyle(), , . .
, , , if/else:
if(node_list[i].style.display == 'block') {
node_list[i].style.display = 'none';
} else {
node_list[i].style.display = 'block';
}
.display 'block', else .
: http://jsfiddle.net/uLjxp3ha/1/