    var DHTML = (document.getElementById || document.all || document.layers);        

    function getObj(name){
      if (document.getElementById){
        this.obj = document.getElementById(name);
        this.style = document.getElementById(name).style;
        this.inner = document.getElementById(name).innerHTML;    
      }else if (document.all){
        this.obj = document.all[name].id;
        this.style = document.all[name].style;
        this.inner = document.all[name].innerHTML;    
      }else if (document.layers){
        this.obj = document.layers[name].id;
        this.style = document.layers[name];
        this.inner = document.layers[name]; 
      }
  }
      
	  function inizializza(nameONE){
		//alert(DHTML);
		if (!DHTML) return;
		invisible('x'+nameONE);
	  }
	  
	  function invisible(nameONE){
		x = new getObj(nameONE);
		vis = x.style.display;
		//alert (vis);
		if(vis=='' || vis=='none'){
		  x.style.display = 'block';
		}else{
		  x.style.display = 'none';
		  //x.style.visibility = 'hidden';		  
		}       
	  } 
	  
	function getIndex(mySelect)
	  {
	  //var x=document.getElementById(mySelect);
	  //alert(x.selectedIndex);
	  document.getElementById(mySelect).selectedIndex=0;
	  //document.getElementById('radio_pbm').checked=true;	
	  //alert(document.getElementById('radio_pbm').checked);
	  //myvar = myForm.scelta[counter].value; 
	  //document.getElementById('radio_pbm').value;
	  //document.myForm.action = myvar; 	  
	  document.adoped.tipo_testo[0].checked=true;
	  }	  

function mylocation(selezionato){
  if(selezionato=="31-0"){
    selezionato=31;
    selezionato2=0;
  }else{
      selezionato2=2;
  }
  location.href='ricerca.php?selezione='+document.forms[1].selezionetxt.value+'&categoriaID='+selezionato+'&dest='+selezionato2
}

function go(wheretogo){
  location.href='agenti.php?provinciaID='+wheretogo+'&macrodestinazioneID='+document.getElementById('macrodestinazioneID').selectedIndex;
}

function popupwin(str, dimX, dimY, scrollb) {
                     var caratteristiche =
                     'scrollbars=' + scrollb + ',resizable=yes,width=' + dimX +
                     ',height=' + dimY +
                     ',status=no,location=no,toolbar=no';
                     myWin = window.open(str,'pagina',caratteristiche);
                     myWin.focus();
}

function registra() {
var txt='Per poter usufruire di questo servizio è necessario registrarsi. Registrati cliccando su OK.\n\r Se sei già registrato procedi al login nella pagina corrente cliccando su Annulla.\n\r Per la richiesta di copie saggio, è necessario essere docenti';
//"Per poter usufruire di questo servizio è necessario registrarsi. Registrati o esegui il Login cliccando su ok\n\rPer la richiesta di copie saggio, è necessario essere docenti"
var x=window.confirm(txt);
if(x){
  //popupwin('registrazione/registrazione.php?sitoID=5&pagina=/scheda_opera.php&ID=2489','550','400','yes');
  document.location.href="http://ppbm.it/registrazione/index.php";
}
}