teste=new Array();

teste[0]="Misael";
teste[1]="Mariane";
teste[2]="Diomara";



function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function teste()
			{
			document.Anuncio.subcategoria.value = teste;
			}



function testeMudarCampo(ddd,tipoTelefone)
			{
			tamanho = document.getElementById(ddd);			
			if (tamanho.value.length > 1)
				{
				document.getElementById(tipoTelefone).focus();
				}
			}
			
function AtualizaCamposMenu(id)
		{
		if (document.getElementById(id)!= undefined)
			{
			if (document.getElementById(id).style.display == '')
				{
				document.getElementById(id).style.display = 'none';
				}
				else
					{
					document.getElementById(id).style.display = '';
					}
			}
		}
			
	function OcultaCat(tmpDiv){
		if (document.getElementById(tmpDiv)!= undefined){
			document.getElementById(tmpDiv).style.display = 'none';
			}
									
			}	


function validaCadastro()
   		{
   		
   		if (document.Cadastro.email.value=="")
   			{
   			alert("E-mail não informado!");
			document.Cadastro.email.focus();
			document.getElementById('AvisoEmail').style.display = '';
			return false;
			}
			else
				{
				document.getElementById('AvisoEmail').style.display = 'none';
				}
			mail=document.Cadastro.email.value;
    			var er = new RegExp(/^[A-Za-z0-9_\-\.]+@[A-Za-z0-9_\-\.]{2,}\.[A-Za-z0-9]{2,}(\.[A-Za-z0-9])?/);
    	   		if (!er.test(mail))
    				{
    				alert("O E-mail informado é invalido!!!");
    				document.getElementById('AvisoEmail').style.display = '';
    				document.Cadastro.email.focus();
       			 	return false;
        			}
        			else
        				{
        				document.getElementById('AvisoEmail').style.display = 'none';
        				}
        							
        if (document.Cadastro.nome.value=="")
   			{
   			alert("Nome não informado!");
   			document.Cadastro.nome.focus();
   			document.getElementById('AvisoNome').style.display = '';
   			return false;
   			}
   			else
   				{
   				document.getElementById('AvisoNome').style.display = 'none';
   				}
   			  			
   			
   		if (document.Cadastro.senha.value=="")	
			{
			alert("Senha não informada!")
			document.Cadastro.senha.focus();
			document.getElementById('AvisoSenha').style.display = '';
			return false;
			}
			else
				{
				if (document.Cadastro.senha.value.length < 6)
					{
					alert("Sua senha deve possuir no mínimo 6 caracteres!!!")
					document.Cadastro.senha.focus();
					document.getElementById('AvisoSenha').style.display = '';
					return false;
					}
					else
						{
						document.getElementById('AvisoSenha').style.display = 'none';
						}
       			}
			
		if (document.Cadastro.confSenha.value=="")	
			{
			alert("Confirmação de  Senha não informada!")
			document.Cadastro.confSenha.focus();
			document.getElementById('AvisoConfSenha').style.display = '';
			return false;
			}
			else
				{
				document.getElementById('AvisoConfSenha').style.display = 'none';
				}
			if (document.Cadastro.senha.value!=document.Cadastro.confSenha.value)
			{
			alert("Confirmação de senha diferente da senha");
			document.Cadastro.confSenha.focus();
			document.getElementById('AvisoConfSenha').style.display = '';
			return false;
			}
			else
				{
				document.getElementById('AvisoConfSenha').style.display = 'none';
				}
			
			if (document.Cadastro.dddTelefone.value!="")
   					{
   					exp = /\d{2}/;
    				if(!exp.test(document.Cadastro.dddTelefone.value))
    					{						
      					alert('Numero do DDD Invalido! (DDD com dois numeros)'); 
       					document.Cadastro.dddTelefone.focus();
       					document.getElementById('AvisoTelefone').style.display = '';
       					return false;
       					}
       					else
       						{
       						document.getElementById('AvisoTelefone').style.display = 'none';
       						}
       				}
       				else
       					{   					
   						alert("DDD não informado!");
						document.Cadastro.dddTelefone.focus();
						document.getElementById('AvisoTelefone').style.display = '';
						return false;
						}
						
		if (document.Cadastro.telefone.value=="")
   			{
   			alert("Telefone não informado!");
			document.Cadastro.telefone.focus();
			document.getElementById('AvisoTelefone').style.display = '';
			return false;
			}	
			else
				{
				document.getElementById('AvisoTelefone').style.display = 'none';
				}
	
   		
   		if (document.Cadastro.cidade.value=="")
   			{
   			alert("Cidade não informada!");
			document.Cadastro.cidade.focus();
			document.getElementById('AvisoCidade').style.display = '';
			return false;
			}
			else
				{
				document.getElementById('AvisoCidade').style.display = 'none';
				}
			
		if (document.Cadastro.uf.value=="")
			{
			alert("Estado não informado!");
			document.Cadastro.uf.focus();
			document.getElementById('AvisoUf').style.display = '';
			return false;
			}
			else
				{
				document.getElementById('AvisoUf').style.display = 'none';
				}
			
		if ( !document.Cadastro.AceitaCond.checked )
   				{
   			 	alert("Você deve aceitar os termos e condições para anunciar!!!");
   				document.Cadastro.AceitaCond.focus();
   				document.getElementById('AvisoTermos').style.display = '';
   				return false;
   				}
   				else
   					{
   					document.getElementById('AvisoTermos').style.display = 'none';
   					}

			
			
		}
