That's easy... just look at EVERY element on the page and only do something if it's a checkbox. Heck, there's only 5000+ elements, how long could that possibly take?
for (iCount=0;iCount<=document.all.length;iCount++) {
elm = document.all[iCount];
if (elm.type == 'checkbox') {
// snip
}
}