var sections = ['general_info','statistical_info','obituary','event_info'];
var curSection = sections[0];
function changeSection(_go, _section) {
	var newSection = curSection;

	if (!_section) {
		var current = currentSection(sections);
		if (_go == true) {
			newSection = sections[((current+1) <= sections.length ? (current+1) : current)];
		}
		else if (_go != true) {
			newSection = sections[((current-1) >= 0 ? (current-1) : current)];
		}
	} else {
		newSection = _section;
	}

	if (newSection != curSection) {
		$(curSection + '_link').className = '';
		$(curSection).style.display = 'none';
		$(newSection + '_link').className = 'selected';
		$(newSection).style.display = '';
		curSection = newSection;
		
		var newCurrent = currentSection(sections);
		$('prev_button').disabled = (newCurrent > 0 ? false : true);
		$('next_button').disabled = (newCurrent < (sections.length-1) ? false : true);
	}
}
function currentSection(_group) {
	var num = 0;
	for(var i=0; i<_group.length; i++) {
		if (curSection == _group[i]) {
			num = i;
			break;
		}
	}
	
	return num;
}