function SlideShow() {
	var thisObj = this;
	
	this.slideShowOn = true;
	this.delay = 3500;      // Delay in ms between slide changes 3500.
	this.lastSlide = 3;     // Number of Slides (Panel# classes) to iterate through.
	this.currentSlide = 1;

	this.Initialize = function() {
		thisObj.SwitchPanel(thisObj.currentSlide);
		setTimeout(thisObj.Iterate, thisObj.delay)
	}
	
	
	/*
	*  Event for mouseover a particular slides hotspot (Turns Slideshow off).
	*/
	this.PanelMouseOver = function(panelId) {
		thisObj.slideShowOn = false;
		thisObj.SwitchPanel(panelId);
		thisObj.currentSlide = panelId;
	}
	
	
	/*
	*  Event for mouseout a particular slides hotspot (Turns Slideshow off).
	*/
	this.PanelMouseOut = function() {
		thisObj.slideShowOn = true;
	}
	
	
	/*
	*  Switches to the specified slide using jquery fade effect.
	*/
	this.SwitchPanel = function(panelId) {
		$("#TopPanelMain").removeClass("Panel1").removeClass("Panel2").removeClass("Panel3");

//		for (var i = 1; i <= 3; i++) {
//			$("#TopPanelContent" + i).css("background-image", "url(/images/homerect_off.gif)");
//			$("#TopPanelContent" + i + " > .PanelContent").css("color", "#dddddd");
//		}

		$("#TopPanelMain").addClass("Panel" + panelId);
//		$("#TopPanelContent" + panelId).css("background-image", "url(/images/homerect_on.gif)");
//		$("#TopPanelContent" + panelId + " > .PanelContent").css("color", "white");
	}
	
	
	/*
	*  Iterates through all slides in the show.
	*/
	this.Iterate = function() {
		if (thisObj.slideShowOn) {
			thisObj.currentSlide += 1;
			thisObj.currentSlide = thisObj.currentSlide > thisObj.lastSlide ? 1 : thisObj.currentSlide; // Check for last pane.

			$('#TopPanelFadeLayer').fadeOut(0).removeClass().addClass('Panel' + thisObj.currentSlide).fadeIn(1000, function() {
				thisObj.SwitchPanel(thisObj.currentSlide);
				$('#TopPanelFadeLayer').removeClass();
				setTimeout(thisObj.Iterate, thisObj.delay);
			});
		} else {
			setTimeout(thisObj.Iterate, thisObj.delay);
		}
	}
	
	
}
