

$(document).ready(function() {	
 
  if (jQuery.browser.msie) { 
    $(".image_thumb ul li").css("height", "52px");
    $(".main_image").css("height", "313px");

  };
  
  
	//Show Banner
	$(".main_image .desc").show(); //Show Banner
	$(".main_image .block").animate({ opacity: 0.85 }, 1 ); //Set Opacity

		var imgAlt = $(".image_thumb ul li:first").find('img').attr("alt"); //Get Alt Tag of Image
 	var imgTitle = $(".image_thumb ul li:first").find('.img_url').attr("alt") //Get Main Image URL
		var imgDesc = $(".image_thumb ul li:first").find('.block').html(); 	//Get HTML of block
		var title = $(".image_thumb ul li:first").find('.title').text(); 	//Get HTML of block		
		var imgDescHeight = $(".image_thumb ul li:first").find('.block').height();	//Calculate height of block	 

    $(".image_thumb ul li:first").addClass('active');  //add class of 'active' on this list only
				$(".main_image .block").html('<span style="padding-left: 5px; font-size: 1.2em"><b>' + title + '</b></span><br><div style="padding-left: 5px;">' + imgDesc + "</div>").animate({ opacity: 0.85,	marginBottom: "0" }, 250 );
		$(".main_image img").attr({ src: imgTitle , alt: imgAlt});
	
	$(".image_thumb ul li").hover(function(){ 
		//Set Variables
		var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
		var imgTitle = $(this).find('.img_url').attr("alt"); ; //Get Main Image URL
		var imgDesc = $(this).find('.block').html(); 	//Get HTML of block
		var title = $(this).find('.title').text(); 	//Get HTML of block		
		var imgDescHeight = $(".main_image").find('.block').height();	//Calculate height of block	
		if ($(this).is(".active")) {  //If it's already active, then...
			return false; // Don't click through
		} else {
			//Animate the Teaser				
			$(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 100 , function() {
				$(".main_image .block").html('<span style="padding-left: 5px; font-size: 1.2em"><b>' + title + '</b></span><br><div style="padding-left: 5px;">' + imgDesc + "</div>").animate({ opacity: 0.85,	marginBottom: "0" }, 250 );
				$(".main_image img").attr({ src: imgTitle , alt: imgAlt});
			});
		}
		
		$(".image_thumb ul 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');
		$(this).find(".title").css("text-decoration", "underline");
		}, function() {
		$(this).removeClass('hover');
		$(this).find(".title").css("text-decoration", "none");		
	});
			
	//Toggle Teaser
	$("a.collapse").click(function(){
		$(".main_image .block").slideToggle();
		$("a.collapse").toggleClass("show");
	});
	

});
