jQuery(document).ready(function() {

	// switch the active slide
		function process_slide_link(link) {
			// turn off all links
			$("dl.carousel dt").each(function(intIndex) {
				$(this).removeClass('selected');
			});
			$("dl.carousel dd").each(function(intIndex) {
				if (link.attr('class') == $(this).attr('class')) {
					$(this).show(); // show this slide
					link.addClass('selected'); // mark as active slide
				} else {
					$(this).hide(); // hide this slide
				}
			});
		}
		// block mouse clicks
		$('dl.carousel dt').click(function() {
			return false;
		});
		// change slide on rollover
		$('dl.carousel dt').mouseover(function() {
			process_slide_link($(this));
		});
		// start on slide 1
		// must account for definition list (dt,dd) element positions so slide 2 = dt:nth-child(3), 3 = dt:nth-child(5)...
		process_slide_link($('dl.carousel dt:nth-child(1)'));

		/* ----- SLIDESHOW ----- */
 
		$('#slideshow').innerFade( {
			animationType : 'FadeIn',
			easing : 'swing',
			speed : 1000,
			timeout : 5000,
			type : 'sequence',
			containerHeight : '391px'
		});

	});

