function SlideShow(Width, Height, Pause, ImagesArray, Canvas0, Canvas1)
{
	this.FadePic = function()
	{
		if (this.curpos < 100)
		{
			this.curpos += 10;
			if (this.tempobj.filters)
			{
				this.tempobj.filters.alpha.opacity = this.curpos;
			}
			else if (this.tempobj.style.MozOpacity)
			{
				this.tempobj.style.MozOpacity = this.curpos / 100;
			}
			if (this.curpos == 100)
			{
				var FadePause = this.Pause;
			}
			else
			{
				var FadePause = 50;
			}
			this.callwrapper1 = new CCallWrapper(this, FadePause, 'FadePic');
			CCallWrapper.asyncExecute(this.callwrapper1);
		}
		else
		{
			nextcanvas = (this.curcanvas == this.Canvas0) ? this.Canvas1 : this.Canvas0
			this.tempobj = this.ie4 ? eval("document.all." + nextcanvas) : document.getElementById(nextcanvas)
			this.tempobj.innerHTML = '<img src="' + this.ImagesArray[this.nextimageindex] + '">'
			this.nextimageindex = (this.nextimageindex < this.ImagesArray.length - 1) ? this.nextimageindex + 1 : 0
			this.curcanvas = (this.curcanvas == this.Canvas0) ? this.Canvas1 : this.Canvas0
			this.callwrapper2 = new CCallWrapper(this, this.Pause, 'RotateImage');
			CCallWrapper.asyncExecute(this.callwrapper2);
		}
	}

	this.RotateImage = function()
	{
		if (this.ie4 || this.dom)
		{
			this.resetit(this.curcanvas)
			var crossobj = this.tempobj = this.ie4 ? eval("document.all." + this.curcanvas) : document.getElementById(this.curcanvas)
			crossobj.style.zIndex += 2
			//this.FadePicInterval = setInterval("this.FadePic()", 50);
			this.callwrapper3 = new CCallWrapper(this, 50, 'FadePic');
			CCallWrapper.asyncExecute(this.callwrapper3);
		}
		else
		{
			document.images.defaultslide.src = this.ImagesArray[this.curimageindex]
		}
		this.curimageindex = (this.curimageindex < this.ImagesArray.length - 1) ? this.curimageindex + 1 : 0
	}
	
	this.resetit = function(what)
	{
		this.curpos = 10
		var crossobj = this.ie4 ? eval("document.all." + what) : document.getElementById(what)
		if (crossobj.filters)
		{
			crossobj.filters.alpha.opacity = this.curpos
		}
		else if (crossobj.style.MozOpacity)
		{
			crossobj.style.MozOpacity = this.curpos / 100
		}
	}
	
	this.Start = function()
	{
		var crossobj = this.ie4 ? eval("document.all." + this.curcanvas) : document.getElementById(this.curcanvas)
		crossobj.innerHTML = '<img src="' + this.ImagesArray[this.curimageindex] + '">'
		this.RotateImage();
	}

	this.Stop = function(ImageFile)
	{
		if (this.callwrapper1)
		{
			this.callwrapper1.cancel();
		}
		if (this.callwrapper2)
		{
			this.callwrapper2.cancel();
		}
		if (this.callwrapper3)
		{
			this.callwrapper3.cancel();
		}
		var crossobj = this.ie4 ? eval("document.all.WholeSlideShow") : document.getElementById('WholeSlideShow')
		crossobj.innerHTML = '<img src="' + ImageFile + '">'
	}

	this.Width = Width;
	this.Height = Height;
	this.Pause = Pause / 2;
	this.ImagesArray = ImagesArray;

	this.ie4 = document.all && navigator.userAgent.indexOf("Opera") == -1;
	this.dom = document.getElementById && navigator.userAgent.indexOf("Opera") == -1;

	this.curpos = 10;
	this.degree = 10;
	this.curcanvas = Canvas0;
	this.Canvas0 = Canvas0;
	this.Canvas1 = Canvas1;
	this.curimageindex = 0;
	this.nextimageindex = 1;

    if (this.ie4 || this.dom)
      document.write('<div id="WholeSlideShow" style="position: relative; width: ' + this.Width + '; height: ' + this.Height + '; overflow: hidden;" align="center"><div id="' + this.Canvas0 + '" style="position: absolute; width: ' + this.Width + '; height: ' + this.Height + '; top: 0; left: 0; filter: alpha(opacity=100); -moz-opacity: 100;"></div><div id="' + this.Canvas1 + '" style="position: absolute; width: ' + this.Width + '; height: ' + this.Height + '; top: 0; left: 0; filter: alpha(opacity=100); -moz-opacity: 100;"></div></div>')
    else
      document.write('<img id="defaultslide" name="defaultslide" src="' + this.ImagesArray[0] + '">')

	this.Start();
}
