function ch(opt){
  ecr(opt,'option');
}

function ecr(text,id){
var txt = '&nbsp;<b>OPTIONS<\/b> :<br> - <a href="#" onClick="va(&#39;' + text + '&#39;); return false">' + text + '<\/a> dans le lexique de G. Jeanneau.<br> - Analyse morphologique de <a href="#" onClick="ve(&#39;' + text + '&#39;); return false">' + text + '<\/a> par Perseus.<br> - Rechercher la forme <b>' + text + '</b> dans la <a href="#" onClick="vi(&#39;' + text + '&#39;); return false">litt&eacute;rature latine<\/a>.';
  if (document.getElementById){
    ot = document.getElementById(id);
    ot.innerHTML = txt;
  }
  else if (document.all){
    ot = document.all[id];
    ot.innerHTML = txt;
  }
  else if (document.layers){
    ot = document.layers[id];
    text2 = '<p class="optionclass" style="margin-left: 4em">' + txt + '<\/p>;';
    ot.document.open();
    ot.document.write(text2);
    ot.document.close();
  }
}

 var incipit=new Array(
  new Array("a","ac","ad","ado","ael","al","am","an","ap","ar","as","at"),
  new Array("b"),
  new Array("ca","can","cas","ce","ch","cis","cle","cog","com","cona","cong","cont","cr","cuj"),
  new Array("da","ded","der","di","dir","dit"),
  new Array("e","eg","em","es","exb","exo","ext"),
  new Array("fa","fe","fi","fl","fr","fu"),
  new Array("g"),
  new Array("h"),
  new Array("ia","imi","imu","ind","infi","inn","inst","inter","intes","invi"),
  new Array("j"),
  new Array("k"),
  new Array("la","lau","lep","lob","luc"),
  new Array("ma","mam","me","mi","mo","mu"),
  new Array("na","ne","neo","ni","no","nu"),
  new Array("ob","obn","obum","olo","or"),
  new Array("pa","pas","pen","perd","perm","pert","pie","poc","pos","praeh","praet","pro","pron","prov"),
  new Array("qua","que","qui","quo"),
  new Array("ra","re","rel","ret","ri"),
  new Array("sa","sc","se","si","so","sp","st","sua","suc","suo"),
  new Array("ta","te","th","tom","tram","tro"),
  new Array("u","un","us","uti"),
  new Array("va","ve","ves","vig","vo"),
  new Array("x"),
  new Array("z"));
		
  lettres=new Array(
    "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r",
	"s","t","u","v","x","z");
	
	var ana = '';

function ve(entree2) {
 if (ana) ana.close();
    ana=window.open('http://www.perseus.tufts.edu/cgi-bin/morphindex?lookup=' + entree2 + '&.submit=Analyze+Form&lang=la&formentry=1','Analyse','height=300,width=650,screenX=0,left=0,screenY=0,top=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');
		if (window.focus) {ana.focus()} 
}

function va(entree1) {
 if (ana) ana.close()
  var i;
  var lalettre;
  var tableau;
		 
		 for (i=0;i<lettres.length;i++) {
    if (entree1.substring(0,1)==lettres[i]) {
	  lalettre=lettres[i];
	  break;
	  }
	}
   tableau=incipit[i];
   for (i=tableau.length-1;i>-1;i--){
     if (entree1>=tableau[i]) {
	   i++;
	   if (i<10) {
	     i="0"+i;
	     }
	   if (tableau.length==1){
     ana=window.open('http://perso.wanadoo.fr/prima.elementa/Dico-' + lalettre + '.htm#' + entree1 + '','Analyse','height=300,width=650,screenX=0,left=0,screenY=0,top=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');
     if (window.focus) {ana.focus()}
		 }
  	 else  {
     ana=window.open('http://perso.wanadoo.fr/prima.elementa/Dico-' + lalettre + i +'.html#' + entree1 + '','Analyse','height=300,width=650,screenX=0,left=0,screenY=0,top=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');
	   if (window.focus) {ana.focus()}
		 } 
	   break;
	   }
     }
   }

