function ch(opt){
  ecr(opt,'option');
}

function ecr(text,id){
var txt = '<a href="#" onclick="trad(1); return false">Voir/cacher&nbsp;la&nbsp;traduction</a>.<br><br>&nbsp;<b>OPTIONS<\/b> :<br>1)&nbsp;<a href="#" onClick="va(&#39;' + text + '&#39;); return false">' + text + '<\/a> Collatinus&nbsp;&amp;&nbsp;Jeanneau<br>(cf.&nbsp;cr&eacute;dits en&nbsp;bas&nbsp;de&nbsp;page).<br>2)&nbsp;Rechercher "<b>' + text + '</b>" dans&nbsp;la&nbsp;<a href="#" onClick="vi(&#39;' + text + '&#39;); return false">litt&eacute;rature latine<\/a>.<br>3)&nbsp;Lemmatisation par&nbsp;"<a href="#" onClick="coll(); return false">Collatinus</a>" du&nbsp;texte&nbsp;s&eacute;lectionn&eacute;.';
  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: 2em">' + txt + '<\/p>;';
    ot.document.open();
    ot.document.write(text2);
    ot.document.close();
  }
}

	var ana = '';

function vo(url) {
 if (ana) ana.close();
    ana = window.open(url,'','height=300,width=650,screenX=0,left=0,screenY=0,top=0,directories=0,location=1,menubar=0,resizable=1,scrollbars=1,status=0,toolbar=0');	
		if (window.focus) {ana.focus()}
}

function va(entree2) {
 if (ana) ana.close();
    ana=window.open('http://collatinus.fltr.ucl.ac.be/jcoll.php?forme=m:' + entree2 + '','','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 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()}
}

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}.trad {display: none; color: #000000; text-align: justify;}");
	document.write("</STYLE>");

	var max = 10;
	var montre = new Array();
	for (var i=1;i<=max;i++)
	{
		montre[i+1] = false;
	}
}

function trad(i)
{
	if (!bon)
	{
		alert('Ce lien ne fonctionne pas avec votre navigateur.');
		return;
	}
	montre[i] = (montre[i]) ? false : true;
	current = (montre[i]) ? 'block' : 'none';
	if (document.getElementById)
	{
		document.getElementById('nbr'+i).style.display = current;
		recharge(i);
	}
	else if (document.all)
	{
		document.all['nbr'+i].style.display = current;
	}
}

var stat=1;
function recharge() {
	if(stat == 0){
	 if(navigator.appName == 'Netscape') {
  location.reload();
	}
	stat=1;}
	 else {
	 stat=0;
  }
}

function glose(i)
{
	if (!bon)
	{
		alert('Ce lien ne fonctionne pas avec votre navigateur.');
		return;
	}
	montre[i] = (montre[i]) ? false : true;
	current = (montre[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 permut(i)
{
	if (!bon)
	{
		alert('Ce lien ne fonctionne pas avec votre navigateur.');
		return;
	}
	montre[i] = (montre[i]) ? false : true;
	current = (montre[i]) ? 'block' : 'none';
	if (document.getElementById)
	{
		document.getElementById('nmr'+i).style.display = current;
	}
	else if (document.all)
	{
		document.all['nmr'+i].style.display = current;
	}
}

var option;
var haut = 0;
var ancien = haut;

function ascenseur()
{
	option = new ident('option');
		if (window.innerHeight)
		{
			  pos = window.pageYOffset
		}
		else if (document.documentElement && document.documentElement.scrollTop)
		{
			pos = document.documentElement.scrollTop
		}
		else if (document.body)
		{
			  pos = document.body.scrollTop
		}
		if (pos < haut) pos = haut;
		else pos += 250;
		if (pos == ancien)
		{
			option.style.top = pos;
		}
		ancien = pos;

	temp = setTimeout('ascenseur()',500);
}

function ident(nom)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(nom);
	this.style = document.getElementById(nom).style;
  }
  else if (document.all)
  {
	this.obj = document.all[nom];
	this.style = document.all[nom].style;
  }
  else if (document.layers)
  {
   	this.obj = document.layers[nom];
   	this.style = document.layers[nom];
  }
}

function coll()
{
	if (document.getSelection) txt = document.getSelection();
	else if (document.selection) txt = document.selection.createRange().text;
	else return;
	document.forms[2].texte.value = txt.replace(new RegExp('([\\f\\n\\r\\t\\v ])+', 'g')," ");
	document.forms[2].submit();
}

