Index: imagemenu.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagemenu/imagemenu.module,v
retrieving revision 1.7.2.2
diff -u -r1.7.2.2 imagemenu.module
--- imagemenu.module	22 Apr 2008 15:06:16 -0000	1.7.2.2
+++ imagemenu.module	2 Mar 2009 20:42:49 -0000
@@ -423,7 +423,27 @@
  * Generate the HTML output for a imagemenu item
  */
 function theme_imagemenu_item($item, $has_children, $prefix = '', $layout = 'vertical', $menu = '') {
-  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
+  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));;
+
+// Set active menu item by checking for path alias, then drupal path, then plain path.
+$active_path = drupal_lookup_path("alias", $_GET["q"]) ? drupal_lookup_path("alias", $_GET["q"]) : (drupal_lookup_path("source", $_GET["q"]) ? drupal_lookup_path("source", $_GET["q"]) :  $_GET["q"]);
+
+$item_path = drupal_lookup_path("alias", $item_path) ? drupal_lookup_path("alias", $item_path) : (drupal_lookup_path("source", $item_path) ? drupal_lookup_path("source", $item_path) :  $item_path);
+
+//check for <front>
+if ($active_path == variable_get('site_frontpage', '') && $item['path'] == '<front>') {
+  $active_path =$item['path'];
+}
+
+  if ($item['path'] == $active_path) {
+    $class .= ' current active-trail';
+    if ($item['mouseover']) {
+      $temp = $item['imagepath'];
+      $item['imagepath'] = $item['mouseover'];
+      $item['mouseover'] = $temp;
+    }
+  }
+
   switch ($layout) {
     case 'vertical':
       $listyle = '';

