////////////////////
// Pour le scroll //
///////////////////
ie = testNav();
n = !testNav();
/*ie=document.all?1:0
n=document.layers?1:0*/

timSpeed=10
contHeight=100

function makeScrollObj(obj,nest){
        nest=(!nest) ? '':'document.'+nest+'.' ;                                                                         
        //this.css=(n) ? eval(nest+'document.'+obj):eval('document.getElementById("'+obj+'").style')    
		this.css=eval('document.getElementById("'+obj+'").style');                                                    
        //this.scrollHeight=n?this.css.document.height:eval('document.getElementById("'+obj+'").offsetHeight')                                                  
        this.scrollHeight=eval('document.getElementById("'+obj+'").offsetHeight');                                                  
		this.top=b_gettop;                                                                              
        return this;
}

function b_gettop(){
        var gleft=(n) ?parseInt(eval('this.css.top')) :eval(this.css.pixelTop) ;
        return gleft;
}
//Variables
var scrollTim;
var active=0;
function scroll(speed){
		var speed1 = ((n)?speed*5:speed) ;
        clearTimeout(scrollTim);
        way=speed>0?1:0;
        if((!way && oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0 && way)){
				oScroll[active].css.top=oScroll[active].top()+speed1;
                scrollTim=setTimeout("scroll("+speed+")",timSpeed);
        }
}

function scroll2(speed){
		var speed1 = ((n)?speed*5:speed) ;
        clearTimeout(scrollTim)
        way=speed>0?1:0;
        if((!way && oScroll2[active].top()>-oScroll2[active].scrollHeight+contHeight) || (oScroll2[active].top()<0 && way)){
                oScroll2[active].css.top=oScroll2[active].top()+speed1;
                scrollTim=setTimeout("scroll2("+speed+")",timSpeed);
        }
}

function noScroll(){
	clearTimeout(scrollTim)
}
var decalage = 193

function goPosition(pos) {
	clearTimeout(scrollTim)	
	if (pos > oScroll[active].scrollHeight) { pos = 0 ;}
	if( pos == 0 || (oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0)){
		oScroll[active].css.top=-pos;
		pos = pos + decalage ;
       setTimeout("goPosition("+pos+")",6000);
	}
}

function scrollInit(){
	//sizeLayers();
	oScroll=new Array() ;
	oScroll[0]=new  makeScrollObj('cacheccoeur','ccoeur') ;
	oScroll[0].css.visibility='visible' ;

	//oScroll2=new Array() ;
	//oScroll2[0]=new  makeScrollObj('cachefocus','focus') ;
	//oScroll2[0].css.visibility='visible' ;

	
}

////////////////////
// Fin du scroll //
///////////////////


function testOs(){
	var agent=navigator.userAgent;
	 if(agent.indexOf("Mac")==-1){
		return "pc";
	}else{ 
		return "mac";
	}
}
function testNav(){
	var agent=navigator.appName;
	 if(agent.indexOf("Netscape")==-1){
		return 1;
	}else{ 
		return 0;
	}
}

