<!--

// Paulinas  - JS File

<!--

 //Abresome

function aparece(objSpan,objImg,objImgInvisivel){
	if (objSpan.style.display == "none"){
		objSpan.style.display = "";
		objImg.src = "images/menos.jpg";
		}
	else{
		objSpan.style.display = "none";
		objImg.src = "images/mais.jpg";
//		document.getElementById(objImgInvisivel).focus();
		}
		
}

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_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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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];}
}
//-->

//menu-list
function navegaBoxGeral(url){
	window.location.assign(url);
}

// layers lojas

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->

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_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

//layer

function MM_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() 
{ //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  if ((obj=MM_findObj(args[i]))!=null) 
  { v=args[i+2];
    if (obj.style) 
    { obj=obj.style; 
       v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
    }
    obj.visibility=v; 
  }
}

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 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];}}
}

//ativação de flash

function AbreArquivoSWF(caminhoArquivo, altura, largura)
{
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+ largura +'" height="'+ altura +'" ID="Shockwaveflash1" VIEWASTEXT>');
  document.write('<param name="movie" value="' + caminhoArquivo + '">');
  document.write('<param name="wmode" value="transparent">');
  document.write('<param name="quality" value="high">');
  document.write('<embed src="' + caminhoArquivo + '" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ largura +'" height="'+ altura +'"></embed>');
  document.write('</object>');
}



function PermitirSomenteNumeros(qtdCaracteres, objeto, objeto2)
{
  campo = eval(objeto);
  
  if ( (window.event.keyCode < 48) || (window.event.keyCode > 57) || (campo.value.length > qtdCaracteres))
  {
     event.returnValue = false;
  }
  
  if ((campo.value.length == qtdCaracteres) && (qtdCaracteres == 5))
  {
     campo2 = eval(objeto2);
     campo2.focus();
    
  
    
  }
}

function ValidarQtdSacola(objeto)
{
  campo = eval(objeto);
  if ((window.event.keyCode < 48) || (window.event.keyCode > 57))
  {
     event.returnValue = false;
  }
  
}

function AbrirPaulinasTV(IdVideo)
{
  if (IdVideo > 0)
  {
    pag = 'http://www.paulinas.org.br/paulinas_tv/clipes/pl_tv_main.aspx?VideoID=' + IdVideo.toString();
  }
  else
  {
    pag = 'http://www.paulinas.org.br/paulinas_tv/clipes/pl_tv_main.aspx';
  }
  
  hWnd = window.open(pag,'tv','scrollbars=no,toolbar=no,location=no,resizeble=no,width=573,height=464,top=20,left=20');

}

function AbrirPaulinasRadio(idMusica)
{
 if (idMusica > 0)
  {
    pag = 'http://www.paulinas.org.br/radio/radio.aspx?idMusica=' + idMusica.toString();
  }
  
	hWnd = window.open(pag,'radio','scrollbars=no,toolbar=no,location=no,resizeble=no,width=470,height=270,top=20,left=20');
} 


