function StartScreen(imageMngr, canvasElement, canvasCtx, highScore, startGameFunction)
{
    _highscoreStartLocation = {x: 832, y: 58};
    _lastX = -1;
    _lastV = -1;
    _maxSpeed = 40;
    _waveReset = 0;
    _rightWave = false;
    _leftWave = false;

    this._handFollowMouse = function(event)
    {
        canvasRect = canvasElement.getBoundingClientRect();
        width = imageMngr.startScreenHand.width;
        height = imageMngr.startScreenHand.height;
        x = event.clientX - canvasRect.left;
        y = event.clientY - canvasRect.top;
        v = -1;
        didWave = false;

        if(_lastX == -1) 
        {
            _lastX = x;
        } 
        else 
        {
            v = _lastX - x;
            if(v > _maxSpeed)
            {
                v = _maxSpeed;
                _rightWave = true;
                _waveReset = 40;
            }
            else if(v < -_maxSpeed)
            {
                v = -_maxSpeed;
                _leftWave = true;
                _waveReset = 40;
            }
        }

        canvasCtx.save();

        canvasCtx.drawImage(imageMngr.startScreenBackgroud, 0, 0);

        canvasCtx.fillStyle="gold";
        canvasCtx.font = "30px Arial";
        canvasCtx.fillText(highScore, 
            _highscoreStartLocation.x, 
            _highscoreStartLocation.y);

        canvasCtx.translate(x, y);
        if(v != -1)
        {
            newV = _lastV + v
            if(newV > _maxSpeed) newV = _maxSpeed;
            if(newV < -_maxSpeed) newV = -_maxSpeed;
            rotation = (newV / _maxSpeed) * 0.35;
            canvasCtx.rotate(Math.PI * rotation);

            _lastX = x;
            _lastV = v;
        }
        canvasCtx.drawImage(imageMngr.startScreenHand, -width / 2, -height * 0.75);

        canvasCtx.restore();

        if(_rightWave && _leftWave)
        {
            canvasElement.onmousemove = undefined;
            startGameFunction();
        }
        else 
        {
            _waveReset -= 1;
            if(_waveReset < 1)
            {
                _rightWave = false;
                _leftWave = false;
            }
        }
    }

    this.displayStartScreen = function()
    {
        canvasCtx.save();
        canvasElement.style.cursor = "none";
        canvasCtx.drawImage(imageMngr.startScreenBackgroud, 0, 0);

        canvasCtx.fillStyle="gold";
        canvasCtx.font = "30px Arial";
        canvasCtx.fillText(highScore, 
            _highscoreStartLocation.x, 
            _highscoreStartLocation.y);

        canvasCtx.restore();

        canvasElement.onmousemove = this._handFollowMouse;
    }
}

function EndScreen(imageMngr, canvasElement, canvasCtx, lastScore, highScore, startGameFunction)
{
    _highscoreEndLocation = {x: 562, y: 460};
    _lastscoreEndLocation = {x: 382, y: 460};
    _lastX = -1;
    _lastV = -1;
    _maxSpeed = 40;
    _waveReset = 0;
    _rightWave = false;
    _leftWave = false;

    this._handFollowMouse = function(event)
    {
        canvasRect = canvasElement.getBoundingClientRect();
        width = imageMngr.startScreenHand.width;
        height = imageMngr.startScreenHand.height;
        x = event.clientX - canvasRect.left;
        y = event.clientY - canvasRect.top;
        v = -1;
        didWave = false;

        if(_lastX == -1) 
        {
            _lastX = x;
        } 
        else 
        {
            v = _lastX - x;
            if(v > _maxSpeed)
            {
                v = _maxSpeed;
                _rightWave = true;
                _waveReset = 40;
            }
            else if(v < -_maxSpeed)
            {
                v = -_maxSpeed;
                _leftWave = true;
                _waveReset = 40;
            }
        }

        canvasCtx.save();
        canvasElement.style.cursor = "none";
        canvasCtx.drawImage(imageMngr.endScreenBackgroud, 0, 0);

        canvasCtx.fillStyle="black";
        canvasCtx.font = "30px Arial";

        canvasCtx.fillText(lastScore, 
            _lastscoreEndLocation.x, 
            _lastscoreEndLocation.y);

        canvasCtx.fillStyle="gold";

        canvasCtx.fillText(highScore, 
            _highscoreEndLocation.x, 
            _highscoreEndLocation.y);

        canvasCtx.translate(x, y);
        if(v != -1)
        {
            newV = _lastV + v
            if(newV > _maxSpeed) newV = _maxSpeed;
            if(newV < -_maxSpeed) newV = -_maxSpeed;
            rotation = (newV / _maxSpeed) * 0.35;
            canvasCtx.rotate(Math.PI * rotation);

            _lastX = x;
            _lastV = v;
        }
        canvasCtx.drawImage(imageMngr.endScreenHand, -width / 2, -height * 0.75);

        canvasCtx.restore();

        if(_rightWave && _leftWave)
        {
            canvasElement.onmousemove = undefined;
            startGameFunction();
        }
        else 
        {
            _waveReset -= 1;
            if(_waveReset < 1)
            {
                _rightWave = false;
                _leftWave = false;
            }
        }
    }

    this.displayEndScreen = function()
    {
        canvasCtx.save();
        canvasElement.style.cursor = "none";
        canvasCtx.drawImage(imageMngr.endScreenBackgroud, 0, 0);

        canvasCtx.fillStyle="black";
        canvasCtx.font = "30px Arial";

        canvasCtx.fillText(lastScore, 
            _lastscoreEndLocation.x, 
            _lastscoreEndLocation.y);

        canvasCtx.fillStyle="gold";

        canvasCtx.fillText(highScore, 
            _highscoreEndLocation.x, 
            _highscoreEndLocation.y);

        canvasCtx.restore();

        canvasElement.onmousemove = this._handFollowMouse;
    }
}