// JavaScript Document
// Author: Eli Anderson
var src;
$(document).ready(function() {     
    var name = $(".slideShowViewer img").attr('name');
	var info = '<p>'+name+'</p>';
	if (name == "")
	{
		info = "";	
	}
	$(".imgInfo").html(info);
	$("p.imgTitle").html($(".slideShowViewer img").attr('alt'));
	
	$('.slideShowThumbs img').click(function(e) {       
     	var source = $(this).attr('src');
 		var alt = $(this).attr('alt');
		var obj = $(".slideShowViewer").html();
		var name = $(this).attr('name');
		var info = '<p>' +name+ '</p>';
		var title = $(this).attr('alt');
		if (name == ""){
			info = "";	
		}	
    $(obj).fadeOut('slow', function() { 
	$(".slideShowViewer").html('<img src="'+ source +'" alt="'+alt+'"height="400px" width="400px"/>').fadeIn('slow');
	$(".imgInfo").html(info);
	$("p.imgTitle").html(title);
	});       
    });   
}); 


$(document).ready(function() { 	
	$('#filters li').click(function(e){
		var id = $(this).attr('id');	
		if (id == 'center'){
			$('.slideShowThumbs img').css('display', 'none');
			$('.slideShowThumbs img.center').css('display', 'inline');	
		}
		else if (id == 'head'){
			$('.slideShowThumbs img').css('display', 'none');
			$('.slideShowThumbs img.head').css('display', 'inline');	
		}
		else {
			$('.slideShowThumbs img').css('display', 'inline');			
		}
		//alert(id);
	
	});
						   
});
