<!--

/*
 **************************************************************************
 *
 *  windows.js
 *  Copyright (c) 2006. Emerson de Almeida Carneiro.
 *
 *  Projeto.: e-Softcheque
 *  Autor...: Emerson de Almeida Carneiro
 *  Internet: http://www.fteam.com
 *  E-mail..: e.carneiro@fteam.com
 *  Iniciado: 29/04/2006
 *  Revisado: 04/05/2006
 *
 *  Conjunto de rotinas de tratamento e exibição de janelas.
 *
 **************************************************************************
 */

/*
 **************************************************************************
 *
 *  newAppWindow
 *  Abre uma janela de aplicativo no navegador utilizado.
 *
 **************************************************************************
 */
function newAppWindow(url, name) {
  var str;
  var ah = 480;
  var aw = 640;
  var xc = 10;
  var yc = 10;

  if (window.screen) {
    if (screen.availHeight <= 600) {
      ah = (screen.availHeight * 90) / 100;
      yc = (screen.availHeight - ah) / 3;
    } else {
      ah = (screen.availHeight * 80) / 100;
      yc = (screen.availHeight - ah) / 3;
    }
    if (screen.availWidth <= 800) {
      aw = (screen.availWidth * 90) / 100;
      xc = (screen.availWidth - aw) / 2;
    } else {
      aw = (screen.availWidth * 80) / 100;
      xc = (screen.availWidth - aw) / 2;
    }
  }

  str  = "height=" + ah;
  str += ",innerHeight=" + ah;
  str += ",width=" + aw;
  str += ",innerWidth=" + aw;
  str += ",left=" + xc;
  str += ",screenX=" + xc;
  str += ",top=" + yc;
  str += ",screenY=" + yc;
  str += ",hotkeys=0";
  str += ",menubar=0";
  str += ",resizable=1";
  str += ",scrollbars=1";
  str += ",status=0";
  str += ",toolbar=0";

  return window.open(url, name, str);
  
}

/*
 **************************************************************************
 *
 *  newSingleWindow
 *  Abre uma janela não redimensionável, com altura e largura
 *  especificados, no navegador utilizado.
 *
 **************************************************************************
 */
function newSingleWindow(url, title, height, width) {
  var str;
  var xc = 10;
  var yc = 10;
  var wh = 18;
  var ww = 0;

  wh = wh + (height * 1);
  ww = ww + (width * 1);

  if (window.screen) {
    yc = (screen.availHeight - wh) / 2;
    xc = (screen.availWidth - ww) / 2;
  }

  str  = "height=" + wh;
  str += ",innerHeight=" + wh;
  str += ",width=" + ww;
  str += ",innerWidth=" + ww;
  str += ",left=" + xc;
  str += ",screenX=" + xc;
  str += ",top=" + yc;
  str += ",screenY=" + yc;
  str += ",hotkeys=0";
  str += ",menubar=0";
  str += ",resizable=0";
  str += ",scrollbars=0";
  str += ",status=0";
  str += ",toolbar=0";

  return window.open(url, title, str);
  
}

/*
 **************************************************************************
 *
 *  newWindow
 *  Abre uma janela redimensionável, com altura e largura especificados,
 *  no navegador utilizado.
 *
 **************************************************************************
 */
function newWindow(url, title) {
  var str;
  var xc = 10;
  var yc = 10;
  var wh = 400;
  var ww = 500;

  if (window.screen) {
    yc = (screen.availHeight - wh) / 2;
    xc = (screen.availWidth - ww) / 2;
  }

  str  = "height=" + wh;
  str += ",innerHeight=" + wh;
  str += ",width=" + ww;
  str += ",innerWidth=" + ww;
  str += ",left=" + xc;
  str += ",screenX=" + xc;
  str += ",top=" + yc;
  str += ",screenY=" + yc;
  str += ",hotkeys=0";
  str += ",menubar=0";
//  str += ",resizable=0";
  str += ",scrollbars=0";
  str += ",status=0";
  str += ",toolbar=0";

  return window.open(url, title, str);
  
}

/*
 **************************************************************************
 *
 * FIM DE ARQUIVO
 *
 **************************************************************************
 */

//-->
