/*----------------------------------
Handles the Understanding Tiles

----------------------------------*/

//Document Ready Function
$(function() {
	
	
	//swap 
	$('.tile-wall .tiles a.link').click(function(){
		//get index for this item
		index = $(this).parent().index();
		
		$('.stage img').hide();
		
		//show that image in the stage
		$('.stage img:eq('+ index +')').show();
		
		//show the stage
		$('.stage').fadeIn();
		
		return false;
		
	}).hover(function(){
		$('.norm', $(this)).fadeOut('fast');
			
	}, function(){
		$('.norm', $(this)).fadeIn('fast');
	});
	
	//Close button
	$('.tile-wall .stage .stage-close, .tile-wall .stage .close').click(function(){
		$(this).closest('.stage').fadeOut();
	});
});
