/* Funciones de elementos mostrados en formato lytebox específicos de FUNDESTAP. */

var timeoutID = null;

/* Must pass in the "anchors" ID so that Lytebox can call the correct "onclick" handler... */
function loadLytebox_cuestionario_final() {
    if (typeof myLytebox != 'undefined') {
        // if the myLytebox object exists, start it up!
        var a = document.createElement("a");
        a.href = "cuestionario_final.htm";
        a.rel = "lyteframe";
        a.title = "Cuestionario de evaluación final";
        a.rev = "width: 850px; height: 500; scrolling: auto;";
        myLytebox.start( a, false, true);
    } else {
        // wait 1/10th of a second and attempt loading again...
        if (timeoutID) { clearTimeout(timeoutID); }
        timeoutID = setTimeout('loadLytebox_cuestionario_final()', 100);
    }
}

function loadLytebox_bienvenida_curso() {
    if (typeof myLytebox != 'undefined') {
        // if the myLytebox object exists, start it up!
        var a = document.createElement("a");
        a.href = "bienvenida.html";
        a.rel = "lyteframe";
        a.title = "Bienvenida al curso";
        a.rev = "width: 850px; height: 500; scrolling: auto;";
        myLytebox.start( a, false, true);
    } else {
        // wait 1/10th of a second and attempt loading again...
        if (timeoutID) { clearTimeout(timeoutID); }
        timeoutID = setTimeout('loadLytebox_bienvenida_curso()', 100);
    }
}

function loadLytebox_make_test(id) {
    if (typeof myLytebox != 'undefined') {
        // if the myLytebox object exists, start it up!
        var cadcero = '';
        var id_final = ''
        id_final = id.toString();
        for(i=0;i<(5-id_final.length);i++){
          cadcero+='0';
        }
        id_final = cadcero + id_final;

        var a = document.createElement("a");
        a.href = "indexnomenu.php?action=make_test&id=" + id_final;
        a.rel = "lyteframe";
        a.title = "Realizar Evaluación";
        a.rev = "width: 850px; height: 500; scrolling: auto;";
        myLytebox.start( a, false, true);
    } else {
        // wait 1/10th of a second and attempt loading again...
        if (timeoutID) { clearTimeout(timeoutID); }
        timeoutID = setTimeout('loadLytebox_make_test(' + id + ')', 100);
    }
}