$(document).ready(function() {
	//Show Banner
	$(".mainImage .desc").show(); //Show Banner
	$(".mainImage .text").animate({ opacity: 0.85 }, 1 ); //Set Opacity

	//Click and Hover events for thumbnail list
	$(".imageThumb li:first").addClass('active'); 
	$(".imageThumb li").click(function(){ 
		//Set Variables
		var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgCls = $(this).find('img').attr("class"); //Get Class Tag of Image
		var imgTitle = $(this).find('img').attr("src"); //Get Main Image URL
		var imgDesc = $(this).find('.text').html(); 	//Get HTML of text
		var imgDescHeight = $(".mainImage").find('.text').height();	//Calculate height of text
		if ($(this).is(".active")) {  //If it's already active, then...
			return false; // Don't click through
		} else {
			//Animate the Teaser
			$(".mainImage .text").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
				$(".mainImage .text").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
				$(".mainImage img").attr({ src: imgTitle , alt: imgAlt, width: imgCls});
			});
		}
		
		$(".imageThumb li").removeClass('active'); //Remove class of 'active' on all lists
		$(this).addClass('active');  //add class of 'active' on this list only
		return false;
		
	}) .hover(function(){
		$(this).addClass('hover');
		}, function() {
		$(this).removeClass('hover');
	});
			
	//Toggle Teaser
	$("a.collapse").click(function(){
		$(".mainImage .text").slideToggle();
		$("a.collapse").toggleClass("show");
	});
	
});//Close Function

//http://designm.ag/tutorials/image-rotator-css-jquery/

