/** THIS HANDLES THE PRODUCT PAGE TABS **/
$(function(){
	// Show the panel tabs
	// They would be hidden normally since we are gracefully degrading
	$('.eventTab').show();
	
	// Each activate first tab by default
	$('.eventTab:first').addClass('selected');
	
	// Each infopanel
	$('.eventPanel').each(function(index){
		// Does it have a class of selected
		if(index == 0){
			// yes, do nothing
		}else{
			// no hide it
			$(this).hide();
		}
	});
	
	// When click on an infotab
	$('.eventTab').click(function(){
		// Remove all infotab selected states
		$('.eventTab').removeClass('selected');
		// Add selected to the clicked item
		$(this).addClass('selected');
		
		// Get the id from this attr
		var id = $(this).attr('id');
		// Replace tab with panel in the id
		id = id.replace("eventTab-","eventPanel-");
		// Hide the infopanle
		$('.eventPanel').hide();
		// Now show the panel with the correct name
		$('#'+id).show();
		// And focus
		$(this).focus();
		
	});
	
});
