jQuery toggle not working properly
<p>I have a list of Regions and corresponding countries..when i click on a region, the list should expand while collapsing all other regions. Also when i click on the same region again n again, it should toggle.
But in my case every things working fine except that toggle function is not working properly on first click.</p>

<pre><code>$(document).ready(function(){
$("tbody[id*='titl']").live('click',function(){     
    var nextId = ('#' + $(this).next("tbody[id*='tbod']").attr('id'));
    $("tbody[id*='tbod']").each(function(){
    var hideId = ('#' + $(this).attr('id'));    
    if(nextId != hideId)
    {
        $(hideId).hide();       
    }
    else
    {           

        $(hideId).toggle();
    }

});
});
</code></pre>
