Hi,
be aware: The value will be computed on page load, that means if you change that value in the XPage, in your CSJS code, the initial value from the variable will be used, to update the value you have to refresh the page/ that element in which you use this variable.