$(document).ready(function() {
	
	$('#search-form select, .select-bar select').each(function() {
		$(this).parent().append('<span class="faux">' + $(this).find('option:selected').text() + '</span>');
		$(this).change(function() {
			$(this).parent().find('.faux').text($(this).find('option:selected').text());
		});
	});
	
	$('#price-range-slider').slider({
		range: true,
		min: parseInt($('#price-range-default-min').val()),
		max: parseInt($('#price-range-default-max').val()),
		values: [parseInt($('#price-range-min').val()), parseInt($('#price-range-max').val())],
		slide: function(event, ui) {
			$("#price-range-min").val(ui.values[0]);
			$("#price-range-max").val(ui.values[1]);
		}
	});
	
	
	var i = 0;
	$('.product-presentation .product-image a').attr('id', 'zoombox-trigger-' + (i++)).click(function() {
		showZoombox($(this));
		return false;
	});
	
	$('.product-presentation .presentation-options .zoom a').click(function() {
		showZoombox($('.product-presentation .product-image a'));
		return false;
	});
	
	$('a.zooming').attr('id', 'zoombox-trigger-' + (i++)).click(function() {
		showZoombox($(this));
		return false;
	});
	
});
