You may be able to adapt code from Application-wide configuration, actually.
In reply to Re: Site Wide Variables by akho in thread Site Wide Variables by Anonymous Monk