function SlideShowObj( ComponentName, 
	ComponentWidth, ComponentHeight, Alignment,
	LeftMargin, TopMargin, RightMargin, BottomMargin, 
	IAHeight, SpaceBetIAandTA, ShowDivider, 
	EffectSpeed, StepSize, PauseTime, Sequence, 
	BkImage, BkAudio, BkColor, BorderSize, BorderColor,
	SlidesData, StartMute, MouseOverPause )
{
	this.LoadOneTime = 2;
	this.MaxSimultaneousLoads = 5;

	this.browser = 0;
	if ( document.all ) this.browser = 1; // IE
	else if ( document.layers ) this.browser = 2; // NS4
	else if ( document.getElementById && !document.all ) this.browser = 3; // NS6
	if ( navigator.userAgent.indexOf("Opera") != -1 ) this.browser = 4; // Opera

	this.name = ComponentName;
	this.ComponentWidth = ComponentWidth;
	this.ComponentHeight = ComponentHeight;
	this.Alignment = Alignment;
	this.LeftMargin = LeftMargin;
	this.TopMargin = TopMargin;
	this.RightMargin = RightMargin;
	this.BottomMargin = BottomMargin;
	this.swidth = ComponentWidth - LeftMargin - RightMargin;
	if ( this.browser != 3 ) this.swidth -= ( BorderSize + BorderSize );
	this.ImgAreaHeight = IAHeight;
	this.sheight = ComponentHeight - TopMargin - BottomMargin;
	if ( this.browser != 3 ) this.sheight -= ( BorderSize + BorderSize );
	this.TextAreaTop = TopMargin + IAHeight + SpaceBetIAandTA
	this.TextAreaHeight = this.sheight - (IAHeight + SpaceBetIAandTA);
	this.SpaceBetImgAndText = SpaceBetIAandTA;
	this.ShowDivider = ShowDivider;
	this.EffectSpeed = EffectSpeed;
	this.StepSize = StepSize;
	this.PauseInterval = PauseTime;
	this.Sequence = Sequence;
	this.BkImage = BkImage;
	this.BkColor = BkColor;
	this.BorderSize = BorderSize;
	this.BorderColor = BorderColor;
	this.index = -1;
	this.intervalId = 0;
	this.EffectIntervalId = 0;
	this.bPauseFlag = 0;
	this.IframeInterval = 0;
	this.Layer = "";
	this.BkAudioInterval = 0;
	this.arrImages= new Array ();
	this.BkAudioPlayOnce = false;
	this.MouseOverPause = MouseOverPause;
	
	//Member functions
	this.GenerateHTML = SlideShow_GenerateHTML;
	this.StartSlideShow = SlideShow_StartSlideShow;
	this.SetSlide = SlideShow_SetSlide;
	this.PlayEffect = SlideShow_PlayEffect;
	this.GetIFrameInnerHTML = SlideShow_GetIFrameInnerHTML;
	this.SetDivInnerHTML = SlideShow_SetDivInnerHTML;
	this.StartBkAudio = SlideShow_StartBkAudio;
	this.HandleButton = SlideShow_HandleButton;
	this.ImageComplete = SlideShow_ImageComplete;
	this.Back = SlideShow_Back;
	this.Next = SlideShow_Next;
	this.Play = SlideShow_Play;
	this.Pause = SlideShow_Pause;
	this.Begin = SlideShow_First;
	this.End = SlideShow_Last;
	this.ToggleSound = SlideShow_ToggleSound;
	this.GotoSlide = SlideShow_GotoSlide;
	
	this.LoadContent = SlideShow_LoadContent;
	this.MouseOver = SlideShow_MouseOver;
	this.MouseOut = SlideShow_MouseOut;
	this.CreateLayers = SlideShow_CreateLayers;
	this.LoadSlides = SlideShow_LoadSlides;
	this.LoadSlideImage = SlideShow_LoadSlideImage;
	this.LoadSlideDesc = SlideShow_LoadSlideDesc;
	this.EnableAudio = navigator.javaEnabled();
	this.PlayAudio = 1 - StartMute;
	this.DescLoading = 0;
	this.ImgLoading = 0;
	this.AllLoaded = false;

	if ( this.browser != 4 )
	{
		var arrSlides, arrSlideData;

		arrSlides = SlidesData.split ( "##RS##" );
		if ( arrSlides.length > 0 )
		{
			for ( var i = 0 ; i < arrSlides.length ; i++ )
			{
				arrSlideData = arrSlides[i].split ( "##FS##" );
				if ( arrSlideData.length == 10 )
				{
					if ( ! this.EnableAudio ) arrSlideData[1] = "";
					this.arrImages[this.arrImages.length] = new SlideShowImage ( this.swidth, this.ImgAreaHeight, arrSlideData[0], arrSlideData[1], arrSlideData[2], arrSlideData[3], arrSlideData[4], arrSlideData[5], arrSlideData[6], arrSlideData[7], arrSlideData[8], arrSlideData[9] );
				}
			}
		}
		if ( this.EnableAudio && BkAudio != "" )
		{
			this.BkAudioPlayOnce = ( BkAudio.charAt(BkAudio.length-1) == "1" );
			if (this.PlayAudio) this.BkAudioInterval = setInterval ( this.name+".StartBkAudio()", 1000 );
		}
	}
	return this;
}

