/***************************************
* Détection de navigateur
***************************************/

function isIE()
{
	if ((navigator.appName == "Microsoft Internet Explorer") && (navigator.appVersion.substring(0,1)>=4)) return true;
}

function isNS()
{
	if ((navigator.appName == "Netscape") && (navigator.appVersion.substring(0,1)>=4)) return true;
}

/***************************************
* fonctions navigation
***************************************/

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_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 MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

/***************************************
* PopUps divers
***************************************/

function PopUp(page, largeur, hauteur, scroll)
{
	open(page,'popup','toolbars=0,directories=0,status=0,resizable=' + scroll + ',scrollbars=' + scroll + ',width=' + largeur + ',height=' + hauteur + '');
}
/***************************************
* Chargement d'images
***************************************/

function MM_preloadImages() {
	if (document.images)
	{
		var imgFiles = MM_preloadImages.arguments;
		if (document.preloadArray==null) document.preloadArray = new Array();
		var i = document.preloadArray.length;
		with (document) for (var j=0; j<imgFiles.length; j++) if (imgFiles[j].charAt(0)!="#")
		{
			preloadArray[i] = new Image;
			preloadArray[i++].src = imgFiles[j];
		}
	}
	return true;
}

/***************************************
* rollover d'images
***************************************/
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_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;
}

/***************************************
* Actions sur cellules
***************************************/

function txtoff(cell)
{
	cell.className = 'txt1noir';
	return true;
}


function txton(cell)
{
	cell.className = 'txt1rouge';
	return true;
}

function menuoff(cell)
{
	cell.className = 'menuoff';
	return true;
}


function menuon(cell)
{
	cell.className = 'menuon';
	return true;
}

/***************************************
* fonction antiretour de l'ascenseur en cliquant sur un lien
***************************************/

function ClickReturn () {

	var bAgent = window.navigator.userAgent; 

	var bAppName = window.navigator.appName;

	if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))

		return true; // dont follow link

	else return false; // dont follow link

}



CSStopExecution = false;


/***************************************
* Vérifications de formulaires


function checkLogin(form, login, pass)
{
    chlogin = document.forms['' + form + ''].elements['' + login + ''].value;
    chpass = document.forms['' + form + ''].elements['' + pass + ''].value;

	if (chlogin == '')
	{
		alert('Vous devez indiquer votre login !')
		return false;
	}
	else if (chpass == '')
	{
		alert('Vous devez indiquer votre mot de passe !')
		return false;
	}
	else
	{
		return true;
	}
}

***************************************/



/***************************************
* fonctions alpha sur images > ! uniquement IE



function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",20)
}
function low(which2){
clearInterval(highlighting)
if (which2.style.MozOpacity)
which2.style.MozOpacity=0.3
else if (which2.filters)
which2.filters.alpha.opacity=99
}

function highlightit(cur2){
if (cur2.style.MozOpacity<1)
cur2.style.MozOpacity=parseFloat(cur2.style.MozOpacity)-0.1
else if (cur2.filters&&cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity-=10
else if (window.highlighting)
clearInterval(highlighting)
}

***************************************
FONCTION INFOBULLE
***************************************

*/
var IB=new Object;
var posX=0;posY=0;
function AffBulle(xOffset,yOffset,texte) {
  contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=3 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT class='txtbulle' color="+IB.ColTexte+">"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;";
  var finalPosX=posX-xOffset;
  if (finalPosX<0) finalPosX=0;
  if (document.layers) {
    document.layers["bulle"].document.write(contenu);
    document.layers["bulle"].document.close();
    document.layers["bulle"].top=posY+yOffset;
    document.layers["bulle"].left=finalPosX;
    document.layers["bulle"].visibility="show";}
  if (document.all) {
    //var f=window.event;
    //doc=document.body.scrollTop;
    bulle.innerHTML=contenu;
    document.all["bulle"].style.top=posY+yOffset;
    document.all["bulle"].style.left=finalPosX;//f.x-xOffset;
    document.all["bulle"].style.visibility="visible";
  }
  //modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById
  else if (document.getElementById) {
    document.getElementById("bulle").innerHTML=contenu;
    document.getElementById("bulle").style.top=posY+yOffset;
    document.getElementById("bulle").style.left=finalPosX;
    document.getElementById("bulle").style.visibility="visible";
  }
}
function getMousePos(e) {
  if (document.all) {
  posX=event.x+document.body.scrollLeft; //modifs CL 09/2001 - IE : regrouper l évènement
  posY=event.y+document.body.scrollTop;
  }
  else {
  posX=e.pageX; //modifs CL 09/2001 - NS6 : celui-ci ne supporte pas e.x et e.y
  posY=e.pageY; 
  }
}
function HideBulle() {
	if (document.layers) {document.layers["bulle"].visibility="hide";}
	if (document.all) {document.all["bulle"].style.visibility="hidden";}
	else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}
}

function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {
	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;

	if (document.all) {
		document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden;overflow:hidden;z-index:3'></DIV>");
		document.onmousemove=getMousePos;
	}
	//modif CL 09/2001 - NS6 : celui-ci ne supporte plus document.layers mais document.getElementById
	else if (document.getElementById) {
	        document.onmousemove=getMousePos;
	        document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden;overflow:hidden;z-index:3'></DIV>");
	}

}

function InitBulle2(ColTexte,ColFond,ColContour,NbPixel) {
	IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;


}