// JavaScript Document
var IE = document.all?true:false;
var Contador;
var Album=1;
var Ajax = new Array();
var Titulo='Site Oficial do Deputado Estadual Nelson Martins';
if(document.title>'') document.title+=' - '+Titulo; else document.title=Titulo;
function nuevoAjax(){ // Função que inicializa Ajax em qualquier Navegador
	var xmlhttp;
 	try {
 		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 	} catch (e) {
 		try {
 			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
 		} catch (ex) {
			try {
				xmlhttp = new XMLHttpRequest();
			} catch (exc) {
	 			xmlhttp = false;
			}
 		}
  	}
	return xmlhttp;
}
function Linkar(Pagina, Zona, Variables){ // Função que atualiza qualquer objeto Ajax
	if (Pagina!='#'){
		Ajax[Zona]=nuevoAjax();
		Ajax[Zona].open("POST", Pagina+".php", true);
		Ajax[Zona].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		Ajax[Zona].onreadystatechange=function() {
			if (Ajax[Zona].readyState==4) {
				document.getElementById(Zona).innerHTML = Ajax[Zona].responseText;
			} else {
				document.getElementById(Zona).innerHTML = "Carregando...";
			}
		}
		Ajax[Zona].send(Variables);
	}
}
function LinkarFotos(Pagina, Zona, Variables){ // Função que atualiza qualquer objeto Ajax
	if (Pagina!='#'){
		Ajax[Zona]=nuevoAjax();
		Ajax[Zona].open("POST", Pagina+".php", true);
		Ajax[Zona].setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		Ajax[Zona].onreadystatechange=function() {
			if (Ajax[Zona].readyState==4) {
				document.getElementById(Zona).innerHTML = Ajax[Zona].responseText;
				LlenaVariable();
			} else {
				document.getElementById(Zona).innerHTML = "Carregando...";
			}
		}
		Ajax[Zona].send(Variables);
	}
}
//                                                               +---------------------+
//---------------------------------------------------------------¦ FIN DE FUNÇÕES AJAX ¦
//                                                               +---------------------+
function ChequeaEmail(Email){
	return ((Email.indexOf("@")>2 && Email.lastIndexOf(".")<Email.length-2 && Email.lastIndexOf(".")>Email.indexOf("@")+2 && Email.indexOf(" ")==-1 && Email.indexOf("@")==Email.lastIndexOf("@")));
}
function TeleFormat(Obj, Ev) {
	strCheck = '0123456789';
	Salida='';
	Tope=8;
	whichCode = (window.Event) ? Ev.which : Ev.keyCode;
	if (whichCode == 13) return true;  // Enter
	if(whichCode == 8)Tope=10;
	Valor=Obj.value;
	if(Valor.length==14 && whichCode != 8) return false;
	for(n=0;n<Valor.length;n++){
		Letra=Valor.substring(n, n+1);
		if(strCheck.indexOf(Letra)!=-1){
			Salida+=Letra;
		}
	}
		if(Salida.length>(Tope-5)) Salida=Salida.substring(0,Salida.length-(Tope-5))+'.'+Salida.substring(Salida.length-(Tope-5),Salida.length);
		if(Salida.length>Tope) Salida="("+Salida.substring(0,Salida.length-Tope)+') '+Salida.substring(Salida.length-Tope,Salida.length);
	Obj.value=Salida;
}
function FontMais(elem){
	Tamano=parseInt(document.getElementById(elem).style.fontSize)||12;
	if(Tamano<=22) document.getElementById(elem).style.fontSize=(Tamano+2)+'px';
}
function FontMenos(elem){
	Tamano=parseInt(document.getElementById(elem).style.fontSize)||12;
	if(Tamano>=8) document.getElementById(elem).style.fontSize=(Tamano-2)+'px';
}
function iconoIn(imagen, altura){
	if(altura) imagen.style.backgroundPosition=altura+'px 0px';
	else imagen.style.backgroundPosition='24px 0px';
}
function iconoOut(imagen){
	imagen.style.backgroundPosition='0px 0px';
}
function sizeFont (elem, acao){
	var tamInic = 13;
	var tamMin = 4;
	var tamMax = 25;
	if (document.getElementById(elem).style.fontSize == "") {
		var tamFonte = tamInic;
	}else{
		var tamFonte = parseInt(document.getElementById(elem).style.fontSize);
	}
	switch (acao){
		case '+':
			if (tamFonte < tamMax)
			document.getElementById(elem).style.fontSize = (tamFonte + 2) + "px";
			break;
		case '-':
			if (tamFonte > tamMin)
			document.getElementById(elem).style.fontSize = (tamFonte - 2) + "px";
			break;
	}
}
function AbrirFoto(PrePasta, variables) {
	var widthCrop='238';
	if(IE) widthCrop='265';
	var Foto=window.open(PrePasta+'php/TeiaCrop.php?'+variables, 'Escolhe_uma_foto', 'width='+widthCrop+',height=41,left=200,top=200,scrollbars=0,status=0,titlebar=0,modal=1,dependent=1');
}
function paraAlbunes(){
	clearInterval(Contador);
}
function mueveAlbunes(accion, tope){
	eval(accion+'Albunes('+tope+')');
	Contador=setInterval(accion+'Albunes('+tope+')', 500);
}
function SubeAlbunes(tope){
	if(Album<tope-3) {
		document.getElementById('Albunes').style.top=(parseFloat(document.getElementById('Albunes').style.top)-77)+'px';
		Album++;
	}
}
function BajaAlbunes(tope){
	if(Album>1){
		document.getElementById('Albunes').style.top=(parseFloat(document.getElementById('Albunes').style.top)+78)+'px';
			Album--;
	}
}
function Ativa(Obj, Posit){
	if(!Posit || Posit=='In'){
		if(Obj.value=='Seu e-mail') Obj.value='';
		Obj.style.color='#000000';
	} else if(Posit=='out'){
		if(Obj.value==''){
			Obj.value='Seu e-mail';
			Obj.style.color='#999999';
		}
	}
}
//																				+-------------+
//																				¦ COMENTARIOS ¦
//																				+-------------+
function None(Obj){
	if(Obj.id) document.getElementById('Err'+Obj.id).style.display='none';
	else document.getElementById('Err'+Obj).style.display='none';
	return true;
}
function Inline(Obj){
	if(Obj.id) document.getElementById('Err'+Obj.id).style.display='inline';
	else document.getElementById('Err'+Obj).style.display='inline';
	return false;
}
function Evalua(Obj){
	if(document.getElementById(Obj).value=='') return Inline(Obj);
	else return true;
		
}
function Element(Obj){
	return document.getElementById(Obj);
}
function EnviarComentario(Zona, Contenido, Pasta){
	var Bom=true, Nome='', Email='';
	if(Evalua('ComentNome')) Nome=Element('ComentNome').value; else Bom=false;
	if(ChequeaEmail(Element('ComentEmail').value)) Email=Element('ComentEmail').value; else Bom=Inline('ComentEmail');
	if(Element('ComentTexto').value!='' && Bom) Linkar(Pasta+'comentarios2', 'Comentarios', 'Nome='+Nome+'&Email='+Email+'&Mensagem='+Element('ComentTexto').value+'&Zona='+Zona+'&Conte='+Contenido+'&PrePasta='+Pasta);
}
//																+--------------------+
//																¦ FIM DE COMENTARIOS ¦
//																+--------------------+
//                                                                                +--------------+
//--------------------------------------------------------------------------------¦ FALE CONOSCO ¦
//                                                                                +--------------+
function EnviaFaleConosco(EmailCad, PrePasta){
	var Bom=true, Nome='', Email='', Cidade='', Mensagem='', Mala=0;
	var Asunto=document.getElementById('FaleAsunto').options[document.getElementById('FaleAsunto').selectedIndex].value;
	if(document.getElementById('FaleMala').checked) Mala=1;
	if(EmailCad==''){
		Nome=document.getElementById('FaleNome').value;
		Cidade=document.getElementById('FaleCidade').value;
		Email=document.getElementById('FaleEmail').value;
		if(Nome==''){
			document.getElementById('FaleNomeErr').style.display='inline';
			Bom=false;
		} else {
			document.getElementById('FaleNomeErr').style.display='none';
		}
		if(Email==''){
			document.getElementById('FaleEmailErr').style.display='inline';
			Bom=false;
		} else if(ChequeaEmail(Email)){
			document.getElementById('FaleEmailErr2').style.display='none';
		} else {
			document.getElementById('FaleEmailErr2').style.display='inline';
			Bom=false;
		}
		if(Cidade==''){
			document.getElementById('FaleCidadeErr').style.display='inline';
			Bom=false;
		} else {
			document.getElementById('FaleCidadeErr').style.display='none';
		}
	} else Email=EmailCad;
	Mensagem=document.getElementById('FaleMensagem').value;
	if(Mensagem==''){
		document.getElementById('FaleMensagemErr').style.display='inline';
		Bom=false;
	} else {
		document.getElementById('FaleMensagemErr').style.display='none';
	}
	if(Bom)	Linkar(PrePasta+'contato/faleForm', 'faleForm', 'Nome='+Nome+'&Email='+Email+'&Cidade='+Cidade+'&Asunto='+Asunto+'&Mensagem='+Mensagem+'&Mala='+Mala+'&Grabar=yes');
}
//                                                               +---------------------+
//---------------------------------------------------------------¦ FIM DE FALE CONOSCO ¦
//                                                               +---------------------+
//                                                                                    +----------+
//------------------------------------------------------------------------------------¦ CADASTRO ¦
//                                                                                    +----------+
function RellenaCadastro(Id, PrePasta){
	Bom=true;
	Email=document.getElementById('CadastroEmail').value;
	if(!ChequeaEmail(Email)){
		document.getElementById('ErrCadastroEmail').style.display='inline';
		Bom=false;
	}
	Senha=document.getElementById('CadastroSenha').value;
	if(Senha==''){
		document.getElementById('ErrCadastroSenha').style.display='inline';
		Bom=false;
	}
	if(Bom){
		if(document.getElementById('MostrarSim').checked) Mostrar=1; else Mostrar=0;
		Nome=document.getElementById('CadastroNome').value;
		Apelido=document.getElementById('CadastroApelido').value;
		Foto=document.getElementById('CadastroFoto').alt;
		Linkar(PrePasta+'php/cadastro', 'FormularioCadastro', 'Salvar='+Id+'&CampoEmail='+Email+'&CampoSenha='+Senha+'&CampoMostrar='+Mostrar+'&CampoNome='+Nome+'&CampoApelido='+Apelido+'&CampoFoto='+Foto);
	}
}
function Chequeo(Obj){
	document.getElementById('MostrarSim').checked=false;
	document.getElementById('MostrarNao').checked=false;
	Obj.checked=true;
}
function ConfirmaIndex(PrePasta){
	Email=document.getElementById('IndexEmail').value;
	if(ChequeaEmail(Email))	Linkar(PrePasta+'ajax/cadastroIndex', 'form1', 'Email='+Email);
}
function VuelveIndex(PrePasta){
	Linkar(PrePasta+'ajax/cadastroIndex', 'form1', '');
}
function CadastraEmail(){
	Email=document.getElementById('EmailCadastro').value;
	if(ChequeaEmail(Email)){
		document.getElementById('EmailCadastro').value='';
		Linkar('/contato/cadastro', 'EmailCadastroAcept', 'Email='+Email);
	} else {
		document.getElementById('EmailCadastroErr').style.display='block';
	}
}
function SairMala(){
	Email=document.getElementById('EmailCadastro').value;
	if(ChequeaEmail(Email)){
		document.getElementById('EmailCadastro').value='';
		Linkar('/contato/sairMala', 'EmailCadastroAcept', 'Email='+Email);
	} else {
		document.getElementById('EmailCadastroErr').style.display='block';
	}
}
function EditarCadastro(Email){
	if(Email=='') Email=document.getElementById('EmailCadastro').value;
	if(Email!='') window.location="/contato/dadosusuario.php?Email="+Email;
}
function AtualizarDadosUsuario(Id){
	Email=document.getElementById('dadosEmail').value;
	Senha=document.getElementById('dadosSenha1').value;
	Senha2=document.getElementById('dadosSenha2').value;
	Bom=true;
	if(Email!='' && !ChequeaEmail(Email)){
		document.getElementById('dadosEmailErr').style.display='inline';
		Bom=false;
	}
	if(Senha!=Senha2){
		document.getElementById('dadosSenha1Err').style.display='inline';
		Bom=false;
	}
	if(Bom) {
		Nome=document.getElementById('dadosNome').value;
		Telefone=document.getElementById('dadosTelefone').value;
		Bairro=document.getElementById('dadosBairro').value;
		Cidade=document.getElementById('dadosCidade').value;
		Foto=document.getElementById('dadosFoto').alt;
		Linkar('atualForm', 'atualForm', 'CampoNome='+Nome+'&CampoEmail='+Email+'&CampoTelefone='+Telefone+'&CampoBairro='+Bairro+'&CampoCidade='+Cidade+'&CampoFoto='+Foto+'&CampoSenha='+Senha+'&DadosSalva=yes&DadosId='+Id);
	}
}
function ColorMail(Obj){
	if(Obj.value==''){
		Obj.value='Digite seu e-mail';
		Obj.style.color='#999999';
	}
}
function MailFocus(Obj){
	if(Obj.value=='Digite seu e-mail'){
		Obj.value='';
		Obj.style.color='';
	}
}
//                                                                   +-----------------+
//-------------------------------------------------------------------¦ FIM DE CADASTRO ¦
//                                                                   +-----------------+
//                                                                         +----------------------+
//-------------------------------------------------------------------------¦ ENVIAR PARA UM AMIGO ¦
//                                                                         +----------------------+
function EnviaAmigo(EmailCad, Noticia, PrePasta){
	var Bom=true, Nome='', Email='', Nome2='', Email2='', Mensagem='', Mala=0;
	if(document.getElementById('EnviarMala').checked) Mala=1;
	Nome=document.getElementById('EnviarMeuNome').value;
	Email=document.getElementById('EnviarMeuMail').value;
	Nome2=document.getElementById('EnviarSeuNome').value;
	Email2=document.getElementById('EnviarSeuMail').value;
	if(Nome==''){
		document.getElementById('EnviarMeuNomeErr').style.display='inline';
		Bom=false;
	}
	if(ChequeaEmail(Email)==false){
		document.getElementById('EnviarMeuMailErr').style.display='inline';
		Bom=false;
	}
	if(Nome2==''){
		document.getElementById('EnviarSeuNomeErr').style.display='inline';
		Bom=false;
	}
	if(ChequeaEmail(Email2)==false){
		document.getElementById('EnviarSeuMailErr').style.display='inline';
		Bom=false;
	}
	Mensagem=document.getElementById('EnviarMensagem').value;
	if(Bom)	Linkar(PrePasta+'contato/enviaForm', 'enviandoAmigo', 'Id='+Noticia+'&Nome='+Nome+'&Email='+Email+'&Nome2='+Nome2+'&Email2='+Email2+'&Mensagem='+Mensagem+'&Mala='+Mala+'&Enviar=yes');
}
//                                                       +-----------------------------+
//-------------------------------------------------------¦ FIM DE ENVIAR PARA UM AMIGO ¦
//                                                       +-----------------------------+
function NoticiasEnviarComentario(Id){
	Nome=document.getElementById('ComentarioNome').value;
	Email=document.getElementById('ComentarioEmail').value;
	Mensagem=document.getElementById('ComentarioMensagem').value;
	Bom=true;
	if(Nome==''){
		document.getElementById('ComentarioNomeErr').style.display='inline';
		Bom=false;
	}
	if(Email==''){
		document.getElementById('ComentarioEmailErr').style.display='inline';
		Bom=false;
	} else {
		if(!ChequeaEmail(Email)){
			document.getElementById('ComentarioEmailErr2').style.display='inline';
			Bom=false;
		}
	}
	if(Mensagem==''){
		document.getElementById('ComentarioMensagemErr').style.display='inline';
		Bom=false;
	}
	if(Bom) Linkar('/noticias/comentarioform', 'ComentariosNoticia', 'Nome='+Nome+'&Email='+Email+'&Mensagem='+Mensagem+'&ComentarioSalva=yes&Id='+Id);
}
//                                                                                      +--------+
//--------------------------------------------------------------------------------------¦ AGENDA ¦
//                                                                                      +--------+
function AbreDia(Fecha){
	Linkar('ajax/calendario', 'Calendario', 'Fecha='+Fecha);
	Linkar('ajax/eventos', 'eventos', 'Fecha='+Fecha);
}
//                                                                     +---------------+
//---------------------------------------------------------------------¦ FIN DE AGENDA ¦
//                                                                     +---------------+
//                                                                                       +-------+
//---------------------------------------------------------------------------------------¦ FOTOS ¦
//                                                                                       +-------+
// NUEVAS FUNCIONES
function AlbumArriba(){
	Temp=parseFloat(document.getElementById('Albums').style.marginTop);
	document.getElementById('Albums').style.marginTop=(Temp-81)+'px';
	AlbumAtual++;
	document.getElementById('FlechaArriba').style.display='inline';
	document.getElementById('ZonaArriba').setAttribute('onclick', 'AlbumAbajo()');
	document.getElementById('ZonaArriba').style.cursor='pointer';
	if(AlbumAtual+AlbumVista==TotalAlbuns+1){
		document.getElementById('FlechaAbajo').style.display='none';
		document.getElementById('ZonaAbajo').removeAttribute('onclick');
		document.getElementById('ZonaAbajo').style.cursor='auto';
	}
}
function AlbumAbajo(){
	Temp=parseFloat(document.getElementById('Albums').style.marginTop);
	document.getElementById('Albums').style.marginTop=(Temp+81)+'px';
	AlbumAtual--;
	document.getElementById('FlechaAbajo').style.display='inline';
	document.getElementById('ZonaAbajo').setAttribute('onclick', 'AlbumArriba()');
	document.getElementById('ZonaAbajo').style.cursor='pointer';
	if(AlbumAtual==1){
		document.getElementById('FlechaArriba').style.display='none';
		document.getElementById('ZonaArriba').removeAttribute('onclick');
		document.getElementById('ZonaArriba').style.cursor='auto';
	}
}
function FotosEscolheAlbum(IdAlbum){
	FotoActual=0;
	AlbumActual=IdAlbum.toString();
	document.getElementById('TituloAlbum').innerHTML='<h1>'+Fotos[AlbumActual]['Titulo']+'</h1>';
	document.getElementById('TituloFoto').innerHTML=Fotos[AlbumActual]['0']['Titulo'];
	document.getElementById('NumeroFoto').innerHTML=1;
	document.getElementById('NumeroFotos').innerHTML=Fotos[AlbumActual].length;
	document.getElementById('ImagemFoto').src='/images/multimidia/fotos/'+IdAlbum+'/'+Fotos[AlbumActual]['0']['Foto'];
	document.getElementById('AutorFoto').innerHTML=Fotos[AlbumActual]['0']['Autor'];
	document.getElementById('DescripcionFoto').innerHTML=Fotos[AlbumActual]['0']['Descripcao'];
}
function MudaFoto(Op){
	if(Op=='/') Op='+'; else clearInterval(Automatico);
	MuestraFoto=parseInt(FotoActual);
	eval('MuestraFoto'+Op+Op);
	if(MuestraFoto==Fotos[AlbumActual].length) MuestraFoto=0;
	if(MuestraFoto==-1) MuestraFoto+=Fotos[AlbumActual].length;
	FotoActual=MuestraFoto.toString();
	MuestraFoto++;
	document.getElementById('TituloFoto').innerHTML=Fotos[AlbumActual][FotoActual]['Titulo'];
	document.getElementById('NumeroFoto').innerHTML=MuestraFoto;
	document.getElementById('ImagemFoto').src='/images/multimidia/fotos/'+AlbumActual+'/'+Fotos[AlbumActual][FotoActual]['Foto'];
	document.getElementById('AutorFoto').innerHTML=Fotos[AlbumActual][FotoActual]['Autor'];
	document.getElementById('DescripcionFoto').innerHTML=Fotos[AlbumActual][FotoActual]['Descripcao'];
}
function AutoFoto(){
	clearInterval(Automatico);
	Automatico = setInterval("MudaFoto('/')",FotoVelocidad*1500);
}
function ParaFoto(){
	clearInterval(Automatico);
}
function botonIn(imagen){
	imagen.src=imagen.src.substring(0,imagen.src.length-5)+'2'+imagen.src.substring(imagen.src.length-4);
}
function botonOut(imagen){
	imagen.src=imagen.src.substring(0,imagen.src.length-5)+'1'+imagen.src.substring(imagen.src.length-4);
}
//                                                                      +--------------+
//----------------------------------------------------------------------¦ FIN DE FOTOS ¦
//                                                                      +--------------+
function ocultaErro(Obj){
	if(Obj.id) document.getElementById('Err'+Obj.id).style.display='none';
	else document.getElementById('Err'+Obj).style.display='none';
}
//                                                                                       +-------+
//---------------------------------------------------------------------------------------¦ MURAL ¦
//                                                                                       +-------+
function LoguearMural(){
	Bom=true;
	Email=document.getElementById('MuralEmail').value;
	Senha=document.getElementById('MuralSenha').value;
	if(ChequeaEmail(Email)==false){
		document.getElementById('ErrMuralEmail').style.display='inline';
		Bom=false;
	}
	if(Senha==''){
		document.getElementById('ErrMuralSenha').style.display='inline';
		Bom=false;
	}
	if(Bom) document.getElementById('MuralLogin').submit();
}
function ConfirmaMensagem(){
	Bom=true;
	Titulo=document.getElementById('MuralTitulo').value;
	Mensagem=document.getElementById('MuralMensagem').value;
	if(Titulo==''){
		document.getElementById('ErrMuralTitulo').style.display='inline';
		Bom=false;
	}
	if(Mensagem==''){
		document.getElementById('ErrMuralMensagem').style.display='inline';
		Bom=false;
	}
	if(Bom) document.getElementById('MuralEnvio').submit();
}
//                                                                      +--------------+
//----------------------------------------------------------------------¦ FIN DE MURAL ¦
//                                                                      +--------------+
//                                                                                     +---------+
//-------------------------------------------------------------------------------------¦ ENQUETE ¦
//                                                                                     +---------+
function ConfirmaVoto(PrePasta){
	var Votos=document.getElementsByName('VotoEnquete');
	for(var n=0;n<Votos.length;n++){
		if(Votos[n].checked) var Voto=Votos[n].value;
	}
	if(Voto) Linkar(PrePasta+'ajax/ConferirResultados', 'ResultadosEnquete', 'Voto='+Voto);
}
//                                                                    +----------------+
//--------------------------------------------------------------------¦ FIN DE ENQUETE ¦
//                                                                    +----------------+
//                                                                                     +---------+
//-------------------------------------------------------------------------------------¦ RANKING ¦
//                                                                                     +---------+
function AbaOver(Aba){
	if(Aba.title==''){
		Aba.style.background='#92b627';
		Aba.style.color='#FFFFFF';
	}
}
function AbaOut(Aba){
	if(Aba.title==''){
		Aba.style.background='#55791a';
		Aba.style.color='#94A760';
	}
}
function AbaClick(Aba, Mensagem){
	Abas=document.getElementById('ContenedorAbas').getElementsByTagName('div');
	for(var n=0;n<Abas.length;n++){
		if(Abas[n].title!=''){
			Abas[n].style.background='#55791a';
			Abas[n].style.color='#94A760';
			Abas[n].style.cursor='pointer';
			Abas[n].title='';
		}
	}
	Aba.title=Mensagem;
	Aba.style.background='#92b627';
	Aba.style.color='#FFFFFF';
	Aba.style.cursor='default';
	if(Aba.id=='Aba01') document.getElementById('Aba01Conteudo').style.display='block';
	else document.getElementById('Aba01Conteudo').style.display='none';
	if(Aba.id=='Aba02') document.getElementById('Aba02Conteudo').style.display='block';
	else document.getElementById('Aba02Conteudo').style.display='none';
	if(Aba.id=='Aba03') document.getElementById('Aba03Conteudo').style.display='block';
	else document.getElementById('Aba03Conteudo').style.display='none';
}
//                                                                     +----------------+
//---------------------------------------------------------------------¦ FIN DE RANKING ¦
//                                                                     +----------------+
function NoError(Obj){
	if(Obj.id) Id=Obj.id; else Id=Obj;
	document.getElementById(Id+'Err').style.display='none';
}
function Pergunta(PrePasta){
	Nome=document.getElementById('Nome').value;
	Email=document.getElementById('Email').value;
	Cidade=document.getElementById('Cidade').value;
	Pergunta=document.getElementById('Pergunta').value;
	Bom=true;
	if(Nome==''){
		document.getElementById('NomeErr').style.display='inline';
		Bom=false;
	}
	if(Email==''){
		document.getElementById('EmailErr').style.display='inline';
		Bom=false;
	} else {
		if(!ChequeaEmail(Email)){
			document.getElementById('EmailErr2').style.display='inline';
			Bom=false;
		}
	}
	if(Cidade==''){
		document.getElementById('CidadeErr').style.display='inline';
		Bom=false;
	}
	if(Pergunta==''){
		document.getElementById('PerguntaErr').style.display='inline';
		Bom=false;
	}
	Institucao=document.getElementById('Institucao').value;
	if(document.getElementById('Mala').checked) Mala='true'; else Mala='false';
	if(Bom) Linkar(PrePasta+'/multimidia/radio/ajax/pergunta', 'pergunta', 'Nome='+Nome+'&Email='+Email+'&Cidade='+Cidade+'&Institucao='+Institucao+'&Pergunta='+Pergunta+'&Salvar=yes&Mala='+Mala);
}