function atualizaFor(campo,valor,formacaoId,usuarioId) {
var url = 'formacao.asp?param=alterar&campo='+campo+'&valor='+valor+'&formacaoId='+formacaoId+'&usuarioId='+usuarioId;
  if(window.ActiveXObject) {
 	 ajaxFor= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxFor = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxFor.open('GET', url)
  ajaxFor.onreadystatechange = function() {
	  if (ajaxFor.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxFor.readyState == 4) {
		  if (ajaxFor.status == 200) {
			  document.getElementById("formaAtualiza").innerHTML = ajaxFor.responseText;
		  } else {
			  document.getElementById("formaAtualiza").innerHTML = ajaxFor.responseText;
			  
		  }
	  }
  }
  ajaxFor.send(url);
}


function paginacaoNoticia(numero) {
var url = 'noticiasInt.asp?n_page='+numero;
  if(window.ActiveXObject) {
 	 ajaxNoticia= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxNoticia = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxNoticia.open('GET', url)
  ajaxNoticia.onreadystatechange = function() {
	  if (ajaxNoticia.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxNoticia.readyState == 4) {
		  if (ajaxNoticia.status == 200) {
			  document.getElementById("listagem_noticias").innerHTML = ajaxNoticia.responseText;
		  } else {
			  document.getElementById("listagem_noticias").innerHTML = ajaxNoticia.responseText;
			  
		  }
	  }
  }
  ajaxNoticia.send(url);
}

function paginacaoListaProduto(numero) {
var url = 'produtosInt.asp?n_page='+numero;
  if(window.ActiveXObject) {
 	 ajaxNoticia= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxNoticia = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxNoticia.open('GET', url)
  ajaxNoticia.onreadystatechange = function() {
	  if (ajaxNoticia.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxNoticia.readyState == 4) {
		  if (ajaxNoticia.status == 200) {
			  document.getElementById("listaProduto").innerHTML = ajaxNoticia.responseText;
		  } else {
			  document.getElementById("listaProduto").innerHTML = ajaxNoticia.responseText;
			  
		  }
	  }
  }
  ajaxNoticia.send(url);
}


function paginacaoInformativos(numero) {
var url = 'listaInformativoInt.asp?n_page='+numero;
  if(window.ActiveXObject) {
 	 ajaxInformativos= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxInformativos = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxInformativos.open('GET', url)
  ajaxInformativos.onreadystatechange = function() {
	  if (ajaxInformativos.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxInformativos.readyState == 4) {
		  if (ajaxInformativos.status == 200) {
			  document.getElementById("listagem_informativos").innerHTML = ajaxInformativos.responseText;
		  } else {
			  document.getElementById("listagem_informativos").innerHTML = ajaxInformativos.responseText;
			  
		  }
	  }
  }
  ajaxInformativos.send(url);
}

function paginacaoPesquisas(numero,tipo) {
var url = 'pesquisaInt.asp?n_page='+numero+'&tipo='+tipo;
  if(window.ActiveXObject) {
 	 ajaxPesquisas= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxPesquisas = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxPesquisas.open('GET', url)
  ajaxPesquisas.onreadystatechange = function() {
	  if (ajaxPesquisas.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxPesquisas.readyState == 4) {
		  if (ajaxPesquisas.status == 200) {
			  document.getElementById("listagem_pesquisas").innerHTML = ajaxPesquisas.responseText;
		  } else {
			  document.getElementById("listagem_pesquisas").innerHTML = ajaxPesquisas.responseText;
			  
		  }
	  }
  }
  ajaxPesquisas.send(url);
}


 function mascaraData(campoData){             
     var data = campoData.value; 
	     if (data.length == 2){ 
		     data = data + '/';  
			 document.forms[0].Unascimento.value = data;
			 return true;  
	     }
		 if (data.length == 5){ 
		     data = data + '/';
			 document.forms[0].Unascimento.value = data;  
			 return true;
	     }
   }

function selInformativo_lista(id){
	  document.getElementById(id).className="informativoSelecionado_lista";
	}	
function desselInformativo_lista(id){
	  document.getElementById(id).className="";
	}	



function selNoticia(id){
	  document.getElementById(id).style.backgroundColor="#e8e8e8";
	}	
function desselNoticia(id){
	  document.getElementById(id).style.backgroundColor="#fff";
	}



function selInformativo(id){
	  document.getElementById(id).className="informativoSelecionado";
	}	
function desselInformativo(id){
	  document.getElementById(id).className="info01";
	}	

function selInformativo2(id){
	  document.getElementById(id).className="informativoSelecionado02";
	}	
function desselInformativo2(id){
	  document.getElementById(id).className="info02";
	}	


function paginacaoRecado(numero,idAssociado) {
  var url = 'recadosInt.asp?n_page='+numero+'&idAssociado='+idAssociado;
  if(window.ActiveXObject) {
 	 ajaxRecados= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxRecados = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxRecados.open('GET', url)
  ajaxRecados.onreadystatechange = function() {
	  if (ajaxRecados.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxRecados.readyState == 4) {
		  if (ajaxRecados.status == 200) {
			  document.getElementById("listagem_recados").innerHTML = ajaxRecados.responseText;
		  } else {
			  document.getElementById("listagem_recados").innerHTML = ajaxRecados.responseText;
			  
		  }
	  }
  }
  ajaxRecados.send(url);
}


function paginacaoPrivado(numero) {
	var url2 = 'privadoInt.asp?n_page='+numero;
  if(window.ActiveXObject) {
 	 ajaxPrivado= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxPrivado = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxPrivado.open('GET', url2)
  ajaxPrivado.onreadystatechange = function() {
	  if (ajaxPrivado.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxPrivado.readyState == 4) {
		  if (ajaxPrivado.status == 200) {
			  document.getElementById("listagem_privado").innerHTML = ajaxPrivado.responseText;
		  } else {
			  document.getElementById("listagem_privado").innerHTML = ajaxPrivado.responseText;
			  
		  }
	  }
  }
  ajaxPrivado.send(url2);
}





function paginacaoVideo(numero) {
  var url = 'listaVideosInt.asp?n_page='+numero;
  if(window.ActiveXObject) {
 	 ajaxVideos= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxVideos = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxVideos.open('GET', url)
  ajaxVideos.onreadystatechange = function() {
	  if (ajaxVideos.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxVideos.readyState == 4) {
		  if (ajaxVideos.status == 200) {
			  document.getElementById("listagem_videos").innerHTML = ajaxVideos.responseText;
		  } else {
			  document.getElementById("listagem_videos").innerHTML = ajaxVideos.responseText;
			  
		  }
	  }
  }
  ajaxVideos.send(url);
}


function paginacaoinfo(numero,idSubCategoria) {
  var url = 'listagemInt.asp?n_page='+numero+'&idSubCategoria='+idSubCategoria;
  if(window.ActiveXObject) {
 	 ajaxInfo= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxInfo = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxInfo.open('GET', url)
  ajaxInfo.onreadystatechange = function() {
	  if (ajaxInfo.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxInfo.readyState == 4) {
		  if (ajaxInfo.status == 200) {
			  document.getElementById("listagem_info").innerHTML = ajaxInfo.responseText;
		  } else {
			  document.getElementById("listagem_info").innerHTML = ajaxInfo.responseText;
			  
		  }
	  }
  }
  ajaxInfo.send(url);
}

function lista_cursos(usuarioID,param,formacaoId) {
  var url = 'listaformacao.asp?usuarioID='+usuarioID+'&param='+param+'&formacaoId='+formacaoId+'';
  if(window.ActiveXObject) {
 	 ajaxFormacao= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxFormacao = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxFormacao.open('GET', url)
  ajaxFormacao.onreadystatechange = function() {
	  if (ajaxFormacao.readyState == 1) {
		  //document.getElementById('listaIndice').innerHTML = '<img src="img/loading.gif" title="Carregando..."/> Carregando...';
	  }
	  if (ajaxFormacao.readyState == 4) {
		  if (ajaxFormacao.status == 200) {
			  document.getElementById('listagem_cursos').innerHTML = ajaxFormacao.responseText;
		  } else {
			  document.getElementById('listagem_cursos').innerHTML = ajaxFormacao.responseText;
			  
		  }
	  }
  }
  ajaxFormacao.send(url);
}


function voltaTitulo(id){
  valor=document.getElementById(id).value;
	 if (valor==''){
	   	if(id=='usuario'){
			document.getElementById('usuario').value="Usuário";
		}
		if(id=='newsletter'){
			document.getElementById('newsletter').value="cadastre seu e-mail...";
		}
	   	if(id=='senha'){
			document.getElementById('senha').value="Senha";
		}
	   	if(id=='busca'){
			document.getElementById('busca').value="Digite aqui a sua busca...";
		}
		if(id=='nemail'){
			document.getElementById('nemail').value="Cadastre seu e-mail...";
		}
	    if(id=='comentario'){
			document.getElementById('comentario').value="Escreva aqui seu comentario...";
		}	
	    if(id=='ndest'){
			document.getElementById('ndest').value="Nome do destinatario";
		}	
	    if(id=='edest'){
			document.getElementById('edest').value="E-mail do destinatario";
		}	
	 }	
}


function tiraTitulo(id){
	    if(id=='usuario'){
			if (document.getElementById('usuario').value=="Usuário"){
				document.getElementById('usuario').value="";
			}
		}
		if(id=='newsletter'){
			if (document.getElementById('newsletter').value=="cadastre seu e-mail..."){
				document.getElementById('newsletter').value="";
			}
		}
	    if(id=='senha'){
			if (document.getElementById('senha').value=="Senha"){
				document.getElementById('senha').value="";
			}
		}	
	    if(id=='busca'){
			if (document.getElementById('busca').value=="Digite aqui a sua busca..."){
				document.getElementById('busca').value="";
			}
		}
	    if(id=='nemail'){
			if (document.getElementById('nemail').value=="Cadastre seu e-mail..."){
				document.getElementById('nemail').value="";
			}
		}	
	    if(id=='comentario'){
			if (document.getElementById('comentario').value=="Escreva aqui seu comentario..."){
				document.getElementById('comentario').value="";
			}
		}
	    if(id=='ndest'){
			if (document.getElementById('ndest').value=="Nome do destinatario"){
				document.getElementById('ndest').value="";
			}
		}	
	    if(id=='edest'){
			if (document.getElementById('edest').value=="E-mail do destinatario"){
				document.getElementById('edest').value="";
			}
		}				
}


function trans(id){
 txt=document.getElementById(id).value;
	 if (txt==""){
		document.getElementById(id).type="text";
	 }else{
		document.getElementById(id).type="password";
	 }
}


function mostraNucleo(v){
//alert(v);
	 if (v=="S"){
		document.getElementById("caixaNucleo").style.display="block;"
	 }else{
		document.getElementById("caixaNucleo").style.display="none;"
	 }
}



function abreMenu(id){
document.getElementById(id).style.display="block";
}
function fechaMenu(id){
document.getElementById(id).style.display="none";
}

function acendeLink(id){
document.getElementById(id).style.color="#FF9";
}
function apagaLink(id){
document.getElementById(id).style.color="#FFF";
}


function setar(id){
document.getElementById(id).style.background="url(img/bg_menu1.gif) #333 left top repeat-x";
}
function naosetar(id){ 
if (navigator.appName=="Netscape"){
	    document.getElementById(id).style.background="";
	}else{
        document.getElementById(id).style.background="url(img/bg_menu.gif) left top repeat-x;";
	}
}



function abreCaixa(){
if (document.getElementById("caixaComent").style.display=="block"){
     document.getElementById("caixaComent").style.display="none";
	 document.getElementById("textComent").style.display="block";
	 document.getElementById("textComent2").style.display="block";
}else{
     document.getElementById("caixaComent").style.display="block";
	 document.getElementById("textComent").style.display="none";
	 document.getElementById("textComent2").style.display="none";
  }
}


function mostraCaixa(id){
if (document.getElementById(id).style.display=="block"){
     document.getElementById(id).style.display="none";
	}else{
     document.getElementById(id).style.display="block";
	
  }
}


function abreCaixa2(){
if (document.getElementById("caixaEnvia").style.display=="block"){
     document.getElementById("caixaEnvia").style.display="none";
	}else{
     document.getElementById("caixaEnvia").style.display="block";
	
  }
}

function aparecer(id){
	document.getElementById(id).style.display='block';
	}
function sumir(id){
	document.getElementById(id).style.display='none';
	}	
	
	
function validaComent(){
	 if ((document.getElementById("comentario").value=="")|| (document.getElementById("comentario").value=="Escreva aqui seu comentario...")){
		  alert("Preencha o coment&aacute;rio");
		  return false;
		 }
	   document.MainDestaque.submit();
	}	
	
	
function validacao(){
 if ((document.getElementById("newsletter").value=="") || (document.getElementById("newsletter").value=="cadastre seu e-mail..."))
					 {
					  
					  document.getElementById("campo_email").innerHTML="Informe o seu e-mail";
					  document.getElementById("newsletter").focus();
					  return false;					 }
					 else
					 {
						// Verifica se o e-mail é válido.
						email = document.getElementById("newsletter").value;
						x= email.indexOf('@');
					    if (( x < 0 ) || (email.indexOf("@",x + 1) != -1) || (email.indexOf(".") < 1) ) 
						{ 
					       document.getElementById("campo_email").innerHTML="E-mail informado está incorreto.";
						   document.getElementById("newsletter").focus();
					       return false;
					    } 
					 }
					cadnewsletter(document.getElementById("newsletter").value);

 }
	

function cadnewsletter(email) {
	
var url = 'cadnewsletter.asp?newsletter=' + email;
  if(window.ActiveXObject) {
 	 ajaxInfo= new ActiveXObject("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  } else {
 	 ajaxInfo = new XMLHttpRequest("Microsoft.XMLHTTP"); /*Inicia o Ajax*/
  }
  ajaxInfo.open('GET', url)
  ajaxInfo.onreadystatechange = function() {
	  if (ajaxInfo.readyState == 1)
	   {

		  document.getElementById('campo_email').innerHTML = 'Enviado...';

	  }
	  if (ajaxInfo.readyState == 4) {
		  if (ajaxInfo.status == 200) {
			  document.getElementById("campo_email").innerHTML = 'E-mail cadastrado com sucesso!';
			  document.getElementById('newsletter').value='';
		  } else {
			  document.getElementById("campo_email").innerHTML = 'E-mail cadastrado com sucesso!';
			  document.getElementById('newsletter').value='';
			  
		  }
	  }
  }
  ajaxInfo.send(url);
}



		 function validaCadastro(){
		   Unome=document.MainCadastro.Unome.value
		   if (Unome==''){
		   alert('Preencha o nome corretamente')
           document.MainCadastro.Unome.focus()
		   return false
		   }

		   Uemail=document.MainCadastro.Uemail.value
		   if ((Uemail=='')||(Uemail.indexOf("@")==-1)) {
		   alert('Preencha o e-mail corretamente')
           document.MainCadastro.Uemail.focus()
		   return false
		   }
		   
		   Utelefone=document.MainCadastro.Utelefone.value
		   if (Utelefone=='') {
		   alert('Preencha o telefone corretamente')
           document.MainCadastro.Utelefone.focus()
		   return false
		   }
		   
		   Ucargo=document.MainCadastro.Ucargo.value
		   if (Ucargo==''){
		   alert('Preencha o cargo corretamente')
           document.MainCadastro.Ucargo.focus()
		   return false
		   }
		 				   
		   Ulogin=document.MainCadastro.Ulogin.value
		   if (Ulogin==''){
		   alert('Preencha o login corretamente')
           document.MainCadastro.Ulogin.focus()
		   return false
		   }
           		
		   Usenha=document.MainCadastro.Usenha.value
		   if (Usenha==''){
		   alert('Preencha a senha corretamente')
           document.MainCadastro.Usenha.focus()
		   return false
		   }
		   
		   UConfsenha=document.MainCadastro.UConfsenha.value
		   if (UConfsenha==''){
		   alert('Preencha a confirmação de senha corretamente')
           document.MainCadastro.UConfsenha.focus()
		   return false
		   }
		  
		  if (Usenha!=UConfsenha){
		   alert('A confirmação da senha está diferente da senha!')
           document.MainCadastro.UConfsenha.focus()
		   return false
		  }

		 document.MainCadastro.submit()
		 
		 }
