JavaScript helpers for touch devices