Copied menu code from Jquery Mobile

Possibly slow and heavy