// Info textbox
function swInf(target) { document.getElementById('info_'+target).style.display='inline';  }
function hdInf(target) { document.getElementById('info_'+target).style.display='none';   }

// Controllo select option multiple
function rimuovivoce(from_target){
  var elSel = document.getElementById(from_target);
  var i;
  for (i = elSel.length - 1; i>=0; i--) {
    if (elSel.options[i].selected) {
      elSel.remove(i);
    }
  }
}

function aggiungivoce(from_target,to_target){
	num_option=document.getElementById(to_target).options.length; 
	indice_selezionato = document.getElementById(from_target).selectedIndex;
	if(indice_selezionato>=0){
		value_selezionato = document.getElementById(from_target).options[indice_selezionato].value;
		testo_selezionato = document.getElementById(from_target).options[indice_selezionato].innerHTML;
		duplicato=0;
		for(a=0;a<num_option;a++){
			if(document.getElementById(to_target).options[a].value==value_selezionato){
				duplicato=1;
			}
		}
		if(duplicato==0){
			document.getElementById(to_target).options[num_option]=new Option('',escape(value_selezionato),false,false);
			document.getElementById(to_target).options[num_option].innerHTML = testo_selezionato;
		}
	}
}

function listavoci(target_list){
	var lista_provincie_azienda = '';
	for (i=0;i<document.getElementById(target_list).length;i++) {
		lista_provincie_azienda = lista_provincie_azienda+document.getElementById(target_list)[i].value+':';
	}
	return lista_provincie_azienda;
}

// SlideUp - SlideDown dei BOX
function SlideDownBox(target) { Effect.SlideDown(target, { duration: 1.0 }); }
function SlideUpBox(target) { Effect.SlideUp(target, { duration: 1.0 }); }


