Javascript changes, added a touch event detection