var refActuel=0,position=-30,opaque=0,liensTab=[],taille,liensIndice=-1,liensTimer,isIE=!!document.all;function move(elem){if(!liensTimer&&elem==liensIndice){return false;}if(liensTimer){clearInterval(liensTimer);liensTimer=null;}var dir=liensTab[elem]>position?1:-1;var menu_ref=_$('menu_item');if(liensIndice>=0){menu_ref.getElementsByTagName('li')[liensIndice].className='';}function actionTimer(){if(Math.abs(liensTab[elem]-position)>4){position+=5*dir;menu_ref.style.backgroundPosition='10px '+position+'px';}else{clearInterval(liensTimer);position=liensTab[elem];menu_ref.style.backgroundPosition='10px '+position+'px';liensIndice=elem;menu_ref.getElementsByTagName('li')[liensIndice].className='active';liensTimer=null;}}liensTimer=setInterval(actionTimer,10);}function inc(){if(isIE){_$('chg_flux').filters[0].opacity=opaque;_$('ajout').filters[0].opacity=(opaque*2);}else{_$('chg_flux').style.opacity=opaque/100;_$('ajout').style.opacity=opaque/50;}opaque+=5;if(opaque>50){opaque=50;getFlux();}else{setTimeout(inc,50);}}function dec(){if(isIE){_$('chg_flux').filters[0].opacity=opaque;_$('ajout').filters[0].opacity=(opaque*2);}else{_$('chg_flux').style.opacity=opaque/100;_$('ajout').style.opacity=opaque/50;}opaque-=5;if(opaque<0){opaque=0;_$('chg_flux').style.display='none';_$('ajout').style.display='none';}else{setTimeout(dec,50);}}function navRSS(reference){if(refActuel==reference){return false;}_$('navTab').getElementsByTagName('div')[reference].style.backgroundPosition='bottom';_$('navTab').getElementsByTagName('div')[refActuel].style.backgroundPosition='top';refActuel=reference;taille=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;_$('chg_flux').style.height=Math.max(taille,document.body.offsetHeight)+'px';opaque=0;_$('chg_flux').style.display='block';_$('ajout').style.display='block';if(isIE){_$('chg_flux').style.filter='alpha(opacity=0)';_$('ajout').style.filter='alpha(opacity=0)';}inc();return;}function getFlux(){var nombre=refActuel?10:2;var xhr=getXHR();xhr.onreadystatechange=function(){if(xhr.readyState==4&&xhr.status==200){_$('corps').innerHTML=xhr.responseText;taille=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;if(taille<_$('corps').offsetHeight+125){_$('footer').style.position='static';}else{_$('footer').style.position='absolute';_$('footer').style.bottom='10px';}dec();}};xhr.open("POST",'/actu_ajx.php',true);xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=iso-8859-1");xhr.send('flux='+refActuel+'&nb='+nombre);}function getXHR(){var xhr=null;if(window.XMLHttpRequest){try{xhr=new XMLHttpRequest();}catch(e){}}else if(window.ActiveXObject){try{xhr=new ActiveXObject("Msxml2.XMLHTTP");}catch(e1){try{xhr=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){}}}return xhr;}function _$(un_id){return document.getElementById(un_id);}var init=function(){_$('actif').onclick=function(){return false;};var liens=_$('menu').getElementsByTagName('li');var i=liens.length;while(i){i--;liensTab[i]=isIE&&!navigator.appVersion.match('MSIE 8')?liens[i].offsetTop:liens[i].offsetTop-_$('menu').offsetTop;liens[i].ref=i;liens[i].onmouseover=function(){move(this.ref);};liens[i].onmouseout=function(){move(_$('actif').ref);};}move(_$('actif').ref);if(isIE){_$('chg_flux').style.filter='alpha(opacity=0)';_$('ajout').style.filter='alpha(opacity=0)';}else{_$('chg_flux').style.opacity=0;_$('ajout').style.opacity=0;}var listeItem=_$('navTab').getElementsByTagName('div');i=listeItem.length;while(i){i--;listeItem[i].ref=i;listeItem[i].onclick=function(){navRSS(this.ref);};}liens=null;listeItem=null;}();
