
var flagMenuC 	= '';
var timerId 	= null;
var menuIds 	= new Array("menuAR","menuLIENS","menuArchive","1","2","3","4","5");
var repositioned= false;
DOM		= (document.getElementById) ? true : false;
NS4		= (document.layers) ? true : false;
NS6		= ((navigator.appName == "Netscape") && (parseFloat(navigator.appVersion) >=5 ))
NS4old		= (NS4 && (parseFloat(navigator.appVersion) < 4.02));
IE		= (document.all) ? true : false;
IE4		= IE && !DOM;
Mac		= (navigator.appVersion.indexOf("Mac") != -1);
Unix		= (navigator.appVersion.indexOf("X11") != -1);
IE4M		= IE4 && Mac;
Opera		= (navigator.userAgent.indexOf("Opera")!=-1);
Konqueror	= (navigator.userAgent.indexOf("Konqueror")!=-1);

function setFlagM(mId){
    if (mId!=''){ // annule le timer en cours et le réinitialise
        if (timerId)
            window.clearTimeout(timerId);
        timerId = window.setTimeout('closeMif2(\'' + mId + '\')',300);
        
    }
    flagMenuC = mId;    
}

function showM(mId,mWidth){ 	
    if (timerId)
          window.clearTimeout(timerId);
          
    var mX = findXY('img'+ mId,'x');
    var mY = findXY('img'+ mId,'y');
        
    if (document.layers)
    {    	
        document.layers[mId].visibility = "show";        
    }
    else if (document.getElementById)
    {    
    	document.getElementById(mId).style.visibility = "visible";
    	
    }
    else if (document.all)
    {    	
         document.all[mId].style.visibility = "visible";
    }
}

function closeM(mId){ 
    if (mId == null || mId==""){
        if (document.layers)
            for (var i=0;i<menuIds.length;i++)
            {
            	if(document.layers[menuIds[i]] != null) 
                	document.layers[menuIds[i]].visibility = "hidden";
            }
        else if (document.getElementById)
             for (var i=0;i<menuIds.length;i++)
             {
             	if(document.getElementById(menuIds[i]) != null)
             		document.getElementById(menuIds[i]).style.visibility = "hidden";
             }
        else if (document.all)
             for (var i=0;i<menuIds.length;i++)
             {
                objLayer =document.all[menuIds[i]].style.visibility = "hidden";
             }
    }
    else {
        if (document.layers)
            objLayer = document.layers[mId].visibility = "hide";
        else if (document.getElementById)
             objLayer =document.getElementById(mId).style.visibility = "hidden";
        else if (document.all)
             objLayer =document.all[mId].style.visibility = "hidden";
    }
}

function closeMif(mId){
    if (timerId)
        window.clearTimeout(timerId);
     window.setTimeout('closeMif2(\'' + mId + '\')',300); 
}

function closeMif2(mId){
    if (flagMenuC == mId) // ne pas fermer et revérifier dans 2 secondes
       timerId = window.setTimeout('closeMif2(\'' + mId + '\')',300);
    else {
        closeM(mId);
        if (timerId)
            window.clearTimeout(timerId);
    }
}

function getReal(xy,el){
    if((IE)||(DOM)){
       Pos=(xy=="x")?el.offsetLeft:el.offsetTop;
       if ((IE)&&(!Mac)&&(el.tagName)&&
           (el.tagName.toUpperCase()=="TABLE")&&
           (el.border)&&(el.border>0)) Pos++;
       tmpEl=el.offsetParent;      
       while(tmpEl!=null){
          Pos+=(xy=="x")?tmpEl.offsetLeft:tmpEl.offsetTop;     
          //alert("tmpEl.offsetParent=" + tmpEl.tagName +" tmpEl.offsetTop="+ tmpEl.offsetTop);
          if ((IE)&&(!Mac)&&(tmpEl.tagName)&&
              (tmpEl.tagName.toUpperCase()=="TABLE")&&
              (tmpEl.border)&&(tmpEl.border>0)) Pos++;
          tmpEl=tmpEl.offsetParent;          
       }
    }else{

       Pos=(xy=="x")?el.x:el.y;
    }


    //alert(Pos);
    /*if (IE && Mac) {
	   MacOffset=(xy=="x")?(document.body.currentStyle.marginLeft) :
                           (document.body.currentStyle.marginTop);
       if(MacOffset.indexOf('%')!=-1){
          MacSize=(xy=="x")?parseInt(document.body.offsetWidth) :
                            parseInt(document.body.offsetHeight);
          MacOffset=(parseInt(MacOffset)/100)*MacSize;
       }else{
          MacOffset=parseInt(MacOffset)
       }
       Pos+=MacOffset;
    }*/
    
    return Pos;
}

