hi maback, welcome to the board.
unfortunately, renfe's "tiknet" service (online ticket purchasing) does not allow for buying "trenhotel" tickets

, only normal tickets.
howeeeeeeeeeeeeeeeeever...
there is a renfe agent in u.s.a. that you can try...
"rail europe group"
web:
www.raileurope.com phones: 1-800-438-7245 / 1-877-456-rail
e-mail: service@raileurope.com
they have tons of different products but maybe if you call them they can tell you if your trenhotel purchase will be possible.
since you want to take 2 trenhotels, you may want to consider the flexipass at
www.raileurope.com/us/rail/passes/spain_flexipass.htm . see also "how it works" at
http://www.raileurope.com/us/common/how_pass_works.htm for conditions and comments on overnight travel (the "Seat Reservations and Overnight Travel" section).
PLEASE let us know what they say and how it works out, this is an interesting topic.
saludos,
jer...