Javascript for cell state/colors