Sharing variabe in multiple javascript files

Hi friends,

I have created a flag variable and some functions to retrive and update
its vales.
1)getFlag():
returns the value of the flag
2)toggleFlag():
toggle value of flag.
I have used one .js file to contain functions and
one .rhtml file which uses those functions.
I have used those functions to avoid multiple
popup windows the window is able to open only when the flag is true.
Initially flag is true when window is opened it is set to false and when
window is closed the flag become true to allow other window to be open.
But in this flow when i add some alert boxes to see the
values it shows correct values till one window is got closed but after
it shows flag as false.

please help me…

Kiran
[email protected]