Thats a terrible way of doing it! dont hide the content using a onload use a css display:none
In the <head>
code:
<javascript>
function hide(obj)
{
var ele = document.getElementById(obj);
var style = ele.style;
var img = "img"+obj;
var currentStyle = ele.currentStyle || window.getComputedStyle(ele, null);
if (currentStyle.display == "none"){
style.display = "block";
document.getElementById(img).setAttribute('src','images/opentriangle.gif');
}
else{
style.display = "none";
document.getElementById(img).setAttribute('src','images/triangle.gif');
}
}
</javascript>
code:
<a href="#" onclick="javascript:hide('templates');return false;"><img src="images/triangle.gif" id="imgtemplates" border="0"> Templates/a>
<div id="templates" style="display:none">
Content that hidden
</div>
Not sure if it will work as its taken out of my site....