
function detection() {
	var nav = navigator.appName;
	var vers = navigator.appVersion;
	if (nav=="Microsoft Internet Explorer") this.nav = "ie";
	else if (nav=="Netscape") this.nav = "ns";
	else this.nav = nav;
	this.version = parseInt(vers);
	this.mac = (navigator.userAgent.indexOf("Mac")!=-1) ||(navigator.userAgent.indexOf("Macintosh")!=-1);
	this.win = (navigator.userAgent.indexOf("Windows")!=-1) ||(navigator.userAgent.indexOf("Win")!=-1);
	this.ie = (this.nav == "ie" && this.version >= 4);
	this.ie4 = (vers.indexOf("MSIE 4")>0);
	this.ie5 = (vers.indexOf("MSIE 5")>0);
	this.ie6 = (vers.indexOf("MSIE 6")>0);
	this.ns = (this.nav == "ns" && this.version >= 4);
	this.ns4 = (this.nav == "ns" && this.version == 4);
	this.ns6 = (this.nav == "ns" && this.version == 5);
	this.gen4 = (this.ie || this.ns);
	if(!this.ie && document.all) this.ie = true;
}
estce = new detection();

function Calque(nom,cparent) {																			   
	_ID_CALQUE++;
	if(estce.ie)
	{
		 this.doc = document;
		 this.cal = document.all[nom];
		 this.strCal = "document.all[\""+nom+"\"]";
		 this.strCss = this.strCal+".style";		 
		 this.css = this.cal.style;
 		 this.h = this.cal.offsetHeight;
		 this.w = this.cal.offsetWidth;
		 this.x = this.css.pixelLeft;
		 this.y = this.css.pixelTop;
		 this.clipH = this.cal.offsetHeight;
	}
    else if(estce.ns)
	{
   		 if(estce.ns4)
		 {
		  	  if (!cparent)cparent="";		  	  
			  else cparent= getNs4Path(arguments)+"document."+cparent+".";
		  	  this.css=eval(cparent+"document.layers." +nom);						
   		      this.strCal = cparent+"document.layers." +nom;
			  this.strCss = this.strCal;
			  this.cal=this.css;
			  this.doc = this.css.document;
			  this.h=this.css.document.height;
			  this.w=this.css.document.width;
		      this.x = this.css.left;
		      this.y = this.css.top;
		      this.clipH = this.css.clip.height;
		      
		 }
         else if(estce.ns6)
		 {
			  this.doc = document;

			  this.cal = document.getElementById(nom);
			  this.strCal = "document.getElementById(\""+nom+"\")";
				
			  this.css = this.cal.style;
			  this.strCss = this.strCal+".style";
			  this.h=this.cal.offsetHeight;
			  this.w=this.cal.offsetWidth;
			  this.x = parseInt(this.css.left);
		 	  this.y = parseInt(this.css.top);
		 	  this.clipH = this.cal.offsetHeight;	
		 }		 
	}
	this.z = this.css.zIndex;
	this.cparent = cparent;
	this.onImage=false;
	this.nom = nom;
	this.objet = nom + "Calque";
	this.act = false;
	this.div = nom;
	this.ssp = 1;
	this.id = _ID_CALQUE;
	eval (this.objet + "=this");
}
function methode_write(content){
	if(estce.ie && estce.mac) content+="&nbsp;";
	if(estce.ns4){
		this.doc.open();
		this.doc.write(content);
		this.doc.close();
	}
	else this.cal.innerHTML = content;
	if(!estce.ns4)
		this.h = reAdjustSize(this.nom);
	else
		this. h = reAdjustSize(this.strCal);
}
function reAdjustSize(nameCalque){
	if(estce.ie) var s = eval("document.all[\""+nameCalque+"\"].offsetHeight");
	else if(estce.ns4) var s = eval(nameCalque+".document.height");
	else if(estce.ns6) var s = eval("document.getElementById(\""+nameCalque+"\").offsetHeight");
	return s;
}
function getNs4Path(arg){
	var ns4Path = "";
	if(arg.length > 2) { 
		for (i = arg.length-1; i >= 2; i--){
			ns4Path += "document.layers[\""+arg[i]+"\"]";
			if(i > 1)  ns4Path += ".";
		}
	}
	return ns4Path;
}
function methode_bougerA(x,y) {
	if (x!=null)
	{
		this.x = x;
		if (estce.ns) 
			this.css.left = (estce.ns6)?this.x+"px":this.x;
		else 
			this.css.pixelLeft = this.x;
	}
	if (y!=null)
	{
		this.y = y;
		if (estce.ns) 
			this.css.top = (estce.ns6)?this.y+"px":this.y;
		else 
			this.css.pixelTop = this.y;
	}
}
function methode_montrer() {this.css.visibility = (estce.ns4)? "show" : "visible";}
function methode_cacher() {this.css.visibility = (estce.ns4)? "hide" : "hidden";}
//function methode_scrollTo(x,y){ this.x=x;this.y=y; this.css.left=this.x; this.css.top= (!document.getElementById && !document.all) ? this.y : this.y+"px";}
//function methode_scrollDn(dplmt,scrollId){ if(this.y > -this.h + eval("oScroller"+scrollId+".clipH")){ this.scrollTo(0,this.y-dplmt);if(_LOOP_SCROLL) setTimeout(this.objet+".scrollDn("+dplmt+","+scrollId+")",_CELERITE_SCROLL); } }
//function methode_scrollUp(dplmt,scrollId){ if(this.y<0){this.scrollTo(0,this.y-dplmt);if(_LOOP_SCROLL) setTimeout(this.objet+".scrollUp("+dplmt+","+scrollId+")",_CELERITE_SCROLL);}}
//function scroll(celerite,scrollId){ if(_LOADED_SCROLL){_LOOP_SCROLL=true;if(celerite>0) eval(_SCROLLTAB[scrollId]+".scrollDn("+celerite+","+scrollId+")");else eval(_SCROLLTAB[scrollId]+".scrollUp("+celerite+","+scrollId+")");}}
function noScroll(){ _LOOP_SCROLL=false; }
Calque.prototype.montrer = methode_montrer;
Calque.prototype.cacher = methode_cacher;
Calque.prototype.bougerA = methode_bougerA;
Calque.prototype.write = methode_write;
Calque.prototype.scrollTo = methode_scrollTo;
Calque.prototype.scrollUp = methode_scrollUp;
Calque.prototype.scrollDn = methode_scrollDn;

