// Variabili globali
var srcDettaglio="";
var titoloDettaglio=""
var didascaliaDettaglio=""

/* popup */
function openPopup(urlpopup,nomepopup,w,h,settingspopup){
  var x=(screen.width-w)/2;
  var y=(screen.height-h)/2-20;
  if(x<0)x=0;
  if(y<0)y=0;
  if(w>screen.width)w=screen.width;
  if(h>screen.height)h=screen.height;
  var settings='top='+y+',left='+x+',width='+w+',height='+h+','+settingspopup;
  var popup=window.open(urlpopup,nomepopup,settings);
  popup.focus();
}//openPopup

function resizeWindow(){
  if(document.getElementById('foto') != null){
    w=document.getElementById('foto').width+30;
    h=document.getElementById('foto').height+120;
    winWidth= w//(w<320)?320:((w<640)?w:640);
    //if(w >=640){document.getElementById('foto').width=580}
    winHeight= h //(h<240)?240:((h<480)?h:480);
    winLeft=(screen.width-winWidth)/2;
    winTop=(screen.height-winHeight)/2;
    window.moveTo(winLeft,winTop);
    window.resizeTo(winWidth,winHeight);
  }//end if
}//resizeWindow

function mostralistino(){
  var settingspopup = 'location=no,directories=no,menubar=no,toolbar=yes,status=no,scrollbars=yes,resizable=yes,fullscreen=no';
  var passwordGrossisti = "oloibla"
  var passwordListino = "a121a"
  var varResponse = window.prompt("Inserisci la password:","");
  if (varResponse == passwordGrossisti){
    var w=500;
    var h=480;
    openPopup('listinogrossisti.html','listino',w,h,settingspopup);
  }
  else if (varResponse == passwordListino){
    var w=500;
    var h=480;
    openPopup('listinorivendori.html','listino',w,h,settingspopup);
  }
  else if ( (varResponse == "") || (varResponse == undefined) || (varResponse == null) ) {
  }
  else {
    alert("Password non corretta")
  }
}//mostralistino

