I have this loaded before the radio buttons with corresponding color variable.
<script type="text/javascript">
//<![CDATA[
images = {"Black":"http:\/\/ecx.images-amazon.com\/images\/I\/31XwBA2m8pL.jpg","Slate":"http:\/\/ecx.images-amazon.com\/images\/I\/31SqWkrSb6L.jpg","White":"http:\/\/ecx.images-amazon.com\/images\/I\/31OJufgJT2L.jpg"};
//]]>
</script>
Here is the jquery function. The best I can do so far is make the first image disappear, leaving the alt attribute.
function change_large_product_image(url) {
jQuery('.largeprod img').attr('src', url);
return false;
}
Here is a sample source for the radio button.
<label for="Black" style="background: #fff url(http://ecx.images-amazon.com/images/I/11TeKFAzJsL._SL30_.jpg) center center no-repeat;" title="Black" >
Black
</label>
<input id="color_black" name="color" onclick="change_large_product_image(images['Black'])" type="radio" value="Black" />