function vi(entree3) {
 if (ana) ana.close();
    ana = window.open('coll.html','','height=300,width=650,screenX=0,left=0,screenY=0,top=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');
		ana.document.open();
		ana.document.write('<html><head>');
		ana.document.write('<meta http-equiv="Content-Type" content="text\/html"><\/head>');
		ana.document.write('<body><h4>Patience, la page de r&eacute;sultat va appara&icirc;tre...<\/h4><br><img src="fichiers/sys.gif" alt="patienter" border="0"><br>');
		ana.document.write('<form method="POST" action="http://www.picosearch.com/cgi-bin/ts.pl" name="rech" style="display: none; visibility: hidden;"><select name="opt">');
		ana.document.write('<option selected value="ANY">Chercher au moins un mot</option>');
		ana.document.write('<\/select><input type="HIDDEN" name="index" value="123844"><a href="http://www.picosearch.com/" target="_top">');
		ana.document.write('<img border="0" src="http://www.picosearch.com/picosmall9.gif" alt="PicoSearch"><\/a><input type="TEXT" name="query" value="' + entree3 + '">');
		ana.document.write('<input type="submit" value="Rechercher" name="SEARCH"><\/form>');
		ana.document.write('<\/body><\/html>');
		ana.document.close();
		ana.document.rech.submit();
 if (window.focus) {ana.focus()}
}

function vu(tit,latin) {
 if (ana) ana.close();
    ana = window.open('coll.html','','height=300,width=650,screenX=0,left=0,screenY=0,top=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');	
		ana.document.open();
		ana.document.write('<html><head>');
		ana.document.write('<meta http-equiv="Content-Type" content="text\/html"><\/head><body>'); 
		ana.document.write('Patientez...<img src="fichiers/sys.gif" alt="patienter" border="0"><br><form method="post" action="http://collatinus.fltr.ucl.ac.be/index.php" enctype="http://collatinus.fltr.ucl.ac.be/multipart/form-data" name="lat" target="_self" style="visibility: hidden; display: none">');
		ana.document.write('<input name="titre" value='+tit+'>');
		ana.document.write('<input name="intro"><input name="texte" type="submit" value="Lemmatiser"><textarea cols="80" rows="4" name="texte">'+latin+'</textarea><\/form>');
		ana.document.write('<\/body><\/html>');
		ana.document.close();
		ana.document.lat.submit();
		if (window.focus) {ana.focus()}
}

function vo(url) {
 if (ana) ana.close();
    comm = window.open(url,'','height=300,width=700,screenX=0,left=0,screenY=0,top=0,directories=1,location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1');	
		if (window.focus) {comm.focus()}
}

var bon = (document.getElementById || document.all);

if (bon)
{
	document.write("<STYLE TYPE='text/css'>");
	document.write(".note {display: none; background-color: #ffffcc; font-size: 8pt; color: #000000; text-align: justify; position: absolute; border: 2px #ffffff; border-style: inset; right: 10%; width: 300pt}");
	document.write("</STYLE>");

	var max = 7;
	var shown = new Array();
	for (var i=1;i<=max;i++)
	{
		shown[i+1] = false;
	}

}

function glose(i)
{
	if (!bon)
	{
		alert('Ce lien ne fonctionne pas avec votre navigateur.');
		return;
	}
	shown[i] = (shown[i]) ? false : true;
	current = (shown[i]) ? 'block' : 'none';
	if (document.getElementById)
	{
		document.getElementById('nbr'+i).style.display = current;
	}
	else if (document.all)
	{
		document.all['nbr'+i].style.display = current;
	}
}

function vob(url) {
var admis = (document.getElementById);
if (admis){
    var str = "screenX=0,left=0,screenY=0,top=0,directories=0,location=0,menubar=0,resizable=1,scrollbars=1,status=1,toolbar=1";
    if (window.screen) {
      var ah = screen.availHeight - 30;
      var aw = screen.availWidth - 10;
      str += ",height=" + ah;
      str += ",innerHeight=" + ah;
      str += ",width=" + aw;
      str += ",innerWidth=" + aw;
    }
    ana=window.open(url, "w", str);
		if (window.focus) {ana.focus()}
}
    else{
		alert('Votre navigateur est trop ancien pour ouvrir ce lien ; utilisez au moins IE5 ou NS6, par exemple.');
		return;
	}
}

function permut(i)
{
  if (!bon)
  {
    alert('Ce lien ne fonctionne pas avec votre navigateur.');
    return;
  }
  shown[i] = (shown[i]) ? false : true;
  current = (shown[i]) ? 'block' : 'none';
  if (document.getElementById)
  {
    document.getElementById('nmr'+i).style.display = current;
  }
  else if (document.all)
  {
    document.all['nmr'+i].style.display = current;
  }
}
