Shows or hides the wait state, either as an explicit setting or depending on the time that a supplied function needs to complete.
Returns the 'this' object.
The required switch is either a boolean or a function. If it is a boolean, the wait state is shown if switch is true and hidden if switch is false. If it is a function (the wait-function), the wait state is switched on just before the function is called and turned off just after the function completes.