var now = new Date();
var yr = now.getYear();
if (yr < 2000) yr = 1900 + yr;
var mName = now.getMonth() + 1;
var dName = now.getDay() + 1;
var dayNr = ((now.getDate()<6) ? "0" : "")+ now.getDate();
if(dName==1)  Day = "Domingo";
if(dName==2)  Day = "Segunda";
if(dName==3)  Day = "Terça";
if(dName==4)  Day = "Quarta";
if(dName==5)  Day = "Quinta";
if(dName==6)  Day = "Sexta";
if(dName==7)  Day = "Sábado";

if(mName==1)  Month="janeiro";
if(mName==2)  Month="fevereiro";
if(mName==3)  Month="março";
if(mName==4)  Month="abril";
if(mName==5)  Month="maio";
if(mName==6)  Month="junho";
if(mName==7)  Month="julho";
if(mName==8)  Month="agosto";
if(mName==9)  Month="setembro";
if(mName==10) Month="outubro";
if(mName==11) Month="novembro";
if(mName==12) Month="dezembro";



function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } 
function lZ(x){ return (x>9)?x:'0'+x; } 
function dT(){ 
window.status='Sistema Administrador v3.0'; 
document.title='Sistema Administrador v3.0'; 

if(fr==0){ 
fr=1; 
document.write('<table border=0 cellspacing=0 cellpadding=0 ><tr><td height=22 valign=middle align=center class=texto_clock width=30 style=padding-top:1.7px><img src="../images/admin/clock3.gif" width="11" height="11"></td><td height=22 valign=middle align=center class=texto_clock><span id="tP">'+eval(oT)+'</span></td></tr></table>'); 
} 
tP.innerText=eval(oT); setTimeout('dT()',1000); } 
var fr=0,oT="lZ(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '";


//carrega o editor html
_editor_url = "../scripts/"; 
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor_clean.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');  




//CAMPOS MASCARADOS
//----------------------------------------------------------------
function Mascara(objeto, evt, mask) {
 
var LetrasU = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var LetrasL = 'abcdefghijklmnopqrstuvwxyz';
var Letras  = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
var Numeros = '0123456789';
var Fixos  = '().-:/ '; 
var Charset = " !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_/`abcdefghijklmnopqrstuvwxyz{|}~";

evt = (evt) ? evt : (window.event) ? window.event : "";
var value = objeto.value;
if (evt) {
 var ntecla = (evt.which) ? evt.which : evt.keyCode;
 tecla = Charset.substr(ntecla - 32, 1);
 if (ntecla < 32) return true;

 var tamanho = value.length;
 if (tamanho >= mask.length) return false;

 var pos = mask.substr(tamanho,1); 
 while (Fixos.indexOf(pos) != -1) {
  value += pos;
  tamanho = value.length;
  if (tamanho >= mask.length) return false;
  pos = mask.substr(tamanho,1);
 }

 switch (pos) {
   case '#' : if (Numeros.indexOf(tecla) == -1) return false; break;
   case 'A' : if (LetrasU.indexOf(tecla) == -1) return false; break;
   case 'a' : if (LetrasL.indexOf(tecla) == -1) return false; break;
   case 'Z' : if (Letras.indexOf(tecla) == -1) return false; break;
   case '*' : objeto.value = value; return true; break;
   default : return false; break;
 }
}
objeto.value = value; 
return true;
}

// AS MASCARAS EFETIVAS
function MaskCEP(objeto, evt) { 
return Mascara(objeto, evt, '#####-###');
}

function MaskTelefone(objeto, evt) { 
return Mascara(objeto, evt, '####-####');
}

function MaskCPF(objeto, evt) { 
return Mascara(objeto, evt, '###.###.###-##');
}

function MaskRG(objeto, evt) { 
return Mascara(objeto, evt, '##.###.###-#');
}


function MaskCNPJ(objeto, evt) {
return Mascara(objeto, evt, '##.###.###/####-##');
}



//----------------------------------------------------------------



// TROCA AUTOMATICA ENTRE OS CAMPOS
//----------------------------------------------------------------
//PARA PESSOA FISICA
function maxToquesCPF(){
	if(document.getElementById('cpf').value.length == document.getElementById('cpf').maxLength){
		document.getElementById('rg').focus();
	}
}
function maxToquesRG(){
	if(document.getElementById('rg').value.length == document.getElementById('rg').maxLength){
		document.getElementById('nasc_diapf').focus();
	}
}

