/* ##### fonctions communes et génériques ##### */

function addEvent(type,fonction,objet){
	if (objet.addEventListener){	// code standard DOM
		objet.addEventListener(type, fonction, false);
	}
	else if (objet.attachEvent){ 	// code propriétaire MSIE
		objet.attachEvent("on"+type, fonction);
	}
}

function hasClass(ele,cls) {
	return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}
function addClass(ele,cls) {
	if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}
function removeClass(ele,cls) {
	if (hasClass(ele,cls)) {
		var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
		ele.className=ele.className.replace(reg,' ');
	}
}

function createXHR() 
{
    var request = false;
        try {
            request = new ActiveXObject('Msxml2.XMLHTTP');
        }
        catch (err2) {
            try {
                request = new ActiveXObject('Microsoft.XMLHTTP');
            }
            catch (err3) {
		try {
			request = new XMLHttpRequest();
		}
		catch (err1) 
		{
			request = false;
		}
            }
        }
    return request;
}

function addScript(url) {
    var script = document.createElement('script');
    script.src = url;
    document.body.appendChild(script);
    document.body.removeChild(script);
}

function in_array(tab, val) {
        for (var i=0; i<tab.length; i++) {
                if (tab[i]==val) { return i; }
        }
        return -1;
}

function valeur(obj) {
	strRes = document.getElementById(obj).value;
	return (strRes);
}

function gopub(d1,d2){
    document.getElementById(d2).parentNode.replaceChild(document.getElementById(d1),document.getElementById(d2));
}

function deplace_pub(div_source,div_cible){
	var ifr_pub_source = document.getElementById(div_source);	
	var ifr_pub_cible = document.getElementById(div_cible);
	var parentDiv = ifr_pub_cible.parentNode;
	parentDiv.replaceChild(ifr_pub_source,ifr_pub_cible);
}

/* ##### onload ##### */

/* onload::toutes_pages */
function onLoad(){
	for (i = 0; i < document.links.length; i++) {
		var link = document.links[i];
		addEvent('click', onclick_out,link);
		//addEvent('contextmenu', onclick_out,link);
	}
	
	if(document.getElementById("box_lpn") != null ){//null ou pas
		addEvent('submit', onclick_out, document.getElementById("box_lpn"));
	}
}
addEvent('load',onLoad,window);


/* browserdetect.js */

// Browser Detect Lite  v2.1.4
// http://www.dithered.com/javascript/browser_detect/index.html
// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)


