/*
//Specify the marquee's width (in pixels)
var marqueewidth=150;
//Specify the marquee's height
var marqueeheight=150;
//Specify the marquee's scroll speed (larger is faster)
var speed=2;
//Specify the marquee contents
var marqueecontents='<span class=Text6-white><img src="swiglog2.gif" width=43 height=27 border=0 alt=""><b>Swigweb has now Closed</b>..<img src="swiglog2.gif" width=43 height=27 border=0 alt=""><b>..Many thanks to everyone who visited our site. All the 2001-2002 season results and tables will be updated as soon as possible..Enjoy your football in 2002-2003<img src="nod2.jpg" width=115 height=130 border=1 alt=""></span>';

if (document.all);
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>');

function regenerate(){window.location.reload()}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate",450);
intializemarquee();
}
}

function intializemarquee(){
document.cmarquee01.document.cmarquee02.document.write(marqueecontents);
document.cmarquee01.document.cmarquee02.document.close();
thelength=document.cmarquee01.document.cmarquee02.document.height;
scrollit();
}
function scrollit(){
if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
document.cmarquee01.document.cmarquee02.top-=speed;
setTimeout("scrollit()",100);
} else {
document.cmarquee01.document.cmarquee02.top=marqueeheight;
scrollit();
}
}
window.onload=regenerate2

function setCook2(nom,valeur,jours) {
	var expDate = new Date()
	expDate.setTime(expDate.getTime() + (jours * 24 * 3600 * 1000))
	document.cookie = nom + "=" + escape(valeur) + ";expires=" + expDate.toGMTString()
}

function getCook(nom) {
deb = document.cookie.indexOf(nom + "=")
if (deb >= 0) {
	deb += nom.length + 1
	fin = document.cookie.indexOf(";",deb)
	if (fin < 0) fin = document.cookie.length
	return unescape(document.cookie.substring(deb,fin))
	}
return ""
}

function litCook(nom) {
	c=lit_cook(nom)
	if(c=="") alert("Le cookie est vide !")
	else alert("Le cookie vaut : "+c)
}
*/
NS6 = (document.getElementById&&!document.all);
IE = (document.all);
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4");
MAC = (navigator.userAgent.indexOf("Mac") != -1);
/*
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if 
	(document.layers||(document.getElementById&&!document.all)) {
		if (e.which==2||e.which==3) {(message);return false;}}
	}
if (document.layers) {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
*/
IE5=NN4=NN6=false;
if(document.all)IE5=true;
else if(document.getElementById)NN6=true;
else if(document.layers)NN4=true;

function autoSize() {
	if(IE5) self.resizeTo(document.images[0].width+10,document.images[0].height+50)
	else if(NN6) self.sizeToContent()
	else top.window.resizeTo(document.images[0].width,document.images[0].height+50)
	self.focus()
}

function ResizeToFit() {
	var imgWidth;
	var imgHeight;
	if (document.imgLarge && document.imgLarge.complete) {imgWidth = document.imgLarge.width + 90;imgHeight = document.imgLarge.height + 90;window.resizeTo(imgWidth, imgHeight);}
}

function HorlogeDynamique() {
	var DateActuel = new Date();
	var heure = DateActuel.getHours();
	var minutes = DateActuel.getMinutes();
	var secondes = DateActuel.getSeconds();

	if (heure == 0) {
		heure = "0" + heure;
		}
	if (minutes <= 9) {
		minutes = "0" + minutes;
		}
	if (secondes <= 9) {
		secondes = "0" + secondes;
		}
	
	Horloge = "<b>"+ heure + ":" + minutes + ":" + secondes + "</b>";
	if (document.getElementById) {
		document.getElementById("clock").innerHTML = Horloge;
		}
	if (document.layers) {
		document.clock.document.write("<br>&nbsp;&nbsp;"+Horloge); 
		document.clock.document.close(); 
		}
	if ((document.all)&&(!document.getElementById)) {
		document.all["clock"].innerHTML = Horloge;
		}
	setTimeout("HorlogeDynamique()", 1000)
}


/*
Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
Script featured on/available at http://www.dynamicdrive.com/
This notice must stay intact for use
*/

