
//Class slideShowCon
		
		slideShowCon.prototype.img_holder1;
		slideShowCon.prototype.img_holder2;
		slideShowCon.prototype.image_array;
		slideShowCon.prototype.image_number = 0;
		slideShowCon.prototype.fade_speed;
		slideShowCon.prototype.Fade_IntervalId;
		slideShowCon.prototype.begin_IntervalId;
		slideShowCon.prototype.opacity = 100;
		slideShowCon.prototype.imageActive = true;
		slideShowCon.prototype.play = true;
		slideShowCon.prototype.prever = true;
		slideShowCon.prototype.nexter = true;
		slideShowCon.prototype.prevstart = true;
		slideShowCon.prototype.imagecount = false;
		
		function slideShowCon(Images, fd_speed)
		{
			document.write('<div id="completeslideshow"><a href="javascript:void(0)" onclick="PG.NextSlide()"><img id="photo_holder2" src="" style="position:absolute;"  border="0"  /><img id="photo_holder1" src=""  border="0"/></a>' + 

'<div id="controlholder">' +

'<div id="leftdiv"><a id="prev" href="javascript:void(0)" onclick="PG.PrevSlide()" onmouseover="document.arrowleft.src=\'slideshow/btn_images/slide_leftarrow_on.png\'"  onmouseout="document.arrowleft.src=\'slideshow/btn_images/slide_leftarrow_off.png\'"><img name="arrowleft" src="slideshow/btn_images/slide_leftarrow_off.png" border="0"/></a></div>' +

'<div id="middiv"><span id="imagecounter"></span></div>' +

'<div id="rightdiv"><a id="nxt" href="javascript:void(0)" onclick="PG.NextSlide()" onmouseover="document.arrowright.src=\'slideshow/btn_images/slide_rightarrow_on.png\'"  onmouseout="document.arrowright.src=\'slideshow/btn_images/slide_rightarrow_off.png\'"><img  name="arrowright" src="slideshow/btn_images/slide_rightarrow_off.png" border="0"/></a></div>' +

'</div>' +

'</div>');
			
			this.img_holder1 = document.getElementById('photo_holder1');
			this.img_holder2 = document.getElementById('photo_holder2');
			this.image_array = Images;
			this.image_number = 0;
			this.Fade_IntervalId = 0;
			this.fade_speed = fd_speed;
			imgCt = this.image_array.length;

		}
		////////////// Start Methods /////////////////////////
		slideShowCon.prototype.beginSlideShow = function()
		{
			this.changeImgNext();
			this.opacity = 0;
			this.img_holder1.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder1.style.MozOpacity=this.opacity/100;
			this.img_holder1.style.opacity=this.opacity/100;
			this.img_holder1.style.khtmlOpacity=this.opacity/100;
			
			this.img_holder2.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder2.style.MozOpacity=this.opacity/100;
			this.img_holder2.style.opacity=this.opacity/100;
			this.img_holder2.style.khtmlOpacity=this.opacity/100;
			
			var instant = this;
			this.begin_IntervalId = setInterval(function() {instant.beginFade()}, this.fade_speed);
		}
		
		slideShowCon.prototype.beginFade = function()
		{
			this.opacity = this.opacity + 5;
			this.img_holder2.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder2.style.MozOpacity=this.opacity/100;
			this.img_holder2.style.opacity=this.opacity/100;
			this.img_holder2.style.khtmlOpacity=this.opacity/100;
			
			if(this.opacity >= 100)
			{
				this.img_holder1.style.filter = 'alpha(opacity = ' + this.opacity + ')';
				this.img_holder1.style.MozOpacity=this.opacity/100;
				this.img_holder1.style.opacity=this.opacity/100;
				this.img_holder1.style.khtmlOpacity=this.opacity/100;
			
				this.stopBeginFade();
			}			
		}
		
		slideShowCon.prototype.stopBeginFade = function()
		{
			clearInterval(this.begin_IntervalId);
		}
		
		slideShowCon.prototype.changeImgNext = function()
		{		
			
			this.stopSlideshow();
			this.opacity = 100;
			this.img_holder2.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder2.style.MozOpacity=this.opacity/100;
			this.img_holder2.style.opacity=this.opacity/100;
			this.img_holder2.style.khtmlOpacity=this.opacity/100;
			
			if(this.nexter == true)
			{
				this.img_holder2.src = this.image_array[this.image_number];					
				
				this.image_number = this.image_number + 1;
	
				document.getElementById('imagecounter').innerHTML = "M&S in Action. Image " + this.image_number + " of " + this.image_array.length;
			
				if(this.image_number == this.image_array.length)
				{				
					this.image_number =  0;
				}		
		
				this.img_holder1.src = this.image_array[this.image_number];
			}
			else
			{			

				
				this.image_number = this.image_number;
						
				this.img_holder2.src = this.image_array[this.image_number];	
				
				this.image_number = this.image_number + 1;
				
				document.getElementById('imagecounter').innerHTML = "M&S in Action. Image " + this.image_number + " of " + this.image_array.length;
				
				if(this.image_number == this.image_array.length)
				{				
					this.image_number =  0;
				}		
		
				this.img_holder1.src = this.image_array[this.image_number];	
			}
						
			this.prever = false;
			this.nexter = true;
		}	
		
		slideShowCon.prototype.changeImgPrev = function()
		{			

			this.nexter = false;
			this.stopSlideshow();
			this.opacity = 100;
			this.img_holder2.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder2.style.MozOpacity=this.opacity/100;
			this.img_holder2.style.opacity=this.opacity/100;
			this.img_holder2.style.khtmlOpacity=this.opacity/100;

			this.img_holder2.src = this.image_array[this.image_number];	
			document.getElementById('imagecounter').innerHTML = "M&S in Action. Image " + (this.image_number+1) + " of " + this.image_array.length;
		
			this.image_number = this.image_number - 1;
					
			if(this.image_number == -1)
			{				
				this.image_number = this.image_array.length - 1;
			}
	

		}			

		slideShowCon.prototype.fadeImagenxt = function()
		{
			if(this.opacity == 100)
			{
				if(this.nexter == false)
				{
					this.image_number = this.image_number + 2;
		
					if(this.image_number == this.image_array.length)
					{				
						this.image_number =  0;
					}		
			
					this.img_holder1.src = this.image_array[this.image_number];	
				}
				
				if(this.image_number > this.image_array.length )
				{
					this.image_number = 1;	
					this.img_holder1.src = this.image_array[this.image_number];	
				}
			}
			
			this.prevstart = false;
			
			this.opacity = this.opacity - 5;
			this.img_holder2.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder2.style.MozOpacity=this.opacity/100;
			this.img_holder2.style.opacity=this.opacity/100;
			this.img_holder2.style.khtmlOpacity=this.opacity/100;
			
			if(this.opacity <= 0)
			{
				this.prever = false;
				this.changeImgNext();
			}
		}	
		
		slideShowCon.prototype.fadeImageprev = function()
		{
			if(this.opacity == 100)
			{
				if(this.prever == true)
				{
					if(this.prevstart == true)
					{
						this.image_number = this.image_number - 2;
	
						if(this.image_number == - 1 || this.image_number == - 2)
						{				
							this.image_number = this.image_array.length - 1;
						}
						
						this.img_holder1.src = this.image_array[this.image_number];	
						
						this.prevstart = false;
					}
					else
					{	
						this.image_number = this.image_number;
							
						if(this.image_number == - 1 || this.image_number == - 2)
						{				
							this.image_number = this.image_array.length;
						}
						
						this.img_holder1.src = this.image_array[this.image_number];
					}
				}
				else
				{
					this.image_number = this.image_number - 2;
					
					if(this.image_number == - 1 || this.image_number == - 2)
					{	
						if(this.image_number == -1)
						{
							this.image_number = this.image_array.length - 1;
						}
						else
						{
							this.image_number = this.image_array.length - 2;
						}
					}
					
					this.img_holder1.src = this.image_array[this.image_number];
					
					this.prevstart = false;
				}
			}
			
			this.opacity = this.opacity - 5;
			this.img_holder2.style.filter = 'alpha(opacity = ' + this.opacity + ')';
			this.img_holder2.style.MozOpacity=this.opacity/100;
			this.img_holder2.style.opacity=this.opacity/100;
			this.img_holder2.style.khtmlOpacity=this.opacity/100;
			
			if(this.opacity <= 0)
			{
				this.prever = true;
				this.changeImgPrev();
			}
		}	
		
		slideShowCon.prototype.NextSlide = function()
		{
			if(this.opacity == 100)
			{
				var instant = this;
				this.Fade_IntervalId = setInterval(function() {instant.fadeImagenxt()}, this.fade_speed);
			}	
		}
		
		slideShowCon.prototype.PrevSlide = function()
		{
			if(this.opacity == 100)
			{
				var instant = this;
				this.Fade_IntervalId = setInterval(function() {instant.fadeImageprev()}, this.fade_speed);
			}
		}
		
		slideShowCon.prototype.stopSlideshow = function()
		{
			clearInterval(this.Fade_IntervalId);
		}
		
//EndClass


