Index: /trunk/ippMonitor/Makefile
===================================================================
--- /trunk/ippMonitor/Makefile	(revision 9438)
+++ /trunk/ippMonitor/Makefile	(revision 9439)
@@ -31,4 +31,5 @@
 $(DESTBIN)/detMasterFrame.php \
 $(DESTBIN)/detMasterImfile.php \
+$(DESTBIN)/detNormalizedExp.php \
 $(DESTBIN)/detNormalizedImfile.php \
 $(DESTBIN)/detNormalizedStatImfile.php \
@@ -58,30 +59,7 @@
 
 PICTURES = \
-$(DESTBIN)/PScolorlogo2.jpg \
-$(DESTBIN)/flat_1_0.b1.jpeg \
-$(DESTBIN)/flat_1_0.b2.jpeg \
-$(DESTBIN)/pic.png
+$(DESTBIN)/PScolorlogo2.jpg
 
-DEMOPICS = \
-$(DESTBIN)/806237f.detresid.3.0.b1.jpg \
-$(DESTBIN)/806237f.detresid.3.0.b2.jpg \
-$(DESTBIN)/806238f.detresid.3.0.b1.jpg \
-$(DESTBIN)/806238f.detresid.3.0.b2.jpg \
-$(DESTBIN)/806239f.detresid.3.0.b1.jpg \
-$(DESTBIN)/806239f.detresid.3.0.b2.jpg \
-$(DESTBIN)/838749d.detresid.2.0.b1.jpg \
-$(DESTBIN)/838749d.detresid.2.0.b2.jpg \
-$(DESTBIN)/838790d.detresid.2.0.b1.jpg \
-$(DESTBIN)/838790d.detresid.2.0.b2.jpg \
-$(DESTBIN)/838791d.detresid.2.0.b1.jpg \
-$(DESTBIN)/838791d.detresid.2.0.b2.jpg \
-$(DESTBIN)/850131b.detresid.1.0.b1.jpg \
-$(DESTBIN)/850131b.detresid.1.0.b2.jpg \
-$(DESTBIN)/850132b.detresid.1.0.b1.jpg \
-$(DESTBIN)/850132b.detresid.1.0.b2.jpg \
-$(DESTBIN)/850133b.detresid.1.0.b1.jpg \
-$(DESTBIN)/850133b.detresid.1.0.b2.jpg
-
-php: $(RAWSRC) $(DEFSRC) $(PICTURES) $(DEMOPICS)
+php: $(RAWSRC) $(DEFSRC) $(PICTURES)
 
 # dependancy rules for binary code #########################
Index: /trunk/ippMonitor/def/autocode.php
===================================================================
--- /trunk/ippMonitor/def/autocode.php	(revision 9438)
+++ /trunk/ippMonitor/def/autocode.php	(revision 9439)
@@ -4,9 +4,9 @@
 
 $ID = checkID ();
-if ($ID['proj']) {
-  $db = dbconnect($ID['proj']);
-} else {
-  $db = dbconnect('detrend');
-}
+
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+$db = dbconnect($ID['proj']);
 
 if ($ID['menu']) {
@@ -16,5 +16,5 @@
 }
 
-menu($myMenu, '$TITLE', '$STYLE', $ID['link']);
+menu($myMenu, '$TITLE', '$STYLE', $ID['link'], $ID['proj']);
 
 echo "<p> $TITLE </p>";
@@ -25,7 +25,7 @@
 // query the database
 if ($WHERE) {
-  $sql = "SELECT $FIELDS FROM $TABLE WHERE $WHERE LIMIT 20";
+  $sql = "SELECT $FIELDS FROM $TABLE WHERE $WHERE LIMIT 40";
 } else {
-  $sql = "SELECT $FIELDS FROM $TABLE LIMIT 20";
+  $sql = "SELECT $FIELDS FROM $TABLE LIMIT 40";
 }
 
Index: /trunk/ippMonitor/def/detNormalizedExp.d
===================================================================
--- /trunk/ippMonitor/def/detNormalizedExp.d	(revision 9438)
+++ /trunk/ippMonitor/def/detNormalizedExp.d	(revision 9439)
@@ -4,11 +4,11 @@
 MENU  ipp.detrend.dat
 
