Javascript help - combo box
<p>Hi I need some help understanding this code:
It works well but can someone add some comments to help me understand it better?
Thanks</p>

<p>Here's the code:</p>

<pre><code>function contractall() {
    if (document.getElementById) {
        var inc = 0
        while (document.getElementById("dropmsg" + inc)) {

            document.getElementById("dropmsg" + inc).style.display = "none"
            inc++
        }
    }
}



function expandone() {
    if (document.getElementById) {
        var selectedItem = document.dropmsgform.dropmsgoption.selectedIndex
        contractall()
        document.getElementById("dropmsg" + selectedItem).style.display = "block"
    }
}

if (window.addEventListener) window.addEventListener("load", expandone, false)
else if (window.attachEvent) window.attachEvent("onload", expandone)
</code></pre>
