//#############################################################
//####    Verifica  formatação do campo como aaa@bbb.cc    ####
//####         Retorna true se for um E-Mail valido        ####
//####        Retorna false nao for um E-Mail valido       ####
//#############################################################
function IsValidEmail( Value ){
var i, Current, Tmp
var Array = Value.split( '@' , 3 );

// Se tiver mais ou menos que 1 Arroba ou nao tiver nada antes ou apos o Arroba
if( Array.length != 2 || Array[0] == '' || Array[1] == '' )
	return false;

Tmp = Array[0];
// Se contiver caracteres especiais antes do Arroba
for(i=0; i < Tmp.length ;i++)
	{
	Current =  Tmp.charAt(i);
	if( (Current < '0' || Current > '9') && (Current < 'A' || Current > 'Z') && (Current < 'a' || Current > 'z') && Current != '_' && Current != '-' && Current != '.' )
		return false;			
	}

Tmp = Array[1];
// Se contiver caracteres especiais depois do Arroba
for(i=0; i < Tmp.length ;i++)
	{
	Current =  Tmp.charAt(i);
	if( (Current < '0' || Current > '9') && (Current < 'A' || Current > 'Z') && (Current < 'a' || Current > 'z') && Current != '.' && Current != '_' && Current != '-' )
		return false;			
	}

Tmp = Tmp.split( '.' , 4 );
// Se depois do arroba existir menos de 2 ou mais de 3 pontos
if( Tmp.length != 2 && Tmp.length != 3 )
	return false;

// Se depois do arroba existir menos de 2 ou mais de 3 pontos
if( Tmp.length == 2 && (Tmp[0] == '' || Tmp[1] == '') )
	return false;

// Se depois do arroba existir menos de 2 ou mais de 3 pontos
if( Tmp.length == 3 && (Tmp[0] == '' || Tmp[1] == '' || Tmp[2] == '') )
	return false;

return true
}

