
//Progress bar code

var barEnd = 9; //Must match number of spans

var barColor = "#FFFFFF";  // Progress bar colour

var progressInterval = 250;  // Time in milliseconds between updates
var barAt = barEnd;
var progressTimer;

function processUpdate(btn1, btn2) {
  document.getElementById("progressbar").style.visibility = "visible";
  if(btn1.length > 0) {
      eval("document.gform." + btn1 + ".disabled = true");
  }
  if(btn2.length > 0) {
      eval("document.gform." + btn2 + ".disabled = true");
  }
  document.gform.submit();
  updateBar();
}

function updateBar() {
  barAt++;
  if(barAt > barEnd) {
    clearBar();
  } else {
    document.getElementById("progress" + barAt).style.backgroundColor = barColor;
  }
  progressTimer = setTimeout("updateBar()", progressInterval);
}

function stopBar() {
  clearTimeout(progressTimer);
  clearBar();
}

function clearBar() {
  for(var i = 1; i <= barEnd; i++) {
    document.getElementById("progress" + i).style.backgroundColor = "transparent";
  }
  barAt = 0;
}


