// JANELA EM DIV **************************************************************
function abreDiv(){ 
document.getElementById("abre_status").style.display = 'block';
document.getElementById("layer_um").style.display = 'none';
document.getElementById("Layer3").style.display = 'none';
}

function fechaTudo(){ 
document.getElementById("abre_status").style.display = 'block';
document.getElementById("abre_status").style.display = 'none';
document.getElementById("Layer3").style.display = 'none';
}

// ABRE POP UP REDIMENSIONÁVEL **************************************************************
	function MM_openBrWindow(theURL,winName,features) 
		{
		window.open(theURL,winName,features);
		}

// SELECIONA E COPIA TEXTEAREA **************************************************************
function selectCode()
    { 
  if(document.pad.text.value.length>0) 
      { 
    textRange = document.pad.text.createTextRange();
    textRange.execCommand("RemoveFormat");
    textRange.execCommand("Copy");
    document.pad.text.focus(); 
    document.pad.text.select();
    alert ("Código copiado.");
      } 
  else alert('Não há o que copiar!') 
    } 

// VALIDA FORM COMENTÁRIOS **************************************************************
function publicacomentesite(){

if(document.comentesite.nome.value=="" || document.comentesite.nome.value.length < 0)
{
alert( "Por favor, seu nome... Quem é você???" );
document.comentesite.nome.focus();
return false;
}

if( document.comentesite.email.value.length < 0  || document.comentesite.email.value.indexOf('@')==-1 || document.comentesite.email.value.indexOf('.')==-1 )
{
alert( "Por favor, informe seu e-mail! Você precisará validar seu comentário!" );
document.comentesite.email.focus();
return false;
}

if(document.comentesite.titulocomentario.value=="" || document.comentesite.titulocomentario.value.length < 0)
{
alert( "Esqueceu de dá um título a seu comentário..." );
document.comentesite.titulocomentario.focus();
return false;
}

if(document.comentesite.anti2.value=="" || document.comentesite.anti2.value.length < 0)
{
alert( "Por favor, verifique o ANTI-SPAM! Repita no segundo campo, os número que você ver no primeiro!" );
document.comentesite.anti2.focus();
return false;
}

if(document.comentesite.anti2.value!=document.comentesite.anti.value)
{
alert( "Por favor, verifique o ANTI-SPAM! Repita no segundo campo, os número que você ver no primeiro!" );
document.comentesite.anti2.focus();
return false;
}

if(document.comentesite.comentario.value=="" || document.comentesite.comentario.value.length < 0)
{
alert( "Bahhhh! Você não escreveu um comentário..." );
document.comentesite.comentario.focus();
return false;
}

return true;
}

// JANELA EM DIV LIVRO **************************************************************
function abreDivL(){ 
document.getElementById("box_menu_select_livros").style.display = 'block';
}

function fechaTudoL(){ 
document.getElementById("box_menu_select_livros").style.display = 'none';
}


// FORM EVENTO **************************************************************
function publicaevento(){

if(document.formevento.categoriaevento.value=="" || document.formevento.categoriaevento.value.length < 0)
{
alert( "Por favor, escolha uma categoria..." );
document.formevento.categoriaevento.focus();
return false;
}

if(document.formevento.tituloevento.value=="" || document.formevento.tituloevento.value.length < 0)
{
alert( "Esqueceu de informar um título..." );
document.formevento.tituloevento.focus();
return false;
}

if(document.formevento.dia.value=="" || document.formevento.dia.value.length < 0)
{
alert( "Informe DIA, MÊS e ANO..." );
document.formevento.dia.focus();
return false;
}

if(document.formevento.mes.value=="" || document.formevento.mes.value.length < 0)
{
alert( "Informe DIA, MÊS e ANO..." );
document.formevento.mes.focus();
return false;
}

if(document.formevento.ano.value=="" || document.formevento.ano.value.length < 0)
{
alert( "Informe DIA, MÊS e ANO..." );
document.formevento.ano.focus();
return false;
}

if(document.formevento.local.value=="" || document.formevento.local.value.length < 0)
{
alert( "Informe o Local do Evento..." );
document.formevento.local.focus();
return false;
}

if(document.formevento.cidade.value=="" || document.formevento.cidade.value.length < 0)
{
alert( "O campo Cidade é obrigatório..." );
document.formevento.cidade.focus();
return false;
}

if(document.formevento.detalhes.value=="" || document.formevento.detalhes.value.length < 0)
{
alert( "Use o campo Detalhes para dá mais informações sobre seu evento..." );
document.formevento.detalhes.focus();
return false;
}

if(document.formevento.promotor.value=="" || document.formevento.promotor.value.length < 0)
{
alert( "Diga o nome do Responsável ou Entidade que promove o Evento..." );
document.formevento.promotor.focus();
return false;
}


if( document.formevento.email.value.length < 0  || document.formevento.email.value.indexOf('@')==-1 || document.formevento.email.value.indexOf('.')==-1 )
{
alert( "O e-mail é necessário..." );
document.formevento.email.focus();
return false;
}


if(document.formevento.anti2.value=="" || document.formevento.anti2.value.length < 0)
{
alert( "Preencha o Anti-Spam!!!" );
document.formevento.anti2.focus();
return false;
}

return true;
}






