diff --git a/dhtml_menu.js b/dhtml_menu.js
index c69ca28..f9f9ca6 100644
--- a/dhtml_menu.js
+++ b/dhtml_menu.js
@@ -16,6 +16,11 @@ Drupal.dhtmlMenu.animation = {show:{}, hide:{}, count:0};
  */
 Drupal.behaviors.dhtmlMenu = {
   attach: function() {
+    // If there are no menus on the page bail out early and avoid errors
+    if (!$('ul.menu').length) {
+      return;
+    }
+        
     var settings = Drupal.settings.dhtmlMenu;
 
     // Initialize the animation effects from the settings.
