function ApriNews(id) {
    var i = 0;

    while (document.getElementById('divnews' + i) != null) {
        if (i != id) {
            document.getElementById('divnews' + i).style.display = 'none';
        } else {
            if (document.getElementById('divnews' + i).style.display == 'none') {
                document.getElementById('divnews' + i).style.display = 'block';
            } else {
                document.getElementById('divnews' + i).style.display = 'none';
            }
        }
        i++;
    }
    return false;
}
function trim(str) {
    return str.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
}
function ctrlCheck(id) {

    if (!document.getElementById(id).checked) {
        alert("E' obbligatorio dare il consenso al trattamento dei dati personali");
        return false;
    } else {
        return true;
    }
}
function ctrlRicerca(id) {
    if (document.getElementById(id).value.length < 3) {
        alert("Occorrono minimo 3 caratteri per effettuare la ricerca");
        return false;
    } else {
        return true;
    }

}

function ctrlRegistrazione(idPrivacy) {
    if (!document.getElementById(idPrivacy).checked) {
        alert("E' obbligatorio dare il consenso al trattamento dei dati personali");
        return false;
    } else {
        return true;
    }
}

function ctrlRicAvanzata(idTitolo, idTitoloOrig, idAnno, idRegia, idAttore, idGenere, idFormato) {
    return true;
}

function fncIndirizzo(pagina) {
    if (pagina != "Regolamento") {
        if (pagina == "credits") {
            window.open("credits.htm", "credits", "width=300,height=200");
        } else {
            document.location.replace(pagina + ".aspx");
        }
    } else {
        window.open(pagina + ".aspx");
    }
}

//Link managed da filmati swf
function NewLink(where) {
    switch (where) {
        case 1: document.location.replace("ElencoPremi.aspx");
            break;
        case 2: window.open("Docs/regolamento_premi.pdf", "regolamento", "");
            break;
    }
}
/*
function NewLink(where, from) {
    if (from == "AreaPersonale" || from == "RaccoltaPunti") {
        switch (where) {
            case 1: document.location.replace("ElencoPremi.aspx");
                break;
            case 2: window.open("Docs/regolamento_premi.pdf", "regolamento", "");
                break;
        }
    }
}
*/