function Mascara(formato, objeto)
{
  campo = eval (objeto);
  if (formato=='CPF')
  {
    caracteres = '01234567890';
    separacoes = 3;
    separacao1 = '.';
    separacao2 = '-';
    conjuntos = 4;
    conjunto1 = 3;
    conjunto2 = 7;
    conjunto3 = 11;
    conjunto4 = 14;
  if ((caracteres.search(String.fromCharCode (window.event.keyCode))!=-1) && campo.value.length < (conjunto4))
  {
    if (campo.value.length == conjunto1) 
      campo.value = campo.value + separacao1;
    else if (campo.value.length == conjunto2) 
      campo.value = campo.value + separacao1;
    else if (campo.value.length == conjunto3) 
      campo.value = campo.value + separacao2;
  }
  else 
    event.returnValue = false;
  } 

  else if (formato=='DATA')
  {
    caracteres = '01234567890';
    separacoes = 2;
    separacao1 = '/';
    separacao2 = '-';
    conjuntos = 4;
    conjunto1 = 2;
    conjunto2 = 5;
    conjunto3 = 11;
    conjunto4 = 10;
    if ((caracteres.search(String.fromCharCode (window.event.keyCode))!=-1) && campo.value.length < (conjunto4))
    {
      if (campo.value.length == conjunto1) 
        campo.value = campo.value + separacao1;
      else if (campo.value.length == conjunto2) 
        campo.value = campo.value + separacao1;
    }
    else 
      event.returnValue = false;
  } 

  else if (formato=='CNPJ')
  {
    caracteres = '01234567890';
    separacoes = 2;
    separacao1 = '.';
    separacao2 = '/';
    separacao3 = '-';
    conjuntos = 4;
    conjunto1 = 2;
    conjunto2 = 6;
    conjunto3 = 10;
    conjunto4 = 15;
    conjunto5 = 18;
    if ((caracteres.search(String.fromCharCode (window.event.keyCode))!=-1) && campo.value.length < (conjunto5))
    {
      if (campo.value.length == conjunto1) 
        campo.value = campo.value + separacao1;
      else if (campo.value.length == conjunto2) 
        campo.value = campo.value + separacao1;
      else if (campo.value.length == conjunto3) 
        campo.value = campo.value + separacao2;
      else if (campo.value.length == conjunto4) 
        campo.value = campo.value + separacao3;
    }
    else 
      event.returnValue = false;
  } 

  else if (formato=='CEP')
  {
    caracteres = '01234567890';
    separacoes = 2;
    separacao1 = '-';
    conjuntos = 2;
    conjunto1 = 5;
    conjunto2 = 9;


    if ((window.event.keyCode >= 48) && (window.event.keyCode <= 57) && campo.value.length < (conjunto2))
    {
      if (campo.value.length == conjunto1) 
        campo.value = campo.value + separacao1;
      }
      else 
        event.returnValue = false;
    } 
}
function AbrirPaulinasTVTrailers(trailerID)
{
  if (trailerID > 0)
  {
    pag = '/paulinas_tv/clipes/pl_tv_main.aspx?TrailerID=' + trailerID.toString();
    
  }
  else
  {
    pag = '/paulinas_tv/clipes/pl_tv_main.aspx?Trailers=true';
    
  }
	
  hWnd = window.open(pag,'tv','scrollbars=no,toolbar=no,location=no,resizeble=no,width=573,height=464,top=20,left=20');
	
}

	function abreIndique(tipo, idProduto)
	{
		var url;
		url = 'Indique.aspx?';
		
		if(tipo == 1) 
		{
			url += 'tipo=1&idProduto=' + idProduto;
		}
		else
		{
			url += 'tipo=' + tipo
		}
		
		window.open(url,'indique','width=500,height=340,top=50,left=50');
	}
	
//Pop-Indique
		
	function AbreIndiqueDiaFeliz(area,url)
	{
		url = escape(url);
		
		urlIndique = '../home/pl_livIndique.aspx?Tipo=' + area + '&Url=' + url;
				
		window.open(urlIndique,'indique','width=500,height=300,top=50,left=50');
		
	}	
	

	function ValidarQtdCaracteres(src, args)
   {
      valor = args.Value;
      args.IsValid = ((valor.length > 2) && (valor.length < 31));
   }
   
   function SetBotaoDefault(btn, event)
   {
    objBtn = document.getElementById(btn);
    if (objBtn == null) objBtn = document.getElementsByName(btn);
    if (event.which == 13 || event.keyCode == 13)
     {
      event.returnValue=false;
    event.cancel = true;
      objBtn.click();
     }
   }
 
 //Pop-Assinatura Familia Crista / Diálogo

function abreassinedialogo()
{
    var desktop = window.open( "https://ssl190.locaweb.com.br/paulinas3/ssl/assine_dialogo.asp", "assinedialogo", "width=640,height=480,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,top=20,left=20" );
}

function abreassinefc()
{
    var desktop = window.open( "https://ssl190.locaweb.com.br/paulinas3/ssl/assine_fc.asp?forma=jacinta", "assinefc", "width=640,height=480,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,top=20,left=20" );
}

// Rádios

function abrebiblia()
{
    hWnd = window.open ('http://www.paulinas.org.br/media/biblia/radio.asp','plradio','scrollbars=no,toolbar=no,location=no,resizeble=no,width=470,height=270,top=20,left=20');
}

function AbrirAjudaLivraria()
{
    pag = 'AjudaHome.aspx';
    hWnd = window.open(pag,'ajuda','scrollbars=yes,toolbar=no,location=no,resizeble=no,width=620,height=550,top=20,left=20');
} 
  
function busca()
{
	try
	{
        txt = document.getElementById('txtPalavrachave').value;
        
        if (txt.value == '')
        {
         alert('Digite uma palavra para a busca.');
         document.getElementById('txtPalavrachave').focus()
        }
        else if (txt.length <= 2)
        {
          alert(unescape('Digite no m%EDnimo 3 caracteres para a busca.'));
          document.getElementById('txtPalavrachave').focus()
        }
        else
        {
            ddl = document.getElementById('ddlSecao').value;
            pag = '/loja/BuscaPortal.aspx?idSecao=' + ddl.value + '&busca=' + txt.value;
            document.location.href = pag;
        }
	}
	catch(e)
	{
		alert(e.message)
	}
    return false;
}
  
