	
	
	function process_colors_selection(selected_item, id){
		if ($$('a.links_colors_select')){
			var links_img = $$('a.links_colors_select');
			links_img.each( function( eAnchor ) {
				eAnchor.className = 'links_colors_select';
			});
		}
				
		if (selected_item){
			selected_item.className = 'links_colors_select selected_color';
			//alert(selected_item.href);
		}
		
		if ($('attribute76')){
			var tabOptions = $('attribute76').getElementsByTagName('option');
			//alert(tabOptions.length);
			var nodes = $A(tabOptions);
			nodes.each(
			function(n) { 
				if(n.value == id){
					n.selected = true;
				} else {
					n.selected = false;
				}
			} );
		}
		
		spConfig.configureElement($('attribute76'));
		
		var element = $('attribute76');
		var selectedPrice;
		if(element.options[element.selectedIndex].config){
            selectedPrice = parseFloat(element.options[element.selectedIndex].config.price)
        }
        else{
            selectedPrice = 0;
        }
        
        
        for(var i=0;i<element.options.length;i++){
            if(element.options[i].config){
            	$('label_color_'+element.options[i].value).innerHTML = element.options[i].text;
            }
        }	
	}
	
	
	function swap_image_by_color(image, selectValue){
		if (selectValue != '' && $(selectValue)){
			$('shadowbox_lnk').href = $(selectValue).title;
			image.src = $(selectValue).src;
			Shadowbox.clearCache(); 
			Shadowbox.setup(); 
		}
		else if ($('default_img')){
			$('shadowbox_lnk').href = $('default_img').title;
			image.src = $('default_img').src;
			Shadowbox.clearCache(); 
			Shadowbox.setup();
		}
		
		if ($('label_color_'+selectValue) && $('option_selecter')){
			$('option_selecter').innerHTML = $('label_color_'+selectValue).innerHTML;
		}
	}
	
	
	function set_selected_db(){
		$$('div.select_cb img').each(
			function(the_image) {
				the_image.className = '';
			}
		);
	}
	
	
	window.onload = function(){ 
		Shadowbox.init(); 
		if ($('attribute76')){		
			$('attribute76').onchange = function () { 
				//alert($F('attribute76'));
				swap_image_by_color($('image'), $F('attribute76'))			
			}
		}
		if ($('billing:use_for_shipping_yes'))
           $('billing:use_for_shipping_yes').checked=true; 
           
	};