//Function to open pop up window
function openWin(theURL,winName,features) {
  	window.open(theURL,winName,features);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function abre(pedido){
	window.location.href = 'exibe_boleto.asp?txt_cod='+pedido;
}

function CheckEmpty(Item, Nome)
{
  if (Item.value == "") {
    alert("O campo \"" + Nome + "\" não pode ser nulo.");
    Item.focus();
    return(true);
  }
} // end CheckEmpty

function CheckLen(Item, Menor, Maior, Nome)
{
  if (Item.value.length < Menor) {
    alert("O campo \"" + Nome + "\" deve ter no mínimo " + Menor + " caracteres.");
    Item.focus();
    return(true);
  }

  if (Item.value.length > Maior) {
    alert("O campo \"" + Nome + "\" deve ter no máximo " + Maior + " caracteres.");
    Item.focus();
    return(true);
  }
} // end CheckLen

function CheckString(Item, StringOK, StringMust, Nome)
{
  var CheckStr = Item.value;
  var StrValid = true;

  // Testa StringOK
  for (i = 0;  i < CheckStr.length;  ++i) {
    for (j = 0;  j < StringOK.length;  ++j)
      if (CheckStr.charAt(i) == StringOK.charAt(j))
        break;
    if (j == StringOK.length) {
      StrValid = false;
      break;
    }
  }
  if (!StrValid) {
    alert("O campo \"" + Nome + "\" contém caracteres inválidos.");
    Item.focus();
    return(true);
  }

  // Testa StringMust
  for (i = 0; i < StringMust.length; ++i) {
    for (j = 0; j < CheckStr.length; ++j)
      if (StringMust.charAt(i) == CheckStr.charAt(j))
        break;
    if (j == CheckStr.length) {
      StrValid = false;
      break;
    }
  }
  if (!StrValid) {
    alert("O campo \"" + Nome + "\" não é válido.");
    Item.focus();
    return(true);
  }

} // end CheckString

function checaDados(){
var Letras = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOZsozYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
var Espacos = " \t\r\n\f";
var Numeros = "0123456789";

if (document.cadastro.preenche.value == "sim") {
	if (document.cadastro.txt_nome.value == "") {
		alert("O campo Nome não pode ser em branco!");
		document.cadastro.txt_nome.focus();
		return false;
		}
	
	if (document.cadastro.txt_telefone.value == "") {
		
		alert("O campo telefone não pode ser em branco!");
		document.cadastro.txt_telefone.focus();
		return false;
		}
	
	if (document.cadastro.txt_nascimento.value == "") {
		
		alert("O campo data de nascimento não pode ser em branco!");
		document.cadastro.txt_nascimento.focus();
		return false;
		}
		
	if (document.cadastro.txt_cpf_cgc.value == "") {
		
		alert("O campo CPF/CGC não pode ser em branco!");
		document.cadastro.txt_cpf_cgc.focus();
		return false;
		}
	
	if (!Verifica_CPF())
		return false;
		
	if (document.cadastro.txt_email.value == "") {
		
		alert("O campo E-mail não pode ser em branco!");
		document.cadastro.txt_email.focus();
		return false;
		}		
		
		
	if (document.cadastro.txt_senha.value == "") {
		
		alert("O campo senha não pode ser em branco!");
		document.cadastro.txt_senha.focus();
		return false;
		}
			
	if (document.cadastro.txt_senha2.value == "") {
		
		alert("O campo senha não pode ser em branco!");
		document.cadastro.txt_senha2.focus();
		return false;
		}
		
	if (document.cadastro.txt_senha2.value != document.cadastro.txt_senha.value) {
		
		alert("A Senha deve ser igual!");
		document.cadastro.txt_senha2.focus();
		return false;
		}	
	
	
	if (document.cadastro.txt_rua.value == "") {
		
		alert("O campo rua não pode ficar em Branco");
		document.cadastro.txt_rua.focus();
		return false;
		}
	
	if (document.cadastro.txt_numero.value == "") {
		
		alert("O campo número não pode ficar em Branco!");
		document.cadastro.txt_numero.focus();
		return false;
		}
	
	if (document.cadastro.txt_bairro.value == "") {
		
		alert("O campo Bairro não pode ser em branco!");
		document.cadastro.txt_bairro.focus();
		return false;
		} 
	
	
	if (document.cadastro.txt_cidade.value == "") {
		
		alert("O campo cidade não pode ser em branco!");
		document.cadastro.txt_cidade.focus();
		return false;
		}
	
	if (document.cadastro.cod_estado.value == "") {
		
		alert("O campo estado não pode ser em branco!");
		document.cadastro.cod_estado.focus();
		return false;
		}
	
	if (document.cadastro.txt_cep.value == "") {
		
		alert("O CEP não pode ser em branco!");
		document.cadastro.txt_cep.focus();
		return false;
		}
	if (CheckString(document.cadastro.txt_cep, Numeros, "", "CEP"))
		return false;
}
}

function Verifica_CPF() {
	s = document.cadastro.txt_cpf_cgc.value;
	if (s == "") {

		alert("Por favor, forneça o seu cpf.");
		document.cadastro.txt_cpf_cgc.focus();
		return false;

	}

	var varFirstChr = s.charAt(0);
	var vaCharCPF = false;

	for ( var i=0; i<=10; i++ ) { 
		var c = s.charAt(i)
         if (s.charAt(i) < "0" || s.charAt(i) > "9")
		 { 
		alert("CPF inválido! Preencha o CPF utilizando apenas os números." );
		document.cadastro.txt_cpf_cgc.value="";
		document.cadastro.txt_cpf_cgc.focus();
		return false;
	     } 
             if( c!=varFirstChr ) vaCharCPF = true; 
	} 

        if( !vaCharCPF ) { 
		alert("CPF inválido!");
		document.cadastro.txt_cpf_cgc.value="";
		document.cadastro.txt_cpf_cgc.focus();
		return false;
        } 	

	soma=0;
	for ( i=0; i<9; i++ ) { 
		soma += (10-i) * ( eval(s.charAt(i)) );	
	} 
	digito_verificador = 11-(soma % 11);
	if ( (soma % 11) < 2 ) digito_verificador = 0;
	if ( eval(s.charAt(9)) != digito_verificador ) {
		alert("CPF inválido!" );
		document.cadastro.txt_cpf_cgc.value="";
		document.cadastro.txt_cpf_cgc.focus();
		return false;
	} 
	soma=0;
	for ( i=0; i<9; i++ ) {
		soma += (11-i) * ( eval(s.charAt(i)) ); 
	}
	soma += 2 * ( eval(s.charAt(9)) );
	digito_verificador = 11-(soma % 11);
	if ( (soma % 11) < 2 ) digito_verificador = 0;
	if ( eval(s.charAt(10)) != digito_verificador ) { 
		alert("CPF inválido!" ); 
		document.cadastro.txt_cpf_cgc.value="";
		document.cadastro.txt_cpf_cgc.focus();
		return false; 
	} 
	
	return true;

}

// FIM Verifica CPF

function PegaCEPCadastro(){
    var cadastro = document.cadastro;
    var Numeros = "0123456789";
    if (cadastro.txt_cep.value == "") {
        alert("O CEP não pode ser em branco!");
        document.cadastro.txt_cep.focus();
        return false;
    } else {
        if (CheckString(document.cadastro.txt_cep, Numeros, "", "CEP"))
	        return false;
        else
        {
         cadastro.preenche.value = "nao";
         cadastro.action = "cadastro.asp";
         cadastro.submit();
         return true;
        } 
    }
}

function checaDadosCesta(num){
	var Letras = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&#402;&#352;&#338;&#381;&#353;&#339;&#382;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
	var Espacos = " \t\r\n\f";
	var Numeros = "0123456789";
	var theElements = pedido.tags("INPUT");
	for (cont = 0; cont < theElements.length; cont++) {
		if ((theElements[cont].type == "text")) {
			nome = theElements[cont].name;
			if (nome.substr(0, 2) == "qt") {
				if (theElements[cont].value == "") {
					alert("É necessário digitar quantos unidades você deseja deste produto.");
					theElements[cont].focus();
					return false;
				}

				if (CheckString(theElements[cont], Numeros, "", "Quantidade")) {
					return false;
				}
				if (theElements[cont].value < num) {
					alert("É necessário digitar uma quantidade maior que "+ (num-1));
					theElements[cont].focus();
					return false;
					
				}	
				
			}
		}
	}	
	return true;	
}

function enviaForm(destino){
	var cadastro = document.pedido;
	var Numeros = "0123456789";
	if (destino == "fecha_pedido.asp"){
		//if (checaDadosCesta(1)){
		    if (cadastro.valCompra.value <= 10) {
				alert("Valor mínimo por compra: R$10,00!");
			} else {
				//if ((cadastro.regiao.value == "cesta.asp?cod=0")){
		 		//	alert("Favor escolher a Região de Entrega!");
				//	cadastro.regiao.focus();					
				//} else {
				
					cadastro.action = destino;
					cadastro.submit();					
				
				//}
				
			}
		//}
	} else {
		cadastro.action=destino;
		cadastro.submit();
	}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; 
  document.MM_sr=new Array; 
  for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
     document.MM_sr[j++]=x; 
	if(!x.oSrc) x.oSrc=x.src; 
	x.src=a[i+2];
  }
}

