function nuevoAjax()
{ 
	/* Crea el objeto AJAX. Esta funcion es generica para cualquier utilidad de este tipo, por
	lo que se puede copiar tal como esta aqui */
	var xmlhttp=false; 
	try 
	{ 
		// Creacion del objeto AJAX para navegadores no IE
		xmlhttp=new ActiveXObject("Msxml2.XMLHTTP"); 
	}
	catch(e)
	{ 
		try
		{ 
			// Creacion del objet AJAX para IE 
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); 
		} 
		catch(E) { xmlhttp=false; }
	}
	if (!xmlhttp && typeof XMLHttpRequest!="undefined") { xmlhttp=new XMLHttpRequest(); } 

	return xmlhttp; 
}

function enc_menu(){	   
	var div_enc_menu;		
	div_enc_menu = document.getElementById('div_enc_menu');
	
	ajaxem=nuevoAjax();	

    
	ajaxem.open("GET", "enc_menu.php?rand="+Math.random(),true);
	ajaxem.onreadystatechange=function() {
		if (ajaxem.readyState==4) {			
		div_enc_menu.innerHTML = ajaxem.responseText
	 	}
	}
	ajaxem.send(null)
}

function mapa(){
	var div_mapa;		
	div_mapa = document.getElementById('div_mapa');
	
	ajaxma=nuevoAjax();	

	ajaxma.open("GET", "acordeon.PHP?rand="+Math.random(),true);
	ajaxma.onreadystatechange=function() {
		if (ajaxma.readyState==4) {	

		div_mapa.innerHTML = ajaxma.responseText
	 	}
	}
	ajaxma.send(null)
}



function lista_submenu(idmenu){
	var div_submenu,idm;		
	div_submenu = document.getElementById('div_submenu');
	idm = idmenu;
	
	ajaxls=nuevoAjax();	
	ajaxls.open("GET", "lista_submenu.php?idm="+idm+"&rand="+Math.random(),true);
	ajaxls.onreadystatechange=function() {
		if (ajaxls.readyState==4) {			
		div_submenu.innerHTML = ajaxls.responseText
	 	}
	}
	ajaxls.send(null)
}


function deshabilita_sub(tipo,idmenu){
	var div_submenu,idt,idm;		
	div_submenu = document.getElementById('div_submenu');
	idt = tipo;
	idm = idmenu;
	
	ajaxds=nuevoAjax();	
	ajaxds.open("GET", "deshabilita_sub.php?idt="+idt+"&idm="+idm+"&rand="+Math.random(),true);
	ajaxds.onreadystatechange=function() {
		if (ajaxds.readyState==4) {			
		div_submenu.innerHTML = ajaxds.responseText
	 	}
	}
	ajaxds.send(null)
}


function banner_productos(){
	var div_banner_productos;		
	div_banner_productos = document.getElementById('div_banner_productos');
	
	ajaxbp=nuevoAjax();	

	ajaxbp.open("GET", "banner_productos.php?rand="+Math.random(),true);
	ajaxbp.onreadystatechange=function() {
		if (ajaxbp.readyState==4) {	
		div_banner_productos.innerHTML = ajaxbp.responseText
	 	}
	}
	ajaxbp.send(null)
}
