I am trying to display div1 for 3 sec then hide and display div2. Please note I am not an expert Javascript developer. However, I have managed, by Googling and copy & paste, to display and hide div1.

I am not able to display div2 when div1 hides. Below is the code....

```
<div id="Div2" style="display:none">
php code here
</div>

<div id="Div1" style="display:none"><img id="myImage" src="ajax-loader.gif"></div><br>
<script type = "text/javascript">
function show() {
    document.getElementById("myDiv").style.display="block";
    setTimeout("hide()", 3000);  // 3 seconds
}

function hide() {
    document.getElementById("myDiv").style.display="none";
}

show();
function show2() {
    document.getElementById("myDiv1").style.display="block";
}
</script>

```