switich two div's with jquery on the base of condition
<p>hello I have two div on my page. </p>

<pre><code>&lt;div id="adsense" style="display:block"&gt;some stuff&lt;/div&gt;
&lt;div id="timeout" style="display:none&gt;Some stuff&lt;/div&gt;
</code></pre>

<p>I have a variable <code>var type</code>.</p>

<p>The page on which these two div's are loads two times. First time the type=0. At this time i want to show the <code>&lt;div id="adsense"&gt;</code>. Then the page goes to other pages and when the page loads second time the type becomes 1.</p>

<p>Now what I want is at first page load the <code>&lt;div id="adsense"&gt;</code> to be shown. When page reloads <code>type becomes 1</code> I want to show the <code>&lt;div id="timeout"&gt;</code> for 9 seconds and then again switch to first div.</p>

<p>I want to know how can I do that? How can I embed if condition in it.</p>
