function AbreBloqueto(opt)
{
	var Largura, Altura, Opcoes;
	Largura = window.screen.width - 20;
	Altura =  window.screen.height - 85;

	Opcoes = "screenX=5,screenY=5,top=5,left=5,height=" + Altura + ",width=" + Largura + ",status=yes,toolbar=no,menubar=no,location=no,resizable=yes";
	if(opt==1)
	{
		window.open("https://ww8.banrisul.com.br/brb/link/Brbw2Lhw_Bloqueto_Titulos_Internet.aspx?SegundaVia=1", "Bloqueto1", Opcoes, true);
	}
	
	if(opt==2)
	{
    	window.open("https://ww8.banrisul.com.br/brb/link/Brbw2Lhw_Bloqueto_Titulos_Internet.aspx?SegundaVia=0", "Bloqueto2", Opcoes, true);
	}
}

function DesviaDJ()
{
	if(navigator.userAgent.substring(8,9) >= "4")
	{
		var Largura, Altura, Opcoes;
		Largura = window.screen.width - 20
		Altura =  window.screen.height - 85
		Opcoes = "top=5,left=5,height=" + Altura + ",width=" + Largura + ",status=yes,toolbar=no,menubar=no,location=no,resizable=yes";
		if(navigator.userAgent.indexOf("MSIE") != -1)
			window.open("https://www.banrisul.com.br/bbz/link/djr/bbzp00ho.asp", "BBZ", Opcoes, true);
		else
			window.open("https://www.banrisul.com.br/bbz/link/djr/bbzp00ho.asp", "BBZ", Opcoes, true);
	}
	else
		alert('Para usar este serviço, por uma questão de segurança, é necessário versão 4.0 ou superior do "Microsoft Internet Explorer" ou "Netscape Communicator".');
}

function Produto(form) {
	var onde=form.escolha.selectedIndex

	if (form.escolha.options[onde].value == 'Home'){
		document.forms[0].Agencia.focus();
	}
	else if (form.escolha.options[onde].value == 'Novo Office'){
		Desvia('Office',null,null,"INTERNET");
		document.frmInternetBank.escolha.options[0].selected = true;
	}
}

function ExecOK(){
	if (document.frmInternetBank.escolha.selectedIndex == 0) {
	    if(document.frmInternetBank.escolha.options[0].value == 'Home')
	    {
		    Desvia('Home','4E', document.getElementById('Agencia').value+document.getElementById('Conta').value,'INTERNET');
		}
		else if(document.frmInternetBank.escolha.options[0].value == 'Home Banco SIM')
		{
		    Desvia('BANCOSIM','4H', document.getElementById('Agencia').value+document.getElementById('Conta').value,'INTERNET');
		}
		document.frmInternetBank.escolha.options[0].selected = true;
		document.getElementById('Agencia').value='';
		document.getElementById('Conta').value='';
	}
	else{
		alert('Escolha um serviço para realizar o acesso.')
	}
}

function ExecBanking(tipo){
	if (tipo == 'home') {
	    Desvia('Home',null, null,'INTERNET');
	}	
	else if (tipo == 'office') {
	    Desvia('Office',null,null,"INTERNET");
	}
	else if (tipo == 'antigo_office') {
	    Desvia('Antigo_Office',null,null,"INTERNET");
	}
	else if (tipo == 'vero') {
	    Desvia('Vero',null,null,"INTERNET");
    }
    else if (tipo == 'cartoesbanrisul') {
	    Desvia('CartoesBanrisul',null,null,"INTERNET");
    }
    else if (tipo == 'portalderenegociacao') {
	    Desvia('PortalDeRenegociacao',null,null,"INTERNET");
    }
	else{
		alert('Escolha um serviço para realizar o acesso.')
	}
}

function Completa(Campo,Tamanho)
{
    var Zeros = "00000000000000000000", Conteudo = Campo.value;
    var Digitos = Conteudo.length;
    if(Tamanho == null) Tamanho = Campo.maxLength;
    if(Digitos < Tamanho) Campo.value = Zeros.substring(0, Tamanho-Digitos) + Conteudo;
}

function MudaCampo(Seguinte,event,Campo)
{
	if(event.keyCode==13){
		return true;
	}
	   				
	if(Campo.value.length == Campo.maxLength){
		Seguinte.focus();
	}
		event.cancelBubble = true;
		return true;
}
function Numerico(e)
{
	var tecla;
	
	tecla  = e.keyCode;
	if (tecla == 0) //é mozilla
		tecla = e.charCode; // é para o Mozilla

	if (tecla < 30 || (tecla > 47 && tecla < 58)) 
		return;

	e.returnValue = false;				
	
	try{
		e.preventDefault();  // é para o Mozilla
		}
	catch(e){}							
}

var Lista_janela = new Array(8);
var Lista_area = new Array(8);
var Lista_link = new Array(8);
var Lista_tamanho = new Array(8);
function abreswf(ID) {
	ID = ID.toLowerCase();
		for (i = 1; i <= 8; i++)
		{
  				if (Lista_area[i] == ID)
     	 		{
					if (Lista_janela[i]=="Atual")
					{	
						window.location=Lista_link[i];
					}
					else if(Lista_janela[i]=="Popup")
					{
						window.open(Lista_link[i],'Banrisul','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no,fullscreen=no,'+Lista_tamanho[i]);
					}
					else
					{   
						window.open (Lista_link[i],"novajanela");
					} 
				}
			
		}
	}
function banner_popup(banner,altura,largura) {
	window.open(banner,'Banrisul','toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,menubar=no,fullscreen=no,width='+largura+',height='+altura);
}
