Thanks for all the examples. I was able to find a couple ways on my own, but I love to see how other people solve these problems so I can learn new techniques.
Hardest thing for me when in JavaScript is taking my mind out of C and PHP. Shared syntax is a blessing and a curse.