// JavaScript Document

$(document).ready(function(){


	/*
		apply a class of firstChild to li elements to fake
		the first-child pseudo-selector for IE6. Thanks to: http://www.pathf.com/blogs/2008/04/hacking-the-fir/
	*/
	$('#wrapper ul > li:first')
		.addClass('firstChild')
	;


	/* CODE FOR HERO DIV ROLLOVER EFFECTS */

	$('.hero').css('opacity', 0.85);
	
	var activeImg = 1;

	$('.hero').mouseover(function () { 
		// get ID of clicked hero
		var curr = $(this).attr('id');
		curr = curr.substring(5);
		
		// add/remove active class from slideshow images and fade in new one
		if (curr != activeImg) {
			$('#img-'+activeImg).removeClass('active-image');
			$('#img-'+curr).css('opacity', 0.2);
			$('#img-'+curr).addClass('active-image');
			$('#img-'+curr).fadeTo('800', 1);
			
			$('#hero-'+activeImg).removeClass('activeHero');
			$(this).addClass('activeHero');

			activeImg = curr;

		}
	});


});


