	/* Set up parameters:
	*  ================================      */
		var dataSourceXML = "/slideshow/homepage/images.xml"; 
		var slideInterval = 6; //in seconds
	/*=========================================
		Don't edit after this.
	=========================================*/
	
	var descriptions = new Array();
	var index = -1;
	var totalIMGs = 0;
	slideInterval = slideInterval * 1000;
	
	
	document.write("<div id=\"ssContainer\"><div id=\"innerContainer\"></div></div>");
	$("#ssContainer #innerContainer").html("<ul id=\"imageSlideShow\"></ul>");

	function next() {
		$(".captionBG").css("bottom", -100 + "px");
		$("#ssContainer #innerContainer ul#imageSlideShow li:eq(" + index + ")").fadeOut();
		if ((index + 1) > (totalIMGs - 1)) {
			index = 0;
		} else {
			index++;	
		};
		$("#ssContainer #innerContainer ul#imageSlideShow li").hide();
		$(".captionBG:eq(" + index + ")").css("bottom", -100 + "px");
		
		$("#ssContainer #innerContainer ul#imageSlideShow li:eq(" + index + ")").fadeIn();
		$(".captionBG").animate({ bottom: 0 + "px"}, 500);
		
		setTimeout("next()",slideInterval);
	};
	
	$(document).ready(function(){
		$.ajax({
			type: "GET",
			url: "" + dataSourceXML + "",
			dataType: "xml",
			success: function(xml) {
				var root = $(xml).find("album").attr("lgPath");
				$(xml).find("img").each(function(){
					$("<li></li>").html( "<img width='400' src='http://www.weschlers.com/" + root + $(this).attr("src") + "'>" + "<div class=\"captionBG\"><p>" + $(this).attr("caption") + "</p></div>" ).appendTo("#innerContainer ul").hide();
					$(".captionBG").animate({
						opacity: 0.75,
						bottom: -$(".captionBG:eq(" + (totalIMGs + 1) + ")").height() + "px"
					}, 0);
					totalIMGs++;
				});
				$("#ssContainer").fadeIn();
				next();
			}, error: function (e,xhr, ajaxOptions, thrownError){ }
		});
	});
