I'm only skimming the thread, but if you define your globals up top before the $(document).ready, they should be available for the page lifecycle. It can get you into trouble unless you use variable names you are sure will be unique in the document namespace, of course.
M.