$(document).ready(function(){
$(".banner .desc").hide(); //Show Banner
$(".banner .block").animate({ opacity: 1 }, 1 ); $(".rightBanner ul li:first").addClass('active'); //runs function on click
$(".rightBanner ul li").click(function () {
var imgAlt = $(this).find('a').attr("title");
var imgTitle = $(this).find('a').attr("href");
var imgDesc = $(this).find('.block').html();
var imgDescWidth = $(".banner").find('.block').height();
var imgLink = $(this).find('.link-more').attr("href");
if ($(this).is(".active")) {
return false;
} else {
$(".banner .block").animate({ opacity: 0, marginRight: -imgDescWidth }, 250 , function() {
$(".banner .block").html(imgDesc).animate({ opacity: 1, marginRight: "0" }, 250 );
$(".banner img").attr({ src: imgTitle , alt: imgAlt , title: imgAlt});
$(".banner .put-link").attr({ href: imgLink });
});
}
$(".rightBanner ul li").removeClass('active');
$(this).addClass('active');
return false;$active = $(this);
slideSwitchClick();
})
.hover(function(){
$(this).addClass('hover');
clearInterval(playSlideshow);
playSlideshow = setInterval('slideSwitchTimed()', 10000 );
}, function() {
$(this).removeClass('hover');
});
//runs function, set timer here
$(function() {
playSlideshow = setInterval('slideSwitchTimed()', 4000 );
});
});
function slideSwitchTimed() {
$active = $('.rightBanner ul li.active').next();
if ( $active.length == 0 ) $active = $('.rightBanner ul li:first');
slideSwitch();
}
function slideSwitchClick() {
slideSwitch();
}
function slideSwitch() {
var $prev = $('.rightBanner ul li.active');
//Show active list-item
$prev.removeClass('active');
$active.addClass('active');
//Set Variables
var imgAlt = $active.find('img').attr("alt");
var imgTitle = $active.find('a').attr("href");
var imgDesc = $active.find('.block').html();
var imgDescWidth = $(".banner").find('.block').height();
var imgLink = $active.find('.link-more').attr("href");
if ($(this).is(".active")) {
return false;
} else {
$(".banner img").animate({ opacity: 1},1 );
$(".banner .block").animate({ opacity: 0, marginRight: -imgDescWidth }, 250 , function() {
$(".banner .block").html(imgDesc).animate({ opacity: 1, marginRight: "0" }, 250 );
$(".banner img").attr({ src: imgTitle , alt: imgAlt});
$(".banner .put-link").attr({ href: imgLink });
});
}
return false;
} 

/*$(document).ready(function() {
	//Show Banner
	$(".banner .desc").show(); //Show Banner
	$(".banner .block").animate({ opacity: 0.85 }, 1 ); //Set Opacity
	//Click and Hover events for thumbnail list
	$(".rightBanner ul li:first").addClass('active');
	$(".rightBanner ul li").click(function(){
	//Set Variables
	var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
	var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
	var imgDesc = $(this).find('.block').html(); //Get HTML of block
	var imgDescHeight = $(".banner").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
	$(".banner .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 , function() {
	$(".banner .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 250 );
	$(".banner img").attr({ src: imgTitle , alt: imgAlt});
	});
	}
	$(".rightBanner 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');
	}, function() {
	$(this).removeClass('hover');
	});
	//Toggle Teaser
	$("a.collapse").click(function(){
	$(".banner .block").slideToggle();
	$("a.collapse").toggleClass("show");
	});

});*///Close Function 

/*$(document).ready(function(){
//Show Banner
$(".banner .desc").show(); //Show Banner
$(".banner .block").animate({ opacity: 0.85 }, 1 ); //Set Opacity
//Click and Hover events for thumbnail list
$(".rightBanner ul li:first").addClass('active');
$(".rightBanner ul li").click(function(){
//Set Variables
var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
var imgDesc = $(this).find('.block').html(); //Get HTML of block
var imgDescHeight = $(".banner").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
$(".banner img").animate({ opacity: 0}, 1000 );
$(".banner .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 1000 , function() {
$(".banner .block").html(imgDesc).animate({ opacity: 0.85, marginBottom: "0" }, 1000 );
$(".banner img").attr({ src: imgTitle , alt: imgAlt}).animate({ opacity: 1}, 1000 );
});
}
$(".rightBanner 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');
}, function() {
$(this).removeClass('hover');
});
//Toggle Teaser
$("a.collapse").click(function(){
$(".banner .block").slideToggle();
$("a.collapse").toggleClass("show");
});
}); */
