var lastimg;
var lastmini=2;


function loadingDisplay(){
	document.getElementById('LLjumping').style.display='none';
	document.getElementById('LLremiseprix').style.display='none';
	if (navigator.appName!="Microsoft Internet Explorer"){
		document.getElementById('LLphotoaccueil').style.display='none';
	}
}

function movePhoto(source){
	if (lastIn!=source){
		affichePhoto(source);
		lastIn=source;
	}
}

function outPhoto(){
	lastIn='';
}

function toggleGrand(){
	if (lastmini==2)
		affichePhoto('mini1');
	else
		affichePhoto('mini2');
}
//---------------------------------------------------------------------------------------------------------
function affichePhoto(img){
// Webexpert est vu comme navigateur Netscape et Mozilla comme Internet Explorer...
	if (img!=null){
		document.getElementById('photogrand').src="images/"+img+".jpg";
		if (lastimg!=null){
			eval("document.getElementById('LL"+lastimg+"').style.display='none'");
		}
		eval("document.getElementById('LL"+img+"').style.display='block'");
		if (navigator.appName=="Microsoft Internet Explorer"){
			if (lastimg!=null){document.getElementById('LL'+lastimg).style.display='none';}
			document.getElementById('LL'+img).style.display='block';
		}
		lastimg=img;
	}
}
//---------------------------------------------------------------------------------------------------------
function afficheseul(img){
debugger;
//alert (img);
		if (img!=null){
			source='images/'+img+'.jpg';
			MM_openBrWindow(source,'zoom','width=700, height=600');	   }
	    }

function MM_openBrWindow(theURL,winName,features) { //v2.0

   window.open(theURL,winName,features);

}
//---------------------------------------------------------------------------------------------------------
function afficheNew(obj){
// Webexpert est vu comme navigateur Netscape et Mozilla comme Internet Explorer...
// ---------------- affichage de la photo du concours -------------------
// on recupere l'index de la ligne qui déclenche la fonction :
  	//intCellIndex = obj.parentElement.cellIndex;		  ceci ne fonctionne pas sous Firefox, seulement sous IE...
   	//intRowIndex = obj.parentElement.parentElement.rowIndex;
	intCellIndex = obj.parentNode.cellIndex;
   	intRowIndex = obj.parentNode.parentNode.rowIndex;
	/* l'indice du tableau est son complément à max car on a rempli a l'envers..*/
	ind= lib.length-intRowIndex-1;
	/* on garnit le texte de la photo  */
		var obj2 = document.getElementById("bloc");
		obj2.innerHTML=lib[ind] + ' <br>-' +resul[ind] + ' -<br>' + comment[ind];
	/* on recherche le nom de la photo dans le tableau  */
	var img=photo[ind];
 //alert(img);
	/*  on l'affiche à la bonne place   */
	if (img!=null){
		document.getElementById('photogrand').src="images/"+img+".jpg";
		/*document.getElementById('photogrand').alt=lib[ind]; */
		lastimg=img;
		}
}
//---------------------------------------------------------------------------------------------------------
function afficheConc(obj,nomtable){
// Webexpert est vu comme navigateur Netscape et Mozilla comme Internet Explorer...
// ---------------- affichage de la photo du concours -------------------
// on recupere l'index de la ligne qui déclenche la fonction :
  	//intCellIndex = obj.parentElement.cellIndex;		  ceci ne fonctionne pas sous Firefox, seulement sous IE...
   	//intRowIndex = obj.parentElement.parentElement.rowIndex;
debugger;
	intCellIndex = obj.parentNode.cellIndex;
   	intRowIndex = obj.parentNode.parentNode.rowIndex;
	lib=obj.innerHTML;
	/* c'est l'indice du tableau  */
	ind=intRowIndex+1;
	/* on garnit le texte de la photo selon le tableau (gice ou sif) */
		var obj2 = document.getElementById("bloc");
		if (nomtable=='gice') {
			obj2.innerHTML=lib + ' <br>-' +resul[ind] + ' -<br>' + comment[ind]+'<br>';
			/* on recherche le nom de la photo dans le tableau  */
			var img=photo[ind];
			}
		else  {
			obj2.innerHTML=lib + ' <br>-' +resulsif[ind] + ' -<br>' + commentsif[ind]+'<br>';
			/* on recherche le nom de la photo dans le tableau  */
			var img=photosif[ind];
			}
 //alert(img);
	/*  on l'affiche à la bonne place   */
	if (img!=null){
//alert ("images/"+img+".jpg");
		if (nomtable=='gice') {
			document.getElementById('photogrand').src="images/"+img+".jpg";}
		else {
			document.getElementById('photogrand2').src="images/"+img+".jpg";}

		lastimg=img;
		}
}
//----------------------------------------------------------------------
/*   ---------------------------------------------------------------------------------------------------------
function afficheConcNn(obj,resul,comment,photo){
// ---------------- affichage de la photo du concours -------------------
// resul=nom de la table resultats, comment celle des commentaires, photo celle des photos
// Webexpert est vu comme navigateur Netscape et Mozilla comme Internet Explorer...
// on recupere l'index de la ligne qui déclenche la fonction avec obj:
  	//intCellIndex = obj.parentElement.cellIndex;		  ceci ne fonctionne pas sous Firefox, seulement sous IE...
   	//intRowIndex = obj.parentElement.parentElement.rowIndex;
debugger;
alert ('ici');
//alert (resul[1]);
	intCellIndex = obj.parentNode.cellIndex;
   	intRowIndex = obj.parentNode.parentNode.rowIndex;
	lib=obj.innerHTML;
	/* c'est l'indice du tableau  */