function findXY(elementid,xory) {	
    var thePlacer = DOM ? document.getElementById(elementid) :
                    IE ? document.all(elementid) : document.images[elementid];
    if(thePlacer!=null)
    {
		retVal=getReal(xory,thePlacer);
		return retVal;
	}	
}
function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII
	obj.style.backgroundColor=pviiColor
}

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_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_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_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 verifyCompatibleBrowser(){ 
	this.ver=navigator.appVersion 
	this.dom=document.getElementById?1:0 
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0; 
	this.ie4=(document.all && !this.dom)?1:0; 
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; 
	this.ns4=(document.layers && !this.dom)?1:0; 
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5) 
	return this 
} 
bw=new verifyCompatibleBrowser() 
lstart=80
loop=true  
speed=120 
pr_step=3 
function ConstructObject(obj,nest){ 
    nest=(!nest) ? '':'document.'+nest+'.' 
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0; 
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0; 
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight 
	this.newsScroll=newsScroll; 
	this.moveIt=b_moveIt; this.x; this.y; 
    this.obj = obj + "Object" 
    eval(this.obj + "=this") 
    return this 
} 
function b_moveIt(x,y){ 
	this.x=x;this.y=y 
	this.css.left=this.x 
	this.css.top=this.y 
} 
//Makes the object scroll up 
function newsScroll(speed){ 
	if(this.y>-this.scrollHeight){ 
		this.moveIt(0,this.y-pr_step) 
		setTimeout(this.obj+".newsScroll("+speed+")",speed) 
	}else if(loop) { 
		this.moveIt(0,lstart) 
		eval(this.obj+".newsScroll("+speed+")") 
	  } 
} 
//Makes the object 
function InitialiseAutoScrollArea(){ 
	objContainer=new ConstructObject('divASContainer') 
	objContent=new ConstructObject('divASContent','divASContainer') 
	objContent.moveIt(0,lstart) 
	objContainer.css.visibility='visible' 
	objContent.newsScroll(speed) 
} 
function fonctiondouble()
{

fillup();
f_init()
scrollInit()



}



/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  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; }
}
//-->


	
function favoris() {
if ( navigator.appName == 'Microsoft Internet Explorer' ){ window.external.AddFavorite("http://www.alternativesante.com/","Alternative santé"); }
else  if (navigator.appName=='Netscape') {window.sidebar.addPanel("Alternative santé","http://www.alternativesante.com","");}
else if (navigator.appName=='Opera'){ alert('Vous utilisez Opéra. Pour ajouter à vos Favoris notre site, faites la combinaison de touches [CLTR] + D'); }
else { alert('Pour ajouter à vos Favoris notre site, faites la combinaison de touches [CMD] + D'); }
return 0;
}

	<!--
var BrowserDetect = {
	init: function () {
		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
		this.version = this.searchVersion(navigator.userAgent)
			|| this.searchVersion(navigator.appVersion)
			|| "an unknown version";
		this.OS = this.searchString(this.dataOS) || "an unknown OS";
	},
	searchString: function (data) {
		for (var i=0;i<data.length;i++)	{
			var dataString = data[i].string;
			var dataProp = data[i].prop;
			this.versionSearchString = data[i].versionSearch || data[i].identity;
			if (dataString) {
				if (dataString.indexOf(data[i].subString) != -1)
					return data[i].identity;
			}
			else if (dataProp)
				return data[i].identity;
		}
	},
	searchVersion: function (dataString) {
		var index = dataString.indexOf(this.versionSearchString);
		if (index == -1) return;
		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
	},
	dataBrowser: [
		{
			string: navigator.vendor,
			subString: "Apple",
			identity: "Safari"
		},
		{
			prop: window.opera,
			identity: "Opera"
		},
		{
			string: navigator.vendor,
			subString: "iCab",
			identity: "iCab"
		},
		{
			string: navigator.vendor,
			subString: "KDE",
			identity: "Konqueror"
		},
		{
			string: navigator.userAgent,
			subString: "Firefox",
			identity: "Firefox"
		},
		{		// for newer Netscapes (6+)
			string: navigator.userAgent,
			subString: "Netscape",
			identity: "Netscape"
		},
		{
			string: navigator.userAgent,
			subString: "MSIE",
			identity: "Explorer",
			versionSearch: "MSIE"
		},
		{
			string: navigator.userAgent,
			subString: "Gecko",
			identity: "Mozilla",
			versionSearch: "rv"
		},
		{ 		// for older Netscapes (4-)
			string: navigator.userAgent,
			subString: "Mozilla",
			identity: "Netscape",
			versionSearch: "Mozilla"
		}
	],
	dataOS : [
		{
			string: navigator.platform,
			subString: "Win",
			identity: "Windows"
		},
		{
			string: navigator.platform,
			subString: "Mac",
			identity: "Mac"
		},
		{
			string: navigator.platform,
			subString: "Linux",
			identity: "Linux"
		}
	]

};
BrowserDetect.init();

