//-------------------------------------------------------
function OpenWindow(url,x,y,height,width,padding,modal,scrollbars,resizable)
{ 
  var params = "";
  
  if (padding < 0)
    padding = screen.availWidth/4;  
  
  if (height > 0)
    params += ",height=" + height;
  else
  {
    height = screen.availHeight - padding;
    params += ",height=" + height;   
  }

  if (width > 0)
    params += ",width=" + width;
  else
  { 
    width = screen.availWidth - padding;
    params += ",width=" + width;
  }
   
  width = Math.min(screen.availWidth, width);  
  height = Math.min(screen.availHeight, height);
    
  if (x<0)
    // Centrato X
    x = (screen.availWidth - width) / 2 ;
   
  if (y<0)
    // Centrato Y
    y = (screen.availHeight - height) / 2;
 
  params += ",left=" + x; 
  params += ",top=" + y;
        
  if (scrollbars)  
    params += ",scrollbars=yes";
  else
    params += ",scrollbars=no";  
  
  if (resizable)  
    params += ",resizable=yes";
  else
    params += ",resizable=no";
  
  if (params != "")
    params = params.substr(1);
  
	window.open(url, "_blank", params+",location=no,menubar=no,toolbar=no,status=yes");	
}

function MessaggioConferma()
{
 return confirm('Confermare l\'operazione?');
}

function switchMenu(obj) 
{
  var el = document.getElementById(obj);
  if ( el.style.display != 'none' ) 
  {
    el.style.display = 'none';
  }
  else 
  {
    el.style.display = '';
  }
}
