Detect a red ball on a foosball table with javascript