		function changePage(page) {
			document.changeDataForm.page.value = page;
			document.changeDataForm.submit();
		}
	
		function changeItemsPerPage(itemsPerPage) {
			$('#changeHowMany').val(itemsPerPage);
			document.changeDataForm.submit();
		}
	
		function changeSortOrder(sortOrder) {
			$('#changeSortOrder').val(sortOrder);
			document.changeDataForm.submit();
		}
	
		function changeData(product,color,max,linkElementId,hrefContent) {
		
			$('#' + linkElementId + '_1').attr('href',hrefContent);
			$('#' + linkElementId + '_2').attr('href',hrefContent);
	
			if (products.products[product].colors[color].imageURL != "") {
				$('#main_img_' + product).attr('src',products.products[product].colors[color].imageURL);
			}
	
			for (i = 0; i < max; i++) {
				if (i == color) {
					$('#img_' + product + '_' + i).addClass('select');
				} else {
					$('#img_' + product + '_' + i).removeClass('select');
				}
			}
		}

// New Code
$(document).ready(function(){
    $("#thumbnails .colors img").each(function(){
    
        // Click Handler
        $(this).click(function(){
            var src = $(this).attr("src").toString().replace(/\.jpg/, "") + "/image1med.jpg";
            var id = $(this).attr("id").toString();
            // Replace the src on the img child of div.prod-thumb above this clicked swatch
            $(this).parent().siblings().eq(0).children().eq(0).children().eq(0).attr("src", src);
            // Change the href on the link child of div.prod-thumb above this clicked swatch
            var href = $(this).parent().siblings().eq(0).children().eq(0).attr("href").toString().replace(/#\w+/, "") + "#" + id;
            $(this).parent().siblings().eq(0).children().eq(0).attr("href", href);
            // Toggle Selected
            $(this).addClass('select');
            $(this).siblings().each(function(){
                $(this).removeClass('select');
            });
        });
        
        // Mouse over/out for older browsers
        $(this).hover(function(){ // Mouse Over
            $(this).addClass('sfHover');
			$(this).css({ 'cursor' : 'pointer'});
        }, function(){ // Mouse Out
            $(this).removeClass('sfHover');
        });
    });
	
	
});	

function facetSelectBoxChanged(source){
	if (source.selectedIndex > 0){
		window.location = source.options[source.selectedIndex].value;
	}
}