elcod = {
    valor_inicial_busqueda : null,
    span_title : null,
}


window.onload = function() {
    var elem = document.getElementById('searchbox');
    elcod.valor_inicial_busqueda = elem.value;

    elcod.span_title = document.createElement('span');
    elcod.span_title.innerHTML = elem.getAttribute('title');
    elcod.span_title.setAttribute('id', 'span_title');
    elem.setAttribute('title', '');
    document.getElementById("boton_busqueda").style.display = 'none';
    elem.parentNode.appendChild(elcod.span_title);
    
    elem.onfocus = function() {
        if (elem.value == elcod.valor_inicial_busqueda) {
            elem.value = '';
        }
        elcod.span_title.style.display = 'block';
    };
    elem.onblur = function() {
        if (elem.value.length == 0) {
            elem.value = elcod.valor_inicial_busqueda;
        }
        elcod.span_title.style.display = 'none';
    };
};
