window.onload = function() {

    TweenMax.set('.centerX', {position:'absolute', xPercent:-50, left:'50%'});
    TweenMax.set('.centerY', {position:'absolute', yPercent:-50, top:'50%'});
    TweenMax.set('.centerXY', {position:'absolute', xPercent:-50, yPercent:-50, left:'50%', top:'50%'});

    var tl = new TimelineMax(/*{repeat:1, repeatDelay: 3}*/)
    .set('#ad', {visibility : 'visible'})

    .addLabel('start', '+=.3')
    .fromTo('#logo-et-moi-wrapper .shadow .flare', 1, {xPercent:-100}, {xPercent:70, ease: Power0.easeOut}, 'start')
    .staggerFrom('#text1 > span', .5, {width:0, ease: Power1.easeOut}, .4, '-=.1')

    .addLabel('s1', '+=.5')
    .to('#ml1', .3, {opacity:0,ease:Power2.easeOut}, 's1')
    .to('#logo-et-moi-wrapper', .3, {opacity:0, x:-300, ease:Power2.easeOut}, 's1')
    .from('#logo', .3, {opacity:0, ease:Power2.easeOut}, 's1')
    .staggerFrom('#text-reduc > *', .5, {x:300, opacity:0, ease: Power2.easeOut}, .1, 's1')
    .fromTo('#text-reduc .shadow .flare', .8, {xPercent:-100}, {xPercent:100, ease: Power0.easeOut}, '-=0')
    .from('#ml-reduc', .3, {opacity:0, ease:Power2.easeOut}, '-=.3')


    .addLabel('s2', '+=1.5')
    .to('#text-reduc, #ml-reduc', .3, {opacity:0, x: -300, ease:Power2.easeOut}, 's2')
    .staggerFrom('#text1 > *', .5, {opacity:0, x:300, ease: Power2.easeOut}, .1, 's2')
    .fromTo('#text1 .shadow .flare', .8, {xPercent:-100}, {xPercent:100, ease: Power0.easeOut}, '-=0')

    .addLabel('s3', '+=1.3')
    .to('#text1', .3, {opacity:0, x: -300, ease:Power2.easeOut}, 's3')
    .staggerFrom('#text2 > *', .5, {x:300, opacity:0, ease: Power2.easeOut}, .1, 's3')
    .fromTo('#text2 .shadow .flare', .8, {xPercent:-100}, {xPercent:100, ease: Power0.easeOut}, '-=0')

    .addLabel('packshot', '+=1.3')
    .from('#logo-white', .5, {opacity:0, ease:Power1.easeOut}, 'packshot')
    .to('#logo', .15, {opacity:0, ease:Power1.easeOut}, 'packshot+=.35')

    .from('#packshot', .5, {xPercent:100, opacity:0, ease:Power1.easeOut}, 'packshot')
    .from('#cta', .5, {width:0, ease:Power2.easeOut}, '-=0')
    .from('#packshot-ml', 1, {opacity:0, ease:Power2.easeOut}, 'packshot+=.5')
   
    .fromTo('#cta .shadow', 1, {xPercent:-100}, {xPercent:50, ease: Power1.easeOut}, '-=.8')

    

}