How to pass global variables to the jquery scope

How to pass global variables to the jquery scope

Hello everyone
I'm having trouble letting functions I defined in jquery read javascript global variables I defined elsewhere..

for example I have a function defined within my jquery

$(document).ready(function(){

function performTabSlide() {
// do something with currentPosition;
}


elsewhere the page I defined the variable currentPosition and assigned it a value from php..

        document.body.onload=retreiveCurrentPosition();

        function retreiveCurrentPosition() {           
            currentPosition=<?=$currentTab?>;
        }


but currentPosition is not defined withing the jQuery scope at all.. Is there a way to pass global variables between jQuery and other javascript variables in the code?

A