function BrowserDetectLite() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser name
   this.isGecko     = (ua.indexOf('gecko') != -1 && ua.indexOf('safari') == -1);
   this.isMozilla   = (this.isGecko && ua.indexOf('gecko/') + 14 == ua.length);
   this.isNS        = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
   this.isIE        = ( (ua.indexOf('msie') != -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) ); 
   this.isSafari    = (ua.indexOf('safari') != - 1);
   this.isOpera     = (ua.indexOf('opera') != -1); 
   this.isKonqueror = (ua.indexOf('konqueror') != -1 && !this.isSafari); 
   this.isIcab      = (ua.indexOf('icab') != -1); 
   this.isAol       = (ua.indexOf('aol') != -1); 
   
   // spoofing and compatible browsers
   this.isIECompatible = ( (ua.indexOf('msie') != -1) && !this.isIE);
   this.isNSCompatible = ( (ua.indexOf('mozilla') != -1) && !this.isNS && !this.isMozilla);
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isNS && this.isGecko) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
   }
   else if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   else if (this.isMozilla) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('rv:') + 3 ) );
   }
   else if (this.isSafari) {
      this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
   }
   else if (this.isOpera) {
      if (ua.indexOf('opera/') != -1) {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
      }
      else {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
      }
   }
   else if (this.isKonqueror) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
   }
   else if (this.isIcab) {
      if (ua.indexOf('icab/') != -1) {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
      }
      else {
         this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
      }
   }
   
   this.versionMajor = parseInt(this.versionMinor); 
   this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
   
   // dom support
   this.isDOM1 = (document.getElementById);
   this.isDOM2Event = (document.addEventListener && document.removeEventListener);
   
   // css compatibility mode
   this.mode = document.compatMode ? document.compatMode : 'BackCompat';

   // platform
   this.isWin   = (ua.indexOf('win') != -1);
   this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   this.isMac   = (ua.indexOf('mac') != -1);
   this.isUnix  = (ua.indexOf('unix') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
   this.isLinux = (ua.indexOf('linux') != -1);
   
   // specific browser shortcuts
   this.isNS4x = (this.isNS && this.versionMajor == 4);
   this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
   this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
   this.isNS4up = (this.isNS && this.versionMinor >= 4);
   this.isNS6x = (this.isNS && this.versionMajor == 6);
   this.isNS6up = (this.isNS && this.versionMajor >= 6);
   this.isNS7x = (this.isNS && this.versionMajor == 7);
   this.isNS7up = (this.isNS && this.versionMajor >= 7);
   
   this.isIE4x = (this.isIE && this.versionMajor == 4);
   this.isIE4up = (this.isIE && this.versionMajor >= 4);
   this.isIE5x = (this.isIE && this.versionMajor == 5);
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE5up = (this.isIE && this.versionMajor >= 5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
   this.isIE6up = (this.isIE && this.versionMajor >= 6);
   
   this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetectLite();

/* dynMenu2.js */

/*
Author   : bieler batiste
Company  : doSimple : http://www.dosimple.ch
send me a mail for more informations : faden@PASDEPOURRIELaltern.org - remove ( PASDEPOURRIEL )

Short javascript function to create and handle a CSS navigation menu

Copyright (C) 2004  Bieler Batiste

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// the timeout for the menu
var timeout = 100;

// not very clean but simple
// the function can be run in the HTML for faster display
// window.onload=initMenu;

// creat timeout variables for list item
// it's for avoid some warning with IE
for( var i = 0; i < 50; i++ )
{
    eval("var timeoutli" + i + " = false;");
    eval("var timeoutli_menu_ln_" + i + " = false;");
    eval("var timeoutli_liste_menu_h_" + i + " = false;");
    eval("var timeoutli_liste_menu_b_" + i + " = false;");
}

// this fonction apply the CSS style and the event
function initMenu(object)
{
    // a test to avoid some browser like IE4, Opera 6, and IE Mac
    if ( browser.isDOM1 
    && !( browser.isMac && browser.isIE ) 
    && !( browser.isOpera && browser.versionMajor < 7 )
    && !( browser.isIE && browser.versionMajor < 5 ) )
    {
        // get some element
        var menu_ln = document.getElementById(object); // the root element
        var lis = menu_ln.getElementsByTagName('li'); // all the li
        
        // change the class name of the menu, 
        // it's usefull for compatibility with old browser
        menu_ln.className=object;
        
        // i am searching for ul element in li element
        for ( var i=0; i<lis.length; i++ )
        {
            // is there a ul element ?
            if ( lis.item(i).getElementsByTagName('ul').length > 0 )
            {        
                // improve IE key navigation
                if ( browser.isIE )
                {
                   addAnEvent(lis.item(i),'keyup',show);
                }
                // link events to list item
                addAnEvent(lis.item(i),'mouseover',show);
                addAnEvent(lis.item(i),'mouseout',timeoutHide);
                addAnEvent(lis.item(i),'blur',timeoutHide);
                addAnEvent(lis.item(i),'focus',show);
                
                // add an id to list item
                lis.item(i).setAttribute( 'id', "li_"+object+"_"+i );
                lis.item(i).getElementsByTagName('a')[0].className = 'menuIndicateur';
            }
        }
    }
}

function addAnEvent( target, eventName, functionName )
{
    // apply the method to IE
    if ( browser.isIE )
    {
        //attachEvent dont work properly with this
        eval('target.on'+eventName+'=functionName');
    }
    // apply the method to DOM compliant browsers
    else
    {
        target.addEventListener( eventName , functionName , true ); // true is important for Opera7
    }
}
 
// hide the first ul element of the current element
function timeoutHide()
{
    // start the timeout
    eval( "timeout" + this.id + " = window.setTimeout('hideUlUnder( \"" + this.id + "\" )', " + timeout + " );");
}

// hide the ul elements under the element identified by id
function hideUlUnder( id )
{   	
	
    document.getElementById(id).getElementsByTagName('ul')[0].style['visibility'] = 'hidden';
	if(nsc == "lesnums"){
		document.getElementById(id).style.background = "url(http://img1.lesnumeriques.com/images/fond/gris/hd_menu_normal.jpg)";
	}else if(nsc == "focus"){
		document.getElementById(id).style.background = "none";
	}
}



// show the first ul element found under this element
function show()
{

	// on met le menu en hover
	if(nsc == "lesnums"){
		document.getElementById(this.id).style.background = "url(http://img1.lesnumeriques.com/images/fond/hd_menu_hoover.png)";
	}else if(nsc == "focus"){
		if(this.id.substring(3,15) == "liste_menu_h"){ 
			// document.getElementById(this.id).style.background = "url(http://www.focus-numerique.com/new/images/ul_menu_haut.png)";
			document.getElementById(this.id).style.backgroundColor = "#424545";
		}else{
			document.getElementById(this.id).style.backgroundColor = "#715C43";
		}
	}

    // show the sub menu
    this.getElementsByTagName('ul')[0].style['visibility'] = 'visible';
    // clear the timeout
    eval ( "clearTimeout( timeout"+ this.id +");" );	
    hideAllOthersUls( this );
}

// hide all ul on the same level of  this list item
function hideAllOthersUls( currentLi )
{
	
    var ul = currentLi.parentNode;
    //alert(lis.childNodes.length);
    for ( var i=0; i<ul.childNodes.length; i++ )
    {
        if ( ul.childNodes[i].id && ul.childNodes[i].id != currentLi.id )
        {
            hideUlUnderLi( ul.childNodes[i] );
        }
    }
}

// hide all the ul wich are in the li element
function hideUlUnderLi( li )
{
    var uls = li.getElementsByTagName('ul');
    for ( var i=0; i<uls.length; i++ )
    {
        uls.item(i).style['visibility'] = 'hidden';
    }
}

/* hd_ct10j.js */

var clic_1 = new Date(1970, 01, 01);
function onclick_out(e){
	clic_2 = new Date();
	tps_clic = clic_2.getTime()-clic_1.getTime();
	clic_1 = clic_2;
	if(tps_clic<700){
		return;
	}
	selObj = e.target || e.srcElement;

	var url_cible = "";
	
	if(selObj.id == "box_lpn"){	// cas formulaire
		var input = document.getElementById('input_pub_lpn');
		var valeur = input.value;
		if( valeur == "Comparer les prix"){ // test si la value "Comparer les prix" on change la value à vide
			document.getElementById('input_pub_lpn').value="";
		}
		url_cible = selObj.action+"?"+input.name+"="+document.getElementById('input_pub_lpn').value+"&box=1";
	}else{ // cas lien
		while(selObj.tagName != "A"){
			selObj=selObj.parentNode;
		}
		url_cible = selObj.href;
	}
		
	var parse = new Poly9.URLParser(url_cible);
	
	var modele = /(((((www|img1|forum|newsletter).)?(lesnumeriques|lesnumériques|lesnum|lmdn|focus-numerique|legrandforum).com))|((www.)?(lesnumeriques.(fr|be)))|((www.)?digitalversus.(com|de|co.uk))|((www.)?pricesversus.(fr|co.uk)))/;

	if(modele.test(parse.getHost())!=true){
		if(clic_m=="aj"){	
			var url = "http://www.lesnumeriques.com/inc/clic.php?clic_m="+clic_m+"&url_source="+escape(document.location.href)+"&url="+escape(url_cible)+"&type_clic=1";
			xhr_clic = false;
			xhr_clic = new createXHR();
			// Open a connection to the server
			xhr_clic.open("GET", url, true);
			// Send the request
			xhr_clic.send(null);
		}else if(clic_m=="sc"){
			var date = new Date();
			var url="http://www.lesnumeriques.com/inc/clic.php?clic_m="+clic_m+"&url_source="+escape(document.location.href)+"&url="+escape(url_cible)+"&type_clic=1"+"&date="+ escape(date.getTime());
			addScript(url);
		}
	}
}

/** 
* @projectDescription 	Poly9's polyvalent URLParser class
* @author	Denis Laprise - denis@poly9.com - http://poly9.com
* @version	0.1 
* @namespace	Poly9
* URLParser is freely distributable under the terms of an MIT-style license.
*/

if (typeof Poly9 == 'undefined')
	var Poly9 = {};

Poly9.URLParser = function(url) {
	this._fields = {'Username' : 4, 'Password' : 5, 'Port' : 7, 'Protocol' : 2, 'Host' : 6, 'Pathname' : 8, 'URL' : 0, 'Querystring' : 9, 'Fragment' : 10};
	this._values = {};
	this._regex = null;
	this.version = 0.1;
	this._regex = /^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/;
	for(var f in this._fields)
		this['get' + f] = this._makeGetter(f);
	if (typeof url != 'undefined')
		this._parse(url);
}
 
Poly9.URLParser.prototype._initValues = function() {
	for(var f in this._fields)
	this._values[f] = '';
}

Poly9.URLParser.prototype._parse = function(url) {
	this._initValues();
	var r = this._regex.exec(url);
	if (!r) throw "DPURLParser::_parse -> Invalid URL"
	for(var f in this._fields) if (typeof r[this._fields[f]] != 'undefined')
		this._values[f] = r[this._fields[f]];
}

Poly9.URLParser.prototype._makeGetter = function(field) {
	return function() {
	return this._values[field];
	}
}



/* home_ct.js */

/* Constructeur de diaporama, utilisé pour les " derniers articles " et le face à face.*/
function diapo(id, auto, encours, temps, nb_images, col_fond, col_hover, slide,nom_class_hover,nom_class_defaut){
	this.id = id;
	this.auto = auto;
	this.encours = encours;
	this.temps = temps;
	this.nb_images = nb_images;
	this.col_fond = col_fond;
	this.col_hover = col_hover;
	this.slide = slide;
	this.nom_class_hover = nom_class_hover;
	this.nom_class_defaut = nom_class_defaut;
}

/*La fonction MM_findObj(n,d) est une fonction qui est utilisé par d'autres fonction de MacroMedia dreamweaver
   (MM_setTextOfTextfield, MM_validateForm entre autres) afin de recuperer un objet (<div><table><img><span><input>, etc...)
    pour se faire, cette fonction a besoin de connaitre le nom de l'objet indiqué via l'attribut name.
*/
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;
}

/* La fonction MM_showHideLayers() est une fonction toute prète qui masque ou montre ( hide ou show )
     un objet qui a été récupéré par la fonction "MM_findObj(n,d)"
*/
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;
  }
}