function checaDadosProdutos(){
	var Letras = ". ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzfSOZsozYÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
	var Espacos = " \t\r\n\f";
	var Numeros = "0123456789";
	
	if (document.produto.flgPersonalizar.value == "S")
	{
		if (document.produto.nomePer.value == ""){
		
		alert("É necessário digitar o nome para personalizar a camisa.\nOu compre seu produto na Categoria 'Camisas Oficiais'.");
		document.produto.nomePer.focus();
		return false;
		}
		if (CheckString(document.produto.nomePer, Letras, "", "Nome Personalizado (Somente Letras)"))
			return false;
	}
	if (document.produto.codTamanho.value == "") {
		alert("Escolha o TAMANHO do produto!");
		document.produto.codTamanho.focus();
		return false;
		}
		
	if (document.produto.codCor.value == "") {
		
		alert("Escolha a COR do produto!");
		document.produto.codCor.focus();
		return false;
		}
	
	if (document.produto.qt.value == "") {
		
		alert("Informe uma QUANTIDADE de produtos.");
		document.produto.qt.focus();
		return false;
		}
		
	if (CheckString(document.produto.qt, Numeros, "", "Quantidade"))
		return false;

	if (document.produto.qt.value < 1) {
		
		alert("Informe uma QUANTIDADE maior que ZERO.");
		document.produto.qt.focus();
		return false;
		}
	if (document.produto.txt_numero_camiseta.value == "*") {
		
		alert("Escolher um NÚMERO de camiseta.");
		document.produto.txt_numero_camiseta.focus();
		return false;
		}		
}