-#     field     name     show   link to     extras
-FIELD det_id, 20,   det_id
-FIELD iteration, 20,   iteration
-FIELD bg, 20, bg
-FIELD bg_stdev, 20, bg_stdev
-FIELD bg_mean_stdev, 20, bg_mean_stdev
-FIELD b1_uri, 20,   b1_uri
-FIELD b2_uri, 20,   b2_uri
-FIELD recipe, 20,   recipe
+#     field        size     name       show            link to                  extras
+FIELD det_id,        7,     det_id
+FIELD bg,            8,     backgnd
+FIELD bg_mean_stdev, 8,     [stdev]
+FIELD bg_stdev,      8,     stdev
+FIELD iteration,     5,     iteration
+FIELD b2_uri,        8,     image,     image=$b2_uri,  detNormalizedImfile.php, det_id=$det_id,iteration=$iteration,image=$b1_uri
+#FIELD b1_uri, 20,   b1_uri
+#FIELD recipe, 20,   recipe
Index: /trunk/ippMonitor/def/detNormalizedImfile.d
===================================================================
--- /trunk/ippMonitor/def/detNormalizedImfile.d	(revision 9438)
+++ /trunk/ippMonitor/def/detNormalizedImfile.d	(revision 9439)
@@ -4,12 +4,14 @@
 MENU  ipp.imfiles.dat
 
-#     field     name     show   link to     extras
-FIELD det_id, 20,   det_id
-FIELD iteration, 20,   iteration
-FIELD class_id, 20,   class_id
-FIELD uri, 20,   uri
-FIELD bg, 20, bg
-FIELD bg_stdev, 20, bg_stdev
-FIELD bg_mean_stdev, 20, bg_mean_stdev
-FIELD b1_uri, 20,   b1_uri
-FIELD b2_uri, 20,   b2_uri
+#     field          size name     show   link to     extras
+FIELD det_id,          7, det_id
+FIELD class_id,        8, class_id
+FIELD bg,              8, backgnd
+FIELD bg_stdev,        8, stdev
+FIELD iteration,       5, iteration
+#FIELD uri,           20, uri
+#FIELD bg_mean_stdev, 20, bg_mean_stdev
+#FIELD b1_uri,        20, b1_uri
+#FIELD b2_uri,        20, b2_uri
+
+TAIL PHP insert_image ('image');
Index: /trunk/ippMonitor/def/detProcessedExp.d
===================================================================
--- /trunk/ippMonitor/def/detProcessedExp.d	(revision 9438)
+++ /trunk/ippMonitor/def/detProcessedExp.d	(revision 9439)
@@ -8,7 +8,7 @@
 FIELD exp_tag, 	 15,   Exposure,  value
 FIELD b2_uri, 	  8,   image,     image=$b2_uri,  detProcessedImfile.php, det_id=$det_id,exp_tag=$exp_tag,image=$b1_uri
-FIELD bg, 	 10,   bg,        value
-FIELD bg_stdev,  10,   bg_stdev,  value
+FIELD bg, 	  8,   backgnd,   value
+FIELD bg_mean_stdev, 8, [stdev],  value
+FIELD bg_stdev,   8,   stdev,     value
 FIELD recipe,    15,   Recipe,    value
 FIELD b1_uri,  	 20,   b1_uri,    none
-# FIELD bg_mean_stdev, 20, bg_mean_stdev
Index: /trunk/ippMonitor/def/detResidExp.d
===================================================================
--- /trunk/ippMonitor/def/detResidExp.d	(revision 9438)
+++ /trunk/ippMonitor/def/detResidExp.d	(revision 9439)
@@ -4,13 +4,13 @@
 MENU  ipp.detrend.dat
 
