var pas  = 3;
var Scroll  = false;
var lastPos = null;
var timer = null;

var timer_news = null;
var Scroll_news = false;
var pas_news = 10;
var hBar = 311;
clicEnCours = false;
position_y = 0;

var flag_shop = true;
var flag_comp = true;

var x = 0;
var y = 0; 

document.onmousemove = SourisXY;
	
function StartScroll(id)
{
    if(!Scroll)
    {
        Scroll = true;
        Scrolling(id);
    }
}
 
function StopScroll()
{
    if(timer)
        clearTimeout(timer);
    Scroll = false;
}

function Scrolling(id)
{
    if(Scroll && document.getElementById(id))
    {
        document.getElementById(id).scrollLeft += parseInt(pas);
        if(lastPos != null)
        {
            if(lastPos == document.getElementById(id).scrollLeft)
            {
                pas = pas * -1;
            }
        }
        timer = setTimeout("Scrolling('" + id + "')",100);
        lastPos = document.getElementById(id).scrollLeft;
    }
}

function aGauche(id)
{
			if (pas < 0)
			{
				pas  = -1*pas;
			}
}

function aDroite(id)
{
			if (pas > 0)
			{
				pas  = -1*pas;
			}
}

function cible(id)
{
	document.getElementById(id).style.cursor = "pointer";
}

function pushpop(id)
{
	if (flag_shop)
	{
		afficher(id);
		flag_shop = false;
	}
	else
	{
		cacher(id);
		flag_shop = true;
	}
}

function change(Id)
{
	if (flag_comp)
	{	
		document.getElementById(Id).style.backgroundColor='#FFFFFF';
		flag_comp = false;
	}
	else
	{
		document.getElementById(Id).style.backgroundColor='#e2d9c4';
		flag_comp = true;
	}
}

function Valider(radio)
{
	var m=0;
	
	for (var i=0; i<radio.length; i++)
	{
  	if (radio[i].checked)
  	{
    	m = i;
    }
  }

	switch(m)
	{
		case 0:		alert("Sélectionnez un type de recherche");
							return false;
							break;
		case 1:		return true;
							break;
		case 2:		return true;
							break;
		case 3:		return true;
							break;
		case 4:		return true;
							break;

	}
}

function SourisXY(e)
{ 
	if (e)
	{
		x = e.pageX; 
		y = e.pageY; 
	}
	else
	{
		x = event.clientX;
		y = event.clientY;
	}
	
 if(document.documentElement && document.documentElement.clientWidth)
      DocRef = document.documentElement;
    else
      DocRef = document.body;

    x += DocRef.scrollLeft;
    y += DocRef.scrollTop;
} 

function lienon(i)
{ 
	if (navigator.appName=="Netscape") 
	document.onmousemove = SourisXY; 
	document.getElementById( "bulle"+i ).style.visibility ="visible"; 
	document.getElementById( "bulle"+i ).style.left = x;
	document.getElementById( "bulle"+i ).style.top = y; 
}

function lienoff(i)
{ 
	document.getElementById( "bulle"+i ).style.visibility ="hidden"; 
}