function Login() {
        if (document.getElementById('login').style.display == '') {
                document.getElementById('login').style.display = 'none';
        }
        else {
                document.getElementById('login').style.display = '';
                document.getElementById('pseudo').focus();
        }
}

function ShowADiv(a) {
        if (document.getElementById(a).style.display == '') {
                document.getElementById(a).style.display = 'none';
        }
        else {
                document.getElementById(a).style.display = '';
        }
}

function ShowAMenu(a) {
        if (document.getElementById) {
                cur = document.getElementById(a);
                if (document.all){
                        if (cur.filters.alpha.opacity <= 0) cur.filters.alpha.opacity = 100;
                        else cur.filters.alpha.opacity = 0;
                }
                else {
                        if (parseFloat(cur.style.getPropertyValue("-moz-opacity"))<=0) cur.style.setProperty("-moz-opacity", 1, "");
                        else cur.style.setProperty("-moz-opacity", 0, "");
                }
        }
}

function ChangeButtonText() {
        if (document.getElementById('pub').checked){
                document.getElementById('submit').value='Enregistrer seulement l\'épisode';
        }
        else {
                document.getElementById('submit').value='Enregistrer et publier l\'épisode';
        }
}

function WaitScreen() {
        document.getElementById('formAdd').style.display='none';
        document.getElementById('formWait').style.display='';
        window.location.href='#';
}

function ViewDefinition(id,path){

        var popWidth = 300;
        var popHeight = 350;
        var brwWidth = 0;
        var brwHeight = 0;
        var popX = 0;
        var popY = 0;

        var IE = document.all ? true : false;

        if (IE){
                brwWidth = window.innerWidth + document.scrollLeft;
                brwHeight = window.innerHeight + document.scrollTop;
        }
        else {
                brwWidth = document.documentElement.clientWidth + document.documentElement.scrollLeft;
                brwHeight = document.documentElement.clientHeight + document.documentElement.scrollTop;
        }

        popX = Math.round((brwWidth / 2)-(popWidth / 2));
        popY = Math.round((brwHeight / 2)-(popHeight / 2));

        window.open(path + 'help/glossary/?id=' + id,'Definition','toolbar=0,location=0,directories=0,status=1,scrollbars=1,resizable=0,copyhistory=0,menuBar=0,width=' + popWidth + ',height=' + popHeight + ',top=' + popY + ',left=' + popX);
}