function initSlideshow() {
  jQuery.get('http://www.saucna.net/gallery.aspx?entityid=38595&id=3481', onExternalGalleryLoaded);
  
}


function onExternalGalleryLoaded(data) {
	var imagesTableElems = jQuery(data).find("#content div.PageMainContent table");
	
	// now loop on each table and extract text and images
	imagesTableElems.each(function() {

	var imageNode = jQuery(this).find("img").first();
	//alert("found image: " + imageNode.length);
	
	var descriptionHTML="";
	var descriptionNode = jQuery(this).find("span").first();
	//alert("found desc: " + descriptionNode.length);
	if (descriptionNode.length != 0) {
		descriptionHTML = descriptionNode.html();
	}
	
	var contentDivHTml = "<div class='slideContent contentdiv'><div class='slideBG' style='background: url("+imageNode.attr("src")+") no-repeat scroll center center transparent;'></div><div class='slideCaption'>"+descriptionHTML+"</div></div>";
	jQuery("#homePageSlideshowWrapper").append(contentDivHTml);

	//jQuery(this).find("td").each(function() {
					//var tableCellContentNode = jQuery(this).html();
					
		//										  });
								  	
								  });
	
	//jQuery('#homePageSlideshowWrapper').html(imagesTableElems);
	//alert('Load was performed 3.');
	startSlideShow()
}

function startSlideShow() {
	//alert("slide show loading");
	featuredcontentslider.init({
		id: "homePageSlideshowWrapper",  //id of main slider DIV
		contentsource: ["inline", ""],  //Valid values: ["inline", ""] or ["ajax", "path_to_file"]
		enablefade: [true, 0.1],  //[true/false, fadedegree]
		autorotate: [true, 3000]  //[true/false, pausetime]
	});

}

