function initSections() {
	$$('div[class~=section]').each(function(el) {
			if (el.id == 'header' || el.id == 'footer' || el.id == 'section_live') return;
			el.addClassName('closed');
	});	
	$$('div[class~=section] div.title').each(function(header) {
		Event.observe(header, 'click', function(event) {toggleSection(findParent(event.target, 'div[class~=section]'));});
		Event.observe(header, 'selectstart', function(){return false});
	});
}

function findParent(element, expression) {
	return Selector.matchElements(element.ancestors(), expression).first()
}

function toggleSection(section) {
	if (section.id == 'header' || section.id == 'footer' || section.id == 'section_live') return;
	section.toggleClassName('closed');
	if (!section.hasClassName('closed')) {
		$$('div[class~=section]').each(function(el) {
			if (el.id == 'header' || el.id == 'footer' || el.id == 'section_live' || el.id == section.id) return;
			el.addClassName('closed');
		});
	}
}

Event.observe(window, 'load', function() {
	if (navigator.appName != 'Opera') {
		initSections();
	}
});

