Comment simplifier mon code javascript?

Version imprimable