-#     field     size     name       show            link to             extras
-FIELD det_id,     7,   	 Det ID,    value
-FIELD exp_tag, 	 15,   	 Exposure,  value,          rawImfile.php,      exp_tag=$exp_tag
-FIELD b2_uri, 	  8,   	 image,     image=$b2_uri,  detResidImfile.php, det_id=$det_id,iteration=$iteration,exp_tag=$exp_tag,image=$b1_uri
-FIELD bg,         8,   	 backgnd,   value
-FIELD bg_stdev,   8,   	 bg_stdev,  value
-FIELD iteration,  5,   	 iter,      value
-FIELD accept,     4,   	 keep,      value
-FIELD b1_uri, 	 20,   	 b1_uri,    none
-# FIELD bg_mean_stdev, 20,   bg_mean_stdev
-# FIELD recipe, 	 15,   	 recipe,    value
+#     field        size    name       show            link to             extras
+FIELD det_id,        7,    Det ID,    value
+FIELD exp_tag, 	    15,    Exposure,  value,          rawImfile.php,      exp_tag=$exp_tag
+FIELD b2_uri, 	     8,    image,     image=$b2_uri,  detResidImfile.php, det_id=$det_id,iteration=$iteration,exp_tag=$exp_tag,image=$b1_uri
+FIELD bg,            8,    backgnd,   value
+FIELD bg_mean_stdev, 8,    [stdev]
+FIELD bg_stdev,      8,    stdev,     value
+FIELD iteration,     5,    iter,      value
+FIELD accept,        4,    keep,      value
+FIELD b1_uri, 	    20,    b1_uri,    none
+# FIELD recipe,     15,    recipe,    value
Index: /trunk/ippMonitor/def/detRun.d
===================================================================
--- /trunk/ippMonitor/def/detRun.d	(revision 9438)
+++ /trunk/ippMonitor/def/detRun.d	(revision 9439)
@@ -5,5 +5,5 @@
 
 #     field      name         show    link to              extras
-FIELD position,  20,   det ID,      value,  detRunSummary.php,   det_id=$position
+FIELD det_id,    20,   det ID,      value,  detRunSummary.php,   det_id=$det_id
 FIELD iteration, 20,   iteration
 FIELD det_type,  20,   det_type
Index: /trunk/ippMonitor/def/example.d
===================================================================
--- /trunk/ippMonitor/def/example.d	(revision 9438)
+++ /trunk/ippMonitor/def/example.d	(revision 9439)
@@ -9,5 +9,5 @@
 # the following WHERE clauses are added to all queries joined by AND
 WHERE detRunSummary.accept = 1
-WHERE detRun.position = detRunSummary.det_id
+WHERE detRun.det_it = detRunSummary.det_id
 WHERE detRun.iteration = detRunSummary.iteration
 
@@ -26,4 +26,4 @@
 # SELECT detRunSummary.det_id,detRunSummary.iteration,detRunSummary.iteration,detRun.det_type,detRunSummary.bg,detRunSummary.bg_stdev \
 # FROM detRunSummary, detRun \
-# WHERE detRunSummary.accept = 1 AND detRun.position = detRunSummary.det_id AND detRun.iteration = detRunSummary.iteration \
+# WHERE detRunSummary.accept = 1 AND detRun.det_id = detRunSummary.det_id AND detRun.iteration = detRunSummary.iteration \
 # LIMIT 20
Index: /trunk/ippMonitor/def/masterDetrendFrames.d
===================================================================
--- /trunk/ippMonitor/def/masterDetrendFrames.d	(revision 9438)
+++ /trunk/ippMonitor/def/masterDetrendFrames.d	(revision 9439)
@@ -9,14 +9,14 @@
 # the following WHERE clauses are added to all queries joined by AND
 WHERE detRunSummary.accept = 1
-WHERE detRun.position = detRunSummary.det_id
+WHERE detRun.det_id = detRunSummary.det_id
 WHERE detRun.iteration = detRunSummary.iteration
 
-#     field                    width name          show         link to            extras
-FIELD detRunSummary.det_id,    7,    det_id,       value,       detRunSummary.php, det_id=$detRunSummary.det_id
+#     field                    width name          show         link to                   extras
+FIELD detRunSummary.det_id,    7,    det_id,       value,       detRunSummary.php,        det_id=$detRunSummary.det_id
 FIELD detRunSummary.iteration, 5,    iter
 FIELD detRun.det_type,         5,    type