// -->

function verif () {

switch(BrowserDetect.browser) {

case "Firefox":
alert ('Utilisateur de Firefox, glissez l\'icon à gauche de l\'adresse url dans la petite maison de démarrage' );
break;

case "Opera":
alert ('Utilisateur d\'Opéra, tapez [CLTR] F12 puis tapez l\'adresse "http://www.alternativesante.com" dans le champs prévu à cet effet' );
break;

case "Safari":
alert ('Utilisateur de Safari, glissez l\'icon à gauche de l\'adresse url dans la petite maison de démarrage' );
break;

}

//if ( BrowserDetect.browser=="Firefox" && BrowserDetect.version=="1.5")
//alert("firefox 1.5");

}

//Début Événements accueil
/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. This may be used freely as long as this msg is intact!
I will also appriciate any links you could give me.
********************************************************************************/
//Default browsercheck, added to all scripts!
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.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
/*****************

You set the width and height of the divs inside the style tag, you only have to
change the divCont, Remeber to set the clip the same as the width and height.
You can remove the divUp and divDown layers if you want. 
This script should also work if you make the divCont position:relative.
Then you should be able to place this inside a table or something. Just remember
that Netscape crash very easily with relative positioned divs and tables.

Updated with a fix for error if moving over layer before pageload.

****************/


//If you want it to move faster you can set this lower:
var speed=50

//Sets variables to keep track of what's happening
var loop, timer

//Object constructor
function makeObj(obj,nest){
    nest=(!nest) ? '':'document.'+nest+'.'
	this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
  	this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
	this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
	this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
	this.up=goUp;this.down=goDown;
	this.moveIt=moveIt; this.x; this.y;
    this.obj = obj + "Object"
    eval(this.obj + "=this")
    return this
}
function moveIt(x,y){
	this.x=x;this.y=y
	this.css.left=this.x
	this.css.top=this.y
}

//Makes the object go up
function goDown(move){
	if(this.y>-this.scrollHeight+oCont.clipHeight){
		this.moveIt(0,this.y-move)
			if(loop) setTimeout(this.obj+".down("+move+")",speed)
	}
}
//Makes the object go down
function goUp(move){
	if(this.y<0){
		this.moveIt(0,this.y-move)
		if(loop) setTimeout(this.obj+".up("+move+")",speed)
	}
}

//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(speed){
	if(loaded){
		loop=true;
		if(speed>0) oScroll.down(speed)
		else oScroll.up(speed)
	}
}

//Stops the scrolling (called on mouseout)
function noScroll(){
	loop=false
	if(timer) clearTimeout(timer)
}
//Makes the object
var loaded;
function scrollInit(){
	oCont=new makeObj('divCont')
	oScroll=new makeObj('divText','divCont')
	oScroll.moveIt(0,0)
	oCont.css.visibility='visible'
	loaded=true;
}
//Fin Événements accueil




/***************************************/
/*   GESTIONNAIRE D'AUTO SCROLLER      */
/*                                     */
/*   by MaX3315                        */
/*   http://codessources.votre-web.com */
/*                                     */
/***************************************/

var MAX3315_globalListNewsScroller=Array(); //LISTE OU S'INCRIVE LES COMPOSANTS

var MAX3315_default_mouseOverColor='#ffffff';
var MAX3315_default_hightlightNewsWithoutLinkToo=true;
var MAX3315_default_outGoingStep=-1;
var MAX3315_default_outGoingSpeed=40;
var MAX3315_default_pauseDuration=0;

