// Recargar datos var xmlhttp = null; var xmlhttpsesion = null; var colaEjecucion = new Array(); function leerDatos() { // } /*function actualizarSesion() { if(colaEjecucion.length==0) { doActualizarSesion(); }else{ colaEjecucion.push("doActualizarSesion()"); } }*/ function actualizarSesion() { xmlhttp_sesion =null; url = './moduls/actualizar_sesion.php'; if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp_sesion=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp_sesion=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp_sesion!=null) { xmlhttp_sesion.onreadystatechange = cambioEstadoSesion; xmlhttp_sesion.open("GET",url,true); xmlhttp_sesion.send(null); } else { // Sin soporte de XML HTTP } } function guardarDato(id,valor) { xmlhttp =null; url = './moduls/instancia_dato.php?dato='+id+'&valor='+encodeURIComponent(valor); if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=null) { xmlhttp.onreadystatechange=cambioEstado; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { // Sin soporte de XML HTTP } } function guardarSolicitudDato(solicitud,dato,valor) { xmlhttp =null; url = './moduls/instancia_dato.php?solicitud='+solicitud+'&dato='+dato+'&valor='+encodeURIComponent(valor); if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=null) { xmlhttp.onreadystatechange=cambioEstado; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { // Sin soporte de XML HTTP } } function guardarSesionParametro(parametro,valor,configuracion) { xmlhttp =null; url = './moduls/actualizar_sesion_parametro.php?parametro='+parametro+'&valor='+encodeURIComponent(valor); if(configuracion!=null) { if(configuracion) { url = url+'&configuracion=true'; } } if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=null) { xmlhttp.onreadystatechange=cambioEstado; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { // Sin soporte de XML HTTP } } function guardarSolicitudValoracion(solicitud,dato,valor) { xmlhttp =null; url = './moduls/instancia_dato.php?valoracion=si&solicitud='+solicitud+'&dato='+dato+'&valor='+encodeURIComponent(valor); if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=null) { xmlhttp.onreadystatechange=cambioEstado; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { // Sin soporte de XML HTTP } } function ejecutarAccion(id,valor) { xmlhttp_accion =null; url = './moduls/instancia_accion.php?dato='+id+'&valor='+encodeURIComponent(valor); if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp_accion=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp_accion=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp_accion!=null) { xmlhttp_accion.onreadystatechange=cambioEstadoAccion; xmlhttp_accion.open("GET",url,true); xmlhttp_accion.send(null); } else { // Sin soporte de XML HTTP } } function guardarPosicion(instancia,dato,x,y,ancho,alto) { xmlhttp =null; url = './moduls/gestion/instancias_posicion_actualizar.php?dato='+dato+'&instancia='+instancia+'&x='+x+'&y='+y+'&ancho='+ancho+'&alto='+alto; if (window.XMLHttpRequest) {// code for Firefox, Opera, IE7, etc. xmlhttp=new XMLHttpRequest(); }else if (window.ActiveXObject) {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } if (xmlhttp!=null) { xmlhttp.onreadystatechange=cambioEstado; xmlhttp.open("GET",url,true); xmlhttp.send(null); } else { // Sin soporte de XML HTTP } } function cambioEstado() { if (xmlhttp.readyState==4) {// 4 = "loaded" if ((xmlhttp.status==200)||(xmlhttp.status==0)) {// 200 = "OK" //document.getElementById('T1').innerHTML=xmlhttp.responseText; // alert(xmlhttp.responseText); } else { alert("Problemilla retrieving data:" + xmlhttp.status); } } } function cambioEstadoSesion() { if(xmlhttp!=null) { if (xmlhttp.readyState==4) {// 4 = "loaded" if ((xmlhttp.status==200)||(xmlhttp.status==0)) {// 200 = "OK" //document.getElementById('T1').innerHTML=xmlhttp.responseText; // alert(xmlhttp.responseText); } else { alert("Problemon retrieving data:" + xmlhttp.status); } } } } function cambioEstadoAccion() { if (xmlhttp_accion.readyState==4) {// 4 = "loaded" if ((xmlhttp.status==200)||(xmlhttp.status==0)) {// 200 = "OK" //document.getElementById('T1').innerHTML=xmlhttp_accion.responseText; eval(xmlhttp_accion.responseText); } else { alert("Problema recibiendo datos:" + xmlhttp_accion.status); } } } // Mostrar y ocultar elementos function abrirVentana(direccion) { window.open(direccion,"_blank"); } function vaciarCapa(destino) { document.getElementById(destino).value = '' ; } function cambiarDisplay(nombre,tipo) { if(tipo==null) tipo = "block"; objeto = document.getElementById(nombre); if (objeto != null) { // Se discrimina por navegador: si soporta currentStyle, se presupone IE if (objeto.currentStyle) { vis = objeto.style; // Comprobar el tipo de display if (vis.display != tipo) { vis.display = tipo; }else{ vis.display = "none"; } }else{ if ((objeto.style.display=='none')||(objeto.style.display=='')) { objeto.style.display = tipo; }else{ objeto.style.display = 'none'; } } } } function cambiarDisplayFila(nombre) { objeto = document.getElementById(nombre); if (objeto != null) { // Se discrimina por navegador: si soporta currentStyle, se presupone IE if (objeto.currentStyle) { vis = objeto.style; // Comprobar el tipo de display if (vis.display != "table-row") { vis.display = "block"; }else{ vis.display = "none"; } }else{ if ((objeto.style.display=='none')||(objeto.style.display=='')) { objeto.style.display = 'table-row'; }else{ objeto.style.display = 'table-row'; } } } } function ocultarDisplay(nombre) { objeto = document.getElementById(nombre); objeto.style.display = 'none'; } function mostrarDisplay(nombre,tipo) { objeto = document.getElementById(nombre); if(tipo==null) { objeto.style.display = 'block'; }else{ objeto.style.display = tipo; } } function mostrarDisplayCelda(nombre) { objeto = document.getElementById(nombre); objeto.style.display = 'block'; } function mostrarAyuda(texto) { } function ocultarAyuda() { } // Solapas var solapaActual=null; function mostrarSolapa(nombre) { if(solapaActual!=null) { try { objeto = document.getElementById("etiqueta_"+solapaActual); objeto.style.borderBottom = 'black solid 1px'; objeto.style.fontWeight = 'normal'; }catch(err) { } ocultarDisplay("solapa_"+solapaActual); } solapaActual = nombre; mostrarDisplay("solapa_"+nombre,"block"); guardarSesionParametro("solapa_",nombre,true); objeto = document.getElementById("etiqueta_"+nombre); objeto.style.borderBottom = 'none'; objeto.style.fontWeight = 'bold'; } function iniciarSolapa(nombre) { var actual = ''; if(actual=='') { mostrarSolapa(nombre); }else{ if(document.getElementById("solapa_"+actual)) { mostrarSolapa(actual); }else{ mostrarSolapa(nombre); } } } // Resaltar elementos function iluminarCapa(capa) { var objeto = document.getElementById(capa); //objeto.style.fontWeight = 'bold'; capaIluminada = capa; objeto.style.background = '#A0D0FF'; } function apagarCapa(capa) { var objeto = document.getElementById(capa); //objeto.style.fontWeight = 'normal'; objeto.style.background = 'none'; }