function trimString (str) 
{
    str = this != window? this : str;
    return str.replace(/^\\s+/g, '').replace(/\\s+$/g, '');
}

function checkSearch()
{
    var kw = trimString(document.ricerca.keywords.value);
    if (kw.length < 2)
    {
        alert('Devi inserire almeno un termine di ricerca, di lunghezza minima due caratteri');
        return false;
    }
        else
    {
        return true;
    }
}
