function clsQUERY()
{

    msgTXT = document.getElementById("msg");
    msgTXT.style.visibility = "hidden";

    msgRES = document.getElementById("result");
    msgRES.style.visibility = "hidden";

    msgINT = document.getElementById("introduccion");
    msgINT.style.visibility = "visible";

    document.buscar.expresion.value = "";

}


function runQUERY()
{
    exp = document.buscar.expresion.value;
    exp = exp.toLowerCase();

    if (exp.length==0) return;

    msgTXT = document.getElementById("msg");
    msgTXT.style.visibility = "visible";

    msgRES = document.getElementById("result");
    msgRES.style.visibility = "visible";

    msgINT = document.getElementById("introduccion");
    msgINT.style.visibility = "hidden";


/********************
 * Ubica los registros
 ********************/

    res = ""; arrEXP = exp.split(" "); idxRES="";totREG = 0;
    totDATA = document.cdDATA.keyWORD.length;

//alert(document.cdDATA.recDATA.length);

    for(ix=0;ix<totDATA;ix++)
    {
        addRECORD=true;

        for (ax=0;ax<arrEXP.length && addRECORD!=false;ax++)
        {
            keyWORD = document.cdDATA.keyWORD.options[ix].value;

            if (keyWORD.indexOf(arrEXP[ax])>=0) addRECORD=true;
            else addRECORD=false;
        }

        if (addRECORD==true){

            totREG++;
            res = res + "<b>" + totREG + ".</b> " +document.cdDATA.recDATA.options[ix].value +"<p>";
        }
    }

    msgTXT.style.visibility = "hidden";
    msgSEARCH = "No se recuperaron registros";
    if (document.buscar.idioma.value=="I") msgSEARCH = "No records found";
    if (document.buscar.idioma.value=="P") msgSEARCH = "Registros não recuperados";

    msgRESULT = "Total Registros";
    if (document.buscar.idioma.value=="I") msgRESULT = "Hits";
    if (document.buscar.idioma.value=="P") msgRESULT = "Total Registros";

    if (res=="") result.innerHTML = msgSEARCH + " <br><br><hr size=1 color=#c5960a>";
    else result.innerHTML = "<b>" + msgRESULT + ":</b> " + totREG + "<br><br>\n" + res + "<hr size=1 color=#c5960a>";

}


function inputTEC(e)
{
    if (e.keyCode==13) runQUERY();
}