function collectAndSearch(theForm,theArch,whereSearch){

	theTarget = null;
	if(typeof(parent.parent.ricercaInCorso)=='undefined' || parent.parent.ricercaInCorso==null){
		theTarget = top.opener.parent
	}else{
		theTarget = parent.parent
	}

	if(whereSearch.indexOf("&findPartner=true")==-1){
		whereSearch = "&findCine=true&findFoto=true&findPartner=false"
	}else{
		whereSearch = "&findCine=true&findFoto=true&findPartner=true"
	}
	parametri = whereSearch+"&theTerm=";
	iValori = "%22 "
	selezionati = false;
	//alert(theForm)
		for(i=0;i<theForm.length;i++){
			if(theForm.elements[i].checked){
					iValori+=theForm.elements[i].value+"%22 and %22 ";
					selezionati = true;
				}
		}
	if(selezionati){
		iValori = iValori.substring(0,iValori.lastIndexOf(" and %22 "))
		theTarget.ricercaInCorso(true);
		theTarget.content_2.location = "/archivio/jsp/doSimpleQuery.jsp?searchFrom=key"+parametri+iValori
		theTarget.focus()
	}else{
		alert('Attenzione:\nSelezionare almeno un termine!')
	}
}