
show = false;

function menu(name) {
    if (document.getElementById('menu-'+name).style.visibility == 'hidden' || document.getElementById('menu-'+name).style.visibility == '') {
        document.getElementById('button-'+name).style.backgroundColor = '#f90';
        document.getElementById('menu-'+name).style.visibility = 'visible';
        show = true;
    } else {
        document.getElementById('menu-'+name).style.visibility = 'hidden';
        show = false;
    }
}

function menu_over(name) {
    if (show == true) {
        if (document.getElementById('menu-'+name).style.visibility == 'hidden' || document.getElementById('menu-'+name).style.visibility == '') {
            hide();
            document.getElementById('button-'+name).style.backgroundColor = '#f90';
            document.getElementById('menu-'+name).style.visibility = 'visible';
        }
    }
}

function menu_hide() {
    show = false;
    hide();
}

function sendEmail(name) {
    window.location.href = 'mailto:'+name+'@aqtc.ca';
}

function deleteNews(id,lang) {
    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer cette nouvelle?     ')) {
            window.location.href = 'accueil.html?delete='+id;
        }
    } else {
        if (confirm('Are you sure you want to delete this news?     ')) {
            window.location.href = 'home.html?delete='+id;
        }
    }
}

function deleteActivity(id,lang) {
    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer cet activité?     ')) {
            window.location.href = 'activites.html?delete='+id;
        }
    } else {
        if (confirm('Are you sure you want to delete this activity?     ')) {
            window.location.href = 'activities.html?delete='+id;
        }
    }
}

function deleteAlbum(lang) {
    url = window.location.href;
    tmp = url.split('?');
    url = tmp[0];

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer cet album?     ')) {
            window.location.href = url+'?delete';
        }
    } else {
        if (confirm('Are you sure you want to delete this album?     ')) {
            window.location.href = url+'?delete';
        }
    }
}

function deletePicture(name,lang) {
    url = window.location.href;
    tmp = url.split('?');
    url = tmp[0];

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer cette photo?     ')) {
            window.location.href = url+'?delete='+name;
        }
    } else {
        if (confirm('Are you sure you want to delete this picture?     ')) {
            window.location.href = url+'?delete='+name;
        }
    }
}

function deleteBlog(lang) {
    url = window.location.href;
    tmp = url.split('?');
    url = tmp[0];

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer cet article?     ')) {
            window.location.href = url+'?delete';
        }
    } else {
        if (confirm('Are you sure you want to delete this article?     ')) {
            window.location.href = url+'?delete';
        }
    }
}

function deleteComment(id,lang) {
    url = window.location.href;
    tmp = url.split('?');
    url = tmp[0];

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer ce commentaire?     ')) {
            window.location.href = url+'?delete='+id;
        }
    } else {
        if (confirm('Are you sure you want to delete this comment?     ')) {
            window.location.href = url+'?delete='+id;
        }
    }
}

function deleteMember(id,lang) {
    url = window.location.href;
    tmp = url.split('?');
    url = tmp[0];

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer ce membre?     ')) {
            window.location.href = url+'?delete='+id;
        }
    } else {
        if (confirm('Are you sure you want to delete this member?     ')) {
            window.location.href = url+'?delete='+id;
        }
    }
}

function deletePage(lang,path) {
    if (path == undefined) {
        path = window.location.href;
    }

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer cette page?     ')) {
            window.location.href = path+'?delete';
        }
    } else {
        if (confirm('Are you sure you want to delete this page?     ')) {
            window.location.href = path+'?delete';
        }
    }
}

function deleteFile(name,lang) {
    url = window.location.href;
    tmp = url.split('?');
    url = tmp[0];

    if (lang == 'FR') {
        if (confirm('Êtes-vous sûr de vouloir supprimer ce fichier?     ')) {
            window.location.href = url+'?delete='+name;
        }
    } else {
        if (confirm('Are you sure you want to delete this file?     ')) {
            window.location.href = url+'?delete='+name;
        }
    }
}

function printView() {
    url   = window.location.href;
    path  = url.split('#');
    path  = path[0]+'?print';
    param = 'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=no,copyhistory=yes,width=575,height=425,left=100,top=100';
    wnd   = window.open(path,'foo',param);
    wnd.focus();
}

function textSize(size) {
    url = window.location.href;
    if (url.indexOf('#') == -1) {
        window.location.href = url+'?textsize='+size;
    } else {
        url = url.replace(/#/,'?textsize='+size+'#')
        window.location.href = url;
    }
}


