function slideImg(ObjId, SlideContainerId, SlidePath, SlideArray, NoThumb, Random, FullPath)
{
	this.objId = ObjId;
	this.slideContainerId = SlideContainerId;
	this.slidePath = SlidePath;
	this.slideArray = SlideArray;
	
	if(FullPath != null)
	    this.fullPath = FullPath;
	else
	    this.fullPath = false;
	    
	if(NoThumb != null)
		this.noThumb = NoThumb;
	else
		this.noThumb = false;
		
	this.slideNb = 0;
	
	if(Random != null)
		this.random = Random;
	else
		this.random = false;
		
	this.showSlide = ShowSlide;
	this.rotate = Rotate;
	this.beginSlideShow = BeginSlideShow;
	this.nextSlide = NextSlide;
	
	// Constructor
	//this.showSlide();
	this.rotate();
	return;
	
	function ShowSlide()
	{
	    if(this.slideNb >= this.slideArray.length)
	        return;
	        
		var src = "";
		var obj = document.getElementById(this.slideContainerId);
		if(this.fullPath)
		    src = this.slideArray[this.slideNb].substring(1,this.slideArray[this.slideNb].length);
		else
		{
		    if(this.noThumb)
			    src = this.slidePath + "/" + this.slideArray[this.slideNb] + ".jpg";
		    else
			    src = this.slidePath + "/" + this.slideArray[this.slideNb] + "_thumb.jpg";
	    }

        if(src != "")
        {
            obj.src = src;
            
		    if(obj.title == "")
		        obj.title = "Se mere...";
		}
	}

	function Rotate()
	{
		if(this.random)
		{
		    var seed = new Date().getSeconds();
			this.slideNb = Math.floor(Math.random(seed)*this.slideArray.length);
		}
		else
		{
			if(this.slideNb >= this.slideArray.length)
			{
				this.slideNb = -1;
		    }

			this.slideNb++;
		}
   		this.showSlide();
		this.nextSlide();
	}
	
	function NextSlide()
	{
	    if(this == window)
	        return;
	        
	    var _this = this; 
        setTimeout(function() { _this.rotate(); }, 3000);        
	}

	function BeginSlideShow()
	{
		this.nextSlide();
	}
}

