It's been a while since I've attempted any cross browser scripting, but I cant believe this simple function is throwing an error in IE:

function infoBoxSwitch(id) {
    var d = document.getElementById(id);
    for (var i = 1; i<=12; i++) {
        if (document.getElementById('infoBox'+i)) {
    if (d) {'block';        
In the HTML, as you'd expect, I have a bunch of DIV's with ID's along the lines of infoBox1, infoBox2, and so on. Works as intended in FF2.0 with the call infoBoxSwitch('infoBox1') - all the DIV's except the one passed to the function are hidden.

So what's causing IE to say "Object Expected?"