var wPdclUpdr;

// to set up the periodical updater for lightboxes which expect a sensor
function initWaitingLightbox() {

  myModalbox.end =
   function () {
     Element.hide('modalbox');
     Element.hide('modalLoading');
     new Effect.Fade('modalOverlay', { duration: 0.2});
     showSelectBoxes();
     wPdclUpdr.stop();
     UpdateWait(0);
   };

  wPdclUpdr = new Ajax.PeriodicalUpdater(' ', '/index.php/util/UpdateWait', {
    method: 'get',
    frequency: 55,
    parameters: {active: 1}
  });
}

function UpdateWait (active) {
  new Ajax.Request('/index.php/util/UpdateWait', {
     method:'get',
     parameters: { active: active }
  });
}
