Semprini = new Object(); 

Semprini.Setup = function() {
	Semprini.SetupStore();
}
Semprini.SetupStore = function() {
	jQuery("select#view_only").bind("change",function(e){
		Semprini.HideAllProductsExcept(jQuery(this).attr('value'));
	});
	jQuery("select#jump_to").bind("change",function(e) {
		Semprini.JumpTo(jQuery(this).attr('value'));
		});
	jQuery("select#show_products_for").bind("change",function(e){
	  Semprini.OnlyShowProductsFor(jQuery(this).attr('value'));
		});
}
Semprini.HideAllProductsExcept = function(thisOne) {
	all_items = ['CD', 'Vinyl', 'Shirts', 'Merchandise'];
	if (thisOne == 'All') {
		all_items.each(function(name, index) { new Effect.Grow(name, {duration:0.5}); }); 
	} else {
		hiders = all_items.without(thisOne);
		hiders.each(function(name, index) { 
			new Effect.Squish(name, {duration:0.1}); 
			}); 
  	new Effect.Grow(thisOne,{duration:0.5});
	}
}
 Semprini.JumpTo = function(item) {
	new Effect.ScrollTo(item);
}
Semprini.OnlyShowProductsFor = function(thisBand) {
	if (thisBand == 'All') {
		redirect = "/store";
	} else {
		redirect = "/artists/" + thisBand + "/products";
	}
  window.location = redirect;
}
function show_these(items) {
			jQuery(items).show('fast');
			$('more_or_less').replace('<p id="more_or_less"><a href="#" onclick="hide_these('+ "'" + items + "'" + ');return false;">Less</a></p>')
}                                                                 
function hide_these(items) {
					jQuery(items).hide('fast');
					$('more_or_less').replace('<p id="more_or_less"><a href="#" onclick="show_these('+ "'" + items + "'" + ');return false;">More</a></p>')
}