/* Fonction permettant de changer la col du fond des boutons lorsqu'on passe la souris sur le numéro en hover "onmousehover"*/
function fond_col(id_diapo,numero) {
	
	document.getElementById("b"+id_diapo+"_"+numero).style.backgroundColor=eval("diapo_"+id_diapo).col_hover;
}
var play_etat = new String("");
/* Cette méthode regarde si le diaporama est en cours de route ou non puis si il est en route défini selon la position du calque,
     le calque suivant en incrémentant la variable encours.*/
	 
// var en_cours;
function marche(id_diapo){
	diapo = eval("diapo_"+id_diapo);
	if(diapo.slide==true){
		if (diapo.auto == 1){
			if(diapo.encours == diapo.nb_images-1){
					diapo.encours = 0;
			}else{
				diapo.encours++;
			}
		}
	}

	/* Permet de cacher les calques du diaporama. */
	for (i=1;i<diapo.nb_images+1;i++){
		MM_showHideLayers("l"+id_diapo+"_"+i,"","hide");
	}
	

	MM_showHideLayers("l"+id_diapo+"_"+(diapo.encours+1),'','show');
	
	if(diapo.en_cours){
		if(typeof(timeval)!="undefined"){
			window.clearInterval(timeval);
			diapo.en_cours = false;
		}
	}

	if ( (diapo.auto == 1) && (diapo.slide==true)){
		timeval = window.setInterval("marche("+id_diapo+")", diapo.temps);
		fond(id_diapo,(diapo.encours+1));
		diapo.en_cours = true;
	}
}

