why ajax callback is setting undefined in my local variable?
===

I found a bug in my site, because of this strange behavior.
The second function alerts "undefined" instead of "one".

    function test() {
        var myParam = "one"
        if (false) {
            var myParam = "two";
        }
        alert(myParam);
    }
    test(); // alert "one"
    
    
    function testAjax() {
        var myParam = "one";
        $.ajax({
            url:    "http://url-to-get-error",
            error:  function(){
                if (false) {
                    var myParam = "two";
                }
                alert(myParam);
            }
        });
    }
    testAjax(); // alert "undefined"

And if I comment block bellow, alerts "one" correctly. 
Someone knows why?

    if (false) {
    var myParam = "two";
    }


See in http://jsfiddle.net/EaW8D/2/.