Javascript string casting problem
<p>Something wierd is happening in my javascript and i dont understand it. Can anyone explain?</p>

<pre><code>var adsl2pSpeed = '9500 - 12500';

        alert(adsl2pSpeed);

        if (!adsl2pSpeed) {
            alert(adsl2pSpeed);
            var adsl2pSpeed = 'Unknown';
        }


        var speed = document.getElementById("PredictedSpeed");
        speed.innerHTML = adsl2pSpeed + " b/s";
</code></pre>

<p>This alerts "Undefined" twice and sets the innerhtml to be "Unknown". If I comment out the if statment it alerts '9500 - 12500' and sets the innerHTML to be '9500 - 12500'. Whats happening? Is the string is being cast as an object so it becomes null?</p>

<p><strong>EDIT</strong> : I am actually registing the adsl2pSpeed  as a startup script not in the function. I moved it up for clarity but possibly that is the problem?</p>