var _CELERITE_SCROLL=50;
var _LOOP_SCROLL = true;
var _LOADED_SCROLL;
var _ID_CALQUE = 0;
var _return_y = 0;
var _SCROLLTAB = new Array();

function methode_scrollDn(dplmt,scrollId){ 
	if(this.y+this.h==0) 
	{
		this.bougerA(this.x,_return_y);
		scroll(1,0);
	}
	else
	{
		this.scrollTo(0,this.y-dplmt);
		if(_LOOP_SCROLL) setTimeout(this.objet+".scrollDn("+dplmt+","+scrollId+")",_CELERITE_SCROLL); 
	} 
}
function methode_scrollUp(dplmt,scrollId){ 
	if(this.y<0){
		this.scrollTo(0,this.y-dplmt);
		if(_LOOP_SCROLL) setTimeout(this.objet+".scrollUp("+dplmt+","+scrollId+")",_CELERITE_SCROLL);
	}
}
function scroll(celerite,scrollId)
{ 
if(_LOADED_SCROLL){
	_LOOP_SCROLL=true;
	if(celerite>0) 
		eval(_SCROLLTAB[scrollId]+".scrollDn("+celerite+","+scrollId+")");
	else 
		eval(_SCROLLTAB[scrollId]+".scrollUp("+celerite+","+scrollId+")");
	}
}

function methode_scrollTo(x,y){ 
	this.x=x;
	this.y=y; 
	this.css.left=this.x; 
	this.css.top= (!document.getElementById && !document.all) ? this.y : this.y+"px";
}
function init(){
	oCadre    = new Calque("CadreCal");
	oScroller0  = new Calque("Scroller0Cal","CadreCal");
	oPrim = new Calque("lienPrime");
	_LOADED_SCROLL=true;
	_SCROLLTAB[0] = "oScroller0";
	_return_y=oScroller0.y
	scroll(1,0)
}

function init2(){
	oCadre    = new Calque("CadreCal");
	oScroller0  = new Calque("Scroller0Cal","CadreCal");
	//oPrim = new Calque("lienPrime");
	_LOADED_SCROLL=true;
	_SCROLLTAB[0] = "oScroller0";
	_return_y=oScroller0.y
	scroll(1,0)
}