/* AJAX */
var peticion = false;
var  testPasado = false;
try {
		peticion = new XMLHttpRequest();
	}
catch (trymicrosoft){
try {
	peticion = new ActiveXObject("Msxml2.XMLHTTP");
	}
catch (othermicrosoft) {
try {
	peticion = new ActiveXObject("Microsoft.XMLHTTP");
	}
catch (failed) {
	peticion = false;
	}
}
}
if (!peticion)
	alert("ERROR AL INICIALIZAR!");
/* AJAX */
//------------------------------------------------------------------
//------------------------------------------------------------------
function getUrl(ruta, auju_cod, esre_cod)
{	
	if(esre_cod == 1) mensaje = "Usted esta deshabilitando a este usuario, ¿desea continuar?";
	if(esre_cod == 2) mensaje = "Usted esta habilitando a este usuario, ¿desea continuar?";
	if( confirm( mensaje ) )
	{ 
		var fragment_url = ruta;	
		peticion.open("GET", fragment_url);
		peticion.onreadystatechange = function()
									{
										if (peticion.readyState == 4)
										{
											str = peticion.responseText;
											msj = str.replace(/^(\s|\&nbsp;)*|(\s|\&nbsp;)*$/g,"");										
											document.getElementById( auju_cod ).innerHTML = msj;										
										}
									}
		peticion.send(null);
	}
}

function cargaDiv( Div, url )
{
	var fragment_url = url;	
	peticion.open("GET", fragment_url);
	peticion.onreadystatechange = function()
								{
									if (peticion.readyState == 4)
									{
										if( Div == null || Div == "" )
										{
											dato = peticion.responseText;
											my_array = dato.split("####");
											document.getElementById( 'direccion' ).innerHTML = "<label>Dirección oficina</label>"+my_array[0];	                               					                             					
											document.getElementById( 'fono' ).innerHTML = "<label>Fono</label>"+my_array[1];
											document.getElementById( 'horario' ).innerHTML = "<label>Horario de atención</label>"+my_array[2];											
										}
										else document.getElementById( Div ).innerHTML = peticion.responseText;										
									}
								}
	peticion.send(null);
}
//------------------------------------------------------------------
//------------------------------------------------------------------