function JSFX_FloatTopDiv()
{
	var startX = 762,
	startY = 60;
	var ns = (navigator.appName.indexOf("Netscape") != -1);
	var d = document;
	function ml(id)
	{
		var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
		if(d.layers)el.style=el;
		el.sP=function(x,y){this.style.left=x;this.style.top=y;};
		el.x = startX;
		if (verticalpos=="fromtop")
		el.y = startY;
		else{
		el.y = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		el.y -= startY;
		}
		return el;
	}
	window.stayTopLeft=function()
	{
		if (verticalpos=="fromtop"){
		var pY = ns ? pageYOffset : document.body.scrollTop;
		ftlObj.y += (pY + startY - ftlObj.y)/8;
		}
		else{
		var pY = ns ? pageYOffset + innerHeight : document.body.scrollTop + document.body.clientHeight;
		ftlObj.y += (pY - startY - ftlObj.y)/8;
		}
		ftlObj.sP(ftlObj.x, ftlObj.y);
		setTimeout("stayTopLeft()", 10);
	}
	ftlObj = ml("divStayTopLeft");
	stayTopLeft();
}














/*
function resolution() {
	alert(
	"Vous etes en résolution : "+screen.width+"*"+screen.Height
	+"\nTaille d'écran disponible : "+screen.availWidth+"*"+screen.availHeight
	+"\nPalette de couleurs : "+screen.colorDepth+" bits"
	);
}
*/

function resolution() {
	document.location="<?php echo $_SERVER['PHP_SELF']; ?>?L="+screen.width+"&H="+screen.height;
}

function resolution_old() {
document.location="./index.php?r=1&width="+screen.width+"&height="+screen.height;
}

function favoris(){
browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
	if (browserName == "Microsoft Internet Explorer" & browserVer >= 4) {
		window.external.AddFavorite('http://andre.cikos.free.fr', '::. André CIKOS .::');
	}
}

var x = 0;
var y = 0;
var move = false;

if (document.getElementById)
{
	if(navigator.appName.substring(0,3) == "Net")
	document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = Pos_Souris;
}

function Pos_Souris(e)
{
	x = (navigator.appName.substring(0,3) == "Net") ? e.pageX : event.x+document.body.scrollLeft;
	y = (navigator.appName.substring(0,3) == "Net") ? e.pageY : event.y+document.body.scrollTop;
}

function display_img(name, width, height)
{
	if (move)
	{
		if(navigator.appName.substring(0,3) == "Net")
		document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = Pos_Souris;
		document.getElementById(name).style.left       =       x - width - 100;
		document.getElementById(name).style.top        =       y - ( height / 2 );
	}
}

function visible(name, img)
{
	move = true;
	var html = document.getElementById(name).innerHTML;
	if (html == "")
	{
		html = '<img src="'+img+'" alt=":: Loading ::">';
		document.getElementById(name).innerHTML = html;
	}
	document.getElementById(name).style.visibility  = 'visible';
}

function hide(name)
{
	move = false;
	document.getElementById(name).style.visibility = 'hidden';
}

function ap_getObj(name)
{
	if (document.getElementById)
		return document.getElementById(name).style;
	else
	{
		if (document.all)
			return document.all[name].style;
		else
		{
			if (document.layers) 
			return document.layers[name];
		}
	}
}

function showWaitMessage(flag)
{
	if (!DHTML)
		return false;

	var div = 'waitDiv';
	var x = ap_getObj(div); x.visibility = (flag) ? 'visible':'hidden'

	if (!document.getElementById)
	{
		if (document.layers)
		{
			x.left=280/2;
		}
	}
	return true;
}


/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object   the table row
 * @param   string   the action calling this script (over, out or click)
 * @param   string   the default background color
 * @param   string   the color to use for mouseover
 * @param   string   the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