function SlideShow_StartBkAudio ()
{
	var oApplet = document.applets["BkAudio_"+this.name];

	if ( this.EnableAudio == false )
	{
		clearInterval ( this.BkAudioInterval );
		return;
	}
	if ( oApplet && oApplet.AppletLoaded == true )
	{
		(this.BkAudioPlayOnce==true) ? oApplet.PlayAudio() : oApplet.LoopAudio();
		clearInterval ( this.BkAudioInterval );
	}
}

function SlideShowImage(cw,ch,ImageName,SoundFile,Url,Target,StatusBarMsg,EntryEffect,ImgDesc,ImgDescFileName,DescAfterEffect,center)
{
	var imgdata;
	
	imgdata = ImageName.split ( "*" );
	this.ImageName = imgdata[0];
	this.w = (imgdata[1] > 0) ? imgdata[1] : 0;
	this.h = (imgdata[2] > 0) ? imgdata[2] : 0;
	this.Sound = SoundFile;
	this.Url = Url;
	this.Target = Target;
	this.Msg = StatusBarMsg;
	this.x = (center == 1) ? (cw-this.w)/2 : 0;
	this.y = (center == 1) ? (ch-this.h)/2 : 0;
	this.EntryEffect = EntryEffect;
	this.CurrentX = 0;
	this.CurrentY = 0;
	this.xStepSize = 0;
	this.yStepSize = 0;
	this.ImgDescription = ImgDesc;
	this.ImgDescFileName = ImgDescFileName;
	this.DescAfterEffect = DescAfterEffect;
	this.center = center;
	this.ImageLoaded = 0;
	this.DescLoaded = 0;
	
	return this;
}

function SlideShow_GetIFrameInnerHTML ( index )
{
	var obj, val = "";
	if ( this.browser == 1 )
	{
		obj = document.frames["LoadDesc"+this.name+index].document.all.tags("BODY");
		if ( typeof(obj[0]) != "undefined" ) val = obj[0].innerHTML;
	}
	else if ( this.browser == 3 )
	{
		obj = document.getElementById("LoadDesc"+this.name+index);
		if ( obj.contentDocument != null  ) val = obj.contentDocument.body.innerHTML
	}
	return val;
}

function SlideShow_SetDivInnerHTML ( name, val )
{
	var obj;
	
	if ( this.browser == 1 ) obj = document.all(name);
	else if ( this.browser == 3 ) obj = document.getElementById(name);
	obj.innerHTML = val;
}

function SlideShow_LoadContent()
{
	var i, val;

	for(i=0; i< this.arrImages.length; i++)
	{
		if(this.arrImages[i].ImgDescription == "")
		{
			val = this.GetIFrameInnerHTML ( i );
			if ( val != "" )
			{
				this.arrImages[i].ImgDescription = val;
				this.SetDivInnerHTML ( "Description"+this.name+i, val );
				this.DescLoading--;
			}
		}
	}
	if ( ! this.DescLoading )
	{
		if ( ! this.arrImages[this.index].DescLoaded ) { this.LoadSlideDesc(this.index); }
		else { clearInterval(this.IframeInterval); this.IframeInterval = 0; }
	}
}

