I think I've determined that neither of these "if" blocks are executing in the Mac browsers, and this is leaving these 4 variables undefined.
I created a simple test page attempting to display the values of document.layers and document.all. Using Opera (the one Mac browser I've found that displays the page), I'm finding that document.layers is undefined, and document.all is [object HTMLCollection]. But using Safari, Camino, Firefox, and Shirra, I get nothing. In fact, Safari and Shirra seem to choke on the document.all.
So -- without knowing what "layers" and "all" mean -- is there a simple solution here? How should these variables be valued for Mac browsers? [ June 06, 2007: Message edited by: marc weber ]
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer sscce.org
The document.layers settings are probably what you want. I am guessing that this test differentiates Netscape browsers (which used to have something called Layers, even though that's obsolete now) from IE (document.all is an IE thing).
The good book 'HTML & XHTML The Definitive Guide' says on page #621:
Spaces and multiple columns are natural extensions to conventional HTML, existing within a document's normal flow. With version 4, Netscape took HTML into an entirely new dimension with layers. It transforms the single-element document model into one containing many layered elements that are combined to form the final document. Regrettably, layers are not supported by Netscape 6 or any other version of Internet Explorer.
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.