This DHTML script is featured on Dynamic Drive.
Click here and read about the story and the math involved in the Tower of Hanoi.