	function buy_op(unique_id, opt)
	{
		var text = '';
		var text_prices = '';
		var ins_opt = '';
		var ins_text = '';
		var options = opt.split(',');
		var output = [];
		var array_index = 0;
		var inserted_text = '';

		for (i in options)
		{
			var op_action = options[i].split('|');
			
			var field_name = eval("document.assigned_buy_options.buy_op_"+unique_id+"_"+op_action[1]);
			
			if (op_action[0]=="checkbox_list")
			{
				for (var j=0; j < field_name.length; j++)
			   {
					if (field_name[j].checked)
			      {
						output[array_index] = field_name[j].value;
						array_index++;
			      }
			   }
			}
			else if (op_action[0]=="radio_list")
			{
				for(var j = 0; j < field_name.length; j++) 
				{
					if(field_name[j].checked && field_name[j].value!='') 
					{
						output[array_index] = field_name[j].value;
						array_index++;
					}
				}				
			}
			else 
			{			
				if (field_name.value != '')
				{
					outp = '';
					if (op_action[0]=="text")
					{
						outp += options[i]+"||";
					}
					outp += field_name.value;
					
					output[array_index] = outp;
					array_index++;
				}
			}
		}
		
		
		for (values in output)
		{
				var val = output[values].split('|');
				var price = '';
				
				if (val[0]=="text")
				{
					ins_text += val[1]+","+val[3]+"|";
					
					text += "<tr><td colspan=\"2\" class=\"buy_op_cell cell_border_line\">"+document.getElementById("name_buy_op_"+unique_id+"_"+val[1]).innerHTML+" "+val[3]+"</td></tr>";
				}
				else
				{
					ins_opt += val[0]+",";
					var price = "";
					if (val[1]!="")
					{
						price = round_int(val[1])+" "+val[2]+" ";
					}	
					
					text_prices += "<tr><td class=\"buy_op_cell cell_border_line\">"+val[3]+"</td><td width=\"30%\" class=\"buy_op_cell nobr cell_border_line\">"+price+"</td></tr>";
				}	
		}
		
		if (text!='')
		{
			text = "<tr><td colspan=\"2\" class=\"buy_op_cell cell_border_line\"><b>"+document.getElementById("additional_description_text").innerHTML+":</b></td></tr>" + text;
		}
		
		inserted_text = "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">";
		inserted_text += text_prices+text;
		inserted_text += "</table>";
		
		document.getElementById("c_op_"+unique_id).innerHTML = inserted_text;
		document.getElementById("c_op_ins_"+unique_id).value = ins_opt;

		document.getElementById("c_op_ins_text_"+unique_id).value = ins_text;
		
	}	
	
	function round_int(amount) 
	{
		// returns the amount in the .99 format 
	    amount -= 0;
	    amount = (Math.round(amount*100))/100;
	    return (amount == Math.floor(amount)) ? amount + ',00' : (  (amount*10 == Math.floor(amount*10)) ? amount + '0' : amount);
	}
