Index: trunk/ippMonitor/raw/DetrendSteps.php
===================================================================
--- trunk/ippMonitor/raw/DetrendSteps.php	(revision 9003)
+++ trunk/ippMonitor/raw/DetrendSteps.php	(revision 9008)
@@ -8,5 +8,12 @@
 
 // document body
-echo "Detrend Image Creation Steps<br>\n";
+echo "Detrend Image Creation<br>\n
+
+The pages in this section allow you to examine the master detrend
+images and the processing steps involved in their creation.  You may
+search through the detrend images which have been accepted by
+the detrend analysis system by selecting the Master Detrend Images tab.
+
+";
 
 menu_end();
Index: trunk/ippMonitor/raw/ipp.detrend.dat
===================================================================
--- trunk/ippMonitor/raw/ipp.detrend.dat	(revision 9003)
+++ trunk/ippMonitor/raw/ipp.detrend.dat	(revision 9008)
@@ -23,4 +23,5 @@
 
 menutop   | menutop      | plain   | &nbsp;                       | 
+menulink  | menuselect 	 | link    | Master Detrend Images        | masterDetrendImages.php
 menulink  | menuselect 	 | link    | Det Run                      | detRun.php                    
 menulink  | menuselect 	 | link    | Det Run Summary              | detRunSummary.php             
Index: trunk/ippMonitor/raw/ipp.php
===================================================================
--- trunk/ippMonitor/raw/ipp.php	(revision 9003)
+++ trunk/ippMonitor/raw/ipp.php	(revision 9008)
@@ -19,5 +19,6 @@
   // connect to the database
   require_once('DB.php');
-  $db = DB::connect("mysql://ipp:ipp@localhost/ipp");
+#  $db = DB::connect("mysql://ipp:ipp@localhost/ipp");
+  $db = DB::connect("mysql://ipp:ipp@localhost/detrend");
   if (DB::iserror($db)) {
     echo "<b>error accessing database</b><br>\n";
@@ -176,4 +177,49 @@
 }
 
+function check_restrict ($key, $where) {
+  // echo "key: $key<br>\n";
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $value = $_GET[$key]; 
+    // echo "using GET<br>\n";
+  } else {
+    $value = $_POST[$key];
+    // echo "using POST<br>\n";
+  }
+  // echo "value: $value<br>\n";
+  if ($value) {
+    if ($where) {
+      $where = $where . " AND $key = '$value'";
+      // echo "where 1: $where<br>\n";
+    } else {
+      $where = "$key = '$value'";
+      // echo "where 2: $where<br>\n";
+    }
+  }
+  return $where;
+}
+
+function write_query_row ($key) {
+  $value = $_POST[$key];
+  if (($_SERVER[REQUEST_METHOD] == 'POST') && $value) { 
+    echo "<td class=\"list\"> <input type=\"text\" name=\"$key\" value=\"$value\"> </td>\n";
+  } else {
+    echo "<td class=\"list\"> <input type=\"text\" name=\"$key\"> </td>\n";
+  }
+}
+
+// expect image supplied with key=name
+function insert_image ($key) {
+
+  if ($_SERVER[REQUEST_METHOD] == 'GET') { 
+    $name = $_GET[$key]; 
+  } else {
+    $name = $_POST[$key]; 
+  }
+
+  if ($name) {
+    echo "<img src=\"$name\">\n";
+  }
+}
+
 // $myPage = $_SERVER[SCRIPT_NAME] . "?pass=$pass";
 
