function affErreur(message, URL, ligne)
{
	alert(message + "\nligne: "+ ligne + "\ndocument: "+ URL);
	return true;
}
window.onerror = affErreur;

function affNote(posit, couleur, msg, wSize, hSize)
{
document.write('<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=4 WIDTH='+wSize+' ALIGN="'+posit+'" HSPACE=30>');
document.write('<TR><TD VALIGN="TOP" HEIGHT='+hSize+'110><P ALIGN="CENTER">');
document.write('<FONT COLOR='+couleur+'>');
document.write(msg);
document.write('</FONT></P></TD></TR></TABLE>');
}

function affImage(posit,chemin,nom,legende,popmsg, wSize, hSize)
{
//alert("affImage("+posit+","+chemin+","+nom+","+legende+","+popmsg+","+wSize+","+hSize+")";
document.write('<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=4 WIDTH=150 ALIGN="'+posit+'" HSPACE=30>');
document.write('<TR><TD VALIGN="TOP" HEIGHT=110><P ALIGN="CENTER">');
afficheJpg(chemin,nom,legende,popmsg, wSize, hSize+6);
document.write('</P></TD></TR></TABLE>');
}

function affImageGif(posit,chemin,nom,legende,popmsg, wSize, hSize)
{
//alert("affImageGif("+posit+","+chemin+","+nom+","+legende+","+popmsg+","+wSize+","+hSize+")";
document.write('<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=4 WIDTH=150 ALIGN="'+posit+'" HSPACE=30>');
document.write('<TR><TD VALIGN="TOP" HEIGHT=110><P ALIGN="CENTER">');
afficheGif(chemin,nom,legende,popmsg, wSize, hSize+6);
document.write('</P></TD></TR></TABLE>');
}

function pasclic()
{
alert("copie interdite !");
return false;
}
function imgprotect()
{
if(document.images)
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown = pasclic;
}

function afficheJpg(chemin,nom,legende,popmsg, wSize, hSize)
{
//var msg = "afficheJpg("+chemin+","+nom+","+legende+","+popmsg+","+wSize+","+hSize+")";
//alert(msg);
	var nom1=chemin+"/"+nom+".jpg";
	var nom2=chemin+"/imx/"+nom+".jpg";
	afficheVignette(nom1,nom2,legende,popmsg, wSize, hSize);
}

function afficheGif(chemin,nom,legende,popmsg, wSize, hSize)
{
	var nom1=chemin+"/"+nom+".gif";
	var nom2=chemin+"/imx/"+nom+".jpg";
	afficheVignette(nom1,nom2,legende,popmsg, wSize, hSize);
}

function affPopup(img,legende,wSize, hSize)
{
	var Maxi = "\'"+img+"\',\'"+legende+"\',"+wSize+","+hSize;
	document.write('<A HREF="javascript:afficheMaxi('+Maxi+')">'+legende+'</A>');
}

function affRef(aaa)
{
	document.write('<HTML><FONT SIZE=1>'+aaa+'&nbsp;</FONT></HTML>')
}

function afficheVignette(nom1,nom2,legende,popmsg, wSize, hSize)
{
//alert("afficheVignette("+nom1+","+nom2+","+legende+","+popmsg+","+wSize+","+hSize+")");
nom1 = nom1.toLowerCase();
nom2 = nom2.toLowerCase();
	if(legende=="")	
		{ soustitre="";
		  if(popmsg=="") { legende="" }
		    else { legende= popmsg } 
		}
	  else { soustitre="<FONT SIZE=1><BR>"+legende+"</FONT>" }
if(popmsg=="") { popmsg="cliquez pour agrandir" };
if(legende=="")	{  legende=nom1 }
	var Maxi = "'"+nom2+"','"+legende+"',"+wSize+","+hSize;
document.write('<A HREF="javascript:afficheMaxi('+Maxi+')"><IMG SRC="'+nom1+'" HSPACE=0 VSPACE=0 BORDER=0 ALT="'+popmsg+'""></A>'+soustitre);
}

function afficheMaxi(nomcomplet,letitre, wSize, hSize)
{
//alert("afficheMaxi("+nomcomplet+","+letitre+","+wSize+","+hSize+")");
if(wSize == 0)
	{	i1 = new Image;
		hSize = i1.height;
		wSize = i1.width;
	}
var scro = 0;
var top;
var left;
if(hSize > (screen.height-60) || hSize == 0) { hSize = 500; scro = 1; top = 0;}
	else if(hSize==0) { top = 0; }
	else	{ top=(screen.height-hSize)/2; } 
if(wSize > (screen.width-50) || wSize == 0) { wSize = 750; scro = 1; left = 0;}
	else if(wSize==0) { left = 0; }
	else	{ left=(screen.width-wSize)/2; } 
var popSize=',height='+hSize+',width='+wSize;
var popPos="top="+top+",left="+left;

popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars='+scro+',resizable=1'+ popSize+','+popPos );
popupImage.document.open();

if(scro) { lscroW = 64; lscroH = 48; }
  else	 { lscroW = 12; lscroH = 30; }

navigateur = navigator.appName;
if (navigateur == "Netscape")
	{  lscroH += 32;  }

wSize += lscroW;
hSize += lscroH;
var newSize= wSize+","+hSize;
var newPos = 'top=(screen.height-document.newimage.height)/2,left=screen.width-document.newimage.width)/2';
var popmsg = 'onmousedown=alert("'+letitre+'")';
html = '<HTML><HEAD><TITLE>'+letitre+'</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 ONBLUR=close()><CENTER><IMG SRC="'+nomcomplet+'" BORDER=0" NAME=newimage onLoad="window.resizeTo('+ newSize +')";"window.moveTo('+newPos+');" '+popmsg+'></CENTER></BODY></HTML>';
//alert(html);
popupImage.document.write(html);
popupImage.document.close();
};

function aff3d(posit,nom)
{
//alert("function aff3d("+posit+","+nom+")");
document.write('<TABLE CELLSPACING=0 BORDER=0 CELLPADDING=4 WIDTH=190 ALIGN="'+posit+'" HSPACE=12>');
document.write('<TR>');
document.write('<TD VALIGN="TOP" HEIGHT=110>');
document.write('<P ALIGN="CENTER">');
document.write('<A HREF="3d/'+nom+'.avi"><IMG SRC="3d/'+nom+'.jpg" BORDER=0 ALT="cliquez pour animer"</A>');
document.write('<BR><FONT SIZE=1>vue 3D [Francis Mathieu]</FONT></A>');
document.write('</P>');
document.write('</TD>');
document.write('</TR>');
document.write('</TABLE>');
};