function SlideShow_GenerateHTML ()
{
	var i, s;

	for(i=0; i < this.arrImages.length; i++)
		if(this.arrImages[i].ImgDescription == "" && this.arrImages[i].ImgDescFileName == "") this.arrImages[i].ImgDescription = " ";

	document.write ( '<table cellpadding=0 cellspacing=0 border=0 align=' + this.Alignment + '><tr><td>' );
	//creating tags/layers depending on the browser
	if (this.browser==4)
	{
		document.write('<table width='+this.ComponentWidth+' height='+this.ComponentHeight+' border=1><tr><td align=center valign=center>This component is not compatible with Opera browser.</td></tr></table>');
	}
	else if ( this.browser == 2 )
	{
		var cw = (this.ComponentWidth-this.BorderSize-this.BorderSize), ch = (this.ComponentHeight-this.BorderSize-this.BorderSize);
		document.write('<ILAYER name="nsbase'+this.name+'" clip="0,0,'+this.ComponentWidth+','+this.ComponentHeight+'" bgcolor="'+this.BorderColor+'">');
		document.write('<LAYER name="nsbkg'+this.name+'" left="'+this.BorderSize+'" top="'+this.BorderSize+'" width="'+cw+'" height="'+ch+'" background="'+this.BkImage+'" bgcolor="'+this.BkColor+'"></Layer>');
		document.write('<LAYER name="ns4slider'+this.name+'" left="'+this.BorderSize+'" top="'+this.BorderSize+'" clip="0,0,'+cw+','+ch+'" width= "'+cw+'" height="'+ch+'">');
		document.write('<LAYER name="ns4slider0'+this.name+'" left="0" top="0" width="'+cw+'" height="'+ch+'" onmouseover="'+this.name+'.MouseOver();" onmouseout="'+this.name+'.MouseOut();"></Layer>');
		document.write('<LAYER name="ns4slider1'+this.name+'" left="'+this.LeftMargin+'" top="'+this.TopMargin+'" width="'+this.swidth+'" height="'+this.ImgAreaHeight+'" clip="0,0,'+this.swidth+','+this.ImgAreaHeight+'" onmouseover="'+this.name+'.MouseOver();" onmouseout="'+this.name+'.MouseOut();">');
		s = "";
		for(i=0; i < this.arrImages.length; i++)
			s += '<layer name="ImgHrefLayer'+this.name+i+'" left="0" top="0" visibility="hidden"></layer>';
		document.write ( s );
		document.write('</LAYER>'); // ns4slider1
		s = '';
		for ( i = 0 ; i < this.arrImages.length ; i++ )
			s += '<layer name="Caption'+this.name+i+'" left="'+this.LeftMargin+'" top="'+this.TextAreaTop+'" width="'+this.swidth+'" height="'+this.TextAreaHeight+'" clip="0,0,'+this.swidth+','+this.TextAreaHeight+'" visibility="hidden"></layer>';
		document.write(s);
		document.write('</LAYER>'); // ns4slider
		if ( this.ShowDivider == 1 )
		{
			s = '<layer name="divider'+this.name+'" left="0" top="'+((this.TextAreaTop-(this.SpaceBetImgAndText/2))-(this.BorderSize/2))+'" width="'+this.ComponentWidth+'" height="'+this.BorderSize+'" bgcolor="'+this.BorderColor+'" visibility="show"></layer>'
			document.write(s);
		}
		document.write('</ILAYER>'); // ns4base

		this.Layer = document.layers["nsbase"+this.name].document.layers["ns4slider"+this.name];
		var doc = document.layers["nsbase"+this.name].document.layers["ns4slider"+this.name].document;
		doc.captureEvents ( Event.MOUSEDOWN);
		doc.onMouseDown = function(event){if (event.target=="") return false;}; 
		this.DescLoading = 1;
	}
	else
	{
		document.write('<div id="base0'+this.name+'" style="z-index:0;background-color:transparent;background-image:url('+this.BkImage+');background-color:'+this.BkColor+';position:relative;overflow:hidden;width:'+this.ComponentWidth+';height:'+this.ComponentHeight+';border:'+this.BorderSize+'px solid '+this.BorderColor+';" onmouseover="'+this.name+'.MouseOver();" onmouseout="'+this.name+'.MouseOut();">')
		document.write ( '<div id="Canvas'+this.name+'" style="position:'+((this.browser==1)?'absolute':'relative')+';overflow:hidden;left:'+this.LeftMargin+';top:'+this.TopMargin+';width:'+this.swidth+';height:'+this.ImgAreaHeight+';clip:rect(0 '+this.swidth+' '+this.ImgAreaHeight+' 0);">');
		for(i=0; i < this.arrImages.length; i++)
		{
			document.write ('<div id="ImgHrefFrame'+this.name+i+'" align="center" style="z-index:0;position:absolute;visibility:hidden;">');
			if ( this.arrImages[i].Url != "" ) document.write('<A HREF="'+this.arrImages[i].Url+'" target="'+this.arrImages[i].Target+'" >');
			document.write('<IMG id="Slide'+this.name+i+'" style="position:absolute;left:0;top:0;" border=0 onload="'+this.name+'.ImageComplete('+i+',1);" onerror="'+this.name+'.ImageComplete('+i+',2);" onabort="'+this.name+'.ImageComplete('+i+',3);">');
			if ( this.arrImages[i].Url != "" ) document.write('</A>');
			document.write('</div>'); // ImgHrefFrame
		}
		document.write('</div>'); // canvas
		for(i=0; i < this.arrImages.length; i++)
		{
			document.write('<div id="Description'+this.name+i+'" style="z-index:1;background-color:transparent;position:absolute;overflow:hidden;left:'+this.LeftMargin+';top:'+this.TextAreaTop+';width:'+this.swidth+';height:'+this.TextAreaHeight+';visibility:hidden;">'+this.arrImages[i].ImgDescription+'</div>');
		}
		if ( this.ShowDivider == 1 ) document.write('<div id="divider'+this.name+'" style="position:absolute;overflow:hidden;left:0;top:'+((this.TextAreaTop-(this.SpaceBetImgAndText/2))-(this.BorderSize/2))+'; width:'+this.ComponentWidth+';border:'+this.BorderSize+'px solid '+this.BorderColor+';border-bottom-width:0px;border-left-width:0px;border-right-width:0px;"></div>');
		document.write('</div>'); // base
	}
	document.write ( '</td></tr></table>' );
	if (this.browser==4) return;
	if ( this.browser != 2 )
	{
		for(i=0; i < this.arrImages.length; i++)
		{
			if(this.arrImages[i].ImgDescription == "" &&  this.arrImages[i].ImgDescFileName != "")
				document.write('<IFrame id="LoadDesc'+this.name+i+'" style="position:absolute;left:-1000;top:-1000"></Iframe>');
			else
				this.arrImages[i].DescLoaded = true;
		}
	}
}

