Menu navigation and ajax wait function