//the main function, call to the effect object

function init(){
	var stretchers = document.getElementsByClassName('submenu');
	var toggles = document.getElementsByClassName('menusection');

	//accordion effect
	var myAccordion = new fx.Accordion(
		toggles, stretchers, {duration: 500, opacity: true}
	);

	//hash function
	function checkHash(){
		var found = false;
		toggles.each(function(h3, i){
			if (window.location.href.indexOf(h3.title) > 0) {
				myAccordion.showThisHideOpen(stretchers[i]);
				found = true;
			}
		});
		return found;
	}
	if (!checkHash()) myAccordion.showThisHideOpen(stretchers[0]);
}
 
