/* -------------------------------------------------- */
/* SOURCE CODE                                        */
/* -------------------------------------------------- */
/**
*
* @copyright Copyright (c) 2007, NETCRIATIVA
*
*/

function abrirJanela()
{
	var file   = 'loteamento.php';
	var name   = 'Loteamento';
	var width  = 795;
	var height = 612;

	// Certifica-se de que uma dimensão de tela existe
	screen_width  = 800;
	screen_height = 600;

	// Dimensões da tela do usuário
	if (screen) if (screen.width)  screen_width  = screen.width;
	if (screen) if (screen.height) screen_height = screen.height;

	// Calcula a posição da janela no centro
	window_left = (screen_width / 2) - (width / 2);
	window_top  = (screen_height / 2) - (height / 2);

	// Abre janela
	if (window)
	{
		if (window.open)
		{
			w = window.open(file, name, 'width=' + width + ', height=' + height + ', left=' + window_left + ', top=' + window_top + ', screenX=' + window_left + ', screenY=' +  window_top + ', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, menubar=no');

			if (w.moveTo)
			w.moveTo(window_left, window_top);

			if (w.focus)
			w.focus();

			return w;
		}
	}
}

function abrirLote(file)
{
	var name   = 'Lote';
	var width  = 464;
	var height = 484;

	// Certifica-se de que uma dimensão de tela existe
	screen_width  = 800;
	screen_height = 600;

	// Dimensões da tela do usuário
	if (screen) if (screen.width)  screen_width  = screen.width;
	if (screen) if (screen.height) screen_height = screen.height;

	// Calcula a posição da janela no centro
	window_left = (screen_width / 2) - (width / 2);
	window_top  = (screen_height / 2) - (height / 2);

	// Abre janela
	if (window)
	{
		if (window.open)
		{
			w = window.open(file, name, 'width=' + width + ', height=' + height + ', left=' + window_left + ', top=' + window_top + ', screenX=' + window_left + ', screenY=' +  window_top + ', toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, menubar=no');

			if (w.moveTo)
			w.moveTo(window_left, window_top);

			if (w.focus)
			w.focus();

			return w;
		}
	}
}

/* -------------------------------------------------- */