// JavaScript Document
  
    function ocultar(div_ocultar){
		document.getElementById(div_ocultar).style.display='none';
		
		} 
        
     function mostrar(div_mostrar){
		 document.getElementById(div_mostrar).style.display='block';
		 
		 }   
      

	
function cargar_asincrono(doc,div){

el_objeto=null;

if(window.XMLHttpRequest){
	el_objeto= new XMLHttpRequest();
	//alert('es un navegador estandar');
	}
if(window.ActiveXObject){
	
	el_objeto=new ActiveXObject("Microsoft.XMLHTTP");
	//alert('es ie 5 o 6')
	}	



el_objeto.onreadystatechange=escribir;

el_objeto.open('POST',doc,true);

el_objeto.send(null);

function escribir(){
	
	
	if(el_objeto.readyState==4){
	
document.getElementById(div).innerHTML=el_objeto.responseText;
		
	}
	}

}



//para cambiar el orden de los banners
function consulta_asincrona(params){

el_objeto=null;

if(window.XMLHttpRequest){
	el_objeto= new XMLHttpRequest();
	//alert('es un navegador estandar');
	}
if(window.ActiveXObject){
	
	el_objeto=new ActiveXObject("Microsoft.XMLHTTP");
	//alert('es ie 5 o 6')
	}	



el_objeto.onreadystatechange=escribir;

el_objeto.open('POST',params,true);

el_objeto.send(null);

function escribir(){
	

	if(el_objeto.readyState==4){
	
cargar_asincrono('listar_banners.php','contenedor_admin');
		
	}
	
	}

}

//para cambiar la pagina de seccion

function cambiar_seccion(consulta){


//alert(consulta);

if(consulta==0){
	return false;
	}

el_objeto=null;

if(window.XMLHttpRequest){
	el_objeto= new XMLHttpRequest();
	//alert('es un navegador estandar');
	}
if(window.ActiveXObject){
	
	el_objeto=new ActiveXObject("Microsoft.XMLHTTP");
	//alert('es ie 5 o 6')
	}	



el_objeto.onreadystatechange=escribir;

el_objeto.open('POST',consulta,true);

el_objeto.send(null);

function escribir(){
	

	if(el_objeto.readyState==4){
	//alert(el_objeto.responseText);
cargar_asincrono('listar_secciones.php','contenedor_admin');
		
	}
	
	}

}

//
function consulta_asincrona(params,recarga){

el_objeto=null;

if(window.XMLHttpRequest){
	el_objeto= new XMLHttpRequest();
	//alert('es un navegador estandar');
	}
if(window.ActiveXObject){
	
	el_objeto=new ActiveXObject("Microsoft.XMLHTTP");
	//alert('es ie 5 o 6')
	}	



el_objeto.onreadystatechange=escribir;

el_objeto.open('POST',params,true);

el_objeto.send(null);

function escribir(){
	

	if(el_objeto.readyState==4){
	//alert(recarga)
cargar_asincrono(recarga,'contenedor_admin');
		
	}
	
	}

}


//ordenar las paginas

function orden_pagina(params,id_seccion){

el_objeto=null;

if(window.XMLHttpRequest){
	el_objeto= new XMLHttpRequest();
	//alert('es un navegador estandar');
	}
if(window.ActiveXObject){
	
	el_objeto=new ActiveXObject("Microsoft.XMLHTTP");
	//alert('es ie 5 o 6')
	}	



el_objeto.onreadystatechange=escribir;

el_objeto.open('POST',params,true);

el_objeto.send(null);

function escribir(){
	

	if(el_objeto.readyState==4){
	//alert(id_seccion)
cargar_asincrono('solo_seccion.php?id_seccion='+id_seccion,'contenedor_seccion_'+id_seccion);
		
	}
	
	}

}

