JavaScript variable with global scope
===

This is an Extension to the [Question](http://stackoverflow.com/questions/11540329/functions-scope-in-javascript/11541574#11541574). I have tried below code to understand JavaScript scope
 
    var a = function(){
       var aa = 10;
       var x = 13;            
       b = function(){ c = function(){ alert(aa); }; };       
    };
    a();
    b();
    c();
    alert(typeof x);​ // Undefined
    alert(x);​ // Returned me 13.
My query is I have declared variable with `var`​ inside a global function. As per my understanding `x` should be local. But it is not acting in that way. Someone please clear my doubt... Please check [this](http://jsfiddle.net/HJ4vK/6/) fiddle.