function BuscaPortal()
{
	try
	{
		var txt = document.getElementById('txtPalavrachave');

		if (txt.value == '')
		{
			alert('Digite uma palavra para a busca.');
			txt.focus();
		}
		else if (txt.value.length <= 2)
		{
			alert(unescape('Digite no m%EDnimo 3 caracteres para a busca.'));
			txt.focus();
		}
		else
		{
			ddl = document.form.ddlSecao;
			pag = '/loja/BuscaPortal.aspx?idSecao=' + ddl.value + '&busca=' + txt.value;
			document.location.href = pag;
		}
	}
	catch(e)
	{
		alert(e.message)
	}
	return false;
}

function BuscaPartituraPortal()
{
    txt = document.form.txtPartitura;
    
    if (txt.value == '')
    {
      alert('Digite uma palavra para a busca.');
      txt.focus();
    }
    else if (txt.value.length <= 2)
    {
      alert(unescape('Digite no m%EDnimo 3 caracteres para a busca.'));
      txt.focus();
    }
    else
    {
      pag = '/loja/BuscaPartituraPortal.aspx?busca=' + txt.value;
      document.location.href = pag;
    }
    return false;
  }
  
   function BuscaCartoes()
  {
    txt = document.getElementById('listcartoes').value;
    if (txt.value != '')
    {
      pag = 'http://www.paulinas.org.br/cartoes/plHomeCartoes.aspx?idTipo=' + txt;
      document.location.href = pag;
    }
    else
    {
        txt = document.form.listcartoes;
        pag = 'http://www.paulinas.org.br/cartoes/plHomeCartoes.aspx?idTipo=' + txt.value;
        document.location.href = pag;
    }
  }
  
  function BuscaRelease() 
  {
		if(ValidaBuscaRelease()) 
		{
		  var texto = document.form.txtBuscaImprensa;
		  var tipo = document.form.ddlTipobuscaImprensa;
		  var pag = 'http://www.paulinas.org.br/imprensa/sl_busca.aspx?Buscar=true&Texto=' + Trim(texto.value) + '&Tipo=' + tipo.value;
		  document.location.href = pag;
		}
		
		return false;
		
	}

	function ValidaBuscaRelease() 
	{
		var txt = document.form.txtBuscaImprensa;
		if(Trim(txt.value).length < 3) 
		{
			alert(unescape('Digite no m%EDnimo 3 caracteres para a busca.'));
			txt.focus();
			return false;
		}
		
		var tipo = document.form.ddlTipobuscaImprensa;
		if(tipo.value == '')
		{
		  alert("Escolha o tipo de busca");
			tipo.focus();
			return false;
		}
		
		return true;
	}

	function Trim(texto) {
		while(texto.length > 0 && texto.substring(0, 1) == ' ') 
		{
			texto = texto.substring(1, texto.length);
		}

		while(texto.length > 0 && texto.substring(texto.length - 1, texto.length) == ' ') 
		{
			texto = texto.substring(0, texto.length - 1);
		}

		return texto;
	}
  
  function ExibirLayer(div) 
  { 
  
    MM_showHideLayers('multimidia','','hide');
    MM_showHideLayers('imprensa','','hide');
    MM_showHideLayers('paulinas','','hide');
    MM_showHideLayers('cursos','','hide');
    MM_showHideLayers('revistas','','hide');
    MM_showHideLayers(div,'','show');
    MM_swapImgRestore();
   
  }
  
    function ExibirLayerMenu(div) 
  { 
  
    MM_showHideLayers('programas','','hide');
    MM_showHideLayers(div,'','show');   
  }
  
     
  
 //Pop Cursos SAB
function abre(curso)
{
 url = curso + '.aspx';
 hWnd = window.open (url,'janelacurso','scrollbars=yes,toolbar=no,location=no,resizeble=no,width=530,height=400,top=20,left=20');
}

