// JavaScript comuni al sito

// visualizza, nasconde un layer
function switchvis(objid, bool) {
  var elemento = document.getElementById(objid);
  elemento.style.display = (bool == true) ? '' : 'none';
}


function showdiv(name) {
  var ar = new Array('mod_pwd', 'mod_dati');
  for (i=0; i<ar.length; i++) {
    vis = (name == ar[i]) ? true : false
    switchvis(ar[i], vis);
  }
}



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function PopupImage(img) {
 titre="Ingrandimento";
 w=open("",'image','width=1,height=1,toolbar=no,scrollbars=no,resizable=yes'); 
 w.document.write("<HTML><HEAD><TITLE>"+titre+"</TITLE></HEAD>");
 w.document.write("<SCRIPT language=javascript>function checksize(){ if (document.images[0].complete) {window.resizeTo(document.images[0].width+15,document.images[0].height+15); window.focus();} else { setTimeout('check()',250) } }</"+"SCRIPT>");
 w.document.write("<BODY BGCOLOR=FFFFFF onload='checksize()' leftMargin=0 topMargin=0 marginwidth=0 marginheight=0><IMG src='"+img+"' border=0>");
 w.document.write("");
 w.document.write("</BODY></HTML>");
 w.document.close();
}