I'm new-ish to Javascript, and I'm currently renovating a Team Fortress 2 Crafting Game which is Javascript based.

What I'm trying to do is to have the item's description and level show up on the right-hand side of the screen. For hats, the level needs to be random. Problem is, the random level I assign either changes when I hover over the hat or it stays the same for that hat and every other.

My question is: how would I set the random integer for that instance of the hat, and no other?

(if this is worded incorrectly, or there is something you do not understand, please post it)

Here is the game so far:
Game
Rar'd files