function handle_response(name, total, nb)
{
  for (i = 1; i < total; i++)
  {
	$(name + "_" + i).style.display='none';
  }

  for (i = 1; i <= total; i++)
  {
	if (i <= nb)
	{
	  $(name + "_" + i).style.display='block';
	}
	else
	{
	  $(name + "_" + i).style.display='none';
	}
  }
}

function	checknewsletter(prefix)
{
		if ($('formchecknewsletter').src == prefix+'/39GeorgeVPictoCross.gif')
		{
			$('formchecknewsletter').src = prefix+'/39GeorgeVPictoCrossChecked.gif';
			$('newsletter').value = '1';
		}
		else
		{
			$('formchecknewsletter').src = prefix+'/39GeorgeVPictoCross.gif';
			$('newsletter').value = '0';
		}
}

function	changelistavis($pos)
{
		
}

function none()
{
	;
}

function change_menu(action, id)
{
        if (action == "over")
        {
                $(id).src = "./im/menu/"+id+"-on.gif";
        }
        else
        {
                $(id).src = "./im/menu/"+id+".gif";
        }
}


function aff_object(object, type, div)
{
	if (type == "image")
	{
		$(div).innerHTML = '<img style="display:block; border:1px SOLID #898989;" src="'+object+'" />';
	}
	if (type == "video")
	{
		$(div).innerHTML = '<object type="application/x-shockwave-flash" data="./players/lecteur-Album.swf" style="margin-top:5px;width:250px; height:200px;"><param name="movie" value="./players/lecteur-Album.swf"><param name="FlashVars" value="flv='+object+'&amp;showvolume=1&amp;showtime=1&amp;showstop=1&amp;buttonovercolor=FF0000&amp;autoplay=1&amp;margin=0&amp;loadingcolor=FF0000&amp;sliderovercolor=990000&amp;width=250&amp;height=200&amp;buffer=10"><param name="wmode" value="transparent"></object>';
	}
	if (type == "son")
	{
		$(div).innerHTML = '<img src="./im/podcast.gif" alt=""><object type="application/x-shockwave-flash" data="./players/dewplayer.swf?son='+object+'" height="20" width="200">';
	}
	if (type == "file")
	{
		$(div).innerHTML = '<a href="'+object+'" target="_BLANK"><img src="./im/default-size4.jpg" style="display:block; border:0px solid #FFFFFF;" /></a>';
	}
}

function showHideOpceTitle(id)
{
	for(var i = 0; document.getElementById('opceTitle_'+i); i++)
	{
		$('opceTitle_'+i).className = "opceTitleNotSelected";
		$('opceText_'+i).style.display = "none";
	}
	$('opceTitle_'+id).className = "opceTitleSelected";
	$('opceText_'+id).style.display = "";
}

function show_hide_menu_left(id)
{
	if ($(id).style.display == "none")
	{
		$(id+"_plus").src = "./im/picto_plus.gif";
		$(id).style.display = "";
	}
	else
	{
		$(id+"_plus").src = "./im/picto_moins.gif";
		$(id).style.display = "none";
	}	
}

var Mouse_X = null;
var Mouse_Y = null;

function WhereMouse( e ){
  var DocRef;    // Variable pour IE uniquement

  // L'événement est passée à la fonction
  // donc tous sauf IE…
  if( e){                     // Dans ce cas on obtient directement la position dans la page
    Mouse_X = e.pageX;
    Mouse_Y = e.pageY;
  }
  else{                      // Dans ce cas on obtient la position relative à la fenêtre d'affichage
    Mouse_X = event.clientX;
    Mouse_Y = event.clientY;

    //-- Il faut traiter le CAS des DOCTYPE sous IE
    if( document.documentElement && document.documentElement.clientWidth) // Donc DOCTYPE
      DocRef = document.documentElement;   // Dans ce cas c'est documentElement qui est réfèrence
    else
      DocRef = document.body;                    // Dans ce cas c'est body qui est réfèrence

    //-- On rajoute la position liée aux ScrollBars
    Mouse_X += DocRef.scrollLeft;
    Mouse_Y += DocRef.scrollTop;
  }
}