function maxToquesDIApf(){
	if(document.getElementById('nasc_diapf').value.length == document.getElementById('nasc_diapf').maxLength){
		document.getElementById('nasc_mespf').focus();
	}
}
function maxToquesMESpf(){
	if(document.getElementById('nasc_mespf').value.length == document.getElementById('nasc_mespf').maxLength){
		document.getElementById('nasc_anopf').focus();
	}
}
function maxToquesANOpf(){
	if(document.getElementById('nasc_anopf').value.length == document.getElementById('nasc_anopf').maxLength){
		document.getElementById('sexopf').focus();
	}
}




//PARA PESSOA JURIDICA
function maxToquesCPFpj(){
	if(document.getElementById('cpfpj').value.length == document.getElementById('cpfpj').maxLength){
		document.getElementById('empresa').focus();
	}
}

function maxToquesCNPJ(){
	if(document.getElementById('cnpj').value.length == document.getElementById('cnpj').maxLength){
		document.getElementById('nasc_diapj').focus();
	}
}
function maxToquesDIApj(){
	if(document.getElementById('nasc_diapj').value.length == document.getElementById('nasc_diapj').maxLength){
		document.getElementById('nasc_mespj').focus();
	}
}
function maxToquesMESpj(){
	if(document.getElementById('nasc_mespj').value.length == document.getElementById('nasc_mespj').maxLength){
		document.getElementById('nasc_anopj').focus();
	}
}
function maxToquesANOpj(){
	if(document.getElementById('nasc_anopj').value.length == document.getElementById('nasc_anopj').maxLength){
		document.getElementById('sexopj').focus();
	}
}




function maxToquesCep(){
	if(document.getElementById('cep1').value.length == document.getElementById('cep1').maxLength){
		document.getElementById('cep2').focus();
	}
}

function maxToquesCEP2(){
	if(document.getElementById('cep2').value.length == document.getElementById('cep2').maxLength){
		document.getElementById('tipo_logra').focus();
	}
}
function maxToquesCep3(){
	if(document.getElementById('cep2_1').value.length == document.getElementById('cep2_1').maxLength){
		document.getElementById('cep2_2').focus();
	}
}

function maxToquesCEP4(){
	if(document.getElementById('cep2_2').value.length == document.getElementById('cep2_2').maxLength){
		document.getElementById('tipo_logra2').focus();
	}
}


function maxToquesDDD_FONE(){
	if(document.getElementById('ddd_fone').value.length == document.getElementById('ddd_fone').maxLength){
		document.getElementById('fone').focus();
	}
}

function maxToquesFONE(){
	if(document.getElementById('fone').value.length == document.getElementById('fone').maxLength){
		document.getElementById('ddd_cel').focus();
	}
}
function maxToquesDDD_CEL(){
	if(document.getElementById('ddd_cel').value.length == document.getElementById('ddd_cel').maxLength){
		document.getElementById('cel').focus();
	}
}
function maxToquesCEL(){
	if(document.getElementById('cel').value.length == document.getElementById('cel').maxLength){
		document.getElementById('ddd_fax').focus();
	}
}
function maxToquesDDD_FAX(){
	if(document.getElementById('ddd_fax').value.length == document.getElementById('ddd_fax').maxLength){
		document.getElementById('fax').focus();
	}
}
function maxToquesFAX(){
	if(document.getElementById('fax').value.length == document.getElementById('fax').maxLength){
		document.getElementById('ref_entrega').focus();
	}
}


function maxToquesCARCEP1(){
	if(document.getElementById('cep_p1').value.length == document.getElementById('cep_p1').maxLength){
		document.getElementById('cep_p2').focus();
	}
}





//MENU
GroupAtual = "";
function abrefecha(atual,tot){
	if(GroupAtual == "" || GroupAtual != atual){
	    //total de categorias
		for(i=1; i<=tot; i++){
	        document.getElementById('sub' + i).style.display = 'none';
	    }
		
	    document.getElementById('sub'+atual).style.display = 'block';
		GroupAtual = atual;
	} else {
		document.getElementById('sub'+atual).style.display = 'none';
		GroupAtual = "";	

	}
}




