<!--

function trim(parola, stretto){ 	
  var temp = parola;
  var obj = /^(\s*)([\W\w]*)(\b\s*$)/;
  if (obj.test(temp)) { 
    temp = temp.replace(obj, '$2'); 
  }
  
  // Se stretto e' true, elimina anche gli spazi interni alla parola.
  if (stretto == true) {
    var obj = /\s/g;
    while (temp.match(obj)) { 
      temp = temp.replace(obj, ""); 
    }
  }
   
  return temp;

}

function bookmark() {
  browserName = navigator.appName;
  browserVer = parseInt(navigator.appVersion);
  if (browserName == "Microsoft Internet Explorer" && browserVer >= 4) {
     window.external.AddFavorite("http://www.ilmangelo.it", document.title);
   }
}

function aprichiudi(targetId, altriID){
  if (document.getElementById){
    if (targetId != "") {
      target = document.getElementById(targetId);
      label = document.getElementById("label_" + targetId);
      bottone = document.getElementById("button_" + targetId);
      bottone.value = "[ " + label.value + " ]";
      target.style.display = "block";
    }
    for (i = 0; i < altriID.length; i++) {
      target = document.getElementById(altriID[i]);
      target.style.display = "none";
      label = document.getElementById("label_" + altriID[i]);
      bottone = document.getElementById("button_" + altriID[i]);
      bottone.value = label.value;
    }  
  }
}

function addRighe(righe){
  document.formdati.action.value = "addrighe";
  document.formdati.righe_correnti.value = 1 + righe;
  document.formdati.submit();
  return true;
}
    
function popup (indirizzo, nome, w, h) {
   window.open(indirizzo, nome,'width=' + w + ',height=' + h + ',scrollbars=no,menubar=no,resizable=yes')	
}

function aprichiudiSmall(targetId, altriID){ 
  if (document.getElementById){
    if (targetId != "") {
      target = document.getElementById( targetId );
      target.style.display = "block";      
    }
    for (i = 0; i < altriID.length; i++) {
      target = document.getElementById(altriID[i]);
      target.style.display = "none";
    }  
  }
}

function showHelp() {
  if (document.getElementById){
    target = document.getElementById("helpbox");  
    target.style.visibility = 'visible';
  }
}

function hideHelp() {
  if (document.getElementById){
    target = document.getElementById("helpbox");  
    target.style.visibility = 'hidden';
  }
}



function errorTrace(msg, url, linenumber){
  alert('Errore Javascript alla riga: ' + linenumber + '\n\n' + msg);
  return true;
}

function cambiaStatoCheckbox(modulo) {
  for (var i = 0; i < modulo.elements.length; i++) {
  	if (modulo.elements[i].type == "checkbox") {
  	  modulo.elements[i].checked = !modulo.elements[i].checked;	
  	}
  }	
}

window.onerror=errorTrace;


	
-->