-FIELD *,                       20,   choose,       value=files, masterDetrendImfiles.php,  det_id=$detRunSummary.det_id,iteration=$detRunSummary.iteration
-FIELD *,                       20,   choose,       value=input, detInputExp.php,  det_id=$detRunSummary.det_id,iteration=$detRunSummary.iteration
-FIELD *,                       20,   choose,       value=resid, detResidExp.php,  det_id=$detRunSummary.det_id,iteration=$detRunSummary.iteration
+FIELD *,                       20,   choose,       value=files, detNormalizedImfiles.php, det_id=$detRunSummary.det_id,iteration=$detRunSummary.iteration
+FIELD *,                       20,   choose,       value=input, detInputExp.php,          det_id=$detRunSummary.det_id,iteration=$detRunSummary.iteration
+FIELD *,                       20,   choose,       value=resid, detResidExp.php,          det_id=$detRunSummary.det_id,iteration=$detRunSummary.iteration
 FIELD detRunSummary.bg,        20,   bg
 FIELD detRunSummary.bg_stdev,  20,   bg_stdev
@@ -27,4 +27,4 @@
 # SELECT detRunSummary.det_id,detRunSummary.iteration,detRunSummary.iteration,detRun.det_type,detRunSummary.bg,detRunSummary.bg_stdev \
 # FROM detRunSummary, detRun \
-# WHERE detRunSummary.accept = 1 AND detRun.position = detRunSummary.det_id AND detRun.iteration = detRunSummary.iteration \
+# WHERE detRunSummary.accept = 1 AND detRun.det_id = detRunSummary.det_id AND detRun.iteration = detRunSummary.iteration \
 # LIMIT 20
Index: /trunk/ippMonitor/raw/DetrendSteps.php
===================================================================
--- /trunk/ippMonitor/raw/DetrendSteps.php	(revision 9438)
+++ /trunk/ippMonitor/raw/DetrendSteps.php	(revision 9439)
@@ -5,5 +5,8 @@
 $ID = checkID ();
 
-menu('ipp.detrend.dat', 'Detrend Steps', 'ipp.css', $ID['link']);
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+menu('ipp.detrend.dat', 'Detrend Steps', 'ipp.css', $ID['link'], $ID['proj']);
 
 // document body
Index: /trunk/ippMonitor/raw/ImfileTables.php
===================================================================
--- /trunk/ippMonitor/raw/ImfileTables.php	(revision 9438)
+++ /trunk/ippMonitor/raw/ImfileTables.php	(revision 9439)
@@ -5,5 +5,8 @@
 $ID = checkID ();
 
-menu('ipp.imfiles.dat', 'Imfile Tables', 'ipp.css', $ID['link']);
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+menu('ipp.imfiles.dat', 'Imfile Tables', 'ipp.css', $ID['link'], $ID['proj']);
 
 // document body
Index: /trunk/ippMonitor/raw/LoadSetup.php
===================================================================
--- /trunk/ippMonitor/raw/LoadSetup.php	(revision 9438)
+++ /trunk/ippMonitor/raw/LoadSetup.php	(revision 9439)
@@ -5,5 +5,8 @@
 $ID = checkID ();
 
-menu('ipp.copy.dat', 'Load and Setup', 'ipp.css', $ID['link']);
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+menu('ipp.copy.dat', 'Load and Setup', 'ipp.css', $ID['link'], $ID['proj']);
 
 // document body