//MENU
GroupAtual = "";
function abrefecha2(atual,tot){
	if(GroupAtual == "" || GroupAtual != atual){
	    //total de categorias
		for(i=1; i<=tot; i++){
	        document.getElementById('suba' + i).style.display = 'none';
	    }
		
	    document.getElementById('suba'+atual).style.display = 'block';
		GroupAtual = atual;
	} else {
		document.getElementById('suba'+atual).style.display = 'none';
		GroupAtual = "";	

	}
}




//PARA AS IMAGENS
function hider()
{
document.all.div1.style.display = 'none';
document.all.div2.style.display = 'block';
}
function unHider()
{
document.all.div1.style.display = 'block';
document.all.div2.style.display = 'none';
}



function showentrega(){
	if(cad.ent.value==1){
		document.getElementById('de').style.display  = 'block';
	}else{
		document.getElementById('de').style.display  = 'none';
	}
}

function soferta()
{
document.getElementById('so').style.display = 'none';
}
function hoferta()
{
document.getElementById('valor0').value = '';
document.getElementById('so').style.display = 'block';
}
function hoferta2()
{
document.getElementById('so').style.display = 'block';
}



function validarecupera()
{
	if (recu.userl.value==""){alert('Por favor, informe o E-mail.'); recu.userl.focus(); return false; }
}

function showpf(){
	document.getElementById('pf').style.display  = 'block';
	document.getElementById('pj').style.display  = 'none';

	document.cad.nomepf.focus();

}
function showpj(){
	document.getElementById('pj').style.display  = 'block';
	document.getElementById('pf').style.display  = 'none';

	document.cad.nomepj.focus();
}

function disable_boleto(){
cf.meio_pgto[0].disabled=true; //boleto

cf.meio_pgto[0].checked=false; //boleto
cf.meio_pgto[1].checked=true; //VISA


}
function enable_boleto(){
cf.meio_pgto[0].disabled=false; //boleto
cf.meio_pgto[0].checked=true; //boleto


}