function SlideShow_ImageComplete ( index, cause )
{
	this.arrImages[index].ImageLoaded = 1; // in case if image is loaded before the flag is set in LoadSlideImage especially for disk previews
	this.ImgLoading--;
	if ( ! this.arrImages[this.index].ImageLoaded ) this.LoadSlideImage ( this.index );
}

function SlideShow_CreateLayers() { this.DescLoading = 0; }

function SlideShow_StartSlideShow()
{
	if ( this.browser == 4 ) return;
	this.index = (this.Sequence == 3 || this.Sequence == 4) ? (this.arrImages.length) : -1;
	this.SetSlide(0,0);
	if (this.Sequence == 6) { this.Sequence = 1; this.bPauseFlag = 1; }
	else if(!this.bPauseFlag) this.intervalId = setInterval(this.name+".SetSlide(0,0)",this.PauseInterval);
}

function SlideShow_LoadSlides ( index )
{
	var i, obj;
	
	for ( i = 0 ; i < this.LoadOneTime ; i++ )
	{
		obj = this.arrImages[index];
		if ( ! obj.ImageLoaded ) this.LoadSlideImage ( index );
		if ( ! obj.DescLoaded ) this.LoadSlideDesc ( index );
		if ( this.Sequence == 3 || this.Sequence == 4 ) { index--; if ( index < 0 ) index = this.arrImages.length - 1; }
		else { index++; if ( index >= this.arrImages.length ) index = 0; }
	}
	for ( index = 0 ; index < this.arrImages.length ; index++ )
	{ obj = this.arrImages[index]; if ( ! obj.ImageLoaded || ! obj.DescLoaded ) return; }
	this.AllLoaded = 1;
}

