// -------------------------------------------------------------------
// Función encargada de Recargar el ifarme con la Sección Correspondiente
function ChangeIframeContent(prontus_id, fid, seccion) {

    var myselect = document.getElementById('buscar_seccion');
    var sec_id = myselect.options[myselect.selectedIndex].value;
    var sec_nom = myselect.options[myselect.selectedIndex].text;
    var seccionstr;

    // Si el Id está vacío no se hace nada
    if(sec_id=='' || sec_id==null) {
        return;
    };

    // Deben venir si o si los datos mínimos.
    if(fid=='' || prontus_id=='') {
        return;
    }

    // Si el ID es 'all' se muestran todas las secciones
    if(sec_id=='all') {
        seccionstr = '';
    } else {
        seccionstr = '_seccion='+sec_id+'&';
    };
   
    var myframe = document.getElementById('Mediaiframe');
    if(myframe) {
        if (seccion == 'all'){
          _href="/"+ prontus_id +"/site/tax/port/"+fid+"/taxport____1.html";
        } else {
          _href="/"+ prontus_id +"/site/tax/port/"+fid+"/taxport_"+ seccion +"___1.html";
        }
        myframe.src = _href;
    };
    resetBuscador();
    setTituloIframe(sec_nom);
};

// -------------------------------------------------------------------
function changeBuscador() {

    resetTaxonomia();
    setTituloIframe("Buscador");
    return true;
};


// -------------------------------------------------------------------
function setTituloIframe(texto) {
    var titDiv = document.getElementById("tituloMedia");
    if(titDiv) {
        titDiv.innerHTML = "<p>" + texto + "</p>";
    };
};

// -------------------------------------------------------------------
function resetTaxonomia() {
    var elem = document.getElementById("buscar_seccion");
    if(elem) {
        elem.selectedIndex = 0;
    };
    return true;
};

// -------------------------------------------------------------------
function resetBuscador() {
    var elem = document.getElementById("searchMediaTexto");
    if(elem) {
        if(elem.value!='Buscar...')
            elem.value = 'Buscar...';
    };
};


