var sections = new Array();
addLoadEvent(initSections);
function initSections(){
	for(var i=0; i<10; i++){
		sections.push({head:$('head_'+i),page:$('page_'+i)});
		section = sections[sections.length-1];
		section.head.index = i;
		section.page.index = i;
		section.page.style.display = 'none';
		section.head.onmouseover = headOver;
		section.head.onmouseout = headOut;
	}
}
var opensection = 'f_';
function headClick(){
	if(opensection == 'f_'+this.index) return;
	
	var section = sections[this.index];
	opensection = 'f_'+this.index;
	if(section.page.style.display == 'none'){
		for(var i=0; i<sections.length; i++){
			sections[i].page.style.display = 'none';
			sections[i].head.className = 'headout';
		}
		section.page.style.display = 'block';
		section.head.className = 'headover';
	} else {
		section.page.style.display = 'none';
		section.head.className = 'headout';
	}
}
function headOver(){
	this.className = 'headover';
	headClick.apply(this);
}
function headOut(){
	if(sections[this.index].page.style.display == 'none')
		this.className = 'headout';
}
