// Détection du modéle objet du navigateur
function navModele(){ 
	this.tom = (document.layers)? true:false;					//Ns4
	this.dom = (document.getElementById)? true:false;			//Ie6, ns6, opera
	this.xom = (document.all)? true:false;						//Ie4, Ie5
	this.yom=false;
	if (this.xom) {												//Ie5
		if ((navigator.userAgent.indexOf('MSIE 5') > 0) || (navigator.userAgent.indexOf('MSIE 6') > 0)) this.yom = true;
		if (this.dom) this.dom = false;
	}
	this.nav=(this.tom || this.dom || this.xom || this.yom);
    return this 
} 
nav=new navModele()
// Dimensions de la fenetre du navigateur
var winWidth;
var winHeight;
var loop, timer;
var table1='<table width="600" height="';
var table2='" border="0" cellpadding="1" cellspacing="0" bgcolor="#666666"><tr><td><table width="100%" height="';
var table3='" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF"><tr><td>&nbsp;</td></tr></table></td></tr></table>';
// Creation d'un calque
function createLayer(child){ 
    this.elt=nav.dom?document.getElementById(child):nav.xom?document.all[child]:nav.tom?eval('document.'+child):0; 
    this.cadre=nav.dom?document.getElementById(child).style:nav.xom?document.all[child].style:nav.tom?eval('document.'+child):0; 
	this.layerMove=layerMove;
	this.obj = child + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
// Ecrire dans un calque
function writeLayer(txt,lyr) {
	txt += "\n";
	
        if (nav.tom) {
                lyr.document.write("<span class='tip'>")
                lyr.document.write(txt)
                lyr.document.write("</span>")
                lyr.document.close()
        } else if (nav.xom) {
		lyr.innerHTML = txt
	} else if (nav.dom) {
		range = document.createRange();
		range.setStartBefore(lyr);
		domfrag = range.createContextualFragment(txt);
		while (lyr.hasChildNodes()) {
			lyr.removeChild(lyr.lastChild);
		}
		lyr.appendChild(domfrag);
	}
}
// Creation d'une fenetre de scroll
function createScroller(child,parent){ 
    this.elt=nav.dom?document.getElementById(child):nav.xom?document.all[child]:nav.tom?eval('document.'+parent+'.document.'+child):0; 
    this.css=nav.dom?document.getElementById(child).style:nav.xom?document.all[child].style:nav.tom?eval('document.'+parent+'.document.'+child):0; 
    this.cadre=nav.dom?document.getElementById(parent).style:nav.xom?document.all[parent].style:nav.tom?eval('document.'+parent):0; 
    this.scrollLength=nav.tom?this.css.document.height:this.elt.offsetHeight 
    this.scroll=scroll;
    this.pageUp=pageUp;
    this.pageDn=pageDn;
    this.scrollMove=layerMove;
	this.down=scrollDn; 
    this.up=scrollUp;
    this.scrolling=scrolling;
    this.scrollingStop=scrollingStop;
    this.scrollTest=scrollTest;
	this.obj = child + "Object" 
    eval(this.obj + "=this") 
    return this 
	this.initialised=false;
} 
// Deplacement du contenu de la fenetre de scroll
function scroll(x,y){ 
	this.x=x;	this.y=y; 
	if (this.y>0) this.y=0;
	this.css.left=this.x; this.css.top=this.y;
	if (winHeight>360) Mark.cadre.top=((winHeight-360)/2)+93-(y*(204/parseInt(this.scrollLength))); else Mark.cadre.top=93-(y*(204/parseInt(this.scrollLength)));
}
// Deplacement du contenu de la fenetre de scroll en haut de page
function pageUp(){ 
	this.scroll(5,0)
}
// Deplacement du contenu de la fenetre de scroll en bas de page
function pageDn(){ 
	this.scroll(5,-parseInt(this.scrollLength)+parseInt(this.cadre.height))
}
// Deplacement de la fenetre de scroll
function layerMove(x,y){ 
	this.cadre.left=this.x; this.cadre.top=this.y;
}
// Defilement du contenu de la fenetre de scroll vers le bas
function scrollDn(step){ 
	if(this.y>-parseInt(this.scrollLength)+parseInt(this.cadre.height)){ 
    	this.scroll(5,this.y-step) 
    	if(this.loop) setTimeout(this.obj+".down("+step+")",50) 
	}
	this.scrollTest();
} 
// Defilement du contenu de la fenetre de scroll vers le haut
function scrollUp(step){ 
	if(this.y<0){ 
	    this.scroll(5,this.y-step) 
	    if(this.loop) setTimeout(this.obj+".up("+step+")",50) 
	}
	this.scrollTest();
} 
// Faire defiler le contenu de la fenetre de scroll
function scrolling(dir){ 
	if(this.initialised){ 
		this.loop=true; 
		if(dir>0) this.down(dir) 
		else this.up(dir) 
	} 
} 
// Stopper le defilement du contenu de la fenetre de scroll
function scrollingStop(){ 
    this.loop=false 
    if(this.timer) clearTimeout(this.timer) 
} 
// Tester le defilement du contenu de la fenetre de scroll
function scrollTest() {
	if(this.y<0) this.stopup=true; else this.stopup=false;
	if(this.y>-parseInt(this.scrollLength)+parseInt(this.cadre.height)) this.stopdn=true; else this.stopdn=false;
} 

// Afficher le Tip
function tipOn(texte) {
	writeLayer(texte,Tip.elt);
	Tip.cadre.visibility='visible';
}
// Masquer le Tip
function tipOff() {
	Tip.cadre.visibility='hidden';
}

