I still haven't been able to figure this out

I tried putting my function in each of the places suggested thus far and can't get it to work. So let me try & tell you what I am trying to do maybe someone can suggest a better way.
We have a header that fails (really goes to pieces) in NS 4.xx so somehow we need to determine if the viewer is useing NS 4.xx and if so serve them an alternate header (actualy an alternate set of buttons) is there some other way to do it?