Cover JavaScript (could be better, but works OK)