When element got visible in Javascript it toggle back to hidden
<p>Please help as when ever i clcik and call Javascript function to unhide an element it turn back hidden again. it takes a second or less.</p>

<p>HTML</p>

<pre><code>&lt;asp:Button ID="btnFromCalOpen" Width = "35" runat="server" Text="&amp;gt;"  style="display:none; visibility:hidden;"  OnClientClick ="ShowCal()"  /&gt;
</code></pre>

<p>Javascript</p>

<pre><code>function ShowCal() {

var elem = document.getElementById('MainContent_CalendarFrom');

if (elem.visibility = "hidden" ) {
    alert("Show");
    elem.style.visibility = "visible";
    elem.style.display = "inline";
}
else {
    alert("Hide");
    elem.style.visibility = "hidden";
    elem.style.display = "none";
}
} 
</code></pre>

<p>it like when ever i click on the button it refresh its style properties of all elements</p>

<p>Please help</p>