function checaDadosCadastroVer(){
var Letras = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþ";
var Espacos = " \t\r\n\f";
var Numeros = "0123456789";

if (document.cadastro.preenche.value == "sim") {
	if (document.cadastro.txt_nome.value == "") {
		alert("O campo Nome não pode ser em branco!");
		document.cadastro.txt_nome.focus();
		return false;
		}
	
	if (document.cadastro.txt_email.value == "") {
		alert("O campo E-mail não pode ser em branco!");
		document.cadastro.txt_email.focus();
		return false;
		}
	
	if (document.cadastro.txt_telefone.value == "") {
		alert("O campo telefone não pode ser em branco!");
		document.cadastro.txt_telefone.focus();
		return false;
		}
	
	if (document.cadastro.txt_nascimento.value == "") {
		alert("O campo data de nascimento não pode ser em branco!");
		document.cadastro.txt_nascimento.focus();
		return false;
		}
	
	if (document.cadastro.txt_cpf_cgc.value == "") {
		alert("O campo CPF/CGC não pode ser em branco!");
		document.cadastro.txt_cpf_cgc.focus();
		return false;
		}
		
	if (!Verifica_CPF())
		return false;	
		
	if (document.cadastro.txt_senha.value == "") {
		alert("O campo senha não pode ser em branco!");
		document.cadastro.txt_senha.focus();
		return false;
		}
			
	if (document.cadastro.txt_senha2.value == "") {
		alert("O campo senha não pode ser em branco!");
		document.cadastro.txt_senha2.focus();
		return false;
		}
		
	if (document.cadastro.txt_senha2.value != document.cadastro.txt_senha.value) {
		alert("A Senha deve ser igual!");
		document.cadastro.txt_senha2.focus();
		return false;
		}	
	
	if (!document.cadastro.filhos(0).checked)
	{
		if (document.cadastro.txt_qt_filhos.value == "") {
			alert("É necessário digitar a quantidade de  Filhos!");
			document.cadastro.txt_qt_filhos.focus();
			return false;
			}
		if (document.cadastro.dth_filho_01.value == "") {
			alert("É necessário digitar a idade de, pelo menos, um filho(a)!");
			document.cadastro.dth_filho_01.focus();
			return false;
			}
	}
}
}

function checaDadosFechaPedido(){
	
	if (document.form.formpagto(0).checked == true) {
		
		if (document.form.cartao_titular.value == "") {
			
			alert("O Nome do Titular não pode ser em branco!");
			document.form.cartao_titular.focus();
			return false;
			}
		if (document.form.digito.value == "") {
			
			alert("O Dígito não pode ser em branco!");
			document.form.digito.focus();
			return false;
			}
		
		if (document.form.digito.length < 3) {
			
			alert("O Dígito deve conter 3 números.");
			return false;
		}
			
		//Verifica o numero dos cartoes (se nao válidos)
		
		if (!CheckCardNumber(form)){
			
			return false;
		}
		
	}
}