function SlideShow_LoadSlideImage ( index )
{
	if ( this.ImgLoading > this.MaxSimultaneousLoads ) return;
	var img, obj = this.arrImages[index], s;

	this.ImgLoading++;
	if ( this.browser == 2 )
	{
		s = '';
		if ( obj.Url != "" ) s += '<A HREF="'+obj.Url+'" target="'+obj.Target+'">';
		s += '<IMG id="Slide'+this.name+index+'" width="'+obj.w+'" height="'+obj.h+'" border=0 onload="'+this.name+'.ImageComplete('+index+',1);" onerror="'+this.name+'.ImageComplete('+index+',2);" onabort="'+this.name+'.ImageComplete('+index+',3);" src="'+obj.ImageName+'">';
		if ( obj.Url != "" ) s += '</A>';
		with ( this.Layer.document.layers["ns4slider1"+this.name].document.layers[index].document )
		{ open (); write ( s ); close (); }
	}
	else
	{
		if ( this.browser == 1 )
			img = document.all('Slide'+this.name+index);
		else if ( this.browser == 3 )
			img = document.getElementById('Slide'+this.name+index);
		img.src = obj.ImageName;
	}
	obj.ImageLoaded = 1;
}

function SlideShow_LoadSlideDesc ( index )
{
	if ( this.DescLoading > this.MaxSimultaneousLoads ) return;
	var obj = this.arrImages[index];
	if ( obj.ImgDescription == "" && obj.ImgDescFileName != "" )
	{
		var ifrm;
		
		if ( this.browser != 2 )
		{
			this.DescLoading++;
			if ( this.browser == 1 )
				ifrm = document.all("LoadDesc"+this.name+index);
			else if ( this.browser == 3 )
				ifrm = document.getElementById("LoadDesc"+this.name+index);
			ifrm.src = obj.ImgDescFileName;
			if(this.IframeInterval == 0) this.IframeInterval = setInterval(this.name+".LoadContent()",800);
		}
		else
		{
			if ( this.DescLoading ) return;
			var s;
			if ( obj.ImgDescription == "" )
			{
				this.DescLoading = 1;
				s = '<layer name="c1'+this.name+index+'" left="0" top="0" width="'+this.swidth+'" height="'+this.TextAreaHeight+'" clip="0,0,'+this.swidth+','+this.TextAreaHeight+'" visibility="hidden" ';
				s += 'src="'+obj.ImgDescFileName+'" onload="'+this.name+'.CreateLayers();" onmouseover="'+this.name+'.MouseOver();" onmouseout="'+this.name+'.MouseOut();"></layer>';
			}
			else
			{
				s = obj.ImgDescription;
				this.DescLoading = 0;
			}
			with ( this.Layer.document.layers[index+2].document )
			{ open(); write(s); close(); }
		}
	}
	obj.DescLoaded = 1;
}

