function accordionMenu() {
	var accordionArray = new Array(); // create a default array
	var myDate = new Date();
	myDate.setDate(myDate.getDate()+30);

	$('.accordion tbody').hide();
	$('.accordion thead').click(
		function() {
			$(this).next().slideToggle('normal',function(){
				var id = $(this).attr('id'); // the ID of a sliding element, ex: "slide_3"
				var number = id.substring(6); // take just the number from the ID, ex: "3"
				if ($(this).is(':hidden')) {
					var state = "closed";
				} else if ($(this).is(':visible')) {
					var state = "open";
				}
				accordionArray[number] = state; // update the array to set the number of the element clicked to its new state, ex: groupsArray[3] = "open";
				$.cookie('accordionList', accordionArray, { expires: myDate }); // save the updated array as a cookie
				return false;
			 });
			return false;
		}
	);
	// if cookie exists, put data into an array
	if ($.cookie('accordionList')) {
		var temp = $.cookie('accordionList');
		var accordionList = new Array();
		accordionList = temp.split(',');
		// loop through array to find any sliding elements that should be opened
		for(var i=0; i < accordionList.length; i++) {
			// if an element is found in the cookie that should be opened, open it and update the array as well
			if (accordionList[i] == "open") {
				$('.accordion #slide_' + i).show();
				accordionArray[i] = "open";
			}
		}
	// cookie doesn't exist, so create one with all elements closed.
	} else {
		$.cookie('accordionList', accordionArray, { expires: myDate });
	}
}