function member_mouseover(e)
{
	var chaine = this.id;
	var tableau=chaine.split("_");

	var divs = $('member_text').getElementsByTagName('div');
	for (var i = 0; i < divs.length; i++)
	{
		divs[i].style.display = "none";
	}
	$("member_text_"+tableau[1]).style.display = "";
	
	WhereMouse(e);
	$('member_name_contain').style.top = (Mouse_Y - 40)+"px";
	$('member_name_contain').style.left = (Mouse_X - 35)+"px";
	$('member_name_contain').style.display = "";
	$('member_name_contain_text').innerHTML = "<a href='./index.php?section=/site/member_detail&id="+tableau[1]+"' style='color:#000; text-decoration:none;'>"+tableau[0]+"</a>";
	
	//alert(this.name+" "+this.id);
	//alert(Mouse_X+" "+Mouse_Y);
}

function membres_list_over(obj)
{
	obj.style.backgroundColor = "#1bbea9";
	obj.style.color = "#FFFFFF";
}

function membres_list_out(obj)
{
	obj.style.backgroundColor = "#ffffff";
	obj.style.color = "#345b6a";
}


/******** fonctions d'affichage de popup sur foond gris ********/

var dialogBoxCurrent = 0;

function initAffDialogBox()
{
        $('bg_dialog_contain').innerHTML = "";

        var arrayPageSize = getPageSize();
        var height = arrayPageSize[1];
        var width = arrayPageSize[0];
        var margin_left = (width / 2) - 300;

        margin_left = parseInt(margin_left);

        document.getElementById('bg_overlay').style.height = height+"px";
        document.getElementById('bg_overlay').style.width = width+"px";

        //margin_left = margin_left - ($('bg_dialog').offsetWidth / 2);

        $('bg_dialog').style.marginLeft = margin_left+"px";

        window.scrollTo(0,0);
}

var positionDialogBox = "closed";

function affDialogBox(url)
{
        Effect.Appear('bg_overlay', { duration: 0.5, from: 0.0, to: 0.7, queue: 'end', scope:'dialogbox', limit:1, afterFinish:function() { $('bg_dialog').style.display = "";}, beforeStart:function() { initAffDialogBox(); ajaxGET(url, 'bg_dialog_contain'); positionDialogBox = "open"; } } );
}

function hideDialogBox()
{
        Effect.Fade('bg_overlay', { duration: 0.5, queue: 'end', scope:'dialogbox', limit:1, beforeStart:function() {$('bg_dialog').style.display = "none"; $('bg_dialog_contain').innerHTML = ""; }, afterFinish:function() { positionDialogBox = "closed"; } });
}

function getPageSize(){

        var xScroll, yScroll;

        if (window.innerHeight && window.scrollMaxY) {
                xScroll = document.body.scrollWidth;
                yScroll = window.innerHeight + window.scrollMaxY;
        } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
                xScroll = document.body.scrollWidth;
                yScroll = document.body.scrollHeight;
        } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
                xScroll = document.body.offsetWidth;
                yScroll = document.body.offsetHeight;
        }

        var windowWidth, windowHeight;
        if (self.innerHeight) { // all except Explorer
                windowWidth = self.innerWidth;
                windowHeight = self.innerHeight;
        } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
                windowWidth = document.documentElement.clientWidth;
                windowHeight = document.documentElement.clientHeight;
        } else if (document.body) { // other Explorers
                windowWidth = document.body.clientWidth;
                windowHeight = document.body.clientHeight;
        }

        // for small pages with total height less then height of the viewport
        if(yScroll < windowHeight){
                pageHeight = windowHeight;
        } else {
                pageHeight = yScroll;
        }

        // for small pages with total width less then width of the viewport
        if(xScroll < windowWidth){
                pageWidth = windowWidth;
        } else {
                pageWidth = xScroll;
        }

        arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight)
        return arrayPageSize;
}

/****/




