function testeAcesso(){
	//alert('geral.js');
}
function IluminarCaixa(box,texto){
	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='F5F5F5';
		box.style.color='555555';
	}
}
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 validaContato(){
	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('fd_assunto',3)&&!valorIgual('fd_assunto','Assunto')){esconde('depor_AlertaAssunto');}
	else{mostra('depor_AlertaAssunto');falha=falha+1;}
	if(checaText('ta_depoimento',10)&&!valorIgual('ta_depoimento','Escreva sua mensagem')){esconde('depor_AlertaDepoimento');}
	else{mostra('depor_AlertaDepoimento');falha=falha+1;}
	if(falha==0){return true;}
	return false;
}
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;
}


