function HashTable(){
    this.hashTable = {};
    this.put = function(key,value){
        this.hashTable[key] = value;
    }
    this.get = function(key){
        return this.hashTable[key];
    }
}

function loadErrorMessages(section,callback){
    var xmlhttp = initAjax();
    xmlhttp.open('GET','js_loadErrorMessages.php?section='+section,true);
    xmlhttp.onreadystatechange = function(){
        if (xmlhttp.readyState == 4){
            evalCode = xmlhttp.responseText;
            eval(evalCode);
            if(callback){
                eval(callback+'();');
            }
        }
    }
    xmlhttp.send(null);
}

function confirmAjaxRequestError(){
    if(confirm(Speech.get("ERROR_AJAX_REQUEST"))){
        window.location.reload();
    }else{
        window.location.href = '/';
    }
}

function getMessage(){
    return errorMessagesHashTable
}

var errorMessagesHashTable = new HashTable();
var Speech = new HashTable();

Speech.put("ERROR_AJAX_REQUEST","Hubo un problema con la conexión.\n¿Desea reintentar con la operación?");