function SlideShow_SetSlide(ButtonId, slideno)
{
	var oldindex;

	oldindex = this.index;
	if ( ButtonId == 0 )
	{
		if(this.index == this.arrImages.length-1 && this.Sequence == 2)//start to end stop
		{ clearInterval(this.intervalId); return; }
		else if(this.index == 0 && this.Sequence == 4)//End to start stop
		{ clearInterval(this.intervalId); return; }
	}
	if(this.index != -1 && this.index != this.arrImages.length)
	{
		if (this.browser == 1)
		{
			document.all("ImgHrefFrame"+this.name+this.index).style.visibility = "hidden";
			document.all("Description"+this.name+this.index).style.visibility = "hidden";
		}
		else if(this.browser == 2)
		{
			this.Layer.document.layers["ns4slider1"+this.name].document.layers[this.index].visibility = "hidden";
			if (this.Layer.document.layers[this.index+2].document.layers.length) this.Layer.document.layers[this.index+2].document.layers[0].visibility = "hidden";
			this.Layer.document.layers[this.index+2].visibility = "hidden";
		}
		else if(this.browser == 3)
		{
			document.getElementById("ImgHrefFrame"+this.name+this.index).style.visibility = "hidden";
			document.getElementById("Description"+this.name+this.index).style.visibility = "hidden";
		}
		clearInterval(this.EffectIntervalId );
	}

	if(ButtonId == 0)
	{
		if(this.Sequence == 1 || this.Sequence == 2 || this.Sequence == 6)  //start to end stop/cycle, JS control
		{
			this.index++;
			if (this.index == this.arrImages.length) this.index = 0;
		}
		if(this.Sequence == 3 || this.Sequence == 4)
		{
			this.index--; //end to start cycle
			if (this.index == -1) this.index = (this.arrImages.length -1);
		}
		if(this.Sequence == 5)
		{
			while ( this.index == oldindex )
			{
				var n = Math.random ();
			
				this.index = parseInt(((this.arrImages.length-1) - 0 + 1) * parseFloat(n) + 0);	
				if(isNaN(this.index)) this.index	= 0;
			}
		}
	}
	else if(ButtonId == 1) //Back
	{
		this.index--; 
		if (this.index == -1) this.index = (this.arrImages.length -1);
	}
	else if(ButtonId == 2) //Next
	{
		this.index++; 
		if (this.index == this.arrImages.length) this.index = 0;
	}
	else if(ButtonId == 5) //First
	{
		this.index = 0 
	}
	else if(ButtonId == 6) //Last
	{
		this.index = this.arrImages.length -1;
	}
	else if(ButtonId == 7) //Jump
	{
		if ( slideno < 0 || slideno >= this.arrImages.length ) slideno = 0;
		this.index = slideno;
	}

	if ( ! this.AllLoaded ) this.LoadSlides ( this.index );

	var obj = this.arrImages[this.index];
	var w, h, Effect, oldEffect;

	w = obj.w;
	h = obj.h;
	if ( w <= 0 || h <= 0 ) return;
		
	Effect = obj.EntryEffect;
	if(Effect == 0) //Random
	{
		var n = Math.random ();
		Effect = parseInt((9) * parseFloat(n) + 1);	
		if(isNaN(Effect)) Effect = 1;
	}

	if(Effect == 1) //Effect = none
	{
		obj.CurrentX = obj.x;
		obj.CurrentY = obj.y;
	}
	else if(Effect == 2) //Effect = Left
	{
		obj.CurrentX = -1*w;
		obj.CurrentY = obj.y;
		obj.xStepSize = +this.StepSize;
		obj.yStepSize = 0;
	}
	else if(Effect == 3) //Effect = Right
	{
		obj.CurrentX = this.swidth;
		obj.CurrentY = obj.y;
		obj.xStepSize = -this.StepSize;
		obj.yStepSize = 0;
	}
	else if(Effect == 4) //Effect = Top
	{
		obj.CurrentX = obj.x;
		obj.CurrentY = -1*h;
		obj.yStepSize = +this.StepSize;
		obj.xStepSize = 0;
	}
	else if(Effect == 5) //Effect = Bottom
	{
		obj.CurrentX = obj.x;
		obj.CurrentY = this.ImgAreaHeight;
		obj.yStepSize = -this.StepSize;
		obj.xStepSize = 0;
	}
	else if ( Effect >= 6 && Effect <= 9 )
	{
		if(Effect == 6) //Effect = Left Top Corner
		{
			obj.CurrentX = -1*w;
			obj.CurrentY = -1*h;		
		}
		else if(Effect == 7) //Effect = Left Bottom Corner
		{
			obj.CurrentX = -1*w;
			obj.CurrentY = this.ImgAreaHeight;		
		}
		else if(Effect == 8) //Effect = Right Top Corner
		{
			obj.CurrentX = this.swidth;
			obj.CurrentY = -1*h;		
		}
		else if(Effect == 9) //Effect = Right Bottom Corner
		{
			obj.CurrentX = this.swidth;
			obj.CurrentY = this.ImgAreaHeight;		
		}
		
		var xDisplacement = Math.abs(obj.x - obj.CurrentX), yDisplacement = Math.abs(obj.y-obj.CurrentY);

		if( xDisplacement < yDisplacement )
		{
			obj.xStepSize = Math.round(this.StepSize);
			obj.yStepSize = Math.round((yDisplacement/xDisplacement)*this.StepSize);
		}
		else
		{
			obj.xStepSize = Math.round((xDisplacement/yDisplacement)*this.StepSize);
			obj.yStepSize = Math.round(this.StepSize);
		}

		if ( Effect == 7 )
		{
			obj.yStepSize *= -1;
		}
		else if ( Effect == 8 )
		{
			obj.xStepSize *= -1;
		}
		else if ( Effect == 9 )
		{
			obj.xStepSize *= -1;
			obj.yStepSize *= -1;
		}
	}

	if (this.browser == 1)
	{
		document.all("ImgHrefFrame"+this.name+this.index).style.pixelLeft = obj.CurrentX;
		document.all("ImgHrefFrame"+this.name+this.index).style.pixelTop = obj.CurrentY;
				
		document.all("ImgHrefFrame"+this.name+this.index).style.visibility = "visible";
		if ( obj.DescAfterEffect == 0 || Effect == 1 ) document.all("Description"+this.name+this.index).style.visibility = "visible";
	}
	else if( this.browser == 2)
	{
		var ns4Layer = this.Layer.document.layers["ns4slider1"+this.name].document.layers[this.index];
		ns4Layer.left = obj.CurrentX;
		ns4Layer.top = obj.CurrentY;
		ns4Layer.visibility = "show";
		if ( this.Layer.document.layers[this.index+2].document.layers.length && ( obj.DescAfterEffect == 0 || Effect == 1 ) )
		{
			this.Layer.document.layers[this.index+2].visibility = "show";
			this.Layer.document.layers[this.index+2].document.layers[0].visibility = "show";
		}
	}
	else if(this.browser == 3)
	{
		var ns6Div = document.getElementById("ImgHrefFrame"+this.name+this.index);

		ns6Div.style.left = obj.CurrentX;
		ns6Div.style.top = obj.CurrentY;

		ns6Div.style.visibility = "visible";
		if ( obj.DescAfterEffect == 0 || Effect == 1 ) document.getElementById("Description"+this.name+this.index).style.visibility = "visible";
	}
	window.status = obj.Msg;

	if ( this.EnableAudio && this.PlayAudio )
	{
		var oApplet = document.applets["ItemAudio_"+this.name];
		if ( oApplet && oApplet.AppletLoaded == true ) (obj.Sound != "") ? oApplet.PlayAudio(this.index+1) : oApplet.StopAudio();
	}

	if ( Effect != 1 ) this.EffectIntervalId = setInterval(this.name+".PlayEffect()",this.EffectSpeed);
}

