Calling a function cancels out the previous action
<p>I have a simple script that i am testing with, but its acting very odd. I call a script which loads and i have it to a particular <code>td id</code>, I then call a second script and add that to different <code>td  id</code> but for some reason it wipes out the first div's content even though they are seperate.</p>

<p>This is what i have:</p>

<pre><code>function call_back(result,div_id,func){
        document.getElementById(div_id).innerHTML = result;
        if(typeof(func) != 'undefined'){func();}
}


function caller(url,cfunc)
{
        if (window.XMLHttpRequest)
          {// code for IE7+, Firefox, Chrome, Opera, Safari
                xmlhttp=new XMLHttpRequest();
          }
        else
          {// code for IE6, IE5
                xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
          }
                xmlhttp.onreadystatechange=cfunc;
                xmlhttp.open("GET",url,true);
                xmlhttp.send();
}


function call_file(url,div_id,func){
    caller(url,function(){
        if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200){
            call_back(xmlhttp.responseText,div_id,func);
        }
    });
}
</code></pre>

<p>I then have this on my onload:</p>

<pre><code> window.onload = function(){
    stage = 6;      
call_file('test.html','menu_left');

    switch(parseInt(stage)){
    case 6: call_file('test2.html','main'); break;
   }
};
</code></pre>

<p>The problem arises with the case statement. If i remove the case statement the contents added with <code>test.html</code> loads fine, but if i add the case statement, content from <code>test.html</code> disappears and then only <code>test2.html</code> displays.</p>

<p>The html for the id's are:</p>

<pre><code>            &lt;table class="body_wrapper"&gt;
                &lt;tr&gt;
                    &lt;td class="menu_left" id="menu_left"&gt;&lt;/td&gt;
                    &lt;td class="main" id="main"&gt;&lt;/td&gt;
                &lt;/tr&gt;   
            &lt;/table&gt;
</code></pre>

<p>Why might this be happening?</p>
