startList = function() {
	var togleables = $('mainNavigation').getElementsByClassName("page");
	
	var scripts = new Array();
	for (i=0;i<togleables.length;i++) {
		scripts[i] = togleables[i];
	}

	scripts.each(function(togleable) {
		togleable.onclick = function() {			
			var stringId = this.id.replace("a_","ul_");			
			if(Element.hasClassName(this, "submenu") && !Element.visible($(stringId))) {
				this.className += " active";
				new Effect.BlindDown(stringId);	
				return false;				
			} else if(Element.hasClassName(this, "submenu") && Element.visible($(stringId))) {				
				new Effect.BlindUp(stringId);						
				return false;				
			} else {
				return true;	
			}					
					
		}
	});	
					
}
window.onload=startList;
