how to disable window.onclick event when "onclick" is called on a specific div?
<p>I have number of <strong>drop down menu's</strong> which gets called with a <code>onClick</code> event right below those specific div's,and i also have a <code>window.onclick</code> set inorder to retract those dropdowns(which are active) when a user clicks elsewhere.</p>

<p>Now,when i click on a div(which has a dropDown) the drop down is getting activated(menu gets created) and simultaneously retracting (because of the <code>window.click</code> ) </p>

<p>The menu's are getting created and getting destroyed at the same time!,Any work arounds to perform the <code>window.onclick</code> iff the clicked element is not on of the div's with a dropdown??</p>

<p>Silly question,from a beginner..
thanks in advance!!</p>

<p>here's a sample code!!.. the onclick on the div is supposed to bring out the menu -- and the window.onclick is supposed to retract the menu(all he menu's which are expanded)</p>

<pre><code>&lt;html&gt;
    &lt;style type="text/css"&gt;
    .bar{
    width: 30px;
    height: 30px;
    background-color: black;
    display: none;
    }
    &lt;/style&gt;
    &lt;script type="text/javascript" &gt;
    function fire(){
    document.getElementById("bar").style.display="block";
    }
    window.onclick=unfire;
    function unfire(){
    if(document.getElementById("bar").style.display== "block")
    document.getElementById("bar").style.display="none";
    }
    &lt;/script&gt;
    &lt;input type="button" value="foo" onclick="fire()"&gt;
    &lt;div id="bar" class="bar"&gt;&lt;/div&gt;
    &lt;/html&gt;
</code></pre>

<p>Edit:added the code sample</p>
