Javascript Toytrain object