function b_over(id_diapo, n_bouton){
	diapo = eval("diapo_"+id_diapo);
	diapo.encours=n_bouton-1;
	marche(id_diapo);
}

function onLoad_diapo(){
	marche(1);
}



function fond(id_diapo,numero) {
	
	for(var i=1; i<=diapo.nb_images; i++){
		addClass(document.getElementById("b"+id_diapo+"_"+i),diapo.nom_class_defaut);
		removeClass(document.getElementById("b"+id_diapo+"_"+i),diapo.nom_class_hover);

		if(document.getElementById("alune_arr_"+i) != undefined){
			document.getElementById("alune_arr_"+i).style.visibility = "hidden";
		}
	}

	removeClass(document.getElementById("b"+id_diapo+"_"+numero),diapo.nom_class_defaut);
	addClass(document.getElementById("b"+id_diapo+"_"+numero),diapo.nom_class_hover);
		
	if(document.getElementById("alune_arr_"+numero) != undefined){
		document.getElementById("alune_arr_"+numero).style.visibility = "visible";
	}
}

function hover_une(id_diapo, n_bouton){
	diapo = eval("diapo_"+id_diapo);
	fond(id_diapo,n_bouton);
	diapo.encours=n_bouton-1;
	diapo.auto=0;
	marche(id_diapo);
}