var MAX3315_default_inCommingStep=-2;
var MAX3315_default_inCommingSpeed=20;
var MAX3315_default_readPauseDuration=3000;
var MAX3315_default_forceAMinHeightToContainerHeight=false;


//Il est fortement déconseillé de mofidier le code à partir de cette ligne

/***********************************/
/**          NEWS OBJET           **/
/***********************************/
function MAX3315_News(_container,_html,_url,_target)
{
	if(typeof(_url)=='undefined') { _url=null; }
	if(typeof(_html)=='undefined') { _html=null; }
	if(typeof(_target)=='undefined') { _target='_self'; }
	//propriete via constructeur
	this.container=_container;  // OBLIGATOIRE
	this.indexInList=0;
	this.html=_html;
	this.url=_url;
	this.target=_target;
	this.div=null;
	this.id=uniqueIDInDOM();
	//autres proprietes
	this.h=0;
	//methode de l'objet news
	this.init=MAX3315_news_init;
}

function MAX3315_news_init()
{
	this.div=document.createElement('div');
	this.div.innerHTML=this.html;

	//ajout du div contenant le message de la news
	this.container.obj.appendChild(this.div);

	this.h=this.div.offsetHeight;

	if(this.container.forceAMinHeightToContainerHeight && this.h<this.container.height)	//on retaille chaque news pour qu'elle soit au moins aussi haute que le conteneur.
	{
		this.h=this.container.height;
		this.div.style.height=this.h+'px';
	}
	
	this.div.style.position='relative';
	this.div.style.display='none';
	
	this.container.obj.removeChild(this.div);
}

/***********************************/
/** Methode globales de recherche **/
/** d'un container                **/
/***********************************/
function MAX3315_globalSearchAContainer(id)
{
	var resu=null;
	//on liste tous les news container enregistre dans la liste
	for(var i=0 ; i<MAX3315_globalListNewsScroller.length ; i++)
	{
		if(''+MAX3315_globalListNewsScroller[i].id==''+id) { return i; }
	}
	return resu;
}

/***********************************/
/**       CONTAINER OBJET         **/
/***********************************/
function MAX3315_Container(idNode)
{
	//initialisation
	this.id=idNode;
	
	this.obj=document.getElementById(this.id);
	this.width=this.obj.offsetWidth;//-(this.obj.style.paddingLeft.replace('px',''))-(this.obj.style.paddingRight.replace('px',''))
	this.height=this.obj.offsetHeight;//-(this.obj.style.paddingTop.replace('px',''))-(this.obj.style.paddingBottom.replace('px',''));
	//initialisation du style du container
	this.obj.style.overflow='hidden';
	
	//proprietes
	this.listNews=Array();
	this.currentIndex=0;
	this.inPause=false;
	this.initilised=false;
	
	this.currentUrl=null;
	this.currentTarget=null;
	
	//propriete graphique
	this.mouseOverColor=MAX3315_default_mouseOverColor;
	this.hightlightNewsWithoutLinkToo=MAX3315_default_hightlightNewsWithoutLinkToo;
	this.outGoingStep=MAX3315_default_outGoingStep;
	this.outGoingSpeed=MAX3315_default_outGoingSpeed;
	this.pauseDuration=MAX3315_default_pauseDuration;
	this.inCommingStep=MAX3315_default_inCommingStep;
	this.inCommingSpeed=MAX3315_default_inCommingSpeed;
	this.readPauseDuration=MAX3315_default_readPauseDuration;
	this.forceAMinHeightToContainerHeight=MAX3315_default_forceAMinHeightToContainerHeight;

	
	//methodes
	this.addNews=MAX3315_addNews;
	this.initAllNews=MAX3315_initAllNews;
	this.launch=MAX3315_launch;
	this.currentGoOut=MAX3315_currentGoOut;
	this.currentComming=MAX3315_currentComming;
	this.loadFromUl=MAX3315_loadFromUl;
	//les listener
	this.overContainer=MAX3315_overContainer;
	this.outContainer=MAX3315_outContainer;
	this.openMore=MAX3315_openMore;
	
	//enregistrement de l'objet dans la liste global
	this.indexInGlobalContainerList=MAX3315_globalListNewsScroller.length;
	MAX3315_globalListNewsScroller.push(this);
	
	//on ajoute les listener (pause au survole et click)
	if(document.all) { this.obj.attachEvent('onmousemove',this.overContainer); }
	else { this.obj.addEventListener('mousemove',this.overContainer,false);}
	if(document.all) { this.obj.attachEvent('onmouseout',this.outContainer); }
	else { this.obj.addEventListener('mouseout',this.outContainer,false);}
	if(document.all) { this.obj.attachEvent('onclick',this.openMore); }
	else { this.obj.addEventListener('click',this.openMore,false);}
	
	
	return;
}


