Index: footermap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/footermap/footermap.module,v
retrieving revision 1.11.2.21
diff -u -p -r1.11.2.21 footermap.module
--- footermap.module	8 Oct 2009 18:34:15 -0000	1.11.2.21
+++ footermap.module	8 Oct 2009 18:34:57 -0000
@@ -236,8 +236,12 @@ function footermap_get_menu($mlid,$level
 	     $r = db_query("SELECT ml.* FROM {menu_links} ml WHERE ml.plid = %d AND ml.hidden <> -1".$add."ORDER BY ml.plid,ml.weight", $mlid)
 	          or die(db_error());
 
+  $mycount = 0;
 	while( $h = db_fetch_object($r) )
 	{
+		if ($level > 3 && $mycount < 5)
+			return;
+		$mycount++;
 		if (preg_match("/node\/(\d+)/",$h->link_path,$matches) == 1)
 	    	$node = node_load($matches[1]);
 	    $g = 0;
