 
 String generateHTMLPage(unsigned long sDelay, unsigned long nShots, unsigned long interval)
 {
+  String stateNotInTimelapse = "enabled";
+  String buttonState = "disabled";
+  if (((currentExecMode == TIMELAPSE) || (currentExecMode == REFRESH)) && (currentNShots > 0))
+  {
+    buttonState = "enabled";
+    stateNotInTimelapse = "disabled";
+  }
   String retVal = "<html><head><title>ANI Camera Remote</title>"
                   "<style>table, th, td { border: 0px solid black;} button, input[type=number], input[type=submit] "
                   "{width:100px;height:24px;font-size:14pt;}</style></head><body>"

  if (pathOK) // generate the html page
  {
    extractParams(sParam);
    pre_process();
    sResponse = generateHTMLPage(delayToStart, numberOfShots, delayBetweenShots);
    generateOKHTML(sResponse, sHeader);
  }


// Global variables
const String prgTitle = "ANI Camera Remote";
const String prgVersion = "1.2";
const int versionMonth = 7;
const int versionYear = 2017;

