/* ---------------------
Scripts généraux du site
--------------------- */
var vNavi
var vVisible, vCache, vDeb, vStyl1, vVis, vTop, vLeft, vColor, vBackColor, vFin
var vLargeur, vHauteur
var vLText1, vLText2, vLVirg
var vLargeUtile

var vPosX, vPosY, vPosAffX, vPosAffY

document.onmousemove=mousePositX;

function mousePositX(e) {
    if (vNavi=="ie4") {
        vPosX=event.x + document.body.scrollLeft
        vPosY=event.y + document.body.scrollTop
    } else {
        vPosX=(e.pageX)
        vPosY=(e.pageY)
    }
}

function showBulle(bulle) {
    vPosAffX = vPosX + 15
    vPosAffY = vPosY - 20
    if (vNavi!="ns4") {
        vTextAlign = ".textAlign=\"";
        chaine = vDeb + bulle + vStyl1 + vTextAlign + "center" + vFin
        eval(chaine)
    }
    // si on déborde sur la marge de gauche on affiche à 0
    if ( vPosAffX < 0 ) { vPosAffX = 0 }

    // on positionne la bulle
    chaine = vDeb + bulle + vStyl1 + vLeft + vPosAffX + vFin
    eval(chaine)
    chaine = vDeb + bulle + vStyl1 + vTop + vPosAffY + vFin
    eval(chaine)

    // et on l'affiche
    chaine = vDeb + bulle + vStyl1 + vVis + vVisible + vFin
    eval(chaine)
}

//  Cette fonction efface l'info-bulle
function hideBulle(bulle) {
    chaine = vDeb + bulle + vStyl1 + vVis + vCache + vFin
//    vAffiche=false
    eval(chaine)
}


/* ---------------------
Rend les objets visibles
--------------------- */
function affiche(obj) {
    ch = vDeb + obj + vStyl1 + vVis + vVisible + vFin
    eval(ch)
}

/* -----------------------
Rend les objets invisibles
----------------------- */
function cache(obj) {
    ch = vDeb + obj + vStyl1 + vVis + vCache + vFin
    eval(ch)
}

/* ---------------------------------------------------
Initialisation des variables en fonction du navigateur
--------------------------------------------------- */
function trouveNavi() {
    if ( document.all ) { vNavi = "ie4" }
    if ( document.layers ) { vNavi = "ns4" }
    if ( document.getElementById&&!document.all ) { vNavi = "ns6" }

    if ( vNavi=="ie4" ) {
        vVisible = "visible";
        vCache = "hidden";
        vDeb = "document.all[\'";
        vStyl1 = "\'].style";
        vLargeur=document.body.clientWidth;
        vHauteur=document.body.clientHeight;
    }

    if ( vNavi=="ns4" ) {
        vVisible = "show";
        vCache = "hide";
        vDeb = "document.layers[\'";
        vStyl1 = "\']";
        vLargeur = window.innerWidth;
        vHauteur = window.innerHeight;
    }

    if ( vNavi=="ns6" ) {
        vVisible = "visible";
        vCache = "hidden";
        vDeb = "document.getElementById(\'";
        vStyl1 = "\').style";
        vLargeur = window.innerWidth;
        vHauteur = window.innerHeight;
    }
    vVis=".visibility=\"";
    vTop = ".top=\"";
    vLeft = ".left=\"";
    vColor = ".color=\"";
    vBackColor = ".backgroundColor=\"";

    vFin = "\"";
}

/* -----------------------------------------
Cette fonction recharge le document en cours
----------------------------------------- */
function recommence() {
    document.location.reload()
}

/* --------------------------------
Cette fonction précharge les images
-------------------------------- */
function preload(obj, src) {
    if (document.images) {
        eval(obj + ' = new Image()')
        eval(obj + '.src = "' + src + '"')
    }
}

function changeMenu(src,obj,obj2) {
    toto=document.F.cache.value
    if (toto!=src) {
        if (document.images) {
            if (vNavi!="ns4") {
		    document.images[src].src = eval(obj+".src")
            } else {
ch = "document." + obj2 + ".document.images[src].src = eval(obj+\".src\")"
eval(ch)

//                document.menu.document.images[src].src = eval(obj+".src")
            }
        }
    }
}

function placeTitre2() {
    vLObj=400; vLargeUtile=vLargeur-215;
    
    if (vLargeur>750 & vLargeur<=1000) { vLObj=480 }
    if (vLargeur>1000) {vLObj=580}
    vGauche=(vLargeUtile-vLObj)/2; vGauche=vGauche+215

    ch = vDeb + "text1a" + vStyl1 + vLeft + vGauche + vFin;
    eval(ch);
    ch = vDeb + "text1b" + vStyl1 + vLeft + (vGauche-2) + vFin;
    eval(ch);

    vLText2=vGauche+150
    vLVirg=vGauche+24

    if ((vLargeur>750) & (vLargeur<1000)) {
        vLText2=vGauche+220
        vLVirg=vGauche+100
    }

    if (vLargeur>1000) {
        vLText2=vGauche+250
        vLVirg=vGauche+150
    }
    ch = vDeb + "text2a" + vStyl1 + vLeft + vLText2 + vFin;
    eval(ch);
    ch = vDeb + "text2b" + vStyl1 + vLeft + (vLText2-2) + vFin;
    eval(ch);
    ch = vDeb + "virgule" + vStyl1 + vLeft + vLVirg + vFin;
    eval(ch);
    ch = vDeb + "text1a" + vStyl1 + vTop + "39" + vFin;
    eval(ch);
    ch = vDeb + "text1b" + vStyl1 + vTop + "37" + vFin;
    eval(ch);
    ch = vDeb + "text2a" + vStyl1 + vTop + "64" + vFin;
    eval(ch);
    ch = vDeb + "text2b" + vStyl1 + vTop + "62" + vFin;
    eval(ch);
    ch = vDeb + "virgule" + vStyl1 + vTop + "35" + vFin;
    eval(ch);
    ch = vDeb + "text1a" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
    ch = vDeb + "text1b" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
    ch = vDeb + "text2a" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
    ch = vDeb + "text2b" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
    ch = vDeb + "virgule" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
    if ( document.F.cache.value != "non" ) {
        ch = vDeb + "menu" + vStyl1 + vVis + vVisible + vFin;
        eval(ch);
    }
}

function poseTitrePage(largeur) {
    laPos = ((vLargeur-215)-largeur)/2
    laPos = laPos + 215
    laPos1 = laPos - 1
    laPos2 = laPos + 1
    ch = vDeb + "titre1" + vStyl1 + vLeft + laPos1 + vFin;
    eval(ch);
    ch = vDeb + "titre2" + vStyl1 + vLeft + laPos2 + vFin;
    eval(ch);
    ch = vDeb + "titre1" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
    ch = vDeb + "titre2" + vStyl1 + vVis + vVisible + vFin;
    eval(ch);
}

function openPage(laPage) {
    open(laPage,"page","menubar=yes,scrollbars=yes,resizable=yes"); 
}

function versTop() {
    if ( document.getElementById&&!document.all ) {
        document.location.reload()
    } else {
        document.location.href="#TOP"
    }
}

function barreetat(mess) {
    if (window.status != mess) { window.status = mess     }
}

