function trattativa_sel(trattativa,prezzo_corrente) {

   if (trattativa == "") return;
   
   var ranges = new Array();
   var rangesTesto = new Array();
   var selPrezzo = document.getElementById('prezzo');
   while(selPrezzo.options.length > 0) selPrezzo.removeChild(selPrezzo.options[0]); 
   
   if ((trattativa==7)||(trattativa==10))
   {
   	selPrezzo.disabled=false
	ranges.push('0');
	rangesTesto.push('Qualunque');
   	ranges.push('10000-100000');
	rangesTesto.push('da 10.000 a 100.000');
	ranges.push('100000-200000');
	rangesTesto.push('da 100.000 a 200.000');
	ranges.push('200000-300000');
	rangesTesto.push('da 200.000 a 300.000');
	ranges.push('300000-500000');
	rangesTesto.push('da 300.000 a 500.000');
	ranges.push('500000-100000000');
	rangesTesto.push('da 500.000 in su');
   }
   else if (trattativa==13)
   {
   	selPrezzo.disabled=false	
	ranges.push('0');
	rangesTesto.push('Qualunque');
	ranges.push('0-500');
	rangesTesto.push('da 0 a 500');
	ranges.push('500-1000');
	rangesTesto.push('da 500 a 1.000');
	ranges.push('1000-3000');
	rangesTesto.push('da 1.000 a 3.000');
	ranges.push('3000-100000');
	rangesTesto.push('da 3.000 in su');
   }
   else
   {
   	ranges.push('0');
	rangesTesto.push('Qualunque');
	selPrezzo.disabled=true
   }

    
   for (i=0; i<ranges.length; i++)
   {
	    var where = (navigator.appName == "Microsoft Internet Explorer") ? -1 : null;
	    newElem = document.createElement("option"); 
		newElem.text = rangesTesto[i];
		
		if (prezzo_corrente!="")
		{
			if (ranges[i] == prezzo_corrente)
			{
				newElem.setAttribute("selected","selected");
			} 
		}
		
		newElem.value = ranges[i]; 
		selPrezzo.add(newElem, where);
   }
}