/*
slideshow_floor.
	Requires jQuery 1.2.1
	Example markup and style information listed below. 
	Divs may be styled as long as their id's remain intact.
	History:
	10/22/07		Completeion of v.1
	Requires jQuery 1.2.1
	Example markup and style information listed below.  

*************STYLE*************



*************MARKUP*************

*/


var currentslideshow_floorImage = 0;
$(function() {
	var slideshow_floorImages = $('.photoFloor p');
	$('.photoFloor p:gt(0)').each(function(index) { 
		$(this).hide();
	}); 
	$('.slideshow_floor .slideshowIndexCurrent').text(1);
	$('.slideshow_floor .slideshowIndexTotal').text(slideshow_floorImages.length);
	$('.thumbnailsFloor img').each(function(index) {
		$(this).css("cursor","pointer");
		$(this).attr("alt", index);
		$(this).click(function(e) {
			lastSlide = currentslideshow_floorImage;
			currentslideshow_floorImage = $(this).attr("alt");
			if(currentslideshow_floorImage < 0) {
				currentslideshow_floorImage = 0;
			}
			if(lastSlide != currentslideshow_floorImage) {						
				$('.slideshow_floor .slideshowIndexCurrent').text(parseInt(currentslideshow_floorImage)+1);
				slideshow_floorImages.each(function(index) { 
					if(index == currentslideshow_floorImage) {	
						//$(this).fadeIn("normal");
						$(this).show();
					} else {
						if($(this).css("display") != "none"){
							//$(this).fadeOut("normal");
							$(this).hide();
						}
					}
				}); 
			}
		});					
	});
	
	$('.next').click(function(){
		lastSlide = currentslideshow_floorImage;
		currentslideshow_floorImage++;
		if(currentslideshow_floorImage >= slideshow_floorImages.length) {
			currentslideshow_floorImage = slideshow_floorImages.length - 1;
		}
		if(lastSlide != currentslideshow_floorImage) {
			$('.slideshow_floor .slideshowIndexCurrent').text(parseInt(currentslideshow_floorImage) + 1);
			slideshow_floorImages.each(function(index) { 
				if(index == currentslideshow_floorImage) {	
					//$(this).fadeIn("normal");
					$(this).show();
				} else {
					if($(this).css("display") != "none"){
						//$(this).fadeOut("normal");
						$(this).hide();
					}
				}
			}); 
		};
		return false;
	});					


	$('.prev').click(function(){
		lastSlide = currentslideshow_floorImage;
		currentslideshow_floorImage--;
		if(currentslideshow_floorImage < 0) {
			currentslideshow_floorImage = 0;
		}
		if(lastSlide != currentslideshow_floorImage) {						
			$('.slideshow_floor .slideshowIndexCurrent').text(parseInt(currentslideshow_floorImage) +1);
			slideshow_floorImages.each(function(index) { 
				if(index == currentslideshow_floorImage) {	
					//$(this).fadeIn("normal");
					$(this).show();
				} else {
					if($(this).css("display") != "none"){
						//$(this).fadeOut("normal");
						$(this).hide();
					}
				}
			}); 
		};
		return false;
	});					
});


$(function(){
	$(".showThumbnails").toggle(
		function(){
			$(".thumbnailsFloor").slideDown();
			$(".showThumbnails").text("hide thumbnails");
			return false;
		},
		function(){
			$(".thumbnailsFloor").slideUp();
			$(".showThumbnails").text("show thumbnails");
			return false;
		}
	);

});


