/** Add onclick function to combination radio options to scroll browser to product image radio button click **/
var fnOnclick = new Array();


YAHOO.util.Event.onAvailable("format_product_details_retail_image", function(){
		var x;
		for(x = 539; x <= 634; x++) {
		var elements = document.getElementsByName('combo_options' + x);
		
		//iterate through all input elements and find combination radio buttons
		for(var i=0; i < elements.length; i++)
		{
			fnOnclick[i] = elements[i].onclick;
			elements[i].onclick = combinationOptionOnClick;
		}
		}
	}
);

/**runs combination selection function then moves the browser to the position of the image div**/
function combinationOptionOnClick()
{
	var y;
	for(y = 539; y <= 634; y++) {
	var elements = document.getElementsByName('combo_options' + y);
	for(var i=0; i < elements.length; i++)
	{
		if(elements[i] ==this)
		{
			fnOnclick[i]();
			window.scrollTo(0,YAHOO.util.Dom.getY('format_product_details_retail_image') - 60 );
		}
	}
	}
}
