function ConsisteTamanho(campo,tamanho)
{
	tam = campo.value.length;
	if (tam > tamanho)
	{
		campo.value = campo.value.substring(0,tamanho);
	}
}

function reloadAndClose()
{
	window.opener.Reload();
	window.close();
}
function Confirmar()
{
	var nexttime = false;
	if(Question("Deseja utilizar o assistente na pr" + String.fromCharCode(243) + "xima vez que efetuar login?") ) 	nexttime = true;
	
	window.parent.salvaAssistente( nexttime  );
}

/*function DesabilitaMenu()
{
	window.parent.menuHabilitado = false;
}

function HabilitaMenu(valor)
{
	window.parent.menuHabilitado = true;
	parent.menu.window.location='menu.aspx?MenuHide=true&menuselecionado=lnkMovFinanceira&exibirassistente=' + valor;
}

function Confirmar(pFormulario)
{
	var nexttime = false;
	if(Question("Deseja utilizar o assistente na pr" + String.fromCharCode(243) + "xima vez que efetuar login?",pFormulario))
	nexttime = true;
	HabilitaMenu(nexttime);
}

function VoltarAssistente(ProximaPagina)
{
	window.parent.frames("topo").document.getElementById("hdnURLBase").value = ProximaPagina;
	if (window.parent.frames("topo").document.getElementById("imgVoltarAssistente").style.display=='none')
		window.parent.frames("topo").document.getElementById("imgVoltarAssistente").style.display='';
	else 
		window.parent.frames("topo").document.getElementById("imgVoltarAssistente").style.display='none';	
}*/

function MoneyToFloat(valor)
{
	return valor.replace (/[^,.0-9\-]/g, '');
}

function FloatToMoney(valor)
{
	if (valor.indexOf('-') != -1)
	{
		valor = valor.replace (/[\-]/g, "(");
		valor+= ")";
	}
	return valor;
}
function line_over()
{
	var tr,td;
	tr = event.srcElement.parentElement;
	if (tr.tagName != "TR") tr = tr.parentElement;
	for(i=0;i<tr.children.length;i++)
	{
		td = tr.children[i];
		td.oldclassName = td.className;
		td.className = "repeater_highlight";
	}
}

function line_out()
{
	var tr,td;
	tr = event.srcElement.parentElement;
	if (tr.tagName != "TR") tr = tr.parentElement;
	for(i=0;i<tr.children.length;i++)
	{
		td = tr.children[i];
		td.className = td.oldclassName;
	}
}

function PopupMunicipio(municipio)
{
	wnd = window.open('/geral/municipio_pesquisar.aspx?txtMunicipio=' + municipio,'PopupMunicipio','width=395,height=330');	
	wnd.focus();
}

function PopupBanco()
{
	wnd = window.open('/cliente/movimentofinanceiro/banco_pesquisar.aspx','PopupBanco','width=395,height=330');	
	wnd.focus();
}

/******************************************************************PROCESSANDO************************************************************/
var contPontos = 0;
var strPontos = new String();
function RotinaSalvamento()
{
	document.getElementById("DivVisibleBotton").style.display = 'none';
	window.setTimeout( "Pontinhos()", 250);
}
function Pontinhos()
{
	++contPontos;
	strPontos = "";
	if (contPontos == 4) contPontos = 0;
	for ( i = 0; i < contPontos; ++i) 
	{
		strPontos += ".";
	}
	document.getElementById("DivOculta").innerHTML = "<font size=2 color=red><b>Processando " + strPontos + " </b></font>"
	window.setTimeout( "Pontinhos()", 250);
}

/* Dados do assistente, favor não modificar*/
var paginaRetornoAssistente = '';

hoje = new Date();
dia = hoje.getDate();
dias = hoje.getDay();
mes = hoje.getMonth();
ano = hoje.getYear();

if (ano < 2000) ano = "19" + ano;

function NArray(n)
{
	this.length = n;
}

NomeDia = new NArray(7);
NomeMes = new NArray(12);

NomeDia[0] = "Domingo";
NomeDia[1] = "Segunda-feira";
NomeDia[2] = "Terça-feira";
NomeDia[3] = "Quarta-feira";
NomeDia[4] = "Quinta-feira";
NomeDia[5] = "Sexta-feira";
NomeDia[6] = "Sábado";
NomeMes[0] = "Janeiro";
NomeMes[1] = "Fevereiro";
NomeMes[2] = "Marco";
NomeMes[3] = "Abril";
NomeMes[4] = "Maio";
NomeMes[5] = "Junho";
NomeMes[6] = "Julho";
NomeMes[7] = "Agosto";
NomeMes[8] = "Setembro";
NomeMes[9] = "Outubro";
NomeMes[10] = "Novembro";
NomeMes[11] = "Dezembro";

function WriteDate()
{
	document.write(NomeDia[dias] + ", " + dia + " de " + NomeMes[mes] + " de " + ano);
}

function Extress()
{
	document.getElementById("Rodape1_btnCadastrarExpress").focus();
}

function AbrirChat()
{
	window.open('Chat_BemVindo_Cliente.aspx','ChatCliente','status=no, scrollbar=no, width=460, height=460, top=100, left=300');
}

function Abrirtela()
{
	window.open('http://www.financeiro24horas.com/Contabilista_Cadastro_Cliente.aspx?AmbientePublico=1','_blank','width=590,height=400,middle=0,right=0');	
}
function Abrirpopup()
{
	window.open('http://www.financeiro24horas.com/publico/cadastro/cadastropublico_contabilista.aspx','_blank','width=590,height=400,middle=0,right=0');
}
function Abrirpagina()
{
	window.open('http://www.financeiro24horas.com/esqueci_login.aspx','_blank','width=590,height=400,middle=0,right=0');
}

function Abrirpag()
{
	window.open('http://www.financeiro24horas.com/contabilistas.asp','_blank','width=590,height=400,middle=0,right=0');
}
function Abrircrc()
{
	window.open('http://www.financeiro24horas.com/Conquistas.htm','_blank','width=590,height=600,top=0,right=0,scrollbars=yes' );
}