/***********************************/
function MHValidacao(n) {
    this.apto = 0;
	if(isNaN(n))
		this.apto = 1;
	else if (n.length!=11)
		this.apto = 2;
}
/***********************************/
function MHCC() {
	this.erro = {
		e01: "HSBC BANK BRASIL S.A. - BANCO MÚLTIPLO\n\n"+
		"As informações digitadas são inválidas.\n\n"+
		"Por favor, tente novamente.",
		e02: "HSBC BANK BRASIL S.A. - BANCO MÚLTIPLO\n\n"+
		"Este campo deve ser preenchido com sua conta corrente\n"+
		"e possui 11 caracteres. Por favor, digite novamente."
	}
	this.campo = "CONTAHSBC";
	this.id = "MeuHSBC";
}
/***********************************/
function MHCPF() {
	this.erro = {
		e01: "HSBC BANK BRASIL S.A. - BANCO MÚLTIPLO\n\n"+
		"As informações digitadas são inválidas.\n\n"+
		"Por favor, tente novamente.",
		e02: "HSBC BANK BRASIL S.A. - BANCO MÚLTIPLO\n\n"+
		"Este campo deve ser preenchido com seu CPF\n"+
		"e possui 11 caracteres. Por favor, digite novamente."
	}
	this.campo = "cpf";
	this.id = "ACESSOLANDPAGE";
}
/***********************************/
function MHAcesso(classe, item) {
	this.elemento = item;
	var tipos = new (eval(classe))();
	var validacao = new MHValidacao(this.elemento.value);
	if(validacao.apto == 0) {
		var url = "/cgi-bin/cb_redirect.cgi?ID="+tipos.id+"&PARMS="+escape(tipos.campo+"="+item.value)+"&CANAL=internet";
		parent.location.href=url;
	}
	if(validacao.apto == 1) alert(tipos.erro.e01);
	if(validacao.apto == 2) alert(tipos.erro.e02);
	this.elemento.focus();
	this.elemento.value="";
}
/***********************************/

