function hideDate(id){
	div = document.getElementById("calendrier"+id);
	div.style.display = 'none';
	
}

function viewDate(id){
	
	for(i=0;i<dateAgenda.length;i++){
		hideDate(dateAgenda[i])
	}
	div = document.getElementById("calendrier"+id);
	div.style.display = 'block';

}


function hideOrga(id){
	div = document.getElementById("orga_"+id);
	div.style.display = 'none';
	
}

function viewOrga(id){
	for(i=0;i<organisations.length;i++){
		hideOrga(organisations[i])
	}
	div = document.getElementById("orga_"+id);
	div.style.display = 'block';
}

function hideElement(id){
	div = document.getElementById(id);
	div.style.display = 'none';
	
}

alpha = Array();
alpha.push('a')
alpha.push('b')
alpha.push('c')
alpha.push('d')
alpha.push('e')
alpha.push('f')
alpha.push('g')
alpha.push('h')
alpha.push('i')
alpha.push('j')
alpha.push('k')
alpha.push('l')
alpha.push('m')
alpha.push('n')
alpha.push('o')
alpha.push('p')
alpha.push('q')
alpha.push('r')
alpha.push('s')
alpha.push('t')
alpha.push('u')
alpha.push('v')
alpha.push('w')
alpha.push('x')
alpha.push('y')
alpha.push('z')

function masqueregion()
{
	for(i=0;i<alpha.length;i++){
		elt = document.getElementById('region_'+alpha[i]);
		elt.style.display = 'none';
		//elt.style.width = "1px";
		//elt.style.height = "1px";
		
		elt = document.getElementById('label_'+alpha[i]);
		SetDiv('label_'+alpha[i],'<a href="#">'+alpha[i].toUpperCase()+"</a>")
		
	}
	

}

function afficheregion(id){
	masqueLabel();
	elt = document.getElementById('label_'+id);
	elt.style.backgroundColor='#007C20';
	elt.style.color='#FFF';
	a = elt.getElementsByTagName('a');
	a[0].style.color='#FFF';
	c = document.getElementById('region_'+id);
	c.checked = true;

}

function masqueLabel(){
	for(i=0;i<alpha.length;i++){
		elt = document.getElementById('label_'+alpha[i]);
		elt.style.backgroundColor='#FFF';
		elt.style.color='#333333';
		a = elt.getElementsByTagName('a');
		a[0].style.color='#000';
		c = document.getElementById('region_'+alpha[i]);
		c.checked = false;
	}	
}


function showpara(id){
	paraselect = null;
	for(i=1; i<=paragraphe; i++){
		hidepara(i)
		aparastyleoff(i)
	}
		elt = document.getElementById('paragraphe_'+id);
		elt.style.display = 'block';
		elt = document.getElementById('apara_'+id);
		elt.className = 'on';	
		paraselect = id;
		window.location.hash='para_'+id;
}
function hidepara(id){
		elt = document.getElementById('paragraphe_'+id);
		elt.style.display = 'none';	
}
function aparastyleoff(id){
		if(id!=paraselect){
			elt = document.getElementById('apara_'+id);
			elt.className = '';				
		}
		
}
function aparastyleon(id){
		elt = document.getElementById('apara_'+id);
		elt.className = 'on';		
}




function affichejeux(elt,div){
	x = findPosX( elt) + 210;
	y = findPosY( elt);
	SetPosition(div,x,y)
	texte = document.getElementById(div).getElementsByTagName('a')[0].innerHTML;
	document.getElementById(div).style.display = 'block';
}

function affichejeuxh(elt,div){
	x = findPosX( elt) + 100;
	y = findPosY( elt);
	SetPosition(div,x,y)
	texte = document.getElementById(div).getElementsByTagName('a')[0].innerHTML;
	document.getElementById(div).style.display = 'block';
}
function masquejeux(div){
	elt = document.getElementById(div);
	elt.style.display = 'none';
}
function masqueannee(id){
	elt = document.getElementById(id);
	elt.style.display = 'none';
}


function SetPosition(id,x,y){
	elt = document.getElementById(id);
	elt.style.display = 'block';
	elt.style.position = "absolute";
	elt.style.left = x+'px';
	elt.style.top = y+'px';
	//alert(elt.style.left)
}
function findPosX(obj)
  {
    var curleft = 0;
    if(obj.offsetParent)
        while(1) 
        {
          curleft += obj.offsetLeft;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.x)
        curleft += obj.x;
    return curleft;
  }

  function findPosY(obj)
  {
    var curtop = 0;
    if(obj.offsetParent)
        while(1)
        {
          curtop += obj.offsetTop;
          if(!obj.offsetParent)
            break;
          obj = obj.offsetParent;
        }
    else if(obj.y)
        curtop += obj.y;
    return curtop;
  }

var ns4 = (document.layers)? true:false;         //NS 4
var ie4 = (document.all)? true:false;         //IE 4
var dom = (document.getElementById)? true:false;   //NS 6 ou IE 5

function SetDiv(ID,Content) {
	if (dom) {
		document.getElementById(ID).innerHTML = Content;
		return;
	}
	if (ie4) {
		document.all[ID].innerHTML = Content;
		return;
	}
	if (ns4) {
	  with (eval('document.'+ID+'.document')) {
		 open();
		 write(Content);
		 close();
	 }
	 return;
	}
}


function show(img,txt){

	MM_swapImage('fullimage','',img,1);
	writetoLyr('legendeimage',txt);

}

function writetoLyr(name, message) {
	document.getElementById(name).innerHTML = message;
	/*
    if (document.layers) {
        document.layers[name].document.close();
        document.layers[name].document.write(message);
        document.layers[name].document.close();
    } else {
        if (document.all) {
            eval("document.all." + name + ".innerHTML='" + message + "'");
        } else {
            document.getElementById(name).innerHTML = message;
        }
    }
	*/
}