// Abre nova Janela
function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
  toolbar_str = toolbar ? 'yes' : 'no';
  menubar_str = menubar ? 'yes' : 'no';
  statusbar_str = statusbar ? 'yes' : 'no';
  scrollbar_str = scrollbar ? 'yes' : 'no';
  resizable_str = resizable ? 'yes' : 'no';
  window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

function abre(url, name)
{     
	var str = "left=0,screenX=0,top=0,screenY=0,status=1,scrollbars=1";

     if (window.screen) {
       var ah = screen.availHeight - 50;
       var aw = screen.availWidth - 10;
       str += ",height=" + ah;
       str += ",innerHeight=" + ah;
       str += ",width=" + aw;
       str += ",innerWidth=" + aw;
     } else {
       str += ",resizable"; // redimensiona a janela para o usuário
     }

	var janela = window.open(url, name, str);

	if (!janela)
	{
		alert("Por favor, desative seu anti-popup para usar o sistema.");
	}
}

function abre2(url, name)
{     
	var str = "status=1,scrollbars=1";

     if (window.screen) {
       var ah = 600;//screen.availHeight - 50;
       var aw = 650;//screen.availWidth - 10;
       str += ",height=" + ah;
       str += ",innerHeight=" + ah;
       str += ",width=" + aw;
       str += ",innerWidth=" + aw;
	   str += ",top=" + (screen.height) ? (screen.height-ah)/2 : 0;
	   str += ",left=" + (screen.width) ? (screen.width-aw)/2 : 0;
	   str += ",screenY=" + (screen.height) ? (screen.height-ah)/2 : 0;
	   str += ",screenX=" + (screen.width) ? (screen.width-aw)/2 : 0;
     } else {
       str += ",resizable"; // redimensiona a janela para o usuário
     }

	var janela = window.open(url, name, str);

	if (!janela)
	{
		alert("Por favor, desative seu anti-popup para usar o sistema.");
	}
}
