var objetoAjax;
var destino='';
function getObjetoAjax()
{
var xhr=false;
if(window.XMLHttpRequest)
{
xhr=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
try
{
xhr=new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xhr=new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
xhr=false;
}
}
}
return xhr;
}
function swActivar(origen, dest, Id)
{
eval("objetoAjax"+Id+"=getObjetoAjax()");
if(eval("objetoAjax"+Id)) {
eval("objetoAjax"+Id+".open('GET',origen,true)");
eval('objetoAjax'+Id+'.onreadystatechange=function(){ if (objetoAjax'+Id+'.readyState==4) {document.getElementById(dest).src = eval("objetoAjax"+Id+".responseText"); } else {document.getElementById(dest).src = "/gestor/imagenes/loading.gif";}; } ');
eval("objetoAjax"+Id+".send(null)");
}
}
function swActivarGaleria( Id, idImagen2)
{
origen="../../../../gestor/generico/funciones_imagenes/activar_galeria.php?Id="+Id+"&Id2="+idImagen2;
dest="img_"+Id+"_"+idImagen2;
eval("objetoAjax"+Id+"=getObjetoAjax()");
if(eval("objetoAjax"+Id)) {
eval("objetoAjax"+Id+".open('GET',origen,true)");
eval('objetoAjax'+Id+'.onreadystatechange=function(){ if (objetoAjax'+Id+'.readyState==4) {document.getElementById(dest).src = eval("objetoAjax"+Id+".responseText"); } else {document.getElementById(dest).src = "/gestor/imagenes/loading.gif";}; } ');
eval("objetoAjax"+Id+".send(null)");
}
}
function swActivarUsuario(Id)
{
origen="activarusuario.php?Id="+Id;
dest="img_"+Id;
eval("objetoAjax"+Id+"=getObjetoAjax()");
if(eval("objetoAjax"+Id)) {
eval("objetoAjax"+Id+".open('GET',origen,true)");
eval('objetoAjax'+Id+'.onreadystatechange=function(){ if (objetoAjax'+Id+'.readyState==4) {document.getElementById(dest).src = eval("objetoAjax"+Id+".responseText"); } else {document.getElementById(dest).src = "/gestor/imagenes/loading.gif";}; } ');
eval("objetoAjax"+Id+".send(null)");
}
}
var isIE = false;
var req;
var destino = "";
function cargaXML(url,donde) {
if(url==''){
return;
}
destino = donde;
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send(null);
} else if (window.ActiveXObject) {
isIE = true;
req = new ActiveXObject("Microsoft.XMLHTTP");
if (req) {
req.onreadystatechange = processReqChange;
req.open("GET", url, true);
req.send();
}
}
}
function processReqChange(){
if(document.getElementById(destino)){
var elemento = document.getElementById(destino);
if(req.readyState == 4){
elemento.innerHTML = req.responseText;
}
}
}
function swActivarMenu(Menu)
{
cargaXML("jose.php?Menu="+Menu,"capa");
}
function Ajax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function swActivarMenuCursos(Menu,Tipo_curso,Aula_curso)
{
var url="menu_cursos.php?Menu="+Menu+"&Tipo_curso="+Tipo_curso+"&Aula_curso="+Aula_curso;
//alert(url);
document.getElementById('capa-cursos').innerHTML='

CARGANDO ...
';
ajax=Ajax();
ajax.open("GET", url ,true);
ajax.onreadystatechange=function()
{
if (ajax.readyState==4)
{
var results = ajax.responseText;
//alert(results);
if( results!="")
{
document.getElementById('capa-cursos').innerHTML=results;
if(Menu==1)
{
//document.getElementById('capa-cursos-agua').style.display='none';
//document.getElementById('capa-cursos').style.display='block';
//document.getElementById('capa-cursos').innerHTML=results;
document.getElementById("cab-tipo2").style.background = 'url(/imagenes/cab-tipo2.gif) no-repeat top left';
document.getElementById("cab-tipo3").style.background = 'url(/imagenes/cab-tipo3.gif) no-repeat top left';
document.getElementById("cab-tipo4").style.background = 'url(/imagenes/cab-tipo4.gif) no-repeat top left';
}
else if(Menu==2)
{
//document.getElementById('capa-cursos-agua').style.display='none';
//document.getElementById('capa-cursos').style.display='block';
//document.getElementById('capa-cursos').innerHTML=results;
document.getElementById("cab-tipo1").style.background = 'url(/imagenes/cab-tipo1.gif) no-repeat top left';
document.getElementById("cab-tipo3").style.background = 'url(/imagenes/cab-tipo3.gif) no-repeat top left';
document.getElementById("cab-tipo4").style.background = 'url(/imagenes/cab-tipo4.gif) no-repeat top left';
}
else if(Menu==3)
{
//document.getElementById('capa-cursos-agua').style.display='none';
//document.getElementById('capa-cursos').style.display='block';
//document.getElementById('capa-cursos').innerHTML=results;
document.getElementById("cab-tipo1").style.background = 'url(/imagenes/cab-tipo1.gif) no-repeat top left';
document.getElementById("cab-tipo2").style.background = 'url(/imagenes/cab-tipo2.gif) no-repeat top left';
document.getElementById("cab-tipo4").style.background = 'url(/imagenes/cab-tipo4.gif) no-repeat top left';
}
else if(Menu==4)
{
//document.getElementById('capa-cursos').style.display='none';
//document.getElementById('capa-cursos-agua').style.display='block';
//document.getElementById('capa-cursos-agua').innerHTML=results;
document.getElementById("cab-tipo1").style.background = 'url(/imagenes/cab-tipo1.gif) no-repeat top left';
document.getElementById("cab-tipo2").style.background = 'url(/imagenes/cab-tipo2.gif) no-repeat top left';
document.getElementById("cab-tipo3").style.background = 'url(/imagenes/cab-tipo3.gif) no-repeat top left';
}
document.getElementById("cab-tipo"+Menu).style.background = 'url(/imagenes/cab-tipo'+Menu+'-on.gif) no-repeat top left';
}
else
{
document.getElementById('capa-cursos').style.display='none';
}
}
}
ajax.send(null);
}
function PestanasMisdatos(Id)
{
var url="/usuarios/datos_usuarios.php?Id="+Id;
document.getElementById('caja2b').innerHTML='
CARGANDO ...
';
ajax=Ajax();
ajax.open("GET", url ,true);
ajax.onreadystatechange=function()
{
if (ajax.readyState==4)
{
var results = ajax.responseText;
if( results!="")
{
document.getElementById('caja2b').innerHTML=results;
if(Id==1)
{
document.getElementById("pestana2").style.background = 'url(/imagenes/cab-pestanas2.gif) no-repeat top left';
}
else if(Id==2)
{
document.getElementById("pestana1").style.background = 'url(/imagenes/cab-pestanas1.gif) no-repeat top left';
}
document.getElementById("pestana"+Id).style.background = 'url(/imagenes/cab-pestanas'+Id+'-on.gif) no-repeat top left';
}
else
{
document.getElementById('caja2b').style.display='none';
}
}
}
ajax.send(null);
}