how do i popup div tags using javascript
<p>hi i have a situation that i want to put popup code in if else statement using JavaScript? my code is 
</p>

<pre><code>&lt;script src="scripts/jquery-1.9.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;


$(documnet).ready(function () {
    $("#AddToCartBtn").click(function (e) {
        ShowDialog(false);
        e.preventDefault();
    });

    $("#AddToCartBtn").click(function (e) {
        ShowDialog(true);
        e.preventDefault();
    });

    $("#btnClose").click(function (e) {
        HideDialog();
        e.preventDefault();
    });

    $("#btnSubmit").click(function (e) {
        var brand = $("#brands input:radio:checked").val();
        $("#output").html("&lt;b&gt;Your favorite mobile brand: &lt;/b&gt;" + brand);
        HideDialog();
        e.preventDefault();
    });

});

function ShowDialog() {
    $("#overlay").show();
    $("#dialog").fadeIn(300);


    if (modal) {
        $("#overlay").unbind("click");
    }
    else {
        $("#overlay").click(function (e) {
            HideDialog();
        });
    }
}

function HideDialog() {
    $("#overlay").hide();
    $("#dialog").fadeOut(300);
} 
</code></pre>

<p></p>

<p>Heres the css..</p>

<pre><code>.web_dialog_overlay
{
position: fixed;
top: 0;


 right: 0;
   bottom: 0;
   left: 0;
   height: 100%;
   width: 100%;
   margin: 0;
   padding: 0;
   background: #000000;
   opacity: .15;
   filter: alpha(opacity=15);
   -moz-opacity: .15;
   z-index: 101;
   display: none;
}
.web_dialog
{
   display: none;
   position: fixed;
   width: 380px;
   height: 200px;
   top: 50%;
   left: 50%;
   margin-left: -190px;
   margin-top: -100px;
   background-color: #ffffff;
   border: 2px solid #336699;
   padding: 0px;
   z-index: 102;
   font-family: Verdana;
   font-size: 10pt;
}
.web_dialog_title
{
   border-bottom: solid 2px #336699;
   background-color: #336699;
   padding: 4px;
   color: White;
   font-weight:bold;
}
.web_dialog_title a
{
   color: White;
   text-decoration: none;
}
.align_right
{
   text-align: right;
}
</code></pre>

<p>and lastly the asp button control and the 's</p>

<pre><code>&lt;asp:ImageButton ID="AddToCartBtn" runat="server" RowIndex='&lt;%# Container.DisplayIndex %&gt;'
                                        ImageUrl="~/Pictures/ShoppingCart.png" onClientClick="ShowDialog()"                                         
                                          /&gt;

&lt;div id="output"&gt;&lt;/div&gt;

&lt;div id="overlay" runat="server" class="web_dialog_overlay"&gt;&lt;/div&gt;

&lt;div id="dialog" class="web_dialog"&gt;


&lt;table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0"&gt;
      &lt;tr&gt;
         &lt;td class="web_dialog_title"&gt;Online Survey&lt;/td&gt;
         &lt;td class="web_dialog_title align_right"&gt;
            &lt;a href="#" id="btnClose"&gt;Close&lt;/a&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="2" style="padding-left: 15px;"&gt;
            &lt;b&gt;Choose your favorite mobile brand? &lt;/b&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="2" style="padding-left: 15px;"&gt;
            &lt;div id="brands"&gt;
               &lt;input id="brand1" name="brand" type="radio" checked="checked" value="Nokia" /&gt; Nokia
               &lt;input id="brand2" name="brand" type="radio" value="Sony" /&gt; Sony 
               &lt;input id="brand3" name="brand" type="radio" value="Motorola" /&gt; Motorola
            &lt;/div&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
         &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
         &lt;td colspan="2" style="text-align: center;"&gt;
            &lt;input id="btnSubmit" type="button" value="Submit" /&gt;
         &lt;/td&gt;
      &lt;/tr&gt;
   &lt;/table&gt;
&lt;/div&gt;
</code></pre>

<p>as same as it but here when user clicks add to cart it will add to whistlist but for me when i click add to cart popup div has to display </p>