function setPointer(theRow, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
	var theCells = null;

	// 1. Pointer and mark feature are disabled or the browser can't get the
	//	row -> exits
	if ((thePointerColor == '' && theMarkColor == '')
		|| typeof(theRow.style) == 'undefined') {
		return false;
	}

	// 2. Gets the current row and exits if the browser can't get it
	if (typeof(document.getElementsByTagName) != 'undefined') {
		theCells = theRow.getElementsByTagName('td');
	}
	else if (typeof(theRow.cells) != 'undefined') {
		theCells = theRow.cells;
	}
	else {
		return false;
	}

	// 3. Gets the current color...
	var rowCellsCnt  = theCells.length;
	var domDetect = null;
	var currentColor = null;
	var newColor	 = null;
	// 3.1 ... with DOM compatible browsers except Opera that does not return
	//		 valid values with "getAttribute"
	if (typeof(window.opera) == 'undefined'
		&& typeof(theCells[0].getAttribute) != 'undefined') {
		currentColor = theCells[0].getAttribute('bgcolor');
		domDetect = true;
	}
	// 3.2 ... with other browsers
	else {
		currentColor = theCells[0].style.backgroundColor;
		domDetect	= false;
	} // end 3

	// 4. Defines the new color
	// 4.1 Current color is the default one
	if (currentColor == ''
		|| currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
		if (theAction == 'over' && thePointerColor != '') {
			newColor = thePointerColor;
		}
		else if (theAction == 'click' && theMarkColor != '') {
			newColor = theMarkColor;
		}
	}
	// 4.1.2 Current color is the pointer one
	else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()) {
		if (theAction == 'out') {
			newColor = theDefaultColor;
		}
		else if (theAction == 'click' && theMarkColor != '') {
			newColor = theMarkColor;
		}
	}
	// 4.1.3 Current color is the marker one
	else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
		if (theAction == 'click') {
			newColor = (thePointerColor != '')
					 ? thePointerColor
					 : theDefaultColor;
		}
	} // end 4

	// 5. Sets the new color...
	if (newColor) {
		var c = null;
		// 5.1 ... with DOM compatible browsers except Opera
		if (domDetect) {
			for (c = 0; c < rowCellsCnt; c++) {
				theCells[c].setAttribute('bgcolor', newColor, 0);
			} // end for
		}
		// 5.2 ... with other browsers
		else {
			for (c = 0; c < rowCellsCnt; c++) {
				theCells[c].style.backgroundColor = newColor;
			}
		}
	} // end 5

	return true;
}

function hideLoadingPage() {
	if (document.getElementById) {  // DOM3 = IE5, NS6
		document.getElementById('hidepage').style.visibility = 'hidden';
	} else {
		if (document.layers) {
			document.hidepage.visibility = 'hidden';// Netscape 4
		} else {
				document.all.hidepage.style.visibility = 'hidden';// IE 4
		}
	}
}

function adjust_popup() {
	var w, h, fixedW, fixedH, diffW, diffH;
	if (document.all) {
		fixedW = document.body.clientWidth;
		fixedH = document.body.clientHeight;
		window.resizeTo(fixedW, fixedH);
		diffW = fixedW - document.body.clientWidth;
		diffH = fixedH - document.body.clientHeight;
	} else {
		fixedW = window.innerWidth;
		fixedH = window.innerHeight;
		window.resizeTo(fixedW, fixedH);
		diffW = fixedW - window.innerWidth;
		diffH = fixedH - window.innerHeight;
	}
	w = fixedW + diffW;
	h = fixedH + diffH;
	if (h >= screen.availHeight) w += 16;
	if (w >= screen.availWidth)  h += 16;
	w = Math.min(w,screen.availWidth);
	h = Math.min(h,screen.availHeight);
	window.resizeTo(w,h);
//	window.moveTo((screen.availWidth-w)/2, (screen.availHeight-h)/2);
//	window.moveTo((5, 5);
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location=\'"+selObj.options[selObj.selectedIndex].value+"\'");
	if (restore) selObj.selectedIndex=0;
}

function x() {
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
//window.focus();
}

function ouverturePage(m1, m2, m3) {
//	m3=m3.replace('’','\\’');
	document.forms.infosPage.menu_niv2.value = m2;
	document.forms.infosPage.menu_niv3.value = m3;
	document.forms.infosPage.action = "../" + m1 + "/corps_" + m1 +".php";
	document.forms.infosPage.submit();
}

function Vibre2() {
posi = 0;
	{
	if(posi<40)
		{
		if(posi/2 == Math.round(posi/2))
			{
			X = Math.round(Math.random()*40)-20;
			Y = Math.round(Math.random()*40)-20;
			window.moveBy(X,Y);
			}
		else
			window.moveBy(-X,-Y);
		posi++;
		tempo=setTimeout('Vibre2()', 10);
		}
	}
Vibre2()
}
function MoveMyPopup() {
	while(winpos < winleft)	{
		popup.moveBy(3,0);
		winpos += 3;
	}
}

