function addMenuHovers() {

  // add the mouseover code
  $('#menu').children('li').each(
    function() {
      $(this).hover(
        function() { $(this).addClass('on'); },
        function() { $(this).removeClass('on'); }
      );
    });
};
$(addMenuHovers);