	function filtra_categorie(id_tipologia) {
        $("#categoria").load("/ricerca_ajax_categorie.php?id_tipologia="+id_tipologia+"");
	}

	function seleziona_valore(value,text) {
		
		option = document.getElementById("search_id_categoria").getElementsByTagName("option");
		for(d = 0; d < option.length; d++) {
			if(option[d].value == value) {
				//alert (value);
				//document.getElementById("search_id_categoria").selected = value;
				document.getElementById("selectsearch_id_categoria").childNodes[0].nodeValue = text;
				document.getElementById("search_id_categoria").selectedIndex = value;
				
			}
		}
		
	}

///// AJAX SEARCH 

function ajax_result_prodotti(url,objID,inserito)
{
	var text_search = '';

	if (document.getElementById('search_id_tipologia')){ id_tipologia = document.forms['search_form'].search_id_tipologia.value; }
	else var id_tipologia = null;
	
	if (document.getElementById('search_id_categoria')){ id_categoria = document.forms['search_form'].search_id_categoria.value; }
	else var id_categoria = null;

	if (document.getElementById('search_id_eta')){ id_eta = document.forms['search_form'].search_id_eta.value; }
	else var id_eta = null;

	if (document.getElementById('search_prezzo')){ id_prezzo = document.forms['search_form'].search_prezzo.value; }
	else var id_prezzo = null;

	if (document.getElementById('id_marchio')){ id_marchio = document.forms['search_form'].id_marchio.value; }
	else var id_marchio = null;

	if (document.getElementById('search_lang')){ lang = document.forms['search_form'].search_lang.value; }
	else var lang = null;

	
	field_ricerca = document.forms['search_form_text'].text_search;
	
	if((field_ricerca.value != null) && (field_ricerca.value != '')  && (field_ricerca.value != 'undefined') )
	{
		text_search = field_ricerca.value;
	}


		//text_search = document.forms['search_form_text'].text_search.value; 
	//}
	
	
	loadContentArchivio(id_tipologia,id_categoria,id_eta,id_prezzo,id_marchio,lang,'1','1',text_search);
}