//	ind=intRowIndex+1;
	/* on garnit le texte de la photo selon le tableau (gice ou sif) */
//		var obj2 = document.getElementById("bloc");
//			obj2.innerHTML=lib + ' <br>-' +resul[ind] + ' -<br>' + comment[ind]+'<br>';
			/* on recherche le nom de la photo dans le tableau  */
//			var img=photo[ind];
 //alert(img);
	/*  on l'affiche à la bonne place   */
/*	if (img!=null){
//alert ("images/"+img+".jpg");
		document.getElementById('photogrand').src="images/"+img+".jpg";}
		lastimg=img;
		}
}
*/
//-------------------------------
function afficheConcN(obj,resul,comment,photo,affiche){
// ---------------- affichage de la photo du concours -------------------
//alert affiche;
	intCellIndex = obj.parentNode.cellIndex;
   	intRowIndex = obj.parentNode.parentNode.rowIndex;
	lib=obj.innerHTML;
	/* c'est l'indice du tableau  */
	ind=intRowIndex+1;
//alert ('ici '+ind+lib+resul[1]+photo[1]);
	/* on garnit le texte de la photo selon le tableau ( */
	var obj2 = document.getElementById("bloc");
	obj2.innerHTML=lib + ' <br>-' +resul[ind] + ' -<br>' + comment[ind]+'<br>';
	/* on recherche le nom de la photo dans le tableau  */
	var img=photo[ind];
	if (img!=null){
//alert ("images/"+img+".jpg");
		document.getElementById(affiche).src="images/"+img+".jpg";}
		lastimg=img;
}
//-------------------------------
function afficheConcNS(obj,resul,comment,photo,affiche,bloc){
// ---------------- affichage de la photo du concours -------------------
//alert affiche;
	intCellIndex = obj.parentNode.cellIndex;
   	intRowIndex = obj.parentNode.parentNode.rowIndex;
	lib=obj.innerHTML;
	/* c'est l'indice du tableau  */
	ind=intRowIndex+1;
//alert ('ici '+ind+lib+resul[1]+photo[1]);
	/* on garnit le texte de la photo selon le tableau ( */
	var obj2 = document.getElementById(bloc);
	obj2.innerHTML=lib + ' <br><font color=blue><b>-' +resul + '-</b></font><br>' + comment+'<br>';
	/* on recherche le nom de la photo dans le tableau  */
	var img=photo;
	if (img!=null){
//alert ("images/"+img+".jpg");
		document.getElementById(affiche).src="images/"+img+".jpg";}
		lastimg=img;
}
//---------------------------------------------------------------------------------------------------------
function remptablo(lib) {
// remplit le tableau d'affichage des concours d'après la liste en commençant par la fin
// pour afficher les plus récents en haut
var i=0;
var nolig=0;
var texte;
var centre, pair;

		var obj = document.getElementById("lconc");

		for (i=lib.length-1; i>=0; i--)  {
		/* on remplit la zone à afficher avec un carre de couleur   et le texte trouvé dans le tableau lib() */
			var zon= "<a href='images/rien.gif' onMouseOver='afficheNew(this)'";
			zon=zon +" onClick='afficheNew(this); return false;'>";
			zon=zon +  "&nbsp;<img src=";
		/* on teste si i est pair pour varier la couleur du carré  et le fond de la ligne*/
			if(i/2 == Math.round(i/2)) {
				zon=zon + "'images/carre_r.gif'";
				pair=true;}
			  else	{
				zon=zon + "'images/carre_bl.gif'";
				pair=false;
				}
			zon=zon + " border='0' width='9' height='9'> ";
			zon=zon+ lib[i] + "</a>";
			var zon2= resul[i]+"&nbsp;" ;
 		/*  on recupere l'index de la ligne à remplir*/
			if(obj.getElementsByTagName("tr")[nolig]) {
		/* la ligne existe on la remplit   */
				li=obj.getElementsByTagName("tr")[nolig];
		/* on ecrit la zone à l'écran dans le 1er et 2eme TD  */
				li.getElementsByTagName("td")[0].innerHTML=zon;
				li.getElementsByTagName("td")[1].innerHTML=zon2;
				if (pair)
					li.style.background="#FFFFCC";
				}
		  	else 		 {
		/* si la ligne n'existe pas on la cree   */
				var newRow = obj.insertRow(-1);
			    var newCell = newRow.insertCell(0);
			    newCell.innerHTML = zon;
			    newCell = newRow.insertCell(1);
			    newCell.innerHTML = zon2;
				newCell.style.textAlign="center";
				if (pair) {
					newRow.style.background="#FFFFCC";	}
				}
			nolig=nolig+1;
//alert('i='+i+'-ligne='+nolig);
			}
			/* on affiche la photo correspondant à la 1ere ligne affichée */
			document.getElementById('photogrand').src="images/"+photo[lib.length-1]+".jpg";
			var refe="images/"+photo[lib.length-1]+".jpg onclick='afficheseul(lastimg); return false;'";
			document.getElementById('voir').href=refe;
			lastimg=photo[lib.length-1];
			ind= lib.length-1;
			/* on garnit le texte de la photo  */
			var obj2 = document.getElementById("bloc");
			obj2.innerHTML=lib[ind] + ' <br>- ' + resul[ind] + ' - <br>' + comment[ind];
}
//-------------------------------------------------------------------------------------------
function lire_fic()
{
var fso=new ActiveXObject("Scripting.FileSystemObject");
var otf=fso.OpenTextFile("haras.txt",1 ,false);
/*exemple : if (!fso.FileExists("nom du fichier"))
    var ts=fso.CreateTextFile("nom du fichier");
	var ligne=ts.ReadLine();        // lit jusqu'à CrLf
	var car=ts.Read(NbrCaractères); // lit NbrCaractères
	var tout=ts.ReadAll();          // lit fichier complet

	var fso=new ActiveXObject("Scripting.FileSystemObject");
	var ts=fso.OpenTextFile("fichier",1,false);
	var lu;
	while (!ts.AtEndOfStream)	// tant que le fichier n'est
	      { lu=ts.ReadLine();	// pas entiérement lu
	        alert(lu);	}
	ts.close();		 */
alert(otf.Read(12)); //Lecture des 7 premiers caractères ("Bonjour.").
alert(otf.ReadAll());
otf.Close();
}
function oui(var1){
	image=var1
	effet=setInterval("effet2(image)",50)
}
	function non(var1){
	clearInterval(effet)
	var1.filters.alpha.opacity=20
}

function effet2(var2){
	if (var2.filters.alpha.opacity<100)
		var2.filters.alpha.opacity+=5
	else if (window.effet)
		clearInterval(effet)
}

