Other not so elegant way of detecting touch screen devices

But at least it seems to work. We could probably also use the built in mechanism that is also used for mobile theming. But then I would have to pass a new parameter to the template