
//document.write('<div id="Layer1" style="position:absolute; width:82px; height:77px; z-index:1; left: 360px; top: 30px"><img src="../../Noel/Houx.gif" width="90" height="75"></div>');
//document.write('<div id="Layer1" style="position:absolute; width:59px; height:42px; z-index:1; top: 0px; left: 0px"><img src="../../Noel/Houx2.gif"></div>');

function LoadPage()
{
// Suppression du bandeau Lycos
//SupprLycos();

// Suppression des annonces obsolètes
EffaceObjPassee("Annonce1");
EffaceObjPassee("Annonce2");
EffaceObjPassee("Annonce3");
EffaceObjPassee("Annonce4");
EffaceObjPassee("Annonce5");
EffaceObjPassee("Annonce6");
}

// Fonction supprimant le bandeau Lycos 
function SupprLycos(){if(top.LycosAdFrame) {top.document.body.cols = "*,0";}}

// Retourne la valeur sous forme de chaine de "Lg" caractères avec des zéro devant
function Str0(Valeur,Lg)
{
var str = '0000000000'+Valeur;
return (str.substring(str.length-Lg,str.length));
}

// Retourne le signe de Valeur
// -1 = Négatif
//  1 = Positif
//  0 = Zéro
function Signe(Valeur)
{
//alert(Valeur);
if (Valeur>0) {return 1};
if (Valeur<0) {return -1};
return 0;
}

// Transforme une chaine de date au format "JJ/MM/AAAA" en date
function String2Date(StrDate)
{
var j = StrDate.substring(0,2);
var m = StrDate.substring(3,5);
var y = StrDate.substring(6,10);
var d = new Date(y,m-1,j);
//alert("date="+j+"/"+m+"/"+y);
return d;
}

// Indique si Date1 est avant Date2 (ne compare pas les heures)
//  1 = Date1 < Date2
//  0 = Date1 = Date2
// -1 = Date1 > Date2
function CompDate(Date1, Date2)
{
var D1 = new Date() ;
var D2 = new Date() ;

D1 = Date1;
D2 = Date2;

//alert(D1);
//alert(D2);

if (D1.getYear() != D2.getYear()) 
	{
	return Signe(D1.getYear() - D2.getYear());
	}
if (D1.getMonth() != D2.getMonth()) 
	{
	return Signe(D1.getMonth() - D2.getMonth());
	}
return Signe(D1.getDate() - D2.getDate());

}

// Recherche la propriete "date" de l'objet dont le nom est passé
// si cette date est passée, rend l'objet invisible
// si l'objet n'existe pas, ne fais rien
function EffaceObjPassee(IdObj)
{
var obj = document.getElementById(IdObj);
var today = new Date();

if (obj) 
	{
	if (!obj.date) 
		{
		alert(IdObj+" n'a pas de propriété \"date\" de défini !");
		return;
		}
	if (CompDate(String2Date(obj.date),today )<0)
		{
		obj.innerHTML="";
		}
	else
		{obj.style.visibility="visible";}
		
	}
}


//---------------------------------------------------------------------
// Ouvre une fenetre pour affiche l'image indiquée avec son commentaire
//---------------------------------------------------------------------
function fct_AfficheImage(Img, Fmt, Texte)
{
var wPopup;

	// Si la fenêtre de visu n'existe pas ou est fermée, on la réouvre
	if(!wPopup || wPopup.closed) {
		wPopup = window.open('', 'img_popup', 'width=50, height=50, top=(screen.height-50)/2, left=(screen.width-50)/2, status=no, directories=no, toolbar=no, location=no, menubar=no, scrollbars=no, resizable=yes');
	}

	// On écrit le contenu de la fenêtre popup
	wPopup.document.clear();
	wPopup.document.write('<HTML><HEAD><TITLE>Image : '+Img+'</TITLE><link rel="stylesheet" href="../StylesGlobaux.css" type="text/css"></HEAD>');
	// La fonction qui attend que l'image soit chargée et affichée pour redimensionner la fenêtre à la bonne taille
	wPopup.document.write('<SCRIPT language="JavaScript">\n');
	wPopup.document.write('function checkSize() { if(document.images[0].complete) { w = document.images[0].width+50; h = document.images[0].height+100; window.resizeTo(w, h); window.moveTo((screen.width-w)/2, (screen.height-h)/2); document.images[0].style.visibility = "visible"; window.focus(); } else { setTimeout("checkSize()", 250); } }\n');
	wPopup.document.write('function f_FermeVisu() {	close(); }\n');
	wPopup.document.write('</'+'SCRIPT>');

	wPopup.document.write('<BODY bgcolor="#FFFF99"  background="../Fonds/Courbes_2.jpg" leftMargin="0" topMargin="0" marginWidth="0" marginHeight="0" alink="#66FF66">');
	wPopup.document.write('<table width="100%" height="100%" border=0 align="center" cellpadding="0" cellspacing="0">');
//	wPopup.document.write('<tr valign="middle"><td align="center"><a href="#" onClick="window.opener.fct_Prec()" >Précédente</a> / ');
//	wPopup.document.write('<a href="#" onClick="window.opener.fct_Suiv()" >Suivante</a></td></tr> ');
//	wPopup.document.write('<tr > <td align="center"><img src="'+Img+'" border="0" onLoad="checkSize()" onClick="f_FermeVisu()" style="visibility:hidden"></td></tr>');
	wPopup.document.write('<tr > <td align="center"><img src="'+Img+'" border="0" onLoad="checkSize()" onClick="f_FermeVisu()" style="visibility:visible"></td></tr>');
	wPopup.document.write('<tr ><td align="center" class="'+Fmt+'">'+Texte+' </td></tr>');
	wPopup.document.write('</table>');
	wPopup.document.write('</BODY></HTML>');
	wPopup.document.close();
}
