I am trying to fix a bug on a client's website that causes the prototype.js PeriodicalExecuter not to function even when JS is turned on. I have been unable to replicate the bug myself.

Not too experienced in JS however I have a feeling it's the "window.changed" that is causing the error. Is There any other way of expressing this?

new PeriodicalExecuter(function(pe) {
if (window.changed) { pe.stop(); return; }
var members = $('memberId').select('option').random();
members.writeAttribute('selected', 'selected');

Thanks in advance