I have a floating layer that activates through this link:
<a href="javascript:ToggleFloatingLayer('FloatingLayer',1);"> BUTTON </a>
This is the floating layer:
<div id="FloatingLayer">
<div id="closeX"> <a href="#" onClick="ToggleFloatingLayer('FloatingLayer',0);return false">x</a>
</div>
The script:
<script language="JavaScript1.2">
function ToggleFloatingLayer(DivID, iState) // 1 visible, 0 hidden
{
if(document.layers) //NN4+
{
document.layers[DivID].visibility = iState ? "show" : "hide";
}
else if(document.getElementById) //gecko(NN6) + IE 5+
{
var obj = document.getElementById(DivID);
obj.style.visibility = iState ? "visible" : "hidden";
}
else if(document.all) // IE 4
{
document.all[DivID].style.visibility = iState ? "visible" : "hidden";
}
}
</script>
I want the "BUTTON" to open and also close this floating layer. So it opens and closes in the same link. But right now I can only close it through that "closeX" x. How can I do it?