Use GetBranchesLoop and warnings. Remove unused code. Moved the Get's to after auth.
I begin to show how this script will use referer to redirect back to the sending
page upon successful change of branch or printer (see hidden div and recycle_loop).
Indicator for singleBranchMode added.
Also added another helper function for GetBranchesLoop, namely mybranch. This
encapsulates the logic for finding an intelligent default selection, which is
almost always desirable.
This does not resolve bug 2426, but is work in that direction.