function abrejan(valor, nr_pedido, nome_sacado, doc_sacado, data_emissao, data_vencto){	
	window.open('http://comercio.locaweb.com.br/comercio.comp?valor='+ valor +'&banco=itau&agencia=0268&carteira=175&codigo_cedente=262227&numdoc='+ nr_pedido +'&conta=timesmania-itau&sacado='+ nome_sacado +'&cgccpfsac='+ doc_sacado +'&datadoc='+ data_emissao +'&vencto='+ data_vencto +'&instr1=Entrega+em+3+dias+ap%F3s+a+confirma%E7%E3o%2E')
}
function abrejanSantos(url){	
	window.open('https://mup.comercioeletronico.com.br/sepsboleto/004500024/prepara_pagto.asp?merchantid=004500024&orderid='+url,'pagamento', 'toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,menubar=no,width=750,height=510,left=0,top=0');
}

function checaDadosEnderecoEdita(){
var Numeros = "0123456789";
if (document.cadastro.preenche.value == "sim") {
if (document.cadastro.txt_nome_ender.value == "") {
	alert("O Nome do Endereço não pode ficar em Branco");
	document.cadastro.txt_nome_ender.focus();
	return false;
	}
	
if (document.cadastro.txt_rua.value == "") {
	alert("O campo rua não pode ficar em Branco");
	document.cadastro.txt_rua.focus();
	return false;
	}

if (document.cadastro.txt_numero.value == "") {
	alert("O campo número não pode ficar em Branco!");
	document.cadastro.txt_numero.focus();
	return false;
	}

if (document.cadastro.txt_bairro.value == "") {
	alert("O campo Bairro não pode ser em branco!");
	document.cadastro.txt_bairro.focus();
	return false;
	}

if (document.cadastro.txt_cidade.value == "") {
	alert("O campo cidade não pode ser em branco!");
	document.cadastro.txt_cidade.focus();
	return false;
	}

if (document.cadastro.txt_cep.value == "") {
	alert("O CEP não pode ser em branco!");
	document.cadastro.txt_cep.focus();
	return false;
	}
	
if (CheckString(document.cadastro.txt_cep, Numeros, "", "CEP"))
    return false;
    }   
}

function PegaCEPEnderecoEdita(){
    var cadastro = document.cadastro;
    var Numeros = "0123456789";
    if (cadastro.txt_cep.value == "") {
        alert("O CEP não pode ser em branco!");
        document.cadastro.txt_cep.focus();
        return false;
    } else {
        if (CheckString(document.cadastro.txt_cep, Numeros, "", "CEP"))
	        return false;
        else
        {
         cadastro.preenche.value = "nao";
         cadastro.action = "endereco_edita.asp";
         cadastro.submit();
         return true;
        } 
    }
}

function PegaCEPEnderecoCadastra(){
    var cadastro = document.cadastro;
    var Numeros = "0123456789";
    if (cadastro.txt_cep.value == "") {
        alert("O CEP não pode ser em branco!");
        document.cadastro.txt_cep.focus();
        return false;
    } else {
        if (CheckString(document.cadastro.txt_cep, Numeros, "", "CEP"))
	        return false;
        else
        {
         cadastro.preenche.value = "nao";
         cadastro.action = "endereco_cadastra.asp";
         cadastro.submit();
         return true;
        } 
    }
}

function validaFaleConosco(){
	var form = document.form;
	var Numeros = "0123456789";
	if (form.nome.value == "") {
        alert("O NOME não pode ser em branco!"); form.nome.focus(); return false;
    }
	if (form.email.value == "") {
        alert("O E-MAIL não pode ser em branco!"); form.email.focus(); return false;
    }
	if (!IsValidEmail(form.email.value)) {
        alert("O E-MAIL é inválido!"); form.email.focus(); return false;
    }
	if (form.codigo_DDD.value == "") {
        alert("O DDD não pode ser em branco!"); form.codigo_DDD.focus(); return false;
    }
	if (CheckString(form.codigo_DDD, Numeros, "", "DDD"))
		return false;
	
	if (form.codigo_DDD.value.length < 2) {
        alert("O DDD deve ter 2 caracteres!"); form.codigo_DDD.focus(); return false;
    }
	if (form.Numero_telefone.value == "") {
        alert("O TELEFONE não pode ser em branco!"); form.Numero_telefone.focus(); return false;
    }
	if (CheckString(form.Numero_telefone, Numeros, "", "TELEFONE"))
		return false;
	
	if (form.Numero_telefone.value.length < 8) {
        alert("O TELEFONE deve ter 8 caracteres!"); form.Numero_telefone.focus(); return false;
    }
	if (form.Assunto.value == "") {
        alert("O ASSUNTO não pode ser em branco!"); form.Assunto.focus(); return false;
    }
	if (form.Observacao.value == "") {
        alert("A MENSAGEM não pode ser em branco!"); form.Observacao.focus(); return false;
    }
}

