javascript variables from database records