Not able to access global JS variable in Rails

Hie,
I have a very genuine problem, may be i am unaware abt the method of
doing it.
I have to declare a global variable and have to give him a value
dynamically.
I am doing it at top of my page in script tag as

I am using dyna arch calendar to implement the dynamic weekends.
But i am not able to get the value of this variable from my js method.
Please help!!!
Thanks in anticipation.
Anand