﻿var i;
var alphabet="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var filename=document.location.pathname;
i=filename.lastIndexOf('/');
var lettre=filename.substring(i+2,i+3);
var longtitle=window.document.title;
i=longtitle.indexOf('|');
var titre=longtitle.substring(0,i);

function bottomMail() { 
        var x1=":jp."; 
        var x2="quei"; 
        var x3="ll@fr"; 
        var x4="ee."; 
        document.getElementById('BottomMail1').href="mailto"+x1+x2+x3+x4+"fr"; 
        document.getElementById('BottomMail2').href="mailto"+x1+x2+x3+x4+"fr"; 
} 

function barre(lettre) { 
        var c,output; 
        output = '<div id="' + lettre + '"><h2><a name="' + lettre + '"></a>'; 
        for (var i=0; i<26; i++) 
        {       
                c = alphabet.substring(i,i+1); 
                if (c==lettre) 
                { 
                        output += '<b>'+c+'</b> '; 
                } 
                else 
                { 
                        output += '<a href="#' + c + '">' + c + '</a> '; 
                } 
        } 
        output += '</h2></div>'; 
        document.getElementById("main").innerHTML += output; 
} 

function nextL()
{
	var c;
	if (lettre=='Z')
		return ('A')
	else
		for (var i=0; i<25; i++)
		{
	            c = alphabet.substring(i,i+1); 
                if (c==lettre) 
                { 
                        return (alphabet.substring(i+1,i+2)); 
                } 
		}
}

function goToNext()
{
	var output;
	output = '<a href="G'+nextL()+'.html">suite</a>'; 
    document.getElementById("suite").innerHTML = output; 
}

function goTo(sel) {
	indexS=sel.selectedIndex;
	dest=sel.options[indexS].value;
	location.replace(dest);
}

function menuG() { 
        var c, output; 
        output = '<select class="nav" name="popup_name" onchange="goTo(this);">'; 
        for (var i=0; i<26; i++) 
        {       
                c = alphabet.substring(i,i+1); 
                output += '<option '; 
                if (c==lettre) 
                { 
                        output +='selected '; 
                } 
                output +='value="G'+c+'.html">  '+c+'</option>'; 
        } 
        output +='</select>'; 
        document.getElementById("Gmenu").innerHTML += output; 
} 

function sendForm() { 
        var x1=":jp."; 
        var x2="quei"; 
        var x3="ll@wan"; 
        var x4="adoo."; 
        document.getElementById('aboForm').action = 'mailto'+x1+x2+x3+x4+'fr?Subject=Abonnement PGEFF'; 
} 

function writeBottomTitle() { 
        document.getElementById("bottomTitle").innerHTML = '<strong>Document : '+window.document.title+'</strong>'; 
} 

function writeLetterInCrumbs() { 
        document.getElementById("crumbs").innerHTML += lettre ; 
} 

function writeTitleInCrumbs() { 
        document.getElementById("crumbs").innerHTML += titre ; 
} 

function writeLetterInSurtitle() { 
        document.getElementById("Surtitle").innerHTML += lettre ; 
} 

function writeTitleInNotuleHeader() { 
        document.getElementById("notuleHeader").innerHTML += titre ; 
} 

function writeLetterInEmpty() { 
        document.getElementById("empty").innerHTML += lettre ; 
} 

function mailTo(x,y) {
	myWindow = window.open("envoimail.html", "Mail", 'toolbar=no');
	myWindow.location="mailto:"+x+"@"+y;
	myWindow.close(); 
}

