if (document.getElementById) { /* W3C DOM CODE */ } else if (document.layers) { /* Nav4 DOM CODE */ } else if (document.all) { /* IE4 DOM CODE */ }