// JavaScript Document

// FACEBOX
//jQuery(document).ready(function($) {
//    $('a[rel*=facebox]').facebox()
//}) 

function abrir(strMensagem)
{
	$(document).ready(function(){
		 jQuery.facebox(strMensagem);
	})
}

function ValidaComentario(id){
	
	var msg = "";
	if(document.getElementById("txtNome" + id).value ==""){
		msg += "Preencha seu nome\n";
	}
	if(document.getElementById("txtEmail" + id).value ==""){
		msg += "Preencha seu E-mail\n";
	}
	if(document.getElementById("txtMensagem" + id).value ==""){
		msg += "Preencha seu Mensagem\n";
	}
	if(msg != "")
	{
		alert(msg);
		return false;
	}
	
}


function abrir(strMensagem)
{
	$(document).ready(function(){
		 jQuery.facebox(strMensagem);
	})
}

var reEmail1 = /^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
var reEmail2 = /^[\w-]+(\.[\w-]+)*@(([\w-]{2,63}\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
var reEmail3 = /^[\w-]+(\.[\w-]+)*@(([A-Za-z\d][A-Za-z\d-]{0,61}[A-Za-z\d]\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/;
var reEmail = reEmail3;
function VerificaEmail(stremail)
{
	if (reEmail.test(stremail)) {
		return true;
	} else if (stremail != null && stremail != "") {
		return false
	}
}

function validaFale(){

    msg = "";
    if(document.getElementById("txtNome").value == ""){
        msg = "Preencha o campo <strong>Nome</strong>!<br />";
    }
    
    if(document.getElementById("txtEmail").value == ""){
        msg += "Preencha o campo <strong>E-mail</strong>!<br />";
    }
    else
    {
        if(!VerificaEmail(document.getElementById("txtEmail").value))
        {
            msg += "<strong>E-mail inv&aacute;lido</strong>!<br />";
        }
    }
	
	if(document.getElementById("txtEmpresa").value == ""){
        msg += "Preencha o campo <strong>Empresa</strong>!<br />";
    }
	
	if(document.getElementById("txtMensagem").value == ""){
        msg += "Preencha o campo <strong>Mensagem</strong>!<br />";
    }
	
	if(msg != ""){
        msg = "<h2 class='Aamerelo Aalerta'></h2>\n<p><br /><br />" + msg + "</p>";
        abrir(msg);
        return false;
    }
	
}

function validaVisistante(){

    msg = "";
    if(document.getElementById("txtNome").value == ""){
        msg = "Preencha o campo <strong>Nome</strong>!<br />";
    }
    
    if(document.getElementById("txtEmail").value == ""){
        msg += "Preencha o campo <strong>E-mail</strong>!<br />";
    }
    else
    {
        if(!VerificaEmail(document.getElementById("txtEmail").value))
        {
            msg += "<strong>E-mail inv&aacute;lido</strong>!<br />";
        }
    }
	
	if(document.getElementById("txtTelefone").value == ""){
        msg += "Preencha o campo <strong>Telefone</strong>!<br />";
    }
	
	if(document.getElementById("txtEndereco").value == ""){
        msg += "Preencha o campo <strong>Endereco</strong>!<br />";
    }
	
	if(document.getElementById("txtBairro").value == ""){
        msg += "Preencha o campo <strong>Bairro</strong>!<br />";
    }
	
	if(document.getElementById("txtCep").value == ""){
        msg += "Preencha o campo <strong>Cep</strong>!<br />";
    }
	if(document.getElementById("txtCidade").value == ""){
        msg += "Preencha o campo <strong>Cidade</strong>!<br />";
    }

	if(document.getElementById("txtEstado").value == "0"){
        msg += "Selecione um <strong>Estado</strong>!<br />";
    }
	
	if(document.getElementById("txtFaixa").value == "0"){
        msg += "Selecione uma <strong>Faixa Et&aacute;ria</strong>!<br />";
    }
	if(document.getElementById("txtComo").value == "0"){
        msg += "Selecione a op&ccedil;&atilde;o <strong>como ficou sabendo da MixShow</strong>!<br />";
    }	
	if(msg != ""){
        msg = "<h2 class='Aamerelo Aalerta'></h2>\n<p><br /><br />" + msg + "</p>";
        abrir(msg);
        return false;
    }	
}

function validaExpositor(){

    msg = "";
   
	if(document.getElementById("txtRazao").value == ""){
        msg += "Preencha o campo <strong>Raz&atilde;o Social</strong>!<br />";
    }
	
	if(document.getElementById("txtNomeFantasia").value == ""){
        msg += "Preencha o campo <strong>Nome Fantasia</strong>!<br />";
    }
	
	if(document.getElementById("txtCnpj").value == ""){
        msg += "Preencha o campo <strong>CNPJ</strong>!<br />";
    }
	
	if(document.getElementById("txtInscricao").value == ""){
        msg += "Preencha o campo <strong>Inscri&ccedil;&atilde;o Estadual</strong>!<br />";
    }
	
	
	if(document.getElementById("txtEndereco2").value == ""){
        msg += "Preencha o campo <strong>Endereco</strong>!<br />";
    }
	
	if(document.getElementById("txtBairro2").value == ""){
        msg += "Preencha o campo <strong>Bairro</strong>!<br />";
    }
	
	if(document.getElementById("txtCep2").value == ""){
        msg += "Preencha o campo <strong>Cep</strong>!<br />";
    }
	if(document.getElementById("txtCidade2").value == ""){
        msg += "Preencha o campo <strong>Cidade</strong>!<br />";
    }

	if(document.getElementById("txtEstado2").value == "0"){
        msg += "Selecione um <strong>Estado</strong>!<br />";
    }
	
	if(document.getElementById("txtAtuacao").value == "0"){
        msg += "Selecione uma <strong>&Aacute;rea de Atua&ccedil;&atilde;o</strong>!<br />";
    }
	if(document.getElementById("txtPecas").value == ""){
        msg += "Preencha o campo <strong>N&uacute;umero de Pe&ccedil;as</strong>!<br />";
    }
	 if(document.getElementById("txtNome2").value == ""){
  		msg += "Preencha o campo <strong>Nome do Responsavel</strong>!<br />";
    }
    
    if(document.getElementById("txtEmail2").value == ""){
        msg += "Preencha o campo <strong>E-mail</strong>!<br />";
    }
    else
    {
        if(!VerificaEmail(document.getElementById("txtEmail2").value))
        {
            msg += "<strong>E-mail inv&aacute;lido</strong>!<br />";
        }
    }
	
	if(document.getElementById("txtTelefone2").value == ""){
        msg += "Preencha o campo <strong>Telefone</strong>!<br />";
    }
	
	if(document.getElementById("txtRg").value == ""){
        msg += "Preencha o campo <strong>RG</strong>!<br />";
    }
	
	if(document.getElementById("txtCpf").value == ""){
        msg += "Preencha o campo <strong>Cpf</strong>!<br />";
    }
	
	if(document.getElementById("txtComo2").value == "0"){
        msg += "Selecione a op&ccedil;&atilde;o <strong>como ficou sabendo da MixShow</strong>!<br />";
    }	
	if(msg != ""){
        msg = "<h2 class='Aamerelo Aalerta'></h2>\n<p><br /><br />" + msg + "</p>";
        abrir(msg);
        return false;
    }	
}

// JavaScript Document

// FACEBOX
	$(function() {
			$('.gallery a.ligh').lightBox();
	});

