var currentTab = false;

$(document).ready(function () {
	$('.tab').mouseenter(function () {
		$(this).removeClass('inactive').addClass('active');
	}).mouseleave(function () {
		$(this).removeClass('active').addClass('inactive');
		
		if (currentTab != false) {
			$(currentTab).removeClass('inactive').addClass('active');
		}
	}).click(function () {
		if (currentTab != $(this)) {
			//swap
			$(currentTab).removeClass('active').addClass('inactive');
			currentTab = $(this);
			$(this).removeClass('inactive').addClass('active');
			
			$('.tab_content').hide();
			
			var id = $(this).children('input').val();

			$('#' + id).show();
		}
	});
	
	currentTab = $('.tab:first');
});
