I finally figured it out, it works something like this:
var wordLength = this.word.length;
var result = this.word.substring(0,1).toUpperCase() +
this.word = result;
this.word = word;
this.titleCase = titleCase;
var testword = new titlestr("test");
then in the body you simply put in
Of course, I still need to do a little bit more work to make it
handle multiple words and so on, but the basic idea works. I
wrote the answer based on some info on netscapes web-site in a
discussion of custom objects.
I was really suprised at some of what you can do with them. I am
looking at making other scripts I have written more Object
Oriented using this technique.