<!--
function NewWindow(mypage,myname,w,h,pos,infocus){
var win=null;
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + (mytop-30) + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}
// -->
<!--
function NewWindow2(mypage,myname,w,h,pos,infocus){
var win=null;
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + (mytop-30) + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";win=window.open(mypage,myname,settings);
win.focus();}

// -->
function inviaDati() {
    if (window.event.keyCode == 13) {
        login("login");
        return false;
    }
    else {
        return true;
    }
}

function login(azione) {
    if (document.formUtente.username.value == "" || document.formUtente.password.value == "") {
      alert("ATTENZIONE: Immettere nome utente & password");
      return false;
    }
    else {
      document.formUtente.azione.value = azione;
      document.formUtente.submit();
      return true;
    }
}

function inviaDati2() {
    if (window.event.keyCode == 13) {
        login2("login");
        return false;
    }
    else {
        return true;
    }
}

function login2(azione) {
    if (document.formUtente2.username.value == "" || document.formUtente2.password.value == "") {
      alert("ATTENZIONE: Immettere nome utente & password");
      return false;
    }
    else {
      document.formUtente2.azione.value = azione;
      document.formUtente2.submit();
      return true;
    }
}

function registrami() {
  document.formUtente.azione.value = "registrami";
  document.formUtente.submit();
}



function recuperoPassword() {
  document.formUtente.azione.value = "recuperoPassword";
  document.formUtente.submit();
}  
  
  
//======================================================================
function modificaPasswordUtente(pag) {

    popupFinestra(pag, "finestraUtenteModificaPassword");
}

//======================================================================
function recuperoPasswordUtente(pag) {

    popupFinestra(pag, "finestraUtenteRecuperoPassword");
}

//======================================================================

function popupFinestra(nomePagina, nomeFinestra) {
    var openwin;
    var impostazioni;
    
    impostazioni = "menubar=0,toolbar=0,location=0,status=0,scrollbars=0,resizable=0,width=350,height=250,left=0,top=0";
    openwin = window.open(nomePagina, nomeFinestra, impostazioni);
    openwin.focus();
}

