Just enclose your block of code within a span or division and then toggle the display from NONE to BLOCK whenever you want to hide or display your code:
Here the span is hidden via the style attribute of "display:none"
Code:
<span id="myspan" style="display:none;">
and here it is displayed:
Code:
<span id="myspan" style="display:block;">
To change it I created two functions LoadElement and HideElement which accepts the name of a span or division as the parm.
Code:
function LoadElement(eid)
{
var element = document.getElementById(eid);
element.style.display = 'block';
}
Code:
function HideElement(eid)
{
var element = document.getElementById(eid);
element.style.display = 'none';
}
Then to display the span:
Code:
LoadElement('myspan');
and to hide the span:
Code:
HideElement('myspan');
That's how I do it. Of course you still need the code to test for a specific user , group or style that you want to show/hide the block for