
function MV_LIB_popup_01(url, name)
{
  agt= navigator.userAgent.toLowerCase();
  is_ie= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  if (is_ie)
  {
    w+= 10;
    h+= 38;
    var x= (screen.width  - w)/2;
    var y= (screen.height - h)/2;
  }
  else
  {
    var x= screen.availLeft + (screen.availWidth  - w)/2;
    var y= screen.availTop +  (screen.availHeight - h)/2;
  }
  var finestra= window.open(url,'_blank','width=' + w +',height=' + h + ', toolbar=no,directories=no,location=no,status=yes,menubar=no,copyhistory=no,scrollbars=yes,resizable=yes');
  finestra.moveTo(x,y);
}

function MV_LIB_popup_size2(url, w, h, name)
{
  agt= navigator.userAgent.toLowerCase();
  is_ie= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  if (is_ie)
  {
    if (arguments.length < 5)
    {
      w+= 10;
      h+= 38;
    }
    var x= (screen.width  - w)/2;
    var y= (screen.height - h)/2;
  }
  else
  {
    var x= screen.availLeft + (screen.availWidth  - w)/2;
    var y= screen.availTop +  (screen.availHeight - h)/2;
  }
  var finestra= window.open(url, name, 'Width='+w+',Height='+h+', screenX='+x+',screenY='+y+', toolbar=no,directories=no,location=no,status=yes,menubar=no,copyhistory=no,scrollbars=yes,resizable=yes');
  finestra.moveTo(x,y);
}

function MV_LIB_popup_size3(url, w, h, name)
{
  agt= navigator.userAgent.toLowerCase();
  is_ie= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  if (is_ie)
  {
    if (arguments.length < 5)
    {
      w+= 10;
      h+= 38;
    }
    var x= (screen.width  - w)/2;
    var y= (screen.height - h)/2;
  }
  else
  {
    var x= screen.availLeft + (screen.availWidth  - w)/2;
    var y= screen.availTop +  (screen.availHeight - h)/2;
  }
  var finestra= window.open(url, name, 'Width='+w+',Height='+h+', screenX='+x+',screenY='+y+', toolbar=no,directories=no,location=no,status=no,menubar=no,copyhistory=no,scrollbars=no,resizable=no');
  finestra.moveTo(x,y);
}

function MV_LIB_popup_size1(url, w, h)
{
  agt= navigator.userAgent.toLowerCase();
  is_ie= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  if (is_ie)
  {
    w+= 10;
    h+= 38;
    var x= (screen.width  - w)/2;
    var y= (screen.height - h)/2;
  }
  else
  {
    var x= screen.availLeft + (screen.availWidth  - w)/2;
    var y= screen.availTop +  (screen.availHeight - h)/2;
  }
  var finestra= window.open(url, 'blank_', 'Width='+w+',Height='+h+', screenX='+x+',screenY='+y+', toolbar=no,directories=no,location=no,status=yes,menubar=no,copyhistory=no,scrollbars=yes,resizable=yes');
  finestra.moveTo(x,y);
}

function MV_LIB_popup_auto1(url)
{
  var w= window.innerWidth;
  var h= window.innerHeight;
  MV_LIB_popup_size1(url, w, h);
}

function MV_LIB_popup_hidden(url)
{
  var finestra= window.open(url,'_blank','width=10,height=10,screenX=2500,screenY=2500,alwaysLowered=yes,toolbar=no,directories=no,location=no,status=no,menubar=no,copyhistory=no,scrollbars=no,resizable=no');
}

function MV_LIB_popup_autocenter()
{
  agt= navigator.userAgent.toLowerCase();
  is_ie= ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
  if (is_ie)
  {
    return;
    w= document.width;
    h= document.height;
    var x= (screen.width  - w)/2;
    var y= (screen.height - h)/2;
  }
  else
  {
    w= window.outerWidth;
    h= window.outerHeight;
    var x= screen.availLeft + (screen.availWidth  - w)/2;
    var y= screen.availTop +  (screen.availHeight - h)/2;
  }
  window.moveTo(x,y);
}
