/*
<input type="hidden" name="on1" value="size" /><input type="radio" name="os1" value="Mastercard" /><input type="radio" name="os1" value="visa" />
*/
var option = 0;
var formular;
var newItem;

function makeOptions(attribute){
	if(ebayForm[attribute].length > 1){
		option++;
		var container = new Element('div', {'class':'column'});
		new Element('input', {'type':'hidden', 'name':'on'+option, 'value':attribute }).inject(container, 'top');
		ebayForm[attribute].each(function(el){
			if($chk(el)){
				newItem = new Element('label', {'for':'r'+option+el.replace(/\s+/g, ''), 'html':el+'<br />' });
				new Element('input', {'type':'radio', 'class':'radio', 'id':'r'+option+el.replace(/\s+/g, ''), 'name':'os'+option, 'value':el }).inject(newItem, 'top');
				newItem.inject(container, 'top');
			}
		});
		container.inject(formular, 'top');
	}
}

window.addEvent('domready', function() {
	formular = $('formular');
	makeOptions('color');
	makeOptions('fabric');
	makeOptions('size');
	$$('#formular div.column').each(function(el){
		el.setStyle('width', 360/option);
		el.getElement('input').set('checked', 'checked');
	});
});