<!--
/*funzione trim*/
function trim(StrToTrim)
{
    // CONTROLLA CHE IL VALORE IN INPUT SIA DI TIPO STRING
    if (typeof StrToTrim != "string")
    {
        return StrToTrim;
    }

    // CATTURA IL PRIMO CARATTERE DELLA STRINGA PER CONTROLLARE CHE NON SIA UNO SPAZIO VUOTO
    var StrBlank = StrToTrim.substring(0, 1);

    // ELIMINA LO SPAZIO VUOTO DALLA PRIMA POSIZIONE DELLA STRINGA
    while (StrBlank == " ")
    {
        StrToTrim = StrToTrim.substring(1, StrToTrim.length);
        StrBlank = StrToTrim.substring(0, 1);
    }

    // CATTURA L'ULTIMO CARATTERE DELLA STRINGA PER CONTROLLARE CHE NON SIA UNO SPAZIO VUOTO
    StrBlank = StrToTrim.substring(StrToTrim.length - 1, StrToTrim.length);

    // ELIMINA LO SPAZIO VUOTO DALL'ULTIMA POSIZIONE DELLA STRINGA
    while (StrBlank == " ")
    {
        StrToTrim = StrToTrim.substring(0, StrToTrim.length-1);
        StrBlank = StrToTrim.substring(StrToTrim.length-1, StrToTrim.length);
    }

    // ELIMINA POTENZIALI SPAZI VUOTI MULTIPLI ALL'INIZIO ED ALLA FINE DI UNA STRINGA
    while (StrToTrim.indexOf("  ") != -1)
    {
        StrToTrim = StrToTrim.substring(0, StrToTrim.indexOf("  "));
        StrToTrim += StrToTrim.substring(StrToTrim.indexOf("  ") + 1, StrToTrim.length);
    }

    // RESTITUISCE IL VALORE FINALE SENZA SPAZI VUOTI DI CONTORNO
    return StrToTrim;
}

/* semplici funzioni mostra/nascondi div */
function mostradiv(nome) {
div=document.getElementById(nome);
div.style.display='block'
piu=document.getElementById(nome+'piu');
meno=document.getElementById(nome+'meno');
piu.style.display='none'
meno.style.display='inline'
}
function nascondidiv(nome) {
div=document.getElementById(nome);
div.style.display='none'
piu=document.getElementById(nome+'piu');
meno=document.getElementById(nome+'meno');
piu.style.display='inline'
meno.style.display='none'
}
/* /semplici funzioni mostra/nascondi div */

// controlo che il form di ricerca non sia vuoto
function checkSearch() {
	if (document.ricerca.s.value!='' && document.ricerca.s.value!='Posso aiutarti?' && document.getElementById('camporicerca').style.visibility!="hidden") {
		document.ricerca.submit();
	}
}

//-->