
$(document).ready(function($) {

	// Set up the sublime videos
	sublimevideo.ready(function(){
		sublimeSlideShow();
	});


	// Sneakily hook up another sliding area to the same slider controls (thumbnails)
	
	var secondaryContainer = $(".maps");
	var secondarySlides = $(".map", secondaryContainer);

	function mapHover() {
		var item = $(this);
		var index = $("a", item).attr("rel") - 1;
		rotateMap(index);
	}
	
	function mapReset() {
		var item = $(this);
		var parent = item.parent();
		var currindex = $(".active a", parent).attr("rel") - 1;
		
		rotateMap(currindex);
	}

	function rotateMap(triggerID) {
		secondarySlides.hide();
		secondarySlides.eq(triggerID).show();
	}
	
	$(".slide-controls").children().hover(mapHover, mapReset).click(mapHover);
	
	// Fix PNGs for IE6
	
	$('#video-feature').supersleight();
	$('.map-container').supersleight();
	$('.slide-controls').supersleight();
	
});
