JavaScript can't access the JSP variable, because that exists on the server when the page is generated. You can embed the value of that variable in the JavaScript code. Something like the following should do the trick.
Leave out the double quotes if the value is numerical.
Be sure that you understand why that works. Do a View Source on the page as sent to the browser, and you will see that the value was substituted on the server before the browser gets the page.