Wrap time/place and map in collapsing regions
Wrap time/place and map in collapsing regions

--- a/busui/common.inc.php
+++ b/busui/common.inc.php
@@ -226,8 +226,11 @@
         }
        $center = $totalLat/sizeof($mapPoints).",".$totalLon/sizeof($mapPoints);
     }
-    
-    return '<img src="staticmaplite/staticmap.php?center='.$center.'&zoom='.$zoom.'&size='.$width.'x'.$height.'&maptype=mapnik&markers='.$markers.'" width='.$width.' height='.$height.'>';
+    $output = "";
+    $output .= '<div data-role="collapsible" data-collapsed="true"><h3>Open Map...</h3>';
+    $output .= '<center><img src="staticmaplite/staticmap.php?center='.$center.'&zoom='.$zoom.'&size='.$width.'x'.$height.'&maptype=mapnik&markers='.$markers.'" width='.$width.' height='.$height.'></center>';
+    $output .= '</div>';
+    return $output;
 }
 
 function distance($lat1, $lng1, $lat2, $lng2)
@@ -390,4 +393,36 @@
     }
     return implode(", ",$pointNames);
 }
+
+function timePlaceSettings() {
+    global $service_periods;
+    echo '<div data-role="collapsible" data-collapsed="true">
+        <h3>Change Time/Place...</h3>
+        <div class="ui-body"> 
+		<div data-role="fieldcontain">
+	            <label for="geolocate"> Current Location: </label>
+			<input type="text" id="geolocate" name="geolocate" value="Enter co-ordinates or address here"/> <a href="#" style="display:none" name="here" id="here"/>Here?</a>
+	        </div>
+    		<div data-role="fieldcontain">
+		        <label for="time"> Time: </label>
+		    	<input type="time" value="'. date("H:m").'"/> <a href="#" style="display:none" name="currentTime" id="currentTime"/>Current Time?</a>
+	        </div>
+		<div data-role="fieldcontain">
+		    <label for="service_period"> Service Period:  </label>
+			<select name="service_period">';
+
+			   foreach ($service_periods as $service_period) {
+			    echo "<option value=\"$service_period\"".(service_period() === $service_period ? "SELECTED" : "").'>'.ucwords($service_period).'</option>';
+			   }
+			echo '</select>
+			<a href="#" style="display:none" name="currentPeriod" id="currentPeriod"/>Current Period?</a>
+		</div>
+		
+		<input type="submit" value="Update"/>
+            </div></div>';
+echo "	<script>
+$('#here').click(function(event) { $('#geolocate').val(getCookie('geolocate')); return false;});
+$('#here').show();
+        </script>";
+}
 ?>

--- a/busui/index.php
+++ b/busui/index.php
@@ -30,34 +30,8 @@
 		<li><a href="routeList.php?bynumber=yes">Routes By Number</a></li>
 		<li><a href="routeList.php?nearby=yes">Nearby Routes</a></li>
             </ul>
-            <div class="ui-body ui-body-c">
-		<h3>Time/Place Settings</h3>
-		<div data-role="fieldcontain">
-	            <label for="geolocate"> Current Location: </label>
-			<input type="text" id="geolocate" name="geolocate"/> <a href="#" style="display:none" name="here" id="here"/>Here?</a>
-	        </div>
-    		<div data-role="fieldcontain">
-		        <label for="time"> Time: </label>
-		    	<input type="time" value="<?php echo date("H:m"); ?>"/> <a href="#" style="display:none" name="currentTime" id="currentTime"/>Current Time?</a>
-	        </div>
-		<div data-role="fieldcontain">
-		    <label for="service_period"> Service Period:  </label>
-			<select name="service_period">	
-			   <?php
-			   foreach ($service_periods as $service_period) {
-			    echo "<option value=\"$service_period\"".(service_period() === $service_period ? "SELECTED" : "").'>'.ucwords($service_period).'</option>';
-			   }?>
-			</select>
-			<a href="#" style="display:none" name="currentPeriod" id="currentPeriod"/>Current Period?</a>
-		</div>
-		
-		<input type="submit" value="Update"/>
-            </div>
-	<script>
-$('#here').click(function(event) { $('#geolocate').val(getCookie('geolocate')); return false;});
-$('#here').show();
-        </script>
-        </div>
+<?php echo timePlaceSettings();?>
+        
    </div>
  </body>
 </html>