//methode chargeant et creant a la vole les objet news depuis une structure du DOM au format decrit ci-dessous
  /*
    structure que l'on attends
    <ul id="newsToLoad">  <!--  <= c'est ce noeud que l'on passe en argument-->
      <li> <!-- news 1-->
        <ul>
          <li>CONTENU HTML</li>
          <li><a href="htp://more_about" target="_self">LIEN</a></li>
        </ul>
      </li>
      <li> <!--news 2-->
        <ul>
          <li>CONTENU HTML</li>
          <li></li>  <!-- dans ce cas il n'y a pas de lien-->
        </ul>
      </li>
	  <!--
	  etc...
	  ...
	  -->
    </ul>
  */

function MAX3315_loadFromUl(ulNode)
{
  var tabNews=ulNode.getElementsByTagName('ul');
  for(var i=0 ; i<tabNews.length ; i++)
  {
	var tmpLi=tabNews[i].getElementsByTagName('li');
	
	var content=tmpLi[0].innerHTML;
	var url='';
	var target='_self';
	
	if(tmpLi.length>1)
	{
		var tmpA=tmpLi[1].getElementsByTagName('a');
		if(tmpA[0])
		{
			url=tmpA[0].href;
			if(tmpA[0].target)
			{
				target=tmpA[0].target;
			}
		}
	}
	this.addNews(new MAX3315_News(null,content,url,target));
  }
  
  this.launch();
}

//Handler pour la gestion du survol avec la sourie permettant la pause de l'animation
function MAX3315_overContainer(aEvent)
{
  	var myEvent = aEvent ? aEvent : window.event; //recuperation de l'evenement selon le navigateur
	//on recupere cible de l'evenemet
	var nodeDOM= myEvent.target ? myEvent.target : myEvent.srcElement;
	
	var myContainerObjIndex=MAX3315_globalSearchAContainer(nodeDOM.id);
	while(myContainerObjIndex==null)
	{
		nodeDOM=nodeDOM.parentNode;
		myContainerObjIndex=MAX3315_globalSearchAContainer(nodeDOM.id);
	}

	if(MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!=null && MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!='' || MAX3315_globalListNewsScroller[myContainerObjIndex].hightlightNewsWithoutLinkToo)
	{
		MAX3315_globalListNewsScroller[myContainerObjIndex].obj.style.backgroundColor=MAX3315_globalListNewsScroller[myContainerObjIndex].mouseOverColor;
	}
	if(MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!=null && MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!='')
	{ if(MAX3315_globalListNewsScroller[myContainerObjIndex].obj) { MAX3315_globalListNewsScroller[myContainerObjIndex].obj.style.cursor='pointer'; }
	} else { if(MAX3315_globalListNewsScroller[myContainerObjIndex].obj) { MAX3315_globalListNewsScroller[myContainerObjIndex].obj.style.cursor='default'; } }
	
	MAX3315_globalListNewsScroller[myContainerObjIndex].inPause=true;
}

//handler gerant la sortie de la sourie, permettant le redemarrage du defilement
function MAX3315_outContainer(aEvent)
{
  	var myEvent = aEvent ? aEvent : window.event; //recuperation de l'evenement selon le navigateur
	//on recupere cible de l'evenemet
	var nodeDOM= myEvent.target ? myEvent.target : myEvent.srcElement;
	
	var myContainerObjIndex=MAX3315_globalSearchAContainer(nodeDOM.id);
	while(myContainerObjIndex==null) //on recherche le container de news
	{
		nodeDOM=nodeDOM.parentNode;
		myContainerObjIndex=MAX3315_globalSearchAContainer(nodeDOM.id);
	}
	
	if(MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!=null && MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!='' || MAX3315_globalListNewsScroller[myContainerObjIndex].hightlightNewsWithoutLinkToo)
	{
		MAX3315_globalListNewsScroller[myContainerObjIndex].obj.style.backgroundColor='';
	}
	MAX3315_globalListNewsScroller[myContainerObjIndex].inPause=false;
}

