/*
    All scripts in this page (c) stef deschamps for cie.fr
    stef@nota-bene.org
*/

var isNN = (document.layers);
var isIE = (document.all);
var isDyn = (parseInt(navigator.appVersion) >= 4);

function afficher(nomDiv) {
    if (isDyn) {
        if (isNN) {
            document.layers[nomDiv].visibility = "show";
        } else{
            document.all[nomDiv].style.visibility = "visible";
        }
    }
}

function masquer(nomDiv) {
    if (isDyn) {
        if (isNN) {
            document.layers[nomDiv].visibility = "hide";
        } else{
            document.all[nomDiv].style.visibility = "hidden";
        }
    }
}

function posDiv(id,haut,gauche) {
    //id est l'id de la div
    //haut et gauche sont les positions du coin superieur gauche
    if(isDyn){
        if(isNN){
            //si NN4
            document.layers[id].moveTo(gauche,haut);
        } else {
            //si IE
            document.all[id].style.pixelLeft = gauche;
            document.all[id].style.pixelTop = haut;
        }
    }
}

function getGauche(id) {
    //renvoie la position gauche de la div
    if(isNN){
        //si NN4
        gauche = document.layers[id].left;
    } else if(isIE) {
        //si IE
        gauche = document.all[id].style.pixelLeft;
    }
    return gauche;
}

function getHaut(id) {
    //renvoie la position haut de la div
    if(isNN){
        //si NN4
        haut = document.layers[id].top;
    } else if(isIE){
        //si IE
        haut = document.all[id].style.pixelTop;
    }
    return haut;
}

function largeurPage() {
    //calcul de la largeur d'affichage
    var largeur = 800;
    if(isIE) { largeur = document.body.clientWidth }
    if(isNN) { largeur = window.innerWidth }
    return largeur;
}

