Index: trunk/ippMonitor/raw/DetrendSteps.php
===================================================================
--- trunk/ippMonitor/raw/DetrendSteps.php	(revision 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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 9399)
+++ 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',
