	var adair = false;
	
	function loadAjax(){
		adair = false;
		
		if(window.XMLHttpRequest)
		{
			adair = new XMLHttpRequest();
			if(adair.overrideMimeType){ adair.overrideMimeType('text/xml'); }
		}
		else if(window.ActiveXObject)
		{
			try
			{
				adair = new ActiveXObject("Msxml2.XMLHTTP");	
			}
			catch(e)
			{
				try
				{
					adair = new ActiveXObject("Microsoft.XMLHTTP");	
				}
				catch(e){}
			}
			
		}
	}
	
	
	
	function validaContateNos()	
	{		
		
		
		if(document.getElementById('nome').value.length >= 2)
		
		{
			
			var reEmail = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
			
			if(reEmail.test(document.getElementById('email').value))
			
			{				
				
				if(document.getElementById('dddtel').value.length >= 2)
				{
					
					if(document.getElementById('tel').value.length >= 6)
					{
						
						if(document.getElementById('cidade').value.length >= 2)
						{
					
							if(document.getElementById('uf').value != -1)
							{		
								
								loadAjax();
								adair.onreadystatechange = function ()
								{
									if(adair.readyState == 4)
									{
										if(adair.status == 200)
										{
												document.getElementById('recebeConteudo').innerHTML = "";
												document.getElementById('recebeConteudo').innerHTML = adair.responseText;
										} else { alert("Ocorreu algum erro com a página!");	}
									}
								}
								adair.open('GET', 'modulos/scripts_diversos/enviaContatoAjax.php?nome='+document.getElementById('nome').value+'&email='+document.getElementById('email').value+'&dddtel='+document.getElementById('dddtel').value+'&tel='+document.getElementById('tel').value+'&cidade='+document.getElementById('cidade').value+'&uf='+document.getElementById('uf').value+'&msg='+document.getElementById('msg').value, true);
								adair.setRequestHeader("Cache-Control","no-store, no-cache, must-revalidate");
								adair.setRequestHeader("Cache-Control","post-check=0, pre-check=0");
								adair.setRequestHeader("Pragma", "no-cache");
								adair.send(null);
								
					
							}			
							else			
							{				
								alert("Por favor, escolha seu ESTADO!");
								document.getElementById('uf').focus();
								return false;
							}
						
						}			
						else			
						{				
							alert("Por favor, preencha o campo CIDADE!");
							document.getElementById('cidade').focus();
							return false;
						}
				   		
					}			
					else			
					{				
						alert("Por favor, preencha o campo TELEFONE!");
						document.getElementById('tel').focus();
						return false;
					}
				
				}			
				else			
				{				
					alert("Por favor, preencha o campo DDD do telefone!");
					document.getElementById('dddtel').focus();
					return false;
				}					
								
			}			
			else			
			{				
				alert("Você está inserindo um endereço de E-MAIL INVÁLIDO!!\ndigite seu endereço de e-mail corretamente!");
				document.getElementById('email').focus();
				return false;
			}						
		}		
		else		
		{		
			alert("É necessário que você insira seu NOME!");
			document.getElementById('nome').focus();
			return false;
		}
		return false;
	}
	
	
	
	function exibeEsteKra(kra)
	{
		//alert(kra);
		
		if(kra == 1)
		{
			document.getElementById('tdWallpaper'+kra).style.display='block';
			document.getElementById('tdWallpaper'+kra).style.marginLeft='0px';
		}
		else if(kra == 2)
		{
			document.getElementById('tdWallpaper'+kra).style.display='block';
			document.getElementById('tdWallpaper'+kra).style.marginLeft='142px';
		}
		else if(kra == 3)
		{
			document.getElementById('tdWallpaper'+kra).style.display='block';
			document.getElementById('tdWallpaper'+kra).style.marginLeft='280px';
		}
		else if(kra == 4)
		{
			document.getElementById('tdWallpaper'+kra).style.display='block';
			document.getElementById('tdWallpaper'+kra).style.marginLeft='420px';
		}
		
		
	}
	
	
	
	function ocultaEsteKra(kra)
	{		
		
		document.getElementById('tdWallpaper'+kra).style.display='none';		
		
	}
	
	function divDisplay(idDoDiv,valor){ document.getElementById(idDoDiv).style.display=valor; }

    function f(){ return false; }
    
    function dom(id){

    return document.getElementById(id);

    }

    function envEmail(form,resp)
	{

        //alert(form+resp);
        var valores="txtNome1="+dom(form).txtNome1.value;
		valores+="&txtEmail1="+dom(form).txtEmail1.value;
		valores+="&txtEmail2="+dom(form).txtEmail2.value;
		valores+="&txtEmail3="+dom(form).txtEmail3.value;
    	valores+="&txtEmail4="+dom(form).txtEmail4.value;
		valores+="&txtEmail5="+dom(form).txtEmail5.value;
        //alert(valores);
        loadAjax();
		adair.open('POST', 'fncs/envia_meditacao.php', true);
		adair.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		adair.setRequestHeader("Cache-Control","no-store, no-cache, must-revalidate");
		adair.setRequestHeader("Cache-Control","post-check=0, pre-check=0");
		adair.setRequestHeader("Pragma", "no-cache");
		adair.send(valores);

		adair.onreadystatechange = function ()
		{

			if(adair.readyState >= 0 && adair.readyState <= 3)
			{ dom(resp).innerHTML="<center>carregando</center>"; }
			else
			{
				if(adair.status == 200)
				{

                    dom(resp).innerHTML = 'Email enviado com sucesso!!<br>Fique com Deus, e que Nossa Senhora Aparecida abençoe a você e toda sua família.';
                    //dom(resp).innerHTML =  adair.responseText;
					setTimeout("dom('frmEnviaEmailMed').style.display='none'",4000);
					setTimeout("dom('"+resp+"').innerHTML=''",4000);
					dom(form).reset();
				}
				else { alert("Ocorreu algum erro com a página!"); }
			}

		}

	}
	
