Thanks to all the monks for your help. This made me improve my code and make the functions more generic. What's the bad news? After putting a lot of work into this (I'm still a newbie, so it takes me a while), the brass is so pro-microsoft that they don't want anything that isn't asp or jsp on our intranet. It was a good experience though. Especially since I decided to break down and use references--that definitely taught me a lot.
As far as the http header thing, the idea is that if it is a script file, it reads all of it in, which would include the http header. the regular files would be coded to start and end at the body tags.
Thanks again,
Derek