AI_DIFFICULTY variable. Even several years ago looking 4 moves ahead was reasonable, so recent performance improvements may have even made 5 plausible.
The UI was implemented with prototype.js and script.aculo.us. Remember prototype? I wrote the initial version of this before jQuery had a virtual stranglehold on the market. That said, I actually rather like prototype--not as much as jQuery, admittedly. And I do like scrip.aculo.us more than anything equivalent I've tried for jQuery.