var losDatos = '';
var emptyMensaje = 'Tus datos petaron !!! la respuesta del servidor fue nula XD !!!';
var displayMensaje = true;
var displayLoading = true;
var targetHTML = true;
var targetResponse = false;



function autocompletaLista() {
 targetHTML = true;
 targetResponse = false;
 losDatos = 'accion=autocompleta&string='+document.getElementById('string').value;
 ajaxInicio('autoCompleta', 'targetLoading', 'POST', 'shinzou-respuesta.php');
}

function seleccionaUser(elUsuario) {
 document.getElementById('string').value = elUsuario;
 document.getElementById('autoCompleta').style.visibility = 'hidden';
}

function muestraHTML(ruta) {
 targetHTML = true;
 targetResponse = false;
 losDatos = 'accion=status';
 ajaxInicio('targetMensaje2', 'targetLoading', 'POST', ruta);

     document.getElementById('contenido_popup').style.visibility = 'visible';
	 document.getElementById('contenido_popup').style.overflowX='hidden';

}


function muestraStatus2() {
	
 targetHTML = true;
 targetResponse = false;
 losDatos = 'accion=status';
 ajaxInicio('targetMensaje2', 'targetLoading', 'POST', 'index.php?option=com_content&id=5&tipo=box&fondo=mision');
 
}

function muestraStatus(ruta2) {
 if(document.getElementById('targetMensaje').style.visibility == 'hidden'){
 document.getElementById('borrar').style.visibility = 'hidden';
 
 var ruta1="/new/templates/rhuk_milkyway/contenedor_flash.php?ruta=";
 var ruta_total= ruta1+ruta2;
 ajaxInicio('targetMensaje', 'targetLoading', 'POST', ruta_total);}
 else{
 ruta2=ruta2.replace("/","&");
 ruta2=ruta2.replace("/","&");
 ruta2=ruta2.replace("/","&");
 ruta2=ruta2.replace("/","&");
 ajaxInicio('targetMensaje2', 'targetLoading', 'POST', ruta2);
 
 
 }

  //alert('El archivo llamado en la función ajaxInicio() no existe...\n\nEl sistema avisa del error en la esquina superior derecha de la página');
}

function muestraResponse(){
 targetHTML = false;
 targetResponse = true;
 losDatos = 'accion=response';
 ajaxInicio('targetResponse', 'targetLoading', 'POST', 'shinzou-respuesta.php');
}

function catchResponse(objResponse) {
 var textoResponse = 'Cabeceras del objeto XMLHTTP: \n\n'+objResponse.getAllResponseHeaders();
 alert(textoResponse);
}

function descarga() {
	document.getElementById('contenido_texto').style.width = '33%';
	 document.getElementById('targetMensaje').style.visibility = 'hidden';
	 document.getElementById('targetMensaje').innerHTML = '&nbsp;';
	 document.getElementById('targetMensaje2').innerHTML = '&nbsp;';
	 document.getElementById('borrar').style.visibility = 'visible';
	 document.getElementById('contenido_popup').style.visibility = 'hidden';
	 

}


function borraMensajes() {
/*
document.getElementById('targetMensaje').style.visibility = 'hidden';
document.getElementById('targetMensaje2').style.visibility = 'hidden';
document.getElementById('borrar').style.visibility = 'visible';
*/

}



/**********************************************PRUEBA//////////////////////////////////*/
function muestraCentral(ruta2) {
 if(document.getElementById('carga_efecto').style.visibility == 'hidden'){
	 
 document.getElementById('menu').style.visibility = 'hidden';
 document.getElementById('carga_contenido').style.marginTop= '-430px';
 if(navigator.userAgent<"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"){
	document.getElementById('carga_contenido').style.marginTop= '-500px';
	}
 
 document.getElementById('carga_contenido').style.width= '752px';
 document.getElementById('carga_contenido').style.height= '450px';

var ruta1="/new/templates/rhuk_milkyway/carga_efecto.php?ruta=";
 var ruta_total= ruta1+ruta2;
 ajaxInicio('carga_efecto', 'targetLoading', 'POST', ruta_total);}
 else{
 ruta2=ruta2.replace("/","&");
 ruta2=ruta2.replace("/","&");
 ruta2=ruta2.replace("/","&");
 ruta2=ruta2.replace("/","&");
 ajaxInicio('carga_contenido', 'targetLoading', 'POST', ruta2);
 }
 
}

function muestraHTML_central(ruta) {

 targetHTML = true;
 targetResponse = false;
 losDatos = 'accion=status';
 ajaxInicio('carga_contenido', 'targetLoading', 'POST', ruta);


}

function descarga_central() {
	document.getElementById('menu').style.visibility = 'visible';
	
	 document.getElementById('carga_contenido').style.visibility = 'hidden';
	 document.getElementById('carga_efecto').style.visibility = 'hidden';
	 
	 document.getElementById('carga_contenido').style.marginTop= '0px';
	  document.getElementById('carga_contenido').style.width= '0px';
      document.getElementById('carga_contenido').style.height= '0px';
	  
     document.getElementById('carga_contenido').innerHTML = '&nbsp;';
	 document.getElementById('carga_efecto').innerHTML = '&nbsp;';

	 

}

/**********************************************PRUEBA//////////////////////////////////*/
/********************************Noticias*************************************************/

function ver_noticias() {
 targetHTML = true;
 targetResponse = false;
 losDatos = 'accion=status'; 
	ajaxInicio('home', 'targetLoading', 'POST', 'index.php?intro=fin2');



}



function muestraCentral_organigrama(ruta2) {
	document.getElementById('menu').style.visibility = 'hidden';
 document.getElementById('carga_contenido').style.marginTop= '-430px';
 if(navigator.userAgent<"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)"){
	document.getElementById('carga_contenido').style.marginTop= '-500px';
	}
 
 
 document.getElementById('carga_contenido').style.width= '752px';
 document.getElementById('carga_contenido').style.height= '450px';
 
 

 
 var ruta1="/new/templates/rhuk_milkyway/carga_efecto_organigrama.php?ruta=";
 var ruta_total= ruta1+ruta2;
 ajaxInicio('carga_efecto', 'targetLoading', 'POST', ruta_total);
 
}