// 												VALIDACOES - SITE
//--------------------------------------------------------------------------------------------------------
// Cadastro
function validacad(){

	/*
	//valida cpf normal
	//----------------------------------------------------------------------------------------------
	var cpf = cad.cpf.value;
	exp = /\.|\-/g
	cpf = cpf.toString().replace( exp, "" ); 
	var digitoDigitado = eval(cpf.charAt(9)+cpf.charAt(10));
	var soma1=0, soma2=0;
	var vlr =11;
	
	for(i=0;i<9;i++){
		soma1+=eval(cpf.charAt(i)*(vlr-1));
		soma2+=eval(cpf.charAt(i)*vlr);
		vlr--;
	}	
	soma1 = (((soma1*10)%11)==10 ? 0:((soma1*10)%11));
	soma2=(((soma2+(2*soma1))*10)%11);
	
	var digitoGerado=(soma1*10)+soma2;
	//----------------------------------------------------------------------------------------------


	//valida cpf pessoa juridica
	//----------------------------------------------------------------------------------------------
	var cpfb = cad.cpfpj.value;
	exp = /\.|\-/g
	cpfb = cpfb.toString().replace( exp, "" ); 
	var digitoDigitadob = eval(cpfb.charAt(9)+cpfb.charAt(10));
	var soma1b=0, soma2b=0;
	var vlrb =11;
	
	for(i=0;i<9;i++){
		soma1b+=eval(cpfb.charAt(i)*(vlrb-1));
		soma2b+=eval(cpfb.charAt(i)*vlrb);
		vlrb--;
	}	
	soma1b = (((soma1b*10)%11)==10 ? 0:((soma1b*10)%11));
	soma2b = (((soma2b+(2*soma1b))*10)%11);
	
	var digitoGeradob=(soma1b*10)+soma2b;
	//----------------------------------------------------------------------------------------------
	*/



if (cad.tipocad[0].checked){ 
	if (cad.nomepf.value=="")		{alert('Por favor, informe o Nome.'); cad.nomepf.focus(); return false; }

	if (cad.cpf.value=="")			{alert('Por favor, informe o CPF.'); cad.cpf.focus(); return false; }
	//if (cad.cpf.value=="111.111.111-11"){alert('CPF Inválido!'); cad.cpf.focus(); return false; }
	//if(digitoGerado!=digitoDigitado){ alert('CPF Inválido!'); cad.cpf.focus(); return false; }

	//valida cpf normal
	//----------------------------------------------------------------------------------------------
		
		cpf_ori = document.cad.cpf.value;
		re1 = /\-|\./g;
	
		cpf1 = cpf_ori.replace(re1, "");
		erro1 = new String;
		
		if (cpf1 == "00000000000" || cpf1 == "11111111111" || cpf1 == "22222222222" || cpf1 == "33333333333" || cpf1 == "44444444444" || cpf1 == "55555555555" || cpf1 == "66666666666" || cpf1 == "77777777777" || cpf1 == "88888888888" || cpf1 == "99999999999"){
			 erro1 += "Número de CPF inválido!"
		}
		
		var a1 = [];
		var b1 = new Number;
		var c1 = 11;
		for (i1=0; i1<11; i1++){
			   a1[i1] = cpf1.charAt(i1);
			   if (i1 < 9) b1 += (a1[i1] * --c1);
		}
		if ((x1 = b1 % 11) < 2) { a1[9] = 0 } else { a1[9] = 11-x1 }
		b1 = 0;
		c1 = 11;
		for (y1=0; y1<10; y1++) b1 += (a1[y1] * c1--); 
		if ((x1 = b1 % 11) < 2) { a1[10] = 0; } else { a1[10] = 11-x1; }
	
	
		if ((cpf1.charAt(9) != a1[9]) || (cpf1.charAt(10) != a1[10])){
			   erro1 +="Número de CPF inválido!";
		}
		if (erro1.length > 0){
			alert(erro1);
			cad.cpf.value='';
			cad.cpf.focus();
			return false;
		
		}
	//----------------------------------------------------------------------------------------------


	if (cad.nasc_diapf.value=="")	{alert('Por favor, informe o Dia do seu nascimento.'); cad.nasc_diapf.focus(); return false; }
	if (cad.nasc_mespf.value=="")	{alert('Por favor, informe o Mês do seu nascimento.'); cad.nasc_mespf.focus(); return false; }
	if (cad.nasc_anopf.value=="")	{alert('Por favor, informe o Ano do seu nascimento.'); cad.nasc_anopf.focus(); return false; }
	if (cad.sexopf.value=="")		{alert('Por favor, informe o Gênero.'); cad.sexopf.focus(); return false; }


}else if(cad.tipocad[1].checked){ 
	if (cad.nomepj.value=="")		{alert('Por favor, informe o Nome.'); cad.nomepj.focus(); return false; }

	if (cad.cpfpj.value=="")		{alert('Por favor, informe o CPF.'); cad.cpfpj.focus(); return false; }
	//if (cad.cpfpj.value=="111.111.111-11"){alert('CPF Inválido!'); cad.cpfpj.focus(); return false; }
	//if(digitoGeradob!=digitoDigitadob){ alert('CPF Inválido!'); cad.cpfpj.focus(); return false; }

	//valida cpf pessoa juridica
	//----------------------------------------------------------------------------------------------
		cpfpj_ori = document.cad.cpfpj.value;
		re1 = /\-|\./g;
	
		cpf2 = cpfpj_ori.replace(re1, "");
		erro2 = new String;
		
		if (cpf2 == "00000000000" || cpf2 == "11111111111" || cpf2 == "22222222222" || cpf2 == "33333333333" || cpf2 == "44444444444" || cpf2 == "55555555555" || cpf2 == "66666666666" || cpf2 == "77777777777" || cpf2 == "88888888888" || cpf2 == "99999999999"){
			 erro2 += "Número de CPF inválido!"
		}
		
		var a2 = [];
		var b2 = new Number;
		var c2 = 11;
		for (i2=0; i2<11; i2++){
			   a2[i2] = cpf2.charAt(i2);
			   if (i2 < 9) b2 += (a2[i2] * --c2);
		}
		if ((x2 = b2 % 11) < 2) { a2[9] = 0 } else { a2[9] = 11-x2 }
		b2 = 0;
		c2 = 11;
		for (y2=0; y2<10; y2++) b2 += (a2[y2] * c2--); 
		if ((x2 = b2 % 11) < 2) { a2[10] = 0; } else { a2[10] = 11-x2; }
	
	
		if ((cpf2.charAt(9) != a2[9]) || (cpf2.charAt(10) != a2[10])){
			   erro2 +="Número de CPF inválido!";
		}
		if (erro2.length > 0){
			alert(erro2);
			cad.cpfpj.value='';
			cad.cpfpj.focus();
			return false;
		}
	//----------------------------------------------------------------------------------------------


	if (cad.empresa.value=="")		{alert('Por favor, informe a Empresa.'); cad.empresa.focus(); return false; }
	
	if (cad.cnpj.value=="")			{alert('Por favor, informe o CNPJ.'); cad.cnpj.focus(); return false; }

	//valida CNPJ
	//-------------------------------------------------------------
	var cnpj = cad.cnpj.value;

    //transforma em numero somente
	x = cnpj.substring(0,2);
	x += cnpj. substring (3,6);
	x += cnpj. substring (7,10);
	x += cnpj. substring (11,15);
	x += cnpj. substring (16,18);
	cnpj = x; 

	if(cnpj.length!=14){
		alert('O CNPJ deve ter 14 números'); cad.cnpj.focus(); return false;
	}else{
		
		// PARA ACHAR O DIGITO VERIFICADOR 1
		// -------------------------------------------------------------------------------------
		var soma = 0;
		soma += cnpj.charAt(0) * 5;
        soma += cnpj.charAt(1) * 4;
        soma += cnpj.charAt(2) * 3;
        soma += cnpj.charAt(3) * 2;
        soma += cnpj.charAt(4) * 9; 
        soma += cnpj.charAt(5) * 8;
        soma += cnpj.charAt(6) * 7;
        soma += cnpj.charAt(7) * 6;
        soma += cnpj.charAt(8) * 5;
        soma += cnpj.charAt(9) * 4;
        soma += cnpj.charAt(10) * 3;
        soma += cnpj.charAt(11) * 2; 

		var d1 = soma % 11;  // resto da divisao por 11 da soma
		d1 = d1 < 2 ? 0 : 11 - d1; // se resto < 2 entao DV1 = 0 caso contrario DV1 = 11 - resto 
		// -------------------------------------------------------------------------------------


		// PARA ACHAR O DIGITO VERIFICADOR 2
		// -------------------------------------------------------------------------------------
		var soma = 0;
        soma += cnpj.charAt(0) * 6;
        soma += cnpj.charAt(1) * 5;
        soma += cnpj.charAt(2) * 4;
        soma += cnpj.charAt(3) * 3;
        soma += cnpj.charAt(4) * 2;
        soma += cnpj.charAt(5) * 9;
        soma += cnpj.charAt(6) * 8;
        soma += cnpj.charAt(7) * 7;
        soma += cnpj.charAt(8) * 6;
        soma += cnpj.charAt(9) * 5;
        soma += cnpj.charAt(10) * 4;
        soma += cnpj.charAt(11) * 3;
        soma += cnpj.charAt(12) * 2; 

		var d2 = soma % 11;  // resto da divisao por 11 da soma
		d2 = d2 < 2 ? 0 : 11 - d2; // se resto < 2 entao DV2 = 0 caso contrario DV2 = 11 - resto 
		// -------------------------------------------------------------------------------------
		
		
		if (cnpj.charAt(12) == d1 && cnpj.charAt(13) == d2) {
		 //return true;
		 //alert('valido');
		}else{
		 alert('CNPJ Inválido.'); cad.cnpj.focus(); return false;
		}
		

	}//fim do if comprimento <> 14


	if (cad.nasc_diapj.value=="")	{alert('Por favor, informe o Dia do seu nascimento.'); cad.nasc_diapj.focus(); return false; }
	if (cad.nasc_mespj.value=="")	{alert('Por favor, informe o Mês do seu nascimento.'); cad.nasc_mespj.focus(); return false; }
	if (cad.nasc_anopj.value=="")	{alert('Por favor, informe o Ano do seu nascimento.'); cad.nasc_anopj.focus(); return false; }
	if (cad.sexopj.value=="")		{alert('Por favor, informe o Gênero.'); cad.sexopj.focus(); return false; }
}


//para o endereco
if (cad.cep1.value=="")		{alert('Por favor, informe o CEP.'); cad.cep1.focus(); return false; }
if (cad.cep2.value=="")		{alert('Por favor, informe o restante do CEP.'); cad.cep2.focus(); return false; }
if (cad.tipo_logra.value==""){alert('Por favor, informe o Tipo do logradouro.'); cad.tipo_logra.focus(); return false; }
if (cad.logradouro.value==""){alert('Por favor, informe o Logradouro.'); cad.logradouro.focus(); return false; }
if (cad.numero.value=="")	{alert('Por favor, informe o Número.'); cad.numero.focus(); return false; }
if (cad.bairro.value=="")	{alert('Por favor, informe o Bairro.'); cad.bairro.focus(); return false; }
if (cad.cidade.value=="")	{alert('Por favor, informe a Cidade.'); cad.cidade.focus(); return false; }
if (cad.estado.value=="")	{alert('Por favor, informe o Estado.'); cad.estado.focus(); return false; }
if (cad.ddd_fone.value=="")	{alert('Por favor, informe o DDD do telefone.'); cad.ddd_fone.focus(); return false; }
if (cad.fone.value=="")		{alert('Por favor, informe o Telefone.'); cad.fone.focus(); return false; }

	//caso o endereco seja diferente para a entrega
	if(cad.ent.value==1){
		if (cad.cep2_1.value=="")	{alert('Por favor, informe o CEP de entrega.'); cad.cep2_1.focus(); return false; }
		if (cad.cep2_2.value=="")	{alert('Por favor, informe o restante do CEP de entrega.'); cad.cep2_2.focus(); return false; }
		if (cad.tipo_logra2.value==""){alert('Por favor, informe o Tipo do logradouro de entrega.'); 
		cad.tipo_logra2.focus(); return false; }
		if (cad.logradouro2.value==""){alert('Por favor, informe o Logradouro de entrega.'); 
		cad.logradouro2.focus(); return false; }
		if (cad.numero2.value=="")	{alert('Por favor, informe o Número de entrega.'); cad.numero2.focus(); return false; }
		if (cad.bairro2.value=="")	{alert('Por favor, informe o Bairro de entrega.'); cad.bairro2.focus(); return false; }
		if (cad.cidade2.value=="")	{alert('Por favor, informe a Cidade de entrega.'); cad.cidade2.focus(); return false; }
		if (cad.estado2.value=="")	{alert('Por favor, informe o Estado de entrega.'); cad.estado2.focus(); return false; }
	}

	if (cad.email.value=="")	{alert('Por favor, informe o E-mail.'); cad.email.focus(); return false; }
	if (cad.senha.value=="")	{alert('Por favor, informe a Senha.'); cad.senha.focus(); return false; }
	if (cad.senha2.value=="")	{alert('Por favor, informe a Confirmação da senha.'); cad.senha2.focus(); return false; }

	//se a senha e a confirmacao for diferente
	if (cad.senha.value==cad.senha2.value){
	
	}else{
		alert('Atenção: As senhas devem ser iguais.'); 
		cad.senha.value=""; 
		cad.senha2.value=""; 
		cad.senha.focus(); 
		return false; 
	}

}


