Following is the code which I have tried

What I want is on after 3 seconds the documents `bgcolor` to change 

I have used `document.bgcolor` and its not working as it always returns `black`

```
 var A = new Array("0", "1", "2");
    var B = 0;
    var C = 3;

    function D() {

        if (document.images) {
            B++;
            if (B == C) {

                B = 0;
            }
            document.bgColor = A[B];
            setTimeout("D()", 3 * 1000);
        }
    }

    window.onload = function () {

        D();
    }

```