    function cambiar_clase(nombre, clase) {
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Modifica el estilo de visualización de una división.
    //----------------------------------------------------------------------
            cuerpo=document.getElementById(nombre);
            if (cuerpo == null)
                alert('Error('+nombre+'): Fallo en la comunicación\\n'+
                      'Favor informar a soporte@authorsglobe.com');
            else
                cuerpo.className=clase;
    }

    function cambiar_dia(numero_anho, numero_mes, numero_dia, numero_hora, numero_minuto,
                         div_despliegue, variable, tabla, campo, reg_id, opciones) 
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Cambia el día de una fecah específica.
    //----------------------------------------------------------------------
    {
        llamarProceso('divisionAjax.php',
                      div_despliegue,
                      '&accion_ajx=ingreso_variable'+
                      '&division='+div_despliegue+
                      '&tabla='+tabla+
                      '&campo='+campo+
                      '&registro_id='+reg_id+
                      '&valor='+
                          encodeURIComponent(numero_anho+'-'+
                                             numero_mes+'-'+
                                             numero_dia+' '+
                                             numero_hora+':'+
                                             numero_minuto)+
                      '&tipo_cambio=dia'+
                      '&opciones='+opciones+
                      '&variable='+variable,
                      null,
                      '');
    }

    function cambiar_imagen(nombre, fuente)
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Cambiar alguna propiedad de un objeto
    //----------------------------------------------------------------------
    {
        imagen = document.getElementById(nombre);
        imagen.src = fuente;
    }

    function cambiar_propiedad(nombre, propiedad, valor)
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Cambiar alguna propiedad de un objeto
    //----------------------------------------------------------------------
    {
        seccion = document.getElementById(nombre);
        if (seccion != null)
            switch (propiedad) {
                case 'display':
                    seccion.style.display = valor;
                    break;
                case 'visibility':
                    seccion.style.visibility = valor;
                    break;
                case 'background':
                    seccion.style.background = valor;
                    break;
                case 'top':
                    seccion.style.top = valor;
                    break;
                case 'bottom':
                    seccion.style.bottom = valor;
                    break;
                case 'left':
                    seccion.style.left = valor;
                    break;
                case 'right':
                    seccion.style.right = valor;
                    break;
                case 'width':
                    seccion.style.width = valor;
                    break;
                case 'height':
                    seccion.style.height = valor;
                    break;
                case 'margin':
                    seccion.style.margin = valor;
                    break;
                case 'overflow':
                    seccion.style.overflow = valor;
                    break;
                default:
                    alert('js_error: No implementado para '+propiedad);
            }
        else
            alert('Error ('+nombre+') Fallo en la comunicación\n'+
                  'Revise su conexión de red.');
    }

    function cambiar_texto(nombre, valor)
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Modificar un texto en el interior de una división.
    //----------------------------------------------------------------------
    {
        seccion = document.getElementById(nombre);
        if (seccion != null)
            seccion.innerHTML = valor;
        else
            alert('PLEASE WAIT...\n['+nombre+']');
    }

    function es_numero(valor)
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Identificar si un texto contiene solo números.
    //----------------------------------------------------------------------
    {
        var numeros_validos = "0123456789.-";
        var actual;
        var retorno = true;

        if (valor.length == 0)
            return false;

        for (i = 0; i < valor.length && retorno == true; i++) {
            actual = valor.charAt(i);
            if (numeros_validos.indexOf(actual) == -1)
                retorno = false;
        }

        return retorno;
    }

    function tope_pagina(event) {
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Posiciona la página al principio.
    //----------------------------------------------------------------------
        window.scrollTo(0,0)
    }

    //------------------------------------------------------------
    // AJAX
    //------------------------------------------------------------

    function nuevoAjax(){
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Crea un nuevo objeto 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 llamarProceso(script, division, datos, divmensaje, mensaje) {
    //----------------------------------------------------------------------
    // PROPOSITO:
    // Carga el resultado del script indicado en la division correspondiente
    // presentando el mensaje en la posición indicada.
    //----------------------------------------------------------------------

        if (divmensaje != null && mensaje != '') {
            contenedor = document.getElementById('MENSAJETOP');
            cambiar_texto(divmensaje, mensaje);
        }

        contenedor = document.getElementById(division);

        if (mensaje != '')
            contenedor.innerHTML = mensaje;

        ajax=nuevoAjax();
        ajax.open("POST", script, true);
        ajax.onreadystatechange=function() {
            if (ajax.readyState==4) {
                contenedor.innerHTML = ajax.responseText;
            }
        }
        ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
        ajax.send("datos="+datos)
    }

