var EdgeSlideShow = {
    _local : {},
    _next : null,
    init : function() {
        $(this.__get('class')).children().css({opacity: 0.0});
        $(this.__get('class')+' li:first').css({opacity: 1.0});
        $(this.__get('class')+' li:first').addClass(this.__get('showclassname'));
    },

   __set : function( key , value ) {
        this._local[key] = value;
    },

    __get : function( key ) {
        return this._local[key];
    },

    __isset : function ( varname ) {
        return( varname === undefined ) ? false : true;
    },

    _setNext : function() {
        $(this.__get('showclass')).removeClass(this.__get('showclassname'));
        this._next.addClass(this.__get('showclassname'));
    },

    run : function( settingsObj ) {
        this.__set('class' , '.' + settingsObj.classname);
        this.__set('showclassname' ,(this.__isset(settingsObj.showclassname)) ? settingsObj.showclassname : 'showclass' );
        this.__set('showclass' , (this.__isset(settingsObj.showclassname)) ? '.' + settingsObj.showclassname : '.showclass');
        this.__set('fadeSpeed' , (this.__isset(settingsObj.fade)) ? settingsObj.fade : 1000 );
        this.__set('interval' , (this.__isset(settingsObj.interval )) ? settingsObj.interval : 6000 );
        this.init();
        setInterval('EdgeSlideShow.rotate()', this.__get('interval'));
    },

    rotate : function() {
        this._next = ( ! $(this.__get('showclass')).next().length ) ? $(this.__get('class')+' li:first') : $(this.__get('showclass')).next();
        this._next.animate({opacity: 1.0} , this.__get('fadeSpeed'));
        $(this.__get('showclass')).animate({opacity: 0.0} , this.__get('fadeSpeed'));
        this._setNext();
        
    }
}
