    /* jshint browser: true */

    //animation ID's needed for cancelAnimationFrame
    var eyeshadowAnim;


    // var renderShadow = PIXI.autoDetectRenderer(640, 480, {
    //     antialias: true,
    //     transparent: true
    // });

    //document.getElementById('eyeshadowHolder').appendChild(renderer.view);

    //var shadowStage = new PIXI.Container();

    // create the root of the scene graph
    var shadowLeft = PIXI.Sprite.fromImage('img/eyeshadow/eyeshadowLeft.png');
    var shadowRight = PIXI.Sprite.fromImage('img/eyeshadow/eyeshadowRight.png');

    // var blurFilter = new PIXI.filters.BlurFilter();

    // shadowRight.filters = [blurFilter];
    // shadowRight.passes = 3;
    // shadowRight.blur = 50;

    // shadowLeft.filters = [new PIXI.filters.BlurXFilter(), new PIXI.filters.BlurYFilter()];
    // shadowRight.filters = [new PIXI.filters.BlurXFilter(), new PIXI.filters.BlurYFilter()];

    var shadowLeftMask = new PIXI.Graphics();
    var shadowRightMask = new PIXI.Graphics();

    var blurFilter = new PIXI.filters.BlurFilter();

    blurFilter.passes = 5;
    blurFilter.blur = 30;
    shadowLeft.filters = [blurFilter];
    shadowRight.filters = [blurFilter];

    shadowLeft.anchor.x = 0.5;
    shadowLeft.anchor.y = 0.5;

    shadowRight.anchor.x = 0.5;
    shadowRight.anchor.y = 0.5;

    shadowLeft.alpha = 0.75;
    shadowRight.alpha = 0.75;

    stage.addChild(shadowLeft);
    stage.addChild(shadowRight);

    stage.addChild(shadowLeftMask);
    stage.addChild(shadowRightMask);

    //apply eyeshadow
    function applyEyeshadow() {
        var hex = "0x" + eyeshadowColor;

        //console.log(faceScale);
        eyeshadowAnim = compatibility.requestAnimationFrame(applyEyeshadow);

        shadowLeft.x = holderLeftX;
        shadowLeft.y = holderLeftY;
        shadowLeft.scale.set(faceScale);
        shadowLeft.rotation = r;

        shadowRight.x = holderRightX;
        shadowRight.y = holderRightY;
        shadowRight.scale.set(faceScale);
        shadowRight.rotation = r;

        //draw left
        shadowLeft.tint = hex;
        shadowRight.tint = hex;

        shadowLeftMask.clear();
        shadowLeftMask.beginFill(0xFF0000, 1);
        shadowLeftMask.moveTo(shadowLeft.x - shadowLeft.width / 2, shadowLeft.y - shadowLeft.height / 2);
        shadowLeftMask.lineTo(shadowLeft.x + shadowLeft.width / 2, shadowLeft.y - shadowLeft.height / 2);
        shadowLeftMask.lineTo(shadowLeft.x + shadowLeft.width / 2, shadowLeft.y + shadowLeft.height / 2);
        shadowLeftMask.lineTo(shadowLeft.x - shadowLeft.width / 2, shadowLeft.y + shadowLeft.height / 2);

        var newX = ((shadowLeft.x - shadowLeft.width / 2) + (shadowLeft.x - shadowLeft.width / 2)) / 2;
        var newY = (shadowLeft.y + shadowLeft.height / 2) - 1;

        //shadowLeftMask.lineTo(newX, newY);
        shadowLeftMask.lineTo(points[36 * 2], points[36 * 2 + 1]);
        shadowLeftMask.quadraticCurveTo((points[40 * 2] + points[41 * 2]) / 2, (points[40 * 2 + 1] + points[41 * 2 + 1]) / 2 + (points[40 * 2 + 1] - points[38 * 2 + 1]), points[39 * 2], points[39 * 2 + 1]);
        shadowLeftMask.quadraticCurveTo((points[38 * 2] + points[37 * 2]) / 2, (points[38 * 2 + 1] + points[37 * 2 + 1]) / 2 - 25 * faceScale, points[36 * 2], points[36 * 2 + 1] - 1);
        shadowLeftMask.lineTo(newX, newY);
        shadowLeftMask.endFill();

        //draw right
        shadowRightMask.clear();
        shadowRightMask.beginFill(0xFF0000, 1);
        shadowRightMask.moveTo(shadowRight.x + shadowRight.width / 2, shadowRight.y - shadowRight.height / 2);
        shadowRightMask.lineTo(shadowRight.x - shadowRight.width / 2, shadowRight.y - shadowRight.height / 2);
        shadowRightMask.lineTo(shadowRight.x - shadowRight.width / 2, shadowRight.y + shadowRight.height / 2);
        shadowRightMask.lineTo(shadowRight.x + shadowRight.width / 2, shadowRight.y + shadowRight.height / 2);

        newX = ((shadowRight.x + shadowRight.width / 2) + (shadowRight.x + shadowRight.width / 2)) / 2;
        newY = (shadowRight.y + shadowRight.height / 2) - 1;

        //shadowRightMask.lineTo(newX, newY);
        shadowRightMask.lineTo(points[45 * 2], points[45 * 2 + 1]);
        shadowRightMask.quadraticCurveTo((points[47 * 2] + points[46 * 2]) / 2, (points[47 * 2 + 1] + points[46 * 2 + 1]) / 2 + (points[47 * 2 + 1] - points[43 * 2 + 1]), points[42 * 2], points[42 * 2 + 1]);
        shadowRightMask.quadraticCurveTo((points[43 * 2] + points[44 * 2]) / 2, (points[43 * 2 + 1] + points[44 * 2 + 1]) / 2 - 25 * faceScale, points[45 * 2], points[45 * 2 + 1] - 1);
        shadowRightMask.lineTo(newX, newY);
        shadowRightMask.endFill();

        shadowLeft.mask = shadowLeftMask;
        shadowRight.mask = shadowRightMask;

        renderer.render(stage);
    }
