      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 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 x=window.confirm("Per poter usufruire di questo servizio è necessario registrarsi. Registrati o esegui il Login cliccando su ok");
    if (x) {
    popupwin('registrazione/registrazione.php?sitoID=10&pagina=/old/scheda_opera.php&ID=2180','550','400','yes');
    }
    }
    
    function pdf(indirizzo){
               window.open(indirizzo);
    }
    
    function verificaFormAdv(){
    var mess="";
    if ((document.cerca1.materiaID1.value == 0) && (document.cerca1.destinazioneID1.value == 0) && (document.cerca1.scuolaID.value == 0) && (document.cerca1.volume_ISBN.value == "") && (document.cerca1.txt.value == "")) mess+="Inserire almeno un crietrio di ricerca valido";
    //se ² tutto OK esegui il submit...
    if (mess=="") {
            document.cerca1.submit();
    } else {
            alert(mess);
            }
    }
    
    function openPictureWindow_Fever(imageName,imageWidth,imageHeight,alt,posLeft,posTop) {
            newWindow = window.open("","newWindow","width="+imageWidth+",height="+imageHeight+",left="+posLeft+",top="+posTop);
            newWindow.document.open();
            newWindow.document.write('<html><title>'+alt+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" onBlur="self.close()">');
            newWindow.document.write('<img src='+imageName+' width='+imageWidth+' height='+imageHeight+' alt='+alt+'>');
            newWindow.document.write('</body></html>');
            newWindow.document.close();
            newWindow.focus();
    }
    
    function verificaForm(formnumber){
    var mess="";
    if (document.cerca.txt.value=="") mess="Per effettuare una ricerca è necessario inserire un criterio di ricerca valido.";
    
    //se ² tutto OK esegui il submit...
    if (mess=="") {
             document.forms[formnumber].submit();
    } else {
            alert(mess);
            }
    }
    
    function verifica_form(){
    var mess="";
    if ((document.invia.mittente.value.indexOf("@") == -1) | (document.invia.mittente.value.indexOf(".") == -1) | (document.invia.mittente.value.length < 7)) mess+="Controlla che l\'e-mail che hai inserito sia valida. ";
    if (document.invia.destinatario.value == "") mess+="Non hai indicato alcun destinatario. ";
    if (document.invia.soggetto.value=="") mess+="Non hai indicato l'oggetto del messaggio. ";
    if (document.invia.testo.value=="") mess+="Non hai inserito alcun testo. ";
    //se ² tutto OK esegui il submit...
    if (mess=="") {
            document.invia.submit();
            return true;
    } else {
            alert(mess);
            return false;
            }
    }
    
    function verifica_form1(){
    var mess="";
    if ((document.getElementById('invia').mittente.value.indexOf("@") == -1) | (document.getElementById('invia').mittente.value.indexOf(".") == -1) | (document.getElementById('invia').mittente.value.length < 7)) mess+="Controlla che l\'e-mail che hai inserito sia valida. ";
    if (document.getElementById('invia').destinatario.value == "") mess+="Non hai indicato alcun destinatario. ";
    if (document.getElementById('invia').soggetto.value=="") mess+="Non hai indicato l'oggetto del messaggio. ";
    if (document.getElementById('invia').testo.value=="") mess+="Non hai inserito alcun testo. ";
    //se tutto OK esegui il submit...
    if (mess=="") {
            document.getElementById('invia').submit();
            return true;
    } else {
            alert(mess);
            return false;
            }
    }    
