Strange javascript bug
<p>Pls look at the following code:
html...</p>

<pre><code> &lt;pre id='output'&gt;&lt;/pre&gt;
</code></pre>

<p>html...</p>

<p>JS</p>

<pre><code> function log(text) {
    var div = document.getElementById('output');
    div.innerHTML += text + '\n';
 }

function foo() {

    var browser=0;
    if(navigator.appName.toUpperCase()=="MICROSOFT INTERNET EXPLORER")
        browser=1;
    else
    if(navigator.appName.toUpperCase()=="NETSCAPE")
        browser=2;
    log ('browser:'+browser);
    if (browser==1)
    {
        log ('IE');
    }
    if (browser==2);
    {
        log ('Chrome');
    }

    if (browser==0);
    {
            log ('Could not determine broweser type');
            return;
    }
  }
</code></pre>

<hr>

<p>When I run this from IE the output is:
browser:1 ie not supported Chrome extension will be loaded Could not determine broweser type </p>

<p>When I run it from Chrome the output is:
browser:2
Chrome extension will be loaded
Could not determine broweser type</p>

<hr>

<p>How can it be that browser has more than one value?
10xs,
Nir</p>
