Making it work on the evil browser
After getting the Apparatus stuff working on Firefox, I started the crossbrowser testing. Opera needed one tweak: its Array() object doesn't support the indexOf() method (introduced in JavaScript 1.6), so I had to add an implementation of that:
if(!Array.indexOf){
Array.prototype.indexOf = function(obj){
for(var i=0; i<this.length; i++){
if(this[i]==obj){
return i;
}
}
}
}
Tested also on Safari 2 (Mac) and Safari 3 beta (Windows), and on Konqueror. The last has some tiny layout issues, but other than that, everything works.
Except for IE, of course. IE doesn't support element.getAttribute(), so I had to put in a few traps with document.all which call use element.className instead. But it does work!
So all that's left now is the switching between the expanded view and the old-print-style view (hereinafter referred to as "the curmudgeonly view"). That will take a little thought.