//apaga foto dos usuarios vips
function apaga_foto(id, titulo) {
	if (confirm('Deseja realmente excluir a foto "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/minhasfotos/'+id+'/apagar_foto.html';
	}
}

//apaga evento
function remove_evento(id, titulo) {
	if (confirm('Deseja realmente excluir o evento "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/meuseventos/'+id+'/apagar_evento.html';
	}
}

//apagar recado
function apaga_recado(id, titulo) {
	if (confirm('Deseja realmente excluir o recado "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/recado/'+id+',99/apagar_recado.html';
	}
}

//apagar recado
function cancela_evento(id, titulo) {
	if (confirm('Deseja cancelar sua participação no evento \n"' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/eventos/'+id+',99/cancelar_evento.html';
	}
}

//remover albums
function apaga_album(id, titulo,msg) {
	if (confirm('Deseja realmente excluir o Álbum "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/minhasfotos/'+id+',89,'+msg+'/apagar_album.html';
	}
}

//remove amigo
function remove_amigo(id, msg, titulo) {
	if (confirm('Deseja realmente remover o contato "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/contatos/'+id+',99,'+msg+'/apagar_amigo.html';
	}
}

//remove grupo
function remove_grupo(id, titulo, msg) {
	if (confirm('Deseja realmente remover o grupo "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/grupos/'+id+',99,'+msg+'/apagar_grupo.html';
	}
}

//abandonar grupo
function abandonar_grupo(id, titulo, msg) {
	if (confirm('Deseja realmente sair do grupo "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/grupos/'+id+',97,'+msg+'/abandonar_grupo.html';
	}
}

//abandonar evento
function abandonar_evento(id, titulo) {
	if (confirm('Deseja realmente sair do evento "' + titulo + '" ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/meuseventos/'+id+'/abandonar_evento.html';
	}
}

//remove torpedo
function remove_torpedo(id, msg) {
	if (confirm('Deseja realmente remover este torpedo?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/pessoa/'+id+',99,'+msg+'/apaga_torpedo.html';
	}
}

//remove video
function remove_video(id, titulo, msg) {
	if (confirm('Deseja realmente remover o video '+titulo+'?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/videos/'+id+',99,'+msg+'/apaga_video.html';
	}
}

//remove usuario do grupo
function remove_usuario_grupo(id, user) {
	if (confirm('Deseja realmente remover este membro do grupo ?')) {
		window.location = LB_ROOT_DIR + 'entretenimento/grupo/'+id+',99,'+user+'/remove_contato_grupo.html';
	}
}

//mostra informações gerais
function adicionar_geral(campo, label, valor){
	if (document.getElementById(campo).style.display == 'none') { 
		document.getElementById(campo).style.display='';
		document.getElementById(label).innerHTML = null;		
	} else {
		document.getElementById(campo).style.display='none';
		document.getElementById(label).innerHTML = valor;
	}
}

//mostra torpedo
function mostra_torpedo() {
	if (document.getElementById('box-cadastro').style.display == 'none') { 
		document.getElementById('box-cadastro').style.display='';
		document.getElementById('label_cria_torpedo').innerHTML = '';		
	} else {
		document.getElementById('box-cadastro').style.display='none';
		document.getElementById('label_cria_torpedo').innerHTML = 'enviar torpedo »';
	}
}

//validar cadastro
function validar_cadastro() {
	if(document.frm_cadastro.email.value == ''){
		alert("Favor preencher o campo Email!!");
		document.frm_cadastro.email.focus();
		return false;
	}
	
	if(document.frm_cadastro.senha.value == '') {
		alert("Favor preencher o campo Senha!!");
		document.frm_cadastro.senha.focus();
		return false;
	}
	
	if (document.frm_cadastro.senha.value.length < 6) {
		alert('Sua senha deve de ter mais de cinco caracteres.');
		document.frm_cadastro.senha.focus();
		return false;
	}
	
	
	if (document.frm_cadastro.senha.value != document.frm_cadastro.nova_senha.value) {
		alert("As senhas não confirmam, favor digitar novamente!!");
		document.form.nova_senha.focus();
		return false;
	}

	if(document.frm_cadastro.nome.value == '') {
		alert("Favor preencher o campo nome!!");
		document.frm_cadastro.nome.focus();
		return false;
	}
	
	if(document.frm_cadastro.apelido.value == '') {
		alert("Favor preencher o campo Apelido!!");
		document.frm_cadastro.apelido.focus();
		return false;
	}
	
	if(document.frm_cadastro.palavra.value == ''){
		alert("Favor preencher o campo Valor da Figura!!");
		document.frm_cadastro.palavra.focus();
		return false;
	}

return true;
}

//validar cadastro video
function validar_cadastro_video(form) {
	if(form.url.value == '') {
		alert("Favor preencher o campo URL video YouTube!!");
		form.url.focus();
		return false;
	}
	
	if(form.titulo.value == '') {
		alert("Favor preencher o campo Título!!");
		form.titulo.focus();
		return false;
	}
	
return true;
}

//validar cadastro video
function validar_cadastro_recado(form) {
	if(form.titulo.value == '') {
		alert("Favor preencher o campo Título!!");
		form.titulo.focus();
		return false;
	}
	
	if(form.texto.value == '') {
		alert("Favor preencher o campo Mensagem!!");
		form.texto.focus();
		return false;
	}
	
return true;
}

//validar cadastro evento
function validar_cadastro_evento(form) {
	if(form.ac30chamada.value == '') {
		alert("Favor preencher o campo Chamada do Evento!!");
		form.ac30chamada.focus();
		return false;
	}
	
	if(form.ac30titulo.value == '') {
		alert("Favor preencher o campo Título!!");
		form.ac30titulo.focus();
		return false;
	}
	
	if(form.ad30data.value == '') {
		alert("Favor preencher o campo Data!!");
		form.ad30data.focus();
		return false;
	}
	
return true;
}

//validar cadastro grupo
function validar_cadastro_grupo(form) {
	if(form.nome.value == '') {
		alert("Favor preencher o campo Nome!");
		form.nome.focus();
		return false;
	}
	
	return true;
}


//validar alterar cadastro
function validar_editar_cadastro() {
	if(document.frm_cadastro.nome.value == '') {
		alert("Favor preencher o campo nome!!");
		document.frm_cadastro.nome.focus();
		return false;
	}
	
	if(document.frm_cadastro.apelido.value == '') {
		alert("Favor preencher o campo Apelido!!");
		document.frm_cadastro.apelido.focus();
		return false;
	}
	
return true;
}

//validar alterar acesso
function validar_editar_acesso() {
	if(document.frm_acesso.email.value == ''){
		alert("Favor preencher o campo Email!!");
		document.frm_acesso.email.focus();
		return false;
	}
	
	if (document.frm_acesso.senha_atual.value != '') {
		if(document.frm_acesso.senha.value == '') {
			alert("Favor preencher o campo Senha!!");
			document.frm_acesso.senha.focus();
			return false;
		}
		
		if (document.frm_acesso.senha.value.length < 6) {
			alert('Sua senha deve de ter mais de cinco caracteres.');
			document.frm_acesso.senha.focus();
			return false;
		}
		
		if (document.frm_acesso.senha.value != document.frm_acesso.nova_senha.value) {
			alert("As senhas não confirmam, favor digitar novamente!!");
			document.frm_acesso.nova_senha.focus();
			return false;
		}
	}
	return true;
}


///validar torpedo
function validar_torpedo() {
	if(document.frm_torpedo.msg.value == ''){
		alert("Favor preencher o campo Mensagem!!");
		document.frm_torpedo.msg.focus();
		return false;
	}

return true;
}