function SlideShow_PlayEffect()
{
	var obj = this.arrImages[this.index];
	var EndEffect = false;
	
	obj.CurrentX += obj.xStepSize; 
	obj.CurrentY += obj.yStepSize; 

	if(obj.xStepSize != 0)
	{
		if(obj.CurrentX > (obj.x - this.StepSize) && obj.CurrentX < (obj.x + this.StepSize)) EndEffect = true;
	}
	if(obj.yStepSize != 0)
	{
		if(obj.CurrentY > (obj.y - this.StepSize) && obj.CurrentY < (obj.y + this.StepSize)) EndEffect = true;
	}
	if ( EndEffect == true )
	{
		obj.CurrentX = obj.x;
		obj.CurrentY = obj.y;
		clearInterval(this.EffectIntervalId );
		if ( obj.DescAfterEffect == 1 )
		{
			if (this.browser == 1)
			{
				document.all("Description"+this.name+this.index).style.visibility = "visible";
			}
			else if ( this.browser == 2 )
			{
				if ( this.Layer.document.layers[this.index+2].document.layers.length )
				{
					this.Layer.document.layers[this.index+2].visibility = "show";
					this.Layer.document.layers[this.index+2].document.layers[0].visibility = "show";
				}
			}
			else if(this.browser == 3)
			{
				document.getElementById("Description"+this.name+this.index).style.visibility = "visible";
			}
		}
	}
	if (this.browser == 1)
	{
		document.all("ImgHrefFrame"+this.name+this.index).style.pixelLeft = obj.CurrentX;
		document.all("ImgHrefFrame"+this.name+this.index).style.pixelTop = obj.CurrentY;
	}
	else if(this.browser == 2)
	{
		var ns4Layer = this.Layer.document.layers["ns4slider1"+this.name].document.layers[this.index];

		ns4Layer.left = obj.CurrentX;
		ns4Layer.top = obj.CurrentY;
	}
	else if(this.browser == 3)
	{
		var ns6Div = document.getElementById("ImgHrefFrame"+this.name+this.index);
		
		ns6Div.style.left = obj.CurrentX;
		ns6Div.style.top = obj.CurrentY;
	}
}

