// JavaScript Document
function abrirPagina(cUrl){
	if(document.forms[0].Logado.value == 'false'){
		alert('Você precisa logar antes de acessar os serviços.'); document.forms[0].txtUsuario.focus(); return false;}
	document.location.href = cUrl;}

function abreJanela(url)
{
	if (screen)
	{
	  sHeight = screen.availHeight
	  sWidth = screen.availWidth
	  wHeight = 1     //new window height
	  wWidth = 1      //new window width
	  wLeft = 0  //left position
	  wTop = 0 //top position
	  if(newWindow)
	  {
		newWindow.close();
		newWindow = null;
	  }
	  newWindow = window.open(url,"","left=" + wLeft + ",top=" + wTop + ",width=" + wWidth + ",height=" + wHeight + ",scrollbars=yes, menubar=yes")
	  newWindow.resizeTo(sWidth, sHeight);
	}
}

var newWindow;

function abreJanelaCentro(url, nHeight, nWidth, cAdicional){
	if(screen){
		sHeight = screen.height
		sWidth = screen.width
		wHeight = nHeight    //new window height
		wWidth = nWidth     //new window width
		wLeft = (sWidth - wWidth) / 2  //left position
		wTop = (sHeight - wHeight) / 2 //top position
		if(newWindow){
			newWindow.close();
			newWindow = null;}
		newWindow = window.open(url,"","left=" + wLeft + ",top=" + wTop + ",width=" + wWidth + ",height=" + wHeight +  cAdicional)}}
		
function VerificaNumerico(checkStr,valInteger)
{
	var allValid = true;
	if(valInteger)
		var checkOK = "0123456789"
	else
		var checkOK = "0123456789.,";
	var decPoints = 0;
	var allNum = "";
	for (k = 0; k < checkStr.length; k++)
	{
		ch = checkStr.charAt(k);
		for (j = 0; j < checkOK.length; j++)
			 if (ch == checkOK.charAt(j))
				 break;
		 if (j == checkOK.length)
		  {
			  allValid = false;
			  break;
			}
		allNum += ch;
	}
	return (allValid);
}
