var CommentRollouts = {
	init: function() {
		$$('div.comments').each(function(comments_div) {
			comments_div.setStyle({'display': 'none'});
		});
	},
	
	toggle: function(comment_id) {
		var div = $('comments_for_entry_' + comment_id);
		var toggle_button = $('toggle_comments_for_entry_' + comment_id);
		if (div.getStyle('display') == 'none') {
			toggle_button.innerHTML = 'Hide comments';
		} else {
			toggle_button.innerHTML = 'Show comments';
		}
		div.toggle();
	}
}

Event.observe(window, 'load', CommentRollouts.init);