Index: trunk/MagicSoft/Mars/datacenter/db/menu.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/menu.php	(revision 8512)
+++ trunk/MagicSoft/Mars/datacenter/db/menu.php	(revision 8621)
@@ -1034,4 +1034,6 @@
     InitSequInfo($_GET, $first);
 
+    //init for limits
+
     if (empty($_GET["fArrTimeLimitMean"]))
         $_GET["fArrTimeLimitMean"]="";
@@ -1040,46 +1042,23 @@
         $_GET["fArrTimeLimitRms"]="";
 
+    if (empty($_GET["fSkyBrightLimitMean"]))
+        $_GET["fSkyBrightLimitMean"]="";
+
+    if (empty($_GET["fSkyBrightLimitRms"]))
+        $_GET["fSkyBrightLimitRms"]="";
+
+    if (empty($_GET["fMaxHumLimit1"]))
+        $_GET["fMaxHumLimit1"]="";
+
+    if (empty($_GET["fMaxHumLimit2"]))
+        $_GET["fMaxHumLimit2"]="";
+
+    //values that differ for different data
+    if (empty($_GET["fPSFLimitMean"]))
+        $_GET["fPSFLimitMean"]="";
+
     if (empty($_GET["fPedRmsInLimitMean"]))
         $_GET["fPedRmsInLimitMean"]="";
 
-    if (empty($_GET["fPedRmsInLimitRms"]))
-        $_GET["fPedRmsInLimitRms"]="";
-
-    if (empty($_GET["fMuonRateLimitMean"]))
-        $_GET["fMuonRateLimitMean"]="";
-
-    if (empty($_GET["fMuonRateLimitRms"]))
-        $_GET["fMuonRateLimitRms"]="";
-
-    if (empty($_GET["fImgRateLimitMean"]))
-        $_GET["fImgRateLimitMean"]="";
-
-    if (empty($_GET["fImgRateLimitRms"]))
-        $_GET["fImgRateLimitRms"]="";
-
-    if (empty($_GET["fPSFLimitMean"]))
-        $_GET["fPSFLimitMean"]="";
-
-    if (empty($_GET["fPSFLimitRms"]))
-        $_GET["fPSFLimitRms"]="";
-
-    if (empty($_GET["fUnsInLimit1"]))
-        $_GET["fUnsInLimit1"]="";
-
-    if (empty($_GET["fUnsInLimit2"]))
-        $_GET["fUnsInLimit2"]="";
-
-    if (empty($_GET["fIsoInLimit1"]))
-        $_GET["fIsoInLimit1"]="";
-
-    if (empty($_GET["fIsoInLimit2"]))
-        $_GET["fIsoInLimit2"]="";
-
-    if (empty($_GET["fIMCLimit1"]))
-        $_GET["fIMCLimit1"]="";
-
-    if (empty($_GET["fIMCLimit2"]))
-        $_GET["fIMCLimit2"]="";
-
     if (empty($_GET["fZdMinLimit1"]))
         $_GET["fZdMinLimit1"]="";
@@ -1094,78 +1073,102 @@
         $_GET["fZdMaxLimit2"]="";
 
+    // values taken from distribution or from experience
+    if (empty($_GET["fUnsInLimit1"]))
+        $_GET["fUnsInLimit1"]=$first?"12":"";
+
+    if (empty($_GET["fUnsInLimit2"]))
+        $_GET["fUnsInLimit2"]=$first?"20":"";
+
+    if (empty($_GET["fRunTimeLimit1"]))
+        $_GET["fRunTimeLimit1"]=$first?"5":"";
+
+    if (empty($_GET["fRunTimeLimit2"]))
+        $_GET["fRunTimeLimit2"]=$first?"2":"";
+
+    if (empty($_GET["fPSFLimitRms"]))
+        $_GET["fPSFLimitRms"]=$first?"1.0":"";
+
+    if (empty($_GET["fPedRmsInLimitRms"]))
+        $_GET["fPedRmsInLimitRms"]=$first?"0.08":"";
+
+    if (empty($_GET["fNumIslLimitMean"]))
+        $_GET["fNumIslLimitMean"]=$first?"1.230":"";
+
+    if (empty($_GET["fNumIslLimitRms"]))
+        $_GET["fNumIslLimitRms"]=$first?"0.013":"";
+
     if (empty($_GET["fMuonCalLimitMean"]))
-        $_GET["fMuonCalLimitMean"]="";
+        $_GET["fMuonCalLimitMean"]=$first?"100.0":"";
 
     if (empty($_GET["fMuonCalLimitRms"]))
