oops, I just realized it should switch to visitor mode when I go to view space.. must mean my code is really wrong:)
Here is the code, which I believe was taken directly from MS's site
if (p_args.module.getMode() == Web.Gadget.Mode.guest) {
img1.style.visible = false;
Incendy,
This is the code I use.
if (p_args.module.getMode() == Web.Gadget.Mode.view ) {
} else
{
}