function fp_image_run(id) {
    var anim = new LAnimation([
        [$S(".fpimageimage", $(id)),
            [0, "opacity: 0.0"],
            [1000, "opacity: 0.0"],
            [2500, "opacity> 1.0"]
        ],
        [$S(".fpimagetext", $(id)), 
            [0, "left: 100%;"],
            [2500, "left: 100%;"],
            [3000, "left> 0%;"]
        ]
    ]);
    
    anim.setTween(LAnimation.smoothEnd);
    anim.setFps(20);
    anim.start();
}

function picturestrip_run(id, spacing) {
    var els = $C("li", $(id));
    var step = els[0].offsetWidth() + spacing, x = 0, animRules = [];
    
    for (i = 0; i < els.length; i++) {
        animRules.push(
            [els[i],
                [0, "left: " + (-step) + "px"],
                [1000, "left> " + x + "px"]
            ]
        );
        
        x += step;
    }
    
    var anim = new LAnimation(animRules);
    
    anim.setTween(LAnimation.smoothEnd);
    anim.setFps(20);
    anim.start();
}

function moving_button_init(id) {
    var el = $(id);
    el.ang = 0.0;
    
    var anim = new LAnimation([
        [el,
            [0, "opacity: 0;"],
            [2000, "opacity: 0;"],
            [3000, "opacity> 1.0;"]
        ]
    ]);
    
    anim.setFps(20);
    anim.start();
    
    new LTimer(50, el, moving_button_tick).setRepeat(true).start();
}

function moving_button_tick() {
    this.style({
        left: Math.floor(Math.cos(this.ang) * 3) + "px",
        top: Math.floor(Math.sin(this.ang + 0.2) * 3) + "px"
    });
    
    this.ang += 0.1;
    while (this.ang > Math.PI * 2)
        this.ang -= Math.PI * 2;
}