function AbrirLayerAleatorioHome()
{
  var totalLayers = 4;
  var indexLayer = Math.floor(Math.random() * totalLayers);
  
  MM_showHideLayers('multimidia','','hide');
  MM_showHideLayers('imprensa','','hide');
  MM_showHideLayers('paulinas','','hide');
  MM_showHideLayers('cursos','','hide');
  MM_showHideLayers('revistas','','hide');
  
  var layerExibe;
  switch (indexLayer)
  {
    case 0: 
    { 
      MM_showHideLayers('cursos','','show');
      MM_swapImage('buttoncurso','','file:///R|/portal.paulinas.org.br/web/img/cp_tt_aba_br_eventos.jpg',1);
      break;
    }
    case 1: 
    { 
      MM_showHideLayers('revistas','','show');
      MM_swapImage('buttonrevista','','file:///R|/portal.paulinas.org.br/web/img/cp_tt_aba_br_revistas.jpg',1);
      break;
    }
    case 2: 
    { 
      MM_showHideLayers('multimidia','','show');
      MM_swapImage('buttonmulti','','file:///R|/portal.paulinas.org.br/web/img/cp_tt_aba_br_multimidia.jpg',1);
      break;
    }
     case 3: 
    { 
      MM_showHideLayers('paulinas','','show');
      MM_swapImage('buttonpauli','','file:///R|/portal.paulinas.org.br/web/img/cp_tt_aba_br_conheca_paulinas.jpg',1);
      break;
    }
  }
}

//Layers Livrarias
function mOvr(src,clrOver)
	{
	if(!src.contains(event.fromElement))
		{
		src.style.cursor = 'hand';
		src.bgColor = clrOver;
		}
	}
function mOut(src,clrIn)
	{
	if(!src.contains(event.toElement))
		{
		src.style.cursor = 'default';
		src.bgColor = clrIn;
		}
	}

function AbrirAlertaSaidaPortal(url)
{
  url = 'AlertaSaida.aspx?url=' + url;
  window.open(url, 'AlertaSaida', 'width=450,height=220,top=50,left=50')
}


function Validar(theForm)
{
  if (document.form.fPais.value != "BRASIL")
  {
    document.all.dPagamentosBrasil.style.display = 'none';
    document.all.dPagamentosExterior.style.display = 'block';
  }
  else
  {
    document.all.dPagamentosBrasil.style.display = 'block';
    document.all.dPagamentosExterior.style.display = 'none';
  }
}

function Validar(theForm)
{

  if (theForm.fNome.value == "")
  {
    alert("Por favor, informe o seu nome.");
    theForm.fNome.focus();
    return (false);
  }

   
   if (theForm.fEndereco.value.length < 10)
  {
    alert("O campo do endereço aceita no mínimo 10 caracteres.");
    theForm.fEndereco.focus();
    return (false);
  }
  
   
   if (theForm.fCEP.value == "")
  {
    alert("Por favor, informe o CEP corretamente.");
    theForm.fCEP.focus();
    return (false);
  }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fCEP.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas número no campo CEP.");
    theForm.fCEP.focus();
    return (false);
  }
 
  
   if (theForm.fCEP.value.length < 5)
  {
    alert("Por favor, o campo CEP deve conter no mínimo 5 dígitos.");
    theForm.fCEP.focus();
    return (false);
  }
 
  
   if (theForm.fCEP2.value == "")
  {
    alert("Por favor, informe o complemento do CEP corretamente.");
    theForm.fCEP2.focus();
    return (false);
  }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fCEP2.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas número no complemento do campo CEP.");
    theForm.fCEP2.focus();
    return (false);
  }
 
  
   if (theForm.fCEP2.value.length < 3)
  {
    alert("Por favor, o complemento do campo CEP deve conter no mínimo 3 dígitos.");
    theForm.fCEP2.focus();
    return (false);
  }
  
  
   if (theForm.fCidade.value == "")
  {
    alert("Por favor, informe a cidade.");
    theForm.fCidade.focus();
    return (false);
  }
 
  
   if (theForm.fEstado.value == "")
  {
    alert("Por favor, informe o estado.");
    theForm.fEstado.focus();
    return (false);
  }
  
    if (theForm.fPais.value == "")
    {
    alert("Por favor, informe o país.");
    theForm.fPais.focus();
    return (false);
    }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fTelefone.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas números no telefone.");
    theForm.fTelefone.focus();
    return (false);
  }
 
 
   if (theForm.fTelefone.value == "")
  {
    alert("Por favor, informe o telefone.");
    theForm.fTelefone.focus();
    return (false);
  }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fFax.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas número no campo fax.");
    theForm.fFax.focus();
    return (false);
  }
   
  
   if (theForm.fEmail.value == "")
  {
    alert("Por favor, informe o seu e-mail.");
    theForm.fEmail.focus();
    return (false);
  }
 
  
   if (theForm.fEmail.value.length < 6)
  {
    alert("O campo do e-mail aceita no mínimo 6 caracteres.");
    theForm.fEmail.focus();
    return (false);
  }
  
  
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
  var checkStr = theForm.fEmail.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, verifique se o seu e-mail foi digitado corretamente.");
    theForm.fEmail.focus();
    return (false);
  }
 
   if (theForm.fProfissao.value == "")
  {
    alert("Por favor, informe a sua profissão.");
    theForm.fProfissao.focus();
    return (false);
  }
 
   if (theForm.fConfissao.value == "")
  {
    alert("Por favor, informe a sua confissão religiosa.");
    theForm.fConfissao.focus();
    return (false);
  }
  
 
 return (true);
} 