Index: /trunk/ippMonitor/raw/Login.php
===================================================================
--- /trunk/ippMonitor/raw/Login.php	(revision 9438)
+++ /trunk/ippMonitor/raw/Login.php	(revision 9439)
@@ -4,5 +4,5 @@
 
 if (($_SERVER[REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {
-  menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
+  menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
   echo "Invalid Client Request<br>\n";
   menu_end ();
@@ -14,5 +14,5 @@
   $ID = checkID ();
 
-  menu ('ipp.menu.dat', 'Login', 'ipp.css', $ID['link']);
+  menu ('ipp.menu.dat', 'Login', 'ipp.css', $ID['link'], $ID['proj']);
 
   $pass = $ID['pass'];
@@ -34,5 +34,5 @@
     $ID = checkLogin ();
 
-    menu ('ipp.menu.dat', 'Login', 'ipp.css', $ID['link']);
+    menu ('ipp.menu.dat', 'Login', 'ipp.css', $ID['link'], $ID['proj']);
     echo "Login Accepted\n";
     menu_end();
@@ -41,5 +41,5 @@
 
   if (key_exists (logout, $_POST)) {
-    menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
+    menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
     echo "You are now logged out<br>\n";
     logintext ();
@@ -50,5 +50,5 @@
 
   // missing a valid POST state (login or logout)
-  menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
+  menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
   echo "Invalid Client Post Request<br>\n";
   foreach ($_POST as $key => $value) {
Index: /trunk/ippMonitor/raw/ScienceSteps.php
===================================================================
--- /trunk/ippMonitor/raw/ScienceSteps.php	(revision 9438)
+++ /trunk/ippMonitor/raw/ScienceSteps.php	(revision 9439)
@@ -5,5 +5,8 @@
 $ID = checkID ();
 
-menu('ipp.science.dat', 'Science Steps', 'ipp.css', $ID['link']);
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+menu('ipp.science.dat', 'Science Steps', 'ipp.css', $ID['link'], $ID['proj']);
 
 // document body
Index: /trunk/ippMonitor/raw/SelectProject.php
===================================================================
--- /trunk/ippMonitor/raw/SelectProject.php	(revision 9438)
+++ /trunk/ippMonitor/raw/SelectProject.php	(revision 9439)
@@ -4,5 +4,5 @@
 
 if (($_SERVER[REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {
-  menu ('ipp.menu.dat', 'Select Project', 'ipp.css', '');
+  menu ('ipp.menu.dat', 'Select Project', 'ipp.css', '', '');
   echo "Invalid Client Request<br>\n";
   menu_end ();
@@ -13,15 +13,5 @@
 
 if ($_SERVER[REQUEST_METHOD] == 'GET') { 
-    menu ('ipp.menu.dat', 'Select Project', 'ipp.css', '');
-    echo "<p> Select the project of interest </p>\n";
-    echo "<form action=\"$myPage\" method=\"POST\">\n";
-    echo "Project: <input type=\"text\" name=\"proj\"><br>\n";
-    echo "<input type=\"submit\" name=\"project\">\n";
-
-    $pass = $ID['pass'];
-    echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
-    echo "</form>\n";
-
-    menu_end ();
+  projectform ($ID);
 }
 
@@ -40,5 +30,5 @@
     }
 
-    menu ('ipp.menu.dat', 'Select Project', 'ipp.css', $ID['link']);
+    menu ('ipp.menu.dat', 'Select Project', 'ipp.css', $ID['link'], $ID['proj']);
     echo "New project is : $myProj<br>\n";
     menu_end();
Index: /trunk/ippMonitor/raw/ipp.copy.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.copy.dat	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.copy.dat	(revision 9439)
@@ -15,7 +15,8 @@
 menulink  | menuselect   | link    | Login                        | Login.php     
 menulink  | menuselect   | link    | Select Project               | SelectProject.php     
+menulink  | menuselect   | link    | [$PROJECT]                   | SelectProject.php     
 
 menutop   | menutop      | plain   | &nbsp;                       | 
-menutop   | menutop      | link    | Load and Setup               | LoadSetup.php
+menutops  | menutops     | link    | Load and Setup               | LoadSetup.php
 menutop   | menutop      | link    | Science Steps                | ScienceSteps.php
 menutop   | menutop      | link    | Detrend Steps                | DetrendSteps.php
@@ -28,6 +29,2 @@
 menulink  | menuselect 	 | link    | Raw Detrend Exp              | rawDetrendExp.php             
 menulink  | menuselect 	 | link    | Raw Science Exp              | rawScienceExp.php             
-
-menutop   | menutop      | plain   | &nbsp;                       | 
-menutop   | menutop      | plain   | External Links               | none
-menutop   | menutop      | link    | test page                    | phptest.php     
Index: /trunk/ippMonitor/raw/ipp.css
===================================================================
--- /trunk/ippMonitor/raw/ipp.css	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.css	(revision 9439)
@@ -10,4 +10,5 @@
 
 a.menutop     { text-decoration: none; color: #ffffff; font-weight: bold }
+a.menutops    { text-decoration: none; color: #80f0ff; font-weight: bold }
 a.menuext     { text-decoration: none; color: #ffffff; font-weight: bold }
 a.menulink    { text-decoration: none; font-weight: normal; color: #000000}
@@ -16,4 +17,5 @@
 
 td.menutop    { text-align: left; background: #0080c0; font-size: small; color: #ffffff; padding: 2px; }
+td.menutops   { text-align: left; background: #0080c0; font-size: small; color: #000000; padding: 2px; }
 td.menuext    { text-align: left; background: #303070; font-size: small; color: #ffffff; padding: 2px; }
 td.menulink   { text-align: left; background: #d0d0ff; font-size: small; color: #000000; padding: 2px; font-weight: normal; text-indent: 0px; }
Index: /trunk/ippMonitor/raw/ipp.detrend.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.detrend.dat	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.detrend.dat	(revision 9439)
@@ -15,14 +15,14 @@
 menulink  | menuselect   | link    | Login                        | Login.php     
 menulink  | menuselect   | link    | Select Project               | SelectProject.php     
+menulink  | menuselect   | link    | [$PROJECT]                   | SelectProject.php     
 
 menutop   | menutop      | plain   | &nbsp;                       | 
 menutop   | menutop      | link    | Load and Setup               | LoadSetup.php
 menutop   | menutop      | link    | Science Steps                | ScienceSteps.php
-menutop   | menutop      | link    | Detrend Steps                | DetrendSteps.php
+menutops  | menutops     | link    | Detrend Steps                | DetrendSteps.php
 menutop   | menutop      | link    | Imfile Tables                | ImfileTables.php
 
 menutop   | menutop      | plain   | &nbsp;                       | 
-menulink  | menuselect 	 | link    | Master Detrend Frames        | masterDetrendFrames.php
-menulink  | menuselect 	 | link    | Master Detrend Imfiles       | masterDetrendImfiles.php
+menulink  | menuselect 	 | link    | Detrend Frames               | masterDetrendFrames.php
 menulink  | menuselect 	 | link    | Detrend Runs                 | detRunSummary.php             
 menulink  | menuselect 	 | link    | Raw Detrend Exp              | rawDetrendExp_detrend.php
@@ -30,6 +30,3 @@
 menulink  | menuselect 	 | link    | Proc Detrend Exp             | detProcessedExp.php
 menulink  | menuselect 	 | link    | Resid Detrend Exp            | detResidExp.php
-
-menutop   | menutop      | plain   | &nbsp;                       | 
-menutop   | menutop      | plain   | External Links               | none
-menutop   | menutop      | link    | test page                    | phptest.php
+menulink  | menuselect 	 | link    | Norm Detrend Exp             | detNormalizedExp.php
Index: /trunk/ippMonitor/raw/ipp.imfiles.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.imfiles.dat	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.imfiles.dat	(revision 9439)
@@ -15,4 +15,5 @@
 menulink  | menuselect   | link    | Login                        | Login.php     
 menulink  | menuselect   | link    | Select Project               | SelectProject.php     
+menulink  | menuselect   | link    | [$PROJECT]                   | SelectProject.php     
 
 menutop   | menutop      | plain   | &nbsp;                       | 
@@ -20,5 +21,5 @@
 menutop   | menutop      | link    | Science Steps                | ScienceSteps.php
 menutop   | menutop      | link    | Detrend Steps                | DetrendSteps.php
-menutop   | menutop      | link    | Imfile Tables                | ImfileTables.php
+menutops  | menutops     | link    | Imfile Tables                | ImfileTables.php
 
 menutop   | menutop      | plain   | &nbsp;                       | 
Index: /trunk/ippMonitor/raw/ipp.menu.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.menu.dat	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.menu.dat	(revision 9439)
@@ -15,4 +15,5 @@
 menulink  | menuselect   | link    | Login                        | Login.php     
 menulink  | menuselect   | link    | Select Project               | SelectProject.php     
+menulink  | menuselect   | link    | [$PROJECT]                   | SelectProject.php     
 
 menutop   | menutop      | plain   | &nbsp;                       | 
@@ -21,7 +22,2 @@
 menutop   | menutop      | link    | Detrend Steps                | DetrendSteps.php
 menutop   | menutop      | link    | Imfile Tables                | ImfileTables.php
-
-menutop   | menutop      | plain   | &nbsp;                       | 
-
-menutop   | menutop      | plain   | External Links               | none            
-menutop   | menutop      | link    | test page                    | phptest.php     
Index: /trunk/ippMonitor/raw/ipp.php
===================================================================
--- /trunk/ippMonitor/raw/ipp.php	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.php	(revision 9439)
@@ -13,4 +13,18 @@
   echo '<input type="submit" name="login" value="login">', "\n";
   echo '</form>', "\n\n";
+}
+
+function projectform ($ID) {
+    menu ('ipp.menu.dat', 'Select Project', 'ipp.css', $ID['link'], $ID['proj']);
+    echo "<p> Please select the project of interest </p>\n";
+    echo "<form action=\"SelectProject.php\" method=\"POST\">\n";
+    echo "Project: <input type=\"text\" name=\"proj\"><br>\n";
+    echo "<input type=\"submit\" name=\"project\">\n";
+
+    $pass = $ID['pass'];
+    echo "<input type=\"hidden\" name=\"pass\" value=\"$pass\">\n";
+    echo "</form>\n";
+
+    menu_end ();
 }
 
@@ -54,5 +68,5 @@
   $success = $qry->fetchInto($row);
   if (!$success) {  
-    menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
+    menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
     echo "Login Failed, please try again<br>\n";
     loginform ();
@@ -97,7 +111,9 @@
 function checkID () {
 
+  $VERBOSE = 0;
+
   // check for valid server method
   if (($_SERVER[REQUEST_METHOD] != 'POST') && ($_SERVER[REQUEST_METHOD] != 'GET')) {
-    menu ('ipp.menu.dat', 'Login', 'ipp.css', '');
+    menu ('ipp.menu.dat', 'Login', 'ipp.css', '', '');
     echo "Invalid Client Request<br>\n";
     menu_end ();
@@ -110,10 +126,12 @@
     $ID['proj'] = $_GET[proj];
     $ID['menu'] = $_GET[menu];
-    // echo "using GET: ", $ID['pass'], $ID['proj'];
-
-    // echo "GET list<br>\n";
-    // foreach ($_GET as $key => $value) {
-    // echo "$key : $value<br>\n";
-    // }
+
+    if ($VERBOSE) {
+      echo "using GET: ", $ID['pass'], $ID['proj'], "<br>\n";
+      echo "GET list<br>\n";
+      foreach ($_GET as $key => $value) {
+	echo "$key : $value<br>\n";
+      }
+    }
   }
   if ($_SERVER[REQUEST_METHOD] == 'POST') { 
@@ -121,15 +139,17 @@
     $ID['proj'] = $_POST[proj];
     $ID['menu'] = $_POST[menu];
-    // echo "using POST: ", $ID['pass'], $ID['proj'];
-
-    // echo "POST list<br>\n";
-    // foreach ($_POST as $key => $value) {
-    // echo "$key : $value<br>\n";
-    // }
+
+    if ($VERBOSE) {
+      echo "using POST: ", $ID['pass'], $ID['proj'], "<br>\n";
+      echo "POST list<br>\n";
+      foreach ($_POST as $key => $value) {
+	echo "$key : $value<br>\n";
+      }
+    }
   }
 
   // user is not logged in at all
   if ($ID['pass'] == "") {
-    menu('ipp.menu.dat', 'Login', 'ipp.css', '');
+    menu('ipp.menu.dat', 'Login', 'ipp.css', '', '');
     logintext ();    
     loginform ();
@@ -153,5 +173,5 @@
   $success = $qry->fetchInto($row);
   if (! $success) {
-    menu('ipp.menu.dat', 'Login', 'ipp.css', '');
+    menu('ipp.menu.dat', 'Login', 'ipp.css', '', '');
     echo "unknown user, please login again<br>\n";
     loginform ();
@@ -170,5 +190,5 @@
 }
 
-function menu ($source, $title, $sheet, $append) {
+function menu ($source, $title, $sheet, $append, $project) {
 
   echo "<html><head><title> $title </title></head>\n\n";
@@ -178,4 +198,6 @@
   $root = "/phpipp";
 
+  if (! $project) { $project = "none"; }
+
   $file = fopen ($source, "r");
 
@@ -190,4 +212,8 @@
     $name = trim($line[3]);
     $base = trim($line[4]);
+
+    if (preg_match ('|\$PROJECT|', $name)) {
+      $name = preg_replace ('|\$PROJECT|', $project, $name);
+    }
 
     if ($append) {
Index: /trunk/ippMonitor/raw/ipp.science.dat
===================================================================
--- /trunk/ippMonitor/raw/ipp.science.dat	(revision 9438)
+++ /trunk/ippMonitor/raw/ipp.science.dat	(revision 9439)
@@ -15,8 +15,9 @@
 menulink  | menuselect   | link    | Login                        | Login.php     
 menulink  | menuselect   | link    | Select Project               | SelectProject.php     
+menulink  | menuselect   | link    | [$PROJECT]                   | SelectProject.php     
 
 menutop   | menutop      | plain   | &nbsp;                       | 
 menutop   | menutop      | link    | Load and Setup               | LoadSetup.php
-menutop   | menutop      | link    | Science Steps                | ScienceSteps.php
+menutops  | menutops     | link    | Science Steps                | ScienceSteps.php
 menutop   | menutop      | link    | Detrend Steps                | DetrendSteps.php
 menutop   | menutop      | link    | Imfile Tables                | ImfileTables.php
@@ -29,6 +30,2 @@
 menulink  | menuselect 	 | link    | P2 Pending Exp               | p2PendingExp.php              
 menulink  | menuselect 	 | link    | P3 Pending Exp               | p3PendingExp.php              
-
-menutop   | menutop      | plain   | &nbsp;                       | 
-menutop   | menutop      | plain   | External Links               | none            
-menutop   | menutop      | link    | test page                    | phptest.php     
Index: /trunk/ippMonitor/raw/masterDetrendImfiles.php
===================================================================
--- /trunk/ippMonitor/raw/masterDetrendImfiles.php	(revision 9438)
+++ /trunk/ippMonitor/raw/masterDetrendImfiles.php	(revision 9439)
@@ -4,9 +4,8 @@
 
 $ID = checkID ();
-if ($ID['proj']) {
-  $db = dbconnect($ID['proj']);
-} else {
-  $db = dbconnect('detrend');
-}
+// require an explicit project
+if (! $ID['proj']) { projectform ($ID); }
+
+$db = dbconnect($ID['proj']);
 
 if ($ID['menu']) {
@@ -16,5 +15,5 @@
 }
 
-menu($myMenu, 'Master Detrend Imfiles', 'ipp.css', $ID['link']);
+menu($myMenu, 'Master Detrend Imfiles', 'ipp.css', $ID['link'], $ID['proj']);
 
 echo "<p> Master Detrend Imfiles </p>";
Index: /trunk/ippMonitor/raw/phptest.php
===================================================================
--- /trunk/ippMonitor/raw/phptest.php	(revision 9438)
+++ /trunk/ippMonitor/raw/phptest.php	(revision 9439)
@@ -3,5 +3,5 @@
 include 'ipp.php';
 
-menu('ipp.menu.dat', 'test.page', 'ipp.css', '');
+menu('ipp.menu.dat', 'test.page', 'ipp.css', '', '');
 
 $varlist = array ('SERVER_NAME', 'GATEWAY_INTERFACE', 'SERVER_PROTOCOL',
