And yes, you need to define the vars outside the functions to access them from other functions
var xposition;
var yposition;
function saveScrollC() {
xposition = document.body.scrollLeft:window.pageXOffset;
yposition = document.body.scrollTop:window.pageYOffset;
}