function stop_diapo(id_diapo){
	diapo.auto=0;
	marche(id_diapo);	
}

function marche_diapo(id_diapo){
	diapo = eval("diapo_"+id_diapo);
	diapo.encours = diapo.encours-1;
	if(diapo.encours < 0){
		diapo.encours=diapo.encours; // se positionne au courant
	}

	diapo.auto=1;
	marche(id_diapo);
	
}

/* news_ct.js */

function hover_out_news(hover,precedent_suivant){
	// -1 = suivant, 1 = précédent
	if(hover){ // hover
		if(precedent_suivant == 1){
			removeClass(document.getElementById(id_news_precedente),"liens_nsp");
			addClass(document.getElementById(id_news_precedente),"hover");
		}else{
			removeClass(document.getElementById(id_news_suivante),"liens_nsp");
			addClass(document.getElementById(id_news_suivante),"hover");
		}
	}else{
		if(precedent_suivant == 1){
			addClass(document.getElementById(id_news_precedente),"liens_nsp");
			removeClass(document.getElementById(id_news_precedente),"hover");
		}else{
			addClass(document.getElementById(id_news_suivante),"liens_nsp");
			removeClass(document.getElementById(id_news_suivante),"hover");
		}
	}
	
}

/* art_ct.js */

function change_menu(num_menu,nom_menu){
	if(li_en_cours != num_menu){
		document.getElementById('sous_menu_' + li_en_cours).style.visibility = "hidden";
		document.getElementById('sous_menu_' + num_menu).style.visibility = "visible";
		li_en_cours = num_menu;
		position_li = num_menu-1;
		ul = document.getElementById(nom_menu);
		var lis = ul.getElementsByTagName('li');
		addClass(lis[position_li],"liste_menu_en_cours");
		
		for(var i=0; i<lis.length;i++){
			if(i != position_li){
			removeClass(lis[i],"liste_menu_en_cours");
			addClass(lis[i],"liste_menu_defaut");
			}
		}
		
		
	}
	
}

/* fonction pour pub */

function SmartAdServer(sas_pageid,sas_formatid,sas_target) {
	if (sas_masterflag==1) {sas_masterflag=0;sas_master='M';} else {sas_master='S';};
	document.write('<SCR'+'IPT SRC="http://ww57.smartadserver.com/call/pubj/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></SCR'+'IPT>');
}

/* fonctions diapo forum home */


