Index: trunk/src/map/inc/suggestions.php
===================================================================
--- trunk/src/map/inc/suggestions.php	(revision 7820)
+++ trunk/src/map/inc/suggestions.php	(revision 7822)
@@ -2,8 +2,15 @@
 require_once("../../config.php");
 require_once($config['root']."/map/inc/kmlHandler.php");
+/*
+ * Get the array containing all the nodes
+ */
+$markers = get_node_array($config['kml_file']);
 
-$markers = get_node_array($config['kml_file']);
+
 $suggested_markers = array();
 
+/*
+ * Get the value that has been sent in the url, if theres no value in the url, the value will be nothing.
+ */
 if(isset($_GET['value']))
 {
@@ -15,4 +22,7 @@
 }
 
+/*
+ * Fill the markernames array with all the names from markers we have on the map.
+ */
 foreach($markers as $marker)
 {
@@ -20,17 +30,24 @@
 }
 
+/*
+ * If the typed value is equal to the first part of a node name, the nodename is inserted into the $suggested_markers array
+ */
 if (strlen($typed_value) > 0)
-  {
+{
   for($i=0; $i<count($markernames); $i++)
     {
-	$hint= "";
-    if (strtolower($typed_value)==strtolower(substr($markernames[$i],0,strlen($typed_value))))
-      {
+		$hint= "";
+		if (strtolower($typed_value)==strtolower(substr($markernames[$i],0,strlen($typed_value))))
+		{
+			$suggested_markers[]=$markernames[$i];
+		}
+   }
+}
 
-        $suggested_markers[]=$markernames[$i];
-     }
-   }
- }
- 
+/*
+ * If there are no suggested markers, check if there is something that has been typed.
+ * If so there are no suggestions found.
+ * Else there has been nothing typed, so we show all the markers we have.
+ */
 if ($suggested_markers == null)
 {
@@ -45,4 +62,8 @@
 }
 
+/*
+ * Make a list with all the suggested markers we have. 
+ * onchange we call the goToMarker function in nodemapWL.js and set the constructor with the value of the selected option.
+ */
 echo "<select multiple onchange='goToMarker(this.options[this.selectedIndex].text)'>";
 foreach($suggested_markers as $name)
