Updated collision test javascript.