function testeAcesso(){
	//alert('geral.js');
}
function pubPrv(aid,status){
	document.getElementById("ifPrv").src='../aplicativo/alterar_propriedade_link.php?id='+aid+'&status='+status;
}
function apagarLink(aid){
	document.getElementById("ifRem").src='../aplicativo/remover_links.php?id='+aid;
}
function IluminarCaixa(box,texto){
	if(box.value=="Senha"){
		document.getElementById("senhaLogin").value='';
		document.getElementById("senhaLogin").type='password';
		box.style.color='000000';
	}
	if(box.value==texto){
		//box.style.backgroundColor='FFFFFF';
		box.style.color='000000';
		box.value='';
	}
}
function remPss(box,texto){
	if(box.value==''){
		box.value=texto;
		//box.style.backgroundColor='FFFFFF';
		box.style.color='999999';
	}
	if(document.getElementById("senha").value=='' ||document.getElementById("senha").value=="Senha"){
		document.getElementById("senha").value='Senha';
		document.getElementById("senha").type='text';
	}
}
function addPss(box,texto){
	if(box.value=="Senha"){
		document.getElementById("senha").value='';
		document.getElementById("senha").type='password';
		document.getElementById("senha").style.color='000000';
	}
	if(box.value==texto){
		//box.style.backgroundColor='FFFFFF';
		box.style.color='000000';
		box.value='';
	}
}
function ApagarCaixa(box,texto){
	if(box.value==''){
		box.value=texto;
		//box.style.backgroundColor='FFFFFF';
		box.style.color='999999';
	}
	if(document.getElementById("senhaLogin").value=="" ||document.getElementById("senhaLogin").value=="Senha"){
		document.getElementById("senhaLogin").value='Senha';
		document.getElementById("senhaLogin").type='text';
	}
}
function esconderOpcaoPgInicial(){
	document.getElementById('putPgIndex').style.display='none';
		document.getElementById("ocultarPagIni").src='../aplicativo/ocultar.php';
}
function validaMC(){
	var sobre=document.getElementById("descL").value;
	falha=0;
	if(checaText('descL',3)&&!valorIgual('descL','')){esconde('depor_AlertaSobre');}
	else{mostra('depor_AlertaSobre');falha=falha+1;}
	if(falha==0){return true;}
	return false;
}
function buscaLinks(){
	var termoBusca=document.getElementById("busca").value;
	if(checaText('busca',3)&&!valorIgual('busca','Busca')){falha=0;}
	else{falha=1;}
	if(falha==0){
		form1.action='buscar/'+termoBusca;
		form1.submit();
	}
	return false;	
}
function linkRelAlt(descEdi2){
	if(descEdi2=="imgDesc"){ document.getElementById("imgDesc").style.display='none';}
	document.getElementById("descLR").innerHTML='';
	document.getElementById("descL").style.display='block';
	document.getElementById("alterar").style.display='block';
}
function validaDepoimento(){
	estado=document.getElementById('sc_estado').value;
	falha=0;
	if(checaText('fd_nome',3)&&!valorIgual('fd_nome','Nome')){esconde('depor_AlertaNome');}
	else{mostra('depor_AlertaNome');falha=falha+1;}
	if(validar_email('fd_email')){esconde('depor_AlertaEmail');}
	else{mostra('depor_AlertaEmail');falha=falha+1;}
	if(estado!="0"){esconde('depor_AlertaEstado');}
	else{mostra('depor_AlertaEstado');falha=falha+1;}
	if(checaText('ta_depoimento',10)&&!valorIgual('ta_depoimento','Escreva seu depoimento')){esconde('depor_AlertaDepoimento');}
	else{mostra('depor_AlertaDepoimento');falha=falha+1;}
	if(falha==0){return true;}
	return false;
}
function validaCadastro(){
	falha=0;
	if(checaText('fd_nome',3)&&!valorIgual('fd_nome','Nome')){esconde('alertaNome');}
	else{mostra('alertaNome');falha=falha+1;}
	if(checaText('apelido',3)&&!valorIgual('apelido','Apelido')){esconde('alertaApelido');}
	else{mostra('alertaApelido');falha=falha+1;}
	if(validar_email('fd_email')){esconde('alertaEmail');}
	else{mostra('alertaEmail');falha=falha+1;}
	if(checaText('foto',3)&&!valorIgual('foto','Foto')){esconde('alertaFoto');}
	else{mostra('alertaFoto');falha=falha+1;}
	if(checaText('senha',6)&&!valorIgual('senha','Senha')){esconde('alertaSenha');}
	else{mostra('alertaSenha');falha=falha+1;}

	if(checaText('veriVeri',6) &&!valorIgual('veriVeri','Cod Verificador')){
		var teste=document.getElementById("testeVeri").value;
		var veriVeri=document.getElementById("veriVeri").value;
		if(teste!=veriVeri){
			codigoVerify();
		}
		esconde('alertaVerificador');		
	}
	else{mostra('alertaVerificador');falha=falha+1;}
	testeApelido('apelido',document.getElementById("apelido").value,"apelidoExiste","email",document.getElementById("fd_email").value,"emailExiste");
	if(falha==0 && document.getElementById("cadcad").value=="okay" && document.getElementById("apelidoConf").value==1 && document.getElementById("emailConf").value==1 && document.getElementById("testeVeri").value!=""){
		document.getElementById("sloadGif").style.display='block';
		//document.getElementById("alertaFoto").style.display="none";
		document.getElementById("formCad").target='ifrFoto';
		formCad.action='aplicativo/verificarFoto.php';
		formCad.submit();		
		//return true;
	}
	return false;
}
function codigoVerify(){
	var campo=document.getElementById("veriVeri").value;
	document.getElementById("ifrVeri").style.display='none';
	document.getElementById("ifrVeri").src='aplicativo/verificador.php?resVeri='+campo;
}
function validaCadastroUrl(){
	falha=0;
	if(checaText('fd_nome',3)&&!valorIgual('fd_nome','Nome do Site')){esconde('alertaNome');}
	else{mostra('alertaNome');falha=falha+1;}
	if(checaText('site',3)&&!valorIgual('site','Site')){esconde('alertaSite');testeUrl();}
	else{mostra('alertaSite');falha=falha+1;}
	if(falha==0 && document.getElementById('iconeValue').value!=""){return true;}
	return false;
}
function prediletos(valor2,aid){
	valor=document.getElementById('cont'+aid).value;
	/*if(valor==0){valor=1;}
	else{valor=0;}	*/
	document.getElementById("ifPrediletos").src='../aplicativo/favoritarPrediletos.php?valor='+valor+'&aid='+aid;
}
function testeUrl(){
	var site=document.getElementById("site").value;
	document.getElementById("siteIF").src='../aplicativo/verificar_site.php?url='+site;
}
function editarPred(aid){
	var x=document.getElementById(aid).innerHTML='dsadsa';
}
function validaReceberFrase(){
	falha=0;
	if(checaText('fd_nome',3)&&!valorIgual('fd_nome','Nome')){esconde('depor_AlertaNome');}
	else{mostra('depor_AlertaNome');falha=falha+1;}
	if(validar_email('fd_email')){esconde('depor_AlertaEmail');}
	else{mostra('depor_AlertaEmail');falha=falha+1;}
	if(valorIgual('select_nasc_dia','0')||valorIgual('select_nasc_mes','0')||valorIgual('select_nasc_ano','0')){mostra('depor_AlertaData');falha=falha+1;}
	else{esconde('depor_AlertaData');}
	if(valorIgual('select_sexo','0')){mostra('depor_AlertaSexo');falha=falha+1;}
	else{esconde('depor_AlertaSexo');}
	if(falha==0){return true;}
	return false;
}
function validarReativar(){
	falha=0;
	if(validar_email('fd_email')){esconde('depor_AlertaEmail');}
	else{mostra('depor_AlertaEmail');falha=falha+1;}
	if(falha==0){return true;}
	return false;
}

