Show popup immediately on site load
<p>I have one advertising popup that shows advertisements. However I've been recommended this of code from <a href="http://www.veign.com/blog/2008/05/22/create-a-one-time-popup-using-jquery/" rel="nofollow">Create a one-time popup using jQuery</a>. The popup working fine and also disabled while cookies set. But this popup will not appear immediately on my websites first page load. After when I navigate to another page it will appear. I just want it to open when first site loads.</p>

<p>Here is my code:</p>

<pre><code>    &lt;%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage"%&gt;
&lt;%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %&gt;
&lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
&lt;title&gt;Untitled Page&lt;/title&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
&lt;meta name="ROBOTS" content="ALL,INDEX,FOLLOW"/&gt;
&lt;link href="css/style.css" rel="stylesheet" type="text/css" /&gt;
&lt;script src="js/jquery-1.3.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/slide.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/jquery.cookie.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="js/thickbox.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&amp;;lang=en"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body onload="init()"&gt;
&lt;div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;"&gt;&lt;img src="images/loading.gif" alt=""/&gt;&lt;/div&gt;
&lt;script type="text/javascript"&gt;
    var ld = (document.all);
    var ns4 = document.layers;
    var ns6 = document.getElementById &amp;&amp; !document.all;
    var ie4 = document.all;
    if (ns4)
        ld = document.loading;
    else if (ns6)
        ld = document.getElementById("loading").style;
    else if (ie4)
        ld = document.all.loading.style;
    function init() {
        if (ns4) { ld.visibility = "hidden"; }
        else if (ns6 || ie4) ld.display = "none";
    }
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
$(document).ready(function(){
   if ($.cookie('20080521') != '1') {
    tb_show("&lt;strong&gt;Seminar on Total Investment!&lt;/strong&gt;", "#TB_inline?height=190&amp;width=275&amp;inlineId=mypopup","");
    $.cookie('20080521', '1', { expires: 20 }); }
   });
&lt;/script&gt;
&lt;form id="form1" runat="server"&gt;
    &lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;
    &lt;/asp:ScriptManager&gt;
    &lt;div id="mypopup" style="display:none"&gt;&lt;p id="msg"&gt;Seminar on Total Investment By Mr.Samir Shah. Contact: 9727152508&lt;/p&gt;&lt;/div&gt;
</code></pre>
