$(function () {
	
	// ability to reveal alternate product set (different qty)
	$('.reveal_alternate_products').click(function() {
		$($(this).attr('href')).fadeIn();
		$(this).parents('tr').eq(0).hide();
		return false;
	});
	
	$('.hide_alternate_products').click(function() {
		var id = $(this).attr('href');
		$(id).hide();
		$(id + '_revealer').fadeIn();
		return false;
	});
	
	

	// hide alternate product sets
	$('.alternate_product_set').hide();

	// qty up down spinner
	$('input.choose_qty').spinner({max: 100, min: 0});

	// hide information that is to be "revealed""
	$('.reveal').hide();
	$('.revealer').addClass('show');

	$('.revealer').click( function () {

			var link   = $(this);
			var target = $(link.attr('href'));

			// is the target visible or hidden?
			visible = target.is(':visible');

			if (!visible) {
				target.fadeIn();
				link.removeClass('show').addClass('hide');
			} else {
				target.fadeOut();
				link.removeClass('hide').addClass('show');
			}

			return false;
		}
	);
		
});

