 function motore_interno() {
     var Scrivi = document.getElementById("motore").Scrivi.value;
        if ((Scrivi == "") || (Scrivi.indexOf(" Scrivi qui") != (-1))) {
           alert("ATTENZIONE! Non è stato inserito nessun termine di ricerca.");
           document.motore.Scrivi.focus();
           return false;
        }
        else {
           document.getElementById("motore").action = "http://search.atomz.com/search/";
           document.getElementById("motore").submit();
        }
  }


 function motore_esterno() {
     var Autore = document.getElementById("motore-esterno").Autore.value;
	 var Titolo = document.getElementById("motore-esterno").Titolo.value;
        if ((Autore == " Autore")) {
           alert("ATTENZIONE! Non è stato compilato il campo 'Autore' se si desidera procedere comunque premere nuovamente il pulsante 'Vai'.");
           document.getElementById("motore-esterno").Autore.focus();
           return false;
        }
        else if ((Titolo == " Titolo")) {
          alert("ATTENZIONE! Non è stato compilato il campo 'Titolo' se si desidera procedere comunque premere nuovamente il pulsante 'Vai'.");
          document.getElementById("motore-esterno").Titolo.focus();
          return false;
        }
        else {
           document.getElementById("motore-esterno").action = "http://sbnweb.csi.it:8092/CIC/BASIS/OPACX/UDMOPAC/esimplex/SDF";
           document.getElementById("motore-esterno").submit();
        }
  }
  
  
   function externalLinks() { 
     if (!document.getElementsByTagName) return;
     var anchors = document.getElementsByTagName("a"); 
     for (var i=0; i<anchors.length; i++) { 
	 var anchor = anchors[i]; 
	    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "esterno") {
		anchor.target = "_blank";
		if (anchor.title) anchor.title += " (Il link apre una nuova finestra)";
		if (!anchor.title) anchor.title = "Il link apre una nuova finestra";
	} 
} 
} 


   function linkesterni() { 
     if (!document.getElementsByTagName) return;
     var anchors = document.getElementsByTagName("form"); 
     for (var i=0; i<anchors.length; i++) { 
	 var anchor = anchors[i]; 
	    if (anchor.getAttribute("id") && anchor.getAttribute("method") == "get") {
		anchor.target = "_blank";
		if (anchor.title) anchor.title += " (Il risultato della ricerca apre una nuova finestra)";
		if (!anchor.title) anchor.title = "Il link apre una nuova finestra";
	} 
} 
} 
   
  
   function albero(mID) {
	var menu = document.getElementById(mID);
	var display = menu.style.display;
	menu.style.display = (display == "block") ? "none" : "block";
	
}

window.onload = function() {
externalLinks(); 
linkesterni();
	var uls = document.getElementsByTagName("ul");
	for (i=0;i<uls.length;i++) {
		if(uls[i].className=="submenu")uls[i].style.display = "none";
	}
}