//gestion du clic sur le container, avec eventuelle ouverture du lien de la news courante (si elle en possede un)
function MAX3315_openMore(aEvent)
{
  	var myEvent = aEvent ? aEvent : window.event; //recuperation de l'evenement selon le navigateur
	//on recupere cible de l'evenemet
	var nodeDOM= myEvent.target ? myEvent.target : myEvent.srcElement;
	
	var myContainerObjIndex=MAX3315_globalSearchAContainer(nodeDOM.id);
	while(myContainerObjIndex==null)
	{
		nodeDOM=nodeDOM.parentNode;
		myContainerObjIndex=MAX3315_globalSearchAContainer(nodeDOM.id);
	}
	if(MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!=null && MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl!='')
	{
		window.open(MAX3315_globalListNewsScroller[myContainerObjIndex].currentUrl,MAX3315_globalListNewsScroller[myContainerObjIndex].currentTarget,'');
	}
}

//lie une nouvelle instance d'un objet News a cette instance de container
function MAX3315_addNews(aNews)
{
	aNews.container=this;
	aNews.indexInList=this.listNews.length;
	this.listNews.push(aNews);
	return;
}

//fonction d'initialisation du container
// elle appel principallement la fonction d'initialisation de news sur chaque news
function MAX3315_initAllNews()
{
	this.obj.innerHTML='';
	
	//initilisation d'une news apres l'autre
	for(var i=0; i < this.listNews.length ; i++) { this.listNews[i].init(); }
}

//fonction de lancement de l'animation
// automatiquement appeler par loadFromUl
// Mais peut-être appeler manuellement dans le cadre d'une chargement manuelle des news via addNews
function MAX3315_launch()
{
	if(!this.initilised) { this.initAllNews(); }
	
	this.listNews[this.currentIndex].div.style.top='0px';
	this.listNews[this.currentIndex].div.style.display='block';
	this.currentUrl=this.listNews[this.currentIndex].url;
	this.currentTarget=this.listNews[this.currentIndex].target;
	
	this.obj.appendChild(this.listNews[this.currentIndex].div);
	setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentGoOut()',this.readPauseDuration);
}


//animation de sortie d'une news
function MAX3315_currentGoOut()
{
	if(this.inPause)
	{
		setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentGoOut()',this.pauseDuration);
	}
	else
	{
		var tmpTop=Math.round(this.listNews[this.currentIndex].div.style.top.replace('px',''));
		var divHeight=this.listNews[this.currentIndex].h;
		this.listNews[this.currentIndex].div.style.top=(tmpTop+this.outGoingStep)+'px';
		if(divHeight>-tmpTop)
		{
			setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentGoOut()',this.outGoingSpeed);
		}
		else
		{
			this.listNews[this.currentIndex].div.style.display='none';
			
			this.obj.removeChild(this.listNews[this.currentIndex].div);
			
			this.currentIndex=(this.currentIndex+1)%this.listNews.length;
			this.listNews[this.currentIndex].div.style.display='block';
			this.listNews[this.currentIndex].div.style.top=this.height+'px';
			
			this.obj.appendChild(this.listNews[this.currentIndex].div);
	
			setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentComming()',this.outGoingSpeed);
		}
	}
}

//animation d'entré d'une news
function MAX3315_currentComming()
{
	if(this.inPause)
	{
		setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentComming()',this.pauseDuration);
	}
	else
	{
		this.currentUrl=this.listNews[this.currentIndex].url;
		this.currentTarget=this.listNews[this.currentIndex].target;
		
		if(this.currentUrl==null || this.currentUrl=='') { this.obj.style.cursor='default'; }
		else { this.obj.style.cursor='pointer'; }
		
		var tmpTop=Math.round(this.listNews[this.currentIndex].div.style.top.replace('px',''));
		this.listNews[this.currentIndex].div.style.top=(tmpTop+this.inCommingStep)+'px';
		
		if(tmpTop>0)
		{
			setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentComming()',this.inCommingSpeed);
		}
		else
		{
			//on passe a l'animation de sortie apres une pause de this.readPauseDuration milisecondes
			setTimeout('MAX3315_globalListNewsScroller['+this.indexInGlobalContainerList+'].currentGoOut()',this.readPauseDuration);
		}
	}
}



