D'oh .... three posts for what should've been one!! Just noticed a slight bug in Andres code: Andre wrote: > if (type="_unload") type = "unload"; surely, that should be if(type == "_unload") type = "unload"; (two '=' not one) John