function ValidarFormDialogo(theForm)
{

  if (theForm.fNome.value == "")
  {
    alert("Por favor, informe o seu nome.");
    theForm.fNome.focus();
    return (false);
  }

   
   if (theForm.fEndereco.value.length < 10)
  {
    alert("O campo do endere&ccedil;o aceita no mínimo 10 caracteres.");
    theForm.fEndereco.focus();
    return (false);
  }
  
   
   if (theForm.fCEP.value == "")
  {
    alert("Por favor, informe o CEP corretamente.");
    theForm.fCEP.focus();
    return (false);
  }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fCEP.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas número no campo CEP.");
    theForm.fCEP.focus();
    return (false);
  }

  
   if (theForm.fCEP.value.length < 5)
  {
    alert("Por favor, o campo CEP deve conter no mínimo 5 dígitos.");
    theForm.fCEP.focus();
    return (false);
  }
 
  
   if (theForm.fCEP2.value == "")
  {
    alert("Por favor, informe o complemento do CEP corretamente.");
    theForm.fCEP2.focus();
    return (false);
  }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fCEP2.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas número no complemento do campo CEP.");
    theForm.fCEP2.focus();
    return (false);
  }
 
  
   if (theForm.fCEP2.value.length < 3)
  {
    alert("Por favor, o complemento do campo CEP deve conter no mínimo 3 dígitos.");
    theForm.fCEP2.focus();
    return (false);
  }
  
  
   if (theForm.fCidade.value == "")
  {
    alert("Por favor, informe a cidade.");
    theForm.fCidade.focus();
    return (false);
  }
 
 
   if (theForm.fEstado.value == "")
  {
    alert("Por favor, informe o estado.");
    theForm.fEstado.focus();
    return (false);
  }
  
    if (theForm.fPais.value == "")
    {
    alert("Por favor, informe o país.");
    theForm.fPais.focus();
    return (false);
    }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fTelefone.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas números no telefone.");
    theForm.fTelefone.focus();
    return (false);
  }
   
 
   if (theForm.fTelefone.value == "")
  {
    alert("Por favor, informe o telefone.");
    theForm.fTelefone.focus();
    return (false);
  }
  
  
  var checkOK = "0123456789";
  var checkStr = theForm.fFax.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, digite apenas número no campo fax.");
    theForm.fFax.focus();
    return (false);
  }
   
  
   if (theForm.fEmail.value == "")
  {
    alert("Por favor, informe o seu e-mail.");
    theForm.fEmail.focus();
    return (false);
  }
 
  
   if (theForm.fEmail.value.length < 6)
  {
    alert("O campo do e-mail aceita no mínimo 6 caracteres.");
    theForm.fEmail.focus();
    return (false);
  }
  
  
  var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_.@";
  var checkStr = theForm.fEmail.value;
  var allValid = true;
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
  }
  if (!allValid)
  {
    alert("Por favor, verifique se o seu e-mail foi digitado corretamente.");
    theForm.fEmail.focus();
    return (false);
  }
 
   if (theForm.fProfissao.value == "")
  {
    alert("Por favor, informe a sua profissão.");
    theForm.fProfissao.focus();
    return (false);
  }
 
   if (theForm.fConfissao.value == "")
  {
    alert("Por favor, informe a sua confissão religiosa.");
    theForm.fConfissao.focus();
    return (false);
  }
  
 
 return (true);
 
 
}


//Pop-Assinatura Familia Crista / Diálogo

function abreassinedialogo()
{
    var desktop = window.open( "https://www.paulinas.org.br/assine_dialogo.asp", "assinedialogo", "width=640,height=480,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,top=20,left=20" );
}

function abreassinefc()
{
    var desktop = window.open( "https://www.paulinas.org.br/assine_fc.asp?forma=jacinta", "assinefc", "width=640,height=480,toolbar=no,location=no,status=yes,menubar=no,scrollbars=yes,resizable=no,top=20,left=20" );
}

function tamanho()
{
     //self.moveTo(0, 0);
     self.resizeTo(650, 620);
 }

