function initMenu() {
  $('#accordion div').hide();
  $('#accordion h3:first').addClass('selected');
  $('#accordion div:first').show();
  $('#accordion h3').click(
	function() {
	// for the h3 in #accordian that has been clicked do this:
	  var checkElement = $(this).next(); //create a new variable called checkElement which is equal to the element after this h3
	  
	  if((checkElement.is('div')) && (checkElement.is(':visible'))) { // if checkElement is a div AND checkElement is visible then do:
		return false; 
		}
	  if((checkElement.is('div')) && (!checkElement.is(':visible'))) { // if checkElement is a div AND checkElement is not visible then do:
		$('#accordion h3').removeClass('selected'); //find all h2s in #accordian and remove the class 'selected'
		$('#accordion div:visible').slideUp('normal'); //find all visible divs in accordian and slide up
		$(this).addClass('selected'); //add the class 'selected' to this h2
		checkElement.slideDown('normal'); // slidedown checkElement
		return false;
		}
	  }
	);
  
  $('#accordion2 div').hide();
  $('#accordion2 h3:first').addClass('selected');
  $('#accordion2 div:first').show();
  $('#accordion2 h3').click(
	function() {
	// for the h3 in #accordian that has been clicked do this:
	  var checkElement = $(this).next(); //create a new variable called checkElement which is equal to the element after this h3
	  
	  if((checkElement.is('div')) && (checkElement.is(':visible'))) { // if checkElement is a div AND checkElement is visible then do:
		return false; 
		}
	  if((checkElement.is('div')) && (!checkElement.is(':visible'))) { // if checkElement is a div AND checkElement is not visible then do:
		$('#accordion2 h3').removeClass('selected'); //find all h2s in #accordian and remove the class 'selected'
		$('#accordion2 div:visible').slideUp('normal'); //find all visible divs in accordian and slide up
		$(this).addClass('selected'); //add the class 'selected' to this h2
		checkElement.slideDown('normal'); // slidedown checkElement
		return false;
		}
	  }
	);
  
  }


$(document).ready(function() {
initMenu();
});