function mostarFormularioDepoimento(){
	esconde('depor_deixe');
	mostra('depor_formulario');
}
function fecharEnviarDepoimento(){
	esconde('depor_formulario');
	mostra('depor_deixe');
}
function twittarIsto(titulo,caminho){
	comprimentoTitulo=titulo.length;
	if(comprimentoTitulo>90){conteudo = titulo.substr(0,87)+'...';}
	else{conteudo=titulo;}
	twtUrl='http://www.fernandolapolli.com.br/'+caminho;
	var twtLink = 'http://twitter.com/home?status='+encodeURIComponent(conteudo + ' ' + twtUrl);
	//Twitterthis
	window.open("http://twitthis.com/twit?url="+encodeURIComponent(twtUrl)+"&title="+encodeURIComponent(conteudo),"sharer","toolbar=0,status=0,width=580,height=600");
}
function faceBookIsto(t,u){
	u='http://www.fernandolapolli.com.br/'+u;
	window.open("http://www.facebook.com/sharer.php?u="+encodeURIComponent(u)+"&t="+encodeURIComponent(t),"sharer","toolbar=0,status=0,width=626,height=436");
}
function gostei(id){
	var raiz=document.getElementById('gosteiBase').value
	document.getElementById('iframeGostei').src=raiz+"depoimentos/gostei.php?d="+id;
}
function gostaram(id,qts,repeteco){
	if(repeteco==1){
		document.getElementById('linkGost'+id).innerHTML = 'voc&ecirc; j&aacute; registrou';
		document.getElementById('linkGost'+id).style.backgroundColor='#FFFFDD';
	}else{
		document.getElementById('linkGost'+id).innerHTML = 'interesse registrado';
		document.getElementById('linkGost'+id).style.backgroundColor='#DDFFE5';
		if(qts>1){document.getElementById('textGost'+id).innerHTML = qts+' pessoas gostaram';}		
		else{document.getElementById('textGost'+id).innerHTML = '1 pessoa gostou';}
		document.getElementById('textGost'+id).style.display="block";
	}
}
function contarD(text,conta,total){
	ta = document.getElementById(text);
	co = document.getElementById(conta);
	to=parseInt(total);
	if(ta.value.length > to){
		var va = ta.value.substring(0,to);
		ta.value=va;
	}
	co.value=ta.value.length + ' de '+to;
}


