Javascript - hide div on initial page load

I’m building a site and using this bit of code to hide a div on click

{
   var obj = document.layers ? document.layers[szDivID] :
   document.getElementById ?  document.getElementById(szDivID).style :
   document.all[szDivID].style;
   obj.visibility = document.layers ? (iState ? "show" : "hide") :
   (iState ? "visible" : "hidden");
}

its all working fine, but i was wanting to know if it was possible to hide a div on the initial page load, but just once off. Basically when the site loads, there is an empty #content div, so I wan to hide it, but that same div holds the content for all the other pages, so it would need to be visible after the first page.

this is the site http://www.blockprojects.com/index.php

any help would be great.

You can create a function to do this, and add an event handler to the body tag.

<script>
function hideDiv(){
document.getElementById('IDGOESHERE').style.display = "none";
}
hideDiv()
</script>

[quote=jkanakaraj;2327028]You can create a function to do this, and add an event handler to the body tag.

<script>
function hideDiv(){
document.getElementById('IDGOESHERE').style.display = "none";
}
hideDiv()
</script>

[/quote]

Actually, the onLoad attribute in the tag, and a call to the function there, should be able to assist you. This is for the body part.

<script>
// Check for INT value. 
var numInt = 1;

// I'd put this code into a separate script so you don't have to re-write this. Javascript can use variables declared on(Level 2: In the Head) and off(Level 3: Separate file) of the page.
// Variable.
function chckFrInt()
{// Check to see if it's the first time.
  if(numInt == 1)
  {//  if it IS the first time
    hideDiv()
  }
}

function hideDiv(){
document.getElementById('IDGOESHERE').style.display = "none";
}
hideDiv()
</script>
<body onload="javascript:chckFrInt()">