/*

*/

function mimiSplash() {
    this._splash_object = null;
    this._slide_interval = 5;
    this._splash_width = null;
    this._current_slide = 0;
    this._max_slides = 0;
	this._k = 0;

    this._timer = null;
    this._timerCounter = 0;

    this.reset = function() {
		this._splash_object.style.backgroundPosition = '0px';
    }
    
	this.maxSlides = function(value) {
		this._max_slides = value;
    }
    
    this.slideInterval = function(value) {
		this._slide_interval = value;
    }
    
    this.width = function(width) {
		this._splash_width = width;
    }

    this.object = function(object_ref) {
		this._splash_object = object_ref;
    }
    
    

    this.processSlideEffect = function() {
		var stopValue = 0; 
		if (this._slide_start > this._slide_end) {
			this._timerCounter-=39;
			stopValue = this._slide_end-39;
			if (this._timerCounter <= stopValue) {
				this._timerCounter = this._slide_end;
				clearTimeout(this._timer);
				return false;
			}
		}
		else {
			this._timerCounter+=39;
			stopValue = this._slide_end+39;
			if (this._timerCounter >= stopValue) {
				this._timerCounter = this._slide_end;
				clearTimeout(this._timer);
				return false;
			}
		}
		this._slideSpeed = 1;
		this.setposition(this._timerCounter);
		this._timer = setTimeout("splash.processSlideEffect()", this._slideSpeed);
    }
        
    this.setposition = function(position) {
	    this._splash_object.style.backgroundPosition = (position - this._k)+ 'px';
    }

    this.slideLeft = function() {
		var oldpos = this._current_slide * this._splash_width;
		var newpos = (((this._current_slide * this._splash_width) - this._splash_width ));
		this._current_slide--;
		this._k = -29;
		this._slide_end = newpos;
		this._slide_start = oldpos
		this.processSlideEffect();
    }
    
    this.slideRight = function() {
		var oldpos = this._current_slide * this._splash_width;
		var newpos = (((this._current_slide * this._splash_width) + this._splash_width ));
		this._current_slide++;
		this._k = 29;
		this._slide_end = newpos;
		this._slide_start = oldpos;
		this.processSlideEffect();
    }

    // End of class
}
