Javascript inventory