-        $_GET["fMuonCalLimitRms"]="";
+        $_GET["fMuonCalLimitRms"]=$first?"1.6":"";
+
+    if (empty($_GET["fRelTimeMaxLimit1"]))
+        $_GET["fRelTimeMaxLimit1"]=$first?"1.0":"";
+
+    if (empty($_GET["fRelTimeMaxLimit2"]))
+        $_GET["fRelTimeMaxLimit2"]=$first?"1.02":"";
+
+    if (empty($_GET["fRelTimeMinLimit1"]))
+        $_GET["fRelTimeMinLimit1"]=$first?"0.97":"";
+
+    if (empty($_GET["fRelTimeMinLimit2"]))
+        $_GET["fRelTimeMinLimit2"]=$first?"0.93":"";
+
+    if (empty($_GET["fIMCLimit1"]))
+        $_GET["fIMCLimit1"]=$first?"00":"";
+
+    if (empty($_GET["fIMCLimit2"]))
+        $_GET["fIMCLimit2"]=$first?"00":"";
+
+    if (empty($_GET["fIsoInLimit1"]))
+        $_GET["fIsoInLimit1"]=$first?"00":"";
+
+    if (empty($_GET["fIsoInLimit2"]))
+        $_GET["fIsoInLimit2"]=$first?"00":"";
 
     if (empty($_GET["fInhomLimitMean"]))
-        $_GET["fInhomLimitMean"]="";
+        $_GET["fInhomLimitMean"]=$first?"10":"";
 
     if (empty($_GET["fInhomLimitRms"]))
-        $_GET["fInhomLimitRms"]="";
-
-    if (empty($_GET["fNumIslLimitMean"]))
-        $_GET["fNumIslLimitMean"]="";
-
-    if (empty($_GET["fNumIslLimitRms"]))
-        $_GET["fNumIslLimitRms"]="";
-
-    if (empty($_GET["fSkyBrightLimitMean"]))
-        $_GET["fSkyBrightLimitMean"]="";
-
-    if (empty($_GET["fSkyBrightLimitRms"]))
-        $_GET["fSkyBrightLimitRms"]="";
+        $_GET["fInhomLimitRms"]=$first?"3":"";
+
+    if (empty($_GET["fImgRateLimitMean"]))
+        $_GET["fImgRateLimitMean"]=$first?"180":"";
+
+    if (empty($_GET["fImgRateLimitRms"]))
+        $_GET["fImgRateLimitRms"]=$first?"30":"";
+
+    if (empty($_GET["fMuonRateLimitMean"]))
+        $_GET["fMuonRateLimitMean"]=$first?"1":"";
+
+    if (empty($_GET["fMuonRateLimitRms"]))
+        $_GET["fMuonRateLimitRms"]=$first?"0.1":"";
+
+    if (empty($_GET["fMuonNumLimit1"]))
+        $_GET["fMuonNumLimit1"]=$first?"180":"";
+
+    if (empty($_GET["fMuonNumLimit2"]))
+        $_GET["fMuonNumLimit2"]=$first?"120":"";
+
+    if (empty($_GET["fPulsePosLimit1"]))
+        $_GET["fPulsePosLimit1"]=$first?"3.5":"";
+
+    if (empty($_GET["fPulsePosLimit2"]))
+        $_GET["fPulsePosLimit2"]=$first?"2.5":"";
 
     if (empty($_GET["fNumStarsLimit1"]))
-        $_GET["fNumStarsLimit1"]="";
+        $_GET["fNumStarsLimit1"]=$first?"30":"";
 
     if (empty($_GET["fNumStarsLimit2"]))
-        $_GET["fNumStarsLimit2"]="";
+        $_GET["fNumStarsLimit2"]=$first?"20":"";
 
     if (empty($_GET["fNumStarsCorLimit1"]))
-        $_GET["fNumStarsCorLimit1"]="";
+        $_GET["fNumStarsCorLimit1"]=$first?"10":"";
 
     if (empty($_GET["fNumStarsCorLimit2"]))
-        $_GET["fNumStarsCorLimit2"]="";
-
-    if (empty($_GET["fMuonNumLimit1"]))
-        $_GET["fMuonNumLimit1"]="";
-
-    if (empty($_GET["fMuonNumLimit2"]))
-        $_GET["fMuonNumLimit2"]="";
-
-    if (empty($_GET["fRelTimeMinLimit1"]))
-        $_GET["fRelTimeMinLimit1"]="";
-
-    if (empty($_GET["fRelTimeMinLimit2"]))
-        $_GET["fRelTimeMinLimit2"]="";
-
-    if (empty($_GET["fRelTimeMaxLimit1"]))
-        $_GET["fRelTimeMaxLimit1"]="";
-
-    if (empty($_GET["fRelTimeMaxLimit2"]))
-        $_GET["fRelTimeMaxLimit2"]="";
-
-    if (empty($_GET["fRunTimeLimit1"]))
-        $_GET["fRunTimeLimit1"]="";
-
-    if (empty($_GET["fRunTimeLimit2"]))
-        $_GET["fRunTimeLimit2"]="";
-
-    if (empty($_GET["fPulsePosLimit1"]))
-        $_GET["fPulsePosLimit1"]="";
-
-    if (empty($_GET["fPulsePosLimit2"]))
-        $_GET["fPulsePosLimit2"]="";
-
-    if (empty($_GET["fMaxHumLimit1"]))
-        $_GET["fMaxHumLimit1"]="";
-
-    if (empty($_GET["fMaxHumLimit2"]))
-        $_GET["fMaxHumLimit2"]="";
-
-}
-
+        $_GET["fNumStarsCorLimit2"]=$first?"5":"";
+
+}
 
 ?>
