    // JavaScript Document  	
	
function createXMLHTTP(){
		var HTTP;
		try
		{
				HTTP = new ActiveXObject("Microsoft.XMLHTTP");  //IE
				HTTP = new XMLHttpRequest();  //Firefox	
		} 
		
		catch(e) 
		{		
				try
				{
					HTTP = new ActiveXObject("Msxml2.XMLHTTP");
				}catch(ex)
				{				
						try
						{
							HTTP = new XMLHttpRequest();
						}
						catch(exc)
						{
							alert("Esse browser n?o tem recursos para uso do Ajax");
							HTTP = null;
						}
				}
				return HTTP;
		}	
		var arrSignatures = ["MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0",							    "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP","Microsoft.XMLHTTP"];
		
		for (var i=0; i < arrSignatures.length; i++)
		{
			try
			{	
					var oRequest = new ActiveXObject(arrSignatures[i]);
					return oRequest;
			} 
			catch (oError)
			{
		}		 
	}	
	throw new Error("MSXML n?o esta instalado em sua m?quina.");
}
	
	function ajax_home(pag){
    var HTTP = createXMLHTTP();
    	    	    
	        HTTP.Open("POST",pag +".asp",true);
            HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            HTTP.onReadyStateChange=function(){
                if (HTTP.readyState==4){  //completo
	                document.getElementById("portal").innerHTML = HTTP.responsetext;
                }
            }    
	        HTTP.Send("seila=ok");
    }
	
	function ajax_foto(pag, id){

	var HTTP=createXMLHTTP();

	        HTTP.open("GET",pag +".asp?foto_id="+id,true);
            HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			HTTP.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
            HTTP.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
            HTTP.setRequestHeader("Pragma", "no-cache");
			
            HTTP.onreadystatechange=function(){
                if (HTTP.readyState==4){  //completo
				//Lê o texto
				 if(HTTP.status==200){
					var texto = HTTP.responseText
				}else{
					alert("problemas no servidor");
				}
					
					//Exibe o texto no div conteúdo
					var conteudo=document.getElementById("fotos")
					conteudo.innerHTML = texto
                }
            }
	        HTTP.send(null);
    }
	
		
	function ajax_galeria(pag, id){
	var conteudo=document.getElementById("corpo")
	conteudo.innerHTML = "<div class='carregando' align='center'><img src=../../fcfas/util/imagens/load.gif /> </div>"	
	
  	var HTTP=createXMLHTTP();

	        HTTP.open("GET",pag +".asp?galeria_id="+id,true);
            HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			HTTP.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
            HTTP.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
            HTTP.setRequestHeader("Pragma", "no-cache");
			
            HTTP.onreadystatechange=function(){
                if (HTTP.readyState==4){  //completo
				//Lê o texto
				 if(HTTP.status==200){
					var texto = HTTP.responseText
				}else{
					alert("problemas no servidor");
				}
					
					//Exibe o texto no div conteúdo
					var conteudo=document.getElementById("corpo")
					conteudo.innerHTML = texto
                }
            }
	        HTTP.send(null);
    }	
	
	
		
	function ajax_breve(pag){
    var HTTP = createXMLHTTP();
    	    	    
	        HTTP.Open("POST",pag +".asp",true);
            HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
            HTTP.onReadyStateChange=function(){
                if (HTTP.readyState==4){  //completo
	                document.getElementById("corpo").innerHTML = HTTP.responsetext;
                }
            }    
	        HTTP.Send("seila=ok");
    }
	
	function ajax_noticias(pag, id){
	var conteudo=document.getElementById("corpo")
	conteudo.innerHTML = "<div class='carregando' align='center'><img src=../../fcfas/util/imagens/load.gif /> </div>"	
		
 	var HTTP=createXMLHTTP();

	        HTTP.open("GET",pag +".asp?id="+id,true);
            HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			HTTP.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
            HTTP.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
            HTTP.setRequestHeader("Pragma", "no-cache");
			
            HTTP.onreadystatechange=function(){
                if (HTTP.readyState==4){  //completo
				//Lê o texto
				 if(HTTP.status==200){
					var texto = HTTP.responseText
				}else{
					alert("problemas no servidor");
				}
					
					//Exibe o texto no div conteúdo
					var conteudo=document.getElementById("corpo")
					conteudo.innerHTML = texto
                }
            }
	        HTTP.send(null);
    }	
	
	function ajax_conteudo(pag){
	var conteudo=document.getElementById("corpo")
	conteudo.innerHTML = "<div class='carregando' align='center'><img src=../../fcfas/util/imagens/load.gif /> </div>"	
		
 	var HTTP=createXMLHTTP();

	        HTTP.open("GET",pag,true);
            HTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			HTTP.setRequestHeader("Cache-Control", "no-store, no-cache, must-revalidate");
            HTTP.setRequestHeader("Cache-Control", "post-check=0, pre-check=0");
            HTTP.setRequestHeader("Pragma", "no-cache");
			
            HTTP.onreadystatechange=function(){
                if (HTTP.readyState==4){  //completo
				//Lê o texto
				 if(HTTP.status==200){
					var texto = HTTP.responseText
				}else{
					alert("problemas no servidor");
				}
					
					//Exibe o texto no div conteúdo
					var conteudo=document.getElementById("corpo")
					conteudo.innerHTML = texto
                }
            }
	        HTTP.send(null);
    }	
	
	function foto_detalhe2(cod_foto){
			var strPagina = 'sistema_fotos/mostra_foto.asp?cod_foto='+cod_foto;
				window.open(strPagina,'PaginaDetalhe','scrollbars=no top=1 left=1 width=500 height=380');
			}