$package('ejs.effects',
    $class('SliderEffect').$implements(ejs.events.IEventDispatcher).$define(
        $public({
            targets:[],
            target:null,
            duration:5000,  //ms
            construct:function(){
                var param = arguments[0];
                if(param){
                    this.target = param.target;
                    this.targets = ejs.isArray(param.targets)?param.targets:[];
                    this.duration = ejs.isNumeric(param.duration)?param.duration:5000;
                }
            },
            play:function(parameter){
                parameter && (parameter.delay = this.duration);
                if(this.target){
                    $(this.target).coinslider(parameter);
                }
                else{
                    for(var i=0;i<this.targets.length;++i){
                        if($(this.targets[i]))
                            $(this.targets[i]).coinslider(parameter);
                    }
                }
            }
        })
    )        
);

