javascript : checking boolean values
<p>I have a boolean value set as a hidden variable in the form and I have the below javascript .</p>

<pre><code>         $().ready(function() {

             var flag =  $('#popUpFlag').val();

             alert("flag = "+flag);

             if(flag){
                alert("flag is true");
             }else{
                alert("flag is false");
             }
        })
</code></pre>

<p>These are the outputs for the alert . </p>

<pre><code>         flag =
         flag is false


         flag = false
         flag is false


         flag = true
         flag is false
</code></pre>

<p>My concern is obviously the third output . When the flag is true , why is it printing "flag is false" , instead of "flag is true" . I tested it in IE8 and FF 4</p>

<p>Suggestions are welcome.</p>
