var timeoutCotizacionesIndices;
                
function onLoadIndices() {
    // Inicializo la columna derecha.
    onLoadColumnaDerecha();
    // Defino el tiempo para cancelar la solicitud.
    DWREngine.setTimeout(timeToCancelRefresh);
    // Defino el manejador de errores para dwr.
    DWREngine.setErrorHandler(errorHandlerDwr);
    
    timeoutCotizacionesIndices = setTimeout("getCotizacionesIndices()", timeToRefresh);
}

function getCotizacionesIndices() {
    // Cancelo el timer para que no refresque por el momento.
    window.clearTimeout(timeoutCotizacionesIndices);
    // Obtengo los datos.
    Indices.getHTMLIndices(onDatosRecibidosIndices);
    // Defino el tiempo a esperar para obtener nuevamente los datos.
    timeoutCotizacionesIndices = setTimeout("getCotizacionesIndices()", timeToRefresh);
}

function onDatosRecibidosIndices(data) {
    // Cancelo el timer para que no refresque por el momento.
    window.clearTimeout(timeoutCotizacionesIndices);
    // Cargo los datos en la página.
    DWRUtil.setValue("tablaindices", data);
    // Defino el tiempo a esperar para obtener nuevamente los datos.
    timeoutCotizacionesIndices = setTimeout("getCotizacionesIndices()", timeToRefresh);
}

function errorHandlerDwr(msg) {
    window.defaultStatus="Error al obtener los datos... " + msg;
}