function recup_derniers_topics(timeout){
	

	var req = new XMLHttpRequest();
	req.open("GET", "/home/derniers_topics.json", true); 	
	req.onreadystatechange = function(){
		if (req.readyState == 4){

			if (req.status != 404){
				var bloc_derniers_topics = "";
				var derniers_topics = eval("(" + req.responseText + ")");
				for(var i=0;i< derniers_topics.length;i++){
					var num_page = parseInt(derniers_topics[i][5] / 40);
					// num_page = num_page+1;
					// var lien_topic = "http://www.legrandforum.com/avis/Appareils-Photo-Camescopes-Numeriques/" + derniers_topics[i][1] + "sujet_" + derniers_topics[i][2] + "_" + num_page + ".htm#t" + derniers_topics[i][6];num_page = num_page+1;
					var lien_topic = "http://www.legrandforum.com/avis/Appareils-Photo-Camescopes-Numeriques/" + derniers_topics[i][1] + "sujet_" + derniers_topics[i][2] + "_1.htm";
					bloc_derniers_topics += "<a href=\"" + lien_topic + "\" >"+ derniers_topics[i][0] + "</a>"; // target=\"_blank\"

				}				
				
				document.getElementById("div_defilement").innerHTML = bloc_derniers_topics;
			}
		}
		

	};

	req.send(null);
	setTimeout("init_mrq()",timeout);	
}



var pas=1;
var stoc=0;
var h_fen="112px";
var interval ="";
function scrollmrq(){
	if (parseInt(mrq.style.top) > -h_mrq-parseInt(350) ) {
		mrq.style.top = parseInt(mrq.style.top)-pas+"px";
	}else{ 
		// animation ajax		
		document.getElementById("loading_forum").style.visibility = "visible";
		mrq.style.top=parseInt(h_fen)+"px";
		clearInterval(interval);
		if(typeof(interval_haut)!="undefined"){clearInterval(interval_haut);}
		if(typeof(interval_bas)!="undefined"){clearInterval(interval_bas);}	
		recup_derniers_topics(2000);
	}
}

function scrollmrq_haut(){
	if (parseInt(mrq.style.top) < 0 ) {
		mrq.style.top = parseInt(mrq.style.top)+pas+"px";
	}else{		
		mrq.style.top = "0px";
	}
}

function scrollmrq_bas(){
	if (parseInt(mrq.style.top) > (parseInt(-h_mrq)+parseInt(h_fen)-parseInt(9)-parseInt(350)) ) {
		mrq.style.top = parseInt(mrq.style.top)-pas+"px";
	}else{
		mrq.style.top= (parseInt(-h_mrq)+parseInt(h_fen)-parseInt(18)-parseInt(350))+"px";
	}
}


function init_mrq(){

	mrq=document.getElementById("div_defilement");
	fen=document.getElementById("menu_deroulant");
	
	var defile_haut = document.getElementById("defile_haut");
	defile_haut.onmouseover = function(){
		clearInterval(interval);
		interval_haut = setInterval("scrollmrq_haut()",8);
	};
	
	defile_haut.onmouseout=function(){
		if(typeof(interval_haut)!="undefined"){clearInterval(interval_haut);}
		interval = setInterval("scrollmrq()",80)
	};
	
	var defile_bas = document.getElementById("defile_bas");
	defile_bas.onmouseover = function(){
		clearInterval(interval);
		interval_bas = setInterval("scrollmrq_bas()",8);
	};
	
	defile_bas.onmouseout=function(){
		if(typeof(interval_bas)!="undefined"){clearInterval(interval_bas);} 
		interval = setInterval("scrollmrq()",80)
	};
	
	
	with(mrq.style){
		position="absolute";
		top=0;
	}
	
	mrq.onmouseover=function(){stoc=pas;pas=0};
	mrq.onmouseout=function(){
		if(typeof(interval_haut)!="undefined"){clearInterval(interval_haut);}
		if(typeof(interval_bas)!="undefined"){clearInterval(interval_bas);}
		pas=stoc
	};
	
	fen.style.height=h_fen;
	h_mrq=mrq.offsetHeight;
	
	document.getElementById("loading_forum").style.visibility = "hidden";
	interval = setInterval("scrollmrq()",80);

}
function no_link(){return false;}