function validaEsqueciSenha(){
	var form = document.senha;
	if (form.email.value == "") {
        alert("O E-MAIL não pode ser em branco!"); form.email.focus(); return false;
    }
	if (!IsValidEmail(form.email.value)) {
        alert("O E-MAIL é inválido!"); form.email.focus(); return false;
    }
}

function validaLogar(){
	var form = document.login;
	if (form.login.value == "") {
        alert("O E-MAIL não pode ser em branco!"); form.login.focus(); return false;
    } else {
		var txt = form.login.value;
	
		/////////////////////////////////////////////////////////////////////////////////
			prim = form.login.value.indexOf("@")
			strEmail = form.login
			if(prim < 2) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("@",prim + 1) != -1) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf(".") < 1) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf(" ") != -1) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("zipmeil.com") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("hotmeil.com") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf(".@") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("@.") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf(".com.br.") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("/") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("[") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("]") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("(") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf(")") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
			if(strEmail.value.indexOf("..") > 0) {
				alert('O e-mail informado está incorreto.');
				strEmail.focus();
				return false;
			}
		/////////////////////////////////////////////////////////////////////////////////
	}
	if (form.senha.value == "") {
        alert("A SENHA não pode ser em branco!"); form.senha.focus(); return false;
    }
}

function validaBusca(){
	var form = document.busca;
	if (form.palavra.value == "") {
        alert("Digite uma palavra para efetuar a sua busca."); form.palavra.focus(); return false;
    }	
}

function validaNewsletter(){
	var form = document.newsletter;
	/*
	if (form.ds_time.value == "") {
        alert("Escolha um TIME!"); form.ds_time.focus(); return false;
    }
    if (form.ds_time.value == "Outro"){
        if ((form.ds_time_outro.value == "") || (form.ds_time_outro.value == "Digite aqui o seu Time")) {
            alert("Escolha um TIME!"); form.ds_time_outro.focus(); return false;
        }
    }
	*/
	if ((form.ds_nome.value == "") || (form.ds_nome.value == "Digite aqui o seu nome")) {
        alert("O NOME não pode ser em branco!"); form.ds_nome.focus(); return false;
    }
	if ((form.ds_email.value == "") || (form.ds_email.value == "Digite aqui o seu e-mail")) {
        alert("O E-MAIL não pode ser em branco!"); form.ds_email.focus(); return false;
    }
	if (!IsValidEmail(form.ds_email.value)) {
        alert("O E-MAIL é inválido!"); form.ds_email.focus(); return false;
    }
    
    /*
    if (form.ds_time.value == "Outro"){
        if ((form.ds_time_outro.value != "") && (form.ds_time_outro.value != "Digite aqui o seu Time")) {
            var parametro1 = $F('ds_time_outro'); //recuperação de parametro
        }
    } else {
        var parametro1 = $F('ds_time'); //recuperação de parametro
    }
	
    var parametro2 = $F('ds_nome'); //recuperação de parametro
	var parametro3 = $F('ds_email'); //recuperação de parametro
	var url        = 'newsletter_source.asp'; //arquivo de destino
	var parametros = 'ds_nome='+ parametro2 +'&ds_email='+ parametro3 ; //montagem dos parametros
	
	var myAjax = new Ajax.Updater(
		'conteudo_news', //div que mostrará o retorno em html
		url, 
		{
			method: 'get', 
			parameters: parametros				
		});
	
	return false;   
	*/
}