// Busca
function validabusca(b){
	if (b.keyword.value==""){
		alert('Por favor, informe a palava chave antes de realizar a busca.'); 
		b.keyword.focus(); 
		return false;
	}
}

// Login
function validalogin(l){
	if (l.userl.value==""){alert('Por favor, informe o e-mail para entrar.'); l.userl.focus(); return false; }
	if (l.passl.value==""){alert('Por favor, informe a senha para entrar.'); l.passl.focus(); return false; }
}

// Newsletter
function validanews(n){
	if (n.option[0].checked) {  
		if (n.emailnews.value==""){alert('Por favor, informe o e-mail para cadastrar.'); n.emailnews.focus(); return false; }
	}
	if (n.option[1].checked) {  
		if (n.emailnews.value==""){alert('Por favor, informe o e-mail para remover.'); n.emailnews.focus(); return false; }
	}
}



// Contato
function validacont(){
	if (cont.nome.value=="")	{alert('Por favor, informe o Nome.'); cont.nome.focus(); return false; }
	if (cont.ddd_fone.value==""){alert('Por favor, informe o DDD do telefone.'); cont.ddd_fone.focus(); return false; }
	if (cont.fone.value=="")	{alert('Por favor, informe o Telefone.'); cont.fone.focus(); return false; }
	if (cont.email.value=="")	{alert('Por favor, informe o E-mail.'); cont.email.focus(); return false; }
	if (cont.assunto.value=="")	{alert('Por favor, informe o Assunto.'); cont.assunto.focus(); return false; }
}

//Medalhas
function validaenviafoto(){
	if (med.uploadedfile.value=="")	{alert('Por favor, envia uma imagem.'); med.uploadedfile.focus(); return false; }
}
