Nested Fuction Issue

Hi, i’m trying to get my gallery scroller to activate on scrollwheel instead of just button click - to do this i’ve added the listener code and nested the scrolling function inside, however the nested function is not being called at all, is it due to incorrect syntax or something?

Individually the components work fine, i can get traces back on the mousewheel and the scroller does work on button click…Think i am joining the two together incorrectly.

var yPositions = new Array(0, -150, -300, -450, -600);
var mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
    // this is an array for storing the positions of the slider
    function jumpTo(number) {
        // this function takes the variable "number" that is passed from the buttons and takes the corresponding 
        // value from the array of positions, then sets the new position in the slider to the new position.
        slider.newY = yPositions[number];

Thanks for any help!