/**
Script: Slideshow.Flash.js
	Slideshow.Flash - Flash extension for Slideshow.

License:
	MIT-style license.

Copyright:
	Copyright (c) 2008 [Aeron Glemann](http://www.electricprism.com/aeron/).
*/

Slideshow.Flash = new Class({
    Extends: Slideshow,
    options: {
        color: ["#FFF"]
    },
    initialize: function(B, C, A) {
        A.overlap = true;
        if (A.color) {
            A.color = $splat(A.color)
        }
        this.parent(B, C, A)
    },
    _show: function(B) {
        if (!this.image.retrieve("tween")) {
            $$(this.a, this.b).set("tween", {
                duration: this.options.duration,
                link: "cancel",
                onStart: this._start.bind(this),
                onComplete: this._complete.bind(this),
                property: "opacity"
            })
        }
        if (B) {
            this.image.get("tween").cancel().set(1)
        } else {
            this.slideshow.retrieve("images").setStyle("background", this.options.color[this.slide % this.options.color.length]);
            var A = (this.counter % 2) ? this.a: this.b;
            A.get("tween").cancel().set(0);
            this.image.get("tween").set(0).start(1)
        }
    }
});