function na_open_window(url, name, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable) {
	toolbar_str = toolbar ? 'no' : 'no';
	menubar_str = menubar ? 'yes' : 'no';
	statusbar_str = statusbar ? 'yes' : 'no';
	scrollbar_str = scrollbar ? 'yes' : 'no';
	resizable_str = resizable ? 'no' : 'no';
//	alert(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
	window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

//--- CSS Blend Menu ---
function lite(obj) {
if(document.all&&!window.opera) {
	obj.filters.blendTrans.apply();
	obj.filters.blendTrans.play();
	}
}

//--- verif message Book ---
function clearmessage(){
document.sms.message.value="";
document.sms.charsleft.value="500";
document.sms.message.focus();
}

function ShowCharsLeft(sms) {
if(navigator.appName!="Netscape") {
	maxLength = 500
	if (sms.message.value.length > maxLength) {
		sms.message.value = sms.message.value.substring(0,maxLength)
		charleft = 0
			} else {charleft = maxLength - sms.message.value.length}
sms.charsleft.value = charleft}
}
function avertislegal(){
	window.open("http:"+racine+"/Include/avert_legal.php","avertissement","resizable=no,scrollbars,width=650,height=350,top=50,left=50");
}
function AlphaVerif(objet,champ) {
	reg = /[^\n\r\sàâèéêôùüûïîç@a-zA-Z0-9_,:;€£%#\*\!\-\'\`\&\$\.\(\)\[\]\"<>\/\’\…\–]/g
	if (reg.test(objet.value) == true) {
		alert("Caractère non valide dans la donnée \"" + champ + "\".")
		objet.focus()
		return false
	}
	return true
}
//--- verifEmail ---
function verifEmail(objet,champ) {
	reg = /[a-zA-Z0-9\.\-_]+@[a-zA-Z0-9\.\-_]+\.[a-zA-Z0-9\.-_]/g
	if (reg.test(objet.value) == false ) {
		alert("Vous devez rentrer une adresse Email valide");
		objet.focus();
		return false;
	}
	return true;
}
function valid(leform) {
<!--- CHAMPS OBLIGATOIRES --->
<!--- si la valeur est nulle --->
if (leform.txtemail.value=="" || leform.txtemail.value=="Votre email") {
	alert("Champ 'E-mail' non renseigné");
	leform.txtemail.focus();
	return false;
	} else {

<!--- si la valeur ne contient pas @ --->
	if (leform.txtemail.value.indexOf("@")==-1) {
		alert("Veuillez saisir une adresse E-mail, SVP.");
		leform.txtemail.focus();
		return false;
		} else {
		longueur = leform.txtemail.value.length;
		position = leform.txtemail.value.indexOf("@");
		left_str = leform.txtemail.value.substring(0,position);
		right_str = leform.txtemail.value.substring(position+1,longueur);
		left_len = left_str.length;
		right_len = right_str.length;

<!--- si la valeur gauche ou droite du @ est vide --->
		if ((left_len==0) || (right_len==0)) {
			alert("Veuillez saisir une adresse E-mail correcte, SVP.");
			leform.txtemail.focus();
			return false;
			} else {

<!--- s'il n'y a pas de point --->
			if (right_str.indexOf(".")==-1) {
				alert("Veuillez saisir une adresse E-mail correcte, SVP.");
				leform.txtemail.focus();
				return false;
				} else {
				right_longueur = right_str.length;
				right_position = right_str.lastIndexOf(".");
				l_right_str = right_str.substring(0,right_position);
				r_right_str = right_str.substring(right_position+1,right_longueur);
				l_right_len = l_right_str.length;
				r_right_len = r_right_str.length;

<!--- s'il y a au moins 2 lettres après le point --->
				if ((r_right_len < 2)||(r_right_len > 4)) {
				alert("Veuillez saisir une adresse E-mail correcte, SVP.");
				leform.txtemail.focus();
				return false;
				} else {

<!--- s'il y a au moins 1 lettre après le point --->
					if (l_right_len==0)
					{
					alert("Veuillez saisir une adresse E-mail correcte, SVP.");
					leform.txtemail.focus();
					return false;
					}
				}
			}
	}
}
}
return true;
}

function windopen(url){
	window.open(url,"avertissement","resizable=no,scrollbars,width=700,height=450,top=20,left=20");
}

function ouvrefenetre (url,nom,largeur,hauteur,gauche,haut) {
	window.open(url,"avertissement","resizable=no,scrollbars",'width='+largeur+',height='+hauteur+',left='+gauche+',top='+haut)
}

function winrech(url){
//	document.write("<iframe src=http://www.lusis.fr/SITE/lusis/recherche_frame.php/ width=620 height=650 scrolling=no marginwidth=0 marginheight=0 frameborder=0 vspace=0 hspace=0></iframe>");
	window.open(url,"recherche","resizable=no,scrollbars,width=620,height=650,top=5,left=5");
}

function winnews(url){
	window.open(url,"avertissement","resizable=no,scrollbars,width=300,height=200,top=50,left=50");
}

function printmsg (valeur,vari,largeur,hauteur,haut,gauche,scroll) {
		wnd=window.open(valeur,vari,'location=0,menubar=0,toolbar=0,personalbar=0,status=0,resizable=0,scrollbars='+scroll+',width='+largeur+',height='+hauteur+',left='+gauche+',top='+haut)
}

/*
var repeat=1 //enter 0 to not repeat scrolling after 1 run, othersise, enter 1
var title=document.title
var leng=title.length
var start=1
function titlemove() {
  titl=title.substring(start, leng) + title.substring(0, start)
  document.title=titl
  start++
  if (start==leng+10) {
	start=0
	if (repeat==0)
	return
  }
  setTimeout("titlemove()",240)
}
if (document.title)
titlemove()
*/

function mask(end,middle,start,subject){
var one ='mai';
var two='lto:';
var three='?Subject=';
start,middle,end,subject;
var putogether= one+two+start+middle+end+three+subject;
document.location.href=eval('"'+putogether+'"');
}

function MM_displayStatusMsg(msgStr) {
	status = msgStr;
	document.MM_returnValue = true;
}
/*
function MM_reloadPage(init) { //reloads the window if Nav4 resized
	if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
	Else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
*/
function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_openBrWindow(theURL,winName,hauteur,largeur) {
	window.open(theURL,winName,'width=' + largeur + ',height=' + hauteur + ',top=' + (screen.height/2 - hauteur/2) + ',left=' + (screen.width/2 -largeur/2) + '');
}
/*
function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}
*/
function MM_findObj(n, d) { //v4.01
	var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function tmt_findObj(n){
	var x,t; if((n.indexOf("^/default.htm.htm"))>0&&parent.frames.length){t=n.split("^/default.htm.htm");
	x=eval("parent.frames['"+t[1]+"'].document.getElementById('"+t[0]+"')");
	}else{x=document.getElementById(n)}return x;
}
function center() {
	if(document.getElementById) {
		var p=document.getElementById("content");
		var w= (window.innerWidth) ? window.innerWidth : document.body.clientWidth;
		var h= (window.innerheight) ? window.innerHeight : document.body.clientHeight;
		var x=(w - 750) / 2;
		var y=(h - 520) / 2;
		if(x<0) x=0;
		if(y<0)y=0;
		p.style.left=x+'px';
		p.style.top=y+'px';
		window.onresize=center;
	}
}

function MM_showHideLayers() { //v3.0A Modified by Al Sparber and Massimo Foti for NN6 Compatibility
	if (navigator.appName=="Microsoft Internet Explorer") {
		var i,p,v,obj,args=MM_showHideLayers.arguments;if(document.getElementById){
			for (i=0; i<(args.length-2); i+=3){ obj=tmt_findObj(args[i]);v=args[i+2];
			v=(v=='show')?'visible':(v='hide')?'hidden':v;
			if(obj)obj.style.visibility=v;}} else{
			for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
				if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
		obj.visibility=v; }}
	}
}

// Fonctions qui affichent/cachent les layers
function show(objet) { // Fonction qui affiche le layer
	var objetid;
	if (document.getElementById) { // Pour Netscape 6
		objetid = eval(document.getElementById(objet));
		if (objetid) objetid.style.visibility = 'visible';
	}
	else if (document.layers != null) { // Pour Netscape 4
		objetid = eval(document.layers[objet]);
		if (objetid) objetid.visibility = 'show';
	}
	else if (document.all) { // Pour Internet Explorer
		objetid = eval(document.all[objet]);
		if (objetid) objetid.style.visibility = 'visible';
	}
}

function hide(objet) { // Fonction qui cache le layer
	var objetid;
	if (document.getElementById) { // Pour Netscape 6
		objetid = eval(document.getElementById(objet));
		if (objetid) objetid.style.visibility = 'hidden';
	}
	else if (document.layers != null) { // Pour Netscape
		objetid = document.layers[objet];
		if (objetid) objetid.visibility = 'hide';
	}
	else if (document.all) { // Pour Internet Explorer
		objetid = eval(document.all[objet]);
		if (objetid) objetid.style.visibility = 'hidden';
	}
}

var is_menu=false;
if (loaded) { document.location.reload() }

function checkBrowser(){
	this.ver=navigator.appVersion;
	this.dom=document.getElementById?1:0 ;
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ie4mac=this.ie4 && navigator.userAgent.indexOf("Mac")>-1;
	this.ie5mac=this.ie5 && navigator.userAgent.indexOf("Mac")>-1;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns6=(navigator.userAgent.indexOf("Gecko")	> 0) ? 1 : 0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) && !this.ie4mac;
	this.ie=(this.ie4 || this.ie5 || this.ns6 || this.ie6);
	return this
}

var is = new checkBrowser();
if (is.ns4) {doc="document";sty="";htm=".document";Visible="show"; Hidden="hide";xpos = "e.pageX"; ypos = "e.pageY"; this.captureEvents(Event.RESIZE); this.onresize = reloadlapage;}
if (is.ie) { doc="document.all";sty=".style";htm="";Visible="visible";Hidden="hidden";xpos = "event.x";ypos = "event.y"; }
var loaded=true

function reloadlapage() {
top.document.location.reload(true)
}

function getTop ( Layer ) {
if (is.ie) { return parseInt(Layer.style.top ); }
if (is.ns4) { return parseInt( Layer.top ); }
}

function getLeft ( Layer ) {
if (is.ie) { return parseInt( Layer.style.left ) ; }
if (is.ns4) { return parseInt( Layer.left ) ; }
}

function getHeight(layer) {
if (is.ns4) { if (layer.document.height) return layer.document.height; else return layer.clip.bottom - layer.clip.top;}
if (is.ie) { if (layer.style.pixelHeight) return layer.style.pixelHeight; else if (layer.clientHeight) return layer.clientHeight; else return layer.scrollHeight;}
return -1;
}

function getWidth(layer) {
if (is.ns4) { if (layer.document.width) return layer.document.width; else return layer.clip.right - layer.clip.left;}
if (is.ie) { if (layer.style.pixelWidth) return layer.style.pixelWidth; else return layer.clientWidth;}
return -1;
}

function ReSize( Layer , w,h) {
	if (is.ns4) {Layer.resizeTo( w  ,  h );}
	if (is.ie){Layer.style.width = w; Layer.style.height = h;}
}

function affiche() {
	for (tr=0; tr<arguments.length; tr++) {
	is.ns6 ? calque_local=document.getElementById("clq"+arguments[tr]) : calque_local=MM_findObj("clq"+arguments[tr], self.document);
	if (calque_local) { if (is.ie) calque_local.style.visibility="visible"; if (is.ns4) calque_local.visibility="show";}
	}
}

function masque() {
	for (tr=0; tr<arguments.length; tr++) {
	is.ns6 ? calque_local=document.getElementById("clq"+arguments[tr]) : calque_local=MM_findObj("clq"+arguments[tr], self.document);
	if (calque_local) {
		if (is.ie) calque_local.style.visibility="hidden"
		if (is.ns4) calque_local.visibility="hide"
		}
	}
}

function MoveTo(leLayer, x, y) { //positionne le coin haut-gauche du layer en x,y
	is.ns6 ? calque_local=document.getElementById("clq"+leLayer) : calque_local=MM_findObj("clq"+leLayer, document) ;
	if (is.ns4)
		calque_local.moveTo(x, y);
	if (is.ie)
	{
	calque_local.style.left = x+"px";
	calque_local.style.top = y+"px";
	//calque_local.style.visibility = "hidden"
	//calque_local.style.visibility = "visible"
	}
}

var animations=new Array()

function bougeDe(layerName,dx,dy,steps) {
	var cccalq
	is.ns6 ? cccalq=document.getElementById("clq"+layerName) : cccalq=MM_findObj("clq"+layerName, document) ;
	var noo=animations.length
	animations[animations.length]=cccalq
	if (is.ie) { cccalq.style.visibility="visible" ; cccalq.absX=parseInt(cccalq.offsetLeft) ; cccalq.absY=parseInt(cccalq.offsetTop) }
	if (is.ns4) {cccalq.visibility="show" ; cccalq.absX=parseInt(cccalq.left) ; cccalq.absY=parseInt(cccalq.top) }
	dx/=steps
	dy/=steps
	cccalq.dx=dx; cccalq.dy=dy;  cccalq.step=steps
	animLayers()
}

function bougeA(layerName,x,y,steps) {
	var cccalq
	is.ns6 ? cccalq=document.getElementById("clq"+layerName) : cccalq=MM_findObj("clq"+layerName, document) ;
	var noo=animations.length
	animations[animations.length]=cccalq
	if (is.ie) { cccalq.style.visibility="visible" ; cccalq.absX=parseInt(cccalq.offsetLeft) ; cccalq.absY=parseInt(cccalq.offsetTop) }
	if (is.ns4) {cccalq.visibility="show" ; cccalq.absX=parseInt(cccalq.left) ; cccalq.absY=parseInt(cccalq.top) }
	dx=(x-cccalq.absX)/steps
	dy=(y-cccalq.absY)/steps
	cccalq.dx=dx; cccalq.dy=dy;  cccalq.step=steps
	animLayers()
}

function animLayers() {
	var goon=false
	for (var klm=0;klm<animations.length;klm++) {
		var oLayer=animations[klm]
		if (oLayer.step>0) {
			oLayer.absX+=oLayer.dx
			oLayer.absY+=oLayer.dy
			if (is.ie) {
				oLayer.style.left=Math.round(oLayer.absX)
				oLayer.style.top=Math.round(oLayer.absY) }
			if (is.ns4)
				{
				oLayer.left=Math.round(oLayer.absX)
				oLayer.top=Math.round(oLayer.absY) }
			--oLayer.step; goon=true
			}
		}
	if (goon) { setTimeout("animLayers()",20) }
}

function changeImage(layerName,imgName) {
	var imga;
	is.ns6 ? imga=document.getElementById("img_"+layerName) : imga=MM_findObj("img_"+layerName, document) ;
	imga.src=imgName;
}


var scrollLayers = new Array();
var currentScrollLayer;
	
function choppeScrollCalque(layerName) {
	var zeCalque
	if (scrollLayers[layerName]) zeCalque = scrollLayers[layerName]
	else {
		zeCalque = MM_findObj("clq"+layerName)
		if (zeCalque) {
			zeCalque.scrollLayer = MM_findObj("sub"+layerName)
			zeCalque.scroll = false
			zeCalque.scrollSpeed = 5
			zeCalque.scrollSens = 0
			zeCalque.scrollInterval = 10
			if (is.ie) {
				zeCalque.getH = function() {return getHeight ( zeCalque )}
				zeCalque.getY = function() {return this.scrollLayer.style.pixelTop}
				zeCalque.getX = function() {return this.scrollLayer.style.pixelLeft}
				zeCalque.realHeight = ( zeCalque.scrollLayer.scrollHeight ) ? zeCalque.scrollLayer.scrollHeight : getHeight ( zeCalque.scrollLayer ) ;
				zeCalque.scrollBy = function(dx,dy) {
					this.scrollLayer.style.pixelLeft = this.getX() + dx
					this.scrollLayer.style.pixelTop = this.getY() + dy
					this.scrollLayer.style.visibility = "hidden"
					this.scrollLayer.style.visibility = "visible"
					}
				} if (is.ns4) {
				zeCalque.getY = function() { return parseInt ( this.scrollLayer.top ) }
				zeCalque.realHeight = getHeight ( zeCalque.scrollLayer )
				zeCalque.scrollBy = function(dx,dy) {	this.scrollLayer.moveBy(parseInt(dx),parseInt(dy)) }
				zeCalque.getH = function() { return parseInt ( getHeight ( this ) ) }
				}
			}
		scrollLayers[layerName] = zeCalque
		}
	return zeCalque
}

function scrollUp(layerName) {
	var zeCalque = choppeScrollCalque(layerName)
	if (zeCalque) {zeCalque.scroll = true; zeCalque.scrollSens = 1; currentScrollLayer = zeCalque; doZeScroll(currentScrollLayer);}
}

function scrollDown(layerName) {
	var zeCalque = choppeScrollCalque(layerName)
	if (zeCalque){
		zeCalque.scroll = true
		zeCalque.scrollSens = -1
		currentScrollLayer = zeCalque
		doZeScroll(currentScrollLayer)
	}
}

function doZeScroll(zeCalque) {
	if (zeCalque.scroll && ( (zeCalque.scrollSens>0 && zeCalque.getY()<0 ) || ( zeCalque.scrollSens<0 && ( ( zeCalque.realHeight+zeCalque.getY() )>zeCalque.getH() ) ) ) ) {
		zeCalque.scrollBy(0,zeCalque.scrollSpeed*zeCalque.scrollSens)
		setTimeout("doZeScroll(currentScrollLayer)",zeCalque.scrollInterval)
	}
}

function scrollStop(layerName) {
	var zeCalque = choppeScrollCalque(layerName)
	if (zeCalque) {zeCalque.scroll = false}
}

// -----------------  fonctions pour le deplacement du footer ------------------

var maxH=0

function getPageHeight() {
	if (is.ie) {
		var divs = document.all.tags("DIV")
		for (var i=0; i<divs.length; i++) {
			var localTop = getIEtop(divs[i])
			var localHeight = getIEheight(divs[i])
			if (localTop+localHeight>maxH) maxH = localTop+localHeight
			}
		} if (is.ns4) {getNScontentHeight(document)}
	//return maxH
}

function getIEtop(calque) {
	y = 0;
	obj = calque;
	while (obj.offsetParent != null && obj.offsetParent !=document.body) {
		y += obj.offsetTop;
		obj = obj.offsetParent;
	}
	y += obj.offsetTop;
	return y;
}

function getIEheight(calque) {
var zeHeight = 0
if (parseInt( calque.scrollHeight )>zeHeight ) zeHeight = parseInt( calque.scrollHeight )
if (parseInt( calque.clientHeight )>zeHeight ) zeHeight = parseInt( calque.clientHeight )
if (parseInt( calque.offsetHeight)>zeHeight ) zeHeight = parseInt( calque.offsetHeight)
return zeHeight 
}

function getNStop(calque) {
	y = 0;
	return calque.top
}

function getNScontentHeight(calque, previousTop) {
	if (!previousTop) previousTop = 0
	for (var i=0;i<calque.layers.length;i++) {
	localTop = previousTop + calque.layers[i].top
	var zeHeight = getHeight(calque.layers[i] )
	if (zeHeight+localTop>maxH) maxH = zeHeight+localTop
	getNScontentHeight(calque.layers[i].document , localTop)
	}
}

var tblcount=0

/*
Gradual-Highlight Image Script II- 
By J. Mark Birenbaum (birenbau@ugrad.cs.ualberta.ca)
Permission granted to Dynamicdrive.com to feature script in archive
For full source to script, visit http://dynamicdrive.com
*/

nereidFadeObjects = new Object();
nereidFadeTimers = new Object();

function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
	if (object != "[object]"){
	setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
	return;
	}

	clearTimeout(nereidFadeTimers[object.sourceIndex]);

	diff = destOp-object.filters.alpha.opacity;
	direction = 1;
	if (object.filters.alpha.opacity > destOp){direction = -1;}
	delta=Math.min(direction*diff,delta);
	object.filters.alpha.opacity+=direction*delta;

	if (object.filters.alpha.opacity != destOp){
		nereidFadeObjects[object.sourceIndex]=object;
		nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
	}
}


function chBgColor(o, s) { o.style.backgroundColor = s; }
function ejs_img_fx(img){if(img && img.filters && img.filters[0]){img.filters[0].apply();img.filters[0].play();}}

function newImage(arg) {if (document.images) {rslt = new Image();rslt.src = arg;return rslt;}}

function changeImages() {
	if (document.images && (preloadFlag == true)) {for (var i=0; i<changeImages.arguments.length; i+=2) {document[changeImages.arguments[i]].src = changeImages.arguments[i+1];}}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		nrg_nav_02_nrg_nav_03_over = newImage("/img/nrg_nav_02-nrg_nav_03_over.gif");
		nav_01_over = newImage("/img/topnav/nav_01.jpg");
		preloadFlag = true;
	}
}
function verifPresSel(objet,champ) {
	if (objet.options[objet.selectedIndex].value.length == 0) {
		alert("Vous devez saisir la donnée \"" + champ + "\".");
		objet.focus();
		return false;
	}
	return true;
}