function SlideShow_MouseOver(event)
{
	if ( this.MouseOverPause ) clearInterval ( this.intervalId );
}

function SlideShow_MouseOut ( event ) 
{ 
	if ( ! this.bPauseFlag && this.MouseOverPause ) this.intervalId = setInterval ( this.name+".SetSlide(0,0)", this.PauseInterval );
}

function SlideShow_HandleButton(nSlide)
{
	if ( this.browser == 4 ) return;
	this.bPauseFlag = 1;
	clearInterval(this.intervalId);
	this.SetSlide(nSlide,0);
}

function SlideShow_Back() { this.HandleButton(1); }
function SlideShow_Next() { this.HandleButton(2); }
function SlideShow_First() { this.HandleButton(5); }
function SlideShow_Last() {	this.HandleButton(6); }

function SlideShow_Play()
{
	if ( this.browser == 4 ) return;
	if(this.bPauseFlag)
	{
		this.bPauseFlag = 0;
		this.intervalId = setInterval(this.name+".SetSlide(0,0)",this.PauseInterval);
		if ( this.EnableAudio && this.PlayAudio )
		{
			var oBkApplet = document.applets["BkAudio_"+this.name];
			var oItemApplet = document.applets["ItemAudio_"+this.name];
			if ( oBkApplet && oBkApplet.AppletLoaded == true ) ( (this.BkAudioPlayOnce==true) ? oBkApplet.PlayAudio() : oBkApplet.LoopAudio() );
			if ( oItemApplet && oItemApplet.AppletLoaded == true ) oItemApplet.PlayAudio(this.index+1);
		}
	}
}

function SlideShow_Pause()
{
	if ( this.browser == 4 ) return;
	this.bPauseFlag = 1;
	clearInterval(this.intervalId);
	if ( this.EnableAudio && this.PlayAudio )
	{
		var oBkApplet = document.applets["BkAudio_"+this.name];
		var oItemApplet = document.applets["ItemAudio_"+this.name];
		if ( oBkApplet && oBkApplet.AppletLoaded == true ) oBkApplet.StopAudio();
		if ( oItemApplet && oItemApplet.AppletLoaded == true ) oItemApplet.StopAudio();
	}
}

function SlideShow_ToggleSound()
{
	if ( this.browser == 4 ) return;
	if ( this.EnableAudio )
	{
		var oBkApplet, oItemApplet;

		this.PlayAudio = 1 - this.PlayAudio;
		if ( ! this.bPauseFlag || ! this.PlayAudio )
		{
			oBkApplet = document.applets["BkAudio_"+this.name];
			oItemApplet = document.applets["ItemAudio_"+this.name];
			if ( oBkApplet && oBkApplet.AppletLoaded == true )
				(this.PlayAudio==0) ? oBkApplet.StopAudio() : ( (this.BkAudioPlayOnce==true) ? oBkApplet.PlayAudio() : oBkApplet.LoopAudio() );
			if ( oItemApplet && oItemApplet.AppletLoaded == true )
				(this.PlayAudio==0) ? oItemApplet.StopAudio() : oItemApplet.PlayAudio(this.index+1);
		}
	}
}

function SlideShow_GotoSlide ( index )
{
	index = parseInt ( index );
	if ( isNaN(index) || index <= 0 || index > this.arrImages.length ) return 0;
	this.Pause ();
	this.SetSlide ( 7, index-1 );
	return 1;
}